{-# 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.Lightsail.GetAlarms
-- 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)
--
-- Returns information about the configured alarms. Specify an alarm name
-- in your request to return information about a specific alarm, or specify
-- a monitored resource name to return information about all alarms for a
-- specific resource.
--
-- An alarm is used to monitor a single metric for one of your resources.
-- When a metric condition is met, the alarm can notify you by email, SMS
-- text message, and a banner displayed on the Amazon Lightsail console.
-- For more information, see
-- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-alarms Alarms in Amazon Lightsail>.
module Amazonka.Lightsail.GetAlarms
  ( -- * Creating a Request
    GetAlarms (..),
    newGetAlarms,

    -- * Request Lenses
    getAlarms_alarmName,
    getAlarms_monitoredResourceName,
    getAlarms_pageToken,

    -- * Destructuring the Response
    GetAlarmsResponse (..),
    newGetAlarmsResponse,

    -- * Response Lenses
    getAlarmsResponse_nextPageToken,
    getAlarmsResponse_alarms,
    getAlarmsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetAlarms' smart constructor.
data GetAlarms = GetAlarms'
  { -- | The name of the alarm.
    --
    -- Specify an alarm name to return information about a specific alarm.
    GetAlarms -> Maybe Text
alarmName :: Prelude.Maybe Prelude.Text,
    -- | The name of the Lightsail resource being monitored by the alarm.
    --
    -- Specify a monitored resource name to return information about all alarms
    -- for a specific resource.
    GetAlarms -> Maybe Text
monitoredResourceName :: Prelude.Maybe Prelude.Text,
    -- | The token to advance to the next page of results from your request.
    --
    -- To get a page token, perform an initial @GetAlarms@ request. If your
    -- results are paginated, the response will return a next page token that
    -- you can specify as the page token in a subsequent request.
    GetAlarms -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text
  }
  deriving (GetAlarms -> GetAlarms -> Bool
(GetAlarms -> GetAlarms -> Bool)
-> (GetAlarms -> GetAlarms -> Bool) -> Eq GetAlarms
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAlarms -> GetAlarms -> Bool
$c/= :: GetAlarms -> GetAlarms -> Bool
== :: GetAlarms -> GetAlarms -> Bool
$c== :: GetAlarms -> GetAlarms -> Bool
Prelude.Eq, ReadPrec [GetAlarms]
ReadPrec GetAlarms
Int -> ReadS GetAlarms
ReadS [GetAlarms]
(Int -> ReadS GetAlarms)
-> ReadS [GetAlarms]
-> ReadPrec GetAlarms
-> ReadPrec [GetAlarms]
-> Read GetAlarms
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAlarms]
$creadListPrec :: ReadPrec [GetAlarms]
readPrec :: ReadPrec GetAlarms
$creadPrec :: ReadPrec GetAlarms
readList :: ReadS [GetAlarms]
$creadList :: ReadS [GetAlarms]
readsPrec :: Int -> ReadS GetAlarms
$creadsPrec :: Int -> ReadS GetAlarms
Prelude.Read, Int -> GetAlarms -> ShowS
[GetAlarms] -> ShowS
GetAlarms -> String
(Int -> GetAlarms -> ShowS)
-> (GetAlarms -> String)
-> ([GetAlarms] -> ShowS)
-> Show GetAlarms
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAlarms] -> ShowS
$cshowList :: [GetAlarms] -> ShowS
show :: GetAlarms -> String
$cshow :: GetAlarms -> String
showsPrec :: Int -> GetAlarms -> ShowS
$cshowsPrec :: Int -> GetAlarms -> ShowS
Prelude.Show, (forall x. GetAlarms -> Rep GetAlarms x)
-> (forall x. Rep GetAlarms x -> GetAlarms) -> Generic GetAlarms
forall x. Rep GetAlarms x -> GetAlarms
forall x. GetAlarms -> Rep GetAlarms x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAlarms x -> GetAlarms
$cfrom :: forall x. GetAlarms -> Rep GetAlarms x
Prelude.Generic)

-- |
-- Create a value of 'GetAlarms' 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:
--
-- 'alarmName', 'getAlarms_alarmName' - The name of the alarm.
--
-- Specify an alarm name to return information about a specific alarm.
--
-- 'monitoredResourceName', 'getAlarms_monitoredResourceName' - The name of the Lightsail resource being monitored by the alarm.
--
-- Specify a monitored resource name to return information about all alarms
-- for a specific resource.
--
-- 'pageToken', 'getAlarms_pageToken' - The token to advance to the next page of results from your request.
--
-- To get a page token, perform an initial @GetAlarms@ request. If your
-- results are paginated, the response will return a next page token that
-- you can specify as the page token in a subsequent request.
newGetAlarms ::
  GetAlarms
