{-# 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.DescribeAlarmHistory
-- 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)
--
-- Retrieves the history for the specified alarm. You can filter the
-- results by date range or item type. If an alarm name is not specified,
-- the histories for either all metric alarms or all composite alarms are
-- returned.
--
-- CloudWatch retains the history of an alarm even if you delete the alarm.
--
-- This operation returns paginated results.
module Amazonka.CloudWatch.DescribeAlarmHistory
  ( -- * Creating a Request
    DescribeAlarmHistory (..),
    newDescribeAlarmHistory,

    -- * Request Lenses
    describeAlarmHistory_alarmName,
    describeAlarmHistory_historyItemType,
    describeAlarmHistory_alarmTypes,
    describeAlarmHistory_endDate,
    describeAlarmHistory_startDate,
    describeAlarmHistory_nextToken,
    describeAlarmHistory_scanBy,
    describeAlarmHistory_maxRecords,

    -- * Destructuring the Response
    DescribeAlarmHistoryResponse (..),
    newDescribeAlarmHistoryResponse,

    -- * Response Lenses
    describeAlarmHistoryResponse_alarmHistoryItems,
    describeAlarmHistoryResponse_nextToken,
    describeAlarmHistoryResponse_httpStatus,
  )
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:/ 'newDescribeAlarmHistory' smart constructor.
data DescribeAlarmHistory = DescribeAlarmHistory'
  { -- | The name of the alarm.
    DescribeAlarmHistory -> Maybe Text
alarmName :: Prelude.Maybe Prelude.Text,
    -- | The type of alarm histories to retrieve.
    DescribeAlarmHistory -> Maybe HistoryItemType
historyItemType :: Prelude.Maybe HistoryItemType,
    -- | Use this parameter to specify whether you want the operation to return
    -- metric alarms or composite alarms. If you omit this parameter, only
    -- metric alarms are returned.
    DescribeAlarmHistory -> Maybe [AlarmType]
alarmTypes :: Prelude.Maybe [AlarmType],
    -- | The ending date to retrieve alarm history.
    DescribeAlarmHistory -> Maybe ISO8601
endDate :: Prelude.Maybe Core.ISO8601,
    -- | The starting date to retrieve alarm history.
    DescribeAlarmHistory -> Maybe ISO8601
startDate :: Prelude.Maybe Core.ISO8601,
    -- | The token returned by a previous call to indicate that there is more
    -- data available.
    DescribeAlarmHistory -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Specified whether to return the newest or oldest alarm history first.
    -- Specify @TimestampDescending@ to have the newest event history returned
    -- first, and specify @TimestampAscending@ to have the oldest history
    -- returned first.
    DescribeAlarmHistory -> Maybe ScanBy
scanBy :: Prelude.Maybe ScanBy,
    -- | The maximum number of alarm history records to retrieve.
    DescribeAlarmHistory -> Maybe Natural
maxRecords :: Prelude.Maybe Prelude.Natural
  }
  deriving (DescribeAlarmHistory -> DescribeAlarmHistory -> Bool
(DescribeAlarmHistory -> DescribeAlarmHistory -> Bool)
-> (DescribeAlarmHistory -> DescribeAlarmHistory -> Bool)
-> Eq DescribeAlarmHistory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAlarmHistory -> DescribeAlarmHistory -> Bool
$c/= :: DescribeAlarmHistory -> DescribeAlarmHistory -> Bool
== :: DescribeAlarmHistory -> DescribeAlarmHistory -> Bool
$c== :: DescribeAlarmHistory -> DescribeAlarmHistory -> Bool
Prelude.Eq, ReadPrec [DescribeAlarmHistory]
ReadPrec DescribeAlarmHistory
Int -> ReadS DescribeAlarmHistory
ReadS [DescribeAlarmHistory]
(Int -> ReadS DescribeAlarmHistory)
-> ReadS [DescribeAlarmHistory]
-> ReadPrec DescribeAlarmHistory
-> ReadPrec [DescribeAlarmHistory]
-> Read DescribeAlarmHistory
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAlarmHistory]
$creadListPrec :: ReadPrec [DescribeAlarmHistory]
readPrec :: ReadPrec DescribeAlarmHistory
$creadPrec :: ReadPrec DescribeAlarmHistory
readList :: ReadS [DescribeAlarmHistory]
$creadList :: ReadS [DescribeAlarmHistory]
readsPrec :: Int -> ReadS DescribeAlarmHistory
$creadsPrec :: Int -> ReadS DescribeAlarmHistory
Prelude.Read, Int -> DescribeAlarmHistory -> ShowS
[DescribeAlarmHistory] -> ShowS
DescribeAlarmHistory -> String
(Int -> DescribeAlarmHistory -> ShowS)
-> (DescribeAlarmHistory -> String)
-> ([DescribeAlarmHistory] -> ShowS)
-> Show DescribeAlarmHistory
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAlarmHistory] -> ShowS
$cshowList :: [DescribeAlarmHistory] -> ShowS
show :: DescribeAlarmHistory -> String
$cshow :: DescribeAlarmHistory -> String
showsPrec :: Int -> DescribeAlarmHistory -> ShowS
$cshowsPrec :: Int -> DescribeAlarmHistory -> ShowS
Prelude.Show, (forall x. DescribeAlarmHistory -> Rep DescribeAlarmHistory x)
-> (forall x. Rep DescribeAlarmHistory x -> DescribeAlarmHistory)
-> Generic DescribeAlarmHistory
forall x. Rep DescribeAlarmHistory x -> DescribeAlarmHistory
forall x. DescribeAlarmHistory -> Rep DescribeAlarmHistory x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeAlarmHistory x -> DescribeAlarmHistory
$cfrom :: forall x. DescribeAlarmHistory -> Rep DescribeAlarmHistory x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAlarmHistory' 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', 'describeAlarmHistory_alarmName' - The name of the alarm.
--
-- 'historyItemType', 'describeAlarmHistory_historyItemType' - The type of alarm histories to retrieve.
--
-- 'alarmTypes', 'describeAlarmHistory_alarmTypes' - Use this parameter to specify whether you want the operation to return
-- metric alarms or composite alarms. If you omit this parameter, only
-- metric alarms are returned.
--
-- 'endDate', 'describeAlarmHistory_endDate' - The ending date to retrieve alarm history.
--
-- 'startDate', 'describeAlarmHistory_startDate' - The starting date to retrieve alarm history.
--
-- 'nextToken', 'describeAlarmHistory_nextToken' - The token returned by a previous call to indicate that there is more
-- data available.
--
-- 'scanBy', 'describeAlarmHistory_scanBy' - Specified whether to return the newest or oldest alarm history first.
-- Specify @TimestampDescending@ to have the newest event history returned
-- first, and specify @TimestampAscending@ to have the oldest history
-- returned first.
--
-- 'maxRecords', 'describeAlarmHistory_maxRecords' - The maximum number of alarm history records to retrieve.
newDescribeAlarmHistory ::
  DescribeAlarmHistory
