swagger: '2.0'
info:
  description: Configuration for Sent sms record item keeping. resource.
  version: 'v2'
  title: sent_sms
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: sent_sms
    description: Sent sms record item keeping.
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  UserSecurity:
    type: basic
security:
  - UserSecurity: []
parameters:
  idParam:
   name: id
   in: path
   type: string
   description: Id is system generated key for all the sent sms record.
   required: true
  authParam:
      in: header
      name: Authorization
      type: string
      required: true
      description: Session Id for authentication.Should be mentioned in the format CwsAuth bearer=sessionIdValue
  cloudParam:
      in: header
      name: isCloud
      type: string
      required: true
      description: set the value to true in case of Cloud services, false for on-prem deployment
paths:
  /massvc/{customerid}/nitro/v2/config/sent_sms:
    get:
      tags:
        - sent_sms
      summary: GET all sent_sms
      operationId: getall_sent_sms
      description: Use this operation to get sent sms details.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - in: path
          name: customerid
          type: string
          required: true
          description: Customer Id of the user
        - in: header
          name: Authorization
          type: string
          required: true
          description: Session Id for authentication.Should be mentioned in the format CwsAuth bearer=sessionIdValue
        - in: header
          name: isCloud
          type: string
          required: true
          description: set the value to true in case of Cloud services, false for on-prem deployment
        - in: query
          name: filter
          type: string
          required: false
          description: "Use this query-parameter to get the filtered set of vm_device resources configured on the system. You can set a filter on any property of the resource.Example:  property-name1:property-value1 "
        - in: query
          name: pagesize
          type: integer
          required: false
          description: Use this query-parameter to get the sent_sms resources in chunks.To be used along with pageno query parameter.
        - in: query
          name: pageno
          type: integer
          required: false
          description: Use this query-parameter to get the sent_sms resources in chunks.To be used along with pagesize query parameter.
        - in: query
          name: count
          type: string
          required: false
          description: Use this query-parameter to get the count of sent_sms resources.
          enum:
            - yes
      responses:
        200:
          description:  for sent_sms
          schema: 
              $ref: '#/definitions/getsent_smssResponse'
        400:
          description: Bad input parameter
          schema: 
              $ref: '#/definitions/Error'
        401:
          description: Failed Authentication
          schema: 
              $ref: '#/definitions/Error'
        403:
          description: Unauthorized
          schema: 
              $ref: '#/definitions/Error'
        404:
          description: Item not found
          schema: 
              $ref: '#/definitions/Error'
        409:
          description: Resource Conflict
          schema: 
              $ref: '#/definitions/Error'
        500:
          description: Server Error
          schema: 
              $ref: '#/definitions/Error'
        504:
          description: Gateway Timeout
          schema: 
              $ref: '#/definitions/Error'

  /massvc/{customerid}/nitro/v2/config/sent_sms/{id}:
    get:
      tags:
        - sent_sms
      summary: GET by key for sent_sms
      operationId: getbykey_sent_sms
      description: Use this operation to get sent sms details.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/idParam'
        - in: path
          name: customerid
          type: string
          required: true
          description: Customer Id of the user
        - in: header
          name: Authorization
          type: string
          required: true
          description: Session Id for authentication.Should be mentioned in the format CwsAuth bearer=sessionIdValue
        - in: header
          name: isCloud
          type: string
          required: true
          description: set the value to true in case of Cloud services, false for on-prem deployment
      responses:
        200:
          description:  for sent_sms
          schema: 
              $ref: '#/definitions/getsent_smsResponse'
        400:
          description: Bad input parameter
          schema: 
              $ref: '#/definitions/Error'
        401:
          description: Failed Authentication
          schema: 
              $ref: '#/definitions/Error'
        403:
          description: Unauthorized
          schema: 
              $ref: '#/definitions/Error'
        404:
          description: Item not found
          schema: 
              $ref: '#/definitions/Error'
        409:
          description: Resource Conflict
          schema: 
              $ref: '#/definitions/Error'
        500:
          description: Server Error
          schema: 
              $ref: '#/definitions/Error'
        504:
          description: Gateway Timeout
          schema: 
              $ref: '#/definitions/Error'

    delete:
      tags:
        - sent_sms
      summary: Delete for sent_sms
      operationId: deletebykey_sent_sms
      description: Use this operation to delete sent sms details.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/idParam'
        - in: path
          name: customerid
          type: string
          required: true
          description: Customer Id of the user
        - in: header
          name: Authorization
          type: string
          required: true
          description: Session Id for authentication.Should be mentioned in the format CwsAuth bearer=sessionIdValue
        - in: header
          name: isCloud
          type: string
          required: true
          description: set the value to true in case of Cloud services, false for on-prem deployment
      responses:
        204:
          description:  for sent_sms
        400:
          description: Bad input parameter
          schema: 
              $ref: '#/definitions/Error'
        401:
          description: Failed Authentication
          schema: 
              $ref: '#/definitions/Error'
        403:
          description: Unauthorized
          schema: 
              $ref: '#/definitions/Error'
        404:
          description: Item not found
          schema: 
              $ref: '#/definitions/Error'
        409:
          description: Resource Conflict
          schema: 
              $ref: '#/definitions/Error'
        500:
          description: Server Error
          schema: 
              $ref: '#/definitions/Error'
        504:
          description: Gateway Timeout
          schema: 
              $ref: '#/definitions/Error'

