{-# 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 #-}
module Amazonka.Config.GetResourceConfigHistory
(
GetResourceConfigHistory (..),
newGetResourceConfigHistory,
getResourceConfigHistory_chronologicalOrder,
getResourceConfigHistory_nextToken,
getResourceConfigHistory_limit,
getResourceConfigHistory_laterTime,
getResourceConfigHistory_earlierTime,
getResourceConfigHistory_resourceType,
getResourceConfigHistory_resourceId,
GetResourceConfigHistoryResponse (..),
newGetResourceConfigHistoryResponse,
getResourceConfigHistoryResponse_nextToken,
getResourceConfigHistoryResponse_configurationItems,
getResourceConfigHistoryResponse_httpStatus,
)
where
import Amazonka.Config.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
data GetResourceConfigHistory = GetResourceConfigHistory'
{
GetResourceConfigHistory -> Maybe ChronologicalOrder
chronologicalOrder :: Prelude.Maybe ChronologicalOrder,
GetResourceConfigHistory -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
GetResourceConfigHistory -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
GetResourceConfigHistory -> Maybe POSIX
laterTime :: Prelude.Maybe Core.POSIX,
GetResourceConfigHistory -> Maybe POSIX
earlierTime :: Prelude.Maybe Core.POSIX,
GetResourceConfigHistory -> ResourceType
resourceType :: ResourceType,
GetResourceConfigHistory -> Text
resourceId :: Prelude.Text
}
deriving (GetResourceConfigHistory -> GetResourceConfigHistory -> Bool
(GetResourceConfigHistory -> GetResourceConfigHistory -> Bool)
-> (GetResourceConfigHistory -> GetResourceConfigHistory -> Bool)
-> Eq GetResourceConfigHistory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetResourceConfigHistory -> GetResourceConfigHistory -> Bool
$c/= :: GetResourceConfigHistory -> GetResourceConfigHistory -> Bool
== :: GetResourceConfigHistory -> GetResourceConfigHistory -> Bool
$c== :: GetResourceConfigHistory -> GetResourceConfigHistory -> Bool
Prelude.Eq, ReadPrec [GetResourceConfigHistory]
ReadPrec GetResourceConfigHistory
Int -> ReadS GetResourceConfigHistory
ReadS [GetResourceConfigHistory]
(Int -> ReadS GetResourceConfigHistory)
-> ReadS [GetResourceConfigHistory]
-> ReadPrec GetResourceConfigHistory
-> ReadPrec [GetResourceConfigHistory]
-> Read GetResourceConfigHistory
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetResourceConfigHistory]
$creadListPrec :: ReadPrec [GetResourceConfigHistory]
readPrec :: ReadPrec GetResourceConfigHistory
$creadPrec :: ReadPrec GetResourceConfigHistory
readList :: ReadS [GetResourceConfigHistory]
$creadList :: ReadS [GetResourceConfigHistory]
readsPrec :: Int -> ReadS GetResourceConfigHistory
$creadsPrec :: Int -> ReadS GetResourceConfigHistory
Prelude.Read, Int -> GetResourceConfigHistory -> ShowS
[GetResourceConfigHistory] -> ShowS
GetResourceConfigHistory -> String
(Int -> GetResourceConfigHistory -> ShowS)
-> (GetResourceConfigHistory -> String)
-> ([GetResourceConfigHistory] -> ShowS)
-> Show GetResourceConfigHistory
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetResourceConfigHistory] -> ShowS
$cshowList :: [GetResourceConfigHistory] -> ShowS
show :: GetResourceConfigHistory -> String
$cshow :: GetResourceConfigHistory -> String
showsPrec :: Int -> GetResourceConfigHistory -> ShowS
$cshowsPrec :: Int -> GetResourceConfigHistory -> ShowS
Prelude.Show, (forall x.
GetResourceConfigHistory -> Rep GetResourceConfigHistory x)
-> (forall x.
Rep GetResourceConfigHistory x -> GetResourceConfigHistory)
-> Generic GetResourceConfigHistory
forall x.
Rep GetResourceConfigHistory x -> GetResourceConfigHistory
forall x.
GetResourceConfigHistory -> Rep GetResourceConfigHistory x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetResourceConfigHistory x -> GetResourceConfigHistory
$cfrom :: forall x.
GetResourceConfigHistory -> Rep GetResourceConfigHistory x
Prelude.Generic)
newGetResourceConfigHistory ::
ResourceType ->
Prelude.Text ->
GetResourceConfigHistory
newGetResourceConfigHistory :: ResourceType -> Text -> GetResourceConfigHistory
newGetResourceConfigHistory
ResourceType
pResourceType_
Text
pResourceId_ =
GetResourceConfigHistory' :: Maybe ChronologicalOrder
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe POSIX
-> ResourceType
-> Text
-> GetResourceConfigHistory
GetResourceConfigHistory'
{ $sel:chronologicalOrder:GetResourceConfigHistory' :: Maybe ChronologicalOrder
chronologicalOrder =
Maybe ChronologicalOrder
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:GetResourceConfigHistory' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:limit:GetResourceConfigHistory' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:laterTime:GetResourceConfigHistory' :: Maybe POSIX
laterTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:earlierTime:GetResourceConfigHistory' :: Maybe POSIX
earlierTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:GetResourceConfigHistory' :: ResourceType
resourceType = ResourceType
pResourceType_,
$sel:resourceId:GetResourceConfigHistory' :: Text
resourceId = Text
pResourceId_
}
getResourceConfigHistory_chronologicalOrder :: Lens.Lens' GetResourceConfigHistory (Prelude.Maybe ChronologicalOrder)
getResourceConfigHistory_chronologicalOrder :: (Maybe ChronologicalOrder -> f (Maybe ChronologicalOrder))
-> GetResourceConfigHistory -> f GetResourceConfigHistory
getResourceConfigHistory_chronologicalOrder = (GetResourceConfigHistory -> Maybe ChronologicalOrder)
-> (GetResourceConfigHistory
-> Maybe ChronologicalOrder -> GetResourceConfigHistory)
-> Lens
GetResourceConfigHistory
GetResourceConfigHistory
(Maybe ChronologicalOrder)
(Maybe ChronologicalOrder)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourceConfigHistory' {Maybe ChronologicalOrder
chronologicalOrder :: Maybe ChronologicalOrder
$sel:chronologicalOrder:GetResourceConfigHistory' :: GetResourceConfigHistory -> Maybe ChronologicalOrder
chronologicalOrder} -> Maybe ChronologicalOrder
chronologicalOrder) (\s :: GetResourceConfigHistory
s@GetResourceConfigHistory' {} Maybe ChronologicalOrder
a -> GetResourceConfigHistory
s {$sel:chronologicalOrder:GetResourceConfigHistory' :: Maybe ChronologicalOrder
chronologicalOrder = Maybe ChronologicalOrder
a} :: GetResourceConfigHistory)
getResourceConfigHistory_nextToken :: Lens.Lens' GetResourceConfigHistory (Prelude.Maybe Prelude.Text)
getResourceConfigHistory_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetResourceConfigHistory -> f GetResourceConfigHistory
getResourceConfigHistory_nextToken = (GetResourceConfigHistory -> Maybe Text)
-> (GetResourceConfigHistory
-> Maybe Text -> GetResourceConfigHistory)
-> Lens
GetResourceConfigHistory
GetResourceConfigHistory
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourceConfigHistory' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetResourceConfigHistory' :: GetResourceConfigHistory -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetResourceConfigHistory
s@GetResourceConfigHistory' {} Maybe Text
a -> GetResourceConfigHistory
s {$sel:nextToken:GetResourceConfigHistory' :: Maybe Text
nextToken = Maybe Text
a} :: GetResourceConfigHistory)
getResourceConfigHistory_limit :: Lens.Lens' GetResourceConfigHistory (Prelude.Maybe Prelude.Natural)
getResourceConfigHistory_limit :: (Maybe Natural -> f (Maybe Natural))
-> GetResourceConfigHistory -> f GetResourceConfigHistory
getResourceConfigHistory_limit = (GetResourceConfigHistory -> Maybe Natural)
-> (GetResourceConfigHistory
-> Maybe Natural -> GetResourceConfigHistory)
-> Lens
GetResourceConfigHistory
GetResourceConfigHistory
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourceConfigHistory' {Maybe Natural
limit :: Maybe Natural
$sel:limit:GetResourceConfigHistory' :: GetResourceConfigHistory -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: GetResourceConfigHistory
s@GetResourceConfigHistory' {} Maybe Natural
a -> GetResourceConfigHistory
s {$sel:limit:GetResourceConfigHistory' :: Maybe Natural
limit = Maybe Natural
a} :: GetResourceConfigHistory)
getResourceConfigHistory_laterTime :: Lens.Lens' GetResourceConfigHistory (Prelude.Maybe Prelude.UTCTime)
getResourceConfigHistory_laterTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetResourceConfigHistory -> f GetResourceConfigHistory
getResourceConfigHistory_laterTime = (GetResourceConfigHistory -> Maybe POSIX)
-> (GetResourceConfigHistory
-> Maybe POSIX -> GetResourceConfigHistory)
-> Lens
GetResourceConfigHistory
GetResourceConfigHistory
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourceConfigHistory' {Maybe POSIX
laterTime :: Maybe POSIX
$sel:laterTime:GetResourceConfigHistory' :: GetResourceConfigHistory -> Maybe POSIX
laterTime} -> Maybe POSIX
laterTime) (\s :: GetResourceConfigHistory
s@GetResourceConfigHistory' {} Maybe POSIX
a -> GetResourceConfigHistory
s {$sel:laterTime:GetResourceConfigHistory' :: Maybe POSIX
laterTime = Maybe POSIX
a} :: GetResourceConfigHistory) ((Maybe POSIX -> f (Maybe POSIX))
-> GetResourceConfigHistory -> f GetResourceConfigHistory)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetResourceConfigHistory
-> f GetResourceConfigHistory
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
getResourceConfigHistory_earlierTime :: Lens.Lens' GetResourceConfigHistory (Prelude.Maybe Prelude.UTCTime)
getResourceConfigHistory_earlierTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetResourceConfigHistory -> f GetResourceConfigHistory
getResourceConfigHistory_earlierTime = (GetResourceConfigHistory -> Maybe POSIX)
-> (GetResourceConfigHistory
-> Maybe POSIX -> GetResourceConfigHistory)
-> Lens
GetResourceConfigHistory
GetResourceConfigHistory
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourceConfigHistory' {Maybe POSIX
earlierTime :: Maybe POSIX
$sel:earlierTime:GetResourceConfigHistory' :: GetResourceConfigHistory -> Maybe POSIX
earlierTime} -> Maybe POSIX
earlierTime) (\s :: GetResourceConfigHistory
s@GetResourceConfigHistory' {} Maybe POSIX
a -> GetResourceConfigHistory
s {$sel:earlierTime:GetResourceConfigHistory' :: Maybe POSIX
earlierTime = Maybe POSIX
a} :: GetResourceConfigHistory) ((Maybe POSIX -> f (Maybe POSIX))
-> GetResourceConfigHistory -> f GetResourceConfigHistory)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetResourceConfigHistory
-> f GetResourceConfigHistory
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
getResourceConfigHistory_resourceType :: Lens.Lens' GetResourceConfigHistory ResourceType
getResourceConfigHistory_resourceType :: (ResourceType -> f ResourceType)
-> GetResourceConfigHistory -> f GetResourceConfigHistory
getResourceConfigHistory_resourceType = (GetResourceConfigHistory -> ResourceType)
-> (GetResourceConfigHistory
-> ResourceType -> GetResourceConfigHistory)
-> Lens
GetResourceConfigHistory
GetResourceConfigHistory
ResourceType
ResourceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourceConfigHistory' {ResourceType
resourceType :: ResourceType
$sel:resourceType:GetResourceConfigHistory' :: GetResourceConfigHistory -> ResourceType
resourceType} -> ResourceType
resourceType) (\s :: GetResourceConfigHistory
s@GetResourceConfigHistory' {} ResourceType
a -> GetResourceConfigHistory
s {$sel:resourceType:GetResourceConfigHistory' :: ResourceType
resourceType = ResourceType
a} :: GetResourceConfigHistory)
getResourceConfigHistory_resourceId :: Lens.Lens' GetResourceConfigHistory Prelude.Text
getResourceConfigHistory_resourceId :: (Text -> f Text)
-> GetResourceConfigHistory -> f GetResourceConfigHistory
getResourceConfigHistory_resourceId = (GetResourceConfigHistory -> Text)
-> (GetResourceConfigHistory -> Text -> GetResourceConfigHistory)
-> Lens GetResourceConfigHistory GetResourceConfigHistory Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourceConfigHistory' {Text
resourceId :: Text
$sel:resourceId:GetResourceConfigHistory' :: GetResourceConfigHistory -> Text
resourceId} -> Text
resourceId) (\s :: GetResourceConfigHistory
s@GetResourceConfigHistory' {} Text
a -> GetResourceConfigHistory
s {$sel:resourceId:GetResourceConfigHistory' :: Text
resourceId = Text
a} :: GetResourceConfigHistory)
instance Core.AWSPager GetResourceConfigHistory where
page :: GetResourceConfigHistory
-> AWSResponse GetResourceConfigHistory
-> Maybe GetResourceConfigHistory
page GetResourceConfigHistory
rq AWSResponse GetResourceConfigHistory
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse GetResourceConfigHistory
GetResourceConfigHistoryResponse
rs
GetResourceConfigHistoryResponse
-> Getting (First Text) GetResourceConfigHistoryResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetResourceConfigHistoryResponse
-> Const (First Text) GetResourceConfigHistoryResponse
Lens' GetResourceConfigHistoryResponse (Maybe Text)
getResourceConfigHistoryResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> GetResourceConfigHistoryResponse
-> Const (First Text) GetResourceConfigHistoryResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetResourceConfigHistoryResponse 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 GetResourceConfigHistory
forall a. Maybe a
Prelude.Nothing
| Maybe [ConfigurationItem] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse GetResourceConfigHistory
GetResourceConfigHistoryResponse
rs
GetResourceConfigHistoryResponse
-> Getting
(First [ConfigurationItem])
GetResourceConfigHistoryResponse
[ConfigurationItem]
-> Maybe [ConfigurationItem]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ConfigurationItem]
-> Const (First [ConfigurationItem]) (Maybe [ConfigurationItem]))
-> GetResourceConfigHistoryResponse
-> Const
(First [ConfigurationItem]) GetResourceConfigHistoryResponse
Lens' GetResourceConfigHistoryResponse (Maybe [ConfigurationItem])
getResourceConfigHistoryResponse_configurationItems
((Maybe [ConfigurationItem]
-> Const (First [ConfigurationItem]) (Maybe [ConfigurationItem]))
-> GetResourceConfigHistoryResponse
-> Const
(First [ConfigurationItem]) GetResourceConfigHistoryResponse)
-> (([ConfigurationItem]
-> Const (First [ConfigurationItem]) [ConfigurationItem])
-> Maybe [ConfigurationItem]
-> Const (First [ConfigurationItem]) (Maybe [ConfigurationItem]))
-> Getting
(First [ConfigurationItem])
GetResourceConfigHistoryResponse
[ConfigurationItem]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ConfigurationItem]
-> Const (First [ConfigurationItem]) [ConfigurationItem])
-> Maybe [ConfigurationItem]
-> Const (First [ConfigurationItem]) (Maybe [ConfigurationItem])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe GetResourceConfigHistory
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
GetResourceConfigHistory -> Maybe GetResourceConfigHistory
forall a. a -> Maybe a
Prelude.Just (GetResourceConfigHistory -> Maybe GetResourceConfigHistory)
-> GetResourceConfigHistory -> Maybe GetResourceConfigHistory
forall a b. (a -> b) -> a -> b
Prelude.$
GetResourceConfigHistory
rq
GetResourceConfigHistory
-> (GetResourceConfigHistory -> GetResourceConfigHistory)
-> GetResourceConfigHistory
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetResourceConfigHistory -> Identity GetResourceConfigHistory
Lens
GetResourceConfigHistory
GetResourceConfigHistory
(Maybe Text)
(Maybe Text)
getResourceConfigHistory_nextToken
((Maybe Text -> Identity (Maybe Text))
-> GetResourceConfigHistory -> Identity GetResourceConfigHistory)
-> Maybe Text
-> GetResourceConfigHistory
-> GetResourceConfigHistory
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetResourceConfigHistory
GetResourceConfigHistoryResponse
rs
GetResourceConfigHistoryResponse
-> Getting (First Text) GetResourceConfigHistoryResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetResourceConfigHistoryResponse
-> Const (First Text) GetResourceConfigHistoryResponse
Lens' GetResourceConfigHistoryResponse (Maybe Text)
getResourceConfigHistoryResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> GetResourceConfigHistoryResponse
-> Const (First Text) GetResourceConfigHistoryResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetResourceConfigHistoryResponse 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 GetResourceConfigHistory where
type
AWSResponse GetResourceConfigHistory =
GetResourceConfigHistoryResponse
request :: GetResourceConfigHistory -> Request GetResourceConfigHistory
request = Service
-> GetResourceConfigHistory -> Request GetResourceConfigHistory
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetResourceConfigHistory
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetResourceConfigHistory)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetResourceConfigHistory))
-> Logger
-> Service
-> Proxy GetResourceConfigHistory
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetResourceConfigHistory)))
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 [ConfigurationItem]
-> Int
-> GetResourceConfigHistoryResponse
GetResourceConfigHistoryResponse'
(Maybe Text
-> Maybe [ConfigurationItem]
-> Int
-> GetResourceConfigHistoryResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe [ConfigurationItem]
-> Int -> GetResourceConfigHistoryResponse)
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
"nextToken")
Either
String
(Maybe [ConfigurationItem]
-> Int -> GetResourceConfigHistoryResponse)
-> Either String (Maybe [ConfigurationItem])
-> Either String (Int -> GetResourceConfigHistoryResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [ConfigurationItem]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"configurationItems"
Either String (Maybe (Maybe [ConfigurationItem]))
-> Maybe [ConfigurationItem]
-> Either String (Maybe [ConfigurationItem])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ConfigurationItem]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> GetResourceConfigHistoryResponse)
-> Either String Int
-> Either String GetResourceConfigHistoryResponse
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 GetResourceConfigHistory
instance Prelude.NFData GetResourceConfigHistory
instance Core.ToHeaders GetResourceConfigHistory where
toHeaders :: GetResourceConfigHistory -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetResourceConfigHistory -> 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
"StarlingDoveService.GetResourceConfigHistory" ::
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 GetResourceConfigHistory where
toJSON :: GetResourceConfigHistory -> Value
toJSON GetResourceConfigHistory' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe ChronologicalOrder
Text
ResourceType
resourceId :: Text
resourceType :: ResourceType
earlierTime :: Maybe POSIX
laterTime :: Maybe POSIX
limit :: Maybe Natural
nextToken :: Maybe Text
chronologicalOrder :: Maybe ChronologicalOrder
$sel:resourceId:GetResourceConfigHistory' :: GetResourceConfigHistory -> Text
$sel:resourceType:GetResourceConfigHistory' :: GetResourceConfigHistory -> ResourceType
$sel:earlierTime:GetResourceConfigHistory' :: GetResourceConfigHistory -> Maybe POSIX
$sel:laterTime:GetResourceConfigHistory' :: GetResourceConfigHistory -> Maybe POSIX
$sel:limit:GetResourceConfigHistory' :: GetResourceConfigHistory -> Maybe Natural
$sel:nextToken:GetResourceConfigHistory' :: GetResourceConfigHistory -> Maybe Text
$sel:chronologicalOrder:GetResourceConfigHistory' :: GetResourceConfigHistory -> Maybe ChronologicalOrder
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"chronologicalOrder" Text -> ChronologicalOrder -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ChronologicalOrder -> Pair)
-> Maybe ChronologicalOrder -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ChronologicalOrder
chronologicalOrder,
(Text
"nextToken" 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
nextToken,
(Text
"limit" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit,
(Text
"laterTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
laterTime,
(Text
"earlierTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
earlierTime,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"resourceType" Text -> ResourceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ResourceType
resourceType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"resourceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceId)
]
)
instance Core.ToPath GetResourceConfigHistory where
toPath :: GetResourceConfigHistory -> ByteString
toPath = ByteString -> GetResourceConfigHistory -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetResourceConfigHistory where
toQuery :: GetResourceConfigHistory -> QueryString
toQuery = QueryString -> GetResourceConfigHistory -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetResourceConfigHistoryResponse = GetResourceConfigHistoryResponse'
{
GetResourceConfigHistoryResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
GetResourceConfigHistoryResponse -> Maybe [ConfigurationItem]
configurationItems :: Prelude.Maybe [ConfigurationItem],
GetResourceConfigHistoryResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetResourceConfigHistoryResponse
-> GetResourceConfigHistoryResponse -> Bool
(GetResourceConfigHistoryResponse
-> GetResourceConfigHistoryResponse -> Bool)
-> (GetResourceConfigHistoryResponse
-> GetResourceConfigHistoryResponse -> Bool)
-> Eq GetResourceConfigHistoryResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetResourceConfigHistoryResponse
-> GetResourceConfigHistoryResponse -> Bool
$c/= :: GetResourceConfigHistoryResponse
-> GetResourceConfigHistoryResponse -> Bool
== :: GetResourceConfigHistoryResponse
-> GetResourceConfigHistoryResponse -> Bool
$c== :: GetResourceConfigHistoryResponse
-> GetResourceConfigHistoryResponse -> Bool
Prelude.Eq, ReadPrec [GetResourceConfigHistoryResponse]
ReadPrec GetResourceConfigHistoryResponse
Int -> ReadS GetResourceConfigHistoryResponse
ReadS [GetResourceConfigHistoryResponse]
(Int -> ReadS GetResourceConfigHistoryResponse)
-> ReadS [GetResourceConfigHistoryResponse]
-> ReadPrec GetResourceConfigHistoryResponse
-> ReadPrec [GetResourceConfigHistoryResponse]
-> Read GetResourceConfigHistoryResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetResourceConfigHistoryResponse]
$creadListPrec :: ReadPrec [GetResourceConfigHistoryResponse]
readPrec :: ReadPrec GetResourceConfigHistoryResponse
$creadPrec :: ReadPrec GetResourceConfigHistoryResponse
readList :: ReadS [GetResourceConfigHistoryResponse]
$creadList :: ReadS [GetResourceConfigHistoryResponse]
readsPrec :: Int -> ReadS GetResourceConfigHistoryResponse
$creadsPrec :: Int -> ReadS GetResourceConfigHistoryResponse
Prelude.Read, Int -> GetResourceConfigHistoryResponse -> ShowS
[GetResourceConfigHistoryResponse] -> ShowS
GetResourceConfigHistoryResponse -> String
(Int -> GetResourceConfigHistoryResponse -> ShowS)
-> (GetResourceConfigHistoryResponse -> String)
-> ([GetResourceConfigHistoryResponse] -> ShowS)
-> Show GetResourceConfigHistoryResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetResourceConfigHistoryResponse] -> ShowS
$cshowList :: [GetResourceConfigHistoryResponse] -> ShowS
show :: GetResourceConfigHistoryResponse -> String
$cshow :: GetResourceConfigHistoryResponse -> String
showsPrec :: Int -> GetResourceConfigHistoryResponse -> ShowS
$cshowsPrec :: Int -> GetResourceConfigHistoryResponse -> ShowS
Prelude.Show, (forall x.
GetResourceConfigHistoryResponse
-> Rep GetResourceConfigHistoryResponse x)
-> (forall x.
Rep GetResourceConfigHistoryResponse x
-> GetResourceConfigHistoryResponse)
-> Generic GetResourceConfigHistoryResponse
forall x.
Rep GetResourceConfigHistoryResponse x
-> GetResourceConfigHistoryResponse
forall x.
GetResourceConfigHistoryResponse
-> Rep GetResourceConfigHistoryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetResourceConfigHistoryResponse x
-> GetResourceConfigHistoryResponse
$cfrom :: forall x.
GetResourceConfigHistoryResponse
-> Rep GetResourceConfigHistoryResponse x
Prelude.Generic)
newGetResourceConfigHistoryResponse ::
Prelude.Int ->
GetResourceConfigHistoryResponse
newGetResourceConfigHistoryResponse :: Int -> GetResourceConfigHistoryResponse
newGetResourceConfigHistoryResponse Int
pHttpStatus_ =
GetResourceConfigHistoryResponse' :: Maybe Text
-> Maybe [ConfigurationItem]
-> Int
-> GetResourceConfigHistoryResponse
GetResourceConfigHistoryResponse'
{ $sel:nextToken:GetResourceConfigHistoryResponse' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:configurationItems:GetResourceConfigHistoryResponse' :: Maybe [ConfigurationItem]
configurationItems = Maybe [ConfigurationItem]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetResourceConfigHistoryResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getResourceConfigHistoryResponse_nextToken :: Lens.Lens' GetResourceConfigHistoryResponse (Prelude.Maybe Prelude.Text)
getResourceConfigHistoryResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetResourceConfigHistoryResponse
-> f GetResourceConfigHistoryResponse
getResourceConfigHistoryResponse_nextToken = (GetResourceConfigHistoryResponse -> Maybe Text)
-> (GetResourceConfigHistoryResponse
-> Maybe Text -> GetResourceConfigHistoryResponse)
-> Lens' GetResourceConfigHistoryResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourceConfigHistoryResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetResourceConfigHistoryResponse' :: GetResourceConfigHistoryResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetResourceConfigHistoryResponse
s@GetResourceConfigHistoryResponse' {} Maybe Text
a -> GetResourceConfigHistoryResponse
s {$sel:nextToken:GetResourceConfigHistoryResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetResourceConfigHistoryResponse)
getResourceConfigHistoryResponse_configurationItems :: Lens.Lens' GetResourceConfigHistoryResponse (Prelude.Maybe [ConfigurationItem])
getResourceConfigHistoryResponse_configurationItems :: (Maybe [ConfigurationItem] -> f (Maybe [ConfigurationItem]))
-> GetResourceConfigHistoryResponse
-> f GetResourceConfigHistoryResponse
getResourceConfigHistoryResponse_configurationItems = (GetResourceConfigHistoryResponse -> Maybe [ConfigurationItem])
-> (GetResourceConfigHistoryResponse
-> Maybe [ConfigurationItem] -> GetResourceConfigHistoryResponse)
-> Lens'
GetResourceConfigHistoryResponse (Maybe [ConfigurationItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourceConfigHistoryResponse' {Maybe [ConfigurationItem]
configurationItems :: Maybe [ConfigurationItem]
$sel:configurationItems:GetResourceConfigHistoryResponse' :: GetResourceConfigHistoryResponse -> Maybe [ConfigurationItem]
configurationItems} -> Maybe [ConfigurationItem]
configurationItems) (\s :: GetResourceConfigHistoryResponse
s@GetResourceConfigHistoryResponse' {} Maybe [ConfigurationItem]
a -> GetResourceConfigHistoryResponse
s {$sel:configurationItems:GetResourceConfigHistoryResponse' :: Maybe [ConfigurationItem]
configurationItems = Maybe [ConfigurationItem]
a} :: GetResourceConfigHistoryResponse) ((Maybe [ConfigurationItem] -> f (Maybe [ConfigurationItem]))
-> GetResourceConfigHistoryResponse
-> f GetResourceConfigHistoryResponse)
-> ((Maybe [ConfigurationItem] -> f (Maybe [ConfigurationItem]))
-> Maybe [ConfigurationItem] -> f (Maybe [ConfigurationItem]))
-> (Maybe [ConfigurationItem] -> f (Maybe [ConfigurationItem]))
-> GetResourceConfigHistoryResponse
-> f GetResourceConfigHistoryResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ConfigurationItem]
[ConfigurationItem]
[ConfigurationItem]
[ConfigurationItem]
-> Iso
(Maybe [ConfigurationItem])
(Maybe [ConfigurationItem])
(Maybe [ConfigurationItem])
(Maybe [ConfigurationItem])
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
[ConfigurationItem]
[ConfigurationItem]
[ConfigurationItem]
[ConfigurationItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getResourceConfigHistoryResponse_httpStatus :: Lens.Lens' GetResourceConfigHistoryResponse Prelude.Int
getResourceConfigHistoryResponse_httpStatus :: (Int -> f Int)
-> GetResourceConfigHistoryResponse
-> f GetResourceConfigHistoryResponse
getResourceConfigHistoryResponse_httpStatus = (GetResourceConfigHistoryResponse -> Int)
-> (GetResourceConfigHistoryResponse
-> Int -> GetResourceConfigHistoryResponse)
-> Lens
GetResourceConfigHistoryResponse
GetResourceConfigHistoryResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResourceConfigHistoryResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetResourceConfigHistoryResponse' :: GetResourceConfigHistoryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetResourceConfigHistoryResponse
s@GetResourceConfigHistoryResponse' {} Int
a -> GetResourceConfigHistoryResponse
s {$sel:httpStatus:GetResourceConfigHistoryResponse' :: Int
httpStatus = Int
a} :: GetResourceConfigHistoryResponse)
instance
Prelude.NFData
GetResourceConfigHistoryResponse