newDescribeAlarmHistory :: DescribeAlarmHistory
newDescribeAlarmHistory =
  DescribeAlarmHistory' :: Maybe Text
-> Maybe HistoryItemType
-> Maybe [AlarmType]
-> Maybe ISO8601
-> Maybe ISO8601
-> Maybe Text
-> Maybe ScanBy
-> Maybe Natural
-> DescribeAlarmHistory
DescribeAlarmHistory'
    { $sel:alarmName:DescribeAlarmHistory' :: Maybe Text
alarmName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:historyItemType:DescribeAlarmHistory' :: Maybe HistoryItemType
historyItemType = Maybe HistoryItemType
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmTypes:DescribeAlarmHistory' :: Maybe [AlarmType]
alarmTypes = Maybe [AlarmType]
forall a. Maybe a
Prelude.Nothing,
      $sel:endDate:DescribeAlarmHistory' :: Maybe ISO8601
endDate = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:startDate:DescribeAlarmHistory' :: Maybe ISO8601
startDate = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeAlarmHistory' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:scanBy:DescribeAlarmHistory' :: Maybe ScanBy
scanBy = Maybe ScanBy
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeAlarmHistory' :: Maybe Natural
maxRecords = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the alarm.
describeAlarmHistory_alarmName :: Lens.Lens' DescribeAlarmHistory (Prelude.Maybe Prelude.Text)
describeAlarmHistory_alarmName :: (Maybe Text -> f (Maybe Text))
-> DescribeAlarmHistory -> f DescribeAlarmHistory
describeAlarmHistory_alarmName = (DescribeAlarmHistory -> Maybe Text)
-> (DescribeAlarmHistory -> Maybe Text -> DescribeAlarmHistory)
-> Lens
     DescribeAlarmHistory DescribeAlarmHistory (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmHistory' {Maybe Text
alarmName :: Maybe Text
$sel:alarmName:DescribeAlarmHistory' :: DescribeAlarmHistory -> Maybe Text
alarmName} -> Maybe Text
alarmName) (\s :: DescribeAlarmHistory
s@DescribeAlarmHistory' {} Maybe Text
a -> DescribeAlarmHistory
s {$sel:alarmName:DescribeAlarmHistory' :: Maybe Text
alarmName = Maybe Text
a} :: DescribeAlarmHistory)

