UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

50 lines • 1.79 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 BaseConfigResource = /* @__PURE__ */ (() => { class BaseConfigResource extends APIResource { /** * Updates the Google Tag Gateway configuration for a zone. * * @example * ```ts * const config = await client.googleTagGateway.config.update({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * enabled: true, * endpoint: '/metrics', * hideOriginalIp: true, * measurementId: 'GTM-P2F3N47Q', * }); * ``` */ update(params, options) { const { zone_id, ...body } = params; return this._client.put(path `/zones/${zone_id}/settings/google-tag-gateway/config`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * Gets the Google Tag Gateway configuration for a zone. * * @example * ```ts * const config = await client.googleTagGateway.config.get({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * }); * ``` */ get(params, options) { const { zone_id } = params; return this._client.get(path `/zones/${zone_id}/settings/google-tag-gateway/config`, options)._thenUnwrap((obj) => obj.result); } } BaseConfigResource._key = Object.freeze([ 'googleTagGateway', 'config', ]); return BaseConfigResource; })(); export class ConfigResource extends BaseConfigResource { } //# sourceMappingURL=config.mjs.map