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 { 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: "ResourceManager", 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?: ErrorResponse | string; } export class Conflict extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("Conflict", { 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.withConflictError), [{ status: 409 }], ) { declare readonly body?: ErrorResponse | 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?: ErrorResponse | 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?: ErrorResponse | string; } /** Key-value string pairs attached to an existing resource container. Certain labels may be enforced via organizational policies. * **Key:** Must be between 1 and 63 characters long (excluding an optional domain prefix). Must start and end with an alphanumeric character `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots (.). May include an optional domain prefix up to 250 characters (a lowercase DNS subdomain containing `[a-z0-9]`, `-`, and `.`) followed by a slash (/). Total maximum key length is 314 characters. * **Value:** Must be 63 characters or less. May be empty (""). If non-empty, must start and end with an alphanumeric character `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots (.). Can be set to null to delete the label. > Note: Additional naming restrictions may apply depending on your specific organization.* */ export type Labels = { [key: string]: string | undefined }; export interface Member { /** A valid role defined for the resource. */ role: string; /** Unique identifier of the user, service account or client. */ subject: string; } /** The initial members assigned to the folder. */ export type CreateFolderRequestMembersList = Array; export interface CreateFolderRequest { /** Identifier of the parent resource container */ containerParentId: string; labels?: Labels | undefined; /** The initial members assigned to the folder. */ members?: CreateFolderRequestMembersList | undefined; /** Folder name matching the regex `^[a-zA-ZäüöÄÜÖ0-9]( ?[a-zA-ZäüöÄÜÖß0-9_+&-]){1,40}$`. */ name: string; } /** Container type of parent container. */ export type ParentType = "ORGANIZATION" | "FOLDER"; /** Parent container. */ export interface Parent { /** User-friendly identifier of either organization or folder (will replace id). */ containerId: string; /** Identifier of either organization or folder. */ id: string; /** Container type of parent container. */ type: ParentType; } export interface FolderResponse { /** Globally unique, user-friendly identifier. */ containerId: string; /** Timestamp at which the folder was created. */ creationTime: string; /** Globally unique folder identifier. */ folderId: string; labels?: Labels | undefined; /** Folder name. */ name: string; parent: Parent; /** Timestamp at which the folder was last modified. */ updateTime: string; } /** Key-value string pairs attached to a resource container during creation. Certain labels may be enforced via organizational policies. * **Key:** Must be between 1 and 63 characters long (excluding an optional domain prefix). Must start and end with an alphanumeric character `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots (.). May include an optional domain prefix up to 250 characters (a lowercase DNS subdomain containing `[a-z0-9]`, `-`, and `.`) followed by a slash (/). Total maximum key length is 314 characters. * **Value:** Must be 63 characters or less. May be empty (""). If non-empty, must start and end with an alphanumeric character `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots (.). * Either a `"scope": "PUBLIC"` label or a valid `networkArea` label must be provided for project creation. * To create a project within a STACKIT Network Area, you must set the label `"networkArea": ""`. > **Important:** The `networkArea` label is immutable and **cannot be changed** after project creation. */ export type CreateProjectLabels = { [key: string]: string | undefined }; /** The initial members assigned to the project. At least one subject needs to be a user, and not a client or service account. */ export type CreateProjectRequestMembersList = Array; export interface CreateProjectRequest { /** Identifier of the parent resource container - containerId as well as UUID identifier is supported. */ containerParentId: string; labels?: CreateProjectLabels | undefined; /** The initial members assigned to the project. At least one subject needs to be a user, and not a client or service account. */ members?: CreateProjectRequestMembersList | undefined; /** Project name matching the regex `^[a-zA-ZäüöÄÜÖ0-9]( ?[a-zA-ZäüöÄÜÖß0-9_+&-]){1,40}$`. */ name: string; } /** Lifecycle state of the resource container. | LIFECYCLE STATE | DESCRIPTION | |----------|--------------------| | CREATING | The creation process has been triggered. The state remains until resource manager gets notified about successful process completion. | | ACTIVE | Resource container can be fully used. | | INACTIVE | Resource container usage has been disabled. | | DELETING | The deletion process has been triggered. The state remains until resource manager gets notified about successful process completion. Afterwards, the record will be deleted. | */ export type LifecycleState = "CREATING" | "ACTIVE" | "DELETING" | "INACTIVE"; export interface Project { /** Globally unique, user-friendly identifier. */ containerId: string; /** Timestamp at which the project was created. */ creationTime: string; labels?: Labels | undefined; lifecycleState: LifecycleState; /** Project name. */ name: string; parent: Parent; /** Globally unique, project identifier. */ projectId: string; /** Timestamp at which the project was last modified. */ updateTime: string; } export interface DeleteFolderRequest { /** Folder identifier - containerId as well as UUID identifier is supported. */ containerId: string; /** If true, all nested, empty folders are deleted recursively - if no project is attached! */ force?: boolean | undefined; } export interface DeleteFolderResponse {} export type DeleteFolderLabelsRequestKeysList = Array; export interface DeleteFolderLabelsRequest { /** Folder identifier - containerId as well as UUID identifier is supported. */ containerId: string; /** Label name. */ keys?: DeleteFolderLabelsRequestKeysList | undefined; } export interface DeleteFolderLabelsResponse {} export type DeleteOrganizationLabelsRequestKeysList = Array; export interface DeleteOrganizationLabelsRequest { /** Organization identifier - containerId as well as UUID identifier is supported. */ containerId: string; /** Label name. */ keys?: DeleteOrganizationLabelsRequestKeysList | undefined; } export interface DeleteOrganizationLabelsResponse {} export interface DeleteProjectRequest { /** Project identifier - containerId as well as UUID identifier is supported. */ id: string; } export interface DeleteProjectResponse {} export type DeleteProjectLabelsRequestKeysList = Array; export interface DeleteProjectLabelsRequest { /** Project identifier - containerId as well as UUID identifier is supported. */ containerId: string; /** Label name. */ keys?: DeleteProjectLabelsRequestKeysList | undefined; } export interface DeleteProjectLabelsResponse {} export interface GetFolderDetailsRequest { /** Folder identifier - containerId as well as UUID identifier is supported. */ containerId: string; includeParents?: boolean | undefined; } /** Parent container type. */ export type ParentListItemType = "FOLDER" | "ORGANIZATION"; export interface ParentListItem { /** User-friendly identifier of either organization or folder (will replace id). */ containerId: string; /** User-friendly parent identifier of either organization or folder (will replace parentId). */ containerParentId?: string | undefined; /** Identifier. */ id: string; /** Parent container name. */ name: string; /** Identifier of the parent resource container. */ parentId?: string | undefined; /** Parent container type. */ type: ParentListItemType; } export type ParentList = Array; export interface GetFolderDetailsResponse { /** Globally unique user-friendly identifier. */ containerId: string; /** Timestamp at which the folder was created. */ creationTime: string; /** Globally unique folder identifier. */ folderId: string; labels?: Labels | undefined; /** Folder name. */ name: string; parent: Parent; parents?: ParentList | undefined; /** Timestamp at which the folder was last modified. */ updateTime: string; } export interface GetOrganizationRequest { /** Organization identifier - containerId as well as UUID identifier is supported. */ id: string; } export interface OrganizationResponse { /** Globally unique, user-friendly identifier. */ containerId: string; /** Timestamp at which the organization was created. */ creationTime: string; labels?: Labels | undefined; lifecycleState: LifecycleState; /** Organization name. */ name: string; /** Globally unique, organization identifier. */ organizationId: string; /** Timestamp at which the organization was last modified. */ updateTime: string; } export interface GetProjectRequest { /** Project identifier - containerId as well as UUID identifier is supported. */ id: string; includeParents?: boolean | undefined; } export interface GetProjectResponse { /** Globally unique identifier. */ containerId: string; /** Timestamp at which the project was created. */ creationTime: string; labels?: Labels | undefined; lifecycleState: LifecycleState; /** Project name. */ name: string; parent: Parent; parents?: ParentList | undefined; /** Globally unique identifier. */ projectId: string; /** Timestamp at which the project was last modified. */ updateTime: string; } export type ListFoldersRequestContainerIdsList = Array; export interface ListFoldersRequest { /** Identifier of the parent resource container - containerId as well as UUID identifier is supported. */ containerParentId?: string | undefined; /** List of container identifiers - containerId as well as UUID identifier is supported. */ containerIds?: ListFoldersRequestContainerIdsList | undefined; /** E-Mail address of the user for whom the visible resource containers should be filtered. */ member?: string | undefined; /** The maximum number of projects to return in the response. If not present, an appropriate default will be used. If maximum is exceeded, maximum is used. */ limit?: number | undefined; /** The offset of the first item in the collection to return. */ offset?: number | undefined; /** A timestamp to specify the beginning of the creationTime from which entries should be returned. If not given, defaults to the beginning of time. */ creation_time_start?: string | undefined; } export interface ListFoldersResponseItemsItem { /** Globally unique folder identifier. */ containerId: string; /** Timestamp at which the folder was created. */ creationTime: string; /** Globally unique folder identifier. */ folderId: string; labels?: Labels | undefined; /** Name of the folder. */ name: string; parent: Parent; /** Timestamp at which the folder was created. */ updateTime: string; } export type ListFoldersResponseItemsList = Array; export interface ListFoldersResponse { items: ListFoldersResponseItemsList; limit: number; offset: number; } export type ListOrganizationsRequestContainerIdsList = Array; export interface ListOrganizationsRequest { /** Organization identifiers - containerId as well as UUID identifier is supported. A combination of both is not allowed. */ containerIds?: ListOrganizationsRequestContainerIdsList | undefined; /** E-Mail address of the user for whom the visible resource containers should be filtered. */ member?: string | undefined; /** The maximum number of projects to return in the response. If not present, an appropriate default will be used. If maximum is exceeded, maximum is used. */ limit?: number | undefined; /** The offset of the first item in the collection to return. */ offset?: number | undefined; /** A timestamp to specify the beginning of the creationTime from which entries should be returned. If not given, defaults to the beginning of time. */ creation_time_start?: string | undefined; } export interface ListOrganizationsResponseItemsItem { /** Globally unique, user-friendly identifier. */ containerId: string; /** Timestamp at which the organization was created. */ creationTime: string; labels?: Labels | undefined; lifecycleState: LifecycleState; /** Name of the organization. */ name: string; /** Globally unique, organization identifier. */ organizationId: string; /** Timestamp at which the organization was last modified. */ updateTime: string; } export type ListOrganizationsResponseItemsList = Array; export interface ListOrganizationsResponse { items: ListOrganizationsResponseItemsList; limit: number; offset: number; } export type ListProjectsRequestContainerIdsList = Array; export interface ListProjectsRequest { /** Identifier of the parent resource container - containerId as well as UUID identifier is supported. */ containerParentId?: string | undefined; /** List of container identifiers - containerId as well as UUID identifier is supported. */ containerIds?: ListProjectsRequestContainerIdsList | undefined; /** E-Mail address of the user for whom the visible resource containers should be filtered. */ member?: string | undefined; /** The offset of the first item in the collection to return. */ offset?: number | undefined; /** The maximum number of projects to return in the response. If not present, an appropriate default will be used. If maximum is exceeded, maximum is used. */ limit?: number | undefined; /** A timestamp to specify the beginning of the creationTime from which entries should be returned. If not given, defaults to the beginning of time. */ creation_time_start?: string | undefined; } export type ListProjectsResponseItemsList = Array; export interface ListProjectsResponse { items: ListProjectsResponseItemsList; limit: number; offset: number; } /** Key-value string pairs attached to an existing resource container. Certain labels may be enforced via organizational policies. Setting an individual label's value to `null` removes/deletes that label from the resource. * **Key:** Must be between 1 and 63 characters long (excluding an optional domain prefix). Must start and end with an alphanumeric character `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots (.). May include an optional domain prefix up to 250 characters (a lowercase DNS subdomain containing `[a-z0-9]`, `-`, and `.`) followed by a slash (/). Total maximum key length is 314 characters. * **Value:** Must be 63 characters or less. May be empty (""). If non-empty, must start and end with an alphanumeric character `[a-zA-Z0-9]` and can contain alphanumerics, dashes (-), underscores (_), and dots (.). Can be set to null to delete the label. > Note: Additional naming restrictions may apply depending on your specific organization.* */ export type UpdateLabels = { [key: string]: string | null | undefined }; export interface PartialUpdateFolderRequest { /** Folder identifier - containerId as well as UUID identifier is supported. */ containerId: string; /** New parent identifier for the resource container - containerId as well as UUID identifier is supported. */ containerParentId?: string | undefined; labels?: UpdateLabels | undefined; /** New name for the resource container matching the regex `^[a-zA-ZäüöÄÜÖ0-9]( ?[a-zA-ZäüöÄÜÖß0-9_+&-]){1,40}$`. */ name?: string | undefined; } export interface PartialUpdateOrganizationRequest { /** Organization identifier - containerId as well as UUID identifier is supported. */ id: string; labels?: UpdateLabels | undefined; /** The new name of the organization matching the regex `^[a-zA-ZäüöÄÜÖ0-9]( ?[a-zA-ZäüöÄÜÖß0-9_+&-]){1,40}$`. */ name?: string | undefined; } export interface PartialUpdateProjectRequest { /** Project identifier - containerId as well as UUID identifier is supported. */ id: string; /** New parent identifier for the resource container - containerId as well as UUID identifier is supported. */ containerParentId?: string | undefined; labels?: UpdateLabels | undefined; /** New name for the resource container matching the regex `^[a-zA-ZäüöÄÜÖ0-9]( ?[a-zA-ZäüöÄÜÖß0-9_+&-]){1,40}$`. */ name?: string | undefined; } export interface ErrorResponse { /** The reason phrase of the status code. */ error: string; /** Description of the error. */ message: string; /** Path which was called. */ path: string; /** Http Status Code. */ status: number; /** Timestamp at which the error occurred. */ timeStamp: string; } export type CreateFolderError = BadRequest | Forbidden | Conflict | StackitOpError; /** Create Folder Creates a new folder within a parent organization or folder. Authorization & Permissions: - Evaluated on Target Parent Container: resource-manager.folder.create (required permission on the target parent organization or folder to create a folder). */ export const createFolder: API.OperationMethod< CreateFolderRequest, FolderResponse, CreateFolderError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(56, __c14, 0) as any as S.Schema, output: __S(60, __c15, 0) as any as S.Schema, errors: [BadRequest, Forbidden, Conflict], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateFolder", })); export type CreateProjectError = BadRequest | Forbidden | Conflict | StackitOpError; /** Create Project Creates a new project within a parent container. - Creation request returns synchronously, while underlying resource provisioning runs asynchronously. - Initial lifecycle state is CREATING until provisioning completes. Authorization & Permissions: - Evaluated on Target Parent Container: resource-manager.project.create (required permission on the target parent organization or folder to create a project). */ export const createProject: API.OperationMethod< CreateProjectRequest, Project, CreateProjectError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(76, __c19, 0) as any as S.Schema, output: __S(80, __c20, 0) as any as S.Schema, errors: [BadRequest, Forbidden, Conflict], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateProject", })); export type DeleteFolderError = NotFound | Conflict | StackitOpError; /** Delete Folder Delete a folder and its metadata. - Folder must not contain active child containers unless force deletion is enabled without attached projects. Authorization & Permissions: - Evaluated on Target Folder: resource-manager.folder.delete (required permission on the target folder to delete it). */ export const deleteFolder: API.OperationMethod< DeleteFolderRequest, DeleteFolderResponse, DeleteFolderError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(84, __c21, 0) as any as S.Schema, output: __S(88, __c22, 0) as any as S.Schema, errors: [NotFound, Conflict], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteFolder", })); export type DeleteFolderLabelsError = Conflict | StackitOpError; /** Delete Folder Labels Deletes folder labels by specified keys, or removes all labels if no key is provided. Authorization & Permissions: - Evaluated on Target Folder: resource-manager.folder.edit (required permission on the target folder to delete its labels). */ export const deleteFolderLabels: API.OperationMethod< DeleteFolderLabelsRequest, DeleteFolderLabelsResponse, DeleteFolderLabelsError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(92, __c23, 0) as any as S.Schema, output: __S(88, __c22, 0) as any as S.Schema, errors: [Conflict], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteFolderLabels", })); export type DeleteOrganizationLabelsError = Conflict | StackitOpError; /** Delete Organization Labels Deletes organization labels by specified keys, or removes all labels if no key is provided. Authorization & Permissions: - Evaluated on Target Organization: resource-manager.organization.edit (required permission on the organization to delete labels). */ export const deleteOrganizationLabels: API.OperationMethod< DeleteOrganizationLabelsRequest, DeleteOrganizationLabelsResponse, DeleteOrganizationLabelsError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(100, __c25, 0) as any as S.Schema, output: __S(88, __c22, 0) as any as S.Schema, errors: [Conflict], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteOrganizationLabels", })); export type DeleteProjectError = Conflict | StackitOpError; /** Delete Project Triggers the deletion of a project. - Request returns synchronously, while deletion process runs asynchronously. - Initial lifecycle state is DELETING until workflow completes. Authorization & Permissions: - Evaluated on Target Project: resource-manager.project.delete (required permission on the project to delete it). */ export const deleteProject: API.OperationMethod< DeleteProjectRequest, DeleteProjectResponse, DeleteProjectError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(104, __c26, 0) as any as S.Schema, output: __S(88, __c22, 0) as any as S.Schema, errors: [Conflict], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteProject", })); export type DeleteProjectLabelsError = Conflict | StackitOpError; /** Delete Project Labels Deletes project labels by specified keys, or removes all labels if no key is provided. Authorization & Permissions: - Evaluated on Target Project: resource-manager.project.edit (required permission on the project to delete its labels). */ export const deleteProjectLabels: API.OperationMethod< DeleteProjectLabelsRequest, DeleteProjectLabelsResponse, DeleteProjectLabelsError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(4, __c1, 0) as any as S.Schema, output: __S(88, __c22, 0) as any as S.Schema, errors: [Conflict], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteProjectLabels", })); export type GetFolderDetailsError = Forbidden | NotFound | StackitOpError; /** Get Folder Details Returns metadata for a specific folder. Authorization & Permissions: - Evaluated on Target Folder: resource-manager.folder.get (required primary permission to retrieve folder details). - Evaluated on Parent Containers: resource-manager.organization.get and resource-manager.folder.get implicitly to resolve parent hierarchy details. */ export const getFolderDetails: API.OperationMethod< GetFolderDetailsRequest, GetFolderDetailsResponse, GetFolderDetailsError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(8, __c2, 0) as any as S.Schema, output: __S(9, __c2, 1) as any as S.Schema, errors: [Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetFolderDetails", })); export type GetOrganizationError = NotFound | StackitOpError; /** Get Organization Details Returns metadata for a specific organization. Authorization & Permissions: - Evaluated on Target Organization: resource-manager.organization.get (required permission on the organization to view its details). */ export const getOrganization: API.OperationMethod< GetOrganizationRequest, OrganizationResponse, GetOrganizationError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(16, __c4, 0) as any as S.Schema, output: __S(20, __c5, 0) as any as S.Schema, errors: [NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetOrganization", })); export type GetProjectError = Forbidden | NotFound | StackitOpError; /** Get Project Details Returns the project and its metadata. Authorization & Permissions: - Evaluated on Target Project: resource-manager.project.get (required primary permission to view project details). - Evaluated on Parent Containers: resource-manager.organization.get and resource-manager.folder.get on parent organizations/folders implicitly to resolve and include parent metadata in the response hierarchy. */ export const getProject: API.OperationMethod< GetProjectRequest, GetProjectResponse, GetProjectError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(24, __c6, 0) as any as S.Schema, output: __S(25, __c6, 1) as any as S.Schema, errors: [Forbidden, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetProject", })); export type ListFoldersError = BadRequest | Forbidden | Conflict | StackitOpError; /** Get All Folders Returns all folders and their metadata that: - Are children of the specific containerParentId - Match the given containerIds - User is member of
Filter: - Either containerParentId OR containerIds OR member must be passed - If containerId and containerParentId are given, both are used for filtering - containers must point to the same parent - If member and containerParentId are given, both are used for filtering - If member is given, containers must not point to the same container parent Authorization & Permissions: - When filtering by member: resource-manager.folder.direct.get is evaluated on target folders for the member; if caller differs from target member, system-level resource-manager.folder.get is required. - When filtering by containerParentId: resource-manager.folder.list is evaluated on the parent container. - When filtering by containerIds: resource-manager.folder.get is evaluated on the parent container of requested folders. */ export const listFolders: API.OperationMethod< ListFoldersRequest, ListFoldersResponse, ListFoldersError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(28, __c7, 0) as any as S.Schema, output: __S(30, __c7, 2) as any as S.Schema, errors: [BadRequest, Forbidden, Conflict], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListFolders", })); export type ListOrganizationsError = BadRequest | Forbidden | StackitOpError; /** Get all organizations of member Returns all organizations and their metadata accessible to the caller. - Filterable by containerIds or member. Authorization & Permissions: - Evaluated on Target Organizations: resource-manager.organization.list and/or (depending if containerIDs was used in the request) resource-manager.organization.get to filter and list accessible organizations. */ export const listOrganizations: API.OperationMethod< ListOrganizationsRequest, ListOrganizationsResponse, ListOrganizationsError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(32, __c8, 0) as any as S.Schema, output: __S(34, __c8, 2) as any as S.Schema, errors: [BadRequest, Forbidden], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListOrganizations", })); export type ListProjectsError = BadRequest | Forbidden | StackitOpError; /** Get All Projects of a member. Returns all projects and their metadata that: - Are children of the specific containerParentId - Match the given containerIds - User is member of Filter: - Either containerParentId OR containerIds OR member must be passed - If containerId and containerParentId are given, both are used for filtering - containers must point to the same parent - If member and containerParentId are given, both are used for filtering - If member is given, containers must not point to the same container parent Authorization & Permissions: - Evaluated on Target Projects: resource-manager.project.get, resource-manager.project.list, or resource-manager.project.direct.get to filter and return accessible projects. */ export const listProjects: API.OperationMethod< ListProjectsRequest, ListProjectsResponse, ListProjectsError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(36, __c9, 0) as any as S.Schema, output: __S(38, __c9, 2) as any as S.Schema, errors: [BadRequest, Forbidden], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListProjects", })); export type PartialUpdateFolderError = Forbidden | NotFound | Conflict | StackitOpError; /** Update Folder Update the folder and its metadata (name, labels, parent container). Authorization & Permissions: - Evaluated on Target Folder: resource-manager.folder.edit (required permission on the target folder to modify its details, labels, or parent). */ export const partialUpdateFolder: API.OperationMethod< PartialUpdateFolderRequest, FolderResponse, PartialUpdateFolderError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(40, __c10, 0) as any as S.Schema, output: __S(60, __c15, 0) as any as S.Schema, errors: [Forbidden, NotFound, Conflict], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "PartialUpdateFolder", })); export type PartialUpdateOrganizationError = NotFound | Conflict | StackitOpError; /** Update Organization Updates organization metadata (name, labels). Authorization & Permissions: - Evaluated on Target Organization: resource-manager.organization.edit (required permission on the organization to update metadata and labels). */ export const partialUpdateOrganization: API.OperationMethod< PartialUpdateOrganizationRequest, OrganizationResponse, PartialUpdateOrganizationError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(48, __c12, 0) as any as S.Schema, output: __S(20, __c5, 0) as any as S.Schema, errors: [NotFound, Conflict], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "PartialUpdateOrganization", })); export type PartialUpdateProjectError = Forbidden | NotFound | Conflict | StackitOpError; /** Update Project Updates project metadata (name, labels, or parent hierarchy). Authorization & Permissions: - Evaluated on Target Project: resource-manager.project.edit (required permission on the project to modify its details, labels, or parent). */ export const partialUpdateProject: API.OperationMethod< PartialUpdateProjectRequest, Project, PartialUpdateProjectError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(52, __c13, 0) as any as S.Schema, output: __S(80, __c20, 0) as any as S.Schema, errors: [Forbidden, NotFound, Conflict], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "PartialUpdateProject", })); // 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({ error: S.String, message: S.String, path: S.String, status: S.Number, timeStamp: S.String, }), ).annotate({ identifier: "ErrorResponse" }); } } function __c1(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ containerId: S.String.pipe(T.Label()), keys: S.optional(__S(96, __c24, 0).pipe(T.Query())), }).pipe( T.Http({ method: "DELETE", uri: "/v2/projects/{containerId}/labels", code: 200, baseUrl: "https://resource-manager.api.stackit.cloud", }), ), ).annotate({ identifier: "DeleteProjectLabelsRequest" }); } } function __c2(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ containerId: S.String.pipe(T.Label()), includeParents: S.optional(S.Boolean.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/v2/folders/{containerId}", code: 200, baseUrl: "https://resource-manager.api.stackit.cloud", }), ), ).annotate({ identifier: "GetFolderDetailsRequest" }); case 1: return S.suspend(() => S.Struct({ containerId: S.String, creationTime: S.String, folderId: S.String, labels: S.optional(__S(68, __c17, 0)), name: S.String, parent: __S(72, __c18, 0), parents: S.optional(__S(13, __c3, 1)), updateTime: S.String, }), ).annotate({ identifier: "GetFolderDetailsResponse" }); } } function __c3(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ containerId: S.String, containerParentId: S.optional(S.String), id: S.String, name: S.String, parentId: S.optional(S.String), type: S.String, }), ).annotate({ identifier: "ParentListItem" }); case 1: return S.Array(__S(12, __c3, 0)); } } function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v2/organizations/{id}", code: 200, baseUrl: "https://resource-manager.api.stackit.cloud", }), ), ).annotate({ identifier: "GetOrganizationRequest" }); } } function __c5(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ containerId: S.String, creationTime: S.String, labels: S.optional(__S(68, __c17, 0)), lifecycleState: S.String, name: S.String, organizationId: S.String, updateTime: S.String, }), ).annotate({ identifier: "OrganizationResponse" }); } } function __c6(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.String.pipe(T.Label()), includeParents: S.optional(S.Boolean.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/v2/projects/{id}", code: 200, baseUrl: "https://resource-manager.api.stackit.cloud", }), ), ).annotate({ identifier: "GetProjectRequest" }); case 1: return S.suspend(() => S.Struct({ containerId: S.String, creationTime: S.String, labels: S.optional(__S(68, __c17, 0)), lifecycleState: S.String, name: S.String, parent: __S(72, __c18, 0), parents: S.optional(__S(13, __c3, 1)), projectId: S.String, updateTime: S.String, }), ).annotate({ identifier: "GetProjectResponse" }); } } function __c7(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ containerParentId: S.optional(S.String.pipe(T.Query())), containerIds: S.optional(__S(96, __c24, 0).pipe(T.Query())), member: S.optional(S.String.pipe(T.Query())), limit: S.optional(S.Number.pipe(T.Query())), offset: S.optional(S.Number.pipe(T.Query())), creation_time_start: S.optional(S.String.pipe(T.Query("creation-time-start"))), }).pipe( T.Http({ method: "GET", uri: "/v2/folders", code: 200, baseUrl: "https://resource-manager.api.stackit.cloud", }), ), ).annotate({ identifier: "ListFoldersRequest" }); case 1: return S.Array(__S(60, __c15, 0)); case 2: return S.suspend(() => S.Struct({ items: __S(29, __c7, 1), limit: S.Number, offset: S.Number, }), ).annotate({ identifier: "ListFoldersResponse" }); } } function __c8(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ containerIds: S.optional(__S(96, __c24, 0).pipe(T.Query())), member: S.optional(S.String.pipe(T.Query())), limit: S.optional(S.Number.pipe(T.Query())), offset: S.optional(S.Number.pipe(T.Query())), creation_time_start: S.optional(S.String.pipe(T.Query("creation-time-start"))), }).pipe( T.Http({ method: "GET", uri: "/v2/organizations", code: 200, baseUrl: "https://resource-manager.api.stackit.cloud", }), ), ).annotate({ identifier: "ListOrganizationsRequest" }); case 1: return S.Array(__S(20, __c5, 0)); case 2: return S.suspend(() => S.Struct({ items: __S(33, __c8, 1), limit: S.Number, offset: S.Number, }), ).annotate({ identifier: "ListOrganizationsResponse" }); } } function __c9(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ containerParentId: S.optional(S.String.pipe(T.Query())), containerIds: S.optional(__S(96, __c24, 0).pipe(T.Query())), member: S.optional(S.String.pipe(T.Query())), offset: S.optional(S.Number.pipe(T.Query())), limit: S.optional(S.Number.pipe(T.Query())), creation_time_start: S.optional(S.String.pipe(T.Query("creation-time-start"))), }).pipe( T.Http({ method: "GET", uri: "/v2/projects", code: 200, baseUrl: "https://resource-manager.api.stackit.cloud", }), ), ).annotate({ identifier: "ListProjectsRequest" }); case 1: return S.Array(__S(80, __c20, 0)); case 2: return S.suspend(() => S.Struct({ items: __S(37, __c9, 1), limit: S.Number, offset: S.Number, }), ).annotate({ identifier: "ListProjectsResponse" }); } } function __c10(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ containerId: S.String.pipe(T.Label()), containerParentId: S.optional(S.String), labels: S.optional(__S(44, __c11, 0)), name: S.optional(S.String), }).pipe( T.Http({ method: "PATCH", uri: "/v2/folders/{containerId}", code: 200, baseUrl: "https://resource-manager.api.stackit.cloud", }), ), ).annotate({ identifier: "PartialUpdateFolderRequest" }); } } function __c11(j: number): any { switch (j) { case 0: return S.Record(S.String, /*@__PURE__*/ S.NullOr(S.String)); } } function __c12(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.String.pipe(T.Label()), labels: S.optional(__S(44, __c11, 0)), name: S.optional(S.String), }).pipe( T.Http({ method: "PATCH", uri: "/v2/organizations/{id}", code: 200, baseUrl: "https://resource-manager.api.stackit.cloud", }), ), ).annotate({ identifier: "PartialUpdateOrganizationRequest" }); } } function __c13(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.String.pipe(T.Label()), containerParentId: S.optional(S.String), labels: S.optional(__S(44, __c11, 0)), name: S.optional(S.String), }).pipe( T.Http({ method: "PATCH", uri: "/v2/projects/{id}", code: 200, baseUrl: "https://resource-manager.api.stackit.cloud", }), ), ).annotate({ identifier: "PartialUpdateProjectRequest" }); } } function __c14(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ containerParentId: S.String, labels: S.optional(__S(68, __c17, 0)), members: S.optional(__S(65, __c16, 1)), name: S.String, }).pipe( T.Http({ method: "POST", uri: "/v2/folders", code: 200, baseUrl: "https://resource-manager.api.stackit.cloud", }), ), ).annotate({ identifier: "CreateFolderRequest" }); } } function __c15(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ containerId: S.String, creationTime: S.String, folderId: S.String, labels: S.optional(__S(68, __c17, 0)), name: S.String, parent: __S(72, __c18, 0), updateTime: S.String, }), ).annotate({ identifier: "FolderResponse" }); } } function __c16(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ role: S.String, subject: S.String, }), ).annotate({ identifier: "Member" }); case 1: return S.Array(__S(64, __c16, 0)); } } function __c17(j: number): any { switch (j) { case 0: return S.Record(S.String, S.String); } } function __c18(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ containerId: S.String, id: S.String, type: S.String, }), ).annotate({ identifier: "Parent" }); } } function __c19(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ containerParentId: S.String, labels: S.optional(__S(68, __c17, 0)), members: S.optional(__S(65, __c16, 1)), name: S.String, }).pipe( T.Http({ method: "POST", uri: "/v2/projects", code: 200, baseUrl: "https://resource-manager.api.stackit.cloud", }), ), ).annotate({ identifier: "CreateProjectRequest" }); } } function __c20(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ containerId: S.String, creationTime: S.String, labels: S.optional(__S(68, __c17, 0)), lifecycleState: S.String, name: S.String, parent: __S(72, __c18, 0), projectId: S.String, updateTime: S.String, }), ).annotate({ identifier: "Project" }); } } function __c21(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ containerId: S.String.pipe(T.Label()), force: S.optional(S.Boolean.pipe(T.Query())), }).pipe( T.Http({ method: "DELETE", uri: "/v2/folders/{containerId}", code: 200, baseUrl: "https://resource-manager.api.stackit.cloud", }), ), ).annotate({ identifier: "DeleteFolderRequest" }); } } function __c22(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({})).annotate({ identifier: "DeleteFolderResponse" }); } } function __c23(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ containerId: S.String.pipe(T.Label()), keys: S.optional(__S(96, __c24, 0).pipe(T.Query())), }).pipe( T.Http({ method: "DELETE", uri: "/v2/folders/{containerId}/labels", code: 200, baseUrl: "https://resource-manager.api.stackit.cloud", }), ), ).annotate({ identifier: "DeleteFolderLabelsRequest" }); } } function __c24(j: number): any { switch (j) { case 0: return S.Array(S.String); } } function __c25(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ containerId: S.String.pipe(T.Label()), keys: S.optional(__S(96, __c24, 0).pipe(T.Query())), }).pipe( T.Http({ method: "DELETE", uri: "/v2/organizations/{containerId}/labels", code: 200, baseUrl: "https://resource-manager.api.stackit.cloud", }), ), ).annotate({ identifier: "DeleteOrganizationLabelsRequest" }); } } function __c26(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/v2/projects/{id}", code: 200, baseUrl: "https://resource-manager.api.stackit.cloud", }), ), ).annotate({ identifier: "DeleteProjectRequest" }); } } // 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)); }