{-# 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.DisableAlarmActions
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Disables the actions for the specified alarms. When an alarm\'s actions
-- are disabled, the alarm actions do not execute when the alarm state
-- changes.
module Amazonka.CloudWatch.DisableAlarmActions
  ( -- * Creating a Request
    DisableAlarmActions (..),
    newDisableAlarmActions,

    -- * Request Lenses
    disableAlarmActions_alarmNames,

    -- * Destructuring the Response
    DisableAlarmActionsResponse (..),
    newDisableAlarmActionsResponse,
  )
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:/ 'newDisableAlarmActions' smart constructor.
data DisableAlarmActions = DisableAlarmActions'
  { -- | The names of the alarms.
    DisableAlarmActions -> [Text]
alarmNames :: [Prelude.Text]
  }
  deriving (DisableAlarmActions -> DisableAlarmActions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisableAlarmActions -> DisableAlarmActions -> Bool
$c/= :: DisableAlarmActions -> DisableAlarmActions -> Bool
== :: DisableAlarmActions -> DisableAlarmActions -> Bool
$c== :: DisableAlarmActions -> DisableAlarmActions -> Bool
Prelude.Eq, ReadPrec [DisableAlarmActions]
ReadPrec DisableAlarmActions
Int -> ReadS DisableAlarmActions
ReadS [DisableAlarmActions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisableAlarmActions]
$creadListPrec :: ReadPrec [DisableAlarmActions]
readPrec :: ReadPrec DisableAlarmActions
$creadPrec :: ReadPrec DisableAlarmActions
readList :: ReadS [DisableAlarmActions]
$creadList :: ReadS [DisableAlarmActions]
readsPrec :: Int -> ReadS DisableAlarmActions
$creadsPrec :: Int -> ReadS DisableAlarmActions
Prelude.Read, Int -> DisableAlarmActions -> ShowS
[DisableAlarmActions] -> ShowS
DisableAlarmActions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisableAlarmActions] -> ShowS
$cshowList :: [DisableAlarmActions] -> ShowS
show :: DisableAlarmActions -> String
$cshow :: DisableAlarmActions -> String
showsPrec :: Int -> DisableAlarmActions -> ShowS
$cshowsPrec :: Int -> DisableAlarmActions -> ShowS
Prelude.Show, forall x. Rep DisableAlarmActions x -> DisableAlarmActions
forall x. DisableAlarmActions -> Rep DisableAlarmActions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisableAlarmActions x -> DisableAlarmActions
$cfrom :: forall x. DisableAlarmActions -> Rep DisableAlarmActions x
Prelude.Generic)

-- |
-- Create a value of 'DisableAlarmActions' 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:
--
-- 'alarmNames', 'disableAlarmActions_alarmNames' - The names of the alarms.
newDisableAlarmActions ::
  DisableAlarmActions
newDisableAlarmActions :: DisableAlarmActions
newDisableAlarmActions =
  DisableAlarmActions' {$sel:alarmNames:DisableAlarmActions' :: [Text]
alarmNames = forall a. Monoid a => a
Prelude.mempty}

-- | The names of the alarms.
disableAlarmActions_alarmNames :: Lens.Lens' DisableAlarmActions [Prelude.Text]
disableAlarmActions_alarmNames :: Lens' DisableAlarmActions [Text]
disableAlarmActions_alarmNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableAlarmActions' {[Text]
alarmNames :: [Text]
$sel:alarmNames:DisableAlarmActions' :: DisableAlarmActions -> [Text]
alarmNames} -> [Text]
alarmNames) (\s :: DisableAlarmActions
s@DisableAlarmActions' {} [Text]
a -> DisableAlarmActions
s {$sel:alarmNames:DisableAlarmActions' :: [Text]
alarmNames = [Text]
a} :: DisableAlarmActions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest DisableAlarmActions where
  type
    AWSResponse DisableAlarmActions =
      DisableAlarmActionsResponse
  request :: (Service -> Service)
-> DisableAlarmActions -> Request DisableAlarmActions
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 DisableAlarmActions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DisableAlarmActions)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DisableAlarmActionsResponse
DisableAlarmActionsResponse'

instance Prelude.Hashable DisableAlarmActions where
  hashWithSalt :: Int -> DisableAlarmActions -> Int
hashWithSalt Int
_salt DisableAlarmActions' {[Text]
alarmNames :: [Text]
$sel:alarmNames:DisableAlarmActions' :: DisableAlarmActions -> [Text]
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
alarmNames

instance Prelude.NFData DisableAlarmActions where
  rnf :: DisableAlarmActions -> ()
rnf DisableAlarmActions' {[Text]
alarmNames :: [Text]
$sel:alarmNames:DisableAlarmActions' :: DisableAlarmActions -> [Text]
..} = forall a. NFData a => a -> ()
Prelude.rnf [Text]
alarmNames

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

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

instance Data.ToQuery DisableAlarmActions where
  toQuery :: DisableAlarmActions -> QueryString
toQuery DisableAlarmActions' {[Text]
alarmNames :: [Text]
$sel:alarmNames:DisableAlarmActions' :: DisableAlarmActions -> [Text]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DisableAlarmActions" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-08-01" :: Prelude.ByteString),
        ByteString
"AlarmNames"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" [Text]
alarmNames
      ]

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

-- |
-- Create a value of 'DisableAlarmActionsResponse' 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.
newDisableAlarmActionsResponse ::
  DisableAlarmActionsResponse
newDisableAlarmActionsResponse :: DisableAlarmActionsResponse
newDisableAlarmActionsResponse =
  DisableAlarmActionsResponse
DisableAlarmActionsResponse'

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