{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- 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.Lens as Lens
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
(DisableAlarmActions -> DisableAlarmActions -> Bool)
-> (DisableAlarmActions -> DisableAlarmActions -> Bool)
-> Eq DisableAlarmActions
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]
(Int -> ReadS DisableAlarmActions)
-> ReadS [DisableAlarmActions]
-> ReadPrec DisableAlarmActions
-> ReadPrec [DisableAlarmActions]
-> Read 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
(Int -> DisableAlarmActions -> ShowS)
-> (DisableAlarmActions -> String)
-> ([DisableAlarmActions] -> ShowS)
-> Show DisableAlarmActions
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. DisableAlarmActions -> Rep DisableAlarmActions x)
-> (forall x. Rep DisableAlarmActions x -> DisableAlarmActions)
-> Generic DisableAlarmActions
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' :: [Text] -> DisableAlarmActions
DisableAlarmActions' {$sel:alarmNames:DisableAlarmActions' :: [Text]
alarmNames = [Text]
forall a. Monoid a => a
Prelude.mempty}

-- | The names of the alarms.
disableAlarmActions_alarmNames :: Lens.Lens' DisableAlarmActions [Prelude.Text]
disableAlarmActions_alarmNames :: ([Text] -> f [Text])
-> DisableAlarmActions -> f DisableAlarmActions
disableAlarmActions_alarmNames = (DisableAlarmActions -> [Text])
-> (DisableAlarmActions -> [Text] -> DisableAlarmActions)
-> Lens DisableAlarmActions DisableAlarmActions [Text] [Text]
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) (([Text] -> f [Text])
 -> DisableAlarmActions -> f DisableAlarmActions)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> DisableAlarmActions
-> f DisableAlarmActions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
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 :: DisableAlarmActions -> Request DisableAlarmActions
request = Service -> DisableAlarmActions -> Request DisableAlarmActions
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DisableAlarmActions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DisableAlarmActions)))
response =
    AWSResponse DisableAlarmActions
-> Logger
-> Service
-> Proxy DisableAlarmActions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DisableAlarmActions)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DisableAlarmActions
DisableAlarmActionsResponse
DisableAlarmActionsResponse'

instance Prelude.Hashable DisableAlarmActions

instance Prelude.NFData DisableAlarmActions

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

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

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

-- | /See:/ 'newDisableAlarmActionsResponse' smart constructor.
data DisableAlarmActionsResponse = DisableAlarmActionsResponse'
  {
  }
  deriving (DisableAlarmActionsResponse -> DisableAlarmActionsResponse -> Bool
(DisableAlarmActionsResponse
 -> DisableAlarmActionsResponse -> Bool)
-> (DisableAlarmActionsResponse
    -> DisableAlarmActionsResponse -> Bool)
-> Eq DisableAlarmActionsResponse
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]
(Int -> ReadS DisableAlarmActionsResponse)
-> ReadS [DisableAlarmActionsResponse]
-> ReadPrec DisableAlarmActionsResponse
-> ReadPrec [DisableAlarmActionsResponse]
-> Read 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
(Int -> DisableAlarmActionsResponse -> ShowS)
-> (DisableAlarmActionsResponse -> String)
-> ([DisableAlarmActionsResponse] -> ShowS)
-> Show DisableAlarmActionsResponse
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.
 DisableAlarmActionsResponse -> Rep DisableAlarmActionsResponse x)
-> (forall x.
    Rep DisableAlarmActionsResponse x -> DisableAlarmActionsResponse)
-> Generic DisableAlarmActionsResponse
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