swagger: '2.0'
info:
  title: Content Admin REST APIs
  version: '2.0'
paths:
  /workspaces:
    get:
      produces:
        - application/json
      parameters:
        - description: >-
            The position within the resulting dataset where the query begins
            returning item records. If the offset is "5", the records that
            returned begin with the sixth record that matches the query
            parameters. If the offset is "0", the records that are returned
            begin with the first record that matches the query parameters.
          format: int32
          in: query
          name: offset
          required: false
          type: integer
          x-entity-path: dataArea/get/recordSetStartNumber
        - description: The maximum number of records to return.
          format: int32
          in: query
          name: limit
          required: false
          type: integer
          x-entity-path: dataArea/get/maxItems
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/WorkspaceCollection'
          x-entity-path: dataArea/workspace
      summary: Get the workspaces.
      x-expression-template: '{_wcf.ap=''{accessProfile}''}/Workspace'
      x-facade-client-class: com.ibm.commerce.content.facade.client.ContentFacadeClient
      x-facade-client-method: getWorkspace
      x-parameters:
        accessProfile: IBM_Admin_All
      x-request-bod-class: com.ibm.commerce.content.facade.datatypes.GetWorkspaceType
    post:
      consumes:
        - application/json
      parameters:
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/Workspace'
          x-entity-path: 'dataArea/workspace[1]'
      responses:
        '201':
          description: The operation is successful.
          headers:
            Location:
              description: The URI of the workspace.
              type: string
          x-entity-path: 'dataArea/workspace[1]/workspaceIdentifier/uniqueID'
      summary: Create a workspace.
      x-action-code: Create
      x-expression-template: '/Workspace[1]'
      x-facade-client-class: com.ibm.commerce.content.facade.client.ContentFacadeClient
      x-facade-client-method: processWorkspace
      x-request-bod-class: com.ibm.commerce.content.facade.datatypes.ProcessWorkspaceType
  '/workspaces/{id}':
    delete:
      parameters:
        - description: The workspace ID.
          format: int64
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/workspace[1]/workspaceIdentifier/uniqueID'
      responses:
        '204':
          description: The operation is successful.
      summary: >-
        Delete a workspace. The task group must be in either the "0: Inactive",
        "6: Cancelled", "5: Complete" or "13: Publish Failed" state before it
        can be deleted.
      x-action-code: Delete
      x-expression-template: '/Workspace[1]'
      x-facade-client-class: com.ibm.commerce.content.facade.client.ContentFacadeClient
      x-facade-client-method: processWorkspace
      x-request-bod-class: com.ibm.commerce.content.facade.datatypes.ProcessWorkspaceType
    get:
      produces:
        - application/json
      parameters:
        - description: The workspace ID.
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/Workspace'
          x-entity-path: 'dataArea/workspace[1]'
      summary: Get a workspace.
      x-expression-template: >-
        {_wcf.ap='{accessProfile}'}/Workspace[WorkspaceIdentifier[(UniqueID='{id}')]]
      x-facade-client-class: com.ibm.commerce.content.facade.client.ContentFacadeClient
      x-facade-client-method: getWorkspace
      x-parameters:
        accessProfile: IBM_Admin_All
      x-request-bod-class: com.ibm.commerce.content.facade.datatypes.GetWorkspaceType
    patch:
      consumes:
        - application/json
      parameters:
        - description: The workspace ID.
          format: int64
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/workspace[1]/workspaceIdentifier/uniqueID'
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/Workspace'
          x-entity-path: 'dataArea/workspace[1]'
      responses:
        '200':
          description: The operation is successful.
      summary: Update a workspace.
      x-action-code: Change
      x-expression-template: '/Workspace[1]'
      x-facade-client-class: com.ibm.commerce.content.facade.client.ContentFacadeClient
      x-facade-client-method: changeWorkspace
      x-request-bod-class: com.ibm.commerce.content.facade.datatypes.ChangeWorkspaceType
  '/workspaces/{id}/cancel':
    post:
      parameters:
        - description: The workspace ID.
          format: int64
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/workspace[1]/workspaceIdentifier/uniqueID'
      responses:
        '200':
          description: The operation is successful.
      summary: >-
        Cancel a workspace. The task group must be in " 0: Inactive" state
        before it can be cancelled.
      x-action-code: Cancel
      x-expression-template: '/Workspace[1]'
      x-facade-client-class: com.ibm.commerce.content.facade.client.ContentFacadeClient
      x-facade-client-method: processWorkspace
      x-request-bod-class: com.ibm.commerce.content.facade.datatypes.ProcessWorkspaceType
definitions:
  Workspace:
    description: A workspace.
    properties:
      description:
        description: The workspace description.
        type: string
      emergencyUse:
        description: The workspace is emergency use or not.
        type: boolean
      id:
        description: The workspace ID.
        format: int64
        readOnly: true
        type: integer
        x-entity-path: workspaceIdentifier/uniqueID
      identifier:
        description: The workspace identifier.
        readOnly: true
        type: string
        x-entity-path: workspaceIdentifier/identifier
      name:
        description: The workspace name.
        type: string
      persistent:
        description: Thw workspace is persistent or not.
        type: boolean
      status:
        description: >-
          The workspace status, value: active, complete, cancelled, cancel in
          progress.
        readOnly: true
        type: string
    type: object
    x-entity-class: com.ibm.commerce.content.facade.datatypes.WorkspaceType
  WorkspaceCollection:
    description: A collection of workspaces.
    properties:
      count:
        format: int32
        type: integer
      items:
        items:
          $ref: '#/definitions/Workspace'
        type: array
      limit:
        description: The maximum number of records to return.
        format: int32
        type: integer
      offset:
        description: >-
          The position within the resulting dataset where the query begins
          returning item records. If the offset is "5", the records that
          returned begin with the sixth record that matches the query
          parameters. If the offset is "0", the records that are returned begin
          with the first record that matches the query parameters.
        format: int32
        type: integer
    type: object
x-components: {}
