{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CloudWatch.PutCompositeAlarm
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates or updates a /composite alarm/. When you create a composite
-- alarm, you specify a rule expression for the alarm that takes into
-- account the alarm states of other alarms that you have created. The
-- composite alarm goes into ALARM state only if all conditions of the rule
-- are met.
--
-- The alarms specified in a composite alarm\'s rule expression can include
-- metric alarms and other composite alarms. The rule expression of a
-- composite alarm can include as many as 100 underlying alarms. Any single
-- alarm can be included in the rule expressions of as many as 150
-- composite alarms.
--
-- Using composite alarms can reduce alarm noise. You can create multiple
-- metric alarms, and also create a composite alarm and set up alerts only
-- for the composite alarm. For example, you could create a composite alarm
-- that goes into ALARM state only when more than one of the underlying
-- metric alarms are in ALARM state.
--
-- Currently, the only alarm actions that can be taken by composite alarms
-- are notifying SNS topics.
--
-- It is possible to create a loop or cycle of composite alarms, where
-- composite alarm A depends on composite alarm B, and composite alarm B
-- also depends on composite alarm A. In this scenario, you can\'t delete
-- any composite alarm that is part of the cycle because there is always
-- still a composite alarm that depends on that alarm that you want to
-- delete.
--
-- To get out of such a situation, you must break the cycle by changing the
-- rule of one of the composite alarms in the cycle to remove a dependency
-- that creates the cycle. The simplest change to make to break a cycle is
-- to change the @AlarmRule@ of one of the alarms to @false@.
--
-- Additionally, the evaluation of composite alarms stops if CloudWatch
-- detects a cycle in the evaluation path.
--
-- When this operation creates an alarm, the alarm state is immediately set
-- to @INSUFFICIENT_DATA@. The alarm is then evaluated and its state is set
-- appropriately. Any actions associated with the new state are then
-- executed. For a composite alarm, this initial time after creation is the
-- only time that the alarm can be in @INSUFFICIENT_DATA@ state.
--
-- When you update an existing alarm, its state is left unchanged, but the
-- update completely overwrites the previous configuration of the alarm.
--
-- To use this operation, you must be signed on with the
-- @cloudwatch:PutCompositeAlarm@ permission that is scoped to @*@. You
-- can\'t create a composite alarms if your @cloudwatch:PutCompositeAlarm@
-- permission has a narrower scope.
--
-- If you are an IAM user, you must have @iam:CreateServiceLinkedRole@ to
-- create a composite alarm that has Systems Manager OpsItem actions.
module Amazonka.CloudWatch.PutCompositeAlarm
  ( -- * Creating a Request
    PutCompositeAlarm (..),
    newPutCompositeAlarm,

    -- * Request Lenses
    putCompositeAlarm_actionsEnabled,
    putCompositeAlarm_actionsSuppressor,
    putCompositeAlarm_actionsSuppressorExtensionPeriod,
    putCompositeAlarm_actionsSuppressorWaitPeriod,
    putCompositeAlarm_alarmActions,
    putCompositeAlarm_alarmDescription,
    putCompositeAlarm_insufficientDataActions,
    putCompositeAlarm_oKActions,
    putCompositeAlarm_tags,
    putCompositeAlarm_alarmName,
    putCompositeAlarm_alarmRule,

    -- * Destructuring the Response
    PutCompositeAlarmResponse (..),
    newPutCompositeAlarmResponse,
  )
where

import Amazonka.CloudWatch.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newPutCompositeAlarm' smart constructor.
data PutCompositeAlarm = PutCompositeAlarm'
  { -- | Indicates whether actions should be executed during any changes to the
    -- alarm state of the composite alarm. The default is @TRUE@.
    PutCompositeAlarm -> Maybe Bool
actionsEnabled :: Prelude.Maybe Prelude.Bool,
    -- | Actions will be suppressed if the suppressor alarm is in the @ALARM@
    -- state. @ActionsSuppressor@ can be an AlarmName or an Amazon Resource
    -- Name (ARN) from an existing alarm.
    PutCompositeAlarm -> Maybe Text
actionsSuppressor :: Prelude.Maybe Prelude.Text,
    -- | The maximum time in seconds that the composite alarm waits after
    -- suppressor alarm goes out of the @ALARM@ state. After this time, the
    -- composite alarm performs its actions.
    --
    -- @ExtensionPeriod@ is required only when @ActionsSuppressor@ is
    -- specified.
    PutCompositeAlarm -> Maybe Int
actionsSuppressorExtensionPeriod :: Prelude.Maybe Prelude.Int,
    -- | The maximum time in seconds that the composite alarm waits for the
    -- suppressor alarm to go into the @ALARM@ state. After this time, the
    -- composite alarm performs its actions.
    --
    -- @WaitPeriod@ is required only when @ActionsSuppressor@ is specified.
    PutCompositeAlarm -> Maybe Int
actionsSuppressorWaitPeriod :: Prelude.Maybe Prelude.Int,
    -- | The actions to execute when this alarm transitions to the @ALARM@ state
    -- from any other state. Each action is specified as an Amazon Resource
    -- Name (ARN).
    --
    -- Valid Values:
    -- @arn:aws:sns:@/@region@/@:@/@account-id@/@:@/@sns-topic-name@/@ @ |
    -- @arn:aws:ssm:@/@region@/@:@/@account-id@/@:opsitem:@/@severity@/@ @
    PutCompositeAlarm -> Maybe [Text]
alarmActions :: Prelude.Maybe [Prelude.Text],
    -- | The description for the composite alarm.
    PutCompositeAlarm -> Maybe Text
alarmDescription :: Prelude.Maybe Prelude.Text,
    -- | The actions to execute when this alarm transitions to the
    -- @INSUFFICIENT_DATA@ state from any other state. Each action is specified
    -- as an Amazon Resource Name (ARN).
    --
    -- Valid Values:
    -- @arn:aws:sns:@/@region@/@:@/@account-id@/@:@/@sns-topic-name@/@ @
    PutCompositeAlarm -> Maybe [Text]
insufficientDataActions :: Prelude.Maybe [Prelude.Text],
    -- | The actions to execute when this alarm transitions to an @OK@ state from
    -- any other state. Each action is specified as an Amazon Resource Name
    -- (ARN).
    --
    -- Valid Values:
    -- @arn:aws:sns:@/@region@/@:@/@account-id@/@:@/@sns-topic-name@/@ @
    PutCompositeAlarm -> Maybe [Text]
oKActions :: Prelude.Maybe [Prelude.Text],
    -- | A list of key-value pairs to associate with the composite alarm. You can
    -- associate as many as 50 tags with an alarm.
    --
    -- Tags can help you organize and categorize your resources. You can also
    -- use them to scope user permissions, by granting a user permission to
    -- access or change only resources with certain tag values.
    PutCompositeAlarm -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name for the composite alarm. This name must be unique within the
    -- Region.
    PutCompositeAlarm -> Text
alarmName :: Prelude.Text,
    -- | An expression that specifies which other alarms are to be evaluated to
    -- determine this composite alarm\'s state. For each alarm that you
    -- reference, you designate a function that specifies whether that alarm
    -- needs to be in ALARM state, OK state, or INSUFFICIENT_DATA state. You
    -- can use operators (AND, OR and NOT) to combine multiple functions in a
    -- single expression. You can use parenthesis to logically group the
    -- functions in your expression.
    --
    -- You can use either alarm names or ARNs to reference the other alarms
    -- that are to be evaluated.
    --
    -- Functions can include the following:
    --
    -- -   @ALARM(\"@/@alarm-name@/@ or @/@alarm-ARN@/@\")@ is TRUE if the
    --     named alarm is in ALARM state.
    --
    -- -   @OK(\"@/@alarm-name@/@ or @/@alarm-ARN@/@\")@ is TRUE if the named
    --     alarm is in OK state.
    --
    -- -   @INSUFFICIENT_DATA(\"@/@alarm-name@/@ or @/@alarm-ARN@/@\")@ is TRUE
    --     if the named alarm is in INSUFFICIENT_DATA state.
    --
    -- -   @TRUE@ always evaluates to TRUE.
    --
    -- -   @FALSE@ always evaluates to FALSE.
    --
    -- TRUE and FALSE are useful for testing a complex @AlarmRule@ structure,
    -- and for testing your alarm actions.
    --
    -- Alarm names specified in @AlarmRule@ can be surrounded with
    -- double-quotes (\"), but do not have to be.
    --
    -- The following are some examples of @AlarmRule@:
    --
    -- -   @ALARM(CPUUtilizationTooHigh) AND ALARM(DiskReadOpsTooHigh)@
    --     specifies that the composite alarm goes into ALARM state only if
    --     both CPUUtilizationTooHigh and DiskReadOpsTooHigh alarms are in
    --     ALARM state.
    --
    -- -   @ALARM(CPUUtilizationTooHigh) AND NOT ALARM(DeploymentInProgress)@
    --     specifies that the alarm goes to ALARM state if
    --     CPUUtilizationTooHigh is in ALARM state and DeploymentInProgress is
    --     not in ALARM state. This example reduces alarm noise during a known
    --     deployment window.
    --
    -- -   @(ALARM(CPUUtilizationTooHigh) OR ALARM(DiskReadOpsTooHigh)) AND OK(NetworkOutTooHigh)@
    --     goes into ALARM state if CPUUtilizationTooHigh OR DiskReadOpsTooHigh
    --     is in ALARM state, and if NetworkOutTooHigh is in OK state. This
    --     provides another example of using a composite alarm to prevent
    --     noise. This rule ensures that you are not notified with an alarm
    --     action on high CPU or disk usage if a known network problem is also
    --     occurring.
    --
    -- The @AlarmRule@ can specify as many as 100 \"children\" alarms. The
    -- @AlarmRule@ expression can have as many as 500 elements. Elements are
    -- child alarms, TRUE or FALSE statements, and parentheses.
    PutCompositeAlarm -> Text
alarmRule :: Prelude.Text
  }
  deriving (PutCompositeAlarm -> PutCompositeAlarm -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutCompositeAlarm -> PutCompositeAlarm -> Bool
$c/= :: PutCompositeAlarm -> PutCompositeAlarm -> Bool
== :: PutCompositeAlarm -> PutCompositeAlarm -> Bool
$c== :: PutCompositeAlarm -> PutCompositeAlarm -> Bool
Prelude.Eq, ReadPrec [PutCompositeAlarm]
ReadPrec PutCompositeAlarm
Int -> ReadS PutCompositeAlarm
ReadS [PutCompositeAlarm]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutCompositeAlarm]
$creadListPrec :: ReadPrec [PutCompositeAlarm]
readPrec :: ReadPrec PutCompositeAlarm
$creadPrec :: ReadPrec PutCompositeAlarm
readList :: ReadS [PutCompositeAlarm]
$creadList :: ReadS [PutCompositeAlarm]
readsPrec :: Int -> ReadS PutCompositeAlarm
$creadsPrec :: Int -> ReadS PutCompositeAlarm
Prelude.Read, Int -> PutCompositeAlarm -> ShowS
[PutCompositeAlarm] -> ShowS
PutCompositeAlarm -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutCompositeAlarm] -> ShowS
$cshowList :: [PutCompositeAlarm] -> ShowS
show :: PutCompositeAlarm -> String
$cshow :: PutCompositeAlarm -> String
showsPrec :: Int -> PutCompositeAlarm -> ShowS
$cshowsPrec :: Int -> PutCompositeAlarm -> ShowS
Prelude.Show, forall x. Rep PutCompositeAlarm x -> PutCompositeAlarm
forall x. PutCompositeAlarm -> Rep PutCompositeAlarm x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutCompositeAlarm x -> PutCompositeAlarm
$cfrom :: forall x. PutCompositeAlarm -> Rep PutCompositeAlarm x
Prelude.Generic)

-- |
-- Create a value of 'PutCompositeAlarm' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'actionsEnabled', 'putCompositeAlarm_actionsEnabled' - Indicates whether actions should be executed during any changes to the
-- alarm state of the composite alarm. The default is @TRUE@.
--
-- 'actionsSuppressor', 'putCompositeAlarm_actionsSuppressor' - Actions will be suppressed if the suppressor alarm is in the @ALARM@
-- state. @ActionsSuppressor@ can be an AlarmName or an Amazon Resource
-- Name (ARN) from an existing alarm.
--
-- 'actionsSuppressorExtensionPeriod', 'putCompositeAlarm_actionsSuppressorExtensionPeriod' - The maximum time in seconds that the composite alarm waits after
-- suppressor alarm goes out of the @ALARM@ state. After this time, the
-- composite alarm performs its actions.
--
-- @ExtensionPeriod@ is required only when @ActionsSuppressor@ is
-- specified.
--
-- 'actionsSuppressorWaitPeriod', 'putCompositeAlarm_actionsSuppressorWaitPeriod' - The maximum time in seconds that the composite alarm waits for the
-- suppressor alarm to go into the @ALARM@ state. After this time, the
-- composite alarm performs its actions.
--
-- @WaitPeriod@ is required only when @ActionsSuppressor@ is specified.
--
-- 'alarmActions', 'putCompositeAlarm_alarmActions' - The actions to execute when this alarm transitions to the @ALARM@ state
-- from any other state. Each action is specified as an Amazon Resource
-- Name (ARN).
--
-- Valid Values:
-- @arn:aws:sns:@/@region@/@:@/@account-id@/@:@/@sns-topic-name@/@ @ |
-- @arn:aws:ssm:@/@region@/@:@/@account-id@/@:opsitem:@/@severity@/@ @
--
-- 'alarmDescription', 'putCompositeAlarm_alarmDescription' - The description for the composite alarm.
--
-- 'insufficientDataActions', 'putCompositeAlarm_insufficientDataActions' - The actions to execute when this alarm transitions to the
-- @INSUFFICIENT_DATA@ state from any other state. Each action is specified
-- as an Amazon Resource Name (ARN).
--
-- Valid Values:
-- @arn:aws:sns:@/@region@/@:@/@account-id@/@:@/@sns-topic-name@/@ @
--
-- 'oKActions', 'putCompositeAlarm_oKActions' - The actions to execute when this alarm transitions to an @OK@ state from
-- any other state. Each action is specified as an Amazon Resource Name
-- (ARN).
--
-- Valid Values:
-- @arn:aws:sns:@/@region@/@:@/@account-id@/@:@/@sns-topic-name@/@ @
--
-- 'tags', 'putCompositeAlarm_tags' - A list of key-value pairs to associate with the composite alarm. You can
-- associate as many as 50 tags with an alarm.
--
-- Tags can help you organize and categorize your resources. You can also
-- use them to scope user permissions, by granting a user permission to
-- access or change only resources with certain tag values.
--
-- 'alarmName', 'putCompositeAlarm_alarmName' - The name for the composite alarm. This name must be unique within the
-- Region.
--
-- 'alarmRule', 'putCompositeAlarm_alarmRule' - An expression that specifies which other alarms are to be evaluated to
-- determine this composite alarm\'s state. For each alarm that you
-- reference, you designate a function that specifies whether that alarm
-- needs to be in ALARM state, OK state, or INSUFFICIENT_DATA state. You
-- can use operators (AND, OR and NOT) to combine multiple functions in a
-- single expression. You can use parenthesis to logically group the
-- functions in your expression.
--
-- You can use either alarm names or ARNs to reference the other alarms
-- that are to be evaluated.
--
-- Functions can include the following:
--
-- -   @ALARM(\"@/@alarm-name@/@ or @/@alarm-ARN@/@\")@ is TRUE if the
--     named alarm is in ALARM state.
--
-- -   @OK(\"@/@alarm-name@/@ or @/@alarm-ARN@/@\")@ is TRUE if the named
--     alarm is in OK state.
--
-- -   @INSUFFICIENT_DATA(\"@/@alarm-name@/@ or @/@alarm-ARN@/@\")@ is TRUE
--     if the named alarm is in INSUFFICIENT_DATA state.
--
-- -   @TRUE@ always evaluates to TRUE.
--
-- -   @FALSE@ always evaluates to FALSE.
--
-- TRUE and FALSE are useful for testing a complex @AlarmRule@ structure,
-- and for testing your alarm actions.
--
-- Alarm names specified in @AlarmRule@ can be surrounded with
-- double-quotes (\"), but do not have to be.
--
-- The following are some examples of @AlarmRule@:
--
-- -   @ALARM(CPUUtilizationTooHigh) AND ALARM(DiskReadOpsTooHigh)@
--     specifies that the composite alarm goes into ALARM state only if
--     both CPUUtilizationTooHigh and DiskReadOpsTooHigh alarms are in
--     ALARM state.
--
-- -   @ALARM(CPUUtilizationTooHigh) AND NOT ALARM(DeploymentInProgress)@
--     specifies that the alarm goes to ALARM state if
--     CPUUtilizationTooHigh is in ALARM state and DeploymentInProgress is
--     not in ALARM state. This example reduces alarm noise during a known
--     deployment window.
--
-- -   @(ALARM(CPUUtilizationTooHigh) OR ALARM(DiskReadOpsTooHigh)) AND OK(NetworkOutTooHigh)@
--     goes into ALARM state if CPUUtilizationTooHigh OR DiskReadOpsTooHigh
--     is in ALARM state, and if NetworkOutTooHigh is in OK state. This
--     provides another example of using a composite alarm to prevent
--     noise. This rule ensures that you are not notified with an alarm
--     action on high CPU or disk usage if a known network problem is also
--     occurring.
--
-- The @AlarmRule@ can specify as many as 100 \"children\" alarms. The
-- @AlarmRule@ expression can have as many as 500 elements. Elements are
-- child alarms, TRUE or FALSE statements, and parentheses.
newPutCompositeAlarm ::
  -- | 'alarmName'
  Prelude.Text ->
  -- | 'alarmRule'
  Prelude.Text ->
  PutCompositeAlarm
newPutCompositeAlarm :: Text -> Text -> PutCompositeAlarm
newPutCompositeAlarm Text
pAlarmName_ Text
pAlarmRule_ =
  PutCompositeAlarm'
    { $sel:actionsEnabled:PutCompositeAlarm' :: Maybe Bool
actionsEnabled =
        forall a. Maybe a
Prelude.Nothing,
      $sel:actionsSuppressor:PutCompositeAlarm' :: Maybe Text
actionsSuppressor = forall a. Maybe a
Prelude.Nothing,
      $sel:actionsSuppressorExtensionPeriod:PutCompositeAlarm' :: Maybe Int
actionsSuppressorExtensionPeriod = forall a. Maybe a
Prelude.Nothing,
      $sel:actionsSuppressorWaitPeriod:PutCompositeAlarm' :: Maybe Int
actionsSuppressorWaitPeriod = forall a. Maybe a
Prelude.Nothing,
      $sel:alarmActions:PutCompositeAlarm' :: Maybe [Text]
alarmActions = forall a. Maybe a
Prelude.Nothing,
      $sel:alarmDescription:PutCompositeAlarm' :: Maybe Text
alarmDescription = forall a. Maybe a
Prelude.Nothing,
      $sel:insufficientDataActions:PutCompositeAlarm' :: Maybe [Text]
insufficientDataActions = forall a. Maybe a
Prelude.Nothing,
      $sel:oKActions:PutCompositeAlarm' :: Maybe [Text]
oKActions = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:PutCompositeAlarm' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:alarmName:PutCompositeAlarm' :: Text
alarmName = Text
pAlarmName_,
      $sel:alarmRule:PutCompositeAlarm' :: Text
alarmRule = Text
pAlarmRule_
    }

-- | Indicates whether actions should be executed during any changes to the
-- alarm state of the composite alarm. The default is @TRUE@.
putCompositeAlarm_actionsEnabled :: Lens.Lens' PutCompositeAlarm (Prelude.Maybe Prelude.Bool)
putCompositeAlarm_actionsEnabled :: Lens' PutCompositeAlarm (Maybe Bool)
putCompositeAlarm_actionsEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutCompositeAlarm' {Maybe Bool
actionsEnabled :: Maybe Bool
$sel:actionsEnabled:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Bool
actionsEnabled} -> Maybe Bool
actionsEnabled) (\s :: PutCompositeAlarm
s@PutCompositeAlarm' {} Maybe Bool
a -> PutCompositeAlarm
s {$sel:actionsEnabled:PutCompositeAlarm' :: Maybe Bool
actionsEnabled = Maybe Bool
a} :: PutCompositeAlarm)

-- | Actions will be suppressed if the suppressor alarm is in the @ALARM@
-- state. @ActionsSuppressor@ can be an AlarmName or an Amazon Resource
-- Name (ARN) from an existing alarm.
putCompositeAlarm_actionsSuppressor :: Lens.Lens' PutCompositeAlarm (Prelude.Maybe Prelude.Text)
putCompositeAlarm_actionsSuppressor :: Lens' PutCompositeAlarm (Maybe Text)
putCompositeAlarm_actionsSuppressor = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutCompositeAlarm' {Maybe Text
actionsSuppressor :: Maybe Text
$sel:actionsSuppressor:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Text
actionsSuppressor} -> Maybe Text
actionsSuppressor) (\s :: PutCompositeAlarm
s@PutCompositeAlarm' {} Maybe Text
a -> PutCompositeAlarm
s {$sel:actionsSuppressor:PutCompositeAlarm' :: Maybe Text
actionsSuppressor = Maybe Text
a} :: PutCompositeAlarm)

-- | The maximum time in seconds that the composite alarm waits after
-- suppressor alarm goes out of the @ALARM@ state. After this time, the
-- composite alarm performs its actions.
--
-- @ExtensionPeriod@ is required only when @ActionsSuppressor@ is
-- specified.
putCompositeAlarm_actionsSuppressorExtensionPeriod :: Lens.Lens' PutCompositeAlarm (Prelude.Maybe Prelude.Int)
putCompositeAlarm_actionsSuppressorExtensionPeriod :: Lens' PutCompositeAlarm (Maybe Int)
putCompositeAlarm_actionsSuppressorExtensionPeriod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutCompositeAlarm' {Maybe Int
actionsSuppressorExtensionPeriod :: Maybe Int
$sel:actionsSuppressorExtensionPeriod:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Int
actionsSuppressorExtensionPeriod} -> Maybe Int
actionsSuppressorExtensionPeriod) (\s :: PutCompositeAlarm
s@PutCompositeAlarm' {} Maybe Int
a -> PutCompositeAlarm
s {$sel:actionsSuppressorExtensionPeriod:PutCompositeAlarm' :: Maybe Int
actionsSuppressorExtensionPeriod = Maybe Int
a} :: PutCompositeAlarm)

-- | The maximum time in seconds that the composite alarm waits for the
-- suppressor alarm to go into the @ALARM@ state. After this time, the
-- composite alarm performs its actions.
--
-- @WaitPeriod@ is required only when @ActionsSuppressor@ is specified.
putCompositeAlarm_actionsSuppressorWaitPeriod :: Lens.Lens' PutCompositeAlarm (Prelude.Maybe Prelude.Int)
putCompositeAlarm_actionsSuppressorWaitPeriod :: Lens' PutCompositeAlarm (Maybe Int)
putCompositeAlarm_actionsSuppressorWaitPeriod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutCompositeAlarm' {Maybe Int
actionsSuppressorWaitPeriod :: Maybe Int
$sel:actionsSuppressorWaitPeriod:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Int
actionsSuppressorWaitPeriod} -> Maybe Int
actionsSuppressorWaitPeriod) (\s :: PutCompositeAlarm
s@PutCompositeAlarm' {} Maybe Int
a -> PutCompositeAlarm
s {$sel:actionsSuppressorWaitPeriod:PutCompositeAlarm' :: Maybe Int
actionsSuppressorWaitPeriod = Maybe Int
a} :: PutCompositeAlarm)