newGetAlarms :: GetAlarms
newGetAlarms =
  GetAlarms' :: Maybe Text -> Maybe Text -> Maybe Text -> GetAlarms
GetAlarms'
    { $sel:alarmName:GetAlarms' :: Maybe Text
alarmName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:monitoredResourceName:GetAlarms' :: Maybe Text
monitoredResourceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pageToken:GetAlarms' :: Maybe Text
pageToken = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the alarm.
--
-- Specify an alarm name to return information about a specific alarm.
getAlarms_alarmName :: Lens.Lens' GetAlarms (Prelude.Maybe Prelude.Text)
getAlarms_alarmName :: (Maybe Text -> f (Maybe Text)) -> GetAlarms -> f GetAlarms
getAlarms_alarmName = (GetAlarms -> Maybe Text)
-> (GetAlarms -> Maybe Text -> GetAlarms)
-> Lens GetAlarms GetAlarms (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAlarms' {Maybe Text
alarmName :: Maybe Text
$sel:alarmName:GetAlarms' :: GetAlarms -> Maybe Text
alarmName} -> Maybe Text
alarmName) (\s :: GetAlarms
s@GetAlarms' {} Maybe Text
a -> GetAlarms
s {$sel:alarmName:GetAlarms' :: Maybe Text
alarmName = Maybe Text
a} :: GetAlarms)

-- | The name of the Lightsail resource being monitored by the alarm.
--
-- Specify a monitored resource name to return information about all alarms
-- for a specific resource.
getAlarms_monitoredResourceName :: Lens.Lens' GetAlarms (Prelude.Maybe Prelude.Text)
getAlarms_monitoredResourceName :: (Maybe Text -> f (Maybe Text)) -> GetAlarms -> f GetAlarms
getAlarms_monitoredResourceName = (GetAlarms -> Maybe Text)
-> (GetAlarms -> Maybe Text -> GetAlarms)
-> Lens GetAlarms GetAlarms (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAlarms' {Maybe Text
monitoredResourceName :: Maybe Text
$sel:monitoredResourceName:GetAlarms' :: GetAlarms -> Maybe Text
monitoredResourceName} -> Maybe Text
monitoredResourceName) (\s :: GetAlarms
s@GetAlarms' {} Maybe Text
a -> GetAlarms
s {$sel:monitoredResourceName:GetAlarms' :: Maybe Text
monitoredResourceName = Maybe Text
a} :: GetAlarms)

-- | The token to advance to the next page of results from your request.
--
-- To get a page token, perform an initial @GetAlarms@ request. If your
-- results are paginated, the response will return a next page token that
-- you can specify as the page token in a subsequent request.
getAlarms_pageToken :: Lens.Lens' GetAlarms (Prelude.Maybe Prelude.Text)
getAlarms_pageToken :: (Maybe Text -> f (Maybe Text)) -> GetAlarms -> f GetAlarms
getAlarms_pageToken = (GetAlarms -> Maybe Text)
-> (GetAlarms -> Maybe Text -> GetAlarms)
-> Lens GetAlarms GetAlarms (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAlarms' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:GetAlarms' :: GetAlarms -> Maybe Text
pageToken} -> Maybe Text
pageToken) (\s :: GetAlarms
s@GetAlarms' {} Maybe Text
a -> GetAlarms
s {$sel:pageToken:GetAlarms' :: Maybe Text
pageToken = Maybe Text
a} :: GetAlarms)

instance Core.AWSRequest GetAlarms where
  type AWSResponse GetAlarms = GetAlarmsResponse
  request :: GetAlarms -> Request GetAlarms
request = Service -> GetAlarms -> Request GetAlarms
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetAlarms
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetAlarms)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetAlarms))
-> Logger
-> Service
-> Proxy GetAlarms
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetAlarms)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Maybe [Alarm] -> Int -> GetAlarmsResponse
GetAlarmsResponse'
            (Maybe Text -> Maybe [Alarm] -> Int -> GetAlarmsResponse)
-> Either String (Maybe Text)
-> Either String (Maybe [Alarm] -> Int -> GetAlarmsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextPageToken")
            Either String (Maybe [Alarm] -> Int -> GetAlarmsResponse)
-> Either String (Maybe [Alarm])
-> Either String (Int -> GetAlarmsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Alarm]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"alarms" Either String (Maybe (Maybe [Alarm]))
-> Maybe [Alarm] -> Either String (Maybe [Alarm])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Alarm]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> GetAlarmsResponse)
-> Either String Int -> Either String GetAlarmsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetAlarms

