// 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, CloudflarePaginatedProtocol, type CloudflareOpError, type CloudflareOpContext, } from "../protocol.ts"; import { cloudflarePaginate, ResultInfo } from "../pagination.ts"; import { CloudflareError, CloudflareRateLimited } from "../errors.ts"; import * as Retry from "../retry.ts"; export type { CloudflareOpError, CloudflareOpContext }; /** Fallback camelCase→wire mapping for opaque content (mined from the distilled SDK). */ const KEY_DICTIONARY: Record> = { contentType: "content_type", originTraffic: "origin_traffic", perPage: "per_page", resultInfo: "result_info", totalCount: "total_count", }; export type CreateRequestActionMode = | "simulate" | "ban" | "challenge" | "js_challenge" | "managed_challenge"; export const CreateRequestActionMode = /*@__PURE__*/ S.String; export interface CreateRequestActionResponse { /** The response body to return. The value must conform to the configured content type. */ body?: string; /** The content type of the body. Must be one of the following: `text/plain`, `text/xml`, or `application/json`. */ contentType?: string; } export const CreateRequestActionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ body: S.optional(S.String), contentType: S.optional(S.String.pipe(T.Body("content_type"))), }), ).annotate({ identifier: "CreateRequestActionResponse", }) as any as S.Schema; export interface CreateRequestAction { /** The action to perform. */ mode?: CreateRequestActionMode | (string & {}); /** A custom content type and reponse to return when the threshold is exceeded. The custom response configured in this object will override the custom error for the zone. This object is optional. */ response?: CreateRequestActionResponse; /** The time in seconds during which Cloudflare will perform the mitigation action. Must be an integer value greater than or equal to the period. */ timeout?: number; } export const CreateRequestAction = /*@__PURE__*/ S.suspend(() => S.Struct({ mode: S.optional(CreateRequestActionMode), response: S.optional(CreateRequestActionResponse), timeout: S.optional(S.Number), }), ).annotate({ identifier: "CreateRequestAction", }) as any as S.Schema; export type CreateRequestMatchHeadersItemOp = "eq" | "ne"; export const CreateRequestMatchHeadersItemOp = /*@__PURE__*/ S.String; export interface CreateRequestMatchHeadersItem { /** The name of the response header to match. */ name?: string; /** The operator used when matching: `eq` means "equal" and `ne` means "not equal". */ op?: CreateRequestMatchHeadersItemOp | (string & {}); /** The value of the response header, which must match exactly. */ value?: string; } export const CreateRequestMatchHeadersItem = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.String), op: S.optional(CreateRequestMatchHeadersItemOp), value: S.optional(S.String), }), ).annotate({ identifier: "CreateRequestMatchHeadersItem", }) as any as S.Schema; export type CreateRequestMatchHeadersList = Array; export const CreateRequestMatchHeadersList = /*@__PURE__*/ S.Array( CreateRequestMatchHeadersItem, ) as any as S.Schema; export type CreateRequestMatchRequestMethodsItem = | "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "_ALL_"; export const CreateRequestMatchRequestMethodsItem = /*@__PURE__*/ S.String; export type CreateRequestMatchRequestMethodsList = Array< CreateRequestMatchRequestMethodsItem | (string & {}) >; export const CreateRequestMatchRequestMethodsList = /*@__PURE__*/ S.Array( CreateRequestMatchRequestMethodsItem, ) as any as S.Schema; export type CreateRequestMatchRequestSchemesList = Array; export const CreateRequestMatchRequestSchemesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface CreateRequestMatchRequest { /** The HTTP methods to match. You can specify a subset (for example, `['POST','PUT']`) or all methods (`['_ALL_']`). This field is optional when creating a rate limit. */ methods?: CreateRequestMatchRequestMethodsList; /** The HTTP schemes to match. You can specify one scheme (`['HTTPS']`), both schemes (`['HTTP','HTTPS']`), or all schemes (`['_ALL_']`). This field is optional. */ schemes?: CreateRequestMatchRequestSchemesList; /** The URL pattern to match, composed of a host and a path such as `example.org/path*`. Normalization is applied before the pattern is matched. `*` wildcards are expanded to match applicable traffic. Query strings are not matched. Set the value to `*` to match all traffic to your zone. */ url?: string; } export const CreateRequestMatchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ methods: S.optional(CreateRequestMatchRequestMethodsList), schemes: S.optional(CreateRequestMatchRequestSchemesList), url: S.optional(S.String), }), ).annotate({ identifier: "CreateRequestMatchRequest", }) as any as S.Schema; export interface CreateRequestMatchResponse { /** When true, only the uncached traffic served from your origin servers will count towards rate limiting. In this case, any cached traffic served by Cloudflare will not count towards rate limiting. This field is optional. */ originTraffic?: boolean; } export const CreateRequestMatchResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ originTraffic: S.optional(S.Boolean.pipe(T.Body("origin_traffic"))), }), ).annotate({ identifier: "CreateRequestMatchResponse", }) as any as S.Schema; export interface CreateRequestMatch { headers?: CreateRequestMatchHeadersList; request?: CreateRequestMatchRequest; response?: CreateRequestMatchResponse; } export const CreateRequestMatch = /*@__PURE__*/ S.suspend(() => S.Struct({ headers: S.optional(CreateRequestMatchHeadersList), request: S.optional(CreateRequestMatchRequest), response: S.optional(CreateRequestMatchResponse), }), ).annotate({ identifier: "CreateRequestMatch", }) as any as S.Schema; export interface CreateRateLimitRequest { /** Defines an identifier. */ zoneId: string; /** The action to perform when the threshold of matched traffic within the configured period is exceeded. */ action: CreateRequestAction; /** Determines which traffic the rate limit counts towards the threshold. */ match: CreateRequestMatch; /** The time in seconds (an integer value) to count matching traffic. If the count exceeds the configured threshold within this period, Cloudflare will perform the configured action. */ period: number; /** The threshold that will trigger the configured mitigation action. Configure this value along with the `period` property to establish a threshold per period. */ threshold: number; } export const CreateRateLimitRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), action: CreateRequestAction, match: CreateRequestMatch, period: S.Number, threshold: S.Number, }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/rate_limits", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateRateLimitRequest", }) as any as S.Schema; export type CreateResponseActionMode = | "simulate" | "ban" | "challenge" | "js_challenge" | "managed_challenge"; export const CreateResponseActionMode = /*@__PURE__*/ S.String; export interface CreateResponseActionResponse { /** The response body to return. The value must conform to the configured content type. */ body?: string | null; /** The content type of the body. Must be one of the following: `text/plain`, `text/xml`, or `application/json`. */ contentType?: string | null; } export const CreateResponseActionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ body: S.optional(S.NullOr(S.String)), contentType: S.optional(S.NullOr(S.String).pipe(T.Body("content_type"))), }), ).annotate({ identifier: "CreateResponseActionResponse", }) as any as S.Schema; export interface CreateResponseAction { /** The action to perform. */ mode?: CreateResponseActionMode | null; /** A custom content type and reponse to return when the threshold is exceeded. The custom response configured in this object will override the custom error for the zone. This object is optional. */ response?: CreateResponseActionResponse | null; /** The time in seconds during which Cloudflare will perform the mitigation action. Must be an integer value greater than or equal to the period. */ timeout?: number | null; } export const CreateResponseAction = /*@__PURE__*/ S.suspend(() => S.Struct({ mode: S.optional(S.NullOr(CreateResponseActionMode)), response: S.optional(S.NullOr(CreateResponseActionResponse)), timeout: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "CreateResponseAction", }) as any as S.Schema; export type CreateResponseBypassItemName = "url"; export const CreateResponseBypassItemName = /*@__PURE__*/ S.String; export interface CreateResponseBypassItem { name?: CreateResponseBypassItemName | null; /** The URL to bypass. */ value?: string | null; } export const CreateResponseBypassItem = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.NullOr(CreateResponseBypassItemName)), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "CreateResponseBypassItem", }) as any as S.Schema; export type CreateResponseBypassList = Array; export const CreateResponseBypassList = /*@__PURE__*/ S.Array( CreateResponseBypassItem, ) as any as S.Schema; export type CreateResponseMatchHeadersItemOp = "eq" | "ne"; export const CreateResponseMatchHeadersItemOp = /*@__PURE__*/ S.String; export interface CreateResponseMatchHeadersItem { /** The name of the response header to match. */ name?: string | null; /** The operator used when matching: `eq` means "equal" and `ne` means "not equal". */ op?: CreateResponseMatchHeadersItemOp | null; /** The value of the response header, which must match exactly. */ value?: string | null; } export const CreateResponseMatchHeadersItem = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.NullOr(S.String)), op: S.optional(S.NullOr(CreateResponseMatchHeadersItemOp)), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "CreateResponseMatchHeadersItem", }) as any as S.Schema; export type CreateResponseMatchHeadersList = Array; export const CreateResponseMatchHeadersList = /*@__PURE__*/ S.Array( CreateResponseMatchHeadersItem, ) as any as S.Schema; export type CreateResponseMatchRequestMethodsItem = | "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "_ALL_"; export const CreateResponseMatchRequestMethodsItem = /*@__PURE__*/ S.String; export type CreateResponseMatchRequestMethodsList = Array; export const CreateResponseMatchRequestMethodsList = /*@__PURE__*/ S.Array( CreateResponseMatchRequestMethodsItem, ) as any as S.Schema; export type CreateResponseMatchRequestSchemesList = Array; export const CreateResponseMatchRequestSchemesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface CreateResponseMatchRequest { /** The HTTP methods to match. You can specify a subset (for example, `['POST','PUT']`) or all methods (`['_ALL_']`). This field is optional when creating a rate limit. */ methods?: CreateResponseMatchRequestMethodsList | null; /** The HTTP schemes to match. You can specify one scheme (`['HTTPS']`), both schemes (`['HTTP','HTTPS']`), or all schemes (`['_ALL_']`). This field is optional. */ schemes?: CreateResponseMatchRequestSchemesList | null; /** The URL pattern to match, composed of a host and a path such as `example.org/path*`. Normalization is applied before the pattern is matched. `*` wildcards are expanded to match applicable traffic. Query strings are not matched. Set the value to `*` to match all traffic to your zone. */ url?: string | null; } export const CreateResponseMatchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ methods: S.optional(S.NullOr(CreateResponseMatchRequestMethodsList)), schemes: S.optional(S.NullOr(CreateResponseMatchRequestSchemesList)), url: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "CreateResponseMatchRequest", }) as any as S.Schema; export interface CreateResponseMatchResponse { /** When true, only the uncached traffic served from your origin servers will count towards rate limiting. In this case, any cached traffic served by Cloudflare will not count towards rate limiting. This field is optional. */ originTraffic?: boolean | null; } export const CreateResponseMatchResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ originTraffic: S.optional( S.NullOr(S.Boolean).pipe(T.Body("origin_traffic")), ), }), ).annotate({ identifier: "CreateResponseMatchResponse", }) as any as S.Schema; export interface CreateResponseMatch { headers?: CreateResponseMatchHeadersList | null; request?: CreateResponseMatchRequest | null; response?: CreateResponseMatchResponse | null; } export const CreateResponseMatch = /*@__PURE__*/ S.suspend(() => S.Struct({ headers: S.optional(S.NullOr(CreateResponseMatchHeadersList)), request: S.optional(S.NullOr(CreateResponseMatchRequest)), response: S.optional(S.NullOr(CreateResponseMatchResponse)), }), ).annotate({ identifier: "CreateResponseMatch", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateRateLimitResponse { /** The unique identifier of the rate limit. */ id?: string | null; /** The action to perform when the threshold of matched traffic within the configured period is exceeded. */ action?: CreateResponseAction | null; /** Criteria specifying when the current rate limit should be bypassed. You can specify that the rate limit should not apply to one or more URLs. */ bypass?: CreateResponseBypassList | null; /** An informative summary of the rule. This value is sanitized and any tags will be removed. */ description?: string | null; /** When true, indicates that the rate limit is currently disabled. */ disabled?: boolean | null; /** Determines which traffic the rate limit counts towards the threshold. */ match?: CreateResponseMatch | null; /** The time in seconds (an integer value) to count matching traffic. If the count exceeds the configured threshold within this period, Cloudflare will perform the configured action. */ period?: number | null; /** The threshold that will trigger the configured mitigation action. Configure this value along with the `period` property to establish a threshold per period. */ threshold?: number | null; } export const CreateRateLimitResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(CreateResponseAction)), bypass: S.optional(S.NullOr(CreateResponseBypassList)), description: S.optional(S.NullOr(S.String)), disabled: S.optional(S.NullOr(S.Boolean)), match: S.optional(S.NullOr(CreateResponseMatch)), period: S.optional(S.NullOr(S.Number)), threshold: S.optional(S.NullOr(S.Number)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateRateLimitResponse", }) as any as S.Schema; export interface DeleteRateLimitRequest { /** Defines an identifier. */ zoneId: string; /** Defines the unique identifier of the rate limit. */ rateLimitId: string; } export const DeleteRateLimitRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), rateLimitId: S.String.pipe(T.Label("rate_limit_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/zones/{zone_id}/rate_limits/{rate_limit_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteRateLimitRequest", }) as any as S.Schema; export type DeleteResponseActionMode = | "simulate" | "ban" | "challenge" | "js_challenge" | "managed_challenge"; export const DeleteResponseActionMode = /*@__PURE__*/ S.String; export type DeleteResponseActionResponse = CreateResponseActionResponse; export const DeleteResponseActionResponse = CreateResponseActionResponse; export interface DeleteResponseAction { /** The action to perform. */ mode?: DeleteResponseActionMode | null; /** A custom content type and reponse to return when the threshold is exceeded. The custom response configured in this object will override the custom error for the zone. This object is optional. */ response?: CreateResponseActionResponse | null; /** The time in seconds during which Cloudflare will perform the mitigation action. Must be an integer value greater than or equal to the period. */ timeout?: number | null; } export const DeleteResponseAction = /*@__PURE__*/ S.suspend(() => S.Struct({ mode: S.optional(S.NullOr(DeleteResponseActionMode)), response: S.optional(S.NullOr(CreateResponseActionResponse)), timeout: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "DeleteResponseAction", }) as any as S.Schema; export type DeleteResponseBypassItemName = "url"; export const DeleteResponseBypassItemName = /*@__PURE__*/ S.String; export interface DeleteResponseBypassItem { name?: DeleteResponseBypassItemName | null; /** The URL to bypass. */ value?: string | null; } export const DeleteResponseBypassItem = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.NullOr(DeleteResponseBypassItemName)), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "DeleteResponseBypassItem", }) as any as S.Schema; export type DeleteResponseBypassList = Array; export const DeleteResponseBypassList = /*@__PURE__*/ S.Array( DeleteResponseBypassItem, ) as any as S.Schema; export type DeleteResponseMatchHeadersItemOp = "eq" | "ne"; export const DeleteResponseMatchHeadersItemOp = /*@__PURE__*/ S.String; export interface DeleteResponseMatchHeadersItem { /** The name of the response header to match. */ name?: string | null; /** The operator used when matching: `eq` means "equal" and `ne` means "not equal". */ op?: DeleteResponseMatchHeadersItemOp | null; /** The value of the response header, which must match exactly. */ value?: string | null; } export const DeleteResponseMatchHeadersItem = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.NullOr(S.String)), op: S.optional(S.NullOr(DeleteResponseMatchHeadersItemOp)), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "DeleteResponseMatchHeadersItem", }) as any as S.Schema; export type DeleteResponseMatchHeadersList = Array; export const DeleteResponseMatchHeadersList = /*@__PURE__*/ S.Array( DeleteResponseMatchHeadersItem, ) as any as S.Schema; export type DeleteResponseMatchRequestMethodsItem = | "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "_ALL_"; export const DeleteResponseMatchRequestMethodsItem = /*@__PURE__*/ S.String; export type DeleteResponseMatchRequestMethodsList = Array; export const DeleteResponseMatchRequestMethodsList = /*@__PURE__*/ S.Array( DeleteResponseMatchRequestMethodsItem, ) as any as S.Schema; export type DeleteResponseMatchRequestSchemesList = Array; export const DeleteResponseMatchRequestSchemesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface DeleteResponseMatchRequest { /** The HTTP methods to match. You can specify a subset (for example, `['POST','PUT']`) or all methods (`['_ALL_']`). This field is optional when creating a rate limit. */ methods?: DeleteResponseMatchRequestMethodsList | null; /** The HTTP schemes to match. You can specify one scheme (`['HTTPS']`), both schemes (`['HTTP','HTTPS']`), or all schemes (`['_ALL_']`). This field is optional. */ schemes?: DeleteResponseMatchRequestSchemesList | null; /** The URL pattern to match, composed of a host and a path such as `example.org/path*`. Normalization is applied before the pattern is matched. `*` wildcards are expanded to match applicable traffic. Query strings are not matched. Set the value to `*` to match all traffic to your zone. */ url?: string | null; } export const DeleteResponseMatchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ methods: S.optional(S.NullOr(DeleteResponseMatchRequestMethodsList)), schemes: S.optional(S.NullOr(DeleteResponseMatchRequestSchemesList)), url: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "DeleteResponseMatchRequest", }) as any as S.Schema; export type DeleteResponseMatchResponse = CreateResponseMatchResponse; export const DeleteResponseMatchResponse = CreateResponseMatchResponse; export interface DeleteResponseMatch { headers?: DeleteResponseMatchHeadersList | null; request?: DeleteResponseMatchRequest | null; response?: CreateResponseMatchResponse | null; } export const DeleteResponseMatch = /*@__PURE__*/ S.suspend(() => S.Struct({ headers: S.optional(S.NullOr(DeleteResponseMatchHeadersList)), request: S.optional(S.NullOr(DeleteResponseMatchRequest)), response: S.optional(S.NullOr(CreateResponseMatchResponse)), }), ).annotate({ identifier: "DeleteResponseMatch", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteRateLimitResponse { /** The unique identifier of the rate limit. */ id?: string | null; /** The action to perform when the threshold of matched traffic within the configured period is exceeded. */ action?: DeleteResponseAction | null; /** Criteria specifying when the current rate limit should be bypassed. You can specify that the rate limit should not apply to one or more URLs. */ bypass?: DeleteResponseBypassList | null; /** An informative summary of the rule. This value is sanitized and any tags will be removed. */ description?: string | null; /** When true, indicates that the rate limit is currently disabled. */ disabled?: boolean | null; /** Determines which traffic the rate limit counts towards the threshold. */ match?: DeleteResponseMatch | null; /** The time in seconds (an integer value) to count matching traffic. If the count exceeds the configured threshold within this period, Cloudflare will perform the configured action. */ period?: number | null; /** The threshold that will trigger the configured mitigation action. Configure this value along with the `period` property to establish a threshold per period. */ threshold?: number | null; } export const DeleteRateLimitResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(DeleteResponseAction)), bypass: S.optional(S.NullOr(DeleteResponseBypassList)), description: S.optional(S.NullOr(S.String)), disabled: S.optional(S.NullOr(S.Boolean)), match: S.optional(S.NullOr(DeleteResponseMatch)), period: S.optional(S.NullOr(S.Number)), threshold: S.optional(S.NullOr(S.Number)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteRateLimitResponse", }) as any as S.Schema; export type EditRequestActionMode = | "simulate" | "ban" | "challenge" | "js_challenge" | "managed_challenge"; export const EditRequestActionMode = /*@__PURE__*/ S.String; export type EditRequestActionResponse = CreateRequestActionResponse; export const EditRequestActionResponse = CreateRequestActionResponse; export interface EditRequestAction { /** The action to perform. */ mode?: EditRequestActionMode | (string & {}); /** A custom content type and reponse to return when the threshold is exceeded. The custom response configured in this object will override the custom error for the zone. This object is optional. */ response?: CreateRequestActionResponse; /** The time in seconds during which Cloudflare will perform the mitigation action. Must be an integer value greater than or equal to the period. */ timeout?: number; } export const EditRequestAction = /*@__PURE__*/ S.suspend(() => S.Struct({ mode: S.optional(EditRequestActionMode), response: S.optional(CreateRequestActionResponse), timeout: S.optional(S.Number), }), ).annotate({ identifier: "EditRequestAction", }) as any as S.Schema; export type EditRequestMatchHeadersItemOp = "eq" | "ne"; export const EditRequestMatchHeadersItemOp = /*@__PURE__*/ S.String; export interface EditRequestMatchHeadersItem { /** The name of the response header to match. */ name?: string; /** The operator used when matching: `eq` means "equal" and `ne` means "not equal". */ op?: EditRequestMatchHeadersItemOp | (string & {}); /** The value of the response header, which must match exactly. */ value?: string; } export const EditRequestMatchHeadersItem = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.String), op: S.optional(EditRequestMatchHeadersItemOp), value: S.optional(S.String), }), ).annotate({ identifier: "EditRequestMatchHeadersItem", }) as any as S.Schema; export type EditRequestMatchHeadersList = Array; export const EditRequestMatchHeadersList = /*@__PURE__*/ S.Array( EditRequestMatchHeadersItem, ) as any as S.Schema; export type EditRequestMatchRequestMethodsItem = | "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "_ALL_"; export const EditRequestMatchRequestMethodsItem = /*@__PURE__*/ S.String; export type EditRequestMatchRequestMethodsList = Array< EditRequestMatchRequestMethodsItem | (string & {}) >; export const EditRequestMatchRequestMethodsList = /*@__PURE__*/ S.Array( EditRequestMatchRequestMethodsItem, ) as any as S.Schema; export type EditRequestMatchRequestSchemesList = Array; export const EditRequestMatchRequestSchemesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface EditRequestMatchRequest { /** The HTTP methods to match. You can specify a subset (for example, `['POST','PUT']`) or all methods (`['_ALL_']`). This field is optional when creating a rate limit. */ methods?: EditRequestMatchRequestMethodsList; /** The HTTP schemes to match. You can specify one scheme (`['HTTPS']`), both schemes (`['HTTP','HTTPS']`), or all schemes (`['_ALL_']`). This field is optional. */ schemes?: EditRequestMatchRequestSchemesList; /** The URL pattern to match, composed of a host and a path such as `example.org/path*`. Normalization is applied before the pattern is matched. `*` wildcards are expanded to match applicable traffic. Query strings are not matched. Set the value to `*` to match all traffic to your zone. */ url?: string; } export const EditRequestMatchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ methods: S.optional(EditRequestMatchRequestMethodsList), schemes: S.optional(EditRequestMatchRequestSchemesList), url: S.optional(S.String), }), ).annotate({ identifier: "EditRequestMatchRequest", }) as any as S.Schema; export type EditRequestMatchResponse = CreateRequestMatchResponse; export const EditRequestMatchResponse = CreateRequestMatchResponse; export interface EditRequestMatch { headers?: EditRequestMatchHeadersList; request?: EditRequestMatchRequest; response?: CreateRequestMatchResponse; } export const EditRequestMatch = /*@__PURE__*/ S.suspend(() => S.Struct({ headers: S.optional(EditRequestMatchHeadersList), request: S.optional(EditRequestMatchRequest), response: S.optional(CreateRequestMatchResponse), }), ).annotate({ identifier: "EditRequestMatch", }) as any as S.Schema; export interface EditRateLimitRequest { /** Defines an identifier. */ zoneId: string; /** Defines the unique identifier of the rate limit. */ rateLimitId: string; /** The action to perform when the threshold of matched traffic within the configured period is exceeded. */ action: EditRequestAction; /** Determines which traffic the rate limit counts towards the threshold. */ match: EditRequestMatch; /** The time in seconds (an integer value) to count matching traffic. If the count exceeds the configured threshold within this period, Cloudflare will perform the configured action. */ period: number; /** The threshold that will trigger the configured mitigation action. Configure this value along with the `period` property to establish a threshold per period. */ threshold: number; } export const EditRateLimitRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), rateLimitId: S.String.pipe(T.Label("rate_limit_id")), action: EditRequestAction, match: EditRequestMatch, period: S.Number, threshold: S.Number, }) .pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/rate_limits/{rate_limit_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "EditRateLimitRequest", }) as any as S.Schema; export type EditResponseActionMode = | "simulate" | "ban" | "challenge" | "js_challenge" | "managed_challenge"; export const EditResponseActionMode = /*@__PURE__*/ S.String; export type EditResponseActionResponse = CreateResponseActionResponse; export const EditResponseActionResponse = CreateResponseActionResponse; export interface EditResponseAction { /** The action to perform. */ mode?: EditResponseActionMode | null; /** A custom content type and reponse to return when the threshold is exceeded. The custom response configured in this object will override the custom error for the zone. This object is optional. */ response?: CreateResponseActionResponse | null; /** The time in seconds during which Cloudflare will perform the mitigation action. Must be an integer value greater than or equal to the period. */ timeout?: number | null; } export const EditResponseAction = /*@__PURE__*/ S.suspend(() => S.Struct({ mode: S.optional(S.NullOr(EditResponseActionMode)), response: S.optional(S.NullOr(CreateResponseActionResponse)), timeout: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "EditResponseAction", }) as any as S.Schema; export type EditResponseBypassItemName = "url"; export const EditResponseBypassItemName = /*@__PURE__*/ S.String; export interface EditResponseBypassItem { name?: EditResponseBypassItemName | null; /** The URL to bypass. */ value?: string | null; } export const EditResponseBypassItem = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.NullOr(EditResponseBypassItemName)), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "EditResponseBypassItem", }) as any as S.Schema; export type EditResponseBypassList = Array; export const EditResponseBypassList = /*@__PURE__*/ S.Array( EditResponseBypassItem, ) as any as S.Schema; export type EditResponseMatchHeadersItemOp = "eq" | "ne"; export const EditResponseMatchHeadersItemOp = /*@__PURE__*/ S.String; export interface EditResponseMatchHeadersItem { /** The name of the response header to match. */ name?: string | null; /** The operator used when matching: `eq` means "equal" and `ne` means "not equal". */ op?: EditResponseMatchHeadersItemOp | null; /** The value of the response header, which must match exactly. */ value?: string | null; } export const EditResponseMatchHeadersItem = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.NullOr(S.String)), op: S.optional(S.NullOr(EditResponseMatchHeadersItemOp)), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "EditResponseMatchHeadersItem", }) as any as S.Schema; export type EditResponseMatchHeadersList = Array; export const EditResponseMatchHeadersList = /*@__PURE__*/ S.Array( EditResponseMatchHeadersItem, ) as any as S.Schema; export type EditResponseMatchRequestMethodsItem = | "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "_ALL_"; export const EditResponseMatchRequestMethodsItem = /*@__PURE__*/ S.String; export type EditResponseMatchRequestMethodsList = Array; export const EditResponseMatchRequestMethodsList = /*@__PURE__*/ S.Array( EditResponseMatchRequestMethodsItem, ) as any as S.Schema; export type EditResponseMatchRequestSchemesList = Array; export const EditResponseMatchRequestSchemesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface EditResponseMatchRequest { /** The HTTP methods to match. You can specify a subset (for example, `['POST','PUT']`) or all methods (`['_ALL_']`). This field is optional when creating a rate limit. */ methods?: EditResponseMatchRequestMethodsList | null; /** The HTTP schemes to match. You can specify one scheme (`['HTTPS']`), both schemes (`['HTTP','HTTPS']`), or all schemes (`['_ALL_']`). This field is optional. */ schemes?: EditResponseMatchRequestSchemesList | null; /** The URL pattern to match, composed of a host and a path such as `example.org/path*`. Normalization is applied before the pattern is matched. `*` wildcards are expanded to match applicable traffic. Query strings are not matched. Set the value to `*` to match all traffic to your zone. */ url?: string | null; } export const EditResponseMatchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ methods: S.optional(S.NullOr(EditResponseMatchRequestMethodsList)), schemes: S.optional(S.NullOr(EditResponseMatchRequestSchemesList)), url: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "EditResponseMatchRequest", }) as any as S.Schema; export type EditResponseMatchResponse = CreateResponseMatchResponse; export const EditResponseMatchResponse = CreateResponseMatchResponse; export interface EditResponseMatch { headers?: EditResponseMatchHeadersList | null; request?: EditResponseMatchRequest | null; response?: CreateResponseMatchResponse | null; } export const EditResponseMatch = /*@__PURE__*/ S.suspend(() => S.Struct({ headers: S.optional(S.NullOr(EditResponseMatchHeadersList)), request: S.optional(S.NullOr(EditResponseMatchRequest)), response: S.optional(S.NullOr(CreateResponseMatchResponse)), }), ).annotate({ identifier: "EditResponseMatch", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface EditRateLimitResponse { /** The unique identifier of the rate limit. */ id?: string | null; /** The action to perform when the threshold of matched traffic within the configured period is exceeded. */ action?: EditResponseAction | null; /** Criteria specifying when the current rate limit should be bypassed. You can specify that the rate limit should not apply to one or more URLs. */ bypass?: EditResponseBypassList | null; /** An informative summary of the rule. This value is sanitized and any tags will be removed. */ description?: string | null; /** When true, indicates that the rate limit is currently disabled. */ disabled?: boolean | null; /** Determines which traffic the rate limit counts towards the threshold. */ match?: EditResponseMatch | null; /** The time in seconds (an integer value) to count matching traffic. If the count exceeds the configured threshold within this period, Cloudflare will perform the configured action. */ period?: number | null; /** The threshold that will trigger the configured mitigation action. Configure this value along with the `period` property to establish a threshold per period. */ threshold?: number | null; } export const EditRateLimitResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(EditResponseAction)), bypass: S.optional(S.NullOr(EditResponseBypassList)), description: S.optional(S.NullOr(S.String)), disabled: S.optional(S.NullOr(S.Boolean)), match: S.optional(S.NullOr(EditResponseMatch)), period: S.optional(S.NullOr(S.Number)), threshold: S.optional(S.NullOr(S.Number)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "EditRateLimitResponse", }) as any as S.Schema; export interface GetRateLimitRequest { /** Defines an identifier. */ zoneId: string; /** Defines the unique identifier of the rate limit. */ rateLimitId: string; } export const GetRateLimitRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), rateLimitId: S.String.pipe(T.Label("rate_limit_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/rate_limits/{rate_limit_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetRateLimitRequest", }) as any as S.Schema; export type GetResponseActionMode = | "simulate" | "ban" | "challenge" | "js_challenge" | "managed_challenge"; export const GetResponseActionMode = /*@__PURE__*/ S.String; export type GetResponseActionResponse = CreateResponseActionResponse; export const GetResponseActionResponse = CreateResponseActionResponse; export interface GetResponseAction { /** The action to perform. */ mode?: GetResponseActionMode | null; /** A custom content type and reponse to return when the threshold is exceeded. The custom response configured in this object will override the custom error for the zone. This object is optional. */ response?: CreateResponseActionResponse | null; /** The time in seconds during which Cloudflare will perform the mitigation action. Must be an integer value greater than or equal to the period. */ timeout?: number | null; } export const GetResponseAction = /*@__PURE__*/ S.suspend(() => S.Struct({ mode: S.optional(S.NullOr(GetResponseActionMode)), response: S.optional(S.NullOr(CreateResponseActionResponse)), timeout: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "GetResponseAction", }) as any as S.Schema; export type GetResponseBypassItemName = "url"; export const GetResponseBypassItemName = /*@__PURE__*/ S.String; export interface GetResponseBypassItem { name?: GetResponseBypassItemName | null; /** The URL to bypass. */ value?: string | null; } export const GetResponseBypassItem = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.NullOr(GetResponseBypassItemName)), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "GetResponseBypassItem", }) as any as S.Schema; export type GetResponseBypassList = Array; export const GetResponseBypassList = /*@__PURE__*/ S.Array( GetResponseBypassItem, ) as any as S.Schema; export type GetResponseMatchHeadersItemOp = "eq" | "ne"; export const GetResponseMatchHeadersItemOp = /*@__PURE__*/ S.String; export interface GetResponseMatchHeadersItem { /** The name of the response header to match. */ name?: string | null; /** The operator used when matching: `eq` means "equal" and `ne` means "not equal". */ op?: GetResponseMatchHeadersItemOp | null; /** The value of the response header, which must match exactly. */ value?: string | null; } export const GetResponseMatchHeadersItem = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.NullOr(S.String)), op: S.optional(S.NullOr(GetResponseMatchHeadersItemOp)), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "GetResponseMatchHeadersItem", }) as any as S.Schema; export type GetResponseMatchHeadersList = Array; export const GetResponseMatchHeadersList = /*@__PURE__*/ S.Array( GetResponseMatchHeadersItem, ) as any as S.Schema; export type GetResponseMatchRequestMethodsItem = | "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "_ALL_"; export const GetResponseMatchRequestMethodsItem = /*@__PURE__*/ S.String; export type GetResponseMatchRequestMethodsList = Array; export const GetResponseMatchRequestMethodsList = /*@__PURE__*/ S.Array( GetResponseMatchRequestMethodsItem, ) as any as S.Schema; export type GetResponseMatchRequestSchemesList = Array; export const GetResponseMatchRequestSchemesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface GetResponseMatchRequest { /** The HTTP methods to match. You can specify a subset (for example, `['POST','PUT']`) or all methods (`['_ALL_']`). This field is optional when creating a rate limit. */ methods?: GetResponseMatchRequestMethodsList | null; /** The HTTP schemes to match. You can specify one scheme (`['HTTPS']`), both schemes (`['HTTP','HTTPS']`), or all schemes (`['_ALL_']`). This field is optional. */ schemes?: GetResponseMatchRequestSchemesList | null; /** The URL pattern to match, composed of a host and a path such as `example.org/path*`. Normalization is applied before the pattern is matched. `*` wildcards are expanded to match applicable traffic. Query strings are not matched. Set the value to `*` to match all traffic to your zone. */ url?: string | null; } export const GetResponseMatchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ methods: S.optional(S.NullOr(GetResponseMatchRequestMethodsList)), schemes: S.optional(S.NullOr(GetResponseMatchRequestSchemesList)), url: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "GetResponseMatchRequest", }) as any as S.Schema; export type GetResponseMatchResponse = CreateResponseMatchResponse; export const GetResponseMatchResponse = CreateResponseMatchResponse; export interface GetResponseMatch { headers?: GetResponseMatchHeadersList | null; request?: GetResponseMatchRequest | null; response?: CreateResponseMatchResponse | null; } export const GetResponseMatch = /*@__PURE__*/ S.suspend(() => S.Struct({ headers: S.optional(S.NullOr(GetResponseMatchHeadersList)), request: S.optional(S.NullOr(GetResponseMatchRequest)), response: S.optional(S.NullOr(CreateResponseMatchResponse)), }), ).annotate({ identifier: "GetResponseMatch", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetRateLimitResponse { /** The unique identifier of the rate limit. */ id?: string | null; /** The action to perform when the threshold of matched traffic within the configured period is exceeded. */ action?: GetResponseAction | null; /** Criteria specifying when the current rate limit should be bypassed. You can specify that the rate limit should not apply to one or more URLs. */ bypass?: GetResponseBypassList | null; /** An informative summary of the rule. This value is sanitized and any tags will be removed. */ description?: string | null; /** When true, indicates that the rate limit is currently disabled. */ disabled?: boolean | null; /** Determines which traffic the rate limit counts towards the threshold. */ match?: GetResponseMatch | null; /** The time in seconds (an integer value) to count matching traffic. If the count exceeds the configured threshold within this period, Cloudflare will perform the configured action. */ period?: number | null; /** The threshold that will trigger the configured mitigation action. Configure this value along with the `period` property to establish a threshold per period. */ threshold?: number | null; } export const GetRateLimitResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(GetResponseAction)), bypass: S.optional(S.NullOr(GetResponseBypassList)), description: S.optional(S.NullOr(S.String)), disabled: S.optional(S.NullOr(S.Boolean)), match: S.optional(S.NullOr(GetResponseMatch)), period: S.optional(S.NullOr(S.Number)), threshold: S.optional(S.NullOr(S.Number)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetRateLimitResponse", }) as any as S.Schema; export interface ListRateLimitsRequest { /** Defines an identifier. */ zoneId: string; /** Defines the page number of paginated results. */ page?: number; /** Defines the maximum number of results per page. You can only set the value to `1` or to a multiple of 5 such as `5`, `10`, `15`, or `20`. */ perPage?: number; } export const ListRateLimitsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/rate_limits", code: 200 }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListRateLimitsRequest", }) as any as S.Schema; export type ListResultItemActionMode = | "simulate" | "ban" | "challenge" | "js_challenge" | "managed_challenge"; export const ListResultItemActionMode = /*@__PURE__*/ S.String; export type ListResultItemActionResponse = CreateResponseActionResponse; export const ListResultItemActionResponse = CreateResponseActionResponse; export interface ListResultItemAction { /** The action to perform. */ mode?: ListResultItemActionMode | null; /** A custom content type and reponse to return when the threshold is exceeded. The custom response configured in this object will override the custom error for the zone. This object is optional. */ response?: CreateResponseActionResponse | null; /** The time in seconds during which Cloudflare will perform the mitigation action. Must be an integer value greater than or equal to the period. */ timeout?: number | null; } export const ListResultItemAction = /*@__PURE__*/ S.suspend(() => S.Struct({ mode: S.optional(S.NullOr(ListResultItemActionMode)), response: S.optional(S.NullOr(CreateResponseActionResponse)), timeout: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "ListResultItemAction", }) as any as S.Schema; export type ListResultItemBypassItemName = "url"; export const ListResultItemBypassItemName = /*@__PURE__*/ S.String; export interface ListResultItemBypassItem { name?: ListResultItemBypassItemName | null; /** The URL to bypass. */ value?: string | null; } export const ListResultItemBypassItem = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.NullOr(ListResultItemBypassItemName)), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "ListResultItemBypassItem", }) as any as S.Schema; export type ListResultItemBypassList = Array; export const ListResultItemBypassList = /*@__PURE__*/ S.Array( ListResultItemBypassItem, ) as any as S.Schema; export type ListResultItemMatchHeadersItemOp = "eq" | "ne"; export const ListResultItemMatchHeadersItemOp = /*@__PURE__*/ S.String; export interface ListResultItemMatchHeadersItem { /** The name of the response header to match. */ name?: string | null; /** The operator used when matching: `eq` means "equal" and `ne` means "not equal". */ op?: ListResultItemMatchHeadersItemOp | null; /** The value of the response header, which must match exactly. */ value?: string | null; } export const ListResultItemMatchHeadersItem = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.NullOr(S.String)), op: S.optional(S.NullOr(ListResultItemMatchHeadersItemOp)), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "ListResultItemMatchHeadersItem", }) as any as S.Schema; export type ListResultItemMatchHeadersList = Array; export const ListResultItemMatchHeadersList = /*@__PURE__*/ S.Array( ListResultItemMatchHeadersItem, ) as any as S.Schema; export type ListResultItemMatchRequestMethodsItem = | "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "_ALL_"; export const ListResultItemMatchRequestMethodsItem = /*@__PURE__*/ S.String; export type ListResultItemMatchRequestMethodsList = Array; export const ListResultItemMatchRequestMethodsList = /*@__PURE__*/ S.Array( ListResultItemMatchRequestMethodsItem, ) as any as S.Schema; export type ListResultItemMatchRequestSchemesList = Array; export const ListResultItemMatchRequestSchemesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface ListResultItemMatchRequest { /** The HTTP methods to match. You can specify a subset (for example, `['POST','PUT']`) or all methods (`['_ALL_']`). This field is optional when creating a rate limit. */ methods?: ListResultItemMatchRequestMethodsList | null; /** The HTTP schemes to match. You can specify one scheme (`['HTTPS']`), both schemes (`['HTTP','HTTPS']`), or all schemes (`['_ALL_']`). This field is optional. */ schemes?: ListResultItemMatchRequestSchemesList | null; /** The URL pattern to match, composed of a host and a path such as `example.org/path*`. Normalization is applied before the pattern is matched. `*` wildcards are expanded to match applicable traffic. Query strings are not matched. Set the value to `*` to match all traffic to your zone. */ url?: string | null; } export const ListResultItemMatchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ methods: S.optional(S.NullOr(ListResultItemMatchRequestMethodsList)), schemes: S.optional(S.NullOr(ListResultItemMatchRequestSchemesList)), url: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "ListResultItemMatchRequest", }) as any as S.Schema; export type ListResultItemMatchResponse = CreateResponseMatchResponse; export const ListResultItemMatchResponse = CreateResponseMatchResponse; export interface ListResultItemMatch { headers?: ListResultItemMatchHeadersList | null; request?: ListResultItemMatchRequest | null; response?: CreateResponseMatchResponse | null; } export const ListResultItemMatch = /*@__PURE__*/ S.suspend(() => S.Struct({ headers: S.optional(S.NullOr(ListResultItemMatchHeadersList)), request: S.optional(S.NullOr(ListResultItemMatchRequest)), response: S.optional(S.NullOr(CreateResponseMatchResponse)), }), ).annotate({ identifier: "ListResultItemMatch", }) as any as S.Schema; export interface ListResultItem { /** The unique identifier of the rate limit. */ id?: string | null; /** The action to perform when the threshold of matched traffic within the configured period is exceeded. */ action?: ListResultItemAction | null; /** Criteria specifying when the current rate limit should be bypassed. You can specify that the rate limit should not apply to one or more URLs. */ bypass?: ListResultItemBypassList | null; /** An informative summary of the rule. This value is sanitized and any tags will be removed. */ description?: string | null; /** When true, indicates that the rate limit is currently disabled. */ disabled?: boolean | null; /** Determines which traffic the rate limit counts towards the threshold. */ match?: ListResultItemMatch | null; /** The time in seconds (an integer value) to count matching traffic. If the count exceeds the configured threshold within this period, Cloudflare will perform the configured action. */ period?: number | null; /** The threshold that will trigger the configured mitigation action. Configure this value along with the `period` property to establish a threshold per period. */ threshold?: number | null; } export const ListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(ListResultItemAction)), bypass: S.optional(S.NullOr(ListResultItemBypassList)), description: S.optional(S.NullOr(S.String)), disabled: S.optional(S.NullOr(S.Boolean)), match: S.optional(S.NullOr(ListResultItemMatch)), period: S.optional(S.NullOr(S.Number)), threshold: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "ListResultItem" }) as any as S.Schema; export type ListResultList = Array; export const ListResultList = /*@__PURE__*/ S.Array( ListResultItem, ) as any as S.Schema; export interface ListRateLimitsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: ListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListRateLimitsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: ListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListRateLimitsResponse", }) as any as S.Schema; export type CreateRateLimitError = CloudflareOpError; /** Creates a new rate limit for a zone. Refer to the object definition for a list of required attributes. */ export const createRateLimit: API.OperationMethod< CreateRateLimitRequest, CreateRateLimitResponse, CreateRateLimitError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateRateLimitRequest, output: CreateRateLimitResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteRateLimitError = CloudflareOpError; /** Deletes an existing rate limit. */ export const deleteRateLimit: API.OperationMethod< DeleteRateLimitRequest, DeleteRateLimitResponse, DeleteRateLimitError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteRateLimitRequest, output: DeleteRateLimitResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type EditRateLimitError = CloudflareOpError; /** Updates an existing rate limit. */ export const editRateLimit: API.OperationMethod< EditRateLimitRequest, EditRateLimitResponse, EditRateLimitError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: EditRateLimitRequest, output: EditRateLimitResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetRateLimitError = CloudflareOpError; /** Fetches the details of a rate limit. */ export const getRateLimit: API.OperationMethod< GetRateLimitRequest, GetRateLimitResponse, GetRateLimitError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetRateLimitRequest, output: GetRateLimitResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListRateLimitsError = CloudflareOpError; /** Fetches the rate limits for a zone. */ export const listRateLimits: API.PaginatedOperationMethod< ListRateLimitsRequest, ListRateLimitsResponse, ListRateLimitsError, CloudflareOpContext, ListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListRateLimitsRequest, output: ListRateLimitsResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any;