UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

57 lines • 2.09 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../core/resource.mjs"; import { path } from "../../internal/utils/path.mjs"; export var BaseConfigurations = /* @__PURE__ */ (() => { class BaseConfigurations extends APIResource { /** * Replaces the zone's authentication identifier characteristics used to identify * distinct API sessions. * * @example * ```ts * const configuration = * await client.apiGateway.configurations.update({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * auth_id_characteristics: [ * { name: 'authorization', type: 'header' }, * ], * }); * ``` */ update(params, options) { const { zone_id, normalize, ...body } = params; return this._client.put(path `/zones/${zone_id}/api_gateway/configuration`, { query: { normalize }, body, ...options, })._thenUnwrap((obj) => obj.result); } /** * Returns the authentication identifier characteristics configured for the zone. * Header, cookie, or JWT claim values identify distinct API sessions. * * @example * ```ts * const configuration = * await client.apiGateway.configurations.get({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * }); * ``` */ get(params, options) { const { zone_id, ...query } = params; return this._client.get(path `/zones/${zone_id}/api_gateway/configuration`, { query, ...options, })._thenUnwrap((obj) => obj.result); } } BaseConfigurations._key = Object.freeze([ 'apiGateway', 'configurations', ]); return BaseConfigurations; })(); export class Configurations extends BaseConfigurations { } //# sourceMappingURL=configurations.mjs.map