-- | The actions to execute when this alarm transitions to the @ALARM@ state
-- from any other state. Each action is specified as an Amazon Resource
-- Name (ARN).
--
-- Valid Values:
-- @arn:aws:sns:@/@region@/@:@/@account-id@/@:@/@sns-topic-name@/@ @ |
-- @arn:aws:ssm:@/@region@/@:@/@account-id@/@:opsitem:@/@severity@/@ @
putCompositeAlarm_alarmActions :: Lens.Lens' PutCompositeAlarm (Prelude.Maybe [Prelude.Text])
putCompositeAlarm_alarmActions :: Lens' PutCompositeAlarm (Maybe [Text])
putCompositeAlarm_alarmActions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutCompositeAlarm' {Maybe [Text]
alarmActions :: Maybe [Text]
$sel:alarmActions:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe [Text]
alarmActions} -> Maybe [Text]
alarmActions) (\s :: PutCompositeAlarm
s@PutCompositeAlarm' {} Maybe [Text]
a -> PutCompositeAlarm
s {$sel:alarmActions:PutCompositeAlarm' :: Maybe [Text]
alarmActions = Maybe [Text]
a} :: PutCompositeAlarm) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The description for the composite alarm.
putCompositeAlarm_alarmDescription :: Lens.Lens' PutCompositeAlarm (Prelude.Maybe Prelude.Text)
putCompositeAlarm_alarmDescription :: Lens' PutCompositeAlarm (Maybe Text)
putCompositeAlarm_alarmDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutCompositeAlarm' {Maybe Text
alarmDescription :: Maybe Text
$sel:alarmDescription:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Text
alarmDescription} -> Maybe Text
alarmDescription) (\s :: PutCompositeAlarm
s@PutCompositeAlarm' {} Maybe Text
a -> PutCompositeAlarm
s {$sel:alarmDescription:PutCompositeAlarm' :: Maybe Text
alarmDescription = Maybe Text
a} :: PutCompositeAlarm)