-- | The type of alarm histories to retrieve.
describeAlarmHistory_historyItemType :: Lens.Lens' DescribeAlarmHistory (Prelude.Maybe HistoryItemType)
describeAlarmHistory_historyItemType :: (Maybe HistoryItemType -> f (Maybe HistoryItemType))
-> DescribeAlarmHistory -> f DescribeAlarmHistory
describeAlarmHistory_historyItemType = (DescribeAlarmHistory -> Maybe HistoryItemType)
-> (DescribeAlarmHistory
    -> Maybe HistoryItemType -> DescribeAlarmHistory)
-> Lens
     DescribeAlarmHistory
     DescribeAlarmHistory
     (Maybe HistoryItemType)
     (Maybe HistoryItemType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmHistory' {Maybe HistoryItemType
historyItemType :: Maybe HistoryItemType
$sel:historyItemType:DescribeAlarmHistory' :: DescribeAlarmHistory -> Maybe HistoryItemType
historyItemType} -> Maybe HistoryItemType
historyItemType) (\s :: DescribeAlarmHistory
s@DescribeAlarmHistory' {} Maybe HistoryItemType
a -> DescribeAlarmHistory
s {$sel:historyItemType:DescribeAlarmHistory' :: Maybe HistoryItemType
historyItemType = Maybe HistoryItemType
a} :: DescribeAlarmHistory)

-- | Use this parameter to specify whether you want the operation to return
-- metric alarms or composite alarms. If you omit this parameter, only
-- metric alarms are returned.
describeAlarmHistory_alarmTypes :: Lens.Lens' DescribeAlarmHistory (Prelude.Maybe [AlarmType])
describeAlarmHistory_alarmTypes :: (Maybe [AlarmType] -> f (Maybe [AlarmType]))
-> DescribeAlarmHistory -> f DescribeAlarmHistory
describeAlarmHistory_alarmTypes = (DescribeAlarmHistory -> Maybe [AlarmType])
-> (DescribeAlarmHistory
    -> Maybe [AlarmType] -> DescribeAlarmHistory)
-> Lens
     DescribeAlarmHistory
     DescribeAlarmHistory
     (Maybe [AlarmType])
     (Maybe [AlarmType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmHistory' {Maybe [AlarmType]
alarmTypes :: Maybe [AlarmType]
$sel:alarmTypes:DescribeAlarmHistory' :: DescribeAlarmHistory -> Maybe [AlarmType]
alarmTypes} -> Maybe [AlarmType]
alarmTypes) (\s :: DescribeAlarmHistory
s@DescribeAlarmHistory' {} Maybe [AlarmType]
a -> DescribeAlarmHistory
s {$sel:alarmTypes:DescribeAlarmHistory' :: Maybe [AlarmType]
alarmTypes = Maybe [AlarmType]
a} :: DescribeAlarmHistory) ((Maybe [AlarmType] -> f (Maybe [AlarmType]))
 -> DescribeAlarmHistory -> f DescribeAlarmHistory)
-> ((Maybe [AlarmType] -> f (Maybe [AlarmType]))
    -> Maybe [AlarmType] -> f (Maybe [AlarmType]))
