import * as API from "@distilled.cloud/core/api"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-hetzner/specs/cloud.spec.json). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; import { UnknownHetznerError } from "../errors.ts"; import { paginatePageNumber } from "../pagination.ts"; import { HetznerProtocol, type HetznerOpError, type HetznerOpContext } from "../protocol.ts"; import * as Retry from "../retry.ts"; import * as T from "../traits.ts"; // Schema table, filled on first reach (see __S at the end). const __s: any[] = []; export type { HetznerOpError, HetznerOpContext }; /** Mode of the [Zone](#tag/zones). For more information, see [Zone Modes](#tag/zones/zone-modes). */ export type CreateZoneRequestMode = "primary" | "secondary"; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type CreateZoneRequestLabelsMap = { [key: string]: string | undefined }; /** [Transaction signature (TSIG)](https://en.wikipedia.org/wiki/TSIG) algorithm used to generate the TSIG key. */ export type CreateZoneRequestPrimaryNameserversItemTsigAlgorithm = | "hmac-md5" | "hmac-sha1" | "hmac-sha256"; /** Primary nameserver that returns [Zones](#tag/zones) via `AXFR`. Must allow queries from and may send `NOTIFY` queries to [Hetzner's secondary nameservers](https://docs.hetzner.com/dns-console/dns/general/authoritative-name-servers#secondary-dns-servers-old-name-servers-for-robot-customers). */ export interface CreateZoneRequestPrimaryNameserversItem { /** Public IPv4 or IPv6 address of the primary nameserver. Must be unique across all primary nameservers of this zone. */ address: string; /** Port of the primary nameserver. */ port?: number; /** [Transaction signature (TSIG)](https://en.wikipedia.org/wiki/TSIG) key to use for the zone transfer. Must be base64 encoded. */ tsig_key?: string; /** [Transaction signature (TSIG)](https://en.wikipedia.org/wiki/TSIG) algorithm used to generate the TSIG key. */ tsig_algorithm?: CreateZoneRequestPrimaryNameserversItemTsigAlgorithm | (string & {}); } /** Primary nameservers of the [Zone](#tag/zones). Only applicable for [Zones](#tag/zones) in secondary mode. Ignored for [Zones](#tag/zones) in primary mode. */ export type CreateZoneRequestPrimaryNameserversList = Array; /** Type of the [RRSet](#tag/zone-rrsets). */ export type CreateZoneRequestRrsetsItemType = | "A" | "AAAA" | "CAA" | "CNAME" | "DS" | "HINFO" | "HTTPS" | "MX" | "NS" | "PTR" | "RP" | "SOA" | "SRV" | "SVCB" | "TLSA" | "TXT"; /** Record of a [RRSet](#tag/zone-rrsets). The `value` is used to identify the record in an [RRSet](#tag/zone-rrsets). */ export interface CreateZoneRequestRrsetsItemRecordsItem { /** Value of the record. For details about accepted values, see the [DNS record types documentation](https://docs.hetzner.com/networking/dns/record-types/overview/). */ value: string; /** Comment of the record. */ comment?: string; } /** Records of the [RRSet](#tag/zone-rrsets). Must not be empty and must only contain distinct record values. The order of records returned in responses is not guaranteed to be consistent. */ export type CreateZoneRequestRrsetsItemRecordsList = Array; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type CreateZoneRequestRrsetsItemLabelsMap = { [key: string]: string | undefined }; export interface CreateZoneRequestRrsetsItem { /** Name of the [RRSet](#tag/zone-rrsets). The name must be in lower case, and must not end with a dot or the [Zone](#tag/zones) name. Names containing non-ASCII characters must be transcribed to [Punycode](https://wikipedia.org/wiki/Punycode) representation with ACE prefix, e.g. `xn--4bi` (U+2709). For the [Zone](#tag/zones) apex, use `@`. */ name: string; /** Type of the [RRSet](#tag/zone-rrsets). */ type: CreateZoneRequestRrsetsItemType | (string & {}); /** Time To Live (TTL) of the [RRSet](#tag/zone-rrsets). Must be in between 60s and 2147483647s. If not set, the [Zone's](#tag/zones) Default TTL is used. */ ttl?: number | null; /** Records of the [RRSet](#tag/zone-rrsets). Must not be empty and must only contain distinct record values. The order of records returned in responses is not guaranteed to be consistent. */ records: CreateZoneRequestRrsetsItemRecordsList; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels?: CreateZoneRequestRrsetsItemLabelsMap; } /** [RRSets](#tag/zone-rrsets) to be added to the [Zone](#tag/zones). Only applicable for [Zones](#tag/zones) in primary mode. Ignored for [Zones](#tag/zones) in secondary mode. */ export type CreateZoneRequestRrsetsList = Array; export interface CreateZoneRequest { /** Name of the [Zone](#tag/zones). All names with [well-known public suffixes](https://publicsuffix.org/) (e.g. `.de`, `.com`, `.co.uk`) are supported. Subdomains are not supported. The name must be in lower case and must not end with a dot. [Internationalized domain names](https://en.wikipedia.org/wiki/Internationalized_domain_name) must be transcribed to [Punycode](https://wikipedia.org/wiki/Punycode) representation with ACE prefix, e.g. `xn--mnchen-3ya.de` (`münchen.de`). */ name: string; /** Mode of the [Zone](#tag/zones). For more information, see [Zone Modes](#tag/zones/zone-modes). */ mode: CreateZoneRequestMode | (string & {}); /** Default Time To Live (TTL) of the [Zone](#tag/zones). Must be in between 60s and 2147483647s. This TTL is used for [RRSets](#tag/zone-rrsets) that do not explicitly define a TTL. */ ttl?: number; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels?: CreateZoneRequestLabelsMap; /** Primary nameservers of the [Zone](#tag/zones). Only applicable for [Zones](#tag/zones) in secondary mode. Ignored for [Zones](#tag/zones) in primary mode. */ primary_nameservers?: CreateZoneRequestPrimaryNameserversList; /** [RRSets](#tag/zone-rrsets) to be added to the [Zone](#tag/zones). Only applicable for [Zones](#tag/zones) in primary mode. Ignored for [Zones](#tag/zones) in secondary mode. */ rrsets?: CreateZoneRequestRrsetsList; /** Zone file to import. Only applicable for [Zones](#tag/zones) in primary mode. Ignored for [Zones](#tag/zones) in secondary mode. If provided, `rrsets` must be empty. See [Zone file import](#tag/zones/zone-file-import) for more details. */ zonefile?: string; } /** [Transaction signature (TSIG)](https://en.wikipedia.org/wiki/TSIG) algorithm used to generate the TSIG key. */ export type ZonePrimaryPrimaryNameserversItemTsigAlgorithm = | "hmac-md5" | "hmac-sha1" | "hmac-sha256"; /** Primary nameserver that returns [Zones](#tag/zones) via `AXFR`. Must allow queries from and may send `NOTIFY` queries to [Hetzner's secondary nameservers](https://docs.hetzner.com/dns-console/dns/general/authoritative-name-servers#secondary-dns-servers-old-name-servers-for-robot-customers). */ export interface ZonePrimaryPrimaryNameserversItem { /** Public IPv4 or IPv6 address of the primary nameserver. Must be unique across all primary nameservers of this zone. */ address: string; /** Port of the primary nameserver. */ port?: number; /** [Transaction signature (TSIG)](https://en.wikipedia.org/wiki/TSIG) key to use for the zone transfer. Must be base64 encoded. */ tsig_key?: string; /** [Transaction signature (TSIG)](https://en.wikipedia.org/wiki/TSIG) algorithm used to generate the TSIG key. */ tsig_algorithm?: ZonePrimaryPrimaryNameserversItemTsigAlgorithm; } /** Primary nameservers of the [Zone](#tag/zones). Only set if [Zone](#tag/zones) is in [secondary mode](#tag/zones/zone-modes), otherwise empty. */ export type ZonePrimaryPrimaryNameserversList = Array; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type ZonePrimaryLabelsMap = { [key: string]: string | undefined }; /** Protection configuration for the Resource. */ export interface ZonePrimaryProtection { /** Prevent the Resource from being deleted. */ delete: boolean; } /** Status of the [Zone](#tag/zones). */ export type ZonePrimaryStatus = "ok" | "updating" | "error"; /** Authoritative Hetzner nameservers assigned to this [Zone](#tag/zones). */ export type ZonePrimaryAuthoritativeNameserversAssignedList = Array; /** Authoritative nameservers currently delegated to by the parent DNS zone. If these don't match the assigned authoritative nameservers, the DNS zone is currently not being served by Hetzner. */ export type ZonePrimaryAuthoritativeNameserversDelegatedList = Array; /** Status of the delegation. */ export type ZonePrimaryAuthoritativeNameserversDelegationStatus = | "valid" | "partially-valid" | "invalid" | "lame" | "unregistered" | "unknown"; export interface ZonePrimaryAuthoritativeNameservers { /** Authoritative Hetzner nameservers assigned to this [Zone](#tag/zones). */ assigned: ZonePrimaryAuthoritativeNameserversAssignedList; /** Authoritative nameservers currently delegated to by the parent DNS zone. If these don't match the assigned authoritative nameservers, the DNS zone is currently not being served by Hetzner. */ delegated: ZonePrimaryAuthoritativeNameserversDelegatedList; /** Point in time (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format) when the DNS zone delegation was last checked. */ delegation_last_check: string | null; /** Status of the delegation. */ delegation_status?: ZonePrimaryAuthoritativeNameserversDelegationStatus; } /** Registrar of the domain. */ export type ZonePrimaryRegistrar = "hetzner" | "other" | "unknown"; /** Mode of the [Zone](#tag/zones). For more information, see [Zone Modes](#tag/zones/zone-modes). */ export type ZonePrimaryMode = "primary"; export interface ZonePrimary { /** ID of the [Zone](#tag/zones). */ id: number; /** Name of the [Zone](#tag/zones). All names with [well-known public suffixes](https://publicsuffix.org/) (e.g. `.de`, `.com`, `.co.uk`) are supported. Subdomains are not supported. The name must be in lower case and must not end with a dot. [Internationalized domain names](https://en.wikipedia.org/wiki/Internationalized_domain_name) must be transcribed to [Punycode](https://wikipedia.org/wiki/Punycode) representation with ACE prefix, e.g. `xn--mnchen-3ya.de` (`münchen.de`). */ name: string; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; /** Primary nameservers of the [Zone](#tag/zones). Only set if [Zone](#tag/zones) is in [secondary mode](#tag/zones/zone-modes), otherwise empty. */ primary_nameservers?: ZonePrimaryPrimaryNameserversList; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels: ZonePrimaryLabelsMap; /** Protection configuration for the Resource. */ protection: ZonePrimaryProtection; /** Default Time To Live (TTL) of the [Zone](#tag/zones). Must be in between 60s and 2147483647s. This TTL is used for [RRSets](#tag/zone-rrsets) that do not explicitly define a TTL. */ ttl: number; /** Status of the [Zone](#tag/zones). */ status: ZonePrimaryStatus; /** Number of resource records (RR) within the [Zone](#tag/zones). */ record_count: number; authoritative_nameservers: ZonePrimaryAuthoritativeNameservers; /** Registrar of the domain. */ registrar: ZonePrimaryRegistrar; /** Mode of the [Zone](#tag/zones). For more information, see [Zone Modes](#tag/zones/zone-modes). */ mode: ZonePrimaryMode; } /** [Transaction signature (TSIG)](https://en.wikipedia.org/wiki/TSIG) algorithm used to generate the TSIG key. */ export type ZoneSecondaryPrimaryNameserversItemTsigAlgorithm = | "hmac-md5" | "hmac-sha1" | "hmac-sha256"; /** Primary nameserver that returns [Zones](#tag/zones) via `AXFR`. Must allow queries from and may send `NOTIFY` queries to [Hetzner's secondary nameservers](https://docs.hetzner.com/dns-console/dns/general/authoritative-name-servers#secondary-dns-servers-old-name-servers-for-robot-customers). */ export interface ZoneSecondaryPrimaryNameserversItem { /** Public IPv4 or IPv6 address of the primary nameserver. Must be unique across all primary nameservers of this zone. */ address: string; /** Port of the primary nameserver. */ port?: number; /** [Transaction signature (TSIG)](https://en.wikipedia.org/wiki/TSIG) key to use for the zone transfer. Must be base64 encoded. */ tsig_key?: string; /** [Transaction signature (TSIG)](https://en.wikipedia.org/wiki/TSIG) algorithm used to generate the TSIG key. */ tsig_algorithm?: ZoneSecondaryPrimaryNameserversItemTsigAlgorithm; } /** Primary nameservers of the [Zone](#tag/zones). Only set if [Zone](#tag/zones) is in [secondary mode](#tag/zones/zone-modes), otherwise empty. */ export type ZoneSecondaryPrimaryNameserversList = Array; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type ZoneSecondaryLabelsMap = { [key: string]: string | undefined }; /** Protection configuration for the Resource. */ export type ZoneSecondaryProtection = ZonePrimaryProtection; /** Status of the [Zone](#tag/zones). */ export type ZoneSecondaryStatus = "ok" | "updating" | "error"; /** Authoritative Hetzner nameservers assigned to this [Zone](#tag/zones). */ export type ZoneSecondaryAuthoritativeNameserversAssignedList = Array; /** Authoritative nameservers currently delegated to by the parent DNS zone. If these don't match the assigned authoritative nameservers, the DNS zone is currently not being served by Hetzner. */ export type ZoneSecondaryAuthoritativeNameserversDelegatedList = Array; /** Status of the delegation. */ export type ZoneSecondaryAuthoritativeNameserversDelegationStatus = | "valid" | "partially-valid" | "invalid" | "lame" | "unregistered" | "unknown"; export interface ZoneSecondaryAuthoritativeNameservers { /** Authoritative Hetzner nameservers assigned to this [Zone](#tag/zones). */ assigned: ZoneSecondaryAuthoritativeNameserversAssignedList; /** Authoritative nameservers currently delegated to by the parent DNS zone. If these don't match the assigned authoritative nameservers, the DNS zone is currently not being served by Hetzner. */ delegated: ZoneSecondaryAuthoritativeNameserversDelegatedList; /** Point in time (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format) when the DNS zone delegation was last checked. */ delegation_last_check: string | null; /** Status of the delegation. */ delegation_status?: ZoneSecondaryAuthoritativeNameserversDelegationStatus; } /** Registrar of the domain. */ export type ZoneSecondaryRegistrar = "hetzner" | "other" | "unknown"; /** Mode of the [Zone](#tag/zones). For more information, see [Zone Modes](#tag/zones/zone-modes). */ export type ZoneSecondaryMode = "secondary"; export interface ZoneSecondary { /** ID of the [Zone](#tag/zones). */ id: number; /** Name of the [Zone](#tag/zones). All names with [well-known public suffixes](https://publicsuffix.org/) (e.g. `.de`, `.com`, `.co.uk`) are supported. Subdomains are not supported. The name must be in lower case and must not end with a dot. [Internationalized domain names](https://en.wikipedia.org/wiki/Internationalized_domain_name) must be transcribed to [Punycode](https://wikipedia.org/wiki/Punycode) representation with ACE prefix, e.g. `xn--mnchen-3ya.de` (`münchen.de`). */ name: string; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; /** Primary nameservers of the [Zone](#tag/zones). Only set if [Zone](#tag/zones) is in [secondary mode](#tag/zones/zone-modes), otherwise empty. */ primary_nameservers?: ZoneSecondaryPrimaryNameserversList; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels: ZoneSecondaryLabelsMap; /** Protection configuration for the Resource. */ protection: ZonePrimaryProtection; /** Default Time To Live (TTL) of the [Zone](#tag/zones). Must be in between 60s and 2147483647s. This TTL is used for [RRSets](#tag/zone-rrsets) that do not explicitly define a TTL. */ ttl: number; /** Status of the [Zone](#tag/zones). */ status: ZoneSecondaryStatus; /** Number of resource records (RR) within the [Zone](#tag/zones). */ record_count: number; authoritative_nameservers: ZoneSecondaryAuthoritativeNameservers; /** Registrar of the domain. */ registrar: ZoneSecondaryRegistrar; /** Mode of the [Zone](#tag/zones). For more information, see [Zone Modes](#tag/zones/zone-modes). */ mode: ZoneSecondaryMode; } export type CreateZoneResponseZone = ZonePrimary | ZoneSecondary; /** Status of the Action. */ export type CreateZoneResponseActionStatus = "running" | "success" | "error"; export interface CreateZoneResponseActionResourcesItem { /** ID of the Resource. */ id: number; /** Type of the Resource. */ type: string; } /** Resources the Action relates to. */ export type CreateZoneResponseActionResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export interface CreateZoneResponseActionError { /** Fixed error code for machines. */ code: string; /** Error message for humans. */ message: string; } export interface CreateZoneResponseAction { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: CreateZoneResponseActionStatus; /** Point in time when the Action was started (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ started: string; /** Point in time when the Action was finished (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). Only set if the Action is finished otherwise null. */ finished: string | null; /** Progress of the Action in percent. */ progress: number; /** Resources the Action relates to. */ resources: CreateZoneResponseActionResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: CreateZoneResponseActionError | null; } export interface CreateZoneResponse { zone: CreateZoneResponseZone; action: CreateZoneResponseAction; } export interface DeleteZoneRequest { /** ID or Name of the Zone. */ id_or_name: string; } /** Status of the Action. */ export type DeleteZoneResponseActionStatus = "running" | "success" | "error"; export type DeleteZoneResponseActionResourcesItem = CreateZoneResponseActionResourcesItem; /** Resources the Action relates to. */ export type DeleteZoneResponseActionResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export type DeleteZoneResponseActionError = CreateZoneResponseActionError; export interface DeleteZoneResponseAction { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: DeleteZoneResponseActionStatus; /** Point in time when the Action was started (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ started: string; /** Point in time when the Action was finished (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). Only set if the Action is finished otherwise null. */ finished: string | null; /** Progress of the Action in percent. */ progress: number; /** Resources the Action relates to. */ resources: DeleteZoneResponseActionResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: CreateZoneResponseActionError | null; } export interface DeleteZoneResponse { action: DeleteZoneResponseAction; } export interface GetZoneRequest { /** ID or Name of the Zone. */ id_or_name: string; } export type GetZoneResponseZone = ZonePrimary | ZoneSecondary; export interface GetZoneResponse { zone: GetZoneResponseZone; } export interface GetZoneZonefileRequest { /** ID or Name of the Zone. */ id_or_name: string; } export interface GetZoneZonefileResponse { /** Generated zone file. Example: ```dns $ORIGIN example.com. $TTL 3600 @ IN SOA hydrogen.ns.hetzner.com. dns.hetzner.com. 2024010100 86400 10800 3600000 3600 @ IN 10800 NS hydrogen.ns.hetzner.com. ; Some comment. @ IN 10800 NS oxygen.ns.hetzner.com. @ IN 10800 NS helium.ns.hetzner.de. ``` */ zonefile: string; } /** Mode of the [Zone](#tag/zones). For more information, see [Zone Modes](#tag/zones/zone-modes). */ export type ListZonesRequestMode = "primary" | "secondary"; export type ListZonesRequestSortItem = | "id" | "id:asc" | "id:desc" | "name" | "name:asc" | "name:desc" | "created" | "created:asc" | "created:desc"; export type ListZonesRequestSortList = Array; export interface ListZonesRequest { /** Filter resources by their name. The response will only contain the resources matching exactly the specified name. */ name?: string; /** Filter resources by their mode. The response will only contain the resources matching exactly the specified mode. */ mode?: ListZonesRequestMode | (string & {}); /** Filter resources by labels. The response will only contain resources matching the label selector. For more information, see "[Label Selector](#description/label-selector)". */ label_selector?: string; /** Sort resources by field and direction. May be used multiple times. For more information, see "[Sorting](#description/sorting)". */ sort?: ListZonesRequestSortList; /** Page number to return. For more information, see "[Pagination](#description/pagination)". */ page?: number; /** Maximum number of entries returned per page. For more information, see "[Pagination](#description/pagination)". */ per_page?: number; } export type ListZonesResponseZonesItem = ZonePrimary | ZoneSecondary; export type ListZonesResponseZonesList = Array; /** See "[Pagination](#description/pagination)" for more information. */ export interface ListZonesResponseMetaPagination { /** Current page number. */ page: number; /** Maximum number of entries returned per page. */ per_page: number; /** Page number of the previous page. Can be null if the current page is the first one. */ previous_page: number | null; /** Page number of the next page. Can be null if the current page is the last one. */ next_page: number | null; /** Page number of the last page available. Can be null if the current page is the last one. */ last_page: number | null; /** Total number of entries that exist for this query. Can be null if unknown. */ total_entries: number | null; } export interface ListZonesResponseMeta { /** See "[Pagination](#description/pagination)" for more information. */ pagination: ListZonesResponseMetaPagination; } export interface ListZonesResponse { zones: ListZonesResponseZonesList; meta: ListZonesResponseMeta; } /** User-defined labels (`key/value` pairs) for the Resource. Note that the set of [Labels](#description/labels) provided in the request will overwrite the existing one. For more information, see "[Labels](#description/labels)". */ export type UpdateZoneRequestLabelsMap = { [key: string]: string | undefined }; export interface UpdateZoneRequest { /** ID or Name of the Zone. */ id_or_name: string; /** User-defined labels (`key/value` pairs) for the Resource. Note that the set of [Labels](#description/labels) provided in the request will overwrite the existing one. For more information, see "[Labels](#description/labels)". */ labels?: UpdateZoneRequestLabelsMap; } export type UpdateZoneResponseZone = ZonePrimary | ZoneSecondary; export interface UpdateZoneResponse { zone: UpdateZoneResponseZone; } export type CreateZoneError = HetznerOpError; /** Create a Zone Creates a [Zone](#tag/zones). A default `SOA` and three `NS` resource records with the assigned Hetzner nameservers are created automatically. */ export const createZone: API.OperationMethod< CreateZoneRequest, CreateZoneResponse, CreateZoneError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(6, __c0, 6) as any as S.Schema, output: __S(7, __c0, 7) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type DeleteZoneError = HetznerOpError; /** Delete a Zone Deletes a [Zone](#tag/zones). */ export const deleteZone: API.OperationMethod< DeleteZoneRequest, DeleteZoneResponse, DeleteZoneError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(24, __c3, 0) as any as S.Schema, output: __S(25, __c3, 1) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type GetZoneError = HetznerOpError; /** Get a Zone Returns a single [Zone](#tag/zones). */ export const getZone: API.OperationMethod< GetZoneRequest, GetZoneResponse, GetZoneError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(32, __c4, 0) as any as S.Schema, output: __S(33, __c4, 1) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type GetZoneZonefileError = HetznerOpError; /** Export a Zone file Returns a generated [Zone](#tag/zones) file in BIND (RFC [1034](https://datatracker.ietf.org/doc/html/rfc1034)/[1035](https://datatracker.ietf.org/doc/html/rfc1035)) format. Only applicable for [Zones](#tag/zones) in primary mode. #### Operation specific errors */ export const getZoneZonefile: API.OperationMethod< GetZoneZonefileRequest, GetZoneZonefileResponse, GetZoneZonefileError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(40, __c5, 0) as any as S.Schema, output: __S(41, __c5, 1) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type ListZonesError = HetznerOpError; /** List Zones Returns all [Zones](#tag/zones). Use the provided URI parameters to modify the result. */ export const listZones: API.PaginatedOperationMethod< ListZonesRequest, ListZonesResponse, ListZonesError, HetznerOpContext, ListZonesResponseZonesItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: __S(49, __c6, 1) as any as S.Schema, output: __S(53, __c6, 5) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "meta.pagination.next_page", items: "zones", pageSize: "per_page", } as const, }), paginatePageNumber, ) as any; export type UpdateZoneError = HetznerOpError; /** Update a Zone Updates a [Zone](#tag/zones). To modify resource record sets ([RRSets](#tag/zone-rrsets)), use the [RRSet Actions endpoints](#tag/zone-rrset-actions). */ export const updateZone: API.OperationMethod< UpdateZoneRequest, UpdateZoneResponse, UpdateZoneError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(56, __c7, 0) as any as S.Schema, output: __S(57, __c7, 1) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); // Schema builders: each runs one schema initializer, on that schema's first use. function __c0(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ address: S.String, port: S.optional(S.Number), tsig_key: S.optional(S.String), tsig_algorithm: S.optional(S.String), }), ).annotate({ identifier: "CreateZoneRequestPrimaryNameserversItem" }); case 1: return S.Array(__S(0, __c0, 0)); case 2: return S.suspend(() => S.Struct({ value: S.String, comment: S.optional(S.String), }), ).annotate({ identifier: "CreateZoneRequestRrsetsItemRecordsItem" }); case 3: return S.Array(__S(2, __c0, 2)); case 4: return S.suspend(() => S.Struct({ name: S.String, type: S.String, ttl: S.optional(S.NullOr(S.Number)), records: __S(3, __c0, 3), labels: S.optional(__S(16, __c2, 0)), }), ).annotate({ identifier: "CreateZoneRequestRrsetsItem" }); case 5: return S.Array(__S(4, __c0, 4)); case 6: return S.suspend(() => S.Struct({ name: S.String, mode: S.String, ttl: S.optional(S.Number), labels: S.optional(__S(16, __c2, 0)), primary_nameservers: S.optional(__S(1, __c0, 1)), rrsets: S.optional(__S(5, __c0, 5)), zonefile: S.optional(S.String), }).pipe(T.Http({ method: "POST", uri: "/zones", code: 200 })), ).annotate({ identifier: "CreateZoneRequest" }); case 7: return S.suspend(() => S.Struct({ zone: S.Unknown, action: __S(11, __c1, 3), }), ).annotate({ identifier: "CreateZoneResponse" }); } } function __c1(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number, type: S.String, }), ).annotate({ identifier: "CreateZoneResponseActionResourcesItem" }); case 1: return S.Array(__S(8, __c1, 0)); case 2: return S.suspend(() => S.Struct({ code: S.String, message: S.String, }), ).annotate({ identifier: "CreateZoneResponseActionError" }); case 3: return S.suspend(() => S.Struct({ id: S.Number, command: S.String, status: S.String, started: S.String, finished: S.NullOr(S.String), progress: S.Number, resources: __S(9, __c1, 1), error: S.NullOr(__S(10, __c1, 2)), }), ).annotate({ identifier: "CreateZoneResponseAction" }); } } function __c2(j: number): any { switch (j) { case 0: return S.Record(S.String, S.String); } } function __c3(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id_or_name: S.String.pipe(T.Label()), }).pipe(T.Http({ method: "DELETE", uri: "/zones/{id_or_name}", code: 200 })), ).annotate({ identifier: "DeleteZoneRequest" }); case 1: return S.suspend(() => S.Struct({ action: __S(11, __c1, 3), }), ).annotate({ identifier: "DeleteZoneResponse" }); } } function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id_or_name: S.String.pipe(T.Label()), }).pipe(T.Http({ method: "GET", uri: "/zones/{id_or_name}", code: 200 })), ).annotate({ identifier: "GetZoneRequest" }); case 1: return S.suspend(() => S.Struct({ zone: S.Unknown, }), ).annotate({ identifier: "GetZoneResponse" }); } } function __c5(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id_or_name: S.String.pipe(T.Label()), }).pipe(T.Http({ method: "GET", uri: "/zones/{id_or_name}/zonefile", code: 200 })), ).annotate({ identifier: "GetZoneZonefileRequest" }); case 1: return S.suspend(() => S.Struct({ zonefile: S.String, }), ).annotate({ identifier: "GetZoneZonefileResponse" }); } } function __c6(j: number): any { switch (j) { case 0: return S.Array(S.String); case 1: return S.suspend(() => S.Struct({ name: S.optional(S.String.pipe(T.Query())), mode: S.optional(S.String.pipe(T.Query())), label_selector: S.optional(S.String.pipe(T.Query())), sort: S.optional(__S(48, __c6, 0).pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), per_page: S.optional(S.Number.pipe(T.Query())), }).pipe(T.Http({ method: "GET", uri: "/zones", code: 200 })), ).annotate({ identifier: "ListZonesRequest" }); case 2: return S.Array(S.Unknown); case 3: return S.suspend(() => S.Struct({ page: S.Number, per_page: S.Number, previous_page: S.NullOr(S.Number), next_page: S.NullOr(S.Number), last_page: S.NullOr(S.Number), total_entries: S.NullOr(S.Number), }), ).annotate({ identifier: "ListZonesResponseMetaPagination" }); case 4: return S.suspend(() => S.Struct({ pagination: __S(51, __c6, 3), }), ).annotate({ identifier: "ListZonesResponseMeta" }); case 5: return S.suspend(() => S.Struct({ zones: __S(50, __c6, 2), meta: __S(52, __c6, 4), }), ).annotate({ identifier: "ListZonesResponse" }); } } function __c7(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id_or_name: S.String.pipe(T.Label()), labels: S.optional(__S(16, __c2, 0)), }).pipe(T.Http({ method: "PUT", uri: "/zones/{id_or_name}", code: 200 })), ).annotate({ identifier: "UpdateZoneRequest" }); case 1: return S.suspend(() => S.Struct({ zone: S.Unknown, }), ).annotate({ identifier: "UpdateZoneResponse" }); } } // Schema table: entry i is schema j of builder f, made on first reach. function __S(i: number, f: (j: number) => unknown, j: number): any { return (__s[i] ??= __L.at(f, j)); }