module Network.AWS.CognitoIdentity.CreateIdentityPool
(
CreateIdentityPool
, createIdentityPool
, cipAllowUnauthenticatedIdentities
, cipDeveloperProviderName
, cipIdentityPoolName
, cipOpenIdConnectProviderARNs
, cipSupportedLoginProviders
, CreateIdentityPoolResponse
, createIdentityPoolResponse
, ciprAllowUnauthenticatedIdentities
, ciprDeveloperProviderName
, ciprIdentityPoolId
, ciprIdentityPoolName
, ciprOpenIdConnectProviderARNs
, ciprSupportedLoginProviders
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CognitoIdentity.Types
import qualified GHC.Exts
data CreateIdentityPool = CreateIdentityPool
{ _cipAllowUnauthenticatedIdentities :: Bool
, _cipDeveloperProviderName :: Maybe Text
, _cipIdentityPoolName :: Text
, _cipOpenIdConnectProviderARNs :: List "OpenIdConnectProviderARNs" Text
, _cipSupportedLoginProviders :: Map Text Text
} deriving (Eq, Show)
createIdentityPool :: Text
-> Bool
-> CreateIdentityPool
createIdentityPool p1 p2 = CreateIdentityPool
{ _cipIdentityPoolName = p1
, _cipAllowUnauthenticatedIdentities = p2
, _cipSupportedLoginProviders = mempty
, _cipDeveloperProviderName = Nothing
, _cipOpenIdConnectProviderARNs = mempty
}
cipAllowUnauthenticatedIdentities :: Lens' CreateIdentityPool Bool
cipAllowUnauthenticatedIdentities =
lens _cipAllowUnauthenticatedIdentities
(\s a -> s { _cipAllowUnauthenticatedIdentities = a })
cipDeveloperProviderName :: Lens' CreateIdentityPool (Maybe Text)
cipDeveloperProviderName =
lens _cipDeveloperProviderName
(\s a -> s { _cipDeveloperProviderName = a })
cipIdentityPoolName :: Lens' CreateIdentityPool Text
cipIdentityPoolName =
lens _cipIdentityPoolName (\s a -> s { _cipIdentityPoolName = a })
cipOpenIdConnectProviderARNs :: Lens' CreateIdentityPool [Text]
cipOpenIdConnectProviderARNs =
lens _cipOpenIdConnectProviderARNs
(\s a -> s { _cipOpenIdConnectProviderARNs = a })
. _List
cipSupportedLoginProviders :: Lens' CreateIdentityPool (HashMap Text Text)
cipSupportedLoginProviders =
lens _cipSupportedLoginProviders
(\s a -> s { _cipSupportedLoginProviders = a })
. _Map
data CreateIdentityPoolResponse = CreateIdentityPoolResponse
{ _ciprAllowUnauthenticatedIdentities :: Bool
, _ciprDeveloperProviderName :: Maybe Text
, _ciprIdentityPoolId :: Text
, _ciprIdentityPoolName :: Text
, _ciprOpenIdConnectProviderARNs :: List "OpenIdConnectProviderARNs" Text
, _ciprSupportedLoginProviders :: Map Text Text
} deriving (Eq, Show)
createIdentityPoolResponse :: Text
-> Text
-> Bool
-> CreateIdentityPoolResponse
createIdentityPoolResponse p1 p2 p3 = CreateIdentityPoolResponse
{ _ciprIdentityPoolId = p1
, _ciprIdentityPoolName = p2
, _ciprAllowUnauthenticatedIdentities = p3
, _ciprSupportedLoginProviders = mempty
, _ciprDeveloperProviderName = Nothing
, _ciprOpenIdConnectProviderARNs = mempty
}
ciprAllowUnauthenticatedIdentities :: Lens' CreateIdentityPoolResponse Bool
ciprAllowUnauthenticatedIdentities =
lens _ciprAllowUnauthenticatedIdentities
(\s a -> s { _ciprAllowUnauthenticatedIdentities = a })
ciprDeveloperProviderName :: Lens' CreateIdentityPoolResponse (Maybe Text)
ciprDeveloperProviderName =
lens _ciprDeveloperProviderName
(\s a -> s { _ciprDeveloperProviderName = a })
ciprIdentityPoolId :: Lens' CreateIdentityPoolResponse Text
ciprIdentityPoolId =
lens _ciprIdentityPoolId (\s a -> s { _ciprIdentityPoolId = a })
ciprIdentityPoolName :: Lens' CreateIdentityPoolResponse Text
ciprIdentityPoolName =
lens _ciprIdentityPoolName (\s a -> s { _ciprIdentityPoolName = a })
ciprOpenIdConnectProviderARNs :: Lens' CreateIdentityPoolResponse [Text]
ciprOpenIdConnectProviderARNs =
lens _ciprOpenIdConnectProviderARNs
(\s a -> s { _ciprOpenIdConnectProviderARNs = a })
. _List
ciprSupportedLoginProviders :: Lens' CreateIdentityPoolResponse (HashMap Text Text)
ciprSupportedLoginProviders =
lens _ciprSupportedLoginProviders
(\s a -> s { _ciprSupportedLoginProviders = a })
. _Map
instance ToPath CreateIdentityPool where
toPath = const "/"
instance ToQuery CreateIdentityPool where
toQuery = const mempty
instance ToHeaders CreateIdentityPool
instance ToJSON CreateIdentityPool where
toJSON CreateIdentityPool{..} = object
[ "IdentityPoolName" .= _cipIdentityPoolName
, "AllowUnauthenticatedIdentities" .= _cipAllowUnauthenticatedIdentities
, "SupportedLoginProviders" .= _cipSupportedLoginProviders
, "DeveloperProviderName" .= _cipDeveloperProviderName
, "OpenIdConnectProviderARNs" .= _cipOpenIdConnectProviderARNs
]
instance AWSRequest CreateIdentityPool where
type Sv CreateIdentityPool = CognitoIdentity
type Rs CreateIdentityPool = CreateIdentityPoolResponse
request = post "CreateIdentityPool"
response = jsonResponse
instance FromJSON CreateIdentityPoolResponse where
parseJSON = withObject "CreateIdentityPoolResponse" $ \o -> CreateIdentityPoolResponse
<$> o .: "AllowUnauthenticatedIdentities"
<*> o .:? "DeveloperProviderName"
<*> o .: "IdentityPoolId"
<*> o .: "IdentityPoolName"
<*> o .:? "OpenIdConnectProviderARNs" .!= mempty
<*> o .:? "SupportedLoginProviders" .!= mempty