// 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 DeleteUrlNormalizationRequest { /** The unique ID of the zone. */ zoneId: string; } export const DeleteUrlNormalizationRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }).pipe( T.Http({ method: "DELETE", uri: "/zones/{zone_id}/url_normalization", code: 200, }), ), ).annotate({ identifier: "DeleteUrlNormalizationRequest", }) as any as S.Schema; export interface DeleteUrlNormalizationResponse {} export const DeleteUrlNormalizationResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}), ).annotate({ identifier: "DeleteUrlNormalizationResponse", }) as any as S.Schema; export interface GetUrlNormalizationRequest { /** The unique ID of the zone. */ zoneId: string; } export const GetUrlNormalizationRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }).pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/url_normalization", code: 200, }), ), ).annotate({ identifier: "GetUrlNormalizationRequest", }) as any as S.Schema; export type GetResponseScope = "incoming" | "both" | "none"; export const GetResponseScope = /*@__PURE__*/ S.String; export type GetResponseType = "cloudflare" | "rfc3986"; export const GetResponseType = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetUrlNormalizationResponse { /** The scope of the URL normalization. */ scope: GetResponseScope; /** The type of URL normalization performed by Cloudflare. */ type: GetResponseType; } export const GetUrlNormalizationResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ scope: GetResponseScope, type: GetResponseType, }), ).annotate({ identifier: "GetUrlNormalizationResponse", }) as any as S.Schema; export type UpdateRequestScope = "incoming" | "both" | "none"; export const UpdateRequestScope = /*@__PURE__*/ S.String; export type UpdateRequestType = "cloudflare" | "rfc3986"; export const UpdateRequestType = /*@__PURE__*/ S.String; export interface PutUrlNormalizationRequest { /** The unique ID of the zone. */ zoneId: string; /** The scope of the URL normalization. */ scope: UpdateRequestScope | (string & {}); /** The type of URL normalization performed by Cloudflare. */ type: UpdateRequestType | (string & {}); } export const PutUrlNormalizationRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), scope: UpdateRequestScope, type: UpdateRequestType, }).pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/url_normalization", code: 200, }), ), ).annotate({ identifier: "PutUrlNormalizationRequest", }) as any as S.Schema; export type UpdateResponseScope = "incoming" | "both" | "none"; export const UpdateResponseScope = /*@__PURE__*/ S.String; export type UpdateResponseType = "cloudflare" | "rfc3986"; export const UpdateResponseType = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PutUrlNormalizationResponse { /** The scope of the URL normalization. */ scope: UpdateResponseScope; /** The type of URL normalization performed by Cloudflare. */ type: UpdateResponseType; } export const PutUrlNormalizationResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ scope: UpdateResponseScope, type: UpdateResponseType, }), ).annotate({ identifier: "PutUrlNormalizationResponse", }) as any as S.Schema; export type DeleteUrlNormalizationError = Forbidden | CloudflareOpError; /** Deletes the URL Normalization settings. */ export const deleteUrlNormalization: API.OperationMethod< DeleteUrlNormalizationRequest, DeleteUrlNormalizationResponse, DeleteUrlNormalizationError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteUrlNormalizationRequest, output: DeleteUrlNormalizationResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetUrlNormalizationError = Forbidden | CloudflareOpError; /** Fetches the current URL Normalization settings. */ export const getUrlNormalization: API.OperationMethod< GetUrlNormalizationRequest, GetUrlNormalizationResponse, GetUrlNormalizationError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetUrlNormalizationRequest, output: GetUrlNormalizationResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PutUrlNormalizationError = Forbidden | CloudflareOpError; /** Updates the URL Normalization settings. */ export const putUrlNormalization: API.OperationMethod< PutUrlNormalizationRequest, PutUrlNormalizationResponse, PutUrlNormalizationError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PutUrlNormalizationRequest, output: PutUrlNormalizationResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, }));