{-# 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.CognitoSync.GetIdentityPoolConfiguration
(
GetIdentityPoolConfiguration (..),
newGetIdentityPoolConfiguration,
getIdentityPoolConfiguration_identityPoolId,
GetIdentityPoolConfigurationResponse (..),
newGetIdentityPoolConfigurationResponse,
getIdentityPoolConfigurationResponse_identityPoolId,
getIdentityPoolConfigurationResponse_cognitoStreams,
getIdentityPoolConfigurationResponse_pushSync,
getIdentityPoolConfigurationResponse_httpStatus,
)
where
import Amazonka.CognitoSync.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 GetIdentityPoolConfiguration = GetIdentityPoolConfiguration'
{
GetIdentityPoolConfiguration -> Text
identityPoolId :: Prelude.Text
}
deriving (GetIdentityPoolConfiguration
-> GetIdentityPoolConfiguration -> Bool
(GetIdentityPoolConfiguration
-> GetIdentityPoolConfiguration -> Bool)
-> (GetIdentityPoolConfiguration
-> GetIdentityPoolConfiguration -> Bool)
-> Eq GetIdentityPoolConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetIdentityPoolConfiguration
-> GetIdentityPoolConfiguration -> Bool
$c/= :: GetIdentityPoolConfiguration
-> GetIdentityPoolConfiguration -> Bool
== :: GetIdentityPoolConfiguration
-> GetIdentityPoolConfiguration -> Bool
$c== :: GetIdentityPoolConfiguration
-> GetIdentityPoolConfiguration -> Bool
Prelude.Eq, ReadPrec [GetIdentityPoolConfiguration]
ReadPrec GetIdentityPoolConfiguration
Int -> ReadS GetIdentityPoolConfiguration
ReadS [GetIdentityPoolConfiguration]
(Int -> ReadS GetIdentityPoolConfiguration)
-> ReadS [GetIdentityPoolConfiguration]
-> ReadPrec GetIdentityPoolConfiguration
-> ReadPrec [GetIdentityPoolConfiguration]
-> Read GetIdentityPoolConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetIdentityPoolConfiguration]
$creadListPrec :: ReadPrec [GetIdentityPoolConfiguration]
readPrec :: ReadPrec GetIdentityPoolConfiguration
$creadPrec :: ReadPrec GetIdentityPoolConfiguration
readList :: ReadS [GetIdentityPoolConfiguration]
$creadList :: ReadS [GetIdentityPoolConfiguration]
readsPrec :: Int -> ReadS GetIdentityPoolConfiguration
$creadsPrec :: Int -> ReadS GetIdentityPoolConfiguration
Prelude.Read, Int -> GetIdentityPoolConfiguration -> ShowS
[GetIdentityPoolConfiguration] -> ShowS
GetIdentityPoolConfiguration -> String
(Int -> GetIdentityPoolConfiguration -> ShowS)
-> (GetIdentityPoolConfiguration -> String)
-> ([GetIdentityPoolConfiguration] -> ShowS)
-> Show GetIdentityPoolConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetIdentityPoolConfiguration] -> ShowS
$cshowList :: [GetIdentityPoolConfiguration] -> ShowS
show :: GetIdentityPoolConfiguration -> String
$cshow :: GetIdentityPoolConfiguration -> String
showsPrec :: Int -> GetIdentityPoolConfiguration -> ShowS
$cshowsPrec :: Int -> GetIdentityPoolConfiguration -> ShowS
Prelude.Show, (forall x.
GetIdentityPoolConfiguration -> Rep GetIdentityPoolConfiguration x)
-> (forall x.
Rep GetIdentityPoolConfiguration x -> GetIdentityPoolConfiguration)
-> Generic GetIdentityPoolConfiguration
forall x.
Rep GetIdentityPoolConfiguration x -> GetIdentityPoolConfiguration
forall x.
GetIdentityPoolConfiguration -> Rep GetIdentityPoolConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetIdentityPoolConfiguration x -> GetIdentityPoolConfiguration
$cfrom :: forall x.
GetIdentityPoolConfiguration -> Rep GetIdentityPoolConfiguration x
Prelude.Generic)
newGetIdentityPoolConfiguration ::
Prelude.Text ->
GetIdentityPoolConfiguration
newGetIdentityPoolConfiguration :: Text -> GetIdentityPoolConfiguration
newGetIdentityPoolConfiguration Text
pIdentityPoolId_ =
GetIdentityPoolConfiguration' :: Text -> GetIdentityPoolConfiguration
GetIdentityPoolConfiguration'
{ $sel:identityPoolId:GetIdentityPoolConfiguration' :: Text
identityPoolId =
Text
pIdentityPoolId_
}
getIdentityPoolConfiguration_identityPoolId :: Lens.Lens' GetIdentityPoolConfiguration Prelude.Text
getIdentityPoolConfiguration_identityPoolId :: (Text -> f Text)
-> GetIdentityPoolConfiguration -> f GetIdentityPoolConfiguration
getIdentityPoolConfiguration_identityPoolId = (GetIdentityPoolConfiguration -> Text)
-> (GetIdentityPoolConfiguration
-> Text -> GetIdentityPoolConfiguration)
-> Lens
GetIdentityPoolConfiguration GetIdentityPoolConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIdentityPoolConfiguration' {Text
identityPoolId :: Text
$sel:identityPoolId:GetIdentityPoolConfiguration' :: GetIdentityPoolConfiguration -> Text
identityPoolId} -> Text
identityPoolId) (\s :: GetIdentityPoolConfiguration
s@GetIdentityPoolConfiguration' {} Text
a -> GetIdentityPoolConfiguration
s {$sel:identityPoolId:GetIdentityPoolConfiguration' :: Text
identityPoolId = Text
a} :: GetIdentityPoolConfiguration)
instance Core.AWSRequest GetIdentityPoolConfiguration where
type
AWSResponse GetIdentityPoolConfiguration =
GetIdentityPoolConfigurationResponse
request :: GetIdentityPoolConfiguration
-> Request GetIdentityPoolConfiguration
request = Service
-> GetIdentityPoolConfiguration
-> Request GetIdentityPoolConfiguration
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetIdentityPoolConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetIdentityPoolConfiguration)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetIdentityPoolConfiguration))
-> Logger
-> Service
-> Proxy GetIdentityPoolConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetIdentityPoolConfiguration)))
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 CognitoStreams
-> Maybe PushSync
-> Int
-> GetIdentityPoolConfigurationResponse
GetIdentityPoolConfigurationResponse'
(Maybe Text
-> Maybe CognitoStreams
-> Maybe PushSync
-> Int
-> GetIdentityPoolConfigurationResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe CognitoStreams
-> Maybe PushSync -> Int -> GetIdentityPoolConfigurationResponse)
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
"IdentityPoolId")
Either
String
(Maybe CognitoStreams
-> Maybe PushSync -> Int -> GetIdentityPoolConfigurationResponse)
-> Either String (Maybe CognitoStreams)
-> Either
String
(Maybe PushSync -> Int -> GetIdentityPoolConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe CognitoStreams)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CognitoStreams")
Either
String
(Maybe PushSync -> Int -> GetIdentityPoolConfigurationResponse)
-> Either String (Maybe PushSync)
-> Either String (Int -> GetIdentityPoolConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe PushSync)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PushSync")
Either String (Int -> GetIdentityPoolConfigurationResponse)
-> Either String Int
-> Either String GetIdentityPoolConfigurationResponse
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
GetIdentityPoolConfiguration
instance Prelude.NFData GetIdentityPoolConfiguration
instance Core.ToHeaders GetIdentityPoolConfiguration where
toHeaders :: GetIdentityPoolConfiguration -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetIdentityPoolConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath GetIdentityPoolConfiguration where
toPath :: GetIdentityPoolConfiguration -> ByteString
toPath GetIdentityPoolConfiguration' {Text
identityPoolId :: Text
$sel:identityPoolId:GetIdentityPoolConfiguration' :: GetIdentityPoolConfiguration -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/identitypools/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
identityPoolId,
ByteString
"/configuration"
]
instance Core.ToQuery GetIdentityPoolConfiguration where
toQuery :: GetIdentityPoolConfiguration -> QueryString
toQuery = QueryString -> GetIdentityPoolConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetIdentityPoolConfigurationResponse = GetIdentityPoolConfigurationResponse'
{
GetIdentityPoolConfigurationResponse -> Maybe Text
identityPoolId :: Prelude.Maybe Prelude.Text,
GetIdentityPoolConfigurationResponse -> Maybe CognitoStreams
cognitoStreams :: Prelude.Maybe CognitoStreams,
GetIdentityPoolConfigurationResponse -> Maybe PushSync
pushSync :: Prelude.Maybe PushSync,
GetIdentityPoolConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetIdentityPoolConfigurationResponse
-> GetIdentityPoolConfigurationResponse -> Bool
(GetIdentityPoolConfigurationResponse
-> GetIdentityPoolConfigurationResponse -> Bool)
-> (GetIdentityPoolConfigurationResponse
-> GetIdentityPoolConfigurationResponse -> Bool)
-> Eq GetIdentityPoolConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetIdentityPoolConfigurationResponse
-> GetIdentityPoolConfigurationResponse -> Bool
$c/= :: GetIdentityPoolConfigurationResponse
-> GetIdentityPoolConfigurationResponse -> Bool
== :: GetIdentityPoolConfigurationResponse
-> GetIdentityPoolConfigurationResponse -> Bool
$c== :: GetIdentityPoolConfigurationResponse
-> GetIdentityPoolConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [GetIdentityPoolConfigurationResponse]
ReadPrec GetIdentityPoolConfigurationResponse
Int -> ReadS GetIdentityPoolConfigurationResponse
ReadS [GetIdentityPoolConfigurationResponse]
(Int -> ReadS GetIdentityPoolConfigurationResponse)
-> ReadS [GetIdentityPoolConfigurationResponse]
-> ReadPrec GetIdentityPoolConfigurationResponse
-> ReadPrec [GetIdentityPoolConfigurationResponse]
-> Read GetIdentityPoolConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetIdentityPoolConfigurationResponse]
$creadListPrec :: ReadPrec [GetIdentityPoolConfigurationResponse]
readPrec :: ReadPrec GetIdentityPoolConfigurationResponse
$creadPrec :: ReadPrec GetIdentityPoolConfigurationResponse
readList :: ReadS [GetIdentityPoolConfigurationResponse]
$creadList :: ReadS [GetIdentityPoolConfigurationResponse]
readsPrec :: Int -> ReadS GetIdentityPoolConfigurationResponse
$creadsPrec :: Int -> ReadS GetIdentityPoolConfigurationResponse
Prelude.Read, Int -> GetIdentityPoolConfigurationResponse -> ShowS
[GetIdentityPoolConfigurationResponse] -> ShowS
GetIdentityPoolConfigurationResponse -> String
(Int -> GetIdentityPoolConfigurationResponse -> ShowS)
-> (GetIdentityPoolConfigurationResponse -> String)
-> ([GetIdentityPoolConfigurationResponse] -> ShowS)
-> Show GetIdentityPoolConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetIdentityPoolConfigurationResponse] -> ShowS
$cshowList :: [GetIdentityPoolConfigurationResponse] -> ShowS
show :: GetIdentityPoolConfigurationResponse -> String
$cshow :: GetIdentityPoolConfigurationResponse -> String
showsPrec :: Int -> GetIdentityPoolConfigurationResponse -> ShowS
$cshowsPrec :: Int -> GetIdentityPoolConfigurationResponse -> ShowS
Prelude.Show, (forall x.
GetIdentityPoolConfigurationResponse
-> Rep GetIdentityPoolConfigurationResponse x)
-> (forall x.
Rep GetIdentityPoolConfigurationResponse x
-> GetIdentityPoolConfigurationResponse)
-> Generic GetIdentityPoolConfigurationResponse
forall x.
Rep GetIdentityPoolConfigurationResponse x
-> GetIdentityPoolConfigurationResponse
forall x.
GetIdentityPoolConfigurationResponse
-> Rep GetIdentityPoolConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetIdentityPoolConfigurationResponse x
-> GetIdentityPoolConfigurationResponse
$cfrom :: forall x.
GetIdentityPoolConfigurationResponse
-> Rep GetIdentityPoolConfigurationResponse x
Prelude.Generic)
newGetIdentityPoolConfigurationResponse ::
Prelude.Int ->
GetIdentityPoolConfigurationResponse
newGetIdentityPoolConfigurationResponse :: Int -> GetIdentityPoolConfigurationResponse
newGetIdentityPoolConfigurationResponse Int
pHttpStatus_ =
GetIdentityPoolConfigurationResponse' :: Maybe Text
-> Maybe CognitoStreams
-> Maybe PushSync
-> Int
-> GetIdentityPoolConfigurationResponse
GetIdentityPoolConfigurationResponse'
{ $sel:identityPoolId:GetIdentityPoolConfigurationResponse' :: Maybe Text
identityPoolId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:cognitoStreams:GetIdentityPoolConfigurationResponse' :: Maybe CognitoStreams
cognitoStreams = Maybe CognitoStreams
forall a. Maybe a
Prelude.Nothing,
$sel:pushSync:GetIdentityPoolConfigurationResponse' :: Maybe PushSync
pushSync = Maybe PushSync
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetIdentityPoolConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getIdentityPoolConfigurationResponse_identityPoolId :: Lens.Lens' GetIdentityPoolConfigurationResponse (Prelude.Maybe Prelude.Text)
getIdentityPoolConfigurationResponse_identityPoolId :: (Maybe Text -> f (Maybe Text))
-> GetIdentityPoolConfigurationResponse
-> f GetIdentityPoolConfigurationResponse
getIdentityPoolConfigurationResponse_identityPoolId = (GetIdentityPoolConfigurationResponse -> Maybe Text)
-> (GetIdentityPoolConfigurationResponse
-> Maybe Text -> GetIdentityPoolConfigurationResponse)
-> Lens
GetIdentityPoolConfigurationResponse
GetIdentityPoolConfigurationResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIdentityPoolConfigurationResponse' {Maybe Text
identityPoolId :: Maybe Text
$sel:identityPoolId:GetIdentityPoolConfigurationResponse' :: GetIdentityPoolConfigurationResponse -> Maybe Text
identityPoolId} -> Maybe Text
identityPoolId) (\s :: GetIdentityPoolConfigurationResponse
s@GetIdentityPoolConfigurationResponse' {} Maybe Text
a -> GetIdentityPoolConfigurationResponse
s {$sel:identityPoolId:GetIdentityPoolConfigurationResponse' :: Maybe Text
identityPoolId = Maybe Text
a} :: GetIdentityPoolConfigurationResponse)
getIdentityPoolConfigurationResponse_cognitoStreams :: Lens.Lens' GetIdentityPoolConfigurationResponse (Prelude.Maybe CognitoStreams)
getIdentityPoolConfigurationResponse_cognitoStreams :: (Maybe CognitoStreams -> f (Maybe CognitoStreams))
-> GetIdentityPoolConfigurationResponse
-> f GetIdentityPoolConfigurationResponse
getIdentityPoolConfigurationResponse_cognitoStreams = (GetIdentityPoolConfigurationResponse -> Maybe CognitoStreams)
-> (GetIdentityPoolConfigurationResponse
-> Maybe CognitoStreams -> GetIdentityPoolConfigurationResponse)
-> Lens
GetIdentityPoolConfigurationResponse
GetIdentityPoolConfigurationResponse
(Maybe CognitoStreams)
(Maybe CognitoStreams)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIdentityPoolConfigurationResponse' {Maybe CognitoStreams
cognitoStreams :: Maybe CognitoStreams
$sel:cognitoStreams:GetIdentityPoolConfigurationResponse' :: GetIdentityPoolConfigurationResponse -> Maybe CognitoStreams
cognitoStreams} -> Maybe CognitoStreams
cognitoStreams) (\s :: GetIdentityPoolConfigurationResponse
s@GetIdentityPoolConfigurationResponse' {} Maybe CognitoStreams
a -> GetIdentityPoolConfigurationResponse
s {$sel:cognitoStreams:GetIdentityPoolConfigurationResponse' :: Maybe CognitoStreams
cognitoStreams = Maybe CognitoStreams
a} :: GetIdentityPoolConfigurationResponse)
getIdentityPoolConfigurationResponse_pushSync :: Lens.Lens' GetIdentityPoolConfigurationResponse (Prelude.Maybe PushSync)
getIdentityPoolConfigurationResponse_pushSync :: (Maybe PushSync -> f (Maybe PushSync))
-> GetIdentityPoolConfigurationResponse
-> f GetIdentityPoolConfigurationResponse
getIdentityPoolConfigurationResponse_pushSync = (GetIdentityPoolConfigurationResponse -> Maybe PushSync)
-> (GetIdentityPoolConfigurationResponse
-> Maybe PushSync -> GetIdentityPoolConfigurationResponse)
-> Lens
GetIdentityPoolConfigurationResponse
GetIdentityPoolConfigurationResponse
(Maybe PushSync)
(Maybe PushSync)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIdentityPoolConfigurationResponse' {Maybe PushSync
pushSync :: Maybe PushSync
$sel:pushSync:GetIdentityPoolConfigurationResponse' :: GetIdentityPoolConfigurationResponse -> Maybe PushSync
pushSync} -> Maybe PushSync
pushSync) (\s :: GetIdentityPoolConfigurationResponse
s@GetIdentityPoolConfigurationResponse' {} Maybe PushSync
a -> GetIdentityPoolConfigurationResponse
s {$sel:pushSync:GetIdentityPoolConfigurationResponse' :: Maybe PushSync
pushSync = Maybe PushSync
a} :: GetIdentityPoolConfigurationResponse)
getIdentityPoolConfigurationResponse_httpStatus :: Lens.Lens' GetIdentityPoolConfigurationResponse Prelude.Int
getIdentityPoolConfigurationResponse_httpStatus :: (Int -> f Int)
-> GetIdentityPoolConfigurationResponse
-> f GetIdentityPoolConfigurationResponse
getIdentityPoolConfigurationResponse_httpStatus = (GetIdentityPoolConfigurationResponse -> Int)
-> (GetIdentityPoolConfigurationResponse
-> Int -> GetIdentityPoolConfigurationResponse)
-> Lens
GetIdentityPoolConfigurationResponse
GetIdentityPoolConfigurationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIdentityPoolConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetIdentityPoolConfigurationResponse' :: GetIdentityPoolConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetIdentityPoolConfigurationResponse
s@GetIdentityPoolConfigurationResponse' {} Int
a -> GetIdentityPoolConfigurationResponse
s {$sel:httpStatus:GetIdentityPoolConfigurationResponse' :: Int
httpStatus = Int
a} :: GetIdentityPoolConfigurationResponse)
instance
Prelude.NFData
GetIdentityPoolConfigurationResponse