instance Prelude.NFData GetAlarms

instance Core.ToHeaders GetAlarms where
  toHeaders :: GetAlarms -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetAlarms -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Lightsail_20161128.GetAlarms" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON GetAlarms where
  toJSON :: GetAlarms -> Value
toJSON GetAlarms' {Maybe Text
pageToken :: Maybe Text
monitoredResourceName :: Maybe Text
alarmName :: Maybe Text
$sel:pageToken:GetAlarms' :: GetAlarms -> Maybe Text
$sel:monitoredResourceName:GetAlarms' :: GetAlarms -> Maybe Text
$sel:alarmName:GetAlarms' :: GetAlarms -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"alarmName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
alarmName,
            (Text
"monitoredResourceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
monitoredResourceName,
            (Text
"pageToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
pageToken
          ]
      )

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

instance Core.ToQuery GetAlarms where
  toQuery :: GetAlarms -> QueryString
toQuery = QueryString -> GetAlarms -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetAlarmsResponse' smart constructor.
data GetAlarmsResponse = GetAlarmsResponse'
  { -- | The token to advance to the next page of results from your request.
    --
    -- A next page token is not returned if there are no more results to
    -- display.
    --
    -- To get the next page of results, perform another @GetAlarms@ request and
    -- specify the next page token using the @pageToken@ parameter.
    GetAlarmsResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | An array of objects that describe the alarms.
    GetAlarmsResponse -> Maybe [Alarm]
alarms :: Prelude.Maybe [Alarm],
    -- | The response's http status code.
    GetAlarmsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetAlarmsResponse -> GetAlarmsResponse -> Bool
(GetAlarmsResponse -> GetAlarmsResponse -> Bool)
-> (GetAlarmsResponse -> GetAlarmsResponse -> Bool)
-> Eq GetAlarmsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAlarmsResponse -> GetAlarmsResponse -> Bool
$c/= :: GetAlarmsResponse -> GetAlarmsResponse -> Bool
== :: GetAlarmsResponse -> GetAlarmsResponse -> Bool
$c== :: GetAlarmsResponse -> GetAlarmsResponse -> Bool
Prelude.Eq, ReadPrec [GetAlarmsResponse]
ReadPrec GetAlarmsResponse
Int -> ReadS GetAlarmsResponse
ReadS [GetAlarmsResponse]
(Int -> ReadS GetAlarmsResponse)
-> ReadS [GetAlarmsResponse]
-> ReadPrec GetAlarmsResponse
-> ReadPrec [GetAlarmsResponse]
-> Read GetAlarmsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAlarmsResponse]
$creadListPrec :: ReadPrec [GetAlarmsResponse]
readPrec :: ReadPrec GetAlarmsResponse
$creadPrec :: ReadPrec GetAlarmsResponse
readList :: ReadS [GetAlarmsResponse]
$creadList :: ReadS [GetAlarmsResponse]
readsPrec :: Int -> ReadS GetAlarmsResponse
$creadsPrec :: Int -> ReadS GetAlarmsResponse
Prelude.Read, Int -> GetAlarmsResponse -> ShowS
[GetAlarmsResponse] -> ShowS
GetAlarmsResponse -> String
(Int -> GetAlarmsResponse -> ShowS)
-> (GetAlarmsResponse -> String)
-> ([GetAlarmsResponse] -> ShowS)
-> Show GetAlarmsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAlarmsResponse] -> ShowS
$cshowList :: [GetAlarmsResponse] -> ShowS
show :: GetAlarmsResponse -> String
$cshow :: GetAlarmsResponse -> String
showsPrec :: Int -> GetAlarmsResponse -> ShowS
$cshowsPrec :: Int -> GetAlarmsResponse -> ShowS
Prelude.Show, (forall x. GetAlarmsResponse -> Rep GetAlarmsResponse x)
-> (forall x. Rep GetAlarmsResponse x -> GetAlarmsResponse)
-> Generic GetAlarmsResponse
forall x. Rep GetAlarmsResponse x -> GetAlarmsResponse
forall x. GetAlarmsResponse -> Rep GetAlarmsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAlarmsResponse x -> GetAlarmsResponse
$cfrom :: forall x. GetAlarmsResponse -> Rep GetAlarmsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetAlarmsResponse' 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:
--
-- 'nextPageToken', 'getAlarmsResponse_nextPageToken' - The token to advance to the next page of results from your request.
--
-- A next page token is not returned if there are no more results to
-- display.
--
-- To get the next page of results, perform another @GetAlarms@ request and
-- specify the next page token using the @pageToken@ parameter.
--
-- 'alarms', 'getAlarmsResponse_alarms' - An array of objects that describe the alarms.
--
-- 'httpStatus', 'getAlarmsResponse_httpStatus' - The response's http status code.
newGetAlarmsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetAlarmsResponse
newGetAlarmsResponse :: Int -> GetAlarmsResponse
newGetAlarmsResponse Int
pHttpStatus_ =
  GetAlarmsResponse' :: Maybe Text -> Maybe [Alarm] -> Int -> GetAlarmsResponse
