swagger: '2.0'
info:
  description: Configuration for Application Category resource.
  version: 'v2'
  title: app_category
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: app_category
    description: Application Category
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 app_category
   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/app_category:
    get:
      tags:
        - app_category
      summary: GET all app_category
      operationId: getall_app_category
      description: Use this operation to get app_category
      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 app_category 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 app_category 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 app_category resources.
          enum:
            - yes
      responses:
        200:
          description:  for app_category
          schema: 
              $ref: '#/definitions/getapp_categorysResponse'
        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'

    post:
      tags:
        - app_category
      summary: POST operation for app_category
      operationId: post_app_category
      description: POST operation for app_category
      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: onerror
          description: Use this parameter to set the onerror status for nitro request. Applicable only for bulk requests.
          required: false
          type: string
          default: CONTINUE
          enum:
            - EXIT
            - CONTINUE
        - in: body
          name: app_category
          description: app_category object
          schema:
              $ref: '#/definitions/addapp_categoryRequest'
      responses:
        200:
          description: add for app_category
          schema: 
              $ref: '#/definitions/addapp_categoryResponse'
        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/app_category/{id}:
    get:
      tags:
        - app_category
      summary: GET by key for app_category
      operationId: getbykey_app_category
      description: Use this operation to get app_category
      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: add for app_category
          schema: 
              $ref: '#/definitions/getapp_categoryResponse'
        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'

    put:
      tags:
        - app_category
      summary: PUT for app_category
      operationId: putbykey_app_category
      description: Use this operation to modify app_category
      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
        - in: body
          name: app_category
          description: app_category object
          schema:
              $ref: '#/definitions/modifyapp_categoryRequest'
      responses:
        200:
          description: add for app_category
          schema: 
              $ref: '#/definitions/modifyapp_categoryResponse'
        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:
        - app_category
      summary: Delete for app_category
      operationId: deletebykey_app_category
      description: Use this operation to delete app_category(s)
      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: add for app_category
        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:
  addapp_categoryRequest:
    type: object
    required:
      - app_category
    properties:
      app_category:
        $ref: '#/definitions/app_category_readwrite'
    title: addapp_categoryRequest
    example:
      app_category:
        tenant_id: "zom5yia0qrwg"
        is_default: "True"
        name: "test_category"

  addapp_categoryResponse:
    type: object
    required:
      - app_category
    properties:
      app_category:
        $ref: '#/definitions/app_category'
    title: addapp_categoryResponse
    example:
      app_category:
        tenant_id: "zom5yia0qrwg"
        is_default: "True"
        name: "test_category"
        id: "00000000-0000-375c-0000-000400000004"

  getapp_categoryResponse:
    type: object
    required:
      - app_category
    properties:
      app_category:
        $ref: '#/definitions/app_category'
    title: getapp_categoryResponse
    example:
      app_category:
        tenant_id: "zom5yia0qrwg"
        is_default: "True"
        name: "test_category"
        id: "00000000-0000-375c-0000-000400000004"

  getapp_categorysResponse:
    type: object
    required:
      - app_category
    properties:
      app_category:
        type: array
        items:
          $ref: '#/definitions/app_category'
    title: getapp_categorysResponse
    example:
      app_category:
        tenant_id: "zom5yia0qrwg"
        is_default: "True"
        name: "test_category"
        id: "00000000-0000-375c-0000-000400000004"

  modifyapp_categoryRequest:
    type: object
    required:
      - app_category
    properties:
      app_category:
        $ref: '#/definitions/app_category_readwrite'
    title: modifyapp_categoryRequest
    example:
      app_category:
        tenant_id: "zom5yia0qrwg"
        is_default: "True"
        name: "test_category"

  modifyapp_categoryResponse:
    type: object
    required:
      - app_category
    properties:
      app_category:
        $ref: '#/definitions/app_category'
    title: modifyapp_categoryResponse
    example:
      app_category:
        tenant_id: "zom5yia0qrwg"
        is_default: "True"
        name: "test_category"
        id: "00000000-0000-375c-0000-000400000004"

  app_category_readwrite:
    type: object
    properties:
      tenant_id:
        description: "Tenant Id of app_category"
        type: string
        format: string
        minLength: 1
        maxLength: 128
      is_default:
        description: "True, if this profile is system generated and can not be deleted"
        type: boolean
        format: boolean
      name:
        description: "Application Category"
        type: string
        format: string
        minLength: 1
        maxLength: 128

  app_category:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key for all the app_category
            type: string
            format: uuid
      - $ref: '#/definitions/app_category_readwrite'

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