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 type * as Redacted from "effect/Redacted"; 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 CreateCertificateRequestLabelsMap = { [key: string]: string | undefined }; /** Choose between uploading a Certificate in PEM format or requesting a managed *Let's Encrypt* Certificate. */ export type CreateCertificateRequestType = "uploaded" | "managed"; /** Domains and subdomains that should be contained in the Certificate issued by *Let's Encrypt*. Required for type `managed` Certificates. */ export type CreateCertificateRequestDomainNamesList = Array; export interface CreateCertificateRequest { /** Name of the Certificate. */ name: string; /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ labels?: CreateCertificateRequestLabelsMap; /** Choose between uploading a Certificate in PEM format or requesting a managed *Let's Encrypt* Certificate. */ type?: CreateCertificateRequestType | (string & {}); /** Certificate and chain in PEM format, in order so that each record directly certifies the one preceding. Required for type `uploaded` Certificates. */ certificate?: string; /** Certificate key in PEM format. Required for type `uploaded` Certificates. */ private_key?: string | Redacted.Redacted; /** Domains and subdomains that should be contained in the Certificate issued by *Let's Encrypt*. Required for type `managed` Certificates. */ domain_names?: CreateCertificateRequestDomainNamesList; } /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type CreateCertificateResponseCertificateLabelsMap = { [key: string]: string | undefined }; /** Type of the Certificate. */ export type CreateCertificateResponseCertificateType = "uploaded" | "managed"; /** Domains and subdomains covered by the Certificate. */ export type CreateCertificateResponseCertificateDomainNamesList = Array; /** Status of the issuance process of the Certificate. */ export type CreateCertificateResponseCertificateStatusIssuance = "pending" | "completed" | "failed"; /** Status of the renewal process of the Certificate. */ export type CreateCertificateResponseCertificateStatusRenewal = | "scheduled" | "pending" | "failed" | "unavailable"; /** If issuance or renewal reports `failed`, this property contains information about what happened. */ export interface CreateCertificateResponseCertificateStatusError { code?: string; message?: string; } /** Current status of a type `managed` Certificate, always *null* for type `uploaded` Certificates. */ export interface CreateCertificateResponseCertificateStatus { /** Status of the issuance process of the Certificate. */ issuance?: CreateCertificateResponseCertificateStatusIssuance; /** Status of the renewal process of the Certificate. */ renewal?: CreateCertificateResponseCertificateStatusRenewal; /** If issuance or renewal reports `failed`, this property contains information about what happened. */ error?: CreateCertificateResponseCertificateStatusError | null; } export interface CreateCertificateResponseCertificateUsedByItem { /** ID of resource referenced. */ id: number; /** Type of resource referenced. */ type: string; } /** Resources currently using the Certificate. */ export type CreateCertificateResponseCertificateUsedByList = Array; export interface CreateCertificateResponseCertificate { /** ID of the [Certificate](#tag/certificates). */ 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: CreateCertificateResponseCertificateLabelsMap; /** Type of the Certificate. */ type?: CreateCertificateResponseCertificateType; /** Certificate and chain in PEM format, in order so that each record directly certifies the one preceding. */ certificate: string | null; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; /** Point in time when the Certificate becomes valid (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ not_valid_before: string | null; /** Point in time when the Certificate stops being valid (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ not_valid_after: string | null; /** Domains and subdomains covered by the Certificate. */ domain_names: CreateCertificateResponseCertificateDomainNamesList; /** SHA256 fingerprint of the Certificate. */ fingerprint: string | null; /** Current status of a type `managed` Certificate, always *null* for type `uploaded` Certificates. */ status?: CreateCertificateResponseCertificateStatus | null; /** Resources currently using the Certificate. */ used_by: CreateCertificateResponseCertificateUsedByList; } /** Status of the Action. */ export type CreateCertificateResponseActionStatus = "running" | "success" | "error"; export interface CreateCertificateResponseActionResourcesItem { /** ID of the Resource. */ id: number; /** Type of the Resource. */ type: string; } /** Resources the Action relates to. */ export type CreateCertificateResponseActionResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export interface CreateCertificateResponseActionError { /** Fixed error code for machines. */ code: string; /** Error message for humans. */ message: string; } export interface CreateCertificateResponseAction { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: CreateCertificateResponseActionStatus; /** 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: CreateCertificateResponseActionResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: CreateCertificateResponseActionError | null; } export interface CreateCertificateResponse { certificate: CreateCertificateResponseCertificate; action?: CreateCertificateResponseAction | null; } export interface DeleteCertificateRequest { /** ID of the Certificate. */ id: number; } export interface DeleteCertificateResponse {} export interface GetCertificateRequest { /** ID of the Certificate. */ id: number; } /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type GetCertificateResponseCertificateLabelsMap = { [key: string]: string | undefined }; /** Type of the Certificate. */ export type GetCertificateResponseCertificateType = "uploaded" | "managed"; /** Domains and subdomains covered by the Certificate. */ export type GetCertificateResponseCertificateDomainNamesList = Array; /** Status of the issuance process of the Certificate. */ export type GetCertificateResponseCertificateStatusIssuance = "pending" | "completed" | "failed"; /** Status of the renewal process of the Certificate. */ export type GetCertificateResponseCertificateStatusRenewal = | "scheduled" | "pending" | "failed" | "unavailable"; /** If issuance or renewal reports `failed`, this property contains information about what happened. */ export type GetCertificateResponseCertificateStatusError = CreateCertificateResponseCertificateStatusError; /** Current status of a type `managed` Certificate, always *null* for type `uploaded` Certificates. */ export interface GetCertificateResponseCertificateStatus { /** Status of the issuance process of the Certificate. */ issuance?: GetCertificateResponseCertificateStatusIssuance; /** Status of the renewal process of the Certificate. */ renewal?: GetCertificateResponseCertificateStatusRenewal; /** If issuance or renewal reports `failed`, this property contains information about what happened. */ error?: CreateCertificateResponseCertificateStatusError | null; } export type GetCertificateResponseCertificateUsedByItem = CreateCertificateResponseCertificateUsedByItem; /** Resources currently using the Certificate. */ export type GetCertificateResponseCertificateUsedByList = Array; export interface GetCertificateResponseCertificate { /** ID of the [Certificate](#tag/certificates). */ 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: GetCertificateResponseCertificateLabelsMap; /** Type of the Certificate. */ type?: GetCertificateResponseCertificateType; /** Certificate and chain in PEM format, in order so that each record directly certifies the one preceding. */ certificate: string | null; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; /** Point in time when the Certificate becomes valid (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ not_valid_before: string | null; /** Point in time when the Certificate stops being valid (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ not_valid_after: string | null; /** Domains and subdomains covered by the Certificate. */ domain_names: GetCertificateResponseCertificateDomainNamesList; /** SHA256 fingerprint of the Certificate. */ fingerprint: string | null; /** Current status of a type `managed` Certificate, always *null* for type `uploaded` Certificates. */ status?: GetCertificateResponseCertificateStatus | null; /** Resources currently using the Certificate. */ used_by: GetCertificateResponseCertificateUsedByList; } export interface GetCertificateResponse { certificate: GetCertificateResponseCertificate; } export type ListCertificatesRequestSortItem = | "id" | "id:asc" | "id:desc" | "name" | "name:asc" | "name:desc" | "created" | "created:asc" | "created:desc"; export type ListCertificatesRequestSortList = Array< ListCertificatesRequestSortItem | (string & {}) >; /** Type of the Certificate. */ export type ListCertificatesRequestTypeItem = "uploaded" | "managed"; export type ListCertificatesRequestTypeList = Array< ListCertificatesRequestTypeItem | (string & {}) >; export interface ListCertificatesRequest { /** Sort resources by field and direction. May be used multiple times. For more information, see "[Sorting](#description/sorting)". */ sort?: ListCertificatesRequestSortList; /** 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 resources by type. May be used multiple times. The response will only contain the resources with the specified type. */ type?: ListCertificatesRequestTypeList; /** 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 ListCertificatesResponseCertificatesItemLabelsMap = { [key: string]: string | undefined; }; /** Type of the Certificate. */ export type ListCertificatesResponseCertificatesItemType = "uploaded" | "managed"; /** Domains and subdomains covered by the Certificate. */ export type ListCertificatesResponseCertificatesItemDomainNamesList = Array; /** Status of the issuance process of the Certificate. */ export type ListCertificatesResponseCertificatesItemStatusIssuance = | "pending" | "completed" | "failed"; /** Status of the renewal process of the Certificate. */ export type ListCertificatesResponseCertificatesItemStatusRenewal = | "scheduled" | "pending" | "failed" | "unavailable"; /** If issuance or renewal reports `failed`, this property contains information about what happened. */ export type ListCertificatesResponseCertificatesItemStatusError = CreateCertificateResponseCertificateStatusError; /** Current status of a type `managed` Certificate, always *null* for type `uploaded` Certificates. */ export interface ListCertificatesResponseCertificatesItemStatus { /** Status of the issuance process of the Certificate. */ issuance?: ListCertificatesResponseCertificatesItemStatusIssuance; /** Status of the renewal process of the Certificate. */ renewal?: ListCertificatesResponseCertificatesItemStatusRenewal; /** If issuance or renewal reports `failed`, this property contains information about what happened. */ error?: CreateCertificateResponseCertificateStatusError | null; } export type ListCertificatesResponseCertificatesItemUsedByItem = CreateCertificateResponseCertificateUsedByItem; /** Resources currently using the Certificate. */ export type ListCertificatesResponseCertificatesItemUsedByList = Array; export interface ListCertificatesResponseCertificatesItem { /** ID of the [Certificate](#tag/certificates). */ 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: ListCertificatesResponseCertificatesItemLabelsMap; /** Type of the Certificate. */ type?: ListCertificatesResponseCertificatesItemType; /** Certificate and chain in PEM format, in order so that each record directly certifies the one preceding. */ certificate: string | null; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; /** Point in time when the Certificate becomes valid (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ not_valid_before: string | null; /** Point in time when the Certificate stops being valid (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ not_valid_after: string | null; /** Domains and subdomains covered by the Certificate. */ domain_names: ListCertificatesResponseCertificatesItemDomainNamesList; /** SHA256 fingerprint of the Certificate. */ fingerprint: string | null; /** Current status of a type `managed` Certificate, always *null* for type `uploaded` Certificates. */ status?: ListCertificatesResponseCertificatesItemStatus | null; /** Resources currently using the Certificate. */ used_by: ListCertificatesResponseCertificatesItemUsedByList; } export type ListCertificatesResponseCertificatesList = Array; /** See "[Pagination](#description/pagination)" for more information. */ export interface ListCertificatesResponseMetaPagination { /** 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 ListCertificatesResponseMeta { /** See "[Pagination](#description/pagination)" for more information. */ pagination: ListCertificatesResponseMetaPagination; } export interface ListCertificatesResponse { certificates: ListCertificatesResponseCertificatesList; meta: ListCertificatesResponseMeta; } /** 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 UpdateCertificateRequestLabelsMap = { [key: string]: string | undefined }; export interface UpdateCertificateRequest { /** ID of the Certificate. */ id: number; /** New Certificate name. */ 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?: UpdateCertificateRequestLabelsMap; } /** User-defined labels (`key/value` pairs) for the Resource. For more information, see "[Labels](#description/labels)". */ export type UpdateCertificateResponseCertificateLabelsMap = { [key: string]: string | undefined }; /** Type of the Certificate. */ export type UpdateCertificateResponseCertificateType = "uploaded" | "managed"; /** Domains and subdomains covered by the Certificate. */ export type UpdateCertificateResponseCertificateDomainNamesList = Array; /** Status of the issuance process of the Certificate. */ export type UpdateCertificateResponseCertificateStatusIssuance = "pending" | "completed" | "failed"; /** Status of the renewal process of the Certificate. */ export type UpdateCertificateResponseCertificateStatusRenewal = | "scheduled" | "pending" | "failed" | "unavailable"; /** If issuance or renewal reports `failed`, this property contains information about what happened. */ export type UpdateCertificateResponseCertificateStatusError = CreateCertificateResponseCertificateStatusError; /** Current status of a type `managed` Certificate, always *null* for type `uploaded` Certificates. */ export interface UpdateCertificateResponseCertificateStatus { /** Status of the issuance process of the Certificate. */ issuance?: UpdateCertificateResponseCertificateStatusIssuance; /** Status of the renewal process of the Certificate. */ renewal?: UpdateCertificateResponseCertificateStatusRenewal; /** If issuance or renewal reports `failed`, this property contains information about what happened. */ error?: CreateCertificateResponseCertificateStatusError | null; } export type UpdateCertificateResponseCertificateUsedByItem = CreateCertificateResponseCertificateUsedByItem; /** Resources currently using the Certificate. */ export type UpdateCertificateResponseCertificateUsedByList = Array; export interface UpdateCertificateResponseCertificate { /** ID of the [Certificate](#tag/certificates). */ 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: UpdateCertificateResponseCertificateLabelsMap; /** Type of the Certificate. */ type?: UpdateCertificateResponseCertificateType; /** Certificate and chain in PEM format, in order so that each record directly certifies the one preceding. */ certificate: string | null; /** Point in time when the Resource was created (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ created: string; /** Point in time when the Certificate becomes valid (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ not_valid_before: string | null; /** Point in time when the Certificate stops being valid (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ not_valid_after: string | null; /** Domains and subdomains covered by the Certificate. */ domain_names: UpdateCertificateResponseCertificateDomainNamesList; /** SHA256 fingerprint of the Certificate. */ fingerprint: string | null; /** Current status of a type `managed` Certificate, always *null* for type `uploaded` Certificates. */ status?: UpdateCertificateResponseCertificateStatus | null; /** Resources currently using the Certificate. */ used_by: UpdateCertificateResponseCertificateUsedByList; } export interface UpdateCertificateResponse { certificate: UpdateCertificateResponseCertificate; } export type CreateCertificateError = HetznerOpError; /** Create a Certificate Creates a new Certificate. The default type **uploaded** allows for uploading your existing `certificate` and `private_key` in PEM format. You have to monitor its expiration date and handle renewal yourself. In contrast, type **managed** requests a new Certificate from *Let's Encrypt* for the specified `domain_names`. Only domains managed by *Hetzner DNS* are supported. We handle renewal and timely alert the project owner via email if problems occur. For type `managed` Certificates the `action` key of the response contains the Action that allows for tracking the issuance process. For type `uploaded` Certificates the `action` is always null. */ export const createCertificate: API.OperationMethod< CreateCertificateRequest, CreateCertificateResponse, CreateCertificateError, HetznerOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(3, __c0, 3) as any as S.Schema, errors: [UnknownHetznerError], protocol: HetznerProtocol, retry: Retry.Retry, })); export type DeleteCertificateError = HetznerOpError; /** Delete a Certificate Deletes a Certificate. */ export const deleteCertificate: API.OperationMethod< DeleteCertificateRequest, DeleteCertificateResponse, DeleteCertificateError, 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 GetCertificateError = HetznerOpError; /** Get a Certificate Gets a specific Certificate object. */ export const getCertificate: API.OperationMethod< GetCertificateRequest, GetCertificateResponse, GetCertificateError, 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 ListCertificatesError = HetznerOpError; /** List Certificates Returns all Certificate objects. */ export const listCertificates: API.PaginatedOperationMethod< ListCertificatesRequest, ListCertificatesResponse, ListCertificatesError, HetznerOpContext, ListCertificatesResponseCertificatesItem > = /*@__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: "certificates", pageSize: "per_page", } as const, }), paginatePageNumber, ) as any; export type UpdateCertificateError = HetznerOpError; /** Update a Certificate Updates the Certificate properties. Note: if the Certificate object changes during the request, the response will be a "conflict" error. */ export const updateCertificate: API.OperationMethod< UpdateCertificateRequest, UpdateCertificateResponse, UpdateCertificateError, 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.optional(S.String), certificate: S.optional(S.String), private_key: S.optional(S.String.pipe(T.SensitiveValue({}))), domain_names: S.optional(__S(9, __c1, 1)), }).pipe(T.Http({ method: "POST", uri: "/certificates", code: 200 })), ).annotate({ identifier: "CreateCertificateRequest" }); case 1: return S.suspend(() => S.Struct({ code: S.String, message: S.String, }), ).annotate({ identifier: "CreateCertificateResponseActionError" }); case 2: 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(13, __c1, 5), error: S.NullOr(__S(1, __c0, 1)), }), ).annotate({ identifier: "CreateCertificateResponseAction" }); case 3: return S.suspend(() => S.Struct({ certificate: __S(14, __c1, 6), action: S.optional(S.NullOr(__S(2, __c0, 2))), }), ).annotate({ identifier: "CreateCertificateResponse" }); } } 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({ code: S.optional(S.String), message: S.optional(S.String), }), ).annotate({ identifier: "CreateCertificateResponseCertificateStatusError" }); case 3: return S.suspend(() => S.Struct({ issuance: S.optional(S.String), renewal: S.optional(S.String), error: S.optional(S.NullOr(__S(10, __c1, 2))), }), ).annotate({ identifier: "CreateCertificateResponseCertificateStatus" }); case 4: return S.suspend(() => S.Struct({ id: S.Number, type: S.String, }), ).annotate({ identifier: "CreateCertificateResponseCertificateUsedByItem" }); case 5: return S.Array(__S(12, __c1, 4)); case 6: return S.suspend(() => S.Struct({ id: S.Number, name: S.String, labels: __S(8, __c1, 0), type: S.optional(S.String), certificate: S.NullOr(S.String), created: S.String, not_valid_before: S.NullOr(S.String), not_valid_after: S.NullOr(S.String), domain_names: __S(9, __c1, 1), fingerprint: S.NullOr(S.String), status: S.optional(S.NullOr(__S(11, __c1, 3))), used_by: __S(13, __c1, 5), }), ).annotate({ identifier: "CreateCertificateResponseCertificate" }); } } 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: "/certificates/{id}", code: 200 })), ).annotate({ identifier: "DeleteCertificateRequest" }); case 1: return S.suspend(() => S.Struct({})).annotate({ identifier: "DeleteCertificateResponse" }); } } 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: "/certificates/{id}", code: 200 })), ).annotate({ identifier: "GetCertificateRequest" }); } } function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ certificate: __S(14, __c1, 6), }), ).annotate({ identifier: "GetCertificateResponse" }); } } 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(40, __c5, 0).pipe(T.Query())), name: S.optional(S.String.pipe(T.Query())), label_selector: S.optional(S.String.pipe(T.Query())), type: S.optional(__S(40, __c5, 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: "/certificates", code: 200 })), ).annotate({ identifier: "ListCertificatesRequest" }); case 2: return S.Array(__S(14, __c1, 6)); 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: "ListCertificatesResponseMetaPagination" }); case 4: return S.suspend(() => S.Struct({ pagination: __S(43, __c5, 3), }), ).annotate({ identifier: "ListCertificatesResponseMeta" }); case 5: return S.suspend(() => S.Struct({ certificates: __S(42, __c5, 2), meta: __S(44, __c5, 4), }), ).annotate({ identifier: "ListCertificatesResponse" }); } } 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)), }).pipe(T.Http({ method: "PUT", uri: "/certificates/{id}", code: 200 })), ).annotate({ identifier: "UpdateCertificateRequest" }); } } // 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)); }