swagger: '2.0'
info:
  description: Configuration for Notification Digest Settings resource.
  version: 'v2'
  title: notification_digest_settings
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: notification_digest_settings
    description: Notification Digest Settings
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 for each setting
   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/notification_digest_settings:
    get:
      tags:
        - notification_digest_settings
      summary: GET all notification_digest_settings
      operationId: getall_notification_digest_settings
      description: Use this operation to get notification digest settings
      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 notification_digest_settings 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 notification_digest_settings 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 notification_digest_settings resources.
          enum:
            - yes
      responses:
        200:
          description:  for notification_digest_settings
          schema: 
              $ref: '#/definitions/getnotification_digest_settingssResponse'
        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/notification_digest_settings/{id}:
    get:
      tags:
        - notification_digest_settings
      summary: GET by key for notification_digest_settings
      operationId: getbykey_notification_digest_settings
      description: Use this operation to get notification digest settings
      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 notification_digest_settings
          schema: 
              $ref: '#/definitions/getnotification_digest_settingsResponse'
        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:
        - notification_digest_settings
      summary: PUT for notification_digest_settings
      operationId: putbykey_notification_digest_settings
      description: Use this operation to modify notification digest settings
      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: notification_digest_settings
          description: notification_digest_settings object
          schema:
              $ref: '#/definitions/modifynotification_digest_settingsRequest'
      responses:
        200:
          description:  for notification_digest_settings
          schema: 
              $ref: '#/definitions/modifynotification_digest_settingsResponse'
        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:
  getnotification_digest_settingsResponse:
    type: object
    required:
      - notification_digest_settings
    properties:
      notification_digest_settings:
        $ref: '#/definitions/notification_digest_settings'
    title: getnotification_digest_settingsResponse
    example:
      notification_digest_settings:
        WeeklyFeaturesList: "string_value"
        scheduleTimesEpoch: "string_value"
        slack_profile: "string_value"
        tz_offset: "0"
        scheduleOptions: "string_value"
        ImmediateFeaturesList: "string_value"
        MonthlyFeaturesList: "string_value"
        tenant_id: "7ed7946f-4af7-11e9-99d2-b6fe81a85d18"
        nextScheduleTimeEpoch: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        DailyFeaturesList: "string_value"
        notification_period: "string_value"
        mail_profile: "string_value"

  getnotification_digest_settingssResponse:
    type: object
    required:
      - notification_digest_settings
    properties:
      notification_digest_settings:
        type: array
        items:
          $ref: '#/definitions/notification_digest_settings'
    title: getnotification_digest_settingssResponse
    example:
      notification_digest_settings:
        WeeklyFeaturesList: "string_value"
        scheduleTimesEpoch: "string_value"
        slack_profile: "string_value"
        tz_offset: "0"
        scheduleOptions: "string_value"
        ImmediateFeaturesList: "string_value"
        MonthlyFeaturesList: "string_value"
        tenant_id: "7ed7946f-4af7-11e9-99d2-b6fe81a85d18"
        nextScheduleTimeEpoch: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        DailyFeaturesList: "string_value"
        notification_period: "string_value"
        mail_profile: "string_value"

  modifynotification_digest_settingsRequest:
    type: object
    required:
      - notification_digest_settings
    properties:
      notification_digest_settings:
        $ref: '#/definitions/notification_digest_settings_readwrite'
    title: modifynotification_digest_settingsRequest
    example:
      notification_digest_settings:
        WeeklyFeaturesList: "string_value"
        scheduleTimesEpoch: "string_value"
        slack_profile: "string_value"
        tz_offset: "0"
        scheduleOptions: "string_value"
        ImmediateFeaturesList: "string_value"
        MonthlyFeaturesList: "string_value"
        nextScheduleTimeEpoch: "string_value"
        DailyFeaturesList: "string_value"
        notification_period: "string_value"
        mail_profile: "string_value"

  modifynotification_digest_settingsResponse:
    type: object
    required:
      - notification_digest_settings
    properties:
      notification_digest_settings:
        $ref: '#/definitions/notification_digest_settings'
    title: modifynotification_digest_settingsResponse
    example:
      notification_digest_settings:
        WeeklyFeaturesList: "string_value"
        scheduleTimesEpoch: "string_value"
        slack_profile: "string_value"
        tz_offset: "0"
        scheduleOptions: "string_value"
        ImmediateFeaturesList: "string_value"
        MonthlyFeaturesList: "string_value"
        tenant_id: "7ed7946f-4af7-11e9-99d2-b6fe81a85d18"
        nextScheduleTimeEpoch: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        DailyFeaturesList: "string_value"
        notification_period: "string_value"
        mail_profile: "string_value"

  notification_digest_settings_readwrite:
    type: object
    properties:
      WeeklyFeaturesList:
        description: "List of events for which notification is to be generated weekly."
        type: string
        format: string
      scheduleTimesEpoch:
        description: "Schedule time epoch (string representation of 11 digit numbers)."
        type: string
        format: string
      slack_profile:
        description: "Slack Profile"
        type: string
        format: string
      tz_offset:
        description: "Time zone offset."
        type: integer
        format: int32
      scheduleOptions:
        description: "Comma separated Options for scheduling Configuration Template"
        type: string
        format: string
      ImmediateFeaturesList:
        description: "List of events for which notification is to be generated immediately."
        type: string
        format: string
      MonthlyFeaturesList:
        description: "List of events for which notification is to be generated monthly."
        type: string
        format: string
      nextScheduleTimeEpoch:
        description: "Schedule time epoch at which job is scheduled to be run next."
        type: string
        format: string
      DailyFeaturesList:
        description: "List of events for which notification is to be generated daily."
        type: string
        format: string
      notification_period:
        description: "notification_period"
        type: string
        format: string
      mail_profile:
        description: "Mail Profile"
        type: string
        format: string

  notification_digest_settings:
    allOf:
      -
        properties:
          id:
            description: Id is system generated for each setting
            type: string
            format: string
          tenant_id:
             description: "Tenant Id of the Notification Jobs"
             type: string
             format: string
      - $ref: '#/definitions/notification_digest_settings_readwrite'

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