{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.AWS.CognitoIdentity.Types.Product where
import Network.AWS.CognitoIdentity.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
data CognitoIdentityProvider = CognitoIdentityProvider'
{ _cipClientId :: !(Maybe Text)
, _cipProviderName :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
cognitoIdentityProvider
:: CognitoIdentityProvider
cognitoIdentityProvider =
CognitoIdentityProvider'
{ _cipClientId = Nothing
, _cipProviderName = Nothing
}
cipClientId :: Lens' CognitoIdentityProvider (Maybe Text)
cipClientId = lens _cipClientId (\ s a -> s{_cipClientId = a});
cipProviderName :: Lens' CognitoIdentityProvider (Maybe Text)
cipProviderName = lens _cipProviderName (\ s a -> s{_cipProviderName = a});
instance FromJSON CognitoIdentityProvider where
parseJSON
= withObject "CognitoIdentityProvider"
(\ x ->
CognitoIdentityProvider' <$>
(x .:? "ClientId") <*> (x .:? "ProviderName"))
instance Hashable CognitoIdentityProvider
instance NFData CognitoIdentityProvider
instance ToJSON CognitoIdentityProvider where
toJSON CognitoIdentityProvider'{..}
= object
(catMaybes
[("ClientId" .=) <$> _cipClientId,
("ProviderName" .=) <$> _cipProviderName])
data Credentials = Credentials'
{ _cSessionToken :: !(Maybe Text)
, _cExpiration :: !(Maybe POSIX)
, _cSecretKey :: !(Maybe Text)
, _cAccessKeyId :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
credentials
:: Credentials
credentials =
Credentials'
{ _cSessionToken = Nothing
, _cExpiration = Nothing
, _cSecretKey = Nothing
, _cAccessKeyId = Nothing
}
cSessionToken :: Lens' Credentials (Maybe Text)
cSessionToken = lens _cSessionToken (\ s a -> s{_cSessionToken = a});
cExpiration :: Lens' Credentials (Maybe UTCTime)
cExpiration = lens _cExpiration (\ s a -> s{_cExpiration = a}) . mapping _Time;
cSecretKey :: Lens' Credentials (Maybe Text)
cSecretKey = lens _cSecretKey (\ s a -> s{_cSecretKey = a});
cAccessKeyId :: Lens' Credentials (Maybe Text)
cAccessKeyId = lens _cAccessKeyId (\ s a -> s{_cAccessKeyId = a});
instance FromJSON Credentials where
parseJSON
= withObject "Credentials"
(\ x ->
Credentials' <$>
(x .:? "SessionToken") <*> (x .:? "Expiration") <*>
(x .:? "SecretKey")
<*> (x .:? "AccessKeyId"))
instance Hashable Credentials
instance NFData Credentials
data IdentityDescription = IdentityDescription'
{ _idLastModifiedDate :: !(Maybe POSIX)
, _idCreationDate :: !(Maybe POSIX)
, _idLogins :: !(Maybe [Text])
, _idIdentityId :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
identityDescription
:: IdentityDescription
identityDescription =
IdentityDescription'
{ _idLastModifiedDate = Nothing
, _idCreationDate = Nothing
, _idLogins = Nothing
, _idIdentityId = Nothing
}
idLastModifiedDate :: Lens' IdentityDescription (Maybe UTCTime)
idLastModifiedDate = lens _idLastModifiedDate (\ s a -> s{_idLastModifiedDate = a}) . mapping _Time;
idCreationDate :: Lens' IdentityDescription (Maybe UTCTime)
idCreationDate = lens _idCreationDate (\ s a -> s{_idCreationDate = a}) . mapping _Time;
idLogins :: Lens' IdentityDescription [Text]
idLogins = lens _idLogins (\ s a -> s{_idLogins = a}) . _Default . _Coerce;
idIdentityId :: Lens' IdentityDescription (Maybe Text)
idIdentityId = lens _idIdentityId (\ s a -> s{_idIdentityId = a});
instance FromJSON IdentityDescription where
parseJSON
= withObject "IdentityDescription"
(\ x ->
IdentityDescription' <$>
(x .:? "LastModifiedDate") <*> (x .:? "CreationDate")
<*> (x .:? "Logins" .!= mempty)
<*> (x .:? "IdentityId"))
instance Hashable IdentityDescription
instance NFData IdentityDescription
data IdentityPool = IdentityPool'
{ _ipSamlProviderARNs :: !(Maybe [Text])
, _ipSupportedLoginProviders :: !(Maybe (Map Text Text))
, _ipDeveloperProviderName :: !(Maybe Text)
, _ipOpenIdConnectProviderARNs :: !(Maybe [Text])
, _ipCognitoIdentityProviders :: !(Maybe [CognitoIdentityProvider])
, _ipIdentityPoolId :: !Text
, _ipIdentityPoolName :: !Text
, _ipAllowUnauthenticatedIdentities :: !Bool
} deriving (Eq,Read,Show,Data,Typeable,Generic)
identityPool
:: Text
-> Text
-> Bool
-> IdentityPool
identityPool pIdentityPoolId_ pIdentityPoolName_ pAllowUnauthenticatedIdentities_ =
IdentityPool'
{ _ipSamlProviderARNs = Nothing
, _ipSupportedLoginProviders = Nothing
, _ipDeveloperProviderName = Nothing
, _ipOpenIdConnectProviderARNs = Nothing
, _ipCognitoIdentityProviders = Nothing
, _ipIdentityPoolId = pIdentityPoolId_
, _ipIdentityPoolName = pIdentityPoolName_
, _ipAllowUnauthenticatedIdentities = pAllowUnauthenticatedIdentities_
}
ipSamlProviderARNs :: Lens' IdentityPool [Text]
ipSamlProviderARNs = lens _ipSamlProviderARNs (\ s a -> s{_ipSamlProviderARNs = a}) . _Default . _Coerce;
ipSupportedLoginProviders :: Lens' IdentityPool (HashMap Text Text)
ipSupportedLoginProviders = lens _ipSupportedLoginProviders (\ s a -> s{_ipSupportedLoginProviders = a}) . _Default . _Map;
ipDeveloperProviderName :: Lens' IdentityPool (Maybe Text)
ipDeveloperProviderName = lens _ipDeveloperProviderName (\ s a -> s{_ipDeveloperProviderName = a});
ipOpenIdConnectProviderARNs :: Lens' IdentityPool [Text]
ipOpenIdConnectProviderARNs = lens _ipOpenIdConnectProviderARNs (\ s a -> s{_ipOpenIdConnectProviderARNs = a}) . _Default . _Coerce;
ipCognitoIdentityProviders :: Lens' IdentityPool [CognitoIdentityProvider]
ipCognitoIdentityProviders = lens _ipCognitoIdentityProviders (\ s a -> s{_ipCognitoIdentityProviders = a}) . _Default . _Coerce;
ipIdentityPoolId :: Lens' IdentityPool Text
ipIdentityPoolId = lens _ipIdentityPoolId (\ s a -> s{_ipIdentityPoolId = a});
ipIdentityPoolName :: Lens' IdentityPool Text
ipIdentityPoolName = lens _ipIdentityPoolName (\ s a -> s{_ipIdentityPoolName = a});
ipAllowUnauthenticatedIdentities :: Lens' IdentityPool Bool
ipAllowUnauthenticatedIdentities = lens _ipAllowUnauthenticatedIdentities (\ s a -> s{_ipAllowUnauthenticatedIdentities = a});
instance FromJSON IdentityPool where
parseJSON
= withObject "IdentityPool"
(\ x ->
IdentityPool' <$>
(x .:? "SamlProviderARNs" .!= mempty) <*>
(x .:? "SupportedLoginProviders" .!= mempty)
<*> (x .:? "DeveloperProviderName")
<*> (x .:? "OpenIdConnectProviderARNs" .!= mempty)
<*> (x .:? "CognitoIdentityProviders" .!= mempty)
<*> (x .: "IdentityPoolId")
<*> (x .: "IdentityPoolName")
<*> (x .: "AllowUnauthenticatedIdentities"))
instance Hashable IdentityPool
instance NFData IdentityPool
instance ToJSON IdentityPool where
toJSON IdentityPool'{..}
= object
(catMaybes
[("SamlProviderARNs" .=) <$> _ipSamlProviderARNs,
("SupportedLoginProviders" .=) <$>
_ipSupportedLoginProviders,
("DeveloperProviderName" .=) <$>
_ipDeveloperProviderName,
("OpenIdConnectProviderARNs" .=) <$>
_ipOpenIdConnectProviderARNs,
("CognitoIdentityProviders" .=) <$>
_ipCognitoIdentityProviders,
Just ("IdentityPoolId" .= _ipIdentityPoolId),
Just ("IdentityPoolName" .= _ipIdentityPoolName),
Just
("AllowUnauthenticatedIdentities" .=
_ipAllowUnauthenticatedIdentities)])
data IdentityPoolShortDescription = IdentityPoolShortDescription'
{ _ipsdIdentityPoolId :: !(Maybe Text)
, _ipsdIdentityPoolName :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
identityPoolShortDescription
:: IdentityPoolShortDescription
identityPoolShortDescription =
IdentityPoolShortDescription'
{ _ipsdIdentityPoolId = Nothing
, _ipsdIdentityPoolName = Nothing
}
ipsdIdentityPoolId :: Lens' IdentityPoolShortDescription (Maybe Text)
ipsdIdentityPoolId = lens _ipsdIdentityPoolId (\ s a -> s{_ipsdIdentityPoolId = a});
ipsdIdentityPoolName :: Lens' IdentityPoolShortDescription (Maybe Text)
ipsdIdentityPoolName = lens _ipsdIdentityPoolName (\ s a -> s{_ipsdIdentityPoolName = a});
instance FromJSON IdentityPoolShortDescription where
parseJSON
= withObject "IdentityPoolShortDescription"
(\ x ->
IdentityPoolShortDescription' <$>
(x .:? "IdentityPoolId") <*>
(x .:? "IdentityPoolName"))
instance Hashable IdentityPoolShortDescription
instance NFData IdentityPoolShortDescription
data UnprocessedIdentityId = UnprocessedIdentityId'
{ _uiiErrorCode :: !(Maybe CognitoErrorCode)
, _uiiIdentityId :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
unprocessedIdentityId
:: UnprocessedIdentityId
unprocessedIdentityId =
UnprocessedIdentityId'
{ _uiiErrorCode = Nothing
, _uiiIdentityId = Nothing
}
uiiErrorCode :: Lens' UnprocessedIdentityId (Maybe CognitoErrorCode)
uiiErrorCode = lens _uiiErrorCode (\ s a -> s{_uiiErrorCode = a});
uiiIdentityId :: Lens' UnprocessedIdentityId (Maybe Text)
uiiIdentityId = lens _uiiIdentityId (\ s a -> s{_uiiIdentityId = a});
instance FromJSON UnprocessedIdentityId where
parseJSON
= withObject "UnprocessedIdentityId"
(\ x ->
UnprocessedIdentityId' <$>
(x .:? "ErrorCode") <*> (x .:? "IdentityId"))
instance Hashable UnprocessedIdentityId
instance NFData UnprocessedIdentityId