swagger: '2.0'
info:
  version: 2.0.0
  title: message-types
host: localhost
basePath: /rest/admin/v2/
tags:
  - name: message-types
paths:
  /message-types/swagger.json:
    get:
      tags:
        - message-types
      operationId: getSwaggerJson
      produces:
        - application/json
      parameters:
        - name: path
          in: path
          required: true
          type: string
      responses:
        default:
          description: successful operation
  /message-types:
    get:
      tags:
        - message-types
      description: Get a collection of message types.
      operationId: getMessageTypes
      parameters:
        - name: id
          in: query
          description: The message type id.
          required: false
          type: integer
          format: int32
        - name: direction
          in: query
          description: 'The direction of transmission this message is valid for, 1=outgoing, 2=incoming, or 3=send-receive.'
          required: false
          type: integer
          format: int32
        - name: name
          in: query
          description: Short name for message type.
          required: false
          type: string
        - name: viewName
          in: query
          description: Name of view associated with this message type. This view must be registered to be usable in message transmission. This is a mandatory field.
          required: false
          type: string
        - name: description
          in: query
          description: Description of the message type.
          required: false
          type: string
        - 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 message types.
          schema:
            $ref: '#/definitions/MessageTypeCollection'
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    post:
      tags:
        - message-types
      description: Create a message type.
      operationId: createMessageType
      parameters:
        - in: body
          name: MessageType
          description: A message type
          required: true
          schema:
            $ref: '#/definitions/MessageType'
      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'
  '/message-types/{id}':
    get:
      tags:
        - message-types
      description: Get a message type.
      operationId: getMessageTypeById
      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: A message type
          schema:
            $ref: '#/definitions/MessageType'
        '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:
        - message-types
      description: Delete a message type.
      operationId: deleteMessageTypeById
      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:
        - message-types
      description: Update a message type.
      operationId: updateMessageTypeById
      parameters:
        - in: body
          name: MessageType
          description: A message type
          required: true
          schema:
            $ref: '#/definitions/MessageType'
      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 message type 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'
  MessageType:
    type: object
    properties:
      id:
        type: integer
        format: int32
        description: The message type id.
      direction:
        type: integer
        format: int32
        description: 'The direction of transmission this message is valid for, 1=outgoing, 2=incoming, or 3=send-receive.'
      name:
        type: string
        description: Short name for message type.
      viewName:
        type: string
        description: Name of view associated with this message type. This view must be registered to be usable in message transmission. This is a mandatory field.
      description:
        type: string
        description: Description of the message type.
    description: A message type
  MessageTypeCollection:
    type: object
    properties:
      count:
        type: integer
        format: int64
        description: The total number of items.
      items:
        type: array
        description: The items.
        items:
          $ref: '#/definitions/MessageType'
    description: A collection of message types.