-> (Maybe [AlarmType] -> f (Maybe [AlarmType]))
-> DescribeAlarmHistory
-> f DescribeAlarmHistory
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [AlarmType] [AlarmType] [AlarmType] [AlarmType]
-> Iso
     (Maybe [AlarmType])
     (Maybe [AlarmType])
     (Maybe [AlarmType])
     (Maybe [AlarmType])
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 [AlarmType] [AlarmType] [AlarmType] [AlarmType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ending date to retrieve alarm history.
describeAlarmHistory_endDate :: Lens.Lens' DescribeAlarmHistory (Prelude.Maybe Prelude.UTCTime)
describeAlarmHistory_endDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAlarmHistory -> f DescribeAlarmHistory
describeAlarmHistory_endDate = (DescribeAlarmHistory -> Maybe ISO8601)
-> (DescribeAlarmHistory -> Maybe ISO8601 -> DescribeAlarmHistory)
-> Lens
     DescribeAlarmHistory
     DescribeAlarmHistory
     (Maybe ISO8601)
     (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmHistory' {Maybe ISO8601
endDate :: Maybe ISO8601
$sel:endDate:DescribeAlarmHistory' :: DescribeAlarmHistory -> Maybe ISO8601
endDate} -> Maybe ISO8601
endDate) (\s :: DescribeAlarmHistory
s@DescribeAlarmHistory' {} Maybe ISO8601
a -> DescribeAlarmHistory
s {$sel:endDate:DescribeAlarmHistory' :: Maybe ISO8601
endDate = Maybe ISO8601
a} :: DescribeAlarmHistory) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> DescribeAlarmHistory -> f DescribeAlarmHistory)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAlarmHistory
-> f DescribeAlarmHistory
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The starting date to retrieve alarm history.
describeAlarmHistory_startDate :: Lens.Lens' DescribeAlarmHistory (Prelude.Maybe Prelude.UTCTime)
describeAlarmHistory_startDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAlarmHistory -> f DescribeAlarmHistory
describeAlarmHistory_startDate = (DescribeAlarmHistory -> Maybe ISO8601)
-> (DescribeAlarmHistory -> Maybe ISO8601 -> DescribeAlarmHistory)
-> Lens
     DescribeAlarmHistory
     DescribeAlarmHistory
     (Maybe ISO8601)
     (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmHistory' {Maybe ISO8601
startDate :: Maybe ISO8601
$sel:startDate:DescribeAlarmHistory' :: DescribeAlarmHistory -> Maybe ISO8601
startDate} -> Maybe ISO8601
startDate) (\s :: DescribeAlarmHistory
s@DescribeAlarmHistory' {} Maybe ISO8601
a -> DescribeAlarmHistory
s {$sel:startDate:DescribeAlarmHistory' :: Maybe ISO8601
startDate = Maybe ISO8601
a} :: DescribeAlarmHistory) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> DescribeAlarmHistory -> f DescribeAlarmHistory)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAlarmHistory
-> f DescribeAlarmHistory
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The token returned by a previous call to indicate that there is more
-- data available.
describeAlarmHistory_nextToken :: Lens.Lens' DescribeAlarmHistory (Prelude.Maybe Prelude.Text)
describeAlarmHistory_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeAlarmHistory -> f DescribeAlarmHistory
describeAlarmHistory_nextToken = (DescribeAlarmHistory -> Maybe Text)
-> (DescribeAlarmHistory -> Maybe Text -> DescribeAlarmHistory)
-> Lens
     DescribeAlarmHistory DescribeAlarmHistory (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmHistory' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeAlarmHistory' :: DescribeAlarmHistory -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeAlarmHistory
s@DescribeAlarmHistory' {} Maybe Text
a -> DescribeAlarmHistory
s {$sel:nextToken:DescribeAlarmHistory' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeAlarmHistory)

-- | Specified whether to return the newest or oldest alarm history first.
-- Specify @TimestampDescending@ to have the newest event history returned
-- first, and specify @TimestampAscending@ to have the oldest history
-- returned first.
describeAlarmHistory_scanBy :: Lens.Lens' DescribeAlarmHistory (Prelude.Maybe ScanBy)
describeAlarmHistory_scanBy :: (Maybe ScanBy -> f (Maybe ScanBy))
-> DescribeAlarmHistory -> f DescribeAlarmHistory
describeAlarmHistory_scanBy = (DescribeAlarmHistory -> Maybe ScanBy)
-> (DescribeAlarmHistory -> Maybe ScanBy -> DescribeAlarmHistory)
-> Lens
     DescribeAlarmHistory
     DescribeAlarmHistory
     (Maybe ScanBy)
     (Maybe ScanBy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmHistory' {Maybe ScanBy
scanBy :: Maybe ScanBy
$sel:scanBy:DescribeAlarmHistory' :: DescribeAlarmHistory -> Maybe ScanBy
scanBy} -> Maybe ScanBy
scanBy) (\s :: DescribeAlarmHistory
s@DescribeAlarmHistory' {} Maybe ScanBy
a -> DescribeAlarmHistory
s {$sel:scanBy:DescribeAlarmHistory' :: Maybe ScanBy
scanBy = Maybe ScanBy
a} :: DescribeAlarmHistory)

-- | The maximum number of alarm history records to retrieve.
describeAlarmHistory_maxRecords :: Lens.Lens' DescribeAlarmHistory (Prelude.Maybe Prelude.Natural)
describeAlarmHistory_maxRecords :: (Maybe Natural -> f (Maybe Natural))
-> DescribeAlarmHistory -> f DescribeAlarmHistory
describeAlarmHistory_maxRecords = (DescribeAlarmHistory -> Maybe Natural)
-> (DescribeAlarmHistory -> Maybe Natural -> DescribeAlarmHistory)
-> Lens
     DescribeAlarmHistory
     DescribeAlarmHistory
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmHistory' {Maybe Natural
maxRecords :: Maybe Natural
$sel:maxRecords:DescribeAlarmHistory' :: DescribeAlarmHistory -> Maybe Natural
maxRecords} -> Maybe Natural
maxRecords) (\s :: DescribeAlarmHistory
s@DescribeAlarmHistory' {} Maybe Natural
a -> DescribeAlarmHistory
s {$sel:maxRecords:DescribeAlarmHistory' :: Maybe Natural
maxRecords = Maybe Natural
a} :: DescribeAlarmHistory)