-- | The actions to execute when this alarm transitions to the
-- @INSUFFICIENT_DATA@ state from any other state. Each action is specified
-- as an Amazon Resource Name (ARN).
--
-- Valid Values:
-- @arn:aws:sns:@/@region@/@:@/@account-id@/@:@/@sns-topic-name@/@ @
putCompositeAlarm_insufficientDataActions :: Lens.Lens' PutCompositeAlarm (Prelude.Maybe [Prelude.Text])
putCompositeAlarm_insufficientDataActions :: Lens' PutCompositeAlarm (Maybe [Text])
putCompositeAlarm_insufficientDataActions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutCompositeAlarm' {Maybe [Text]
insufficientDataActions :: Maybe [Text]
$sel:insufficientDataActions:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe [Text]
insufficientDataActions} -> Maybe [Text]
insufficientDataActions) (\s :: PutCompositeAlarm
s@PutCompositeAlarm' {} Maybe [Text]
a -> PutCompositeAlarm
s {$sel:insufficientDataActions:PutCompositeAlarm' :: Maybe [Text]
insufficientDataActions = Maybe [Text]
a} :: PutCompositeAlarm) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The actions to execute when this alarm transitions to an @OK@ state from
-- any other state. Each action is specified as an Amazon Resource Name
-- (ARN).
--
-- Valid Values:
-- @arn:aws:sns:@/@region@/@:@/@account-id@/@:@/@sns-topic-name@/@ @
putCompositeAlarm_oKActions :: Lens.Lens' PutCompositeAlarm (Prelude.Maybe [Prelude.Text])
putCompositeAlarm_oKActions :: Lens' PutCompositeAlarm (Maybe [Text])
putCompositeAlarm_oKActions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutCompositeAlarm' {Maybe [Text]
oKActions :: Maybe [Text]
$sel:oKActions:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe [Text]
oKActions} -> Maybe [Text]
oKActions) (\s :: PutCompositeAlarm
s@PutCompositeAlarm' {} Maybe [Text]
a -> PutCompositeAlarm
s {$sel:oKActions:PutCompositeAlarm' :: Maybe [Text]
oKActions = Maybe [Text]
a} :: PutCompositeAlarm) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of key-value pairs to associate with the composite alarm. You can
-- associate as many as 50 tags with an alarm.
--
-- Tags can help you organize and categorize your resources. You can also
-- use them to scope user permissions, by granting a user permission to
-- access or change only resources with certain tag values.
putCompositeAlarm_tags :: Lens.Lens' PutCompositeAlarm (Prelude.Maybe [Tag])
putCompositeAlarm_tags :: Lens' PutCompositeAlarm (Maybe [Tag])
putCompositeAlarm_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutCompositeAlarm' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: PutCompositeAlarm
s@PutCompositeAlarm' {} Maybe [Tag]
a -> PutCompositeAlarm
s {$sel:tags:PutCompositeAlarm' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: PutCompositeAlarm) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name for the composite alarm. This name must be unique within the
-- Region.
putCompositeAlarm_alarmName :: Lens.Lens' PutCompositeAlarm Prelude.Text
putCompositeAlarm_alarmName :: Lens' PutCompositeAlarm Text
putCompositeAlarm_alarmName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutCompositeAlarm' {Text
alarmName :: Text
$sel:alarmName:PutCompositeAlarm' :: PutCompositeAlarm -> Text
alarmName} -> Text
alarmName) (\s :: PutCompositeAlarm
s@PutCompositeAlarm' {} Text
a -> PutCompositeAlarm
s {$sel:alarmName:PutCompositeAlarm' :: Text
alarmName = Text
a} :: PutCompositeAlarm)