GetAlarmsResponse'
    { $sel:nextPageToken:GetAlarmsResponse' :: Maybe Text
nextPageToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:alarms:GetAlarmsResponse' :: Maybe [Alarm]
alarms = Maybe [Alarm]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetAlarmsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token to advance to the next page of results from your request.
--
-- A next page token is not returned if there are no more results to
-- display.
--
-- To get the next page of results, perform another @GetAlarms@ request and
-- specify the next page token using the @pageToken@ parameter.
getAlarmsResponse_nextPageToken :: Lens.Lens' GetAlarmsResponse (Prelude.Maybe Prelude.Text)
getAlarmsResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetAlarmsResponse -> f GetAlarmsResponse
getAlarmsResponse_nextPageToken = (GetAlarmsResponse -> Maybe Text)
-> (GetAlarmsResponse -> Maybe Text -> GetAlarmsResponse)
-> Lens
     GetAlarmsResponse GetAlarmsResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAlarmsResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetAlarmsResponse' :: GetAlarmsResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetAlarmsResponse
s@GetAlarmsResponse' {} Maybe Text
a -> GetAlarmsResponse
s {$sel:nextPageToken:GetAlarmsResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetAlarmsResponse)

-- | An array of objects that describe the alarms.
getAlarmsResponse_alarms :: Lens.Lens' GetAlarmsResponse (Prelude.Maybe [Alarm])
getAlarmsResponse_alarms :: (Maybe [Alarm] -> f (Maybe [Alarm]))
-> GetAlarmsResponse -> f GetAlarmsResponse
getAlarmsResponse_alarms = (GetAlarmsResponse -> Maybe [Alarm])
-> (GetAlarmsResponse -> Maybe [Alarm] -> GetAlarmsResponse)
-> Lens
     GetAlarmsResponse GetAlarmsResponse (Maybe [Alarm]) (Maybe [Alarm])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAlarmsResponse' {Maybe [Alarm]
alarms :: Maybe [Alarm]
$sel:alarms:GetAlarmsResponse' :: GetAlarmsResponse -> Maybe [Alarm]
alarms} -> Maybe [Alarm]
alarms) (\s :: GetAlarmsResponse
s@GetAlarmsResponse' {} Maybe [Alarm]
a -> GetAlarmsResponse
s {$sel:alarms:GetAlarmsResponse' :: Maybe [Alarm]
alarms = Maybe [Alarm]
a} :: GetAlarmsResponse) ((Maybe [Alarm] -> f (Maybe [Alarm]))
 -> GetAlarmsResponse -> f GetAlarmsResponse)
-> ((Maybe [Alarm] -> f (Maybe [Alarm]))
    -> Maybe [Alarm] -> f (Maybe [Alarm]))
-> (Maybe [Alarm] -> f (Maybe [Alarm]))
-> GetAlarmsResponse
-> f GetAlarmsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Alarm] [Alarm] [Alarm] [Alarm]
-> Iso
     (Maybe [Alarm]) (Maybe [Alarm]) (Maybe [Alarm]) (Maybe [Alarm])
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 AnIso [Alarm] [Alarm] [Alarm] [Alarm]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
getAlarmsResponse_httpStatus :: Lens.Lens' GetAlarmsResponse Prelude.Int
getAlarmsResponse_httpStatus :: (Int -> f Int) -> GetAlarmsResponse -> f GetAlarmsResponse
getAlarmsResponse_httpStatus = (GetAlarmsResponse -> Int)
-> (GetAlarmsResponse -> Int -> GetAlarmsResponse)
-> Lens GetAlarmsResponse GetAlarmsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAlarmsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetAlarmsResponse' :: GetAlarmsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetAlarmsResponse
s@GetAlarmsResponse' {} Int
a -> GetAlarmsResponse
s {$sel:httpStatus:GetAlarmsResponse' :: Int
httpStatus = Int
a} :: GetAlarmsResponse)

instance Prelude.NFData GetAlarmsResponse