{-# 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.ApplicationInsights.ListConfigurationHistory
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the INFO, WARN, and ERROR events for periodic configuration
-- updates performed by Application Insights. Examples of events
-- represented are:
--
-- -   INFO: creating a new alarm or updating an alarm threshold.
--
-- -   WARN: alarm not created due to insufficient data points used to
--     predict thresholds.
--
-- -   ERROR: alarm not created due to permission errors or exceeding
--     quotas.
module Amazonka.ApplicationInsights.ListConfigurationHistory
  ( -- * Creating a Request
    ListConfigurationHistory (..),
    newListConfigurationHistory,

    -- * Request Lenses
    listConfigurationHistory_endTime,
    listConfigurationHistory_eventStatus,
    listConfigurationHistory_maxResults,
    listConfigurationHistory_nextToken,
    listConfigurationHistory_resourceGroupName,
    listConfigurationHistory_startTime,

    -- * Destructuring the Response
    ListConfigurationHistoryResponse (..),
    newListConfigurationHistoryResponse,

    -- * Response Lenses
    listConfigurationHistoryResponse_eventList,
    listConfigurationHistoryResponse_nextToken,
    listConfigurationHistoryResponse_httpStatus,
  )
where

import Amazonka.ApplicationInsights.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:/ 'newListConfigurationHistory' smart constructor.
data ListConfigurationHistory = ListConfigurationHistory'
  { -- | The end time of the event.
    ListConfigurationHistory -> Maybe POSIX
endTime :: Prelude.Maybe Data.POSIX,
    -- | The status of the configuration update event. Possible values include
    -- INFO, WARN, and ERROR.
    ListConfigurationHistory -> Maybe ConfigurationEventStatus
eventStatus :: Prelude.Maybe ConfigurationEventStatus,
    -- | The maximum number of results returned by @ListConfigurationHistory@ in
    -- paginated output. When this parameter is used,
    -- @ListConfigurationHistory@ returns only @MaxResults@ in a single page
    -- along with a @NextToken@ response element. The remaining results of the
    -- initial request can be seen by sending another
    -- @ListConfigurationHistory@ request with the returned @NextToken@ value.
    -- If this parameter is not used, then @ListConfigurationHistory@ returns
    -- all results.
    ListConfigurationHistory -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The @NextToken@ value returned from a previous paginated
    -- @ListConfigurationHistory@ request where @MaxResults@ was used and the
    -- results exceeded the value of that parameter. Pagination continues from
    -- the end of the previous results that returned the @NextToken@ value.
    -- This value is @null@ when there are no more results to return.
    ListConfigurationHistory -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Resource group to which the application belongs.
    ListConfigurationHistory -> Maybe Text
resourceGroupName :: Prelude.Maybe Prelude.Text,
    -- | The start time of the event.
    ListConfigurationHistory -> Maybe POSIX
startTime :: Prelude.Maybe Data.POSIX
  }
  deriving (ListConfigurationHistory -> ListConfigurationHistory -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListConfigurationHistory -> ListConfigurationHistory -> Bool
$c/= :: ListConfigurationHistory -> ListConfigurationHistory -> Bool
== :: ListConfigurationHistory -> ListConfigurationHistory -> Bool
$c== :: ListConfigurationHistory -> ListConfigurationHistory -> Bool
Prelude.Eq, ReadPrec [ListConfigurationHistory]
ReadPrec ListConfigurationHistory
Int -> ReadS ListConfigurationHistory
ReadS [ListConfigurationHistory]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListConfigurationHistory]
$creadListPrec :: ReadPrec [ListConfigurationHistory]
readPrec :: ReadPrec ListConfigurationHistory
$creadPrec :: ReadPrec ListConfigurationHistory
readList :: ReadS [ListConfigurationHistory]
$creadList :: ReadS [ListConfigurationHistory]
readsPrec :: Int -> ReadS ListConfigurationHistory
$creadsPrec :: Int -> ReadS ListConfigurationHistory
Prelude.Read, Int -> ListConfigurationHistory -> ShowS
[ListConfigurationHistory] -> ShowS
ListConfigurationHistory -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListConfigurationHistory] -> ShowS
$cshowList :: [ListConfigurationHistory] -> ShowS
show :: ListConfigurationHistory -> String
$cshow :: ListConfigurationHistory -> String
showsPrec :: Int -> ListConfigurationHistory -> ShowS
$cshowsPrec :: Int -> ListConfigurationHistory -> ShowS
Prelude.Show, forall x.
Rep ListConfigurationHistory x -> ListConfigurationHistory
forall x.
ListConfigurationHistory -> Rep ListConfigurationHistory x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListConfigurationHistory x -> ListConfigurationHistory
$cfrom :: forall x.
ListConfigurationHistory -> Rep ListConfigurationHistory x
Prelude.Generic)