-- | An expression that specifies which other alarms are to be evaluated to
-- determine this composite alarm\'s state. For each alarm that you
-- reference, you designate a function that specifies whether that alarm
-- needs to be in ALARM state, OK state, or INSUFFICIENT_DATA state. You
-- can use operators (AND, OR and NOT) to combine multiple functions in a
-- single expression. You can use parenthesis to logically group the
-- functions in your expression.
--
-- You can use either alarm names or ARNs to reference the other alarms
-- that are to be evaluated.
--
-- Functions can include the following:
--
-- -   @ALARM(\"@/@alarm-name@/@ or @/@alarm-ARN@/@\")@ is TRUE if the
--     named alarm is in ALARM state.
--
-- -   @OK(\"@/@alarm-name@/@ or @/@alarm-ARN@/@\")@ is TRUE if the named
--     alarm is in OK state.
--
-- -   @INSUFFICIENT_DATA(\"@/@alarm-name@/@ or @/@alarm-ARN@/@\")@ is TRUE
--     if the named alarm is in INSUFFICIENT_DATA state.
--
-- -   @TRUE@ always evaluates to TRUE.
--
-- -   @FALSE@ always evaluates to FALSE.
--
-- TRUE and FALSE are useful for testing a complex @AlarmRule@ structure,
-- and for testing your alarm actions.
--
-- Alarm names specified in @AlarmRule@ can be surrounded with
-- double-quotes (\"), but do not have to be.
--
-- The following are some examples of @AlarmRule@:
--
-- -   @ALARM(CPUUtilizationTooHigh) AND ALARM(DiskReadOpsTooHigh)@
--     specifies that the composite alarm goes into ALARM state only if
--     both CPUUtilizationTooHigh and DiskReadOpsTooHigh alarms are in
--     ALARM state.
--
-- -   @ALARM(CPUUtilizationTooHigh) AND NOT ALARM(DeploymentInProgress)@
--     specifies that the alarm goes to ALARM state if
--     CPUUtilizationTooHigh is in ALARM state and DeploymentInProgress is
--     not in ALARM state. This example reduces alarm noise during a known
--     deployment window.
--
-- -   @(ALARM(CPUUtilizationTooHigh) OR ALARM(DiskReadOpsTooHigh)) AND OK(NetworkOutTooHigh)@
--     goes into ALARM state if CPUUtilizationTooHigh OR DiskReadOpsTooHigh
--     is in ALARM state, and if NetworkOutTooHigh is in OK state. This
--     provides another example of using a composite alarm to prevent
--     noise. This rule ensures that you are not notified with an alarm
--     action on high CPU or disk usage if a known network problem is also
--     occurring.
--
-- The @AlarmRule@ can specify as many as 100 \"children\" alarms. The
-- @AlarmRule@ expression can have as many as 500 elements. Elements are
-- child alarms, TRUE or FALSE statements, and parentheses.
putCompositeAlarm_alarmRule :: Lens.Lens' PutCompositeAlarm Prelude.Text
putCompositeAlarm_alarmRule :: Lens' PutCompositeAlarm Text
putCompositeAlarm_alarmRule = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutCompositeAlarm' {Text
alarmRule :: Text
$sel:alarmRule:PutCompositeAlarm' :: PutCompositeAlarm -> Text
alarmRule} -> Text
alarmRule) (\s :: PutCompositeAlarm
s@PutCompositeAlarm' {} Text
a -> PutCompositeAlarm
s {$sel:alarmRule:PutCompositeAlarm' :: Text
alarmRule = Text
a} :: PutCompositeAlarm)

instance Core.AWSRequest PutCompositeAlarm where
  type
    AWSResponse PutCompositeAlarm =
      PutCompositeAlarmResponse
  request :: (Service -> Service)
-> PutCompositeAlarm -> Request PutCompositeAlarm
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutCompositeAlarm
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutCompositeAlarm)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull PutCompositeAlarmResponse
PutCompositeAlarmResponse'

instance Prelude.Hashable PutCompositeAlarm where
  hashWithSalt :: Int -> PutCompositeAlarm -> Int
hashWithSalt Int
_salt PutCompositeAlarm' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [Tag]
Maybe Text
Text
alarmRule :: Text
alarmName :: Text
tags :: Maybe [Tag]
oKActions :: Maybe [Text]
insufficientDataActions :: Maybe [Text]
alarmDescription :: Maybe Text
alarmActions :: Maybe [Text]
actionsSuppressorWaitPeriod :: Maybe Int
actionsSuppressorExtensionPeriod :: Maybe Int
actionsSuppressor :: Maybe Text
actionsEnabled :: Maybe Bool
$sel:alarmRule:PutCompositeAlarm' :: PutCompositeAlarm -> Text
$sel:alarmName:PutCompositeAlarm' :: PutCompositeAlarm -> Text
$sel:tags:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe [Tag]
$sel:oKActions:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe [Text]
$sel:insufficientDataActions:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe [Text]
$sel:alarmDescription:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Text
$sel:alarmActions:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe [Text]
$sel:actionsSuppressorWaitPeriod:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Int
$sel:actionsSuppressorExtensionPeriod:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Int
$sel:actionsSuppressor:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Text
$sel:actionsEnabled:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
actionsEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
actionsSuppressor
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
actionsSuppressorExtensionPeriod
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
actionsSuppressorWaitPeriod
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
alarmActions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
alarmDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
insufficientDataActions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
oKActions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
alarmName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
alarmRule

instance Prelude.NFData PutCompositeAlarm where
  rnf :: PutCompositeAlarm -> ()
rnf PutCompositeAlarm' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [Tag]
Maybe Text
Text
alarmRule :: Text
alarmName :: Text
tags :: Maybe [Tag]
oKActions :: Maybe [Text]
insufficientDataActions :: Maybe [Text]
alarmDescription :: Maybe Text
alarmActions :: Maybe [Text]
actionsSuppressorWaitPeriod :: Maybe Int
actionsSuppressorExtensionPeriod :: Maybe Int
actionsSuppressor :: Maybe Text
actionsEnabled :: Maybe Bool
$sel:alarmRule:PutCompositeAlarm' :: PutCompositeAlarm -> Text
$sel:alarmName:PutCompositeAlarm' :: PutCompositeAlarm -> Text
$sel:tags:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe [Tag]
$sel:oKActions:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe [Text]
$sel:insufficientDataActions:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe [Text]
$sel:alarmDescription:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Text
$sel:alarmActions:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe [Text]
$sel:actionsSuppressorWaitPeriod:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Int
$sel:actionsSuppressorExtensionPeriod:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Int
$sel:actionsSuppressor:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Text
$sel:actionsEnabled:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
actionsEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
actionsSuppressor
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
actionsSuppressorExtensionPeriod
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
actionsSuppressorWaitPeriod
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
alarmActions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
alarmDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
insufficientDataActions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
oKActions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
alarmName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
alarmRule

instance Data.ToHeaders PutCompositeAlarm where
  toHeaders :: PutCompositeAlarm -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath PutCompositeAlarm where
  toPath :: PutCompositeAlarm -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery PutCompositeAlarm where
  toQuery :: PutCompositeAlarm -> QueryString
toQuery PutCompositeAlarm' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [Tag]
Maybe Text
Text
alarmRule :: Text
alarmName :: Text
tags :: Maybe [Tag]
oKActions :: Maybe [Text]
insufficientDataActions :: Maybe [Text]
alarmDescription :: Maybe Text
alarmActions :: Maybe [Text]
actionsSuppressorWaitPeriod :: Maybe Int
actionsSuppressorExtensionPeriod :: Maybe Int
actionsSuppressor :: Maybe Text
actionsEnabled :: Maybe Bool
$sel:alarmRule:PutCompositeAlarm' :: PutCompositeAlarm -> Text
$sel:alarmName:PutCompositeAlarm' :: PutCompositeAlarm -> Text
$sel:tags:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe [Tag]
$sel:oKActions:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe [Text]
$sel:insufficientDataActions:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe [Text]
$sel:alarmDescription:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Text
$sel:alarmActions:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe [Text]
$sel:actionsSuppressorWaitPeriod:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Int
$sel:actionsSuppressorExtensionPeriod:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Int
$sel:actionsSuppressor:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Text
$sel:actionsEnabled:PutCompositeAlarm' :: PutCompositeAlarm -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"PutCompositeAlarm" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-08-01" :: Prelude.ByteString),
        ByteString
"ActionsEnabled" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
actionsEnabled,
        ByteString
"ActionsSuppressor" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
actionsSuppressor,
        ByteString
"ActionsSuppressorExtensionPeriod"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
actionsSuppressorExtensionPeriod,
        ByteString
"ActionsSuppressorWaitPeriod"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
actionsSuppressorWaitPeriod,
        ByteString
"AlarmActions"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
alarmActions),
        ByteString
