// AUTO-GENERATED by scripts/generate.ts from .generated-specs. Do not edit. import * as S from "@distilled.cloud/core/schema"; import * as API from "@distilled.cloud/core/api"; import * as T from "../traits.ts"; import { CloudflareProtocol, type CloudflareOpError, type CloudflareOpContext, } from "../protocol.ts"; import { CloudflareError, CloudflareRateLimited } from "../errors.ts"; import * as Retry from "../retry.ts"; export type { CloudflareOpError, CloudflareOpContext }; export class Forbidden extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("Forbidden", { code: S.Number, message: S.String, }), [{ status: 403 }], ) {} export interface GetConfigRequest { /** Identifier. */ zoneId: string; } export const GetConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }).pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/settings/google-tag-gateway/config", code: 200, }), ), ).annotate({ identifier: "GetConfigRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetConfigResponse { /** Enables or disables Google Tag Gateway for this zone. */ enabled: boolean; /** Specifies the endpoint path for proxying Google Tag Manager requests. Use an absolute path starting with '/', with no nested paths and alphanumeric characters only (e.g. /metrics). */ endpoint: string; /** Hides the original client IP address from Google when enabled. */ hideOriginalIp: boolean; /** Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or G-XXXXXXXXXX). */ measurementId: string; /** Set up the associated Google Tag on the zone automatically when enabled. */ setUpTag?: boolean | null; } export const GetConfigResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ enabled: S.Boolean, endpoint: S.String, hideOriginalIp: S.Boolean, measurementId: S.String, setUpTag: S.optional(S.NullOr(S.Boolean)), }), ).annotate({ identifier: "GetConfigResponse", }) as any as S.Schema; export interface PutConfigRequest { /** Identifier. */ zoneId: string; /** Enables or disables Google Tag Gateway for this zone. */ enabled: boolean; /** Specifies the endpoint path for proxying Google Tag Manager requests. Use an absolute path starting with '/', with no nested paths and alphanumeric characters only (e.g. /metrics). */ endpoint: string; /** Hides the original client IP address from Google when enabled. */ hideOriginalIp: boolean; /** Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or G-XXXXXXXXXX). */ measurementId: string; /** Set up the associated Google Tag on the zone automatically when enabled. */ setUpTag?: boolean; } export const PutConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), enabled: S.Boolean, endpoint: S.String, hideOriginalIp: S.Boolean, measurementId: S.String, setUpTag: S.optional(S.Boolean), }).pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/settings/google-tag-gateway/config", code: 200, }), ), ).annotate({ identifier: "PutConfigRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PutConfigResponse { /** Enables or disables Google Tag Gateway for this zone. */ enabled: boolean; /** Specifies the endpoint path for proxying Google Tag Manager requests. Use an absolute path starting with '/', with no nested paths and alphanumeric characters only (e.g. /metrics). */ endpoint: string; /** Hides the original client IP address from Google when enabled. */ hideOriginalIp: boolean; /** Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or G-XXXXXXXXXX). */ measurementId: string; /** Set up the associated Google Tag on the zone automatically when enabled. */ setUpTag?: boolean | null; } export const PutConfigResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ enabled: S.Boolean, endpoint: S.String, hideOriginalIp: S.Boolean, measurementId: S.String, setUpTag: S.optional(S.NullOr(S.Boolean)), }), ).annotate({ identifier: "PutConfigResponse", }) as any as S.Schema; export type GetConfigError = Forbidden | CloudflareOpError; /** Gets the Google Tag Gateway configuration for a zone. */ export const getConfig: API.OperationMethod< GetConfigRequest, GetConfigResponse, GetConfigError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetConfigRequest, output: GetConfigResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PutConfigError = Forbidden | CloudflareOpError; /** Updates the Google Tag Gateway configuration for a zone. */ export const putConfig: API.OperationMethod< PutConfigRequest, PutConfigResponse, PutConfigError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PutConfigRequest, output: PutConfigResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, }));