swagger: '2.0'
info:
  version: 2.0.0
  title: interaction-specs
host: localhost
basePath: /rest/admin/v2/
tags:
  - name: interaction-specs
paths:
  /interaction-specs:
    get:
      tags:
        - interaction-specs
      description: Get a collection of interaction specs.
      operationId: getInteractionSpecs
      parameters:
        - name: id
          in: query
          description: The interaction spec ID.
          required: false
          type: integer
          format: int32
        - name: name
          in: query
          description: Name of the attribute for this transport (as specified in the Configuration Manager).
          required: false
          type: string
        - name: value
          in: query
          description: 'The value corresponding to the attribute name. This value may be encrypted if encrypt="Yes" is specified in the InteractionSpec definition in the instance configuration file. If the value is encrypted, DBUpdate.txt and AfterMerchantKeyChangeDBUpdater class also need to specify this attribute name.'
          required: false
          type: string
        - name: customizable
          in: query
          description: Reserved for IBM internal use.
          required: false
          type: integer
          format: int32
        - name: profileId
          in: query
          description: The belonged profile id for this interaction spec
          required: false
          type: integer
          format: int32
        - name: offset
          in: query
          description: The index of the first item to be returned.
          required: false
          type: integer
          format: int32
        - name: limit
          in: query
          description: The maximum number of items to be returned.
          required: false
          type: integer
          format: int32
        - name: fields
          in: query
          description: The fields to be returned.
          required: false
          type: string
        - name: expand
          in: query
          description: The related resources to be embedded.
          required: false
          type: string
      responses:
        '200':
          description: A collection of interaction spec.
          schema:
            $ref: '#/definitions/InteractionSpecCollection'
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    post:
      tags:
        - interaction-specs
      description: Create an interaction spec.
      operationId: createInteractionSpec
      parameters:
        - in: body
          name: InteractionSpec
          description: An interaction spec
          required: true
          schema:
            $ref: '#/definitions/InteractionSpec'
      responses:
        '201':
          description: The operation was successful.
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
  /interaction-specs/swagger.json:
    get:
      tags:
        - interaction-specs
      operationId: getSwaggerJson
      produces:
        - application/json
      parameters:
        - name: path
          in: path
          required: true
          type: string
      responses:
        default:
          description: successful operation
  '/interaction-specs/{id}':
    get:
      tags:
        - interaction-specs
      description: Get an interaction spec.
      operationId: getInteractionSpecById
      parameters:
        - name: fields
          in: query
          description: The fields to be returned.
          required: false
          type: string
        - name: expand
          in: query
          description: The related resources to be embedded.
          required: false
          type: string
      responses:
        '200':
          description: An interaction spec
          schema:
            $ref: '#/definitions/InteractionSpec'
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '404':
          description: The resource was not found.
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    delete:
      tags:
        - interaction-specs
      description: Delete an interaction spec.
      operationId: deleteInteractionSpecById
      parameters: []
      responses:
        '204':
          description: The operation was successful.
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '404':
          description: The resource was not found.
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    patch:
      tags:
        - interaction-specs
      description: Update an interaction spec.
      operationId: updateInteractionSpecById
      parameters:
        - in: body
          name: InteractionSpec
          description: An interaction spec
          required: true
          schema:
            $ref: '#/definitions/InteractionSpec'
      responses:
        '200':
          description: The operation was successful.
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '404':
          description: The resource was not found.
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    parameters:
      - name: id
        in: path
        description: The interaction spec ID.
        required: true
        type: integer
        format: int32
definitions:
  Link:
    type: object
    properties:
      href:
        type: string
        format: uri
  Error:
    type: object
    properties:
      code:
        type: string
      message:
        type: string
      messageKey:
        type: string
      messageArguments:
        type: array
        items:
          type: object
      correlationId:
        type: string
      locale:
        type: string
  ErrorResponseContainer:
    type: object
    properties:
      requestId:
        type: string
      errors:
        type: array
        items:
          $ref: '#/definitions/Error'
  InteractionSpec:
    type: object
    properties:
      id:
        type: integer
        format: int32
        description: The interaction spec ID.
      name:
        type: string
        description: Name of the attribute for this transport (as specified in the Configuration Manager).
      value:
        type: string
        description: 'The value corresponding to the attribute name. This value may be encrypted if encrypt="Yes" is specified in the InteractionSpec definition in the instance configuration file. If the value is encrypted, DBUpdate.txt and AfterMerchantKeyChangeDBUpdater class also need to specify this attribute name.'
      customizable:
        type: integer
        format: int32
        description: Reserved for IBM internal use.
      profileId:
        type: integer
        format: int32
        description: The belonged profile id for this interaction spec
    description: An interaction spec
  InteractionSpecCollection:
    type: object
    properties:
      count:
        type: integer
        format: int64
        description: The total number of items.
      items:
        type: array
        description: The items.
        items:
          $ref: '#/definitions/InteractionSpec'
    description: A collection of interaction spec.