-- |
-- Create a value of 'ListConfigurationHistory' 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:
--
-- 'endTime', 'listConfigurationHistory_endTime' - The end time of the event.
--
-- 'eventStatus', 'listConfigurationHistory_eventStatus' - The status of the configuration update event. Possible values include
-- INFO, WARN, and ERROR.
--
-- 'maxResults', 'listConfigurationHistory_maxResults' - The maximum number of results returned by @ListConfigurationHistory@ in
-- paginated output. When this parameter is used,
-- @ListConfigurationHistory@ returns only @MaxResults@ in a single page
-- along with a @NextToken@ response element. The remaining results of the
-- initial request can be seen by sending another
-- @ListConfigurationHistory@ request with the returned @NextToken@ value.
-- If this parameter is not used, then @ListConfigurationHistory@ returns
-- all results.
--
-- 'nextToken', 'listConfigurationHistory_nextToken' - The @NextToken@ value returned from a previous paginated
-- @ListConfigurationHistory@ request where @MaxResults@ was used and the
-- results exceeded the value of that parameter. Pagination continues from
-- the end of the previous results that returned the @NextToken@ value.
-- This value is @null@ when there are no more results to return.
--
-- 'resourceGroupName', 'listConfigurationHistory_resourceGroupName' - Resource group to which the application belongs.
--
-- 'startTime', 'listConfigurationHistory_startTime' - The start time of the event.
newListConfigurationHistory ::
  ListConfigurationHistory
newListConfigurationHistory :: ListConfigurationHistory
newListConfigurationHistory =
  ListConfigurationHistory'
    { $sel:endTime:ListConfigurationHistory' :: Maybe POSIX
endTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:eventStatus:ListConfigurationHistory' :: Maybe ConfigurationEventStatus
eventStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListConfigurationHistory' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListConfigurationHistory' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceGroupName:ListConfigurationHistory' :: Maybe Text
resourceGroupName = forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:ListConfigurationHistory' :: Maybe POSIX
startTime = forall a. Maybe a
Prelude.Nothing
    }

-- | The end time of the event.
listConfigurationHistory_endTime :: Lens.Lens' ListConfigurationHistory (Prelude.Maybe Prelude.UTCTime)
listConfigurationHistory_endTime :: Lens' ListConfigurationHistory (Maybe UTCTime)
listConfigurationHistory_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationHistory' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: ListConfigurationHistory
s@ListConfigurationHistory' {} Maybe POSIX
a -> ListConfigurationHistory
s {$sel:endTime:ListConfigurationHistory' :: Maybe POSIX
endTime = Maybe POSIX
a} :: ListConfigurationHistory) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The status of the configuration update event. Possible values include
-- INFO, WARN, and ERROR.
listConfigurationHistory_eventStatus :: Lens.Lens' ListConfigurationHistory (Prelude.Maybe ConfigurationEventStatus)
listConfigurationHistory_eventStatus :: Lens' ListConfigurationHistory (Maybe ConfigurationEventStatus)
listConfigurationHistory_eventStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationHistory' {Maybe ConfigurationEventStatus
eventStatus :: Maybe ConfigurationEventStatus
$sel:eventStatus:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe ConfigurationEventStatus
eventStatus} -> Maybe ConfigurationEventStatus
eventStatus) (\s :: ListConfigurationHistory
s@ListConfigurationHistory' {} Maybe ConfigurationEventStatus
a -> ListConfigurationHistory
s {$sel:eventStatus:ListConfigurationHistory' :: Maybe ConfigurationEventStatus
eventStatus = Maybe ConfigurationEventStatus
a} :: ListConfigurationHistory)

