swagger: '2.0'
info:
  title: Folder Admin REST APIs
  version: '2.0'
paths:
  /folders:
    post:
      consumes:
        - application/json
      parameters:
        - description: Store ID
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: The request body
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/Folder'
          x-entity-path: 'dataArea/folder[1]'
      responses:
        '201':
          description: The operation was successful
          headers:
            Location:
              description: The URI of the folder
              type: string
          x-entity-path: 'dataArea/folder[1]/folderIdentifier/uniqueID'
      summary: Create a new folder
      x-action-code: Create
      x-action-verb: process
      x-expression-template: '/Folder[1]'
      x-facade-client-class: com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient
      x-facade-client-method: processFolder
      x-request-bod-class: com.ibm.commerce.infrastructure.facade.datatypes.ProcessFolderType
  /folders/by-item-type-and-reference-id:
    get:
      produces:
        - application/json
      parameters:
        - description: Store ID
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: Folder item type to get folder
          in: query
          name: folderItemType
          required: true
          type: string
        - description: reference ID
          format: int32
          in: query
          name: referenceId
          required: true
          type: integer
        - description: Offset
          format: int32
          in: query
          name: offset
          required: false
          type: integer
          x-entity-path: dataArea/get/recordSetStartNumber
        - description: Limit
          format: int32
          in: query
          name: limit
          required: false
          type: integer
          x-entity-path: dataArea/get/maxItems
      responses:
        '200':
          description: The operation was successful
          schema:
            $ref: '#/definitions/FolderCollection'
          x-entity-path: dataArea/folder
      summary: Get folders by folder item type and reference ID
      x-expression-template: >-
        {_wcf.ap='{accessProfile}'}/Folder[FolderItem[FolderItemType='{folderItemType}'
        and ReferenceID='{referenceId}']]
      x-facade-client-class: com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient
      x-facade-client-method: getFolder
      x-parameters:
        accessProfile: IBM_Admin_Details
      x-request-bod-class: com.ibm.commerce.infrastructure.facade.datatypes.GetFolderType
  /folders/by-type:
    get:
      produces:
        - application/json
      parameters:
        - description: Folder type to get folders from
          in: query
          name: folderType
          required: true
          type: string
        - description: Store ID
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: Offset
          format: int32
          in: query
          name: offset
          required: false
          type: integer
          x-entity-path: dataArea/get/recordSetStartNumber
        - description: Limit
          format: int32
          in: query
          name: limit
          required: false
          type: integer
          x-entity-path: dataArea/get/maxItems
      responses:
        '200':
          description: The operation was successful
          schema:
            $ref: '#/definitions/FolderCollection'
          x-entity-path: dataArea/folder
      summary: Get folders by folder type
      x-expression-template: '{_wcf.ap=''{accessProfile}''}/Folder[(FolderUsage=''{folderType}'')]'
      x-facade-client-class: com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient
      x-facade-client-method: getFolder
      x-parameters:
        accessProfile: IBM_Admin_Details
      x-request-bod-class: com.ibm.commerce.infrastructure.facade.datatypes.GetFolderType
  '/folders/{folderId}/child-folders':
    get:
      produces:
        - application/json
      parameters:
        - description: Parent folder ID
          format: int64
          in: path
          name: folderId
          required: true
          type: integer
        - description: Store ID
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: Offset
          format: int32
          in: query
          name: offset
          required: false
          type: integer
          x-entity-path: dataArea/get/recordSetStartNumber
        - description: Limit
          format: int32
          in: query
          name: limit
          required: false
          type: integer
          x-entity-path: dataArea/get/maxItems
      responses:
        '200':
          description: The operation was successful
          schema:
            $ref: '#/definitions/FolderCollection'
          x-entity-path: dataArea/folder
      summary: Get the child folders of a parent folder
      x-expression-template: >-
        {_wcf.ap='{accessProfile}'}/Folder[ParentFolderIdentifier[(UniqueID='{folderId}')]]
      x-facade-client-class: com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient
      x-facade-client-method: getFolder
      x-parameters:
        accessProfile: IBM_Admin_Details
      x-request-bod-class: com.ibm.commerce.infrastructure.facade.datatypes.GetFolderType
  '/folders/{folderId}/items':
    get:
      produces:
        - application/json
      parameters:
        - description: Folder ID
          format: int64
          in: path
          name: folderId
          required: true
          type: integer
        - description: Store ID
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: Offset
          format: int32
          in: query
          name: offset
          required: false
          type: integer
          x-entity-path: dataArea/get/recordSetStartNumber
        - description: Limit
          format: int32
          in: query
          name: limit
          required: false
          type: integer
          x-entity-path: dataArea/get/maxItems
      responses:
        '200':
          description: The operation was successful
          schema:
            $ref: '#/definitions/FolderItemCollection'
          x-entity-path: dataArea/folder/folderItem
      summary: Get the items under a folder
      x-expression-template: >-
        {_wcf.ap={accessProfile}}/Folder[FolderIdentifier[(UniqueID={folderId})]]/FolderItem
      x-facade-client-class: com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient
      x-facade-client-method: getFolder
      x-parameters:
        accessProfile: IBM_Admin_ChildFolderItems
      x-request-bod-class: com.ibm.commerce.infrastructure.facade.datatypes.GetFolderType
    post:
      consumes:
        - application/json
      parameters:
        - description: The folder ID
          format: int64
          in: path
          name: folderId
          required: true
          type: integer
          x-entity-path: dataArea/folder/folderIdentifier/uniqueID
        - description: The store ID
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
          x-entity-path: >-
            dataArea/folder[1]/folderItem[1]/folderItemIdentifier/storeIdentifier/uniqueID
        - description: The request body
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/FolderItem'
          x-entity-path: 'dataArea/folder[1]/folderItem[1]'
      responses:
        '200':
          description: The operation is successful.
      summary: Add an item to a folder
      x-action-code: Add
      x-expression-template: '/Folder[1]/FolderItem[1]'
      x-facade-client-class: com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient
      x-facade-client-method: changeFolder
      x-request-bod-class: com.ibm.commerce.infrastructure.facade.datatypes.ChangeFolderType
      x-request-verb: change
  '/folders/{folderId}/items/{referenceId}':
    delete:
      parameters:
        - description: The folder ID
          format: int64
          in: path
          name: folderId
          required: true
          type: integer
          x-entity-path: 'dataArea/folder[1]/folderIdentifier/uniqueID'
        - description: The store ID
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: reference ID
          format: int32
          in: path
          name: referenceId
          required: true
          type: integer
          x-entity-path: 'dataArea/folder[1]/folderItem[1]/referenceID'
        - description: The folder type
          in: query
          name: folderType
          required: true
          type: string
          x-entity-path: 'dataArea/folder[1]/folderItem[1]/folderItemType'
      responses:
        '204':
          description: The operation was successful
      summary: Delete a particular item by reference ID in a folder
      x-action-code: Delete
      x-expression-template: '/Folder[1]/FolderItem[1]'
      x-facade-client-class: com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient
      x-facade-client-method: changeFolder
      x-request-bod-class: com.ibm.commerce.infrastructure.facade.datatypes.ChangeFolderType
      x-request-verb: change
  '/folders/{id}':
    delete:
      parameters:
        - description: The folder ID
          format: int64
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/folder[1]/folderIdentifier/uniqueID'
        - description: The store ID
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-content-data: storeId
      responses:
        '204':
          description: The operation was successful
      summary: Delete a particular folder by ID
      x-action-code: Delete
      x-action-verb: process
      x-expression-template: '/Folder[1]'
      x-facade-client-class: com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient
      x-facade-client-method: processFolder
      x-request-bod-class: com.ibm.commerce.infrastructure.facade.datatypes.ProcessFolderType
    get:
      produces:
        - application/json
      parameters:
        - description: The requested folder ID
          format: int64
          in: path
          name: id
          required: true
          type: integer
        - description: The store ID
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
      responses:
        '200':
          description: The operation was successful
          schema:
            $ref: '#/definitions/FolderCollection'
          x-entity-path: 'dataArea/folder[1]'
      summary: Get a folder by ID
      x-expression-template: '{_wcf.ap=''{accessProfile}''}/Folder[FolderIdentifier[(UniqueID=''{id}'')]]'
      x-facade-client-class: com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient
      x-facade-client-method: getFolder
      x-parameters:
        accessProfile: IBM_Admin_Details
      x-request-bod-class: com.ibm.commerce.infrastructure.facade.datatypes.GetFolderType
    patch:
      consumes:
        - application/json
      parameters:
        - description: The folder ID
          format: int64
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: dataArea/folder/folderIdentifier/uniqueID
        - description: The store ID
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: The request body
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/Folder'
          x-entity-path: 'dataArea/folder[1]'
      responses:
        '200':
          description: The operation was successful
      summary: Updates a particular folder by ID
      x-action-code: Change
      x-action-verb: change
      x-expression-template: '/Folder[1]'
      x-facade-client-class: com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient
      x-facade-client-method: changeFolder
      x-request-bod-class: com.ibm.commerce.infrastructure.facade.datatypes.ChangeFolderType
