openapi: 3.0.4
info:
  title: Fractal Environments
  description: Fractal Environments description
  contact:
    name: Fractal Cloud
    url: https://fractal.cloud/
    email: contact-us@fractal.cloud
  version: v1
paths:
  /environments/{type}/{ownerId}/{shortName}/initializer/aws/authenticate:
    post:
      tags:
        - AwsInitializer
      summary: >-
        Start AWS authentication via IAM Identity Center (SSO) or direct
        credentials.
      description: >-
        - SSO (Device Authorization Flow): Returns 202 Accepted and publishes a
        device code event.

        - Direct IAM credentials: Can be queued immediately.
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Aws.AwsAuthenticateRequest
            example:
              ssoRegion: null
              ssoStartUrl: null
              accessKeyId: AKIAxxxxxxxxxxxx
              secretAccessKey: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
              sessionToken: FQoGZXIvYXdzEFQaDm/...
          text/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Aws.AwsAuthenticateRequest
            example:
              ssoRegion: null
              ssoStartUrl: null
              accessKeyId: AKIAxxxxxxxxxxxx
              secretAccessKey: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
              sessionToken: FQoGZXIvYXdzEFQaDm/...
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Aws.AwsAuthenticateRequest
            example:
              ssoRegion: null
              ssoStartUrl: null
              accessKeyId: AKIAxxxxxxxxxxxx
              secretAccessKey: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
              sessionToken: FQoGZXIvYXdzEFQaDm/...
      responses:
        '202':
          description: AWS authentication queued. Device code event will be published.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/YanchWare.Fractal.Environments.Application.Events.Azure.Initializer.AzureDeviceCodeCreatedEvent
        '400':
          description: 'Invalid request: missing credentials or SSO start URL.'
  /environments/{type}/{ownerId}/{shortName}/initializer/aws/initialize:
    post:
      tags:
        - AwsInitializer
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: X-AWS-Access-Key-ID
          in: header
          schema:
            type: string
        - name: X-AWS-Secret-Access-Key
          in: header
          schema:
            type: string
        - name: X-AWS-Session-Token
          in: header
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Aws.AccountInitializationRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Aws.AccountInitializationRequest
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Aws.AccountInitializationRequest
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/YanchWare.Fractal.Environments.Application.Contracts.InitializationRunGenerateResponse
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '500':
          description: Internal Server Error
  /environments/{type}/{ownerId}/{shortName}/initializer/aws/status:
    get:
      tags:
        - AwsInitializer
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      responses:
        '200':
          description: OK
  /environments/{type}/{ownerId}/{shortName}/initializer/aws/selected/account:
    post:
      tags:
        - AwsInitializer
      summary: Retrieves AWS regions accessible for the selected account.
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: X-AWS-Access-Key-ID
          in: header
          schema:
            type: string
        - name: X-AWS-Secret-Access-Key
          in: header
          schema:
            type: string
        - name: X-AWS-Session-Token
          in: header
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Aws.AccountSelectedRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Aws.AccountSelectedRequest
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Aws.AccountSelectedRequest
      responses:
        '200':
          description: A list of AWS regions available to your account.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/YanchWare.Fractal.Environments.Application.Contracts.CloudLocationResponse
        '400':
          description: The request is invalid or required credentials are missing.
        '401':
          description: You are not authorized to access this resource.
        '500':
          description: An unexpected error occurred.
  /environments/{type}/{ownerId}/{shortName}/initializer/aws/regions:
    get:
      tags:
        - AwsInitializer
      summary: Gets AWS regions for a given project.
      operationId: GetAwsRegions
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: X-AWS-Access-Key-ID
          in: header
          schema:
            type: string
        - name: X-AWS-Secret-Access-Key
          in: header
          schema:
            type: string
        - name: X-AWS-Session-Token
          in: header
          schema:
            type: string
      responses:
        '200':
          description: Successfully retrieved AWS regions.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/YanchWare.Fractal.Environments.Application.Contracts.Aws.AwsLocationResponse
        '401':
          description: Unauthorized access.
        '500':
          description: Internal server error.
  /environments/{type}/{ownerId}/{shortName}/initializer/azure/authenticate/{tenantId}:
    post:
      tags:
        - AzureInitializer
      summary: Authenticates a user based on environment and optionally a tenant ID.
      parameters:
        - name: type
          in: path
          description: The type of environment.
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          description: The owner's GUID.
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          description: The short name of the environment.
          required: true
          schema:
            maxLength: 30
            type: string
        - name: tenantId
          in: path
          description: Optional tenant ID. If not provided, defaults to "common".
          schema:
            type: string
            format: uuid
      responses:
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
  /environments/{type}/{ownerId}/{shortName}/initializer/azure/initialize:
    post:
      tags:
        - AzureInitializer
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: X-Azure-SP-Client-ID
          in: header
          schema:
            type: string
        - name: X-Azure-SP-Client-Secret
          in: header
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Azure.SubscriptionInitializationRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Azure.SubscriptionInitializationRequest
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Azure.SubscriptionInitializationRequest
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/YanchWare.Fractal.Environments.Application.Contracts.InitializationRunGenerateResponse
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '500':
          description: Internal Server Error
  /environments/{type}/{ownerId}/{shortName}/initializer/azure/retry:
    post:
      tags:
        - AzureInitializer
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      responses:
        '200':
          description: OK
  /environments/{type}/{ownerId}/{shortName}/initializer/azure/status:
    get:
      tags:
        - AzureInitializer
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      responses:
        '200':
          description: OK
  /environments/{type}/{ownerId}/{shortName}/initializer/azure/{tenantId}/subscriptions/{subscriptionId}/locations:
    get:
      tags:
        - AzureInitializer
      summary: >-
        Gets Azure locations for a given subscription, optionally filtered by
        tenant.
      operationId: GetLocationsWithTenant
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: tenantId
          in: path
          schema:
            type: string
            format: uuid
        - name: subscriptionId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successfully retrieved locations.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/YanchWare.Fractal.Environments.Application.Contracts.Azure.AzureLocationResponse
        '401':
          description: Unauthorized access.
        '500':
          description: Internal server error.
  /environments/{type}/{ownerId}/{shortName}/initializer/azure/subscriptions/{subscriptionId}/locations:
    get:
      tags:
        - AzureInitializer
      summary: >-
        Gets Azure locations for a given subscription, optionally filtered by
        tenant.
      operationId: GetLocationsWithoutTenant
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: tenantId
          in: path
          schema:
            type: string
            format: uuid
        - name: subscriptionId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successfully retrieved locations.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/YanchWare.Fractal.Environments.Application.Contracts.Azure.AzureLocationResponse
        '401':
          description: Unauthorized access.
        '500':
          description: Internal server error.
  /environments/{type}/{ownerId}/{shortName}/ci-cd-profiles:
    post:
      tags:
        - CiCdProfiles
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.CiCdProfiles.CreateCiCdProfileRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.CiCdProfiles.CreateCiCdProfileRequest
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.CiCdProfiles.CreateCiCdProfileRequest
      responses:
        '200':
          description: OK
    get:
      tags:
        - CiCdProfiles
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      responses:
        '200':
          description: OK
  /environments/{type}/{ownerId}/{shortName}/ci-cd-profiles/bulk:
    post:
      tags:
        - CiCdProfiles
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: >-
                  #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.CiCdProfiles.CreateCiCdProfileRequest
          text/json:
            schema:
              type: array
              items:
                $ref: >-
                  #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.CiCdProfiles.CreateCiCdProfileRequest
          application/*+json:
            schema:
              type: array
              items:
                $ref: >-
                  #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.CiCdProfiles.CreateCiCdProfileRequest
      responses:
        '200':
          description: OK
  /environments/{type}/{ownerId}/{shortName}/ci-cd-profiles/{profileShortName}:
    get:
      tags:
        - CiCdProfiles
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: profileShortName
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
    put:
      tags:
        - CiCdProfiles
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: profileShortName
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.CiCdProfiles.UpdateCiCdProfileRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.CiCdProfiles.UpdateCiCdProfileRequest
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.CiCdProfiles.UpdateCiCdProfileRequest
      responses:
        '200':
          description: OK
    delete:
      tags:
        - CiCdProfiles
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: profileShortName
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
  /environments/{type}/{ownerId}/{shortName}:
    get:
      tags:
        - Environments
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/YanchWare.Fractal.Environments.Domain.Entities.EnvironmentDto
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
    post:
      tags:
        - Environments
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Environments.CreateEnvironmentRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Environments.CreateEnvironmentRequest
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Environments.CreateEnvironmentRequest
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/YanchWare.Fractal.Environments.Domain.Entities.EnvironmentDto
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
    put:
      tags:
        - Environments
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Environments.UpdateEnvironmentRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Environments.UpdateEnvironmentRequest
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Environments.UpdateEnvironmentRequest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/YanchWare.Fractal.Environments.Domain.Entities.EnvironmentDto
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
    delete:
      tags:
        - Environments
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
  /environments/{type}/{ownerId}/{shortName}/initializer/gcp/oauth/authorize:
    post:
      tags:
        - GcpInitializer
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      responses:
        '302':
          description: Found
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
  /environments/gcp/oauth/callback:
    post:
      tags:
        - GcpInitializer
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.OAuth.OAuthCallback
          text/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.OAuth.OAuthCallback
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.OAuth.OAuthCallback
      responses:
        '200':
          description: Authenticate Callback
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/YanchWare.Fractal.Environments.Application.Common.OAuthResponse
  /environments/{type}/{ownerId}/{shortName}/initializer/gcp/initialize:
    post:
      tags:
        - GcpInitializer
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: X-GCP-Service-Account-Email
          in: header
          schema:
            type: string
        - name: X-GCP-Service-Account-Credentials
          in: header
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Gcp.ProjectInitializationRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Gcp.ProjectInitializationRequest
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Gcp.ProjectInitializationRequest
        required: true
      responses:
        '200':
          description: OK
  /environments/{type}/{ownerId}/{shortName}/initializer/gcp/retry:
    post:
      tags:
        - GcpInitializer
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      responses:
        '200':
          description: OK
  /environments/{type}/{ownerId}/{shortName}/initializer/gcp/status:
    get:
      tags:
        - GcpInitializer
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      responses:
        '200':
          description: OK
  /environments/{type}/{ownerId}/{shortName}/initializer/gcp/selected/project:
    post:
      tags:
        - GcpInitializer
      summary: Retrieves GCP regions accessible for the selected project.
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: X-GCP-Service-Account-Email
          in: header
          schema:
            type: string
        - name: X-GCP-Service-Account-Credentials
          in: header
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Gcp.ProjectSelectedRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Gcp.ProjectSelectedRequest
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Gcp.ProjectSelectedRequest
      responses:
        '200':
          description: A list of GCP regions available to your project.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/YanchWare.Fractal.Environments.Application.Contracts.CloudLocationResponse
        '400':
          description: The request is invalid or required credentials are missing.
        '401':
          description: You are not authorized to access this resource.
        '500':
          description: An unexpected error occurred.
  /environments/{type}/{ownerId}/{shortName}/initializer/gcp/projects/{projectName}/locations:
    get:
      tags:
        - GcpInitializer
      summary: Gets Gcp locations for a given project.
      operationId: GetGcpLocations
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: projectName
          in: path
          required: true
          schema:
            type: string
        - name: X-GCP-Service-Account-Email
          in: header
          schema:
            type: string
        - name: X-GCP-Service-Account-Credentials
          in: header
          schema:
            type: string
      responses:
        '200':
          description: Successfully retrieved locations.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/YanchWare.Fractal.Environments.Application.Contracts.Gcp.GcpLocationResponse
        '401':
          description: Unauthorized access.
        '500':
          description: Internal server error.
  /Health:
    get:
      tags:
        - Health
      responses:
        '200':
          description: OK
  /environments/{type}/{ownerId}/{shortName}/initializer/hetzner/initialize:
    post:
      tags:
        - HetznerInitializer
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: X-Hetzner-Token
          in: header
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Hetzner.ProjectInitializationRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Hetzner.ProjectInitializationRequest
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Initializer.Hetzner.ProjectInitializationRequest
      responses:
        '200':
          description: OK
  /environments/{type}/{ownerId}/{shortName}/initializer/hetzner/status:
    get:
      tags:
        - HetznerInitializer
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      responses:
        '200':
          description: OK
  /environments/{type}/{ownerId}/{shortName}/secrets:
    post:
      tags:
        - Secrets
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Secrets.CreateSecretRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Secrets.CreateSecretRequest
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Secrets.CreateSecretRequest
      responses:
        '200':
          description: OK
    get:
      tags:
        - Secrets
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      responses:
        '200':
          description: OK
  /environments/{type}/{ownerId}/{shortName}/secrets/bulk:
    post:
      tags:
        - Secrets
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: >-
                  #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Secrets.CreateSecretRequest
          text/json:
            schema:
              type: array
              items:
                $ref: >-
                  #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Secrets.CreateSecretRequest
          application/*+json:
            schema:
              type: array
              items:
                $ref: >-
                  #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Secrets.CreateSecretRequest
      responses:
        '200':
          description: OK
  /environments/{type}/{ownerId}/{shortName}/secrets/{secretShortName}:
    get:
      tags:
        - Secrets
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: secretShortName
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
    put:
      tags:
        - Secrets
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: secretShortName
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Secrets.UpdateSecretRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Secrets.UpdateSecretRequest
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.Secrets.UpdateSecretRequest
      responses:
        '200':
          description: OK
  /environments/{type}/{ownerId}/{shortName}/secrets/{secretName}:
    delete:
      tags:
        - Secrets
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: secretName
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
  /environments/{type}/{ownerId}/{shortName}/service-accounts/{principalId}:
    post:
      tags:
        - ServiceAccount
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: principalId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.ServiceAccounts.CreateServiceAccountRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.ServiceAccounts.CreateServiceAccountRequest
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.ServiceAccounts.CreateServiceAccountRequest
      responses:
        '200':
          description: OK
    get:
      tags:
        - ServiceAccount
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: principalId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
    put:
      tags:
        - ServiceAccount
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: principalId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.ServiceAccounts.UpdateServiceAccountRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.ServiceAccounts.UpdateServiceAccountRequest
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/YanchWare.Fractal.Environments.Application.Requests.ServiceAccounts.UpdateServiceAccountRequest
      responses:
        '200':
          description: OK
    delete:
      tags:
        - ServiceAccount
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
        - name: principalId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
  /environments/{type}/{ownerId}/{shortName}/service-accounts:
    get:
      tags:
        - ServiceAccount
      parameters:
        - name: type
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        - name: ownerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: shortName
          in: path
          required: true
          schema:
            maxLength: 30
            type: string
      responses:
        '200':
          description: OK
components:
  schemas:
    Microsoft.AspNetCore.Mvc.ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    YanchWare.Fractal.Environments.Application.Common.OAuthResponse:
      type: object
      properties:
        environmentId:
          $ref: >-
            #/components/schemas/YanchWare.Fractal.Environments.Domain.Values.EnvironmentId
        status:
          $ref: >-
            #/components/schemas/YanchWare.Fractal.Environments.Application.Common.OAuthStatus
        message:
          type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Common.OAuthStatus:
      enum:
        - Success
        - Failure
      type: string
    YanchWare.Fractal.Environments.Application.Contracts.Aws.AwsLocationResponse:
      type: object
      properties:
        name:
          type: string
          nullable: true
        endpoint:
          type: string
          nullable: true
        optInStatus:
          type: string
          nullable: true
        latitude:
          type: number
          format: double
        longitude:
          type: number
          format: double
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Contracts.Azure.AzureAvailabilityZoneMappingsResponse:
      type: object
      properties:
        logicalZone:
          type: string
          nullable: true
        physicalZone:
          type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Contracts.Azure.AzureDeviceCodeResponse:
      type: object
      properties:
        userCode:
          type: string
          nullable: true
        verificationUri:
          type: string
          nullable: true
        expiresOn:
          type: string
          format: date-time
        message:
          type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Contracts.Azure.AzureLocationMetadataResponse:
      type: object
      properties:
        regionType:
          type: string
          nullable: true
        regionCategory:
          type: string
          nullable: true
        geographyGroup:
          type: string
          nullable: true
        longitude:
          type: string
          nullable: true
        latitude:
          type: string
          nullable: true
        physicalLocation:
          type: string
          nullable: true
        pairedRegions:
          type: array
          items:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Application.Contracts.Azure.AzurePairedRegionResponse
          nullable: true
        homeLocation:
          type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Contracts.Azure.AzureLocationResponse:
      type: object
      properties:
        id:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        displayName:
          type: string
          nullable: true
        regionalDisplayName:
          type: string
          nullable: true
        type:
          type: string
          nullable: true
        metadata:
          $ref: >-
            #/components/schemas/YanchWare.Fractal.Environments.Application.Contracts.Azure.AzureLocationMetadataResponse
        availabilityZoneMappings:
          type: array
          items:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Application.Contracts.Azure.AzureAvailabilityZoneMappingsResponse
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Contracts.Azure.AzurePairedRegionResponse:
      type: object
      properties:
        name:
          type: string
          nullable: true
        id:
          type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Contracts.CloudLocationResponse:
      required:
        - locationId
        - provider
      type: object
      properties:
        provider:
          $ref: >-
            #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.CloudProvider
        locationId:
          minLength: 1
          type: string
          description: Identifier for the location (e.g., "us-east-1", "us-central1")
        displayName:
          type: string
          description: Human-readable name for UI (optional)
          nullable: true
        latitude:
          type: number
          description: Latitude coordinate for the location
          format: double
        longitude:
          type: number
          description: Longitude coordinate for the location
          format: double
      additionalProperties: false
      description: >-
        Represents a cloud location with geographic coordinates and caching
        info.
    YanchWare.Fractal.Environments.Application.Contracts.Gcp.GcpLocationResponse:
      type: object
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
          nullable: true
        kind:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        status:
          type: string
          nullable: true
        zones:
          type: array
          items:
            type: string
          nullable: true
        latitude:
          type: number
          format: double
        longitude:
          type: number
          format: double
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Contracts.InitializationRunGenerateResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        environmentId:
          $ref: >-
            #/components/schemas/YanchWare.Fractal.Environments.Domain.Values.EnvironmentId
        cloudProvider:
          $ref: >-
            #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.CloudProvider
        steps:
          uniqueItems: true
          type: array
          items:
            $ref: >-
              #/components/schemas/YanchWare.Fractal.Environments.Application.Contracts.InitializationStepResponse
          nullable: true
        status:
          $ref: >-
            #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.InitializationStatus
        requester:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Contracts.InitializationStepResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        order:
          type: integer
          format: int32
        resourceName:
          type: string
          nullable: true
        resourceType:
          type: string
          nullable: true
        outputFields:
          type: object
          additionalProperties:
            nullable: true
          nullable: true
        lastOperationStatusMessage:
          type: string
          nullable: true
        status:
          $ref: >-
            #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.InitializationStatus
        retryCount:
          type: integer
          format: int32
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Events.Azure.Initializer.AzureDeviceCodeCreatedEvent:
      type: object
      properties:
        messageType:
          $ref: >-
            #/components/schemas/YanchWare.Fractal.Environments.Application.MessageType
        messageName:
          type: string
          nullable: true
        version:
          type: string
          nullable: true
        authorizations:
          type: string
          nullable: true
        eventName:
          type: string
          nullable: true
        environmentId:
          $ref: >-
            #/components/schemas/YanchWare.Fractal.Environments.Domain.Values.EnvironmentId
        deviceCodeResult:
          $ref: >-
            #/components/schemas/YanchWare.Fractal.Environments.Application.Contracts.Azure.AzureDeviceCodeResponse
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.MessageType:
      enum:
        - Unknown
        - Query
        - Command
        - Event
      type: string
    YanchWare.Fractal.Environments.Application.Requests.CiCdProfiles.CreateCiCdProfileRequest:
      type: object
      properties:
        shortName:
          type: string
          nullable: true
        displayName:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        sshPrivateKeyData:
          type: string
          nullable: true
        sshPrivateKeyPassphrase:
          type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Requests.CiCdProfiles.UpdateCiCdProfileRequest:
      type: object
      properties:
        displayName:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        sshPrivateKeyData:
          type: string
          nullable: true
        sshPrivateKeyPassphrase:
          type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Requests.Environments.CreateEnvironmentRequest:
      type: object
      properties:
        managementEnvironmentId:
          $ref: >-
            #/components/schemas/YanchWare.Fractal.Environments.Domain.Values.EnvironmentId
        name:
          type: string
          nullable: true
        resourceGroups:
          uniqueItems: true
          type: array
          items:
            type: string
          nullable: true
        parameters:
          type: object
          additionalProperties:
            nullable: true
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Requests.Environments.UpdateEnvironmentRequest:
      type: object
      properties:
        managementEnvironmentId:
          $ref: >-
            #/components/schemas/YanchWare.Fractal.Environments.Domain.Values.EnvironmentId
        name:
          type: string
          nullable: true
        resourceGroups:
          uniqueItems: true
          type: array
          items:
            type: string
          nullable: true
        parameters:
          type: object
          additionalProperties:
            nullable: true
          nullable: true
        defaultCiCdProfileShortName:
          type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Requests.Initializer.Aws.AccountInitializationRequest:
      type: object
      properties:
        accountId:
          type: string
          nullable: true
        region:
          type: string
          nullable: true
        organizationId:
          type: string
          nullable: true
        tags:
          type: object
          additionalProperties:
            type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Requests.Initializer.Aws.AccountSelectedRequest:
      type: object
      properties:
        accountId:
          type: string
          nullable: true
        organizationId:
          type: string
          nullable: true
        roleName:
          type: string
          nullable: true
        ssoRegion:
          type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Requests.Initializer.Aws.AwsAuthenticateRequest:
      type: object
      properties:
        ssoRegion:
          type: string
          description: >-
            AWS IAM Identity Center (SSO) region used for the OIDC device
            authorization flow (e.g., 'eu-central-1'). Required if using SSO
            flow.
          nullable: true
        ssoStartUrl:
          type: string
          description: |-
            AWS SSO start URL for the account or organization.
            Example formats:
            - Default: https://d-xxxxxxxxxx.awsapps.com/start
            - Custom subdomain: https://your_subdomain.awsapps.com/start
            Required if using SSO flow.
          nullable: true
        accessKeyId:
          type: string
          description: AWS IAM access key ID. Required if using direct credentials.
          nullable: true
        secretAccessKey:
          type: string
          description: AWS IAM secret access key. Required if using direct credentials.
          nullable: true
        sessionToken:
          type: string
          description: AWS IAM session token. Required if using direct credentials.
          nullable: true
      additionalProperties: false
      description: >-
        Request to authenticate a user via AWS IAM Identity Center (SSO) or
        direct IAM credentials.

        Either SSO info (SsoRegion + SsoStartUrl) or direct credentials
        (AccessKeyId + SecretAccessKey + SessionToken) must be provided.
    YanchWare.Fractal.Environments.Application.Requests.Initializer.Azure.SubscriptionInitializationRequest:
      type: object
      properties:
        tenantId:
          type: string
          format: uuid
        subscriptionId:
          type: string
          format: uuid
        region:
          type: string
          nullable: true
        tags:
          type: object
          additionalProperties:
            type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Requests.Initializer.Gcp.ProjectInitializationRequest:
      type: object
      properties:
        organizationId:
          type: string
          nullable: true
        projectId:
          type: string
          nullable: true
        region:
          type: string
          nullable: true
        tags:
          type: object
          additionalProperties:
            type: string
          nullable: true
        fractalConnectorCidr:
          type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Requests.Initializer.Gcp.ProjectSelectedRequest:
      type: object
      properties:
        projectId:
          type: string
          nullable: true
        organizationId:
          type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Requests.Initializer.Hetzner.ProjectInitializationRequest:
      type: object
      properties:
        projectId:
          type: string
          nullable: true
        region:
          type: string
          nullable: true
        tags:
          type: object
          additionalProperties:
            type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Requests.OAuth.OAuthCallback:
      type: object
      properties:
        state:
          type: string
          format: uuid
        code:
          type: string
          nullable: true
        scope:
          type: string
          nullable: true
        error:
          type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Requests.Secrets.CreateSecretRequest:
      type: object
      properties:
        shortName:
          type: string
          nullable: true
        displayName:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        value:
          type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Requests.Secrets.UpdateSecretRequest:
      type: object
      properties:
        displayName:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        value:
          type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Requests.ServiceAccounts.CreateServiceAccountRequest:
      type: object
      properties:
        serviceAccountRole:
          $ref: >-
            #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.ServiceAccountRole
        description:
          type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Application.Requests.ServiceAccounts.UpdateServiceAccountRequest:
      type: object
      properties:
        description:
          type: string
          nullable: true
        active:
          type: boolean
      additionalProperties: false
    YanchWare.Fractal.Environments.Domain.Entities.EnvironmentDto:
      type: object
      properties:
        managementEnvironmentId:
          $ref: >-
            #/components/schemas/YanchWare.Fractal.Environments.Domain.Values.EnvironmentId
        id:
          $ref: >-
            #/components/schemas/YanchWare.Fractal.Environments.Domain.Values.EnvironmentId
        name:
          type: string
          nullable: true
        resourceGroups:
          uniqueItems: true
          type: array
          items:
            type: string
          nullable: true
        parameters:
          type: object
          additionalProperties:
            nullable: true
          nullable: true
        defaultCiCdProfileShortName:
          type: string
          nullable: true
        status:
          $ref: >-
            #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentStatus
        createdAt:
          type: string
          format: date-time
        createdBy:
          type: string
          nullable: true
        updatedAt:
          type: string
          format: date-time
        updatedBy:
          type: string
          nullable: true
      additionalProperties: false
    YanchWare.Fractal.Environments.Domain.Enums.CloudProvider:
      enum:
        - Unknown
        - Azure
        - Gcp
        - Aws
        - Oci
        - Hetzner
      type: string
    YanchWare.Fractal.Environments.Domain.Enums.EnvironmentStatus:
      enum:
        - Unknown
        - Active
        - Failed
        - Deleted
      type: string
    YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType:
      enum:
        - Unknown
        - Personal
        - Organizational
      type: string
    YanchWare.Fractal.Environments.Domain.Enums.InitializationStatus:
      enum:
        - Unknown
        - NotStarted
        - InProgress
        - Completed
        - Failed
        - Cancelled
      type: string
    YanchWare.Fractal.Environments.Domain.Enums.ServiceAccountRole:
      enum:
        - CloudAgent
        - CiCd
        - Custom
        - BasicAuthKeyVaultOnly
        - Bot
      type: string
    YanchWare.Fractal.Environments.Domain.Values.EnvironmentId:
      type: object
      properties:
        type:
          $ref: >-
            #/components/schemas/YanchWare.Fractal.Environments.Domain.Enums.EnvironmentType
        ownerId:
          type: string
          format: uuid
        shortName:
          type: string
          nullable: true
      additionalProperties: false
  securitySchemes:
    Bearer:
      type: apiKey
      description: >-
        X-JWT header using the Bearer scheme. Example: "Authorization: Bearer
        {token}"
      name: X-JWT
      in: header
security:
  - Bearer: []