-- | The maximum number of results returned by @ListConfigurationHistory@ in
-- paginated output. When this parameter is used,
-- @ListConfigurationHistory@ returns only @MaxResults@ in a single page
-- along with a @NextToken@ response element. The remaining results of the
-- initial request can be seen by sending another
-- @ListConfigurationHistory@ request with the returned @NextToken@ value.
-- If this parameter is not used, then @ListConfigurationHistory@ returns
-- all results.
listConfigurationHistory_maxResults :: Lens.Lens' ListConfigurationHistory (Prelude.Maybe Prelude.Natural)
listConfigurationHistory_maxResults :: Lens' ListConfigurationHistory (Maybe Natural)
listConfigurationHistory_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationHistory' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListConfigurationHistory
s@ListConfigurationHistory' {} Maybe Natural
a -> ListConfigurationHistory
s {$sel:maxResults:ListConfigurationHistory' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListConfigurationHistory)

-- | The @NextToken@ value returned from a previous paginated
-- @ListConfigurationHistory@ request where @MaxResults@ was used and the
-- results exceeded the value of that parameter. Pagination continues from
-- the end of the previous results that returned the @NextToken@ value.
-- This value is @null@ when there are no more results to return.
listConfigurationHistory_nextToken :: Lens.Lens' ListConfigurationHistory (Prelude.Maybe Prelude.Text)
listConfigurationHistory_nextToken :: Lens' ListConfigurationHistory (Maybe Text)
listConfigurationHistory_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationHistory' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListConfigurationHistory
s@ListConfigurationHistory' {} Maybe Text
a -> ListConfigurationHistory
s {$sel:nextToken:ListConfigurationHistory' :: Maybe Text
nextToken = Maybe Text
a} :: ListConfigurationHistory)

-- | Resource group to which the application belongs.
listConfigurationHistory_resourceGroupName :: Lens.Lens' ListConfigurationHistory (Prelude.Maybe Prelude.Text)
listConfigurationHistory_resourceGroupName :: Lens' ListConfigurationHistory (Maybe Text)
listConfigurationHistory_resourceGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationHistory' {Maybe Text
resourceGroupName :: Maybe Text
$sel:resourceGroupName:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe Text
resourceGroupName} -> Maybe Text
resourceGroupName) (\s :: ListConfigurationHistory
s@ListConfigurationHistory' {} Maybe Text
a -> ListConfigurationHistory
s {$sel:resourceGroupName:ListConfigurationHistory' :: Maybe Text
resourceGroupName = Maybe Text
a} :: ListConfigurationHistory)

-- | The start time of the event.
listConfigurationHistory_startTime :: Lens.Lens' ListConfigurationHistory (Prelude.Maybe Prelude.UTCTime)
listConfigurationHistory_startTime :: Lens' ListConfigurationHistory (Maybe UTCTime)
listConfigurationHistory_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationHistory' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: ListConfigurationHistory
s@ListConfigurationHistory' {} Maybe POSIX
a -> ListConfigurationHistory
s {$sel:startTime:ListConfigurationHistory' :: Maybe POSIX
startTime = Maybe POSIX
a} :: ListConfigurationHistory) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

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

instance Prelude.Hashable ListConfigurationHistory where
  hashWithSalt :: Int -> ListConfigurationHistory -> Int
hashWithSalt Int
_salt ListConfigurationHistory' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe ConfigurationEventStatus
startTime :: Maybe POSIX
resourceGroupName :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
eventStatus :: Maybe ConfigurationEventStatus
endTime :: Maybe POSIX
$sel:startTime:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe POSIX
$sel:resourceGroupName:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe Text
$sel:nextToken:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe Text
$sel:maxResults:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe Natural
$sel:eventStatus:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe ConfigurationEventStatus
$sel:endTime:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
endTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConfigurationEventStatus
eventStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
startTime

instance Prelude.NFData ListConfigurationHistory where
  rnf :: ListConfigurationHistory -> ()
