// 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> = { dnsRecords: "dns_records", nsName: "ns_name", nsSet: "ns_set", zoneTag: "zone_tag", }; export interface CreateTenantCustomNameserverRequest { /** Tenant identifier tag. */ tenantTag: string; /** The FQDN of the name server. */ nsName: string; /** The number of the set that this name server belongs to. */ nsSet?: number; } export const CreateTenantCustomNameserverRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ tenantTag: S.String.pipe(T.Label("tenant_tag")), nsName: S.String.pipe(T.Body("ns_name")), nsSet: S.optional(S.Number.pipe(T.Body("ns_set"))), }) .pipe( T.Http({ method: "POST", uri: "/tenants/{tenant_tag}/custom_ns", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateTenantCustomNameserverRequest", }) as any as S.Schema; export type CreateResponseDnsRecordsItemType = "A" | "AAAA"; export const CreateResponseDnsRecordsItemType = /*@__PURE__*/ S.String; export interface CreateResponseDnsRecordsItem { /** DNS record type. */ type?: CreateResponseDnsRecordsItemType | null; /** DNS record contents (an IPv4 or IPv6 address). */ value?: string | null; } export const CreateResponseDnsRecordsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ type: S.optional(S.NullOr(CreateResponseDnsRecordsItemType)), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "CreateResponseDnsRecordsItem", }) as any as S.Schema; export type CreateResponseDnsRecordsList = Array; export const CreateResponseDnsRecordsList = /*@__PURE__*/ S.Array( CreateResponseDnsRecordsItem, ) as any as S.Schema; export type CreateResponseStatus = "moved" | "pending" | "verified"; export const CreateResponseStatus = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateTenantCustomNameserverResponse { /** A and AAAA records associated with the nameserver. */ dnsRecords: CreateResponseDnsRecordsList; /** The FQDN of the name server. */ nsName: string; /** Verification status of the nameserver. */ status: CreateResponseStatus; /** Identifier. */ zoneTag: string; /** The number of the set that this name server belongs to. */ nsSet?: number | null; } export const CreateTenantCustomNameserverResponse = /*@__PURE__*/ S.suspend( () => S.Struct({ dnsRecords: CreateResponseDnsRecordsList.pipe(T.Body("dns_records")), nsName: S.String.pipe(T.Body("ns_name")), status: CreateResponseStatus, zoneTag: S.String.pipe(T.Body("zone_tag")), nsSet: S.optional(S.NullOr(S.Number).pipe(T.Body("ns_set"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateTenantCustomNameserverResponse", }) as any as S.Schema; export interface DeleteTenantCustomNameserverRequest { /** Tenant identifier tag. */ tenantTag: string; /** The FQDN of the name server. */ customNsId: string; } export const DeleteTenantCustomNameserverRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ tenantTag: S.String.pipe(T.Label("tenant_tag")), customNsId: S.String.pipe(T.Label("custom_ns_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/tenants/{tenant_tag}/custom_ns/{custom_ns_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteTenantCustomNameserverRequest", }) as any as S.Schema; export type DeleteResultList = Array; export const DeleteResultList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface DeleteTenantCustomNameserverResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: DeleteResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const DeleteTenantCustomNameserverResponse = /*@__PURE__*/ S.suspend( () => S.Struct({ result: DeleteResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteTenantCustomNameserverResponse", }) as any as S.Schema; export interface GetTenantCustomNameserverRequest { /** Tenant identifier tag. */ tenantTag: string; } export const GetTenantCustomNameserverRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ tenantTag: S.String.pipe(T.Label("tenant_tag")), }) .pipe( T.Http({ method: "GET", uri: "/tenants/{tenant_tag}/custom_ns", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetTenantCustomNameserverRequest", }) as any as S.Schema; export type GetResultItemDnsRecordsItemType = "A" | "AAAA"; export const GetResultItemDnsRecordsItemType = /*@__PURE__*/ S.String; export interface GetResultItemDnsRecordsItem { /** DNS record type. */ type?: GetResultItemDnsRecordsItemType | null; /** DNS record contents (an IPv4 or IPv6 address). */ value?: string | null; } export const GetResultItemDnsRecordsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ type: S.optional(S.NullOr(GetResultItemDnsRecordsItemType)), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "GetResultItemDnsRecordsItem", }) as any as S.Schema; export type GetResultItemDnsRecordsList = Array; export const GetResultItemDnsRecordsList = /*@__PURE__*/ S.Array( GetResultItemDnsRecordsItem, ) as any as S.Schema; export type GetResultItemStatus = "moved" | "pending" | "verified"; export const GetResultItemStatus = /*@__PURE__*/ S.String; export interface GetResultItem { /** A and AAAA records associated with the nameserver. */ dnsRecords: GetResultItemDnsRecordsList; /** The FQDN of the name server. */ nsName: string; /** Verification status of the nameserver. */ status: GetResultItemStatus; /** Identifier. */ zoneTag: string; /** The number of the set that this name server belongs to. */ nsSet?: number | null; } export const GetResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ dnsRecords: GetResultItemDnsRecordsList.pipe(T.Body("dns_records")), nsName: S.String.pipe(T.Body("ns_name")), status: GetResultItemStatus, zoneTag: S.String.pipe(T.Body("zone_tag")), nsSet: S.optional(S.NullOr(S.Number).pipe(T.Body("ns_set"))), }), ).annotate({ identifier: "GetResultItem" }) as any as S.Schema; export type GetResultList = Array; export const GetResultList = /*@__PURE__*/ S.Array( GetResultItem, ) as any as S.Schema; export interface GetTenantCustomNameserverResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: GetResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const GetTenantCustomNameserverResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: GetResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetTenantCustomNameserverResponse", }) as any as S.Schema; export type CreateTenantCustomNameserverError = CloudflareOpError; /** Add Tenant Custom Nameserver */ export const createTenantCustomNameserver: API.OperationMethod< CreateTenantCustomNameserverRequest, CreateTenantCustomNameserverResponse, CreateTenantCustomNameserverError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateTenantCustomNameserverRequest, output: CreateTenantCustomNameserverResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteTenantCustomNameserverError = CloudflareOpError; /** Delete Tenant Custom Nameserver */ export const deleteTenantCustomNameserver: API.PaginatedOperationMethod< DeleteTenantCustomNameserverRequest, DeleteTenantCustomNameserverResponse, DeleteTenantCustomNameserverError, CloudflareOpContext, string > = /*@__PURE__*/ API.makePaginated( () => ({ input: DeleteTenantCustomNameserverRequest, output: DeleteTenantCustomNameserverResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type GetTenantCustomNameserverError = CloudflareOpError; /** List a tenant's custom nameservers. */ export const getTenantCustomNameserver: API.PaginatedOperationMethod< GetTenantCustomNameserverRequest, GetTenantCustomNameserverResponse, GetTenantCustomNameserverError, CloudflareOpContext, GetResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: GetTenantCustomNameserverRequest, output: GetTenantCustomNameserverResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any;