instance Core.AWSPager DescribeAlarmHistory where
  page :: DescribeAlarmHistory
-> AWSResponse DescribeAlarmHistory -> Maybe DescribeAlarmHistory
page DescribeAlarmHistory
rq AWSResponse DescribeAlarmHistory
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeAlarmHistory
DescribeAlarmHistoryResponse
rs
            DescribeAlarmHistoryResponse
-> Getting (First Text) DescribeAlarmHistoryResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeAlarmHistoryResponse
-> Const (First Text) DescribeAlarmHistoryResponse
Lens' DescribeAlarmHistoryResponse (Maybe Text)
describeAlarmHistoryResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeAlarmHistoryResponse
 -> Const (First Text) DescribeAlarmHistoryResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeAlarmHistoryResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeAlarmHistory
forall a. Maybe a
Prelude.Nothing
    | Maybe [AlarmHistoryItem] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeAlarmHistory
DescribeAlarmHistoryResponse
rs
            DescribeAlarmHistoryResponse
-> Getting
     (First [AlarmHistoryItem])
     DescribeAlarmHistoryResponse
     [AlarmHistoryItem]
-> Maybe [AlarmHistoryItem]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [AlarmHistoryItem]
 -> Const (First [AlarmHistoryItem]) (Maybe [AlarmHistoryItem]))
-> DescribeAlarmHistoryResponse
-> Const (First [AlarmHistoryItem]) DescribeAlarmHistoryResponse
Lens' DescribeAlarmHistoryResponse (Maybe [AlarmHistoryItem])
describeAlarmHistoryResponse_alarmHistoryItems
              ((Maybe [AlarmHistoryItem]
  -> Const (First [AlarmHistoryItem]) (Maybe [AlarmHistoryItem]))
 -> DescribeAlarmHistoryResponse
 -> Const (First [AlarmHistoryItem]) DescribeAlarmHistoryResponse)
-> (([AlarmHistoryItem]
     -> Const (First [AlarmHistoryItem]) [AlarmHistoryItem])
    -> Maybe [AlarmHistoryItem]
    -> Const (First [AlarmHistoryItem]) (Maybe [AlarmHistoryItem]))
-> Getting
     (First [AlarmHistoryItem])
     DescribeAlarmHistoryResponse
     [AlarmHistoryItem]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AlarmHistoryItem]
 -> Const (First [AlarmHistoryItem]) [AlarmHistoryItem])
-> Maybe [AlarmHistoryItem]
-> Const (First [AlarmHistoryItem]) (Maybe [AlarmHistoryItem])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeAlarmHistory
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeAlarmHistory -> Maybe DescribeAlarmHistory
forall a. a -> Maybe a
Prelude.Just (DescribeAlarmHistory -> Maybe DescribeAlarmHistory)
-> DescribeAlarmHistory -> Maybe DescribeAlarmHistory
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeAlarmHistory
rq
          DescribeAlarmHistory
-> (DescribeAlarmHistory -> DescribeAlarmHistory)
-> DescribeAlarmHistory
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeAlarmHistory -> Identity DescribeAlarmHistory
Lens
  DescribeAlarmHistory DescribeAlarmHistory (Maybe Text) (Maybe Text)
