openapi: 3.0.0
servers:
    - description: Controller URL
      url: https://localhost:8080/controller/alerting/rest/v1/applications/{application-id}/
info:
    description: |
        Action suppression apis.
        [Details at Appdynamics documentation](https://docs.appdynamics.com/display/PRO45/AppDynamics+APIs)
    version: "1.0.0"
    title: Appdynamics Action Suppression Operations
    termsOfService: 'https://www.appdynamics.com/terms/'
    license:
        name: Apache 2.0
        url: 'http://www.apache.org/licenses/LICENSE-2.0.html'

tags:
    - name: action-suppressions
      description: Manage action suppressions in an application.
      externalDocs:
          description: Find out more
          url: 'https://www.appdynamics.com'

paths:
    '/action-suppressions':
        parameters:
            - $ref: '#/components/parameters/applicationId'
        post:
            description: |
                Create a new action suppression from the provided JSON payload.
            tags:
                - action-suppressions
            summary: "Create a new action suppression from the provided JSON payload."
            operationId: createActionSuppression
            responses:
                '201':
                    description: Created successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/ActionSuppression'
                    links:
                        CreatedUserid:
                            operationId: getActionSuppression
                            parameters:
                                action-suppression-id: '$response.body#/id'
                            description:
                                Use the `id` value returned in the response as `action-suppression-id` parameter in `GET /action-suppressions/{action-suppression-id}`.
                '400':
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '409':
                    $ref: '#/components/responses/Conflict'
            requestBody:
                $ref: '#/components/requestBodies/ActionSuppression'
        get:
            tags:
                - action-suppressions
            summary: Returns all the action suppression summaries for the given application ID.
            description: |
                Returns all the action suppressions that are configured for a given application. Only action suppression IDs and names are returned. To obtain complete details of an action suppression, see `GET /action-suppression/{action-suppression-id}`.
            operationId: getActionSuppressionSummaries
            responses:
                '200':
                    description: Fetched successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/ActionSuppressionSummaryArray'
                '400':
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404':
                    $ref: '#/components/responses/NotFound'


    '/action-suppressions/{action-suppression-id}':
        parameters:
            - $ref: '#/components/parameters/applicationId'
            - $ref: '#/components/parameters/actionSuppressionId'
        get:
            tags:
                - action-suppressions
            summary: "Returns JSON representation of action suppression for the given action suppression ID."
            description: |
                Returns JSON representation of action suppression for the given action suppression ID. Enter a valid existing action suppression ID.
            operationId: getActionSuppression
            responses:
                '200':
                    description: Fetched successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/ActionSuppression'
                '400':
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404':
                    $ref: '#/components/responses/NotFound'
        put:
            tags:
                - action-suppressions
            summary: "Update an existing action suppression with the given ID."
            description: |
                Update an existing action suppression with json payload.
            operationId: updateActionSuppression
            responses:
                '200':
                    description: Updated successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/ActionSuppression'
                '400':
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404':
                    $ref: '#/components/responses/NotFound'
            requestBody:
                $ref: '#/components/requestBodies/ActionSuppression'
        delete:
            tags:
                - action-suppressions
            summary: "Delete an existing action suppression with the given ID."
            description: Enter a valid existing action suppression ID.
            operationId: deleteActionSuppression
            responses:
                '204':
                    description: Deleted successfully
                '400':
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404':
                    $ref: '#/components/responses/NotFound'

    '/action-suppressions/action-suppression-by-name':
        parameters:
            - $ref: '#/components/parameters/applicationId'
            - name: name
              in: query
              description: The action suppression name.
              required: true
              schema:
                  type: string
                  minLength: 1
        get:
            tags:
                - action-suppressions
            summary: Returns action suppression by name for given application id
            operationId: getActionSuppressionByName
            responses:
                '200':
                    description: Fetched successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/ActionSuppression'
                '400':
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404':
                    $ref: '#/components/responses/NotFound'


components:
    schemas:
        ActionSuppression:
            description: 'Action Suppression definition'
            type: object
            properties:
                id:
                    description: The id of the action suppression object. User does not need to provide the id while creating an action suppression.
                    type: integer
                    format: int64
                    minimum: 1
                    readOnly: true
                name:
                    description: The name of action suppression.
                    type: string
                    minLength: 1
                    maxLength: 100
                    example: "My Action Suppression"
                disableAgentReporting:
                    description: If enabled, the agents defined in the scope will not report any metric data during the time window.
                    type: boolean
                    default: false
                    example: false
                suppressionScheduleType:
                    $ref: '#/components/schemas/ActionSuppressionScheduleType'
                timezone:
                    $ref: '#/components/schemas/Timezone'
                startTime:
                    description: The time from which action suppression should kick in. Should be given only in case of suppressionScheduleType being ONE_TIME.
                        If the suppressionScheduleType is ONE_TIME and startTime is not specified, action suppression will start from current time.
                        The expected format is yyyy-MM-ddTHH:mm:ss corresponding to rfc3339. Refer https://tools.ietf.org/html/rfc3339
                    type: string
                    example: 2020-04-22T14:05:02
                endTime:
                    description: The time at which ongoing action suppression should end. Should be given only in case of suppressionScheduleType being ONE_TIME.
                        If the suppressionScheduleType is ONE_TIME and endTime is not specified, action suppression will end at 60 minutes from current time.
                        The expected format is yyyy-MM-ddTHH:mm:ss corresponding to rfc3339. Refer https://tools.ietf.org/html/rfc3339
                    type: string
                    example: 2020-04-22T13:05:02
                recurringSchedule:
                    $ref: '#/components/schemas/RecurringScheduleConfiguration'
                affects:
                    $ref: '#/components/schemas/AffectedInfo'
                healthRuleScope:
                    $ref: '#/components/schemas/HealthRuleScope'
            required:
                - name
                - affects

        ActionSuppressionScheduleType:
            description: Representing the available scheduling options for action suppression, default ONE_TIME.
            type: string
            enum:
                - ONE_TIME
                - RECURRING
            default: ONE_TIME

        RecurringScheduleConfiguration:
            type: object
            properties:
                scheduleFrequency:
                    $ref: '#/components/schemas/ScheduleFrequency'
            required:
                - scheduleFrequency
            discriminator:
                propertyName: scheduleFrequency
                mapping:
                    DAILY: '#/components/schemas/DailySchedule'
                    WEEKLY: '#/components/schemas/WeeklySchedule'
                    MONTHLY_SPECIFIC_DATE: '#/components/schemas/MonthlySpecificDateSchedule'
                    MONTHLY_SPECIFIC_DAY: '#/components/schemas/MonthlySpecificDaySchedule'

        DailySchedule:
            description: "scheduleFrequency: DAILY"
            allOf:
                -   $ref: '#/components/schemas/RecurringScheduleConfiguration'
                -   type: object
                    properties:
                        startTime:
                            $ref: '#/components/schemas/Time'
                        endTime:
                            $ref: '#/components/schemas/Time'
                    required:
                        - startTime
                        - endTime

        WeeklySchedule:
            description: "scheduleFrequency: WEEKLY"
            allOf:
                -   $ref: '#/components/schemas/RecurringScheduleConfiguration'
                -   type: object
                    properties:
                        days:
                            type: array
                            items:
                                $ref: '#/components/schemas/DayOfWeek'
                            minItems: 1
                            maxItems: 7
                        startTime:
                            $ref: '#/components/schemas/Time'
                        endTime:
                            $ref: '#/components/schemas/Time'
                    required:
                        - days
                        - startTime
                        - endTime

        MonthlySpecificDateSchedule:
            description: "scheduleFrequency: MONTHLY_SPECIFIC_DATE"
            allOf:
                -   $ref: '#/components/schemas/RecurringScheduleConfiguration'
                -   type: object
                    properties:
                        startDate:
                            description: The start date of the month.
                            type: string
                            pattern: '^(0[1-9]|[12][0-9]|3[01])$|^Last Day$'
                            example: "01"
                        startTime:
                            $ref: '#/components/schemas/Time'
                        endDate:
                            description: The end date of the month.
                            type: string
                            pattern: '^(0[1-9]|[12][0-9]|3[01])$|^Last Day$'
                            example: "Last Day"
                        endTime:
                            $ref: '#/components/schemas/Time'
                    required:
                        - startTime
                        - endTime
                        - startDate
                        - endDate

        MonthlySpecificDaySchedule:
            description: "scheduleFrequency: MONTHLY_SPECIFIC_DAY"
            allOf:
                -   $ref: '#/components/schemas/RecurringScheduleConfiguration'
                -   type: object
                    properties:
                        startTime:
                            $ref: '#/components/schemas/Time'
                        endTime:
                            $ref: '#/components/schemas/Time'
                        day:
                            $ref: '#/components/schemas/DayOfWeek'
                        occurrence:
                            $ref: '#/components/schemas/Occurrence'
                    required:
                        - startTime
                        - endTime
                        - day
                        - occurrence

        ScheduleFrequency:
            type: string
            enum:
                - DAILY
                - WEEKLY
                - MONTHLY_SPECIFIC_DATE
                - MONTHLY_SPECIFIC_DAY
            example: DAILY

        Occurrence:
            type: string
            enum:
                - FIRST
                - SECOND
                - THIRD
                - FOURTH
                - LAST
            example: FIRST

        DayOfWeek:
            type: string
            enum:
                - SUNDAY
                - MONDAY
                - TUESDAY
                - WEDNESDAY
                - THURSDAY
                - FRIDAY
                - SATURDAY
            example: SUNDAY

        Time:
            description: The time in 24 hour format.
            type: string
            pattern: '^([01]\d|2[0-3]):([0-5]\d)$'
            example: "14:00"

        Timezone:
            description: Timezone Id. The default time zone will be the controller timezone.
            type: string
            example: "America/Los_Angeles"



        AffectedInfoType:
            description: Type corresponding to the affected entity information
            type: string
            enum:
                - APPLICATION
                - BUSINESS_TRANSACTIONS
                - TIERS_NODES
                - SERVERS
                - DATABASES
                - SERVERS_IN_SERVERS_APP

        AffectedInfo:
            description: Describes the affected information for a single affected type
            type: object
            properties:
                affectedInfoType:
                    $ref: '#/components/schemas/AffectedInfoType'
            required:
                - affectedInfoType
            discriminator:
                propertyName: affectedInfoType
                mapping:
                    APPLICATION: '#/components/schemas/ApplicationAffectedInfo'
                    BUSINESS_TRANSACTIONS: '#/components/schemas/BusinessTransactionAffectedInfo'
                    TIERS_NODES: '#/components/schemas/TierNodeAffectedInfo'
                    SERVERS: '#/components/schemas/ServerAffectedInfo'
                    DATABASES: '#/components/schemas/DatabaseAffectedInfo'
                    SERVERS_IN_SERVERS_APP: '#/components/schemas/ServerInServerAppAffectedInfo'

        ApplicationAffectedInfo:
            description: Describes the affected information for AffectedInfoType APPLICATIONS
            allOf:
                - $ref: '#/components/schemas/AffectedInfo'
                - type: object

        BusinessTransactionAffectedInfo:
            description: Describes the affected information for AffectedInfoType BUSINESS_TRANSACTIONS
            allOf:
                - $ref: '#/components/schemas/AffectedInfo'
                - type: object
                  properties:
                      affectedBusinessTransactions:
                          $ref: '#/components/schemas/AffectedBusinessTransactions'
                  required:
                      - affectedBusinessTransactions

        AffectedBusinessTransactions:
            type: object
            properties:
                businessTransactionScope:
                    type: string
                    enum:
                        - ALL_BUSINESS_TRANSACTIONS
                        - SPECIFIC_BUSINESS_TRANSACTIONS
                        - BUSINESS_TRANSACTIONS_IN_SPECIFIC_TIERS
                        - BUSINESS_TRANSACTIONS_MATCHING_PATTERN
            required:
                - businessTransactionScope
            discriminator:
                propertyName: businessTransactionScope
                mapping:
                    ALL_BUSINESS_TRANSACTIONS: '#/components/schemas/AllBusinessTransactions'
                    SPECIFIC_BUSINESS_TRANSACTIONS: '#/components/schemas/SpecificBusinessTransactions'
                    BUSINESS_TRANSACTIONS_IN_SPECIFIC_TIERS: '#/components/schemas/BusinessTransactionsInSpecificTiers'
                    BUSINESS_TRANSACTIONS_MATCHING_PATTERN: '#/components/schemas/BusinessTransactionsMatchingPattern'

        AllBusinessTransactions:
            description: "businessTransactionScope: ALL_BUSINESS_TRANSACTIONS"
            allOf:
                - $ref: '#/components/schemas/AffectedBusinessTransactions'
                - type: object

        SpecificBusinessTransactions:
            description: "businessTransactionScope: SPECIFIC_BUSINESS_TRANSACTIONS"
            allOf:
                - $ref: '#/components/schemas/AffectedBusinessTransactions'
                - type: object
                  properties:
                      businessTransactions:
                          type: array
                          items:
                              type: string
                              example: "CheckOutBT"
                          minItems: 1
                          example: ["LoginBT", "reportsBT"]
                  required:
                      - businessTransactions

        BusinessTransactionsInSpecificTiers:
            description: "businessTransactionScope: BUSINESS_TRANSACTIONS_IN_SPECIFIC_TIERS"
            allOf:
                - $ref: '#/components/schemas/AffectedBusinessTransactions'
                - type: object
                  properties:
                      specificTiers:
                          type: array
                          items:
                              type: string
                          minItems: 1
                  required:
                      - specificTiers

        BusinessTransactionsMatchingPattern:
            description: "businessTransactionScope: BUSINESS_TRANSACTIONS_MATCHING_PATTERN"
            allOf:
                - $ref: '#/components/schemas/AffectedBusinessTransactions'
                - type: object
                  properties:
                      patternMatcher:
                          $ref: '#/components/schemas/EntityMatchingPattern'
                  required:
                      - patternMatcher

        TierNodeAffectedInfo:
            description: "affectedInfoType: TIERS_NODES"
            allOf:
                - $ref: '#/components/schemas/AffectedInfo'
                - type: object
                  properties:
                      affectedEntities:
                          $ref: '#/components/schemas/TierNodeEntities'
                  required:
                      - affectedEntities

        TierNodeEntities:
            type: object
            properties:
                tierNodeType:
                    type: string
                    enum:
                        - TIER
                        - NODE
            required:
                - tierNodeType
            discriminator:
                propertyName: tierNodeType
                mapping:
                    TIER: '#/components/schemas/TierEntities'
                    NODE: '#/components/schemas/NodeEntities'

        TierEntities:
            description: "tierNodeType: TIER"
            allOf:
                - $ref: '#/components/schemas/TierNodeEntities'
                - type: object
                  properties:
                      affectedTiers:
                          $ref: '#/components/schemas/AffectedTiers'
                  required:
                      - affectedTiers

        NodeEntities:
            description: "tierNodeType: NODE"
            allOf:
                - $ref: '#/components/schemas/TierNodeEntities'
                - type: object
                  properties:
                      nodeType:
                          type: string
                          enum:
                              - "ALL_NODES"
                              - "JAVA_NODES"
                              - "DOT_NET_NODES"
                              - "PHP_NODES"
                          example: ["JAVA_NODES"]
                      affectedNodes:
                          $ref: '#/components/schemas/AffectedNodes'
                  required:
                      - nodeType
                      - affectedNodes

        AffectedTiers:
            type: object
            properties:
                affectedTierScope:
                    type: string
                    enum:
                        - ALL_TIERS
                        - SPECIFIC_TIERS
                    example: ALL_TIERS
            required:
                - affectedTierScope
            discriminator:
                propertyName: affectedTierScope
                mapping:
                    ALL_TIERS: '#/components/schemas/AllTiers'
                    SPECIFIC_TIERS: '#/components/schemas/SpecificTiers'

        AllTiers:
            description: "affectedTierScope: ALL_TIERS"
            allOf:
                - $ref: '#/components/schemas/AffectedTiers'
                - type: object

        SpecificTiers:
            description: "affectedTierScope: SPECIFIC_TIERS"
            allOf:
                - $ref: '#/components/schemas/AffectedTiers'
                - type: object
                  properties:
                      tiers:
                          type: array
                          items:
                              type: string
                              example: "AuthTier"
                          minItems: 1
                          example: ["AuthTier", "AggregatorTier"]
                  required:
                      - tiers

        AffectedNodes:
            type: object
            properties:
                affectedNodeScope:
                    type: string
                    enum:
                        - ALL_NODES
                        - SPECIFIC_NODES
                        - NODES_OF_SPECIFIC_TIERS
                        - NODES_MATCHING_PATTERN
                        - NODE_PROPERTY_VARIABLE_MATCHER
            required:
                - affectedNodeScope
            discriminator:
                propertyName: affectedNodeScope
                mapping:
                    ALL_NODES: '#/components/schemas/AllNodes'
                    SPECIFIC_NODES: '#/components/schemas/SpecificNodes'
                    NODES_OF_SPECIFIC_TIERS: '#/components/schemas/NodesOfSpecificTiers'
                    NODES_MATCHING_PATTERN: '#/components/schemas/NodesMatchingPattern'
                    NODE_PROPERTY_VARIABLE_MATCHER: '#/components/schemas/NodePropertyVariableMatcher'

        AllNodes:
            description: "affectedNodeScope: ALL_NODES"
            allOf:
                - $ref: '#/components/schemas/AffectedNodes'
                - type: object

        SpecificNodes:
            description: "affectedNodeScope: SPECIFIC_NODES"
            allOf:
                - $ref: '#/components/schemas/AffectedNodes'
                - type: object
                  properties:
                      nodes:
                          type: array
                          items:
                              type: string
                              example: "node1"
                          minItems: 1
                          example: ["node1", "node2"]
                  required:
                      - nodes

        NodesOfSpecificTiers:
            description: "affectedNodeScope: NODES_OF_SPECIFIC_TIERS"
            allOf:
                - $ref: '#/components/schemas/AffectedNodes'
                - type: object
                  properties:
                      specificTiers:
                          type: array
                          items:
                              type: string
                          minItems: 1
                  required:
                      - specificTiers

        NodesMatchingPattern:
            description: "affectedNodeScope: NODES_MATCHING_PATTERN"
            allOf:
                - $ref: '#/components/schemas/AffectedNodes'
                - type: object
                  properties:
                      patternMatcher:
                          $ref: '#/components/schemas/EntityMatchingPattern'
                  required:
                      - patternMatcher

        NodePropertyVariableMatcher:
            description: "affectedNodeScope: NODE_PROPERTY_VARIABLE_MATCHER"
            allOf:
                - $ref: '#/components/schemas/AffectedNodes'
                - type: object
                  properties:
                      propVarPairs:
                          type: array
                          items:
                              type: object
                              properties:
                                  propertyType:
                                      type: string
                                      enum:
                                          - "META"
                                          - "ENV"
                                          - "JVM"
                                      example: "JVM"
                                  name:
                                      type: string
                                      minLength: 1
                                      example: "XmX"
                                  value:
                                      type: string
                                      minLength: 1
                                      example: "5g"
                              required:
                                  - propertyType
                                  - name
                                  - value
                          minItems: 1
                  required:
                      - propVarPairs

        ServerAffectedInfo:
            description: "affectedInfoType: SERVERS"
            allOf:
                -   $ref: '#/components/schemas/AffectedInfo'
                -   type: object
                    properties:
                        affectedServers:
                            $ref: '#/components/schemas/ApplicationAffectedServers'
                    required:
                        - affectedServers
        ApplicationAffectedServers:
            type: object
            properties:
                serversScope:
                    type: string
                    enum:
                        - SPECIFIC_SERVERS_IN_APPLICATION
            required:
                - serversScope
            discriminator:
                propertyName: serversScope
                mapping:
                    SPECIFIC_SERVERS_IN_APPLICATION: '#/components/schemas/SpecificServersInApplication'

        SpecificServersInApplication:
            description: "serversScope: SPECIFIC_SERVERS_IN_APPLICATION"
            allOf:
                -   $ref: '#/components/schemas/ApplicationAffectedServers'
                -   type: object
                    properties:
                        specificServers:
                            type: array
                            items:
                                type: string
                                minLength: 1
                            minItems: 1
                    required:
                        - specificServers
        ServerInServerAppAffectedInfo:
            description: "affectedInfoType: SERVERS_IN_SERVERS_APP"
            allOf:
                -   $ref: '#/components/schemas/AffectedInfo'
                -   type: object
                    properties:
                        serversAffectedEntities:
                            $ref: '#/components/schemas/ServersAffectedEntities'
                    required:
                        - serversAffectedEntities
        ServersAffectedEntities:
            type: object
            properties:
                selectServersBy:
                    type: string
                    enum:
                        - AFFECTED_SERVER_SUBGROUPS
                        - AFFECTED_SERVERS
            required:
                - selectServersBy
            discriminator:
                propertyName: selectServersBy
                mapping:
                    AFFECTED_SERVER_SUBGROUPS: '#/components/schemas/AffectedServerSubGroups'
                    AFFECTED_SERVERS: '#/components/schemas/AffectedServers'
        AffectedServers:
            description: "selectServersBy: AFFECTED_SERVERS"
            allOf:
                -   $ref: '#/components/schemas/ServersAffectedEntities'
                -   type: object
                    properties:
                        affectedServers:
                            $ref: '#/components/schemas/ServerSelectionCriteria'
                    required:
                        - affectedServers
        ServerSelectionCriteria:
            type: object
            properties:
                severSelectionScope:
                    type: string
                    enum:
                        - ALL_SERVERS_IN_ACCOUNT
                        - SERVERS_WITHIN_SUBGROUP
                        - SPECIFIC_SERVERS
                        - SERVERS_MATCHING_PATTERN
            required:
                - severSelectionScope
            discriminator:
                propertyName: severSelectionScope
                mapping:
                    ALL_SERVERS_IN_ACCOUNT: '#/components/schemas/AllServersInAccount'
                    SERVERS_WITHIN_SUBGROUP: '#/components/schemas/ServersWithinSubGroup'
                    SPECIFIC_SERVERS: '#/components/schemas/SpecificServers'
                    SERVERS_MATCHING_PATTERN: '#/components/schemas/ServersMatchingPattern'
        AllServersInAccount:
            description: "severSelectionScope: ALL_SERVERS_IN_ACCOUNT"
            allOf:
                -   $ref: '#/components/schemas/ServerSelectionCriteria'
                -   type: object
        ServersWithinSubGroup:
            description: "severSelectionScope: SERVERS_WITHIN_SUBGROUP"
            allOf:
                -   $ref: '#/components/schemas/ServerSelectionCriteria'
                -   type: object
                    properties:
                        subGroups:
                            type: array
                            items:
                                type: string
                            minItems: 1
                    required:
                        - subGroups
        SpecificServers:
            description: "severSelectionScope: SPECIFIC_SERVERS"
            allOf:
                -   $ref: '#/components/schemas/ServerSelectionCriteria'
                -   type: object
                    properties:
                        servers:
                            type: array
                            items:
                                type: string
                                example: 23, 40
                            minItems: 1
                            example: [ 23, 40 ]
                    required:
                        - servers
        ServersMatchingPattern:
            description: "severSelectionScope: SERVERS_MATCHING_PATTERN"
            allOf:
                -   $ref: '#/components/schemas/ServerSelectionCriteria'
                -   type: object
                    properties:
                        patternMatcher:
                            $ref: '#/components/schemas/EntityMatchingPattern'
                    required:
                        - patternMatcher

        AffectedServerSubGroups:
            description: "selectServersBy: AFFECTED_SERVER_SUBGROUPS"
            allOf:
                -   $ref: '#/components/schemas/ServersAffectedEntities'
                -   type: object
                    properties:
                        subGroups:
                            $ref: '#/components/schemas/AffectedSubGroups'
                    required:
                        - subGroups
        AffectedSubGroups:
            type: object
            properties:
                subGroupScope:
                    type: string
                    enum:
                        - ALL_SUBGROUPS
                        - SPECIFIC_SERVER_SUB_GROUPS
            required:
                - subGroupScope
            discriminator:
                propertyName: subGroupScope
                mapping:
                    ALL_SUBGROUPS: '#/components/schemas/AllSubGroups'
                    SPECIFIC_SERVER_SUB_GROUPS: '#/components/schemas/SpecificServerSubGroups'
        AllSubGroups:
            description: "subGroupScope: ALL_SUBGROUPS"
            allOf:
                -   $ref: '#/components/schemas/AffectedSubGroups'
                -   type: object
        SpecificServerSubGroups:
            description: "subGroupScope: SPECIFIC_SERVER_SUB_GROUPS"
            allOf:
                -   $ref: '#/components/schemas/AffectedSubGroups'
                -   type: object
                    properties:
                        subGroupNames:
                            type: array
                            items:
                                type: string
                                example: 108, 209
                            minItems: 1
                            example: [ 108, 209 ]
                    required:
                        - subGroups


        DatabaseAffectedInfo:
            description: Describes the affected information for AffectedInfoType DATABASES
            allOf:
                - $ref: '#/components/schemas/AffectedInfo'
                - type: object
                  properties:
                      affectedDatabases:
                          $ref: '#/components/schemas/AffectedDatabases'
                  required:
                      - affectedDatabases

        AffectedDatabases:
            type: object
            properties:
                databaseScope:
                    $ref: '#/components/schemas/AffectedDatabaseType'
            required:
                - databaseScope
            discriminator:
                propertyName: databaseScope
                mapping:
                    ALL_DATABASES: '#/components/schemas/AllDatabases'
                    SPECIFIC_DATABASES: '#/components/schemas/SpecificDatabases'

        AllDatabases:
            description: "businessTransactionScope: ALL_DATABASES"
            allOf:
                - $ref: '#/components/schemas/AffectedDatabases'
                - type: object

        SpecificDatabases:
            description: "businessTransactionScope: SPECIFIC_DATABASES"
            allOf:
                - $ref: '#/components/schemas/AffectedDatabases'
                - type: object
                  properties:
                      databases:
                          type: array
                          items:
                              $ref: '#/components/schemas/DbServer'
                              type: string
                              example: "accountsDB"
                          minItems: 1
                          example: ["accountsDB", "MetaDB"]
                  required:
                      - databases

        DbServer:
            type: object
            properties:
                serverName:
                    type: string
                    minLength: 1
                    example: MetaDB
                collectorConfigName:
                    type: string
                    minLength: 1
                    example: ec2
            required:
                - serverName
                - collectorConfigName

        AffectedDatabaseType:
            type: string
            enum:
                - ALL_DATABASES
                - SPECIFIC_DATABASES

        HealthRuleScopeType:
            type: string
            enum:
                - SPECIFIC_HEALTH_RULES

        HealthRuleScope:
            description: 'The health rule scope'
            type: object
            properties:
                healthRuleScopeType:
                    $ref: '#/components/schemas/HealthRuleScopeType'
            required:
                - healthRuleScopeType
            discriminator:
                propertyName: healthRuleScopeType
                mapping:
                    SPECIFIC_HEALTH_RULES: '#/components/schemas/SpecificHealthRules'

        SpecificHealthRules:
            description: 'HealthRuleScope: SPECIFIC_HEALTH_RULES'
            allOf:
                - $ref: '#/components/schemas/HealthRuleScope'
                - type: object
                  properties:
                      healthRules:
                          type: array
                          items:
                              type: string
                              example: "My health rule"
                          minItems: 1
                          example: ["My health rule 1", "My health rule 2"]
                  required:
                      - healthRules

        EntityMatchingPattern:
            type: object
            properties:
                matchTo:
                    type: string
                    enum:
                        - "STARTS_WITH"
                        - "ENDS_WITH"
                        - "CONTAINS"
                        - "EQUALS"
                        - "MATCH_REG_EX"
                    example: "STARTS_WITH"
                matchValue:
                    type: string
                    minLength: 1
                    example: "production"
                shouldNot:
                    type: boolean
                    default: false
                    example: false
            required:
                - matchTo
                - matchValue
        ActionSuppressionSummaryArray:
            type: array
            items:
                $ref: '#/components/schemas/ActionSuppressionSummary'
        ActionSuppressionSummary:
            type: object
            properties:
                id:
                    type: integer
                    format: int64
                    example: 123
                name:
                    type: string
                    minLength: 1
                    example: "Action Suppression"
                timezone:
                    $ref: '#/components/schemas/Timezone'
                startTime:
                    description: The time from which action suppression should kick in. If not specified, action suppression will start from current time.
                        The expected format is yyyy-MM-ddTHH:mm:ss corresponding to rfc3339. Refer https://tools.ietf.org/html/rfc3339
                    type: string
                    example: 2020-04-22T14:05:02
                endTime:
                    description: The time at which ongoing action suppression should end. If not specified, action suppression will end at 60 minutes from current time.
                        The expected format is yyyy-MM-ddTHH:mm:ss corresponding to rfc3339. Refer https://tools.ietf.org/html/rfc3339
                    type: string
                    example: 2020-04-22T13:05:02
                recurringSchedule:
                        $ref: '#/components/schemas/RecurringScheduleConfiguration'

            required:
                - id
                - name

        ErrorResponse:
            properties:
                statusCode:
                    type: integer
                    example: 404
                message:
                    type: string
                    example: "Action suppression with given Id not found."

    parameters:
        applicationId:
            in: path
            name: application-id
            required: true
            schema:
                type: integer
                format: int64
                example: 1
        actionSuppressionId:
            in: path
            name: action-suppression-id
            description: The action-suppression id on which operation is performed
            required: true
            schema:
                type: integer
                format: int64
                example: 4

    requestBodies:
        ActionSuppression:
            content:
                application/json:
                    schema:
                        $ref: '#/components/schemas/ActionSuppression'

    responses:
        NotFound:
            description: The specified resource was not found
            content:
                application/json:
                    schema:
                        $ref: '#/components/schemas/ErrorResponse'
        Unauthorized:
            description: Unauthorized
            content:
                application/json:
                    schema:
                        $ref: '#/components/schemas/ErrorResponse'
        BadRequest:
            description: Bad Request
            content:
                application/json:
                    schema:
                        $ref: '#/components/schemas/ErrorResponse'
        Forbidden:
            description: Forbidden
            content:
                application/json:
                    schema:
                        $ref: '#/components/schemas/ErrorResponse'
        Conflict:
            description: Already exists
            content:
                application/json:
                    schema:
                        $ref: '#/components/schemas/ErrorResponse'