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 }; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type CreateFirewallRequestLabelsMap = { [key: string]: string | undefined }; /** Traffic direction in which the rule should be applied to. Use `source_ips` for direction `in` and `destination_ips` for direction `out` to specify IPs. */ export type CreateFirewallRequestRulesItemDirection = "in" | "out"; /** List of permitted IPv4/IPv6 addresses for incoming traffic. The `direction` must be set to `in`. IPs must be provided in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ export type CreateFirewallRequestRulesItemSourceIpsList = Array; /** List of permitted IPv4/IPv6 addresses for outgoing traffic. The `direction` must be set to `out`. IPs must be in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ export type CreateFirewallRequestRulesItemDestinationIpsList = Array; /** Network protocol to apply the rule for. */ export type CreateFirewallRequestRulesItemProtocol = "tcp" | "udp" | "icmp" | "esp" | "gre"; export interface CreateFirewallRequestRulesItem { /** Description of the rule. */ description?: string | null; /** Traffic direction in which the rule should be applied to. Use `source_ips` for direction `in` and `destination_ips` for direction `out` to specify IPs. */ direction: CreateFirewallRequestRulesItemDirection | (string & {}); /** List of permitted IPv4/IPv6 addresses for incoming traffic. The `direction` must be set to `in`. IPs must be provided in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ source_ips?: CreateFirewallRequestRulesItemSourceIpsList; /** List of permitted IPv4/IPv6 addresses for outgoing traffic. The `direction` must be set to `out`. IPs must be in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ destination_ips?: CreateFirewallRequestRulesItemDestinationIpsList; /** Network protocol to apply the rule for. */ protocol: CreateFirewallRequestRulesItemProtocol | (string & {}); /** Port or port range to apply the rule for. Only applicable for protocols `tcp` and `udp`. A port range can be specified by separating lower and upper bounds with a dash. `1024-5000` will include all ports starting from 1024 up to port 5000. */ port?: string; } /** Array of rules. Rules are limited to 50 entries per [Firewall](#tag/firewalls) and [500 effective rules](https://docs.hetzner.com/cloud/firewalls/overview#limits). */ export type CreateFirewallRequestRulesList = Array; /** Type of the resource. */ export type CreateFirewallRequestApplyToItemType = "server" | "label_selector"; /** [Server](#tag/servers) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `server`, otherwise `null`. */ export interface CreateFirewallRequestApplyToItemServer { /** ID of the [Server](#tag/servers). */ id: number; } /** [Label Selector](#description/label-selector) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `label_selector`, otherwise `null`. */ export interface CreateFirewallRequestApplyToItemLabelSelector { /** The selector. */ selector: string; } export interface CreateFirewallRequestApplyToItem { /** Type of the resource. */ type: CreateFirewallRequestApplyToItemType | (string & {}); /** [Server](#tag/servers) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `server`, otherwise `null`. */ server?: CreateFirewallRequestApplyToItemServer; /** [Label Selector](#description/label-selector) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `label_selector`, otherwise `null`. */ label_selector?: CreateFirewallRequestApplyToItemLabelSelector; } /** Resources to apply the [Firewall](#tag/firewalls) to. Resources added directly are taking precedence over those added via a [Label Selector](#description/label-selector). */ export type CreateFirewallRequestApplyToList = Array; export interface CreateFirewallRequest { /** Name of the [Firewall](#tag/firewalls). Must be unique per Project. */ name: string; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels?: CreateFirewallRequestLabelsMap; /** Array of rules. Rules are limited to 50 entries per [Firewall](#tag/firewalls) and [500 effective rules](https://docs.hetzner.com/cloud/firewalls/overview#limits). */ rules?: CreateFirewallRequestRulesList; /** Resources to apply the [Firewall](#tag/firewalls) to. Resources added directly are taking precedence over those added via a [Label Selector](#description/label-selector). */ apply_to?: CreateFirewallRequestApplyToList; } /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type CreateFirewallResponseFirewallLabelsMap = { [key: string]: string | undefined }; /** Traffic direction in which the rule should be applied to. Use `source_ips` for direction `in` and `destination_ips` for direction `out` to specify IPs. */ export type CreateFirewallResponseFirewallRulesItemDirection = "in" | "out"; /** List of permitted IPv4/IPv6 addresses for incoming traffic. The `direction` must be set to `in`. IPs must be provided in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ export type CreateFirewallResponseFirewallRulesItemSourceIpsList = Array; /** List of permitted IPv4/IPv6 addresses for outgoing traffic. The `direction` must be set to `out`. IPs must be in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ export type CreateFirewallResponseFirewallRulesItemDestinationIpsList = Array; /** Network protocol to apply the rule for. */ export type CreateFirewallResponseFirewallRulesItemProtocol = | "tcp" | "udp" | "icmp" | "esp" | "gre"; export interface CreateFirewallResponseFirewallRulesItem { /** Description of the rule. */ description?: string | null; /** Traffic direction in which the rule should be applied to. Use `source_ips` for direction `in` and `destination_ips` for direction `out` to specify IPs. */ direction: CreateFirewallResponseFirewallRulesItemDirection; /** List of permitted IPv4/IPv6 addresses for incoming traffic. The `direction` must be set to `in`. IPs must be provided in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ source_ips: CreateFirewallResponseFirewallRulesItemSourceIpsList; /** List of permitted IPv4/IPv6 addresses for outgoing traffic. The `direction` must be set to `out`. IPs must be in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ destination_ips: CreateFirewallResponseFirewallRulesItemDestinationIpsList; /** Network protocol to apply the rule for. */ protocol: CreateFirewallResponseFirewallRulesItemProtocol; /** Port or port range to apply the rule for. Only applicable for protocols `tcp` and `udp`. A port range can be specified by separating lower and upper bounds with a dash. `1024-5000` will include all ports starting from 1024 up to port 5000. */ port: string | null; } export type CreateFirewallResponseFirewallRulesList = Array; /** The type of resource to apply. */ export type CreateFirewallResponseFirewallAppliedToItemType = "server" | "label_selector"; /** [Server](#tag/servers) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `server`, otherwise `null`. */ export type CreateFirewallResponseFirewallAppliedToItemServer = CreateFirewallRequestApplyToItemServer; /** [Label Selector](#description/label-selector) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `label_selector`, otherwise `null`. */ export type CreateFirewallResponseFirewallAppliedToItemLabelSelector = CreateFirewallRequestApplyToItemLabelSelector; /** Type of resource. */ export type CreateFirewallResponseFirewallAppliedToItemAppliedToResourcesItemType = "server"; /** [Server](#tag/servers) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `server`, otherwise `null`. */ export type CreateFirewallResponseFirewallAppliedToItemAppliedToResourcesItemServer = CreateFirewallRequestApplyToItemServer; export interface CreateFirewallResponseFirewallAppliedToItemAppliedToResourcesItem { /** Type of resource. */ type?: CreateFirewallResponseFirewallAppliedToItemAppliedToResourcesItemType; /** [Server](#tag/servers) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `server`, otherwise `null`. */ server?: CreateFirewallRequestApplyToItemServer; } /** Resources applied to via this [Label Selector](#description/label-selector). */ export type CreateFirewallResponseFirewallAppliedToItemAppliedToResourcesList = Array; export interface CreateFirewallResponseFirewallAppliedToItem { /** The type of resource to apply. */ type: CreateFirewallResponseFirewallAppliedToItemType; /** [Server](#tag/servers) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `server`, otherwise `null`. */ server?: CreateFirewallRequestApplyToItemServer; /** [Label Selector](#description/label-selector) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `label_selector`, otherwise `null`. */ label_selector?: CreateFirewallRequestApplyToItemLabelSelector; /** Resources applied to via this [Label Selector](#description/label-selector). */ applied_to_resources?: CreateFirewallResponseFirewallAppliedToItemAppliedToResourcesList; } export type CreateFirewallResponseFirewallAppliedToList = Array; export interface CreateFirewallResponseFirewall { /** ID of the [Firewall](#tag/firewalls). */ id: number; /** Name of the [Firewall](#tag/firewalls). Must be unique per Project. */ name: string; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels?: CreateFirewallResponseFirewallLabelsMap; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; rules: CreateFirewallResponseFirewallRulesList; applied_to: CreateFirewallResponseFirewallAppliedToList; } /** Status of the Action. */ export type CreateFirewallResponseActionsItemStatus = "running" | "success" | "error"; export interface CreateFirewallResponseActionsItemResourcesItem { /** ID of the Resource. */ id: number; /** Type of the Resource. */ type: string; } /** Resources the Action relates to. */ export type CreateFirewallResponseActionsItemResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export interface CreateFirewallResponseActionsItemError { /** Fixed error code for machines. */ code: string; /** Error message for humans. */ message: string; } export interface CreateFirewallResponseActionsItem { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: CreateFirewallResponseActionsItemStatus; /** 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: CreateFirewallResponseActionsItemResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: CreateFirewallResponseActionsItemError | null; } export type CreateFirewallResponseActionsList = Array; export interface CreateFirewallResponse { firewall?: CreateFirewallResponseFirewall; actions?: CreateFirewallResponseActionsList; } export interface DeleteFirewallRequest { /** ID of the Firewall. */ id: number; } export interface DeleteFirewallResponse {} export interface GetFirewallRequest { /** ID of the Firewall. */ id: number; } /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type GetFirewallResponseFirewallLabelsMap = { [key: string]: string | undefined }; /** Traffic direction in which the rule should be applied to. Use `source_ips` for direction `in` and `destination_ips` for direction `out` to specify IPs. */ export type GetFirewallResponseFirewallRulesItemDirection = "in" | "out"; /** List of permitted IPv4/IPv6 addresses for incoming traffic. The `direction` must be set to `in`. IPs must be provided in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ export type GetFirewallResponseFirewallRulesItemSourceIpsList = Array; /** List of permitted IPv4/IPv6 addresses for outgoing traffic. The `direction` must be set to `out`. IPs must be in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ export type GetFirewallResponseFirewallRulesItemDestinationIpsList = Array; /** Network protocol to apply the rule for. */ export type GetFirewallResponseFirewallRulesItemProtocol = "tcp" | "udp" | "icmp" | "esp" | "gre"; export interface GetFirewallResponseFirewallRulesItem { /** Description of the rule. */ description?: string | null; /** Traffic direction in which the rule should be applied to. Use `source_ips` for direction `in` and `destination_ips` for direction `out` to specify IPs. */ direction: GetFirewallResponseFirewallRulesItemDirection; /** List of permitted IPv4/IPv6 addresses for incoming traffic. The `direction` must be set to `in`. IPs must be provided in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ source_ips: GetFirewallResponseFirewallRulesItemSourceIpsList; /** List of permitted IPv4/IPv6 addresses for outgoing traffic. The `direction` must be set to `out`. IPs must be in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ destination_ips: GetFirewallResponseFirewallRulesItemDestinationIpsList; /** Network protocol to apply the rule for. */ protocol: GetFirewallResponseFirewallRulesItemProtocol; /** Port or port range to apply the rule for. Only applicable for protocols `tcp` and `udp`. A port range can be specified by separating lower and upper bounds with a dash. `1024-5000` will include all ports starting from 1024 up to port 5000. */ port: string | null; } export type GetFirewallResponseFirewallRulesList = Array; /** The type of resource to apply. */ export type GetFirewallResponseFirewallAppliedToItemType = "server" | "label_selector"; /** [Server](#tag/servers) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `server`, otherwise `null`. */ export type GetFirewallResponseFirewallAppliedToItemServer = CreateFirewallRequestApplyToItemServer; /** [Label Selector](#description/label-selector) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `label_selector`, otherwise `null`. */ export type GetFirewallResponseFirewallAppliedToItemLabelSelector = CreateFirewallRequestApplyToItemLabelSelector; /** Type of resource. */ export type GetFirewallResponseFirewallAppliedToItemAppliedToResourcesItemType = "server"; /** [Server](#tag/servers) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `server`, otherwise `null`. */ export type GetFirewallResponseFirewallAppliedToItemAppliedToResourcesItemServer = CreateFirewallRequestApplyToItemServer; export interface GetFirewallResponseFirewallAppliedToItemAppliedToResourcesItem { /** Type of resource. */ type?: GetFirewallResponseFirewallAppliedToItemAppliedToResourcesItemType; /** [Server](#tag/servers) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `server`, otherwise `null`. */ server?: CreateFirewallRequestApplyToItemServer; } /** Resources applied to via this [Label Selector](#description/label-selector). */ export type GetFirewallResponseFirewallAppliedToItemAppliedToResourcesList = Array; export interface GetFirewallResponseFirewallAppliedToItem { /** The type of resource to apply. */ type: GetFirewallResponseFirewallAppliedToItemType; /** [Server](#tag/servers) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `server`, otherwise `null`. */ server?: CreateFirewallRequestApplyToItemServer; /** [Label Selector](#description/label-selector) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `label_selector`, otherwise `null`. */ label_selector?: CreateFirewallRequestApplyToItemLabelSelector; /** Resources applied to via this [Label Selector](#description/label-selector). */ applied_to_resources?: GetFirewallResponseFirewallAppliedToItemAppliedToResourcesList; } export type GetFirewallResponseFirewallAppliedToList = Array; export interface GetFirewallResponseFirewall { /** ID of the [Firewall](#tag/firewalls). */ id: number; /** Name of the [Firewall](#tag/firewalls). Must be unique per Project. */ name: string; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels?: GetFirewallResponseFirewallLabelsMap; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; rules: GetFirewallResponseFirewallRulesList; applied_to: GetFirewallResponseFirewallAppliedToList; } export interface GetFirewallResponse { firewall: GetFirewallResponseFirewall; } export type ListFirewallsRequestSortItem = | "id" | "id:asc" | "id:desc" | "name" | "name:asc" | "name:desc" | "created" | "created:asc" | "created:desc"; export type ListFirewallsRequestSortList = Array; export interface ListFirewallsRequest { /** Sort resources by field and direction. May be used multiple times. For more information, see "[Sorting](#description/sorting)". */ sort?: ListFirewallsRequestSortList; /** 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; /** 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; } /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type ListFirewallsResponseFirewallsItemLabelsMap = { [key: string]: string | undefined }; /** Traffic direction in which the rule should be applied to. Use `source_ips` for direction `in` and `destination_ips` for direction `out` to specify IPs. */ export type ListFirewallsResponseFirewallsItemRulesItemDirection = "in" | "out"; /** List of permitted IPv4/IPv6 addresses for incoming traffic. The `direction` must be set to `in`. IPs must be provided in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ export type ListFirewallsResponseFirewallsItemRulesItemSourceIpsList = Array; /** List of permitted IPv4/IPv6 addresses for outgoing traffic. The `direction` must be set to `out`. IPs must be in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ export type ListFirewallsResponseFirewallsItemRulesItemDestinationIpsList = Array; /** Network protocol to apply the rule for. */ export type ListFirewallsResponseFirewallsItemRulesItemProtocol = | "tcp" | "udp" | "icmp" | "esp" | "gre"; export interface ListFirewallsResponseFirewallsItemRulesItem { /** Description of the rule. */ description?: string | null; /** Traffic direction in which the rule should be applied to. Use `source_ips` for direction `in` and `destination_ips` for direction `out` to specify IPs. */ direction: ListFirewallsResponseFirewallsItemRulesItemDirection; /** List of permitted IPv4/IPv6 addresses for incoming traffic. The `direction` must be set to `in`. IPs must be provided in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ source_ips: ListFirewallsResponseFirewallsItemRulesItemSourceIpsList; /** List of permitted IPv4/IPv6 addresses for outgoing traffic. The `direction` must be set to `out`. IPs must be in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ destination_ips: ListFirewallsResponseFirewallsItemRulesItemDestinationIpsList; /** Network protocol to apply the rule for. */ protocol: ListFirewallsResponseFirewallsItemRulesItemProtocol; /** Port or port range to apply the rule for. Only applicable for protocols `tcp` and `udp`. A port range can be specified by separating lower and upper bounds with a dash. `1024-5000` will include all ports starting from 1024 up to port 5000. */ port: string | null; } export type ListFirewallsResponseFirewallsItemRulesList = Array; /** The type of resource to apply. */ export type ListFirewallsResponseFirewallsItemAppliedToItemType = "server" | "label_selector"; /** [Server](#tag/servers) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `server`, otherwise `null`. */ export type ListFirewallsResponseFirewallsItemAppliedToItemServer = CreateFirewallRequestApplyToItemServer; /** [Label Selector](#description/label-selector) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `label_selector`, otherwise `null`. */ export type ListFirewallsResponseFirewallsItemAppliedToItemLabelSelector = CreateFirewallRequestApplyToItemLabelSelector; /** Type of resource. */ export type ListFirewallsResponseFirewallsItemAppliedToItemAppliedToResourcesItemType = "server"; /** [Server](#tag/servers) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `server`, otherwise `null`. */ export type ListFirewallsResponseFirewallsItemAppliedToItemAppliedToResourcesItemServer = CreateFirewallRequestApplyToItemServer; export interface ListFirewallsResponseFirewallsItemAppliedToItemAppliedToResourcesItem { /** Type of resource. */ type?: ListFirewallsResponseFirewallsItemAppliedToItemAppliedToResourcesItemType; /** [Server](#tag/servers) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `server`, otherwise `null`. */ server?: CreateFirewallRequestApplyToItemServer; } /** Resources applied to via this [Label Selector](#description/label-selector). */ export type ListFirewallsResponseFirewallsItemAppliedToItemAppliedToResourcesList = Array; export interface ListFirewallsResponseFirewallsItemAppliedToItem { /** The type of resource to apply. */ type: ListFirewallsResponseFirewallsItemAppliedToItemType; /** [Server](#tag/servers) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `server`, otherwise `null`. */ server?: CreateFirewallRequestApplyToItemServer; /** [Label Selector](#description/label-selector) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `label_selector`, otherwise `null`. */ label_selector?: CreateFirewallRequestApplyToItemLabelSelector; /** Resources applied to via this [Label Selector](#description/label-selector). */ applied_to_resources?: ListFirewallsResponseFirewallsItemAppliedToItemAppliedToResourcesList; } export type ListFirewallsResponseFirewallsItemAppliedToList = Array; export interface ListFirewallsResponseFirewallsItem { /** ID of the [Firewall](#tag/firewalls). */ id: number; /** Name of the [Firewall](#tag/firewalls). Must be unique per Project. */ name: string; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels?: ListFirewallsResponseFirewallsItemLabelsMap; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; rules: ListFirewallsResponseFirewallsItemRulesList; applied_to: ListFirewallsResponseFirewallsItemAppliedToList; } export type ListFirewallsResponseFirewallsList = Array; /** See "[Pagination](#description/pagination)" for more information. */ export interface ListFirewallsResponseMetaPagination { /** 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 ListFirewallsResponseMeta { /** See "[Pagination](#description/pagination)" for more information. */ pagination: ListFirewallsResponseMetaPagination; } export interface ListFirewallsResponse { firewalls: ListFirewallsResponseFirewallsList; meta: ListFirewallsResponseMeta; } /** 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 UpdateFirewallRequestLabelsMap = { [key: string]: string | undefined }; export interface UpdateFirewallRequest { /** ID of the Firewall. */ id: number; /** Name of the [Firewall](#tag/firewalls). 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?: UpdateFirewallRequestLabelsMap; } /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type UpdateFirewallResponseFirewallLabelsMap = { [key: string]: string | undefined }; /** Traffic direction in which the rule should be applied to. Use `source_ips` for direction `in` and `destination_ips` for direction `out` to specify IPs. */ export type UpdateFirewallResponseFirewallRulesItemDirection = "in" | "out"; /** List of permitted IPv4/IPv6 addresses for incoming traffic. The `direction` must be set to `in`. IPs must be provided in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ export type UpdateFirewallResponseFirewallRulesItemSourceIpsList = Array; /** List of permitted IPv4/IPv6 addresses for outgoing traffic. The `direction` must be set to `out`. IPs must be in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ export type UpdateFirewallResponseFirewallRulesItemDestinationIpsList = Array; /** Network protocol to apply the rule for. */ export type UpdateFirewallResponseFirewallRulesItemProtocol = | "tcp" | "udp" | "icmp" | "esp" | "gre"; export interface UpdateFirewallResponseFirewallRulesItem { /** Description of the rule. */ description?: string | null; /** Traffic direction in which the rule should be applied to. Use `source_ips` for direction `in` and `destination_ips` for direction `out` to specify IPs. */ direction: UpdateFirewallResponseFirewallRulesItemDirection; /** List of permitted IPv4/IPv6 addresses for incoming traffic. The `direction` must be set to `in`. IPs must be provided in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ source_ips: UpdateFirewallResponseFirewallRulesItemSourceIpsList; /** List of permitted IPv4/IPv6 addresses for outgoing traffic. The `direction` must be set to `out`. IPs must be in [CIDR block notation](https://wikipedia.org/wiki/CIDR). You can specify 100 CIDR blocks at most. The CIDR blocks may refer to networks (with empty host bits) or single hosts. For example, a network could be defined with `10.0.1.0/24` or `2001:db8:ff00:42::/64`, and a single host with `10.0.1.1/32` or `2001:db8:ff00:42::8329/128`. Use `0.0.0.0/0` to allow any IPv4 addresses and `::/0` to allow any IPv6 addresses. IPv6 CIDRs will be transformed to their canonical form according to [RFC5952](https://datatracker.ietf.org/doc/html/rfc5952#section-4). */ destination_ips: UpdateFirewallResponseFirewallRulesItemDestinationIpsList; /** Network protocol to apply the rule for. */ protocol: UpdateFirewallResponseFirewallRulesItemProtocol; /** Port or port range to apply the rule for. Only applicable for protocols `tcp` and `udp`. A port range can be specified by separating lower and upper bounds with a dash. `1024-5000` will include all ports starting from 1024 up to port 5000. */ port: string | null; } export type UpdateFirewallResponseFirewallRulesList = Array; /** The type of resource to apply. */ export type UpdateFirewallResponseFirewallAppliedToItemType = "server" | "label_selector"; /** [Server](#tag/servers) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `server`, otherwise `null`. */ export type UpdateFirewallResponseFirewallAppliedToItemServer = CreateFirewallRequestApplyToItemServer; /** [Label Selector](#description/label-selector) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `label_selector`, otherwise `null`. */ export type UpdateFirewallResponseFirewallAppliedToItemLabelSelector = CreateFirewallRequestApplyToItemLabelSelector; /** Type of resource. */ export type UpdateFirewallResponseFirewallAppliedToItemAppliedToResourcesItemType = "server"; /** [Server](#tag/servers) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `server`, otherwise `null`. */ export type UpdateFirewallResponseFirewallAppliedToItemAppliedToResourcesItemServer = CreateFirewallRequestApplyToItemServer; export interface UpdateFirewallResponseFirewallAppliedToItemAppliedToResourcesItem { /** Type of resource. */ type?: UpdateFirewallResponseFirewallAppliedToItemAppliedToResourcesItemType; /** [Server](#tag/servers) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `server`, otherwise `null`. */ server?: CreateFirewallRequestApplyToItemServer; } /** Resources applied to via this [Label Selector](#description/label-selector). */ export type UpdateFirewallResponseFirewallAppliedToItemAppliedToResourcesList = Array; export interface UpdateFirewallResponseFirewallAppliedToItem { /** The type of resource to apply. */ type: UpdateFirewallResponseFirewallAppliedToItemType; /** [Server](#tag/servers) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `server`, otherwise `null`. */ server?: CreateFirewallRequestApplyToItemServer; /** [Label Selector](#description/label-selector) the [Firewall](#tag/firewalls) is applied to. Only set for `type` `label_selector`, otherwise `null`. */ label_selector?: CreateFirewallRequestApplyToItemLabelSelector; /** Resources applied to via this [Label Selector](#description/label-selector). */ applied_to_resources?: UpdateFirewallResponseFirewallAppliedToItemAppliedToResourcesList; } export type UpdateFirewallResponseFirewallAppliedToList = Array; export interface UpdateFirewallResponseFirewall { /** ID of the [Firewall](#tag/firewalls). */ id: number; /** Name of the [Firewall](#tag/firewalls). Must be unique per Project. */ name: string; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels?: UpdateFirewallResponseFirewallLabelsMap; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; rules: UpdateFirewallResponseFirewallRulesList; applied_to: UpdateFirewallResponseFirewallAppliedToList; } export interface UpdateFirewallResponse { firewall: UpdateFirewallResponseFirewall; } export type CreateFirewallError = HetznerOpError; /** Create a Firewall Create a [Firewall](#tag/firewalls). #### Operation specific errors */ export const createFirewall: API.OperationMethod< CreateFirewallRequest, CreateFirewallResponse, CreateFirewallError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(4, __c0, 4) as any as S.Schema, output: __S(10, __c0, 10) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type DeleteFirewallError = HetznerOpError; /** Delete a Firewall Deletes the [Firewall](#tag/firewalls). #### Operation specific errors */ export const deleteFirewall: API.OperationMethod< DeleteFirewallRequest, DeleteFirewallResponse, DeleteFirewallError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(32, __c2, 0) as any as S.Schema, output: __S(33, __c2, 1) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type GetFirewallError = HetznerOpError; /** Get a Firewall Returns a single [Firewall](#tag/firewalls). */ export const getFirewall: API.OperationMethod< GetFirewallRequest, GetFirewallResponse, GetFirewallError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(48, __c3, 0) as any as S.Schema, output: __S(64, __c4, 0) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type ListFirewallsError = HetznerOpError; /** List Firewalls Returns all [Firewalls](#tag/firewalls). Use the provided URI parameters to modify the result. */ export const listFirewalls: API.PaginatedOperationMethod< ListFirewallsRequest, ListFirewallsResponse, ListFirewallsError, HetznerOpContext, ListFirewallsResponseFirewallsItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: __S(81, __c5, 1) as any as S.Schema, output: __S(85, __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: "firewalls", pageSize: "per_page", } as const, }), paginatePageNumber, ) as any; export type UpdateFirewallError = HetznerOpError; /** Update a Firewall Update a [Firewall](#tag/firewalls). In case of a parallel running change on the [Firewall](#tag/firewalls) a `conflict` error will be returned. */ export const updateFirewall: API.OperationMethod< UpdateFirewallRequest, UpdateFirewallResponse, UpdateFirewallError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(96, __c6, 0) as any as S.Schema, output: __S(64, __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({ description: S.optional(S.NullOr(S.String)), direction: S.String, source_ips: S.optional(__S(17, __c1, 1)), destination_ips: S.optional(__S(17, __c1, 1)), protocol: S.String, port: S.optional(S.String), }), ).annotate({ identifier: "CreateFirewallRequestRulesItem" }); case 1: return S.Array(__S(0, __c0, 0)); case 2: return S.suspend(() => S.Struct({ type: S.String, server: S.optional(__S(18, __c1, 2)), label_selector: S.optional(__S(19, __c1, 3)), }), ).annotate({ identifier: "CreateFirewallRequestApplyToItem" }); case 3: return S.Array(__S(2, __c0, 2)); case 4: return S.suspend(() => S.Struct({ name: S.String, labels: S.optional(__S(16, __c1, 0)), rules: S.optional(__S(1, __c0, 1)), apply_to: S.optional(__S(3, __c0, 3)), }).pipe(T.Http({ method: "POST", uri: "/firewalls", code: 200 })), ).annotate({ identifier: "CreateFirewallRequest" }); case 5: return S.suspend(() => S.Struct({ id: S.Number, type: S.String, }), ).annotate({ identifier: "CreateFirewallResponseActionsItemResourcesItem" }); case 6: return S.Array(__S(5, __c0, 5)); case 7: return S.suspend(() => S.Struct({ code: S.String, message: S.String, }), ).annotate({ identifier: "CreateFirewallResponseActionsItemError" }); case 8: 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(6, __c0, 6), error: S.NullOr(__S(7, __c0, 7)), }), ).annotate({ identifier: "CreateFirewallResponseActionsItem" }); case 9: return S.Array(__S(8, __c0, 8)); case 10: return S.suspend(() => S.Struct({ firewall: S.optional(__S(26, __c1, 10)), actions: S.optional(__S(9, __c0, 9)), }), ).annotate({ identifier: "CreateFirewallResponse" }); } } function __c1(j: number): any { switch (j) { case 0: return S.Record(S.String, S.String); case 1: return S.Array(S.String); case 2: return S.suspend(() => S.Struct({ id: S.Number, }), ).annotate({ identifier: "CreateFirewallRequestApplyToItemServer" }); case 3: return S.suspend(() => S.Struct({ selector: S.String, }), ).annotate({ identifier: "CreateFirewallRequestApplyToItemLabelSelector" }); case 4: return S.suspend(() => S.Struct({ description: S.optional(S.NullOr(S.String)), direction: S.String, source_ips: __S(17, __c1, 1), destination_ips: __S(17, __c1, 1), protocol: S.String, port: S.NullOr(S.String), }), ).annotate({ identifier: "CreateFirewallResponseFirewallRulesItem" }); case 5: return S.Array(__S(20, __c1, 4)); case 6: return S.suspend(() => S.Struct({ type: S.optional(S.String), server: S.optional(__S(18, __c1, 2)), }), ).annotate({ identifier: "CreateFirewallResponseFirewallAppliedToItemAppliedToResourcesItem", }); case 7: return S.Array(__S(22, __c1, 6)); case 8: return S.suspend(() => S.Struct({ type: S.String, server: S.optional(__S(18, __c1, 2)), label_selector: S.optional(__S(19, __c1, 3)), applied_to_resources: S.optional(__S(23, __c1, 7)), }), ).annotate({ identifier: "CreateFirewallResponseFirewallAppliedToItem" }); case 9: return S.Array(__S(24, __c1, 8)); case 10: return S.suspend(() => S.Struct({ id: S.Number, name: S.String, labels: S.optional(__S(16, __c1, 0)), created: S.String, rules: __S(21, __c1, 5), applied_to: __S(25, __c1, 9), }), ).annotate({ identifier: "CreateFirewallResponseFirewall" }); } } 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: "/firewalls/{id}", code: 200 })), ).annotate({ identifier: "DeleteFirewallRequest" }); case 1: return S.suspend(() => S.Struct({})).annotate({ identifier: "DeleteFirewallResponse" }); } } 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: "/firewalls/{id}", code: 200 })), ).annotate({ identifier: "GetFirewallRequest" }); } } function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ firewall: __S(26, __c1, 10), }), ).annotate({ identifier: "GetFirewallResponse" }); } } function __c5(j: number): any { switch (j) { case 0: return S.Array(S.String); case 1: return S.suspend(() => S.Struct({ sort: S.optional(__S(80, __c5, 0).pipe(T.Query())), name: S.optional(S.String.pipe(T.Query())), label_selector: S.optional(S.String.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: "/firewalls", code: 200 })), ).annotate({ identifier: "ListFirewallsRequest" }); case 2: return S.Array(__S(26, __c1, 10)); 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: "ListFirewallsResponseMetaPagination" }); case 4: return S.suspend(() => S.Struct({ pagination: __S(83, __c5, 3), }), ).annotate({ identifier: "ListFirewallsResponseMeta" }); case 5: return S.suspend(() => S.Struct({ firewalls: __S(82, __c5, 2), meta: __S(84, __c5, 4), }), ).annotate({ identifier: "ListFirewallsResponse" }); } } 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(16, __c1, 0)), }).pipe(T.Http({ method: "PUT", uri: "/firewalls/{id}", code: 200 })), ).annotate({ identifier: "UpdateFirewallRequest" }); } } // 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)); }