describeAlarmHistory_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeAlarmHistory -> Identity DescribeAlarmHistory)
-> Maybe Text -> DescribeAlarmHistory -> DescribeAlarmHistory
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeAlarmHistory
DescribeAlarmHistoryResponse
rs
          DescribeAlarmHistoryResponse
-> Getting (First Text) DescribeAlarmHistoryResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeAlarmHistoryResponse
-> Const (First Text) DescribeAlarmHistoryResponse
Lens' DescribeAlarmHistoryResponse (Maybe Text)
describeAlarmHistoryResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeAlarmHistoryResponse
 -> Const (First Text) DescribeAlarmHistoryResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeAlarmHistoryResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeAlarmHistory where
  type
    AWSResponse DescribeAlarmHistory =
      DescribeAlarmHistoryResponse
  request :: DescribeAlarmHistory -> Request DescribeAlarmHistory
request = Service -> DescribeAlarmHistory -> Request DescribeAlarmHistory
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeAlarmHistory
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeAlarmHistory)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribeAlarmHistory))
-> Logger
-> Service
-> Proxy DescribeAlarmHistory
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeAlarmHistory)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeAlarmHistoryResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [AlarmHistoryItem]
-> Maybe Text -> Int -> DescribeAlarmHistoryResponse
DescribeAlarmHistoryResponse'
            (Maybe [AlarmHistoryItem]
 -> Maybe Text -> Int -> DescribeAlarmHistoryResponse)
-> Either String (Maybe [AlarmHistoryItem])
-> Either
     String (Maybe Text -> Int -> DescribeAlarmHistoryResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AlarmHistoryItems"
                            Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [AlarmHistoryItem]))
-> Either String (Maybe [AlarmHistoryItem])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [AlarmHistoryItem])
-> [Node] -> Either String (Maybe [AlarmHistoryItem])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [AlarmHistoryItem]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either String (Maybe Text -> Int -> DescribeAlarmHistoryResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeAlarmHistoryResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NextToken")
            Either String (Int -> DescribeAlarmHistoryResponse)
-> Either String Int -> Either String DescribeAlarmHistoryResponse
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 DescribeAlarmHistory

instance Prelude.NFData DescribeAlarmHistory

instance Core.ToHeaders DescribeAlarmHistory where
  toHeaders :: DescribeAlarmHistory -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeAlarmHistory -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery DescribeAlarmHistory where
  toQuery :: DescribeAlarmHistory -> QueryString
toQuery DescribeAlarmHistory' {Maybe Natural
Maybe [AlarmType]
Maybe Text
Maybe ISO8601
Maybe HistoryItemType
Maybe ScanBy
maxRecords :: Maybe Natural
scanBy :: Maybe ScanBy
nextToken :: Maybe Text
startDate :: Maybe ISO8601
endDate :: Maybe ISO8601
alarmTypes :: Maybe [AlarmType]
historyItemType :: Maybe HistoryItemType
alarmName :: Maybe Text
$sel:maxRecords:DescribeAlarmHistory' :: DescribeAlarmHistory -> Maybe Natural
$sel:scanBy:DescribeAlarmHistory' :: DescribeAlarmHistory -> Maybe ScanBy
$sel:nextToken:DescribeAlarmHistory' :: DescribeAlarmHistory -> Maybe Text
$sel:startDate:DescribeAlarmHistory' :: DescribeAlarmHistory -> Maybe ISO8601
$sel:endDate:DescribeAlarmHistory' :: DescribeAlarmHistory -> Maybe ISO8601
$sel:alarmTypes:DescribeAlarmHistory' :: DescribeAlarmHistory -> Maybe [AlarmType]
$sel:historyItemType:DescribeAlarmHistory' :: DescribeAlarmHistory -> Maybe HistoryItemType
$sel:alarmName:DescribeAlarmHistory' :: DescribeAlarmHistory -> Maybe 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
"DescribeAlarmHistory" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-08-01" :: Prelude.ByteString),
        ByteString
"AlarmName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
alarmName,
        ByteString
"HistoryItemType" ByteString -> Maybe HistoryItemType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe HistoryItemType
historyItemType,
        ByteString
"AlarmTypes"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [AlarmType] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([AlarmType] -> QueryString)
-> Maybe [AlarmType] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AlarmType]
alarmTypes),
        ByteString
"EndDate" ByteString -> Maybe ISO8601 -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ISO8601
endDate,
        ByteString
"StartDate" ByteString -> Maybe ISO8601 -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ISO8601
startDate,
        ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"ScanBy" ByteString -> Maybe ScanBy -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ScanBy
scanBy,
        ByteString
"MaxRecords" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxRecords
      ]

-- | /See:/ 'newDescribeAlarmHistoryResponse' smart constructor.
data DescribeAlarmHistoryResponse = DescribeAlarmHistoryResponse'
  { -- | The alarm histories, in JSON format.
    DescribeAlarmHistoryResponse -> Maybe [AlarmHistoryItem]
alarmHistoryItems :: Prelude.Maybe [AlarmHistoryItem],
    -- | The token that marks the start of the next batch of returned results.
    DescribeAlarmHistoryResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeAlarmHistoryResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeAlarmHistoryResponse
-> DescribeAlarmHistoryResponse -> Bool
(DescribeAlarmHistoryResponse
 -> DescribeAlarmHistoryResponse -> Bool)
-> (DescribeAlarmHistoryResponse
    -> DescribeAlarmHistoryResponse -> Bool)
-> Eq DescribeAlarmHistoryResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAlarmHistoryResponse
-> DescribeAlarmHistoryResponse -> Bool
$c/= :: DescribeAlarmHistoryResponse
-> DescribeAlarmHistoryResponse -> Bool
== :: DescribeAlarmHistoryResponse
-> DescribeAlarmHistoryResponse -> Bool
$c== :: DescribeAlarmHistoryResponse
-> DescribeAlarmHistoryResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAlarmHistoryResponse]
ReadPrec DescribeAlarmHistoryResponse
Int -> ReadS DescribeAlarmHistoryResponse
ReadS [DescribeAlarmHistoryResponse]
(Int -> ReadS DescribeAlarmHistoryResponse)
-> ReadS [DescribeAlarmHistoryResponse]
-> ReadPrec DescribeAlarmHistoryResponse
-> ReadPrec [DescribeAlarmHistoryResponse]
-> Read DescribeAlarmHistoryResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAlarmHistoryResponse]
$creadListPrec :: ReadPrec [DescribeAlarmHistoryResponse]
readPrec :: ReadPrec DescribeAlarmHistoryResponse
$creadPrec :: ReadPrec DescribeAlarmHistoryResponse
readList :: ReadS [DescribeAlarmHistoryResponse]
$creadList :: ReadS [DescribeAlarmHistoryResponse]
readsPrec :: Int -> ReadS DescribeAlarmHistoryResponse
$creadsPrec :: Int -> ReadS DescribeAlarmHistoryResponse
Prelude.Read, Int -> DescribeAlarmHistoryResponse -> ShowS
[DescribeAlarmHistoryResponse] -> ShowS
DescribeAlarmHistoryResponse -> String
(Int -> DescribeAlarmHistoryResponse -> ShowS)
-> (DescribeAlarmHistoryResponse -> String)
-> ([DescribeAlarmHistoryResponse] -> ShowS)
-> Show DescribeAlarmHistoryResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAlarmHistoryResponse] -> ShowS
$cshowList :: [DescribeAlarmHistoryResponse] -> ShowS
show :: DescribeAlarmHistoryResponse -> String
$cshow :: DescribeAlarmHistoryResponse -> String
showsPrec :: Int -> DescribeAlarmHistoryResponse -> ShowS
$cshowsPrec :: Int -> DescribeAlarmHistoryResponse -> ShowS
Prelude.Show, (forall x.
 DescribeAlarmHistoryResponse -> Rep DescribeAlarmHistoryResponse x)
-> (forall x.
    Rep DescribeAlarmHistoryResponse x -> DescribeAlarmHistoryResponse)
-> Generic DescribeAlarmHistoryResponse
forall x.
Rep DescribeAlarmHistoryResponse x -> DescribeAlarmHistoryResponse
forall x.
DescribeAlarmHistoryResponse -> Rep DescribeAlarmHistoryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAlarmHistoryResponse x -> DescribeAlarmHistoryResponse
$cfrom :: forall x.
DescribeAlarmHistoryResponse -> Rep DescribeAlarmHistoryResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAlarmHistoryResponse' 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:
--
-- 'alarmHistoryItems', 'describeAlarmHistoryResponse_alarmHistoryItems' - The alarm histories, in JSON format.
--
-- 'nextToken', 'describeAlarmHistoryResponse_nextToken' - The token that marks the start of the next batch of returned results.
--
-- 'httpStatus', 'describeAlarmHistoryResponse_httpStatus' - The response's http status code.
newDescribeAlarmHistoryResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeAlarmHistoryResponse
newDescribeAlarmHistoryResponse :: Int -> DescribeAlarmHistoryResponse
newDescribeAlarmHistoryResponse Int
pHttpStatus_ =
  DescribeAlarmHistoryResponse' :: Maybe [AlarmHistoryItem]
