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 }; export interface AddNetworkRouteRequest { /** ID of the Network. */ id: number; /** Destination network or host of the route. Packages addressed for IPs matching the destination IP prefix will be send to the specified gateway. Must be one of * private IPv4 ranges of RFC1918 * or `0.0.0.0/0`. Must not overlap with * an existing ip_range in any subnets * or with any destinations in other routes * or with `172.31.1.1`. `172.31.1.1` is being used as a gateway for the public network interface of [Servers](#tag/servers). */ destination: string; /** Gateway of the route. Packages addressed for the specified destination will be send to this IP address. Cannot be * the first IP of the networks ip_range, * an IP behind a vSwitch or * `172.31.1.1`. `172.31.1.1` is being used as a gateway for the public network interface of [Servers](#tag/servers). */ gateway: string; } /** Status of the Action. */ export type AddNetworkRouteResponseActionStatus = "running" | "success" | "error"; export interface AddNetworkRouteResponseActionResourcesItem { /** ID of the Resource. */ id: number; /** Type of the Resource. */ type: string; } /** Resources the Action relates to. */ export type AddNetworkRouteResponseActionResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export interface AddNetworkRouteResponseActionError { /** Fixed error code for machines. */ code: string; /** Error message for humans. */ message: string; } export interface AddNetworkRouteResponseAction { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: AddNetworkRouteResponseActionStatus; /** 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: AddNetworkRouteResponseActionResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: AddNetworkRouteResponseActionError | null; } export interface AddNetworkRouteResponse { action: AddNetworkRouteResponseAction; } /** Type of subnet. */ export type AddNetworkSubnetRequestType = "cloud" | "server" | "vswitch"; export interface AddNetworkSubnetRequest { /** ID of the Network. */ id: number; /** Type of subnet. */ type: AddNetworkSubnetRequestType | (string & {}); /** IP range of the subnet. Uses CIDR notation. Must be a subnet of the parent [Networks](#tag/networks) `ip_range`. Must not overlap with any other subnets or with any destinations in routes. Minimum network size is /30. We highly recommend that you pick a larger subnet with a /24 netmask. */ ip_range?: string; /** Name of the [Network Zone](#tag/network-zones). The [Location](#tag/locations) contains the `network_zone` it belongs to. */ network_zone: string; /** ID of the robot vSwitch. Must be supplied if the subnet is of type `vswitch`. */ vswitch_id?: number; } /** Status of the Action. */ export type AddNetworkSubnetResponseActionStatus = "running" | "success" | "error"; export type AddNetworkSubnetResponseActionResourcesItem = AddNetworkRouteResponseActionResourcesItem; /** Resources the Action relates to. */ export type AddNetworkSubnetResponseActionResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export type AddNetworkSubnetResponseActionError = AddNetworkRouteResponseActionError; export interface AddNetworkSubnetResponseAction { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: AddNetworkSubnetResponseActionStatus; /** 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: AddNetworkSubnetResponseActionResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: AddNetworkRouteResponseActionError | null; } export interface AddNetworkSubnetResponse { action: AddNetworkSubnetResponseAction; } export interface ChangeNetworkIpRangeRequest { /** ID of the Network. */ id: number; /** IP range of the [Network](#tag/networks). Uses CIDR notation. Must span all included subnets. Must be one of the private IPv4 ranges of RFC1918. Minimum network size is /24. We highly recommend that you pick a larger [Network](#tag/networks) with a /16 netmask. */ ip_range: string; } /** Status of the Action. */ export type ChangeNetworkIpRangeResponseActionStatus = "running" | "success" | "error"; export type ChangeNetworkIpRangeResponseActionResourcesItem = AddNetworkRouteResponseActionResourcesItem; /** Resources the Action relates to. */ export type ChangeNetworkIpRangeResponseActionResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export type ChangeNetworkIpRangeResponseActionError = AddNetworkRouteResponseActionError; export interface ChangeNetworkIpRangeResponseAction { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: ChangeNetworkIpRangeResponseActionStatus; /** 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: ChangeNetworkIpRangeResponseActionResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: AddNetworkRouteResponseActionError | null; } export interface ChangeNetworkIpRangeResponse { action: ChangeNetworkIpRangeResponseAction; } export interface ChangeNetworkProtectionRequest { /** ID of the Network. */ id: number; /** Delete protection setting. If true, prevents the [Network](#tag/networks) from being deleted. */ delete?: boolean; } /** Status of the Action. */ export type ChangeNetworkProtectionResponseActionStatus = "running" | "success" | "error"; export type ChangeNetworkProtectionResponseActionResourcesItem = AddNetworkRouteResponseActionResourcesItem; /** Resources the Action relates to. */ export type ChangeNetworkProtectionResponseActionResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export type ChangeNetworkProtectionResponseActionError = AddNetworkRouteResponseActionError; export interface ChangeNetworkProtectionResponseAction { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: ChangeNetworkProtectionResponseActionStatus; /** 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: ChangeNetworkProtectionResponseActionResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: AddNetworkRouteResponseActionError | null; } export interface ChangeNetworkProtectionResponse { action: ChangeNetworkProtectionResponseAction; } export interface DeleteNetworkRouteRequest { /** ID of the Network. */ id: number; /** Destination network or host of the route. Packages addressed for IPs matching the destination IP prefix will be send to the specified gateway. Must be one of * private IPv4 ranges of RFC1918 * or `0.0.0.0/0`. Must not overlap with * an existing ip_range in any subnets * or with any destinations in other routes * or with `172.31.1.1`. `172.31.1.1` is being used as a gateway for the public network interface of [Servers](#tag/servers). */ destination: string; /** Gateway of the route. Packages addressed for the specified destination will be send to this IP address. Cannot be * the first IP of the networks ip_range, * an IP behind a vSwitch or * `172.31.1.1`. `172.31.1.1` is being used as a gateway for the public network interface of [Servers](#tag/servers). */ gateway: string; } /** Status of the Action. */ export type DeleteNetworkRouteResponseActionStatus = "running" | "success" | "error"; export type DeleteNetworkRouteResponseActionResourcesItem = AddNetworkRouteResponseActionResourcesItem; /** Resources the Action relates to. */ export type DeleteNetworkRouteResponseActionResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export type DeleteNetworkRouteResponseActionError = AddNetworkRouteResponseActionError; export interface DeleteNetworkRouteResponseAction { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: DeleteNetworkRouteResponseActionStatus; /** 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: DeleteNetworkRouteResponseActionResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: AddNetworkRouteResponseActionError | null; } export interface DeleteNetworkRouteResponse { action: DeleteNetworkRouteResponseAction; } export interface DeleteNetworkSubnetRequest { /** ID of the Network. */ id: number; /** IP range in CIDR block notation of the subnet to delete. */ ip_range: string; } /** Status of the Action. */ export type DeleteNetworkSubnetResponseActionStatus = "running" | "success" | "error"; export type DeleteNetworkSubnetResponseActionResourcesItem = AddNetworkRouteResponseActionResourcesItem; /** Resources the Action relates to. */ export type DeleteNetworkSubnetResponseActionResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export type DeleteNetworkSubnetResponseActionError = AddNetworkRouteResponseActionError; export interface DeleteNetworkSubnetResponseAction { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: DeleteNetworkSubnetResponseActionStatus; /** 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: DeleteNetworkSubnetResponseActionResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: AddNetworkRouteResponseActionError | null; } export interface DeleteNetworkSubnetResponse { action: DeleteNetworkSubnetResponseAction; } export interface GetNetworksActionRequest { /** ID of the Action. */ id: number; } /** Status of the Action. */ export type GetNetworksActionResponseActionStatus = "running" | "success" | "error"; export type GetNetworksActionResponseActionResourcesItem = AddNetworkRouteResponseActionResourcesItem; /** Resources the Action relates to. */ export type GetNetworksActionResponseActionResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export type GetNetworksActionResponseActionError = AddNetworkRouteResponseActionError; export interface GetNetworksActionResponseAction { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: GetNetworksActionResponseActionStatus; /** 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: GetNetworksActionResponseActionResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: AddNetworkRouteResponseActionError | null; } export interface GetNetworksActionResponse { action: GetNetworksActionResponseAction; } export type ListNetworkActionsRequestSortItem = | "id" | "id:asc" | "id:desc" | "command" | "command:asc" | "command:desc" | "status" | "status:asc" | "status:desc" | "started" | "started:asc" | "started:desc" | "finished" | "finished:asc" | "finished:desc"; export type ListNetworkActionsRequestSortList = Array< ListNetworkActionsRequestSortItem | (string & {}) >; /** Status of the Action. */ export type ListNetworkActionsRequestStatusItem = "running" | "success" | "error"; export type ListNetworkActionsRequestStatusList = Array< ListNetworkActionsRequestStatusItem | (string & {}) >; export interface ListNetworkActionsRequest { /** ID of the Network. */ id: number; /** Sort actions by field and direction. May be used multiple times. For more information, see "[Sorting](#description/sorting)". */ sort?: ListNetworkActionsRequestSortList; /** Filter the actions by status. May be used multiple times. The response will only contain actions matching the specified statuses. */ status?: ListNetworkActionsRequestStatusList; /** 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; } /** Status of the Action. */ export type ListNetworkActionsResponseActionsItemStatus = "running" | "success" | "error"; export type ListNetworkActionsResponseActionsItemResourcesItem = AddNetworkRouteResponseActionResourcesItem; /** Resources the Action relates to. */ export type ListNetworkActionsResponseActionsItemResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export type ListNetworkActionsResponseActionsItemError = AddNetworkRouteResponseActionError; export interface ListNetworkActionsResponseActionsItem { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: ListNetworkActionsResponseActionsItemStatus; /** 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: ListNetworkActionsResponseActionsItemResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: AddNetworkRouteResponseActionError | null; } export type ListNetworkActionsResponseActionsList = Array; /** See "[Pagination](#description/pagination)" for more information. */ export interface ListNetworkActionsResponseMetaPagination { /** 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 ListNetworkActionsResponseMeta { /** See "[Pagination](#description/pagination)" for more information. */ pagination: ListNetworkActionsResponseMetaPagination; } export interface ListNetworkActionsResponse { actions: ListNetworkActionsResponseActionsList; meta: ListNetworkActionsResponseMeta; } export type ListNetworksActionsRequestIdList = Array; export type ListNetworksActionsRequestSortItem = | "id" | "id:asc" | "id:desc" | "command" | "command:asc" | "command:desc" | "status" | "status:asc" | "status:desc" | "started" | "started:asc" | "started:desc" | "finished" | "finished:asc" | "finished:desc"; export type ListNetworksActionsRequestSortList = Array< ListNetworksActionsRequestSortItem | (string & {}) >; /** Status of the Action. */ export type ListNetworksActionsRequestStatusItem = "running" | "success" | "error"; export type ListNetworksActionsRequestStatusList = Array< ListNetworksActionsRequestStatusItem | (string & {}) >; export interface ListNetworksActionsRequest { /** Filter the actions by ID. May be used multiple times. The response will only contain actions matching the specified IDs. */ id?: ListNetworksActionsRequestIdList; /** Sort actions by field and direction. May be used multiple times. For more information, see "[Sorting](#description/sorting)". */ sort?: ListNetworksActionsRequestSortList; /** Filter the actions by status. May be used multiple times. The response will only contain actions matching the specified statuses. */ status?: ListNetworksActionsRequestStatusList; /** 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; } /** Status of the Action. */ export type ListNetworksActionsResponseActionsItemStatus = "running" | "success" | "error"; export type ListNetworksActionsResponseActionsItemResourcesItem = AddNetworkRouteResponseActionResourcesItem; /** Resources the Action relates to. */ export type ListNetworksActionsResponseActionsItemResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export type ListNetworksActionsResponseActionsItemError = AddNetworkRouteResponseActionError; export interface ListNetworksActionsResponseActionsItem { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: ListNetworksActionsResponseActionsItemStatus; /** 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: ListNetworksActionsResponseActionsItemResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: AddNetworkRouteResponseActionError | null; } export type ListNetworksActionsResponseActionsList = Array; /** See "[Pagination](#description/pagination)" for more information. */ export type ListNetworksActionsResponseMetaPagination = ListNetworkActionsResponseMetaPagination; export type ListNetworksActionsResponseMeta = ListNetworkActionsResponseMeta; export interface ListNetworksActionsResponse { actions: ListNetworksActionsResponseActionsList; meta: ListNetworkActionsResponseMeta; } export type AddNetworkRouteError = HetznerOpError; /** Add a route to a Network Adds a route entry to a [Network](#tag/networks). If a change is currently being performed on this [Network](#tag/networks), a error response with code `conflict` will be returned. */ export const addNetworkRoute: API.OperationMethod< AddNetworkRouteRequest, AddNetworkRouteResponse, AddNetworkRouteError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type AddNetworkSubnetError = HetznerOpError; /** Add a subnet to a Network Adds a new subnet to the [Network](#tag/networks). If the subnet `ip_range` is not provided, the first available `/24` IP range will be used. If a change is currently being performed on this [Network](#tag/networks), a error response with code `conflict` will be returned. */ export const addNetworkSubnet: API.OperationMethod< AddNetworkSubnetRequest, AddNetworkSubnetResponse, AddNetworkSubnetError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(24, __c3, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type ChangeNetworkIpRangeError = HetznerOpError; /** Change IP range of a Network Changes the IP range of a [Network](#tag/networks). The following restrictions apply to changing the IP range: - IP ranges can only be extended and never shrunk. - IPs can only be added to the end of the existing range, therefore only the netmask is allowed to be changed. To update the routes on the connected [Servers](#tag/servers), they need to be rebooted or the routes to be updated manually. For example if the [Network](#tag/networks) has a range of `10.0.0.0/16` to extend it the new range has to start with the IP `10.0.0.0` as well. The netmask `/16` can be changed to a smaller one then `16` therefore increasing the IP range. A valid entry would be `10.0.0.0/15`, `10.0.0.0/14` or `10.0.0.0/13` and so on. If a change is currently being performed on this [Network](#tag/networks), a error response with code `conflict` will be returned. */ export const changeNetworkIpRange: API.OperationMethod< ChangeNetworkIpRangeRequest, ChangeNetworkIpRangeResponse, ChangeNetworkIpRangeError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(32, __c4, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type ChangeNetworkProtectionError = HetznerOpError; /** Change Network Protection Changes the protection settings of a [Network](#tag/networks). If a change is currently being performed on this [Network](#tag/networks), a error response with code `conflict` will be returned. */ export const changeNetworkProtection: API.OperationMethod< ChangeNetworkProtectionRequest, ChangeNetworkProtectionResponse, ChangeNetworkProtectionError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(40, __c5, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type DeleteNetworkRouteError = HetznerOpError; /** Delete a route from a Network Delete a route entry from a [Network](#tag/networks). If a change is currently being performed on this [Network](#tag/networks), a error response with code `conflict` will be returned. */ export const deleteNetworkRoute: API.OperationMethod< DeleteNetworkRouteRequest, DeleteNetworkRouteResponse, DeleteNetworkRouteError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(48, __c6, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type DeleteNetworkSubnetError = HetznerOpError; /** Delete a subnet from a Network Deletes a single subnet entry from a [Network](#tag/networks). Subnets containing attached resources can not be deleted, they must be detached beforehand. If a change is currently being performed on this [Network](#tag/networks), a error response with code `conflict` will be returned. */ export const deleteNetworkSubnet: API.OperationMethod< DeleteNetworkSubnetRequest, DeleteNetworkSubnetResponse, DeleteNetworkSubnetError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(56, __c7, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type GetNetworksActionError = HetznerOpError; /** Get an Action Returns a single [Action](#tag/actions). */ export const getNetworksAction: API.OperationMethod< GetNetworksActionRequest, GetNetworksActionResponse, GetNetworksActionError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(64, __c8, 0) as any as S.Schema, output: __S(8, __c1, 0) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type ListNetworkActionsError = HetznerOpError; /** List Actions for a Network Lists [Actions](#tag/actions) for a [Network](#tag/networks). Use the provided URI parameters to modify the result. */ export const listNetworkActions: API.PaginatedOperationMethod< ListNetworkActionsRequest, ListNetworkActionsResponse, ListNetworkActionsError, HetznerOpContext, ListNetworkActionsResponseActionsItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: __S(72, __c9, 0) as any as S.Schema, output: __S(84, __c10, 4) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "meta.pagination.next_page", items: "actions", pageSize: "per_page", } as const, }), paginatePageNumber, ) as any; export type ListNetworksActionsError = HetznerOpError; /** List Actions Lists multiple [Actions](#tag/actions). Use the provided URI parameters to modify the result. */ export const listNetworksActions: API.PaginatedOperationMethod< ListNetworksActionsRequest, ListNetworksActionsResponse, ListNetworksActionsError, HetznerOpContext, ListNetworksActionsResponseActionsItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: __S(89, __c11, 1) as any as S.Schema, output: __S(84, __c10, 4) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "meta.pagination.next_page", items: "actions", pageSize: "per_page", } as const, }), paginatePageNumber, ) as any; // 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({ id: S.Number.pipe(T.Label()), destination: S.String, gateway: S.String, }).pipe(T.Http({ method: "POST", uri: "/networks/{id}/actions/add_route", code: 200 })), ).annotate({ identifier: "AddNetworkRouteRequest" }); } } function __c1(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ action: __S(19, __c2, 3), }), ).annotate({ identifier: "AddNetworkRouteResponse" }); } } function __c2(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number, type: S.String, }), ).annotate({ identifier: "AddNetworkRouteResponseActionResourcesItem" }); case 1: return S.Array(__S(16, __c2, 0)); case 2: return S.suspend(() => S.Struct({ code: S.String, message: S.String, }), ).annotate({ identifier: "AddNetworkRouteResponseActionError" }); 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(17, __c2, 1), error: S.NullOr(__S(18, __c2, 2)), }), ).annotate({ identifier: "AddNetworkRouteResponseAction" }); } } function __c3(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number.pipe(T.Label()), type: S.String, ip_range: S.optional(S.String), network_zone: S.String, vswitch_id: S.optional(S.Number), }).pipe(T.Http({ method: "POST", uri: "/networks/{id}/actions/add_subnet", code: 200 })), ).annotate({ identifier: "AddNetworkSubnetRequest" }); } } function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number.pipe(T.Label()), ip_range: S.String, }).pipe( T.Http({ method: "POST", uri: "/networks/{id}/actions/change_ip_range", code: 200 }), ), ).annotate({ identifier: "ChangeNetworkIpRangeRequest" }); } } function __c5(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number.pipe(T.Label()), delete: S.optional(S.Boolean), }).pipe( T.Http({ method: "POST", uri: "/networks/{id}/actions/change_protection", code: 200 }), ), ).annotate({ identifier: "ChangeNetworkProtectionRequest" }); } } function __c6(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number.pipe(T.Label()), destination: S.String, gateway: S.String, }).pipe(T.Http({ method: "POST", uri: "/networks/{id}/actions/delete_route", code: 200 })), ).annotate({ identifier: "DeleteNetworkRouteRequest" }); } } function __c7(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number.pipe(T.Label()), ip_range: S.String, }).pipe(T.Http({ method: "POST", uri: "/networks/{id}/actions/delete_subnet", code: 200 })), ).annotate({ identifier: "DeleteNetworkSubnetRequest" }); } } function __c8(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number.pipe(T.Label()), }).pipe(T.Http({ method: "GET", uri: "/networks/actions/{id}", code: 200 })), ).annotate({ identifier: "GetNetworksActionRequest" }); } } function __c9(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number.pipe(T.Label()), sort: S.optional(__S(80, __c10, 0).pipe(T.Query())), status: S.optional(__S(80, __c10, 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: "/networks/{id}/actions", code: 200 })), ).annotate({ identifier: "ListNetworkActionsRequest" }); } } function __c10(j: number): any { switch (j) { case 0: return S.Array(S.String); case 1: return S.Array(__S(19, __c2, 3)); case 2: 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: "ListNetworkActionsResponseMetaPagination" }); case 3: return S.suspend(() => S.Struct({ pagination: __S(82, __c10, 2), }), ).annotate({ identifier: "ListNetworkActionsResponseMeta" }); case 4: return S.suspend(() => S.Struct({ actions: __S(81, __c10, 1), meta: __S(83, __c10, 3), }), ).annotate({ identifier: "ListNetworkActionsResponse" }); } } function __c11(j: number): any { switch (j) { case 0: return S.Array(S.Number); case 1: return S.suspend(() => S.Struct({ id: S.optional(__S(88, __c11, 0).pipe(T.Query())), sort: S.optional(__S(80, __c10, 0).pipe(T.Query())), status: S.optional(__S(80, __c10, 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: "/networks/actions", code: 200 })), ).annotate({ identifier: "ListNetworksActionsRequest" }); } } // 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)); }