rnf ListConfigurationHistory' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe ConfigurationEventStatus
startTime :: Maybe POSIX
resourceGroupName :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
eventStatus :: Maybe ConfigurationEventStatus
endTime :: Maybe POSIX
$sel:startTime:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe POSIX
$sel:resourceGroupName:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe Text
$sel:nextToken:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe Text
$sel:maxResults:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe Natural
$sel:eventStatus:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe ConfigurationEventStatus
$sel:endTime:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
endTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConfigurationEventStatus
eventStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
startTime

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

instance Data.ToJSON ListConfigurationHistory where
  toJSON :: ListConfigurationHistory -> Value
toJSON ListConfigurationHistory' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe ConfigurationEventStatus
startTime :: Maybe POSIX
resourceGroupName :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
eventStatus :: Maybe ConfigurationEventStatus
endTime :: Maybe POSIX
$sel:startTime:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe POSIX
$sel:resourceGroupName:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe Text
$sel:nextToken:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe Text
$sel:maxResults:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe Natural
$sel:eventStatus:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe ConfigurationEventStatus
$sel:endTime:ListConfigurationHistory' :: ListConfigurationHistory -> Maybe POSIX
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"EndTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
endTime,
            (Key
"EventStatus" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConfigurationEventStatus
eventStatus,
            (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Key
"ResourceGroupName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
resourceGroupName,
            (Key
"StartTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
startTime
          ]
      )

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

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

-- | /See:/ 'newListConfigurationHistoryResponse' smart constructor.
data ListConfigurationHistoryResponse = ListConfigurationHistoryResponse'
  { -- | The list of configuration events and their corresponding details.
    ListConfigurationHistoryResponse -> Maybe [ConfigurationEvent]
eventList :: Prelude.Maybe [ConfigurationEvent],
    -- | The @NextToken@ value to include in a future @ListConfigurationHistory@
    -- request. When the results of a @ListConfigurationHistory@ request exceed
    -- @MaxResults@, this value can be used to retrieve the next page of
    -- results. This value is @null@ when there are no more results to return.
    ListConfigurationHistoryResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListConfigurationHistoryResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListConfigurationHistoryResponse
-> ListConfigurationHistoryResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListConfigurationHistoryResponse
-> ListConfigurationHistoryResponse -> Bool
$c/= :: ListConfigurationHistoryResponse
-> ListConfigurationHistoryResponse -> Bool
== :: ListConfigurationHistoryResponse
-> ListConfigurationHistoryResponse -> Bool
$c== :: ListConfigurationHistoryResponse
-> ListConfigurationHistoryResponse -> Bool
Prelude.Eq, ReadPrec [ListConfigurationHistoryResponse]
ReadPrec ListConfigurationHistoryResponse
Int -> ReadS ListConfigurationHistoryResponse
ReadS [ListConfigurationHistoryResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListConfigurationHistoryResponse]
$creadListPrec :: ReadPrec [ListConfigurationHistoryResponse]
readPrec :: ReadPrec ListConfigurationHistoryResponse
$creadPrec :: ReadPrec ListConfigurationHistoryResponse
readList :: ReadS [ListConfigurationHistoryResponse]
$creadList :: ReadS [ListConfigurationHistoryResponse]
readsPrec :: Int -> ReadS ListConfigurationHistoryResponse
$creadsPrec :: Int -> ReadS ListConfigurationHistoryResponse
Prelude.Read, Int -> ListConfigurationHistoryResponse -> ShowS
[ListConfigurationHistoryResponse] -> ShowS
ListConfigurationHistoryResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListConfigurationHistoryResponse] -> ShowS
$cshowList :: [ListConfigurationHistoryResponse] -> ShowS
show :: ListConfigurationHistoryResponse -> String
$cshow :: ListConfigurationHistoryResponse -> String
showsPrec :: Int -> ListConfigurationHistoryResponse -> ShowS
$cshowsPrec :: Int -> ListConfigurationHistoryResponse -> ShowS
Prelude.Show, forall x.
Rep ListConfigurationHistoryResponse x
-> ListConfigurationHistoryResponse
forall x.
ListConfigurationHistoryResponse
-> Rep ListConfigurationHistoryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListConfigurationHistoryResponse x
-> ListConfigurationHistoryResponse
$cfrom :: forall x.
ListConfigurationHistoryResponse
-> Rep ListConfigurationHistoryResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListConfigurationHistoryResponse' 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:
--
-- 'eventList', 'listConfigurationHistoryResponse_eventList' - The list of configuration events and their corresponding details.
--
-- 'nextToken', 'listConfigurationHistoryResponse_nextToken' - The @NextToken@ value to include in a future @ListConfigurationHistory@
-- request. When the results of a @ListConfigurationHistory@ request exceed
-- @MaxResults@, this value can be used to retrieve the next page of
-- results. This value is @null@ when there are no more results to return.
--
-- 'httpStatus', 'listConfigurationHistoryResponse_httpStatus' - The response's http status code.
newListConfigurationHistoryResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListConfigurationHistoryResponse
newListConfigurationHistoryResponse :: Int -> ListConfigurationHistoryResponse
newListConfigurationHistoryResponse Int
pHttpStatus_ =
  ListConfigurationHistoryResponse'
    { $sel:eventList:ListConfigurationHistoryResponse' :: Maybe [ConfigurationEvent]
eventList =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListConfigurationHistoryResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListConfigurationHistoryResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of configuration events and their corresponding details.
listConfigurationHistoryResponse_eventList :: Lens.Lens' ListConfigurationHistoryResponse (Prelude.Maybe [ConfigurationEvent])
listConfigurationHistoryResponse_eventList :: Lens' ListConfigurationHistoryResponse (Maybe [ConfigurationEvent])
listConfigurationHistoryResponse_eventList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationHistoryResponse' {Maybe [ConfigurationEvent]
eventList :: Maybe [ConfigurationEvent]
$sel:eventList:ListConfigurationHistoryResponse' :: ListConfigurationHistoryResponse -> Maybe [ConfigurationEvent]
eventList} -> Maybe [ConfigurationEvent]
eventList) (\s :: ListConfigurationHistoryResponse
s@ListConfigurationHistoryResponse' {} Maybe [ConfigurationEvent]
a -> ListConfigurationHistoryResponse
s {$sel:eventList:ListConfigurationHistoryResponse' :: Maybe [ConfigurationEvent]
eventList = Maybe [ConfigurationEvent]
a} :: ListConfigurationHistoryResponse) 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 @NextToken@ value to include in a future @ListConfigurationHistory@
-- request. When the results of a @ListConfigurationHistory@ request exceed
-- @MaxResults@, this value can be used to retrieve the next page of
-- results. This value is @null@ when there are no more results to return.
listConfigurationHistoryResponse_nextToken :: Lens.Lens' ListConfigurationHistoryResponse (Prelude.Maybe Prelude.Text)
listConfigurationHistoryResponse_nextToken :: Lens' ListConfigurationHistoryResponse (Maybe Text)
listConfigurationHistoryResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationHistoryResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListConfigurationHistoryResponse' :: ListConfigurationHistoryResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListConfigurationHistoryResponse
s@ListConfigurationHistoryResponse' {} Maybe Text
a -> ListConfigurationHistoryResponse
s {$sel:nextToken:ListConfigurationHistoryResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListConfigurationHistoryResponse)

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

instance
  Prelude.NFData
    ListConfigurationHistoryResponse
  where
  rnf :: ListConfigurationHistoryResponse -> ()
rnf ListConfigurationHistoryResponse' {Int
Maybe [ConfigurationEvent]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
eventList :: Maybe [ConfigurationEvent]
$sel:httpStatus:ListConfigurationHistoryResponse' :: ListConfigurationHistoryResponse -> Int
$sel:nextToken:ListConfigurationHistoryResponse' :: ListConfigurationHistoryResponse -> Maybe Text
$sel:eventList:ListConfigurationHistoryResponse' :: ListConfigurationHistoryResponse -> Maybe [ConfigurationEvent]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [ConfigurationEvent]
eventList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus