import * as API from "@distilled.cloud/core/api"; import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-dokploy/specs/openapi.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 { DokployServiceErrors } from "../errors.ts"; import { DokployProtocol, type DokployOpError, type DokployOpContext } 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 { DokployOpError, DokployOpContext }; /** Span facts shared by every operation (com.distilled.telemetry#service). */ const TELEMETRY = { system: "dokploy-api", responseHeaders: [ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" }, { header: "request-id", name: "http.response.header.request-id", transform: "list" }, ], prefix: "Dokploy", service: "Postgres", propagate: "w3c", } as const; export class BadRequest extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("BadRequest", { code: S.Number, message: S.String, body: /*@__PURE__*/ S.optional( /*@__PURE__*/ S.Union([/*@__PURE__*/ S.suspend(() => __S(2, __c0, 2)), S.String]), ), headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), }).pipe(C.withBadRequestError), [{ status: 400 }], ) { declare readonly body?: ErrorBADREQUEST | string; } export class Forbidden extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("Forbidden", { code: S.Number, message: S.String, body: /*@__PURE__*/ S.optional( /*@__PURE__*/ S.Union([/*@__PURE__*/ S.suspend(() => __S(2, __c0, 2)), S.String]), ), headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), }).pipe(C.withAuthError), [{ status: 403 }], ) { declare readonly body?: ErrorFORBIDDEN | string; } export class NotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("NotFound", { code: S.Number, message: S.String, body: /*@__PURE__*/ S.optional( /*@__PURE__*/ S.Union([/*@__PURE__*/ S.suspend(() => __S(2, __c0, 2)), S.String]), ), headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), }).pipe(C.withBadRequestError), [{ status: 404 }], ) { declare readonly body?: ErrorNOTFOUND | string; } export interface ChangePostgresPasswordRequest { postgresId: string; password: string | Redacted.Redacted; } export type ChangePostgresPasswordResponse = unknown; export type ChangePostgresStatusRequestApplicationStatus = "idle" | "running" | "done" | "error"; export interface ChangePostgresStatusRequest { postgresId: string; applicationStatus: ChangePostgresStatusRequestApplicationStatus | (string & {}); } export type ChangePostgresStatusResponse = unknown; export interface CreatePostgresRequest { name: string; appName?: string | undefined; databaseName: string; databaseUser: string; databasePassword: string | Redacted.Redacted; dockerImage?: string | undefined; environmentId: string; description?: string | null | undefined; serverId?: string | null | undefined; } export type CreatePostgresResponse = unknown; export interface DeletePostgresRequest { postgresId: string; } export type DeletePostgresResponse = unknown; export interface DeployPostgresRequest { postgresId: string; } export type DeployPostgresResponse = unknown; export interface GetPostgresRequest { postgresId: string; } export type GetPostgresResponse = unknown; export interface MovePostgresRequest { postgresId: string; targetEnvironmentId: string; } export type MovePostgresResponse = unknown; export interface ReadPostgresLogsRequest { postgresId: string; tail?: number | undefined; since?: string | undefined; search?: string | undefined; } export type ReadPostgresLogsResponse = unknown; export interface RebuildPostgresRequest { postgresId: string; } export type RebuildPostgresResponse = unknown; export interface ReloadPostgresRequest { postgresId: string; appName: string; } export type ReloadPostgresResponse = unknown; export interface SavePostgresEnvironmentRequest { postgresId: string; env: string | null; } export type SavePostgresEnvironmentResponse = unknown; export interface SavePostgresExternalPortRequest { postgresId: string; externalPort: number | null; } export type SavePostgresExternalPortResponse = unknown; export interface SearchPostgresRequest { q?: string | undefined; name?: string | undefined; appName?: string | undefined; description?: string | undefined; projectId?: string | undefined; environmentId?: string | undefined; limit?: number | undefined; offset?: number | undefined; } export type SearchPostgresResponse = unknown; export interface StartPostgresRequest { postgresId: string; } export type StartPostgresResponse = unknown; export interface StopPostgresRequest { postgresId: string; } export type StopPostgresResponse = unknown; export type UpdatePostgresRequestArgsList = Array; export type UpdatePostgresRequestApplicationStatus = "idle" | "running" | "done" | "error"; export type UpdatePostgresRequestHealthCheckSwarmTestList = Array; export interface UpdatePostgresRequestHealthCheckSwarm { Test?: UpdatePostgresRequestHealthCheckSwarmTestList | undefined; Interval?: number | undefined; Timeout?: number | undefined; StartPeriod?: number | undefined; Retries?: number | undefined; } export interface UpdatePostgresRequestRestartPolicySwarm { Condition?: string | undefined; Delay?: number | undefined; MaxAttempts?: number | undefined; Window?: number | undefined; } export type UpdatePostgresRequestPlacementSwarmConstraintsList = Array; export interface UpdatePostgresRequestPlacementSwarmPreferencesItemSpread { SpreadDescriptor: string; } export interface UpdatePostgresRequestPlacementSwarmPreferencesItem { Spread: UpdatePostgresRequestPlacementSwarmPreferencesItemSpread; } export type UpdatePostgresRequestPlacementSwarmPreferencesList = Array; export interface UpdatePostgresRequestPlacementSwarmPlatformsItem { Architecture: string; OS: string; } export type UpdatePostgresRequestPlacementSwarmPlatformsList = Array; export interface UpdatePostgresRequestPlacementSwarm { Constraints?: UpdatePostgresRequestPlacementSwarmConstraintsList | undefined; Preferences?: UpdatePostgresRequestPlacementSwarmPreferencesList | undefined; MaxReplicas?: number | undefined; Platforms?: UpdatePostgresRequestPlacementSwarmPlatformsList | undefined; } export interface UpdatePostgresRequestUpdateConfigSwarm { Parallelism: number; Delay?: number | undefined; FailureAction?: string | undefined; Monitor?: number | undefined; MaxFailureRatio?: number | undefined; Order: string; } export type UpdatePostgresRequestRollbackConfigSwarm = UpdatePostgresRequestUpdateConfigSwarm; export interface UpdatePostgresRequestModeSwarmReplicated { Replicas?: number | undefined; } export interface UpdatePostgresRequestModeSwarmReplicatedJob { MaxConcurrent?: number | undefined; TotalCompletions?: number | undefined; } export interface UpdatePostgresRequestModeSwarm { Replicated?: UpdatePostgresRequestModeSwarmReplicated | undefined; Global?: unknown | undefined; ReplicatedJob?: UpdatePostgresRequestModeSwarmReplicatedJob | undefined; GlobalJob?: unknown | undefined; } export type UpdatePostgresRequestLabelsSwarmMap = { [key: string]: string | undefined }; export type UpdatePostgresRequestNetworkSwarmItemAliasesList = Array; export type UpdatePostgresRequestNetworkSwarmItemDriverOptsMap = { [key: string]: string | undefined; }; export interface UpdatePostgresRequestNetworkSwarmItem { Target?: string | undefined; Aliases?: UpdatePostgresRequestNetworkSwarmItemAliasesList | undefined; DriverOpts?: UpdatePostgresRequestNetworkSwarmItemDriverOptsMap | undefined; } export type UpdatePostgresRequestNetworkSwarmList = Array; export interface UpdatePostgresRequestEndpointSpecSwarmPortsItem { Protocol?: string | undefined; TargetPort?: number | undefined; PublishedPort?: number | undefined; PublishMode?: string | undefined; } export type UpdatePostgresRequestEndpointSpecSwarmPortsList = Array; export interface UpdatePostgresRequestEndpointSpecSwarm { Mode?: string | undefined; Ports?: UpdatePostgresRequestEndpointSpecSwarmPortsList | undefined; } export interface UpdatePostgresRequestUlimitsSwarmItem { Name: string; Soft: number; Hard: number; } export type UpdatePostgresRequestUlimitsSwarmList = Array; export type UpdatePostgresRequestNetworkIdsList = Array; export interface UpdatePostgresRequest { postgresId: string; name?: string | undefined; appName?: string | undefined; databaseName?: string | undefined; databaseUser?: string | undefined; databasePassword?: string | Redacted.Redacted | undefined; description?: string | null | undefined; dockerImage?: string | undefined; command?: string | null | undefined; args?: UpdatePostgresRequestArgsList | null | undefined; env?: string | null | undefined; memoryReservation?: string | null | undefined; externalPort?: number | null | undefined; memoryLimit?: string | null | undefined; cpuReservation?: string | null | undefined; cpuLimit?: string | null | undefined; applicationStatus?: UpdatePostgresRequestApplicationStatus | (string & {}) | undefined; healthCheckSwarm?: UpdatePostgresRequestHealthCheckSwarm | null | undefined; restartPolicySwarm?: UpdatePostgresRequestRestartPolicySwarm | null | undefined; placementSwarm?: UpdatePostgresRequestPlacementSwarm | null | undefined; updateConfigSwarm?: UpdatePostgresRequestUpdateConfigSwarm | null | undefined; rollbackConfigSwarm?: UpdatePostgresRequestUpdateConfigSwarm | null | undefined; modeSwarm?: UpdatePostgresRequestModeSwarm | null | undefined; labelsSwarm?: UpdatePostgresRequestLabelsSwarmMap | null | undefined; networkSwarm?: UpdatePostgresRequestNetworkSwarmList | null | undefined; stopGracePeriodSwarm?: number | null | undefined; endpointSpecSwarm?: UpdatePostgresRequestEndpointSpecSwarm | null | undefined; ulimitsSwarm?: UpdatePostgresRequestUlimitsSwarmList | null | undefined; replicas?: number | undefined; createdAt?: string | undefined; networkIds?: UpdatePostgresRequestNetworkIdsList | null | undefined; detachDokployNetwork?: boolean | undefined; } export type UpdatePostgresResponse = unknown; export interface ErrorBADREQUESTIssuesItem { message: string; } /** An array of issues that were responsible for the error */ export type ErrorBADREQUESTIssuesList = Array; /** The error information */ export interface ErrorBADREQUEST { /** The error message */ message: string; /** The error code */ code: string; /** An array of issues that were responsible for the error */ issues?: ErrorBADREQUESTIssuesList | undefined; } export type ErrorFORBIDDENIssuesItem = ErrorBADREQUESTIssuesItem; /** An array of issues that were responsible for the error */ export type ErrorFORBIDDENIssuesList = Array; /** The error information */ export interface ErrorFORBIDDEN { /** The error message */ message: string; /** The error code */ code: string; /** An array of issues that were responsible for the error */ issues?: ErrorFORBIDDENIssuesList | undefined; } export type ErrorNOTFOUNDIssuesItem = ErrorBADREQUESTIssuesItem; /** An array of issues that were responsible for the error */ export type ErrorNOTFOUNDIssuesList = Array; /** The error information */ export interface ErrorNOTFOUND { /** The error message */ message: string; /** The error code */ code: string; /** An array of issues that were responsible for the error */ issues?: ErrorNOTFOUNDIssuesList | undefined; } export type ChangePostgresPasswordError = BadRequest | Forbidden | DokployOpError; export const changePostgresPassword: API.OperationMethod< ChangePostgresPasswordRequest, ChangePostgresPasswordResponse, ChangePostgresPasswordError, DokployOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(320, __c10, 0) as any as S.Schema, output: __S(352, __c11, 0) as any as S.Schema, errors: [BadRequest, Forbidden], serviceErrors: DokployServiceErrors, protocol: DokployProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ChangePostgresPassword", })); export type ChangePostgresStatusError = BadRequest | Forbidden | DokployOpError; export const changePostgresStatus: API.OperationMethod< ChangePostgresStatusRequest, ChangePostgresStatusResponse, ChangePostgresStatusError, DokployOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(384, __c12, 0) as any as S.Schema, output: __S(352, __c11, 0) as any as S.Schema, errors: [BadRequest, Forbidden], serviceErrors: DokployServiceErrors, protocol: DokployProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ChangePostgresStatus", })); export type CreatePostgresError = BadRequest | Forbidden | DokployOpError; export const createPostgres: API.OperationMethod< CreatePostgresRequest, CreatePostgresResponse, CreatePostgresError, DokployOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(416, __c13, 0) as any as S.Schema, output: __S(352, __c11, 0) as any as S.Schema, errors: [BadRequest, Forbidden], serviceErrors: DokployServiceErrors, protocol: DokployProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreatePostgres", })); export type DeletePostgresError = BadRequest | Forbidden | DokployOpError; export const deletePostgres: API.OperationMethod< DeletePostgresRequest, DeletePostgresResponse, DeletePostgresError, DokployOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(448, __c14, 0) as any as S.Schema, output: __S(352, __c11, 0) as any as S.Schema, errors: [BadRequest, Forbidden], serviceErrors: DokployServiceErrors, protocol: DokployProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeletePostgres", })); export type DeployPostgresError = BadRequest | Forbidden | DokployOpError; export const deployPostgres: API.OperationMethod< DeployPostgresRequest, DeployPostgresResponse, DeployPostgresError, DokployOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(480, __c15, 0) as any as S.Schema, output: __S(352, __c11, 0) as any as S.Schema, errors: [BadRequest, Forbidden], serviceErrors: DokployServiceErrors, protocol: DokployProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeployPostgres", })); export type GetPostgresError = BadRequest | Forbidden | NotFound | DokployOpError; export const getPostgres: API.OperationMethod< GetPostgresRequest, GetPostgresResponse, GetPostgresError, DokployOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(512, __c16, 0) as any as S.Schema, output: __S(352, __c11, 0) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: DokployServiceErrors, protocol: DokployProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetPostgres", })); export type MovePostgresError = BadRequest | Forbidden | DokployOpError; export const movePostgres: API.OperationMethod< MovePostgresRequest, MovePostgresResponse, MovePostgresError, DokployOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(544, __c17, 0) as any as S.Schema, output: __S(352, __c11, 0) as any as S.Schema, errors: [BadRequest, Forbidden], serviceErrors: DokployServiceErrors, protocol: DokployProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "MovePostgres", })); export type ReadPostgresLogsError = BadRequest | Forbidden | NotFound | DokployOpError; export const readPostgresLogs: API.OperationMethod< ReadPostgresLogsRequest, ReadPostgresLogsResponse, ReadPostgresLogsError, DokployOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(32, __c1, 0) as any as S.Schema, output: __S(352, __c11, 0) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: DokployServiceErrors, protocol: DokployProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ReadPostgresLogs", })); export type RebuildPostgresError = BadRequest | Forbidden | DokployOpError; export const rebuildPostgres: API.OperationMethod< RebuildPostgresRequest, RebuildPostgresResponse, RebuildPostgresError, DokployOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(64, __c2, 0) as any as S.Schema, output: __S(352, __c11, 0) as any as S.Schema, errors: [BadRequest, Forbidden], serviceErrors: DokployServiceErrors, protocol: DokployProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RebuildPostgres", })); export type ReloadPostgresError = BadRequest | Forbidden | DokployOpError; export const reloadPostgres: API.OperationMethod< ReloadPostgresRequest, ReloadPostgresResponse, ReloadPostgresError, DokployOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(96, __c3, 0) as any as S.Schema, output: __S(352, __c11, 0) as any as S.Schema, errors: [BadRequest, Forbidden], serviceErrors: DokployServiceErrors, protocol: DokployProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ReloadPostgres", })); export type SavePostgresEnvironmentError = BadRequest | Forbidden | DokployOpError; export const savePostgresEnvironment: API.OperationMethod< SavePostgresEnvironmentRequest, SavePostgresEnvironmentResponse, SavePostgresEnvironmentError, DokployOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(128, __c4, 0) as any as S.Schema, output: __S(352, __c11, 0) as any as S.Schema, errors: [BadRequest, Forbidden], serviceErrors: DokployServiceErrors, protocol: DokployProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SavePostgresEnvironment", })); export type SavePostgresExternalPortError = BadRequest | Forbidden | DokployOpError; export const savePostgresExternalPort: API.OperationMethod< SavePostgresExternalPortRequest, SavePostgresExternalPortResponse, SavePostgresExternalPortError, DokployOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(160, __c5, 0) as any as S.Schema, output: __S(352, __c11, 0) as any as S.Schema, errors: [BadRequest, Forbidden], serviceErrors: DokployServiceErrors, protocol: DokployProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SavePostgresExternalPort", })); export type SearchPostgresError = BadRequest | Forbidden | NotFound | DokployOpError; export const searchPostgres: API.OperationMethod< SearchPostgresRequest, SearchPostgresResponse, SearchPostgresError, DokployOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(192, __c6, 0) as any as S.Schema, output: __S(352, __c11, 0) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: DokployServiceErrors, protocol: DokployProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "SearchPostgres", })); export type StartPostgresError = BadRequest | Forbidden | DokployOpError; export const startPostgres: API.OperationMethod< StartPostgresRequest, StartPostgresResponse, StartPostgresError, DokployOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(224, __c7, 0) as any as S.Schema, output: __S(352, __c11, 0) as any as S.Schema, errors: [BadRequest, Forbidden], serviceErrors: DokployServiceErrors, protocol: DokployProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "StartPostgres", })); export type StopPostgresError = BadRequest | Forbidden | DokployOpError; export const stopPostgres: API.OperationMethod< StopPostgresRequest, StopPostgresResponse, StopPostgresError, DokployOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(256, __c8, 0) as any as S.Schema, output: __S(352, __c11, 0) as any as S.Schema, errors: [BadRequest, Forbidden], serviceErrors: DokployServiceErrors, protocol: DokployProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "StopPostgres", })); export type UpdatePostgresError = BadRequest | Forbidden | DokployOpError; export const updatePostgres: API.OperationMethod< UpdatePostgresRequest, UpdatePostgresResponse, UpdatePostgresError, DokployOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(309, __c9, 21) as any as S.Schema, output: __S(352, __c11, 0) as any as S.Schema, errors: [BadRequest, Forbidden], serviceErrors: DokployServiceErrors, protocol: DokployProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdatePostgres", })); // 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({ message: S.String, }), ).annotate({ identifier: "ErrorBADREQUESTIssuesItem" }); case 1: return S.Array(__S(0, __c0, 0)); case 2: return S.suspend(() => S.Struct({ message: S.String, code: S.String, issues: S.optional(__S(1, __c0, 1)), }), ).annotate({ identifier: "ErrorBADREQUEST" }); } } function __c1(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ postgresId: S.String.pipe(T.Query()), tail: S.optional(S.Number.pipe(T.Query())), since: S.optional(S.String.pipe(T.Query())), search: S.optional(S.String.pipe(T.Query())), }).pipe(T.Http({ method: "GET", uri: "/postgres.readLogs", code: 200 })), ).annotate({ identifier: "ReadPostgresLogsRequest" }); } } function __c2(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ postgresId: S.String, }).pipe(T.Http({ method: "POST", uri: "/postgres.rebuild", code: 200 })), ).annotate({ identifier: "RebuildPostgresRequest" }); } } function __c3(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ postgresId: S.String, appName: S.String, }).pipe(T.Http({ method: "POST", uri: "/postgres.reload", code: 200 })), ).annotate({ identifier: "ReloadPostgresRequest" }); } } function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ postgresId: S.String, env: S.NullOr(S.String), }).pipe(T.Http({ method: "POST", uri: "/postgres.saveEnvironment", code: 200 })), ).annotate({ identifier: "SavePostgresEnvironmentRequest" }); } } function __c5(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ postgresId: S.String, externalPort: S.NullOr(S.Number), }).pipe(T.Http({ method: "POST", uri: "/postgres.saveExternalPort", code: 200 })), ).annotate({ identifier: "SavePostgresExternalPortRequest" }); } } function __c6(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ q: S.optional(S.String.pipe(T.Query())), name: S.optional(S.String.pipe(T.Query())), appName: S.optional(S.String.pipe(T.Query())), description: S.optional(S.String.pipe(T.Query())), projectId: S.optional(S.String.pipe(T.Query())), environmentId: S.optional(S.String.pipe(T.Query())), limit: S.optional(S.Number.pipe(T.Query())), offset: S.optional(S.Number.pipe(T.Query())), }).pipe(T.Http({ method: "GET", uri: "/postgres.search", code: 200 })), ).annotate({ identifier: "SearchPostgresRequest" }); } } function __c7(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ postgresId: S.String, }).pipe(T.Http({ method: "POST", uri: "/postgres.start", code: 200 })), ).annotate({ identifier: "StartPostgresRequest" }); } } function __c8(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ postgresId: S.String, }).pipe(T.Http({ method: "POST", uri: "/postgres.stop", code: 200 })), ).annotate({ identifier: "StopPostgresRequest" }); } } function __c9(j: number): any { switch (j) { case 0: return S.Array(S.String); case 1: return S.suspend(() => S.Struct({ Test: S.optional(__S(288, __c9, 0)), Interval: S.optional(S.Number), Timeout: S.optional(S.Number), StartPeriod: S.optional(S.Number), Retries: S.optional(S.Number), }), ).annotate({ identifier: "UpdatePostgresRequestHealthCheckSwarm" }); case 2: return S.suspend(() => S.Struct({ Condition: S.optional(S.String), Delay: S.optional(S.Number), MaxAttempts: S.optional(S.Number), Window: S.optional(S.Number), }), ).annotate({ identifier: "UpdatePostgresRequestRestartPolicySwarm" }); case 3: return S.suspend(() => S.Struct({ SpreadDescriptor: S.String, }), ).annotate({ identifier: "UpdatePostgresRequestPlacementSwarmPreferencesItemSpread" }); case 4: return S.suspend(() => S.Struct({ Spread: __S(291, __c9, 3), }), ).annotate({ identifier: "UpdatePostgresRequestPlacementSwarmPreferencesItem" }); case 5: return S.Array(__S(292, __c9, 4)); case 6: return S.suspend(() => S.Struct({ Architecture: S.String, OS: S.String, }), ).annotate({ identifier: "UpdatePostgresRequestPlacementSwarmPlatformsItem" }); case 7: return S.Array(__S(294, __c9, 6)); case 8: return S.suspend(() => S.Struct({ Constraints: S.optional(__S(288, __c9, 0)), Preferences: S.optional(__S(293, __c9, 5)), MaxReplicas: S.optional(S.Number), Platforms: S.optional(__S(295, __c9, 7)), }), ).annotate({ identifier: "UpdatePostgresRequestPlacementSwarm" }); case 9: return S.suspend(() => S.Struct({ Parallelism: S.Number, Delay: S.optional(S.Number), FailureAction: S.optional(S.String), Monitor: S.optional(S.Number), MaxFailureRatio: S.optional(S.Number), Order: S.String, }), ).annotate({ identifier: "UpdatePostgresRequestUpdateConfigSwarm" }); case 10: return S.suspend(() => S.Struct({ Replicas: S.optional(S.Number), }), ).annotate({ identifier: "UpdatePostgresRequestModeSwarmReplicated" }); case 11: return S.suspend(() => S.Struct({ MaxConcurrent: S.optional(S.Number), TotalCompletions: S.optional(S.Number), }), ).annotate({ identifier: "UpdatePostgresRequestModeSwarmReplicatedJob" }); case 12: return S.suspend(() => S.Struct({ Replicated: S.optional(__S(298, __c9, 10)), Global: S.optional(S.Unknown), ReplicatedJob: S.optional(__S(299, __c9, 11)), GlobalJob: S.optional(S.Unknown), }), ).annotate({ identifier: "UpdatePostgresRequestModeSwarm" }); case 13: return S.Record(S.String, S.String); case 14: return S.suspend(() => S.Struct({ Target: S.optional(S.String), Aliases: S.optional(__S(288, __c9, 0)), DriverOpts: S.optional(__S(301, __c9, 13)), }), ).annotate({ identifier: "UpdatePostgresRequestNetworkSwarmItem" }); case 15: return S.Array(__S(302, __c9, 14)); case 16: return S.suspend(() => S.Struct({ Protocol: S.optional(S.String), TargetPort: S.optional(S.Number), PublishedPort: S.optional(S.Number), PublishMode: S.optional(S.String), }), ).annotate({ identifier: "UpdatePostgresRequestEndpointSpecSwarmPortsItem" }); case 17: return S.Array(__S(304, __c9, 16)); case 18: return S.suspend(() => S.Struct({ Mode: S.optional(S.String), Ports: S.optional(__S(305, __c9, 17)), }), ).annotate({ identifier: "UpdatePostgresRequestEndpointSpecSwarm" }); case 19: return S.suspend(() => S.Struct({ Name: S.String, Soft: S.Number, Hard: S.Number, }), ).annotate({ identifier: "UpdatePostgresRequestUlimitsSwarmItem" }); case 20: return S.Array(__S(307, __c9, 19)); case 21: return S.suspend(() => S.Struct({ postgresId: S.String, name: S.optional(S.String), appName: S.optional(S.String), databaseName: S.optional(S.String), databaseUser: S.optional(S.String), databasePassword: S.optional(S.String.pipe(T.SensitiveValue({}))), description: S.optional(S.NullOr(S.String)), dockerImage: S.optional(S.String), command: S.optional(S.NullOr(S.String)), args: S.optional(S.NullOr(__S(288, __c9, 0))), env: S.optional(S.NullOr(S.String)), memoryReservation: S.optional(S.NullOr(S.String)), externalPort: S.optional(S.NullOr(S.Number)), memoryLimit: S.optional(S.NullOr(S.String)), cpuReservation: S.optional(S.NullOr(S.String)), cpuLimit: S.optional(S.NullOr(S.String)), applicationStatus: S.optional(S.String), healthCheckSwarm: S.optional(S.NullOr(__S(289, __c9, 1))), restartPolicySwarm: S.optional(S.NullOr(__S(290, __c9, 2))), placementSwarm: S.optional(S.NullOr(__S(296, __c9, 8))), updateConfigSwarm: S.optional(S.NullOr(__S(297, __c9, 9))), rollbackConfigSwarm: S.optional(S.NullOr(__S(297, __c9, 9))), modeSwarm: S.optional(S.NullOr(__S(300, __c9, 12))), labelsSwarm: S.optional(S.NullOr(__S(301, __c9, 13))), networkSwarm: S.optional(S.NullOr(__S(303, __c9, 15))), stopGracePeriodSwarm: S.optional(S.NullOr(S.Number)), endpointSpecSwarm: S.optional(S.NullOr(__S(306, __c9, 18))), ulimitsSwarm: S.optional(S.NullOr(__S(308, __c9, 20))), replicas: S.optional(S.Number), createdAt: S.optional(S.String), networkIds: S.optional(S.NullOr(__S(288, __c9, 0))), detachDokployNetwork: S.optional(S.Boolean), }).pipe(T.Http({ method: "POST", uri: "/postgres.update", code: 200 })), ).annotate({ identifier: "UpdatePostgresRequest" }); } } function __c10(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ postgresId: S.String, password: S.String.pipe(T.SensitiveValue({})), }).pipe(T.Http({ method: "POST", uri: "/postgres.changePassword", code: 200 })), ).annotate({ identifier: "ChangePostgresPasswordRequest" }); } } function __c11(j: number): any { switch (j) { case 0: return S.suspend(() => S.Unknown.pipe(T.RawResponseRoot())).annotate({ identifier: "ChangePostgresPasswordResponse", }); } } function __c12(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ postgresId: S.String, applicationStatus: S.String, }).pipe(T.Http({ method: "POST", uri: "/postgres.changeStatus", code: 200 })), ).annotate({ identifier: "ChangePostgresStatusRequest" }); } } function __c13(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ name: S.String, appName: S.optional(S.String), databaseName: S.String, databaseUser: S.String, databasePassword: S.String.pipe(T.SensitiveValue({})), dockerImage: S.optional(S.String), environmentId: S.String, description: S.optional(S.NullOr(S.String)), serverId: S.optional(S.NullOr(S.String)), }).pipe(T.Http({ method: "POST", uri: "/postgres.create", code: 200 })), ).annotate({ identifier: "CreatePostgresRequest" }); } } function __c14(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ postgresId: S.String, }).pipe(T.Http({ method: "POST", uri: "/postgres.remove", code: 200 })), ).annotate({ identifier: "DeletePostgresRequest" }); } } function __c15(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ postgresId: S.String, }).pipe(T.Http({ method: "POST", uri: "/postgres.deploy", code: 200 })), ).annotate({ identifier: "DeployPostgresRequest" }); } } function __c16(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ postgresId: S.String.pipe(T.Query()), }).pipe(T.Http({ method: "GET", uri: "/postgres.one", code: 200 })), ).annotate({ identifier: "GetPostgresRequest" }); } } function __c17(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ postgresId: S.String, targetEnvironmentId: S.String, }).pipe(T.Http({ method: "POST", uri: "/postgres.move", code: 200 })), ).annotate({ identifier: "MovePostgresRequest" }); } } // 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)); }