openapi: 3.0.0
info:
  version: v1.2
  title: TcPCM Gateway API
  description: TcPCM Gateway API
  license:
    name: Privacy Policy
    url: https://www.plm.automation.siemens.com/global/en/legal/privacy-policy.html
paths:
  /token:
    post:
      tags:
        - 'Account'
      summary: Login to get the bearer token for protected endpoints
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                grant_type:
                  type: string
                  default: password
                  description: Defines the method obtaining the access token.
                  enum:
                    - password
                    - applicationSession
                    - urn:ietf:params:oauth:grant-type:token-exchange
                    - refresh_token
                authenticatorId:
                  type: string
                  default: Siemens.TCPCM.AuthenticationMethod.TcPCM
                  description: >-
                    TcPCM authentication method to be used with the provided
                    credentials.
                  enum:
                    - Siemens.TCPCM.AuthenticationMethod.TcPCM
                    - Siemens.TCPCM.AuthenticationMethod.Windows
                    - Siemens.TCPCM.AuthenticationMethod.SamAuth
                client_id:
                  type: string
                  default: TcPCM
                  description: >-
                    Uniquely identifies the application making the request for
                    authentication purposes.
                client_secret:
                  type: string
                  default: Your_Client_Secret
                  description: >-
                    Confidential key used alongside the client_id to securely
                    authenticate the application making the request.
                username:
                  type: string
                  default: Administrator
                  description: TcPCM or Windows user name depending on the authenticatorId.
                password:
                  type: string
                  default: ''
                  description: Corresponding password of the username.
                subject_token_type:
                  type: string
                  description: >-
                    Type of the token to be exchanged for the login. Only
                    "urn:ietf:params:oauth:token-type:access_token" is
                    supported.
                  enum:
                    - urn:ietf:params:oauth:token-type:access_token
                subject_token:
                  type: string
                  description: Value of the exchanged token.
                tcpcmSessionKey:
                  type: string
                  description: >-
                    Session identifier that can be obtained via the TcPCM client
                    application plugin.
                refresh_token:
                  type: string
                  description: >-
                    Refresh token that you obtained via the initial
                    authentication.
              required:
                - grant_type
                - client_id
                - client_secret
      responses:
        '200':
          description: Successful login
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                    description: Bearer token for authorization
                  token_type:
                    type: string
                    description: Only "bearer" is supported
                  expires_in:
                    type: integer
                    description: Seconds until the token expires
                  refresh_token:
                    type: string
                    description: Token to be used for resetting the expiration date
                  as:client_id:
                    type: string
                    description: Requested client id
                  as:TcPCMAuthenticatorId:
                    type: string
                    description: Requested authenticator id
                  .issued:
                    type: string
                    description: Login timestamp
                  .expires:
                    type: string
                    description: Expiration date
                required:
                  - access_token
                  - token_type
                  - expires_in
                  - refresh_token
                  - as:client_id
                  - as:TcPCMAuthenticatorId
                  - .issued
                  - .expires
        '400':
          description: Bad request. Login failed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error title
                  error_description:
                    type: string
                    description: Detailed error description
                required:
                  - error
                  - error_description
        '500':
          description: Server error. Login failed.
          content:
            text/html:
              schema:
                type: string
                description: Error description
      description: >-
        TcPCM supports three different login flows:

        1. **Resource Owner Password flow**: Use the *username* and *password*
        with the *grant\_type* "password" and *authenticatorId*
        "Siemens.TCPCM.AuthenticationMethod.TcPCM" or
        "Siemens.TCPCM.AuthenticationMethod.Windows".

        2. **Token Exchange flow**: Use the *subject\_token\_type* and
        *subject\_token* with the *grant\_type*
        "urn:ietf:params:oauth:grant-type:token-exchange" and *authenticatorId*
        "Siemens.TCPCM.AuthenticationMethod.SamAuth".

        3. **Custom flow**: Use the *tcpcmSessionKey* with the *grant\_type*
        "applicationSession" without *authenticatorId*.


        Refresh token flow:

        * The refresh token can be used to generate a new bearer token without
        re-authenticating.
        
        * The *grant\_type* must be set to "refresh\_token" and the *refresh\_token* must be provided that was obtained via the initial authentication.
  /api/v1/administration/users/{userName}:
    get:
      tags:
        - Administration
      summary: Fetch a user User by {userName}. Only allowed for admins.
      operationId: GetUser_GetUser
      security:
        - bearerHttpAuthentication: []
      parameters:
        - name: userName
          in: path
          description: User name
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response_of_UserResponseModel'
            text/json:
              schema:
                $ref: '#/components/schemas/Response_of_UserResponseModel'
            application/xml:
              schema:
                $ref: '#/components/schemas/Response_of_UserResponseModel'
            text/xml:
              schema:
                $ref: '#/components/schemas/Response_of_UserResponseModel'
        '401':
          description: Unauthorized
        '404':
          description: NotFound
      deprecated: false
      description: ''
    patch:
      tags:
        - Administration
      summary: Activates or deactivate a user
      operationId: ToggleUserActivation_ToggleActivation
      security:
        - bearerHttpAuthentication: []
      parameters:
        - name: userName
          in: path
          description: User name
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ToggleActivationRequestModel'
          text/json:
            schema:
              $ref: '#/components/schemas/ToggleActivationRequestModel'
          application/xml:
            schema:
              $ref: '#/components/schemas/ToggleActivationRequestModel'
          text/xml:
            schema:
              $ref: '#/components/schemas/ToggleActivationRequestModel'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ToggleActivationRequestModel'
        description: >-
          The request represents that {userName} will be either activated or
          deactivated.
        required: true
      responses:
        '204':
          description: NoContent
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
            application/xml:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
            text/xml:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
        '404':
          description: NotFound
        '500':
          description: InternalServerError
      deprecated: false
  /api/v1/administration/application-version:
    get:
      tags:
        - Administration
      summary: Gets the current version of TcPCM. Available since version 2412
      description: 'Gets the current version of TcPCM'
      operationId: 'Administration_GetApplicationVersion'
      parameters: []
      responses:
        '200':
          description: 'Success. Returns the current running version of TcPCM'
          headers: {}
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      version:
                        type: string
                        description: TcPCM version
                    required:
                      - version
                description: |
                  data
                required:
                  - data
              example:
                data:
                  version: '2406.0001'
        '400':
          $ref: '#/components/responses/ErrorBadRequest'
        '401':
          $ref: '#/components/responses/ErrorUnauthorized'
        '406':
          $ref: '#/components/responses/ErrorNotAcceptable'
        '500':
          $ref: '#/components/responses/ErrorInternalServerError'
      security:
        - bearerHttpAuthentication: []
  /api/v1/Calculations/Export:
    post:
      tags:
        - 'Import/Export: Calculations'
      operationId: ExportCalculations_ExportCalculationsToResponseModel
      summary: Export calculations using export configurations
      security:
        - bearerHttpAuthentication: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportCalculationsRequestModel'
          text/json:
            schema:
              $ref: '#/components/schemas/ExportCalculationsRequestModel'
          application/xml:
            schema:
              $ref: '#/components/schemas/ExportCalculationsRequestModel'
          text/xml:
            schema:
              $ref: '#/components/schemas/ExportCalculationsRequestModel'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ExportCalculationsRequestModel'
        required: true
      responses:
        '200':
          description: >-
            Returns export data of given calculation IDs using given export
            configuration.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TcPCMWebApiResponseModel_of_DataTable'
            text/json:
              schema:
                $ref: '#/components/schemas/TcPCMWebApiResponseModel_of_DataTable'
            application/xml:
              schema:
                $ref: '#/components/schemas/TcPCMWebApiResponseModel_of_DataTable'
            text/xml:
              schema:
                $ref: '#/components/schemas/TcPCMWebApiResponseModel_of_DataTable'
        '401':
          description: Indicates that the requested resource requires authentication.
        '405':
          description: >-
            Indicates that the request method (POST or GET) is not allowed on
            the requested resource.
        '500':
          description: Indicates that a generic error has occurred on the server.
      deprecated: false
      description: 'Export calculations using export configurations'
  /api/v1/Calculations/Import:
    post:
      tags:
        - 'Import/Export: Calculations'
      operationId: ImportCalculations_ImportCalculationsFromRequestModel
      security:
        - bearerHttpAuthentication: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportCalculationsRequestModel'
          text/json:
            schema:
              $ref: '#/components/schemas/ImportCalculationsRequestModel'
          application/xml:
            schema:
              $ref: '#/components/schemas/ImportCalculationsRequestModel'
          text/xml:
            schema:
              $ref: '#/components/schemas/ImportCalculationsRequestModel'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ImportCalculationsRequestModel'
        required: true
      responses:
        '200':
          description: Successful import.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TcPCMWebApiResponseModel_of_DataTable'
            text/json:
              schema:
                $ref: '#/components/schemas/TcPCMWebApiResponseModel_of_DataTable'
            application/xml:
              schema:
                $ref: '#/components/schemas/TcPCMWebApiResponseModel_of_DataTable'
            text/xml:
              schema:
                $ref: '#/components/schemas/TcPCMWebApiResponseModel_of_DataTable'
        '401':
          description: Indicates that the requested resource requires authentication.
        '500':
          description: Indicates that a generic error has occurred on the server.
      deprecated: false
      description: >-
        Import calculations from the given data table using an import
        configuration with the given GUID. It is also possible to export the
        imported data directly (since version 2412).
      summary: >-
        Import calculations from the given data table using an import
        configuration
  /api/v1/ToolCalculations/CostBreakDown/Export:
    post:
      tags:
        - 'Import/Export: Calculations'
      operationId: ExportToolCalculationCbd_ExportCostBreakDown
      summary: Exports cost break downs of tool calculations
      security:
        - bearerHttpAuthentication: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportToolCalculationCdbRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/ExportToolCalculationCdbRequest'
          application/xml:
            schema:
              $ref: '#/components/schemas/ExportToolCalculationCdbRequest'
          text/xml:
            schema:
              $ref: '#/components/schemas/ExportToolCalculationCdbRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ExportToolCalculationCdbRequest'
        required: true
      responses:
        '200':
          description: >-
            Returns cost break down data of given tool calculation ID and export
            configuration unique key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TcPCMWebApiResponseModel_of_ExportToolCalculationCbdResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/TcPCMWebApiResponseModel_of_ExportToolCalculationCbdResponse'
            application/xml:
              schema:
                $ref: '#/components/schemas/TcPCMWebApiResponseModel_of_ExportToolCalculationCbdResponse'
            text/xml:
              schema:
                $ref: '#/components/schemas/TcPCMWebApiResponseModel_of_ExportToolCalculationCbdResponse'
        '401':
          description: Indicates that the requested resource requires authentication.
        '405':
          description: >-
            Indicates that the request method (POST or GET) is not allowed on
            the requested resource.
        '500':
          description: Indicates that a generic error has occurred on the server.
      deprecated: false
  /api/v1/profitability-calculation-report:
    get:
      summary: >-
        Returns the profitability calculation report. Available since version
        2406.0001
      security:
        - bearerHttpAuthentication: []
      responses:
        '200':
          $ref: '#/components/responses/ProfitabilityCalculationReportResponse'
        '400':
          $ref: '#/components/responses/ErrorBadRequest'
        '401':
          $ref: '#/components/responses/ErrorUnauthorized'
        '406':
          $ref: '#/components/responses/ErrorNotAcceptable'
        '408':
          $ref: '#/components/responses/ErrorRequestTimeout'
        '500':
          $ref: '#/components/responses/ErrorInternalServerError'
      operationId: get-ProfitabilityCalculation
      description: >-
        Returns the profitability calculation report. Available since version
        2406.0001.
      parameters:
        - $ref: '#/components/parameters/ProfitabilityCalculationIds'
        - $ref: '#/components/parameters/ProjectIds'
        - $ref: '#/components/parameters/ExportConfigurationGuid'
      tags:
        - 'Import/Export: Calculations'
  /api/v1/MasterData/Export:
    post:
      tags:
        - 'Import/Export: MasterData'
      operationId: ExportMasterData_ExportMasterDataToResponseModel
      summary: Exports master data using export configurations
      security:
        - bearerHttpAuthentication: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportMasterDataRequestModel'
          text/json:
            schema:
              $ref: '#/components/schemas/ExportMasterDataRequestModel'
          application/xml:
            schema:
              $ref: '#/components/schemas/ExportMasterDataRequestModel'
          text/xml:
            schema:
              $ref: '#/components/schemas/ExportMasterDataRequestModel'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ExportMasterDataRequestModel'
        required: true
      responses:
        '200':
          description: >-
            Returns export data of given master data IDs using given export
            configuration.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TcPCMWebApiResponseModel_of_DataTable'
            text/json:
              schema:
                $ref: '#/components/schemas/TcPCMWebApiResponseModel_of_DataTable'
            application/xml:
              schema:
                $ref: '#/components/schemas/TcPCMWebApiResponseModel_of_DataTable'
            text/xml:
              schema:
                $ref: '#/components/schemas/TcPCMWebApiResponseModel_of_DataTable'
        '401':
          description: Indicates that the requested resource requires authentication.
        '405':
          description: >-
            Indicates that the request method (POST or GET) is not allowed on
            the requested resource.
        '500':
          description: Indicates that a generic error has occurred on the server.
      deprecated: false
  /api/v1/MasterData/Import:
    post:
      tags:
        - 'Import/Export: MasterData'
      operationId: ImportMasterData_ImportMasterDataFromRequestModel
      summary: Import master data using import configurations
      security:
        - bearerHttpAuthentication: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportMasterDataRequestModel'
          text/json:
            schema:
              $ref: '#/components/schemas/ImportMasterDataRequestModel'
          application/xml:
            schema:
              $ref: '#/components/schemas/ImportMasterDataRequestModel'
          text/xml:
            schema:
              $ref: '#/components/schemas/ImportMasterDataRequestModel'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ImportMasterDataRequestModel'
        required: true
      responses:
        '200':
          description: Imports master data using a given import configuration.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TcPCMResponseModel'
            text/json:
              schema:
                $ref: '#/components/schemas/TcPCMResponseModel'
            application/xml:
              schema:
                $ref: '#/components/schemas/TcPCMResponseModel'
            text/xml:
              schema:
                $ref: '#/components/schemas/TcPCMResponseModel'
        '401':
          description: Indicates that the requested resource requires authentication.
        '500':
          description: Indicates that a generic error has occurred on the server.
      deprecated: false
  /api/v1/masterData/ping:
    get:
      tags:
        - Basic
      operationId: MasterData_Ping
      summary: Check if the service is running
      responses:
        '200':
          description: Ok.
        '500':
          description: Indicates that a generic error has occurred on the server.
      deprecated: false
  /api/v1/Account/Logout:
    get:
      tags:
        - 'Account'
      summary: Logout and invalidate tokens
      operationId: Account_Logout
      security:
        - bearerHttpAuthentication: []
      parameters:
        - name: refreshTokenId
          in: query
          description: Refresh Token Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successfully logged out.
        '401':
          description: Indicates that the requested resource requires authentication.
        '500':
          description: Indicates that a generic error has occurred on the server.
      deprecated: false
      description: >-
        Please note that the *refreshTokenId* needs to be transferred as a query
        parameter.
  /api/v1/Account/DeleteRefreshToken:
    get:
      tags:
        - 'Account'
      summary: Delete RefreshToken
      operationId: Account_DeleteRefreshToken
      parameters:
        - name: refreshTokenId
          in: query
          description: Refresh Token Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: RefreshToken successfully removed.
        '500':
          description: Indicates that a generic error has occurred on the server.
      deprecated: false
