swagger: '2.0'
info:
  version: 2.0.0
  title: profiles
host: localhost
basePath: /rest/admin/v2/
tags:
  - name: profiles
paths:
  /profiles/swagger.json:
    get:
      tags:
        - profiles
      operationId: getSwaggerJson
      produces:
        - application/json
      parameters:
        - name: path
          in: path
          required: true
          type: string
      responses:
        default:
          description: successful operation
  /profiles:
    get:
      tags:
        - profiles
      description: Get a collection of profiles.
      operationId: getProfiles
      parameters:
        - name: id
          in: query
          description: The profile id
          required: false
          type: integer
          format: int32
        - name: storeId
          in: query
          description: The Store ID.
          required: false
          type: integer
          format: int32
        - name: deviceformatId
          in: query
          description: Indicates what default format to use for this profile element.
          required: false
          type: integer
          format: int32
        - name: usersview
          in: query
          description: Specifying whether USER view preferences are available and should be accessed for this profile.
          required: false
          type: string
        - name: lowPriority
          in: query
          description: The lowest priority for which this profile entry is valid (default is 0).
          required: false
          type: integer
          format: int32
        - name: highPriority
          in: query
          description: The highest priority for which this profile entry is valid (default is 0).
          required: false
          type: integer
          format: int32
        - name: archive
          in: query
          description: 'If set to 1, messages of this message type will be archived after being successfully sent.'
          required: false
          type: integer
          format: int32
        - name: transportId
          in: query
          description: The transport.
          required: false
          type: integer
          format: int32
        - name: msgTypeId
          in: query
          description: The message type
          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 profiles.
          schema:
            $ref: '#/definitions/ProfileCollection'
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    post:
      tags:
        - profiles
      description: Create a profile.
      operationId: createProfile
      parameters:
        - in: body
          name: Profile
          description: A profile.
          required: true
          schema:
            $ref: '#/definitions/Profile'
      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'
  '/profiles/{id}':
    get:
      tags:
        - profiles
      description: Get a profile.
      operationId: getProfileById
      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 profile.
          schema:
            $ref: '#/definitions/Profile'
        '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:
        - profiles
      description: Delete a profile.
      operationId: deleteProfileById
      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:
        - profiles
      description: Update a profile.
      operationId: updateProfileById
      parameters:
        - in: body
          name: Profile
          description: A profile.
          required: true
          schema:
            $ref: '#/definitions/Profile'
      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 profile id
        required: true
        type: integer
        format: int32
  '/profiles/{id}/transports':
    get:
      tags:
        - profiles
      description: Finds the transport in a profile.
      operationId: getTransportsOfProfile
      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 store transport.
          schema:
            $ref: '#/definitions/Transport'
        '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 profile id
        required: true
        type: integer
        format: int32
  '/profiles/{id}/message-types':
    get:
      tags:
        - profiles
      description: Finds the message type in a profile.
      operationId: getMessageTypesOfProfile
      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'
    parameters:
      - name: id
        in: path
        description: The profile id
        required: true
        type: integer
        format: int32
  '/profiles/{id}/interaction-specs':
    get:
      tags:
        - profiles
      description: Finds the interaction spec relationships of a profile.
      operationId: getInteractionSpecsOfProfile
      parameters:
        - 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'
    parameters:
      - name: id
        in: path
        description: The profile 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'
  Profile:
    type: object
    properties:
      id:
        type: integer
        format: int32
        description: The profile id
      storeId:
        type: integer
        format: int32
        description: The Store ID.
      deviceformatId:
        type: integer
        format: int32
        description: Indicates what default format to use for this profile element.
      usersview:
        type: string
        description: Specifying whether USER view preferences are available and should be accessed for this profile.
      lowPriority:
        type: integer
        format: int32
        description: The lowest priority for which this profile entry is valid (default is 0).
      highPriority:
        type: integer
        format: int32
        description: The highest priority for which this profile entry is valid (default is 0).
      archive:
        type: integer
        format: int32
        description: 'If set to 1, messages of this message type will be archived after being successfully sent.'
      transportId:
        type: integer
        format: int32
        description: The transport.
      msgTypeId:
        type: integer
        format: int32
        description: The message type
      links:
        type: object
        description: Links to related resources.
        properties:
          transports:
            type: object
            description: The transport.
            properties:
              href:
                type: string
                description: The URL of the link.
          message-types:
            type: object
            description: The message type.
            properties:
              href:
                type: string
                description: The URL of the link.
          interaction-specs:
            type: object
            description: The interaction spec relationships of a profile
            properties:
              href:
                type: string
                description: The URL of the link.
    description: A profile.
  ProfileCollection:
    type: object
    properties:
      count:
        type: integer
        format: int64
        description: The total number of items.
      items:
        type: array
        description: The items.
        items:
          $ref: '#/definitions/Profile'
    description: A collection of profiles.
  Transport:
    type: object
    properties:
      id:
        type: integer
        format: int32
        description: The transport ID.
      code:
        type: string
        description: The code of the transport.
      name:
        type: string
        description: The name of the transport.
      description:
        type: string
        description: The description.
      timeout:
        type: integer
        format: int32
        description: The timeout.
      implemented:
        type: string
        description: If it is implemented.
      addressable:
        type: string
        description: If it is addressable.
    description: An store transport.
  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
  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.