-> Maybe Text -> Int -> DescribeAlarmHistoryResponse
DescribeAlarmHistoryResponse'
    { $sel:alarmHistoryItems:DescribeAlarmHistoryResponse' :: Maybe [AlarmHistoryItem]
alarmHistoryItems =
        Maybe [AlarmHistoryItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeAlarmHistoryResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeAlarmHistoryResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The alarm histories, in JSON format.
describeAlarmHistoryResponse_alarmHistoryItems :: Lens.Lens' DescribeAlarmHistoryResponse (Prelude.Maybe [AlarmHistoryItem])
describeAlarmHistoryResponse_alarmHistoryItems :: (Maybe [AlarmHistoryItem] -> f (Maybe [AlarmHistoryItem]))
-> DescribeAlarmHistoryResponse -> f DescribeAlarmHistoryResponse
describeAlarmHistoryResponse_alarmHistoryItems = (DescribeAlarmHistoryResponse -> Maybe [AlarmHistoryItem])
-> (DescribeAlarmHistoryResponse
    -> Maybe [AlarmHistoryItem] -> DescribeAlarmHistoryResponse)
-> Lens' DescribeAlarmHistoryResponse (Maybe [AlarmHistoryItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmHistoryResponse' {Maybe [AlarmHistoryItem]
alarmHistoryItems :: Maybe [AlarmHistoryItem]
$sel:alarmHistoryItems:DescribeAlarmHistoryResponse' :: DescribeAlarmHistoryResponse -> Maybe [AlarmHistoryItem]
alarmHistoryItems} -> Maybe [AlarmHistoryItem]
alarmHistoryItems) (\s :: DescribeAlarmHistoryResponse
s@DescribeAlarmHistoryResponse' {} Maybe [AlarmHistoryItem]
a -> DescribeAlarmHistoryResponse
s {$sel:alarmHistoryItems:DescribeAlarmHistoryResponse' :: Maybe [AlarmHistoryItem]
alarmHistoryItems = Maybe [AlarmHistoryItem]
a} :: DescribeAlarmHistoryResponse) ((Maybe [AlarmHistoryItem] -> f (Maybe [AlarmHistoryItem]))
 -> DescribeAlarmHistoryResponse -> f DescribeAlarmHistoryResponse)
-> ((Maybe [AlarmHistoryItem] -> f (Maybe [AlarmHistoryItem]))
    -> Maybe [AlarmHistoryItem] -> f (Maybe [AlarmHistoryItem]))
-> (Maybe [AlarmHistoryItem] -> f (Maybe [AlarmHistoryItem]))
-> DescribeAlarmHistoryResponse
-> f DescribeAlarmHistoryResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AlarmHistoryItem]
  [AlarmHistoryItem]
  [AlarmHistoryItem]
  [AlarmHistoryItem]
-> Iso
     (Maybe [AlarmHistoryItem])
     (Maybe [AlarmHistoryItem])
     (Maybe [AlarmHistoryItem])
     (Maybe [AlarmHistoryItem])
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
  [AlarmHistoryItem]
  [AlarmHistoryItem]
  [AlarmHistoryItem]
  [AlarmHistoryItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token that marks the start of the next batch of returned results.
describeAlarmHistoryResponse_nextToken :: Lens.Lens' DescribeAlarmHistoryResponse (Prelude.Maybe Prelude.Text)
describeAlarmHistoryResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeAlarmHistoryResponse -> f DescribeAlarmHistoryResponse
describeAlarmHistoryResponse_nextToken = (DescribeAlarmHistoryResponse -> Maybe Text)
-> (DescribeAlarmHistoryResponse
    -> Maybe Text -> DescribeAlarmHistoryResponse)
-> Lens' DescribeAlarmHistoryResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmHistoryResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeAlarmHistoryResponse' :: DescribeAlarmHistoryResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeAlarmHistoryResponse
s@DescribeAlarmHistoryResponse' {} Maybe Text
a -> DescribeAlarmHistoryResponse
s {$sel:nextToken:DescribeAlarmHistoryResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeAlarmHistoryResponse)

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

instance Prelude.NFData DescribeAlarmHistoryResponse