components:
  schemas:
    IdArray:
      title: IdArray
      type: array
      description: Array with object ids
      uniqueItems: true
      maxItems: 100000
      items:
        type: integer
        format: int32
        minimum: 0
        maximum: 2147483647
      example:
        - 1
        - 5
        - 11
        - 3
        - 2423
        - 3039
        - 4521
    Guid:
      title: GUID
      type: string
      format: uuid
      maxLength: 36
      description: Global unique identifier
      example: 497f6eca-6276-4993-bfeb-53cbbbba6f08
    DataType:
      type: string
      enum:
        - double
        - integer
        - date
        - string
        - object
        - reference
        - bool
        - url
      example: double
    Column:
      title: Column
      type: object
      required:
        - dataType
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 0
          description: Name of the data field
        displayName:
          type: string
          maxLength: 255
          minLength: 0
          description: Displayname of the column
        dataType:
          $ref: '#/components/schemas/DataType'
    DataSet:
      title: DataSet
      type: object
      description: >-
        Represents a two-dimensional data set with column descriptions including
        column data types.
      required:
        - data
        - columns
      properties:
        data:
          type: array
          description: >-
            Array of objects defining a two-dimensional array via the property
            names of the objects. See the 'columns' field for the display names
            and data types.
          maxItems: 100000
          items:
            type: object
        columns:
          type: array
          description: Columns of the dataset describing the names and the datatypes
          maxItems: 100000
          items:
            $ref: '#/components/schemas/Column'
    ErrorResponse:
      type: object
      properties:
        Errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
          readOnly: true
    Error:
      type: object
      properties:
        Detail:
          type: string
          readOnly: true
    ExportCalculationsRequestModel:
      type: object
      properties:
        ProjectIds:
          type: array
          items:
            format: int32
            type: integer
        CalculationIds:
          type: array
          items:
            format: int32
            type: integer
            example: 2056
        ConfigurationGuid:
          type: string
          example: b14473ea-a58c-4d73-afa8-ba7c65613a0e
    ExportMasterDataRequestModel:
      type: object
      properties:
        Ids:
          type: array
          items:
            format: int32
            type: integer
          example:
            - 52
            - 60
        ConfigurationGuid:
          type: string
          example: e1548f26-af8d-4173-9881-7ce1de530911
    ExportToolCalculationCdbRequest:
      required:
        - ToolCalculationId
        - CostBreakDownConfigurationUniqueKey
      type: object
      properties:
        ToolCalculationId:
          format: int32
          type: integer
          example: 1015
        CostBreakDownConfigurationUniqueKey:
          type: string
          example: Siemens.TCPCM.CostBreakdownForTools.StandardCBDforinjecttools.WebApi
    ExportToolCalculationCbdResponse:
      type: object
      properties:
        toolCalculationId:
          format: int32
          type: integer
          readOnly: true
        costBreakDownConfigurationUniqueKey:
          type: string
          readOnly: true
        toolProperties:
          type: array
          items:
            $ref: '#/components/schemas/ExportToolCalculationCbdToolProperty'
          readOnly: true
        materials:
          type: array
          items:
            $ref: '#/components/schemas/ExportToolCalculationCbdMaterial'
          readOnly: true
    ExportToolCalculationCbdToolProperty:
      type: object
      properties:
        name:
          type: string
          readOnly: true
        value:
          type: string
          readOnly: true
        unit:
          type: string
          readOnly: true
    ExportToolCalculationCbdMaterial:
      type: object
      properties:
        properties:
          type: array
          items:
            $ref: '#/components/schemas/ExportToolCalculationCbdMaterialProperty'
          readOnly: true
    ExportToolCalculationCbdMaterialProperty:
      type: object
      properties:
        name:
          type: string
          readOnly: true
        value:
          type: string
          readOnly: true
    UserResponseModel:
      type: object
      properties:
        type:
          type: string
          readOnly: true
        attributes:
          $ref: '#/components/schemas/UserResponseModelAttributes'
    UserResponseModelAttributes:
      type: object
      properties:
        userName:
          type: string
          readOnly: true
        emailAddress:
          type: string
          readOnly: true
        firstName:
          type: string
          readOnly: true
        lastName:
          type: string
          readOnly: true
        active:
          type: boolean
          readOnly: true
        roleAssignments:
          type: array
          items:
            $ref: '#/components/schemas/RoleAssignmentResponseModel'
          readOnly: true
    RoleAssignmentResponseModel:
      type: object
      properties:
        client:
          type: string
          readOnly: true
        role:
          type: string
          readOnly: true
    ToggleActivationRequestModel:
      required:
        - active
      type: object
      properties:
        active:
          type: boolean
          example: false
    ImportCalculationsRequestModel:
      type: object
      properties:
        Data:
          type: array
          items:
            type: object
          description: Dataset to be imported.
          example:
            - Assembly hierarchy level: 0
              Quantity: 4
              Quantity unit: Pcs
              Item number: PNR 24253
            - Assembly hierarchy level: 1
              Quantity: 7
              Quantity unit: Pcs
              Item number: PNR 53221
        PlantUniqueKey:
          type: string
          description: Plant key. Client of the given plant is used.
        ConfigurationGuid:
          type: string
          description: GUID of the import configuration.
          format: uuid
          example: 4c43cab9-d9fa-4154-9c41-968654ac05b2
        ExportConfigurationGuid:
          type: string
          description: >-
            GUID of the export configuration. If this is set then the imported
            data is returned using the given export configuration. Available
            with version 2412.
          format: uuid
          example: b14473ea-a58c-4d73-afa8-ba7c65613a0e
        TargetType:
          type: string
          example: folder
        TargetId:
          format: int32
          type: integer
          example: 534
      required:
        - Data
        - ConfigurationGuid
    TcPCMResponseModel:
      type: object
      properties:
        success:
          type: boolean
        code:
          type: string
        message:
          type: string
    ImportMasterDataRequestModel:
      type: object
      properties:
        Data:
          type: array
          items:
            type: object
          example:
            - Designation: Carbon
              Unique identifier: Custom.Unique.Carbon
              Type: Cost value
            - Designation: Reinvestment rate
              Unique identifier: Custom.Unique.Reinvestment
              Type: Unit
        PlantUniqueKey:
          type: string
          example: TcPCM-001
        ConfigurationGuid:
          type: string
          example: 9231ad11-744e-481a-b9ec-bce80979ccbd
    TcPCMWebApiResponseModel_of_DataTable:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
        success:
          type: boolean
        code:
          type: string
        message:
          type: string
    TcPCMWebApiResponseModel_of_ExportToolCalculationCbdResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/ExportToolCalculationCbdResponse'
        success:
          type: boolean
        code:
          type: string
        message:
          type: string
    Response_of_UserResponseModel:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/UserResponseModel'
    ProfitabilityCalculationReportError:
      title: ProfitabilityCalculationReportError
      type: object
      description: Partial error of a profitability calculation report request.
      required:
        - status
        - detail
      properties:
        status:
          type: integer
          format: int32
          minimum: 0
          description: Http status code
          readOnly: true
        detail:
          type: string
          description: Detail description of the error
        profitabilityCalculationId:
          type: integer
          format: int32
          minimum: 0
          description: Id of the requested profitability calculation
          readOnly: true
        projectId:
          type: integer
          format: int32
          minimum: 0
          description: Id of the requested project
          readOnly: true
  requestBodies: {}
  responses:
    ProfitabilityCalculationReportResponse:
      description: Response to a profitabiliy calculation report request.
      content:
        application/json:
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/components/schemas/DataSet'
              errors:
                type: array
                items:
                  $ref: '#/components/schemas/ProfitabilityCalculationReportError'
          examples:
            Example:
              value:
                data:
                  data:
                    - Name: Wheel
                      Price: 72
                    - Name: Seat
                      Price: 266
                  columns:
                    - name: Name
                      displayName: Part Name
                      dataType: string
                    - name: Price
                      displayName: Price in €
                      dataType: double
                errors:
                  - status: 404
                    detail: Profitability calculation not found
                    profitabilityCalculationId: 731
        application/xml:
          schema:
            type: object
            required:
              - data
            properties:
              data:
                $ref: '#/components/schemas/DataSet'
              errors:
                type: array
                items:
                  $ref: '#/components/schemas/ProfitabilityCalculationReportError'
    ErrorBadRequest:
      description: >-
        The request could not be processed by the server because the request is
        perceived as client error (such as, malformed request syntax, invalid
        request message framing, or deceptive request routing).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            Example:
              value:
                Detail: Invalid JSON format
        application/xml:
          schema:
            $ref: '#/components/schemas/Error'
    ErrorUnauthorized:
      description: >-
        The client is not providing valid authentication credentials for the
        target resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            Example:
              value:
                Detail: Invalid user or password
        application/xml:
          schema:
            $ref: '#/components/schemas/Error'
    ErrorForbidden:
      description: >-
        The client is not allowed to access the resource. The client SHOULD not
        repeat the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            Example:
              value:
                Detail: Not allowed to access calculation with id '271'
        application/xml:
          schema:
            $ref: '#/components/schemas/Error'
    ErrorNotFound:
      description: The resource is not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            Example:
              value:
                Detail: Resource with id '5' is not found
        application/xml:
          schema:
            $ref: '#/components/schemas/Error'
    ErrorNotAcceptable:
      description: >-
        The service is not able to respond using the request media-type or
        representation asked by the client in the Accept header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            Example:
              value:
                Detail: Media type not accepted
        application/xml:
          schema:
            $ref: '#/components/schemas/Error'
    ErrorRequestTimeout:
      description: >-
        The request timed out because a server did not respond within the
        expected waiting time
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            Example:
              value:
                Detail: Request timed out
        application/xml:
          schema:
            $ref: '#/components/schemas/Error'
    ErrorInternalServerError:
      description: >-
        An unexpected error occured and the server is not fulfilling the
        request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            Example:
              value:
                Detail: Internal error
        application/xml:
          schema:
            $ref: '#/components/schemas/Error'
  parameters:
    ProfitabilityCalculationIds:
      name: ProfitabilityCalculationIds
      in: query
      required: false
      schema:
        type: array
        items:
          type: integer
          format: int32
          minimum: 0
          maximum: 2147483647
      description: Ids of the profitability calculations to be exported.
      example:
        - 3
        - 17
        - 732
    ProjectIds:
      name: ProjectIds
      in: query
      required: false
      schema:
        type: array
        items:
          type: integer
          format: int32
          minimum: 0
          maximum: 2147483647
      description: All profitability calculations of these projects are exported.
      example:
        - 53
        - 88
    ExportConfigurationGuid:
      name: ExportConfigurationGuid
      in: query
      required: true
      schema:
        type: string
        format: uuid
        example: cbbb4ada-3550-4939-a138-4da02757d460
      description: GUID of the export configuration.
  securitySchemes:
    bearerHttpAuthentication:
      type: http
      scheme: bearer
      bearerFormat: JWT