definitions:
  getsent_smsResponse:
    type: object
    required:
      - sent_sms
    properties:
      sent_sms:
        $ref: '#/definitions/sent_sms'
    title: getsent_smsResponse
    example:
      sent_sms:
        to_list: "1111111111,1111111112"
        failed_message: "string_value"
        is_sent: "boolean_value"
        message: "Disk Usage Normal: nan%"
        username: "test"
        timestamp: "1580971329"
        url: "string_value"
        id: "689b7cfc-7bda-41e5-9c2e-9c51b3611d8a"
        is_ssl: "true"
        server_name: "test_sms"
        profile_name: "sms_test"

  getsent_smssResponse:
    type: object
    required:
      - sent_sms
    properties:
      sent_sms:
        type: array
        items:
          $ref: '#/definitions/sent_sms'
    title: getsent_smssResponse
    example:
      sent_sms:
        to_list: "1111111111,1111111112"
        failed_message: "string_value"
        is_sent: "boolean_value"
        message: "Disk Usage Normal: nan%"
        username: "test"
        timestamp: "1580971329"
        url: "string_value"
        id: "689b7cfc-7bda-41e5-9c2e-9c51b3611d8a"
        is_ssl: "true"
        server_name: "test_sms"
        profile_name: "sms_test"

  sent_sms_readwrite:
    type: object
    properties:
      to_list:
        description: "List of to whom send the sms. "
        type: string
        format: string
      failed_message:
        description: "Subject of the sms sent."
        type: string
        format: string
        minLength: 1
        maxLength: 2000
      is_sent:
        description: "Is this sms sent successfully."
        type: boolean
        format: boolean
      message:
        description: "Content of the sms sent."
        type: string
        format: string
        minLength: 1
        maxLength: 20000
      username:
        description: "Username for the sms server"
        type: string
        format: string
        maxLength: 128
      url:
        description: "URL used for sending the sms. "
        type: string
        format: string
      is_ssl:
        description: "Is this sms sent as SSL."
        type: boolean
        format: boolean
      server_name:
        description: "SMS server name"
        type: string
        format: string
        minLength: 1
        maxLength: 128
      profile_name:
        description: "Profile name through which sms sent."
        type: string
        format: string
        minLength: 1
        maxLength: 128

  sent_sms:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key for all the sent sms record.
            type: string
            format: string
          timestamp:
             description: "Time when the sms was sent"
             type: number
             format: int64
      - $ref: '#/definitions/sent_sms_readwrite'

  Error:
    properties:
      errorcode:
        type: number
        format: int32
        example: 1001
      errormessage:
        type: string
        format: string
        example: "id cannot be found"