definitions:
  Folder:
    description: A folder
    properties:
      description:
        description: The folder description
        type: string
        x-entity-path: description
      folderItems:
        description: The folder items under a folder
        items:
          $ref: '#/definitions/FolderItem'
        type: array
        x-entity-path: folderItem
      id:
        description: The folder identifier ID
        format: int32
        readOnly: true
        type: integer
        x-entity-path: folderIdentifier/uniqueID
      identifier:
        description: The folder identifier's identifier
        type: string
        x-entity-path: folderIdentifier/identifier
      parentFolderId:
        description: The folder's parent folder's ID
        format: int32
        type: integer
        x-entity-path: folderIdentifier/parentFolderIdentifier/uniqueID
      path:
        description: The folder path
        readOnly: true
        type: string
        x-entity-path: path
      storeId:
        description: The folder's associated store ID
        format: int64
        type: integer
        x-entity-path: folderIdentifier/storeIdentifier/uniqueID
      storeName:
        description: The folder's associated store name
        readOnly: true
        type: string
        x-entity-path: folderIdentifier/storeIdentifier/externalIdentifier/nameIdentifier
      usage:
        description: The folder usage
        type: string
        x-entity-path: folderUsage
    type: object
    x-entity-class: com.ibm.commerce.infrastructure.facade.datatypes.FolderType
  FolderCollection:
    description: A collection of folders
    properties:
      count:
        format: int64
        readOnly: true
        type: integer
      items:
        items:
          $ref: '#/definitions/Folder'
        type: array
    type: object
  FolderItem:
    description: A folder item
    properties:
      id:
        description: The folder item identifier
        format: int32
        type: integer
        x-entity-path: folderItemIdentifier/uniqueID
      referenceId:
        description: The folder item reference ID
        format: int32
        type: integer
        x-entity-path: referenceID
      storeId:
        description: The folder item store ID
        format: int64
        type: integer
        x-entity-path: folderItemIdentifier/storeIdentifier/uniqueID
      type:
        description: The folder item type
        type: string
        x-entity-path: folderItemType
    type: object
    x-entity-class: com.ibm.commerce.infrastructure.facade.datatypes.FolderItemType
  FolderItemCollection:
    description: A collection of folder items
    properties:
      count:
        format: int64
        readOnly: true
        type: integer
      items:
        items:
          $ref: '#/definitions/FolderItem'
        type: array
    type: object
x-components: {}