"AlarmDescription" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
alarmDescription,
        ByteString
"InsufficientDataActions"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
insufficientDataActions
            ),
        ByteString
"OKActions"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
oKActions),
        ByteString
"Tags"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags),
        ByteString
"AlarmName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
alarmName,
        ByteString
"AlarmRule" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
alarmRule
      ]

-- | /See:/ 'newPutCompositeAlarmResponse' smart constructor.
data PutCompositeAlarmResponse = PutCompositeAlarmResponse'
  {
  }
  deriving (PutCompositeAlarmResponse -> PutCompositeAlarmResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutCompositeAlarmResponse -> PutCompositeAlarmResponse -> Bool
$c/= :: PutCompositeAlarmResponse -> PutCompositeAlarmResponse -> Bool
== :: PutCompositeAlarmResponse -> PutCompositeAlarmResponse -> Bool
$c== :: PutCompositeAlarmResponse -> PutCompositeAlarmResponse -> Bool
Prelude.Eq, ReadPrec [PutCompositeAlarmResponse]
ReadPrec PutCompositeAlarmResponse
Int -> ReadS PutCompositeAlarmResponse
ReadS [PutCompositeAlarmResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutCompositeAlarmResponse]
$creadListPrec :: ReadPrec [PutCompositeAlarmResponse]
readPrec :: ReadPrec PutCompositeAlarmResponse
$creadPrec :: ReadPrec PutCompositeAlarmResponse
readList :: ReadS [PutCompositeAlarmResponse]
$creadList :: ReadS [PutCompositeAlarmResponse]
readsPrec :: Int -> ReadS PutCompositeAlarmResponse
$creadsPrec :: Int -> ReadS PutCompositeAlarmResponse
Prelude.Read, Int -> PutCompositeAlarmResponse -> ShowS
[PutCompositeAlarmResponse] -> ShowS
PutCompositeAlarmResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutCompositeAlarmResponse] -> ShowS
$cshowList :: [PutCompositeAlarmResponse] -> ShowS
show :: PutCompositeAlarmResponse -> String
$cshow :: PutCompositeAlarmResponse -> String
showsPrec :: Int -> PutCompositeAlarmResponse -> ShowS
$cshowsPrec :: Int -> PutCompositeAlarmResponse -> ShowS
Prelude.Show, forall x.
Rep PutCompositeAlarmResponse x -> PutCompositeAlarmResponse
forall x.
PutCompositeAlarmResponse -> Rep PutCompositeAlarmResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutCompositeAlarmResponse x -> PutCompositeAlarmResponse
$cfrom :: forall x.
PutCompositeAlarmResponse -> Rep PutCompositeAlarmResponse x
Prelude.Generic)

-- |
-- Create a value of 'PutCompositeAlarmResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
newPutCompositeAlarmResponse ::
  PutCompositeAlarmResponse
newPutCompositeAlarmResponse :: PutCompositeAlarmResponse
newPutCompositeAlarmResponse =
  PutCompositeAlarmResponse
PutCompositeAlarmResponse'

instance Prelude.NFData PutCompositeAlarmResponse where
  rnf :: PutCompositeAlarmResponse -> ()
rnf PutCompositeAlarmResponse
_ = ()