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-stackit). 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 { StackitServiceErrors } from "../errors.ts"; import { StackitProtocol, type StackitOpError, type StackitOpContext } 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 { StackitOpError, StackitOpContext }; /** Span facts shared by every operation (com.distilled.telemetry#service). */ const TELEMETRY = { system: "stackit-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: "STACKIT", service: "Sqlserverflex", labels: "stackit", 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(0, __c0, 0)), S.String]), ), headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), }).pipe(C.withBadRequestError), [{ status: 400 }], ) { declare readonly body?: Error | 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(0, __c0, 0)), S.String]), ), headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), }).pipe(C.withAuthError), [{ status: 403 }], ) { declare readonly body?: Error | 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(0, __c0, 0)), S.String]), ), headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), }).pipe(C.withBadRequestError), [{ status: 404 }], ) { declare readonly body?: Error | string; } export class UnprocessableEntity extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("UnprocessableEntity", { code: S.Number, message: S.String, body: /*@__PURE__*/ S.optional( /*@__PURE__*/ S.Union([ /*@__PURE__*/ S.suspend(() => __S(202, __c25, 2)), /*@__PURE__*/ S.suspend(() => __S(0, __c0, 0)), S.String, ]), ), headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), }).pipe(C.withBadRequestError), [{ status: 422 }], ) { declare readonly body?: ValidationError | Error | string; } export type CreateDatabaseRequestRegion = "eu01"; export interface CreateDatabaseRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: CreateDatabaseRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; collation?: string | undefined; compatibility?: number | undefined; name: string; owner: string; } export interface CreateDatabaseResponse { id: number; } export type CreateInstanceRequestRegion = "eu01"; /** this defines which key to use for storage encryption */ export interface InstanceEncryption { /** The key identifier */ kekKeyId: string; /** The keyring identifier */ kekKeyRingId: string; /** The key version */ kekKeyVersion: string; serviceAccount: string; } /** A dictionary of user-defined key-value pairs used to categorize or organize the resource. **Rules for Keys:** * Must be between 1 and 63 characters long. * Must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). * May contain dashes (`-`), underscores (`_`), and dots (`.`). * **Regex:** `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$` * **Restriction:** The prefix `stackit-` is strictly reserved and cannot be used. **Rules for Values:** * Must be between 0 (empty string) and 63 characters long. * If not empty, must begin and end with an alphanumeric character. * May contain dashes (`-`), underscores (`_`), and dots (`.`). * **Regex:** `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$` */ export type Labels = { [key: string]: string | null | undefined }; /** The network access scope of the instance U+26A0 **Note:** This feature is in private preview. Supplying this object is only permitted for enabled accounts. If your account does not have access, the request will be rejected. */ export type InstanceNetworkAccessScope = "PUBLIC" | "SNA"; /** List of IPV4 cidr. */ export type Acl = Array; /** the network configuration of the instance. */ export interface CreateInstanceRequestNetwork { accessScope?: InstanceNetworkAccessScope | (string & {}) | undefined; acl: Acl; } /** The object containing information about the storage size and class. */ export interface StorageCreate { class: string; size: number; } /** The sqlserver version used for the instance. */ export type InstanceVersion = "2022"; export interface CreateInstanceRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: CreateInstanceRequestRegion | (string & {}); backupSchedule: string; encryption?: InstanceEncryption | undefined; flavorId: string; labels?: Labels | undefined; name: string; /** the network configuration of the instance. */ network: CreateInstanceRequestNetwork; retentionDays: number; storage: StorageCreate; version: InstanceVersion | (string & {}); } export interface CreateInstanceResponse { id: string; } export type CreateUserRequestRegion = "eu01"; /** A list containing the user roles for the instance. A list with the valid user roles can be retrieved using the List Roles endpoint. */ export type CreateUserRequestRolesList = Array; export interface CreateUserRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: CreateUserRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; default_database?: string | undefined; /** A list containing the user roles for the instance. A list with the valid user roles can be retrieved using the List Roles endpoint. */ roles: CreateUserRequestRolesList; username: string; } export type CreateUserResponseRolesList = Array; export interface CreateUserResponse { default_database: string; host: string; id: number; password: string | Redacted.Redacted; port: number; roles: CreateUserResponseRolesList; status: string; uri: string; username: string; } export type DeleteDatabaseRequestRegion = "eu01"; export interface DeleteDatabaseRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: DeleteDatabaseRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; /** The name of the database. */ databaseName: string; } export interface DeleteDatabaseResponse {} export type DeleteInstanceRequestRegion = "eu01"; export interface DeleteInstanceRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: DeleteInstanceRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; } export interface DeleteInstanceResponse {} export type DeleteUserRequestRegion = "eu01"; export interface DeleteUserRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: DeleteUserRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; /** The ID of the user. */ userId: number; } export interface DeleteUserResponse {} export type GetBackupRequestRegion = "eu01"; export interface GetBackupRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: GetBackupRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; /** The ID of the backup. */ backupId: number; } export interface GetBackupResponse { completionTime: string; id: number; name: string; retainedUntil: string; size: number; type: string; } export type GetDatabaseRequestRegion = "eu01"; export interface GetDatabaseRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: GetDatabaseRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; /** The name of the database. */ databaseName: string; } export interface GetDatabaseResponse { collationName: string; compatibilityLevel: number; id: number; name: string; owner: string; } export type GetInstanceRequestRegion = "eu01"; export interface GetInstanceRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: GetInstanceRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; } /** Edition of the MSSQL server instance */ export type InstanceEdition = "Standard" | "EnterpriseCore" | "developer"; /** The access configuration of the instance */ export interface InstanceNetwork { accessScope?: InstanceNetworkAccessScope | undefined; acl?: Acl | undefined; instanceAddress?: string | undefined; routerAddress?: string | undefined; } /** How many replicas the instance should have. */ export type Replicas = 1 | 3; export type State = "READY" | "PENDING" | "PROGRESSING" | "FAILURE" | "UNKNOWN" | "TERMINATING"; /** The object containing information about the storage size and class. */ export interface Storage { class?: string | undefined; size?: number | undefined; } export interface GetInstanceResponse { backupSchedule: string; edition: InstanceEdition; encryption?: InstanceEncryption | undefined; flavorId: string; id: string; isDeletable: boolean; labels?: Labels | undefined; name: string; network: InstanceNetwork; replicas: Replicas; retentionDays: number; state: State; storage: Storage; version: InstanceVersion; } export type GetUserRequestRegion = "eu01"; export interface GetUserRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: GetUserRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; /** The ID of the user. */ userId: number; } /** A list of user roles. */ export type GetUserResponseRolesList = Array; export interface GetUserResponse { default_database: string; host: string; id: number; port: number; /** A list of user roles. */ roles: GetUserResponseRolesList; status: string; username: string; } export type ListBackupsRequestRegion = "eu01"; export type BackupSort = | "end_time.desc" | "end_time.asc" | "index.desc" | "index.asc" | "name.desc" | "name.asc" | "retained_until.desc" | "retained_until.asc" | "size.desc" | "size.asc" | "type.desc" | "type.asc"; export interface ListBackupsRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: ListBackupsRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; /** Number of the page of items list to be returned. */ page?: number | undefined; /** Number of items to be returned on each page. */ size?: number | undefined; /** Sorting of the backups to be returned on each page. */ sort?: BackupSort | (string & {}) | undefined; } export interface ListBackup { completionTime: string; id: number; name: string; retainedUntil: string; size: number; type: string; } /** List of the backups beloning to that database */ export type ListBackupsResponseBackupsList = Array; export interface ListBackupsResponse { /** List of the backups beloning to that database */ backups: ListBackupsResponseBackupsList; /** Name of the database the backups belong to */ databaseName: string; } /** The list containing the information about the backups. */ export type ListBackupResponseBackupsList = Array; export interface Pagination { page: number; size: number; sort: string; totalPages: number; totalRows: number; } export interface ListBackupResponse { /** The list containing the information about the backups. */ backups: ListBackupResponseBackupsList; pagination: Pagination; } export type ListCollationsRequestRegion = "eu01"; export interface ListCollationsRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: ListCollationsRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; } export interface DatabaseGetcollation { collation_name?: string | undefined; description?: string | undefined; } /** List of collations available for the instance. */ export type ListCollationsResponseCollationsList = Array; export interface ListCollationsResponse { /** List of collations available for the instance. */ collations: ListCollationsResponseCollationsList; } export type ListCompatibilitiesRequestRegion = "eu01"; export interface ListCompatibilitiesRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: ListCompatibilitiesRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; } export interface DatabaseGetcompatibility { compatibility_level?: number | undefined; description?: string | undefined; } /** List of compatibilities available for a d */ export type ListCompatibilityResponseCompatibilitiesList = Array; export interface ListCompatibilityResponse { /** List of compatibilities available for a d */ compatibilities: ListCompatibilityResponseCompatibilitiesList; } export type ListCurrentRunningRestoreJobsRequestRegion = "eu01"; export interface ListCurrentRunningRestoreJobsRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: ListCurrentRunningRestoreJobsRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; } export interface BackupRunningRestore { /** the command that was executed */ command: string; /** the name of the database that is being restored */ database_name: string; /** the projected time when the restore should be completed */ estimated_completion_time: string; /** the percentage of the current running restore job */ percent_complete: number; /** the start time of the current running restore job */ start_time: string; } /** List of the currently running Restore jobs */ export type ListCurrentRunningRestoreJobsRunningRestoresList = Array; export interface ListCurrentRunningRestoreJobs { /** List of the currently running Restore jobs */ runningRestores: ListCurrentRunningRestoreJobsRunningRestoresList; } export type ListDatabasesRequestRegion = "eu01"; export type DatabaseSort = | "created_at.desc" | "created_at.asc" | "database_id.desc" | "database_id.asc" | "database_name.desc" | "database_name.asc" | "database_owner.desc" | "database_owner.asc" | "index.asc" | "index.desc"; export interface ListDatabasesRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: ListDatabasesRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; /** Number of the page of items list to be returned. */ page?: number | undefined; /** Number of items to be returned on each page. */ size?: number | undefined; /** Sorting of the databases to be returned on each page. */ sort?: DatabaseSort | (string & {}) | undefined; } export interface ListDatabase { created: string; id: number; name: string; owner: string; } /** A list containing all databases for the instance. */ export type ListDatabasesResponseDatabasesList = Array; export interface ListDatabasesResponse { /** A list containing all databases for the instance. */ databases: ListDatabasesResponseDatabasesList; pagination: Pagination; } export type ListFlavorsRequestRegion = "eu01"; export type FlavorSort = | "index.desc" | "index.asc" | "cpu.desc" | "cpu.asc" | "flavor_description.asc" | "flavor_description.desc" | "id.desc" | "id.asc" | "size_max.desc" | "size_max.asc" | "ram.desc" | "ram.asc" | "size_min.desc" | "size_min.asc" | "storage_class.asc" | "storage_class.desc" | "node_type.asc" | "node_type.desc"; export interface ListFlavorsRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: ListFlavorsRequestRegion | (string & {}); /** Number of the page of items list to be returned. */ page?: number | undefined; /** Number of items to be returned on each page. */ size?: number | undefined; /** Sorting of the flavors to be returned on each page. */ sort?: FlavorSort | (string & {}) | undefined; } /** a storageClass defines how efficient the storage can work */ export interface FlavorStorageClassesStorageClass { class: string; maxIoPerSec: number; maxThroughInMb: number; } /** maximum storage which can be ordered for the flavor in Gigabyte. */ export type FlavorStorageClasses = Array; /** The flavor of the instance containing the technical features. */ export interface ListFlavors { cpu: number; description: string; id: string; maxGB: number; memory: number; minGB: number; nodeType: string; storageClasses: FlavorStorageClasses; } /** List of flavors available for the project. */ export type ListFlavorsResponseFlavorsList = Array; export interface ListFlavorsResponse { /** List of flavors available for the project. */ flavors: ListFlavorsResponseFlavorsList; pagination: Pagination; } export type ListInstancesRequestRegion = "eu01"; export type InstanceSort = | "index.desc" | "index.asc" | "id.desc" | "id.asc" | "is_deletable.desc" | "is_deletable.asc" | "name.asc" | "name.desc" | "state.asc" | "state.desc"; export interface ListInstancesRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: ListInstancesRequestRegion | (string & {}); /** Number of the page of items list to be returned. */ page?: number | undefined; /** Number of items to be returned on each page. */ size?: number | undefined; /** Sorting of the items to be returned on each page. */ sort?: InstanceSort | (string & {}) | undefined; } export interface ListInstance { id: string; isDeletable: boolean; name: string; state: State; } /** List of owned instances and their current status. */ export type ListInstancesResponseInstancesList = Array; export interface ListInstancesResponse { /** List of owned instances and their current status. */ instances: ListInstancesResponseInstancesList; pagination: Pagination; } export type ListRolesRequestRegion = "eu01"; export interface ListRolesRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: ListRolesRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; } /** List of roles available for an instance. */ export type ListRolesResponseRolesList = Array; export interface ListRolesResponse { /** List of roles available for an instance. */ roles: ListRolesResponseRolesList; } export type ListStoragesRequestRegion = "eu01"; export interface ListStoragesRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: ListStoragesRequestRegion | (string & {}); /** The id of an instance flavor. */ flavorId: string; } /** range of maximum and minimum storage which can be ordered for the flavor in Gigabyte. */ export interface FlavorStorageRange { max: number; min: number; } export interface ListStoragesResponse { storageClasses: FlavorStorageClasses; storageRange: FlavorStorageRange; } export type ListUsersRequestRegion = "eu01"; export type UserSort = | "id.asc" | "id.desc" | "index.desc" | "index.asc" | "name.desc" | "name.asc" | "status.desc" | "status.asc"; export interface ListUsersRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: ListUsersRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; /** Number of the page of items list to be returned. */ page?: number | undefined; /** Number of items to be returned on each page. */ size?: number | undefined; /** Sorting of the users to be returned on each page. */ sort?: UserSort | (string & {}) | undefined; } export interface ListUser { id: number; status: string; username: string; } /** List of all users inside an instance */ export type ListUserResponseUsersList = Array; export interface ListUserResponse { pagination: Pagination; /** List of all users inside an instance */ users: ListUserResponseUsersList; } export type ListVersionsRequestRegion = "eu01"; export interface ListVersionsRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: ListVersionsRequestRegion | (string & {}); } /** The version of the sqlserver instance and more details. */ export interface Version { /** Flag if the version is a beta version. If set the version may contain bugs and is not fully tested. */ beta: boolean; /** Timestamp in RFC3339 format which says when the version will no longer be supported by STACKIT. */ deprecated: string; /** Flag if the version is recommend by the STACKIT Team. */ recommend: boolean; /** The sqlserver version used for the instance. */ version: string; } /** A list containing available sqlserver versions. */ export type ListVersionsResponseVersionsList = Array; export interface ListVersionsResponse { /** A list containing available sqlserver versions. */ versions: ListVersionsResponseVersionsList; } export type PartialUpdateInstanceRequestRegion = "eu01"; /** the network configuration of the instance. */ export interface PartialUpdateInstanceRequestNetwork { acl?: Acl | undefined; } /** The object containing information about the storage size and class. */ export interface StorageUpdate { size?: number | undefined; } export type InstanceVersionOpt = "2022"; export interface PartialUpdateInstanceRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: PartialUpdateInstanceRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; backupSchedule?: string | undefined; flavorId?: string | undefined; labels?: Labels | undefined; name?: string | undefined; /** the network configuration of the instance. */ network?: PartialUpdateInstanceRequestNetwork | undefined; retentionDays?: number | undefined; storage?: StorageUpdate | undefined; version?: InstanceVersionOpt | (string & {}) | undefined; } export interface PartialUpdateInstanceResponse {} export type ResetUserRequestRegion = "eu01"; export interface ResetUserRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: ResetUserRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; /** The ID of the user. */ userId: number; } export interface ResetUserResponse { password: string | Redacted.Redacted; status: string; uri: string; username: string; } export type RestoreDatabaseFromBackupRequestRegion = "eu01"; export type SourceBackupType = "BACKUP"; /** Restore from an existing managed backup. */ export interface SourceBackup { type: SourceBackupType; } export interface S3fileInfo { /** The sequence number of the file */ file_number?: number | undefined; /** The path to the file on the S3 bucket */ file_path?: string | undefined; } /** The backup files from which the database should be restored */ export type ExternalS3S3FilesList = Array; /** The external S3 information */ export interface ExternalS3 { /** The s3 access key id */ s3_access_key: string; /** The s3 access secret */ s3_access_secret: string | Redacted.Redacted; /** The s3 bucket address */ s3_bucket: string; /** The backup files from which the database should be restored */ s3_files: ExternalS3S3FilesList; } export type SourceExternalS3Type = "EXTERNAL_S3"; /** Restore from an external S3 backup file. */ export interface SourceExternalS3 { database_owner: string; /** Logging guid to have a complete activity log over all sub stored procedures. */ logging_guid?: string | undefined; s3_details: ExternalS3; type: SourceExternalS3Type; } /** The source of the restore. */ export type RestoreDatabaseFromBackupRequestSource = SourceBackup | SourceExternalS3; export interface RestoreDatabaseFromBackupRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: RestoreDatabaseFromBackupRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; /** The name of the database on the instance to be restore. */ database_name: string; /** The source of the restore. */ source: RestoreDatabaseFromBackupRequestSource; } export interface RestoreDatabaseFromBackupResponse {} export type TriggerBackupRequestRegion = "eu01"; export interface TriggerBackupRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: TriggerBackupRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; /** The name of the database. */ databaseName: string; } export interface TriggerBackupResponse {} export type TriggerRestoreRequestRegion = "eu01"; export interface TriggerRestoreRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: TriggerRestoreRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; /** The name of the database. */ databaseName: string; name: string; restoreDateTime: string; } export interface TriggerRestoreResponse {} export type UpdateInstanceRequestRegion = "eu01"; /** the network configuration of the instance. */ export interface UpdateInstanceRequestNetwork { acl: Acl; } export interface UpdateInstanceRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: UpdateInstanceRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; backupSchedule: string; flavorId: string; labels?: Labels | undefined; name: string; /** the network configuration of the instance. */ network: UpdateInstanceRequestNetwork; retentionDays: number; storage: StorageUpdate; version: InstanceVersion | (string & {}); } export interface UpdateInstanceResponse {} export type UpdateInstanceProtectionRequestRegion = "eu01"; export interface UpdateInstanceProtectionRequest { /** The STACKIT project ID. */ projectId: string; /** The region which should be addressed */ region: UpdateInstanceProtectionRequestRegion | (string & {}); /** The ID of the instance. */ instanceId: string; isDeletable: boolean; } export interface UpdateInstanceProtectionResponse { isDeletable: boolean; } export interface Error { /** The http error code of the error. */ code: number; /** More detailed information about the error. */ message: string; /** The trace id of the request. */ traceId: string; /** Describes in which state the api was when the error happened. */ type: string; } export interface ValidationErrorValidationItem { field: string; message: string; } /** errors for all fields where the error happened */ export type ValidationErrorValidationList = Array; export interface ValidationError { /** the http error should be always 422 for validationError */ code: number; /** errors for all fields where the error happened */ validation: ValidationErrorValidationList; } export type CreateDatabaseError = | BadRequest | Forbidden | NotFound | UnprocessableEntity | StackitOpError; /** Create Database Create database for a user. Note: The name of a valid user must be provided in the 'options' map field using the key 'owner' */ export const createDatabase: API.OperationMethod< CreateDatabaseRequest, CreateDatabaseResponse, CreateDatabaseError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(224, __c28, 0) as any as S.Schema, output: __S(225, __c28, 1) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound, UnprocessableEntity], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateDatabase", })); export type CreateInstanceError = | BadRequest | Forbidden | NotFound | UnprocessableEntity | StackitOpError; /** Create Instance Create a new instance of a sqlserver database instance. */ export const createInstance: API.OperationMethod< CreateInstanceRequest, CreateInstanceResponse, CreateInstanceError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(234, __c29, 2) as any as S.Schema, output: __S(235, __c29, 3) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound, UnprocessableEntity], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateInstance", })); export type CreateUserError = | BadRequest | Forbidden | NotFound | UnprocessableEntity | StackitOpError; /** Create User Create user for an instance. */ export const createUser: API.OperationMethod< CreateUserRequest, CreateUserResponse, CreateUserError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(264, __c33, 0) as any as S.Schema, output: __S(265, __c33, 1) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound, UnprocessableEntity], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateUser", })); export type DeleteDatabaseError = BadRequest | Forbidden | NotFound | StackitOpError; /** Delete Database Delete database for an instance. */ export const deleteDatabase: API.OperationMethod< DeleteDatabaseRequest, DeleteDatabaseResponse, DeleteDatabaseError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(272, __c34, 0) as any as S.Schema, output: __S(280, __c35, 0) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteDatabase", })); export type DeleteInstanceError = BadRequest | Forbidden | NotFound | StackitOpError; /** Delete Instance Delete an available sqlserver instance. */ export const deleteInstance: API.OperationMethod< DeleteInstanceRequest, DeleteInstanceResponse, DeleteInstanceError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(288, __c36, 0) as any as S.Schema, output: __S(280, __c35, 0) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteInstance", })); export type DeleteUserError = BadRequest | Forbidden | NotFound | StackitOpError; /** Delete User Delete an user from a specific instance. */ export const deleteUser: API.OperationMethod< DeleteUserRequest, DeleteUserResponse, DeleteUserError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(296, __c37, 0) as any as S.Schema, output: __S(280, __c35, 0) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteUser", })); export type GetBackupError = BadRequest | Forbidden | NotFound | StackitOpError; /** Get specific backup Get information about a specific backup for an instance. */ export const getBackup: API.OperationMethod< GetBackupRequest, GetBackupResponse, GetBackupError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(8, __c1, 0) as any as S.Schema, output: __S(16, __c2, 0) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetBackup", })); export type GetDatabaseError = BadRequest | Forbidden | NotFound | StackitOpError; /** Get Database Get specific available database */ export const getDatabase: API.OperationMethod< GetDatabaseRequest, GetDatabaseResponse, GetDatabaseError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(24, __c3, 0) as any as S.Schema, output: __S(25, __c3, 1) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetDatabase", })); export type GetInstanceError = BadRequest | Forbidden | NotFound | StackitOpError; /** Get Specific Instance Get information about a specific available instance */ export const getInstance: API.OperationMethod< GetInstanceRequest, GetInstanceResponse, GetInstanceError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(32, __c4, 0) as any as S.Schema, output: __S(35, __c4, 3) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetInstance", })); export type GetUserError = BadRequest | Forbidden | NotFound | StackitOpError; /** Get User Get a specific available user for an instance. */ export const getUser: API.OperationMethod< GetUserRequest, GetUserResponse, GetUserError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(40, __c5, 0) as any as S.Schema, output: __S(41, __c5, 1) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetUser", })); export type ListBackupsError = BadRequest | Forbidden | NotFound | StackitOpError; /** List backups List all backups which are available for a specific instance. */ export const listBackups: API.OperationMethod< ListBackupsRequest, ListBackupResponse, ListBackupsError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(48, __c6, 0) as any as S.Schema, output: __S(52, __c6, 4) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListBackups", })); export type ListCollationsError = BadRequest | Forbidden | NotFound | StackitOpError; /** Get database collation list Returns a list of collations for an instance */ export const listCollations: API.OperationMethod< ListCollationsRequest, ListCollationsResponse, ListCollationsError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(64, __c8, 0) as any as S.Schema, output: __S(67, __c8, 3) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListCollations", })); export type ListCompatibilitiesError = BadRequest | Forbidden | NotFound | StackitOpError; /** Get database compatibility list Returns a list of compatibility levels for creating a new database */ export const listCompatibilities: API.OperationMethod< ListCompatibilitiesRequest, ListCompatibilityResponse, ListCompatibilitiesError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(72, __c9, 0) as any as S.Schema, output: __S(75, __c9, 3) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListCompatibilities", })); export type ListCurrentRunningRestoreJobs2Error = | BadRequest | Forbidden | NotFound | StackitOpError; /** List current running restore jobs List all currently running restore jobs which are available for a specific instance */ export const listCurrentRunningRestoreJobs2: API.OperationMethod< ListCurrentRunningRestoreJobsRequest, ListCurrentRunningRestoreJobs, ListCurrentRunningRestoreJobs2Error, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(80, __c10, 0) as any as S.Schema, output: __S(83, __c10, 3) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListCurrentRunningRestoreJobs2", })); export type ListDatabasesError = BadRequest | Forbidden | NotFound | StackitOpError; /** List Databases List available databases for an instance. */ export const listDatabases: API.OperationMethod< ListDatabasesRequest, ListDatabasesResponse, ListDatabasesError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(88, __c11, 0) as any as S.Schema, output: __S(91, __c11, 3) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListDatabases", })); export type ListFlavors2Error = BadRequest | Forbidden | NotFound | StackitOpError; /** Get Flavors Get all available flavors for a project. */ export const listFlavors2: API.OperationMethod< ListFlavorsRequest, ListFlavorsResponse, ListFlavors2Error, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(96, __c12, 0) as any as S.Schema, output: __S(99, __c12, 3) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListFlavors2", })); export type ListInstancesError = BadRequest | Forbidden | NotFound | StackitOpError; /** List Instances List all available instances for your project. */ export const listInstances: API.OperationMethod< ListInstancesRequest, ListInstancesResponse, ListInstancesError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(112, __c14, 0) as any as S.Schema, output: __S(115, __c14, 3) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListInstances", })); export type ListRolesError = BadRequest | Forbidden | NotFound | StackitOpError; /** List Roles List available roles for an instance that can be assigned to a user */ export const listRoles: API.OperationMethod< ListRolesRequest, ListRolesResponse, ListRolesError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(120, __c15, 0) as any as S.Schema, output: __S(121, __c15, 1) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListRoles", })); export type ListStoragesError = BadRequest | Forbidden | NotFound | StackitOpError; /** Get Storages Get available storages for a specific flavor */ export const listStorages: API.OperationMethod< ListStoragesRequest, ListStoragesResponse, ListStoragesError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(128, __c16, 0) as any as S.Schema, output: __S(130, __c16, 2) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListStorages", })); export type ListUsersError = BadRequest | Forbidden | NotFound | StackitOpError; /** List Users List available users for an instance. */ export const listUsers: API.OperationMethod< ListUsersRequest, ListUserResponse, ListUsersError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(136, __c17, 0) as any as S.Schema, output: __S(139, __c17, 3) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListUsers", })); export type ListVersionsError = BadRequest | Forbidden | NotFound | StackitOpError; /** Get Versions Get the sqlserver available versions for the project. */ export const listVersions: API.OperationMethod< ListVersionsRequest, ListVersionsResponse, ListVersionsError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(144, __c18, 0) as any as S.Schema, output: __S(147, __c18, 3) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListVersions", })); export type PartialUpdateInstanceError = | BadRequest | Forbidden | NotFound | UnprocessableEntity | StackitOpError; /** Update Instance Partially Update an available instance of a mssql database. No fields are required. **Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex Instance.** */ export const partialUpdateInstance: API.OperationMethod< PartialUpdateInstanceRequest, PartialUpdateInstanceResponse, PartialUpdateInstanceError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(153, __c19, 1) as any as S.Schema, output: __S(280, __c35, 0) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound, UnprocessableEntity], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "PartialUpdateInstance", })); export type ResetUserError = | BadRequest | Forbidden | NotFound | UnprocessableEntity | StackitOpError; /** Reset User Reset an user from an specific instance. */ export const resetUser: API.OperationMethod< ResetUserRequest, ResetUserResponse, ResetUserError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(168, __c21, 0) as any as S.Schema, output: __S(169, __c21, 1) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound, UnprocessableEntity], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ResetUser", })); export type RestoreDatabaseFromBackupError = BadRequest | Forbidden | NotFound | StackitOpError; /** Create a Restore Operation Triggers a new restore operation for the specified instance. The request body defines the source (e.g., internal backup, external S3) and the target database. */ export const restoreDatabaseFromBackup: API.OperationMethod< RestoreDatabaseFromBackupRequest, RestoreDatabaseFromBackupResponse, RestoreDatabaseFromBackupError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(176, __c22, 0) as any as S.Schema, output: __S(280, __c35, 0) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "RestoreDatabaseFromBackup", })); export type TriggerBackupError = | BadRequest | Forbidden | NotFound | UnprocessableEntity | StackitOpError; /** Trigger backup for a specific Database Trigger backup for a specific database */ export const triggerBackup: API.OperationMethod< TriggerBackupRequest, TriggerBackupResponse, TriggerBackupError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(184, __c23, 0) as any as S.Schema, output: __S(280, __c35, 0) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound, UnprocessableEntity], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "TriggerBackup", })); export type TriggerRestoreError = | BadRequest | Forbidden | NotFound | UnprocessableEntity | StackitOpError; /** Trigger restore for a specific Database Trigger restore for a specific Database */ export const triggerRestore: API.OperationMethod< TriggerRestoreRequest, TriggerRestoreResponse, TriggerRestoreError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(192, __c24, 0) as any as S.Schema, output: __S(280, __c35, 0) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound, UnprocessableEntity], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "TriggerRestore", })); export type UpdateInstanceError = | BadRequest | Forbidden | NotFound | UnprocessableEntity | StackitOpError; /** Update Instance Updates an available instance of a sqlserver database **Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex Instance.** */ export const updateInstance: API.OperationMethod< UpdateInstanceRequest, UpdateInstanceResponse, UpdateInstanceError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(209, __c26, 1) as any as S.Schema, output: __S(280, __c35, 0) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound, UnprocessableEntity], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateInstance", })); export type UpdateInstanceProtectionError = | BadRequest | Forbidden | NotFound | UnprocessableEntity | StackitOpError; /** Protect Instance Toggle the deletion protection for an instance. */ export const updateInstanceProtection: API.OperationMethod< UpdateInstanceProtectionRequest, UpdateInstanceProtectionResponse, UpdateInstanceProtectionError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(216, __c27, 0) as any as S.Schema, output: __S(217, __c27, 1) as any as S.Schema, errors: [BadRequest, Forbidden, NotFound, UnprocessableEntity], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateInstanceProtection", })); // 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({ code: S.Number, message: S.String, traceId: S.String, type: S.String, }), ).annotate({ identifier: "Error" }); } } function __c1(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), backupId: S.Number.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/{backupId}", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "GetBackupRequest" }); } } function __c2(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ completionTime: S.String, id: S.Number, name: S.String, retainedUntil: S.String, size: S.Number, type: S.String, }), ).annotate({ identifier: "GetBackupResponse" }); } } function __c3(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), databaseName: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseName}", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "GetDatabaseRequest" }); case 1: return S.suspend(() => S.Struct({ collationName: S.String, compatibilityLevel: S.Number, id: S.Number, name: S.String, owner: S.String, }), ).annotate({ identifier: "GetDatabaseResponse" }); } } function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "GetInstanceRequest" }); case 1: return S.suspend(() => S.Struct({ accessScope: S.optional(S.String), acl: S.optional(__S(256, __c32, 0)), instanceAddress: S.optional(S.String), routerAddress: S.optional(S.String), }), ).annotate({ identifier: "InstanceNetwork" }); case 2: return S.suspend(() => S.Struct({ class: S.optional(S.String), size: S.optional(S.Number), }), ).annotate({ identifier: "Storage" }); case 3: return S.suspend(() => S.Struct({ backupSchedule: S.String, edition: S.String, encryption: S.optional(__S(240, __c30, 0)), flavorId: S.String, id: S.String, isDeletable: S.Boolean, labels: S.optional(__S(248, __c31, 0)), name: S.String, network: __S(33, __c4, 1), replicas: S.Number, retentionDays: S.Number, state: S.String, storage: __S(34, __c4, 2), version: S.String, }), ).annotate({ identifier: "GetInstanceResponse" }); } } function __c5(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), userId: S.Number.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "GetUserRequest" }); case 1: return S.suspend(() => S.Struct({ default_database: S.String, host: S.String, id: S.Number, port: S.Number, roles: __S(256, __c32, 0), status: S.String, username: S.String, }), ).annotate({ identifier: "GetUserResponse" }); } } function __c6(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), page: S.optional(S.Number.pipe(T.Query())), size: S.optional(S.Number.pipe(T.Query())), sort: S.optional(S.String.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/backups", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "ListBackupsRequest" }); case 1: return S.Array(__S(16, __c2, 0)); case 2: return S.suspend(() => S.Struct({ backups: __S(49, __c6, 1), databaseName: S.String, }), ).annotate({ identifier: "ListBackupsResponse" }); case 3: return S.Array(__S(50, __c6, 2)); case 4: return S.suspend(() => S.Struct({ backups: __S(51, __c6, 3), pagination: __S(56, __c7, 0), }), ).annotate({ identifier: "ListBackupResponse" }); } } function __c7(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ page: S.Number, size: S.Number, sort: S.String, totalPages: S.Number, totalRows: S.Number, }), ).annotate({ identifier: "Pagination" }); } } function __c8(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/collations", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "ListCollationsRequest" }); case 1: return S.suspend(() => S.Struct({ collation_name: S.optional(S.String), description: S.optional(S.String), }), ).annotate({ identifier: "DatabaseGetcollation" }); case 2: return S.Array(__S(65, __c8, 1)); case 3: return S.suspend(() => S.Struct({ collations: __S(66, __c8, 2), }), ).annotate({ identifier: "ListCollationsResponse" }); } } function __c9(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/compatibility", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "ListCompatibilitiesRequest" }); case 1: return S.suspend(() => S.Struct({ compatibility_level: S.optional(S.Number), description: S.optional(S.String), }), ).annotate({ identifier: "DatabaseGetcompatibility" }); case 2: return S.Array(__S(73, __c9, 1)); case 3: return S.suspend(() => S.Struct({ compatibilities: __S(74, __c9, 2), }), ).annotate({ identifier: "ListCompatibilityResponse" }); } } function __c10(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/restore-jobs", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "ListCurrentRunningRestoreJobsRequest" }); case 1: return S.suspend(() => S.Struct({ command: S.String, database_name: S.String, estimated_completion_time: S.String, percent_complete: S.Number, start_time: S.String, }), ).annotate({ identifier: "BackupRunningRestore" }); case 2: return S.Array(__S(81, __c10, 1)); case 3: return S.suspend(() => S.Struct({ runningRestores: __S(82, __c10, 2), }), ).annotate({ identifier: "ListCurrentRunningRestoreJobs" }); } } function __c11(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), page: S.optional(S.Number.pipe(T.Query())), size: S.optional(S.Number.pipe(T.Query())), sort: S.optional(S.String.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "ListDatabasesRequest" }); case 1: return S.suspend(() => S.Struct({ created: S.String, id: S.Number, name: S.String, owner: S.String, }), ).annotate({ identifier: "ListDatabase" }); case 2: return S.Array(__S(89, __c11, 1)); case 3: return S.suspend(() => S.Struct({ databases: __S(90, __c11, 2), pagination: __S(56, __c7, 0), }), ).annotate({ identifier: "ListDatabasesResponse" }); } } function __c12(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), page: S.optional(S.Number.pipe(T.Query())), size: S.optional(S.Number.pipe(T.Query())), sort: S.optional(S.String.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/v3/projects/{projectId}/regions/{region}/flavors", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "ListFlavorsRequest" }); case 1: return S.suspend(() => S.Struct({ cpu: S.Number, description: S.String, id: S.String, maxGB: S.Number, memory: S.Number, minGB: S.Number, nodeType: S.String, storageClasses: __S(105, __c13, 1), }), ).annotate({ identifier: "ListFlavors" }); case 2: return S.Array(__S(97, __c12, 1)); case 3: return S.suspend(() => S.Struct({ flavors: __S(98, __c12, 2), pagination: __S(56, __c7, 0), }), ).annotate({ identifier: "ListFlavorsResponse" }); } } function __c13(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ class: S.String, maxIoPerSec: S.Number, maxThroughInMb: S.Number, }), ).annotate({ identifier: "FlavorStorageClassesStorageClass" }); case 1: return S.Array(__S(104, __c13, 0)); } } function __c14(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), page: S.optional(S.Number.pipe(T.Query())), size: S.optional(S.Number.pipe(T.Query())), sort: S.optional(S.String.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/v3/projects/{projectId}/regions/{region}/instances", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "ListInstancesRequest" }); case 1: return S.suspend(() => S.Struct({ id: S.String, isDeletable: S.Boolean, name: S.String, state: S.String, }), ).annotate({ identifier: "ListInstance" }); case 2: return S.Array(__S(113, __c14, 1)); case 3: return S.suspend(() => S.Struct({ instances: __S(114, __c14, 2), pagination: __S(56, __c7, 0), }), ).annotate({ identifier: "ListInstancesResponse" }); } } function __c15(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/roles", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "ListRolesRequest" }); case 1: return S.suspend(() => S.Struct({ roles: __S(256, __c32, 0), }), ).annotate({ identifier: "ListRolesResponse" }); } } function __c16(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), flavorId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v3/projects/{projectId}/regions/{region}/storages/{flavorId}", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "ListStoragesRequest" }); case 1: return S.suspend(() => S.Struct({ max: S.Number, min: S.Number, }), ).annotate({ identifier: "FlavorStorageRange" }); case 2: return S.suspend(() => S.Struct({ storageClasses: __S(105, __c13, 1), storageRange: __S(129, __c16, 1), }), ).annotate({ identifier: "ListStoragesResponse" }); } } function __c17(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), page: S.optional(S.Number.pipe(T.Query())), size: S.optional(S.Number.pipe(T.Query())), sort: S.optional(S.String.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "ListUsersRequest" }); case 1: return S.suspend(() => S.Struct({ id: S.Number, status: S.String, username: S.String, }), ).annotate({ identifier: "ListUser" }); case 2: return S.Array(__S(137, __c17, 1)); case 3: return S.suspend(() => S.Struct({ pagination: __S(56, __c7, 0), users: __S(138, __c17, 2), }), ).annotate({ identifier: "ListUserResponse" }); } } function __c18(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v3/projects/{projectId}/regions/{region}/versions", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "ListVersionsRequest" }); case 1: return S.suspend(() => S.Struct({ beta: S.Boolean, deprecated: S.String, recommend: S.Boolean, version: S.String, }), ).annotate({ identifier: "Version" }); case 2: return S.Array(__S(145, __c18, 1)); case 3: return S.suspend(() => S.Struct({ versions: __S(146, __c18, 2), }), ).annotate({ identifier: "ListVersionsResponse" }); } } function __c19(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ acl: S.optional(__S(256, __c32, 0)), }), ).annotate({ identifier: "PartialUpdateInstanceRequestNetwork" }); case 1: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), backupSchedule: S.optional(S.String), flavorId: S.optional(S.String), labels: S.optional(__S(248, __c31, 0)), name: S.optional(S.String), network: S.optional(__S(152, __c19, 0)), retentionDays: S.optional(S.Number), storage: S.optional(__S(160, __c20, 0)), version: S.optional(S.String), }).pipe( T.Http({ method: "PATCH", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "PartialUpdateInstanceRequest" }); } } function __c20(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ size: S.optional(S.Number), }), ).annotate({ identifier: "StorageUpdate" }); } } function __c21(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), userId: S.Number.pipe(T.Label()), }).pipe( T.Http({ method: "POST", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}/reset", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "ResetUserRequest" }); case 1: return S.suspend(() => S.Struct({ password: S.String.pipe(T.SensitiveValue({})), status: S.String, uri: S.String, username: S.String, }), ).annotate({ identifier: "ResetUserResponse" }); } } function __c22(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), database_name: S.String, source: S.Unknown, }).pipe( T.Http({ method: "POST", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/restores", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "RestoreDatabaseFromBackupRequest" }); } } function __c23(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), databaseName: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "POST", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/databases/{databaseName}", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "TriggerBackupRequest" }); } } function __c24(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), databaseName: S.String.pipe(T.Label()), name: S.String, restoreDateTime: S.String, }).pipe( T.Http({ method: "POST", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/databases/{databaseName}/restores", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "TriggerRestoreRequest" }); } } function __c25(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ field: S.String, message: S.String, }), ).annotate({ identifier: "ValidationErrorValidationItem" }); case 1: return S.Array(__S(200, __c25, 0)); case 2: return S.suspend(() => S.Struct({ code: S.Number, validation: __S(201, __c25, 1), }), ).annotate({ identifier: "ValidationError" }); } } function __c26(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ acl: __S(256, __c32, 0), }), ).annotate({ identifier: "UpdateInstanceRequestNetwork" }); case 1: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), backupSchedule: S.String, flavorId: S.String, labels: S.optional(__S(248, __c31, 0)), name: S.String, network: __S(208, __c26, 0), retentionDays: S.Number, storage: __S(160, __c20, 0), version: S.String, }).pipe( T.Http({ method: "PUT", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "UpdateInstanceRequest" }); } } function __c27(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), isDeletable: S.Boolean, }).pipe( T.Http({ method: "POST", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/protections", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "UpdateInstanceProtectionRequest" }); case 1: return S.suspend(() => S.Struct({ isDeletable: S.Boolean, }), ).annotate({ identifier: "UpdateInstanceProtectionResponse" }); } } function __c28(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), collation: S.optional(S.String), compatibility: S.optional(S.Number), name: S.String, owner: S.String, }).pipe( T.Http({ method: "POST", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "CreateDatabaseRequest" }); case 1: return S.suspend(() => S.Struct({ id: S.Number, }), ).annotate({ identifier: "CreateDatabaseResponse" }); } } function __c29(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ accessScope: S.optional(S.String), acl: __S(256, __c32, 0), }), ).annotate({ identifier: "CreateInstanceRequestNetwork" }); case 1: return S.suspend(() => S.Struct({ class: S.String, size: S.Number, }), ).annotate({ identifier: "StorageCreate" }); case 2: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), backupSchedule: S.String, encryption: S.optional(__S(240, __c30, 0)), flavorId: S.String, labels: S.optional(__S(248, __c31, 0)), name: S.String, network: __S(232, __c29, 0), retentionDays: S.Number, storage: __S(233, __c29, 1), version: S.String, }).pipe( T.Http({ method: "POST", uri: "/v3/projects/{projectId}/regions/{region}/instances", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "CreateInstanceRequest" }); case 3: return S.suspend(() => S.Struct({ id: S.String, }), ).annotate({ identifier: "CreateInstanceResponse" }); } } function __c30(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ kekKeyId: S.String, kekKeyRingId: S.String, kekKeyVersion: S.String, serviceAccount: S.String, }), ).annotate({ identifier: "InstanceEncryption" }); } } function __c31(j: number): any { switch (j) { case 0: return S.Record(S.String, /*@__PURE__*/ S.NullOr(S.String)); } } function __c32(j: number): any { switch (j) { case 0: return S.Array(S.String); } } function __c33(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), default_database: S.optional(S.String), roles: __S(256, __c32, 0), username: S.String, }).pipe( T.Http({ method: "POST", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "CreateUserRequest" }); case 1: return S.suspend(() => S.Struct({ default_database: S.String, host: S.String, id: S.Number, password: S.String.pipe(T.SensitiveValue({})), port: S.Number, roles: __S(256, __c32, 0), status: S.String, uri: S.String, username: S.String, }), ).annotate({ identifier: "CreateUserResponse" }); } } function __c34(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), databaseName: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseName}", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "DeleteDatabaseRequest" }); } } function __c35(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({})).annotate({ identifier: "DeleteDatabaseResponse" }); } } function __c36(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "DeleteInstanceRequest" }); } } function __c37(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), region: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), userId: S.Number.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}", code: 200, baseUrl: "https://mssql-flex-service.api.stackit.cloud", }), ), ).annotate({ identifier: "DeleteUserRequest" }); } } // 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)); }