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 }; /** The project has no remaining Primary IP quota (Hetzner `resource_limit_exceeded`, HTTP 403). Often transient -- Servers hold auto-created Primary IP pairs that free up on delete -- retry. */ export class PrimaryIpLimitExceeded extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("PrimaryIpLimitExceeded", { code: S.Number, message: S.String, }), [{ status: 403, message: { includes: "IP limit" } }], ) {} /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type CreatePrimaryIpRequestLabelsMap = { [key: string]: string | undefined }; /** [Primary IP](#tag/primary-ips) type. */ export type CreatePrimaryIpRequestType = "ipv4" | "ipv6"; /** [Location](#tag/locations) ID or name the [Primary IP](#tag/primary-ips) will be bound to. Omit if `assignee_id`/`assignee_type` or `datacenter` are provided. */ export type CreatePrimaryIpRequestLocation = string | number; /** Type of resource to assign the [Primary IP](#tag/primary-ips) to. Omitted if the [Primary IP](#tag/primary-ips) should not get assigned. */ export type CreatePrimaryIpRequestAssigneeType = "server" | "unassigned"; export interface CreatePrimaryIpRequest { /** Name of the Resource. Must be unique per Project. */ name: string; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels?: CreatePrimaryIpRequestLabelsMap; /** [Primary IP](#tag/primary-ips) type. */ type: CreatePrimaryIpRequestType | (string & {}); /** [Location](#tag/locations) ID or name the [Primary IP](#tag/primary-ips) will be bound to. Omit if `assignee_id`/`assignee_type` or `datacenter` are provided. */ location?: CreatePrimaryIpRequestLocation; /** Type of resource to assign the [Primary IP](#tag/primary-ips) to. Omitted if the [Primary IP](#tag/primary-ips) should not get assigned. */ assignee_type?: CreatePrimaryIpRequestAssigneeType | (string & {}); /** ID of resource to assign the [Primary IP](#tag/primary-ips) to. Omitted if the [Primary IP](#tag/primary-ips) should not get assigned. */ assignee_id?: number | null; /** Auto deletion state. If enabled the [Primary IP](#tag/primary-ips) will be deleted once the assigned resource gets deleted. */ auto_delete?: boolean; } /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type CreatePrimaryIpResponsePrimaryIpLabelsMap = { [key: string]: string | undefined }; /** [Location](#tag/locations) of the [Primary IP](#tag/primary-ips). */ export interface CreatePrimaryIpResponsePrimaryIpLocation { /** ID of the [Location](#tag/locations). */ id: number; /** Unique identifier of the [Location](#tag/locations). */ name: string; /** Human readable description of the [Location](#tag/locations). */ description: string; /** Country the [Location](#tag/locations) resides in. ISO 3166-1 alpha-2 code of the country. */ country: string; /** Name of the closest city to the [Location](#tag/locations). City name or city name and state in short form. E.g. `Falkenstein` or `Ashburn, VA`. */ city: string; /** Latitude of the city closest to the [Location](#tag/locations). */ latitude: number; /** Longitude of the city closest to the [Location](#tag/locations). */ longitude: number; /** Name of the Network Zone this [Location](#tag/locations) resides in. */ network_zone: string; } export interface CreatePrimaryIpResponsePrimaryIpDnsPtrItem { /** Single IPv4 or IPv6 address of the record. */ ip: string; /** Domain Name to point to. PTR record content used for reverse DNS. */ dns_ptr: string; } /** List of reverse DNS records. */ export type CreatePrimaryIpResponsePrimaryIpDnsPtrList = Array; /** Protection configuration for the Resource. */ export interface CreatePrimaryIpResponsePrimaryIpProtection { /** Prevent the Resource from being deleted. */ delete: boolean; } /** [Primary IP](#tag/primary-ips) type. */ export type CreatePrimaryIpResponsePrimaryIpType = "ipv4" | "ipv6"; /** Type of resource the [Primary IP](#tag/primary-ips) is assigned to. As of 23 September 2026 `unassigned` is returned if the [Primary IP](#tag/primary-ips) is not assigned. */ export type CreatePrimaryIpResponsePrimaryIpAssigneeType = "server" | "unassigned"; export interface CreatePrimaryIpResponsePrimaryIp { /** ID of the [Primary IP](#tag/primary-ips). */ id: number; /** Name of the Resource. Must be unique per Project. */ name: string; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels: CreatePrimaryIpResponsePrimaryIpLabelsMap; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; /** Blocked state of the [Primary IP](#tag/primary-ips). */ blocked: boolean; /** [Location](#tag/locations) of the [Primary IP](#tag/primary-ips). */ location: CreatePrimaryIpResponsePrimaryIpLocation; /** IP address. */ ip: string; /** List of reverse DNS records. */ dns_ptr: CreatePrimaryIpResponsePrimaryIpDnsPtrList; /** Protection configuration for the Resource. */ protection: CreatePrimaryIpResponsePrimaryIpProtection; /** [Primary IP](#tag/primary-ips) type. */ type: CreatePrimaryIpResponsePrimaryIpType; /** Auto deletion state. If enabled the [Primary IP](#tag/primary-ips) will be deleted once the assigned resource gets deleted. */ auto_delete: boolean; /** Type of resource the [Primary IP](#tag/primary-ips) is assigned to. As of 23 September 2026 `unassigned` is returned if the [Primary IP](#tag/primary-ips) is not assigned. */ assignee_type: CreatePrimaryIpResponsePrimaryIpAssigneeType; /** ID of resource the [Primary IP](#tag/primary-ips) is assigned to. `null` if the [Primary IP](#tag/primary-ips) is not assigned. */ assignee_id: number | null; } /** Status of the Action. */ export type CreatePrimaryIpResponseActionStatus = "running" | "success" | "error"; export interface CreatePrimaryIpResponseActionResourcesItem { /** ID of the Resource. */ id: number; /** Type of the Resource. */ type: string; } /** Resources the Action relates to. */ export type CreatePrimaryIpResponseActionResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export interface CreatePrimaryIpResponseActionError { /** Fixed error code for machines. */ code: string; /** Error message for humans. */ message: string; } /** Action will only be returned if the [Primary IP](#tag/primary-ips) is getting assigned. */ export interface CreatePrimaryIpResponseAction { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: CreatePrimaryIpResponseActionStatus; /** 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: CreatePrimaryIpResponseActionResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: CreatePrimaryIpResponseActionError | null; } export interface CreatePrimaryIpResponse { primary_ip: CreatePrimaryIpResponsePrimaryIp; /** Action will only be returned if the [Primary IP](#tag/primary-ips) is getting assigned. */ action?: CreatePrimaryIpResponseAction | null; } export interface DeletePrimaryIpRequest { /** ID of the Primary IP. */ id: number; } export interface DeletePrimaryIpResponse {} export interface GetPrimaryIpRequest { /** ID of the Primary IP. */ id: number; } /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type GetPrimaryIpResponsePrimaryIpLabelsMap = { [key: string]: string | undefined }; /** [Location](#tag/locations) of the [Primary IP](#tag/primary-ips). */ export type GetPrimaryIpResponsePrimaryIpLocation = CreatePrimaryIpResponsePrimaryIpLocation; export type GetPrimaryIpResponsePrimaryIpDnsPtrItem = CreatePrimaryIpResponsePrimaryIpDnsPtrItem; /** List of reverse DNS records. */ export type GetPrimaryIpResponsePrimaryIpDnsPtrList = Array; /** Protection configuration for the Resource. */ export type GetPrimaryIpResponsePrimaryIpProtection = CreatePrimaryIpResponsePrimaryIpProtection; /** [Primary IP](#tag/primary-ips) type. */ export type GetPrimaryIpResponsePrimaryIpType = "ipv4" | "ipv6"; /** Type of resource the [Primary IP](#tag/primary-ips) is assigned to. As of 23 September 2026 `unassigned` is returned if the [Primary IP](#tag/primary-ips) is not assigned. */ export type GetPrimaryIpResponsePrimaryIpAssigneeType = "server" | "unassigned"; export interface GetPrimaryIpResponsePrimaryIp { /** ID of the [Primary IP](#tag/primary-ips). */ id: number; /** Name of the Resource. Must be unique per Project. */ name: string; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels: GetPrimaryIpResponsePrimaryIpLabelsMap; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; /** Blocked state of the [Primary IP](#tag/primary-ips). */ blocked: boolean; /** [Location](#tag/locations) of the [Primary IP](#tag/primary-ips). */ location: CreatePrimaryIpResponsePrimaryIpLocation; /** IP address. */ ip: string; /** List of reverse DNS records. */ dns_ptr: GetPrimaryIpResponsePrimaryIpDnsPtrList; /** Protection configuration for the Resource. */ protection: CreatePrimaryIpResponsePrimaryIpProtection; /** [Primary IP](#tag/primary-ips) type. */ type: GetPrimaryIpResponsePrimaryIpType; /** Auto deletion state. If enabled the [Primary IP](#tag/primary-ips) will be deleted once the assigned resource gets deleted. */ auto_delete: boolean; /** Type of resource the [Primary IP](#tag/primary-ips) is assigned to. As of 23 September 2026 `unassigned` is returned if the [Primary IP](#tag/primary-ips) is not assigned. */ assignee_type: GetPrimaryIpResponsePrimaryIpAssigneeType; /** ID of resource the [Primary IP](#tag/primary-ips) is assigned to. `null` if the [Primary IP](#tag/primary-ips) is not assigned. */ assignee_id: number | null; } export interface GetPrimaryIpResponse { primary_ip: GetPrimaryIpResponsePrimaryIp; } export type ListPrimaryIpsRequestSortItem = | "id" | "id:asc" | "id:desc" | "created" | "created:asc" | "created:desc"; export type ListPrimaryIpsRequestSortList = Array; export interface ListPrimaryIpsRequest { /** Filter resources by their name. The response will only contain the resources matching exactly the specified name. */ name?: 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; /** Filter results by IP address. */ ip?: string; /** 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; /** Sort resources by field and direction. May be used multiple times. For more information, see "[Sorting](#description/sorting)". */ sort?: ListPrimaryIpsRequestSortList; } /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type ListPrimaryIpsResponsePrimaryIpsItemLabelsMap = { [key: string]: string | undefined }; /** [Location](#tag/locations) of the [Primary IP](#tag/primary-ips). */ export type ListPrimaryIpsResponsePrimaryIpsItemLocation = CreatePrimaryIpResponsePrimaryIpLocation; export type ListPrimaryIpsResponsePrimaryIpsItemDnsPtrItem = CreatePrimaryIpResponsePrimaryIpDnsPtrItem; /** List of reverse DNS records. */ export type ListPrimaryIpsResponsePrimaryIpsItemDnsPtrList = Array; /** Protection configuration for the Resource. */ export type ListPrimaryIpsResponsePrimaryIpsItemProtection = CreatePrimaryIpResponsePrimaryIpProtection; /** [Primary IP](#tag/primary-ips) type. */ export type ListPrimaryIpsResponsePrimaryIpsItemType = "ipv4" | "ipv6"; /** Type of resource the [Primary IP](#tag/primary-ips) is assigned to. As of 23 September 2026 `unassigned` is returned if the [Primary IP](#tag/primary-ips) is not assigned. */ export type ListPrimaryIpsResponsePrimaryIpsItemAssigneeType = "server" | "unassigned"; export interface ListPrimaryIpsResponsePrimaryIpsItem { /** ID of the [Primary IP](#tag/primary-ips). */ id: number; /** Name of the Resource. Must be unique per Project. */ name: string; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels: ListPrimaryIpsResponsePrimaryIpsItemLabelsMap; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; /** Blocked state of the [Primary IP](#tag/primary-ips). */ blocked: boolean; /** [Location](#tag/locations) of the [Primary IP](#tag/primary-ips). */ location: CreatePrimaryIpResponsePrimaryIpLocation; /** IP address. */ ip: string; /** List of reverse DNS records. */ dns_ptr: ListPrimaryIpsResponsePrimaryIpsItemDnsPtrList; /** Protection configuration for the Resource. */ protection: CreatePrimaryIpResponsePrimaryIpProtection; /** [Primary IP](#tag/primary-ips) type. */ type: ListPrimaryIpsResponsePrimaryIpsItemType; /** Auto deletion state. If enabled the [Primary IP](#tag/primary-ips) will be deleted once the assigned resource gets deleted. */ auto_delete: boolean; /** Type of resource the [Primary IP](#tag/primary-ips) is assigned to. As of 23 September 2026 `unassigned` is returned if the [Primary IP](#tag/primary-ips) is not assigned. */ assignee_type: ListPrimaryIpsResponsePrimaryIpsItemAssigneeType; /** ID of resource the [Primary IP](#tag/primary-ips) is assigned to. `null` if the [Primary IP](#tag/primary-ips) is not assigned. */ assignee_id: number | null; } export type ListPrimaryIpsResponsePrimaryIpsList = Array; /** See "[Pagination](#description/pagination)" for more information. */ export interface ListPrimaryIpsResponseMetaPagination { /** 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 ListPrimaryIpsResponseMeta { /** See "[Pagination](#description/pagination)" for more information. */ pagination: ListPrimaryIpsResponseMetaPagination; } export interface ListPrimaryIpsResponse { primary_ips: ListPrimaryIpsResponsePrimaryIpsList; meta: ListPrimaryIpsResponseMeta; } /** 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 UpdatePrimaryIpRequestLabelsMap = { [key: string]: string | undefined }; export interface UpdatePrimaryIpRequest { /** ID of the Primary IP. */ id: number; /** Name of the Resource. Must be unique per Project. */ 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?: UpdatePrimaryIpRequestLabelsMap; /** Auto deletion state. If enabled the [Primary IP](#tag/primary-ips) will be deleted once the assigned resource gets deleted. */ auto_delete?: boolean; } /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type UpdatePrimaryIpResponsePrimaryIpLabelsMap = { [key: string]: string | undefined }; /** [Location](#tag/locations) of the [Primary IP](#tag/primary-ips). */ export type UpdatePrimaryIpResponsePrimaryIpLocation = CreatePrimaryIpResponsePrimaryIpLocation; export type UpdatePrimaryIpResponsePrimaryIpDnsPtrItem = CreatePrimaryIpResponsePrimaryIpDnsPtrItem; /** List of reverse DNS records. */ export type UpdatePrimaryIpResponsePrimaryIpDnsPtrList = Array; /** Protection configuration for the Resource. */ export type UpdatePrimaryIpResponsePrimaryIpProtection = CreatePrimaryIpResponsePrimaryIpProtection; /** [Primary IP](#tag/primary-ips) type. */ export type UpdatePrimaryIpResponsePrimaryIpType = "ipv4" | "ipv6"; /** Type of resource the [Primary IP](#tag/primary-ips) is assigned to. As of 23 September 2026 `unassigned` is returned if the [Primary IP](#tag/primary-ips) is not assigned. */ export type UpdatePrimaryIpResponsePrimaryIpAssigneeType = "server" | "unassigned"; export interface UpdatePrimaryIpResponsePrimaryIp { /** ID of the [Primary IP](#tag/primary-ips). */ id: number; /** Name of the Resource. Must be unique per Project. */ name: string; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels: UpdatePrimaryIpResponsePrimaryIpLabelsMap; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; /** Blocked state of the [Primary IP](#tag/primary-ips). */ blocked: boolean; /** [Location](#tag/locations) of the [Primary IP](#tag/primary-ips). */ location: CreatePrimaryIpResponsePrimaryIpLocation; /** IP address. */ ip: string; /** List of reverse DNS records. */ dns_ptr: UpdatePrimaryIpResponsePrimaryIpDnsPtrList; /** Protection configuration for the Resource. */ protection: CreatePrimaryIpResponsePrimaryIpProtection; /** [Primary IP](#tag/primary-ips) type. */ type: UpdatePrimaryIpResponsePrimaryIpType; /** Auto deletion state. If enabled the [Primary IP](#tag/primary-ips) will be deleted once the assigned resource gets deleted. */ auto_delete: boolean; /** Type of resource the [Primary IP](#tag/primary-ips) is assigned to. As of 23 September 2026 `unassigned` is returned if the [Primary IP](#tag/primary-ips) is not assigned. */ assignee_type: UpdatePrimaryIpResponsePrimaryIpAssigneeType; /** ID of resource the [Primary IP](#tag/primary-ips) is assigned to. `null` if the [Primary IP](#tag/primary-ips) is not assigned. */ assignee_id: number | null; } export interface UpdatePrimaryIpResponse { primary_ip: UpdatePrimaryIpResponsePrimaryIp; } export type CreatePrimaryIpError = PrimaryIpLimitExceeded | HetznerOpError; /** Create a Primary IP Create a new [Primary IP](#tag/primary-ips). Can optionally be assigned to a resource by providing an `assignee_id` and `assignee_type`. If not assigned to a resource the `location` key needs to be provided. This can be either the ID or the name of the [Location](#tag/locations) this [Primary IP](#tag/primary-ips) shall be created in. A [Primary IP](#tag/primary-ips) can only be assigned to resource in the same [Location](#tag/locations) later on. #### Operation specific errors */ export const createPrimaryIp: API.OperationMethod< CreatePrimaryIpRequest, CreatePrimaryIpResponse, CreatePrimaryIpError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(5, __c0, 5) as any as S.Schema, errors: [PrimaryIpLimitExceeded, UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type DeletePrimaryIpError = HetznerOpError; /** Delete a Primary IP Deletes a [Primary IP](#tag/primary-ips). The [Server](#tag/servers) must be powered off (status `off`) in order for this operation to succeed. If assigned to a [Server](#tag/servers) the [Primary IP](#tag/primary-ips) will be unassigned automatically until 1 May 2026. After this date, the [Primary IP](#tag/primary-ips) needs to be unassigned before it can be deleted. #### Operation specific errors */ export const deletePrimaryIp: API.OperationMethod< DeletePrimaryIpRequest, DeletePrimaryIpResponse, DeletePrimaryIpError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(16, __c2, 0) as any as S.Schema, output: __S(17, __c2, 1) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type GetPrimaryIpError = HetznerOpError; /** Get a Primary IP Returns a [Primary IP](#tag/primary-ips). */ export const getPrimaryIp: API.OperationMethod< GetPrimaryIpRequest, GetPrimaryIpResponse, GetPrimaryIpError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(24, __c3, 0) as any as S.Schema, output: __S(32, __c4, 0) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type ListPrimaryIpsError = HetznerOpError; /** List Primary IPs List multiple [Primary IPs](#tag/primary-ips). Use the provided URI parameters to modify the result. */ export const listPrimaryIps: API.PaginatedOperationMethod< ListPrimaryIpsRequest, ListPrimaryIpsResponse, ListPrimaryIpsError, HetznerOpContext, ListPrimaryIpsResponsePrimaryIpsItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: __S(41, __c5, 1) as any as S.Schema, output: __S(45, __c5, 5) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "meta.pagination.next_page", items: "primary_ips", pageSize: "per_page", } as const, }), paginatePageNumber, ) as any; export type UpdatePrimaryIpError = HetznerOpError; /** Update a Primary IP Update a [Primary IP](#tag/primary-ips). If another change is concurrently performed on this [Primary IP](#tag/primary-ips), a error response with code `conflict` will be returned. */ export const updatePrimaryIp: API.OperationMethod< UpdatePrimaryIpRequest, UpdatePrimaryIpResponse, UpdatePrimaryIpError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(48, __c6, 0) as any as S.Schema, output: __S(32, __c4, 0) 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({ name: S.String, labels: S.optional(__S(8, __c1, 0)), type: S.String, location: S.optional(S.Unknown), assignee_type: S.optional(S.String), assignee_id: S.optional(S.NullOr(S.Number)), auto_delete: S.optional(S.Boolean), }).pipe(T.Http({ method: "POST", uri: "/primary_ips", code: 200 })), ).annotate({ identifier: "CreatePrimaryIpRequest" }); case 1: return S.suspend(() => S.Struct({ id: S.Number, type: S.String, }), ).annotate({ identifier: "CreatePrimaryIpResponseActionResourcesItem" }); case 2: return S.Array(__S(1, __c0, 1)); case 3: return S.suspend(() => S.Struct({ code: S.String, message: S.String, }), ).annotate({ identifier: "CreatePrimaryIpResponseActionError" }); case 4: 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(2, __c0, 2), error: S.NullOr(__S(3, __c0, 3)), }), ).annotate({ identifier: "CreatePrimaryIpResponseAction" }); case 5: return S.suspend(() => S.Struct({ primary_ip: __S(13, __c1, 5), action: S.optional(S.NullOr(__S(4, __c0, 4))), }), ).annotate({ identifier: "CreatePrimaryIpResponse" }); } } function __c1(j: number): any { switch (j) { case 0: return S.Record(S.String, S.String); case 1: return S.suspend(() => S.Struct({ id: S.Number, name: S.String, description: S.String, country: S.String, city: S.String, latitude: S.Number, longitude: S.Number, network_zone: S.String, }), ).annotate({ identifier: "CreatePrimaryIpResponsePrimaryIpLocation" }); case 2: return S.suspend(() => S.Struct({ ip: S.String, dns_ptr: S.String, }), ).annotate({ identifier: "CreatePrimaryIpResponsePrimaryIpDnsPtrItem" }); case 3: return S.Array(__S(10, __c1, 2)); case 4: return S.suspend(() => S.Struct({ delete: S.Boolean, }), ).annotate({ identifier: "CreatePrimaryIpResponsePrimaryIpProtection" }); case 5: return S.suspend(() => S.Struct({ id: S.Number, name: S.String, labels: __S(8, __c1, 0), created: S.String, blocked: S.Boolean, location: __S(9, __c1, 1), ip: S.String, dns_ptr: __S(11, __c1, 3), protection: __S(12, __c1, 4), type: S.String, auto_delete: S.Boolean, assignee_type: S.String, assignee_id: S.NullOr(S.Number), }), ).annotate({ identifier: "CreatePrimaryIpResponsePrimaryIp" }); } } function __c2(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number.pipe(T.Label()), }).pipe(T.Http({ method: "DELETE", uri: "/primary_ips/{id}", code: 200 })), ).annotate({ identifier: "DeletePrimaryIpRequest" }); case 1: return S.suspend(() => S.Struct({})).annotate({ identifier: "DeletePrimaryIpResponse" }); } } function __c3(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number.pipe(T.Label()), }).pipe(T.Http({ method: "GET", uri: "/primary_ips/{id}", code: 200 })), ).annotate({ identifier: "GetPrimaryIpRequest" }); } } function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ primary_ip: __S(13, __c1, 5), }), ).annotate({ identifier: "GetPrimaryIpResponse" }); } } function __c5(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())), label_selector: S.optional(S.String.pipe(T.Query())), ip: S.optional(S.String.pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), per_page: S.optional(S.Number.pipe(T.Query())), sort: S.optional(__S(40, __c5, 0).pipe(T.Query())), }).pipe(T.Http({ method: "GET", uri: "/primary_ips", code: 200 })), ).annotate({ identifier: "ListPrimaryIpsRequest" }); case 2: return S.Array(__S(13, __c1, 5)); 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: "ListPrimaryIpsResponseMetaPagination" }); case 4: return S.suspend(() => S.Struct({ pagination: __S(43, __c5, 3), }), ).annotate({ identifier: "ListPrimaryIpsResponseMeta" }); case 5: return S.suspend(() => S.Struct({ primary_ips: __S(42, __c5, 2), meta: __S(44, __c5, 4), }), ).annotate({ identifier: "ListPrimaryIpsResponse" }); } } function __c6(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number.pipe(T.Label()), name: S.optional(S.String), labels: S.optional(__S(8, __c1, 0)), auto_delete: S.optional(S.Boolean), }).pipe(T.Http({ method: "PUT", uri: "/primary_ips/{id}", code: 200 })), ).annotate({ identifier: "UpdatePrimaryIpRequest" }); } } // 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)); }