UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

55 lines • 2.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ConfigResource = exports.BaseConfigResource = void 0; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../core/resource.js"); const path_1 = require("../../internal/utils/path.js"); var BaseConfigResource = /* @__PURE__ */ (() => { class BaseConfigResource extends resource_1.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((0, path_1.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((0, path_1.path) `/zones/${zone_id}/settings/google-tag-gateway/config`, options)._thenUnwrap((obj) => obj.result); } } BaseConfigResource._key = Object.freeze([ 'googleTagGateway', 'config', ]); return BaseConfigResource; })(); exports.BaseConfigResource = BaseConfigResource; class ConfigResource extends BaseConfigResource { } exports.ConfigResource = ConfigResource; //# sourceMappingURL=config.js.map