module Network.AWS.CognitoSync.SetIdentityPoolConfiguration
(
SetIdentityPoolConfiguration
, setIdentityPoolConfiguration
, sipcCognitoStreams
, sipcIdentityPoolId
, sipcPushSync
, SetIdentityPoolConfigurationResponse
, setIdentityPoolConfigurationResponse
, sipcrCognitoStreams
, sipcrIdentityPoolId
, sipcrPushSync
) where
import Network.AWS.Data (Object)
import Network.AWS.Prelude
import Network.AWS.Request.RestJSON
import Network.AWS.CognitoSync.Types
import qualified GHC.Exts
data SetIdentityPoolConfiguration = SetIdentityPoolConfiguration
{ _sipcCognitoStreams :: Maybe CognitoStreams
, _sipcIdentityPoolId :: Text
, _sipcPushSync :: Maybe PushSync
} deriving (Eq, Read, Show)
setIdentityPoolConfiguration :: Text
-> SetIdentityPoolConfiguration
setIdentityPoolConfiguration p1 = SetIdentityPoolConfiguration
{ _sipcIdentityPoolId = p1
, _sipcPushSync = Nothing
, _sipcCognitoStreams = Nothing
}
sipcCognitoStreams :: Lens' SetIdentityPoolConfiguration (Maybe CognitoStreams)
sipcCognitoStreams =
lens _sipcCognitoStreams (\s a -> s { _sipcCognitoStreams = a })
sipcIdentityPoolId :: Lens' SetIdentityPoolConfiguration Text
sipcIdentityPoolId =
lens _sipcIdentityPoolId (\s a -> s { _sipcIdentityPoolId = a })
sipcPushSync :: Lens' SetIdentityPoolConfiguration (Maybe PushSync)
sipcPushSync = lens _sipcPushSync (\s a -> s { _sipcPushSync = a })
data SetIdentityPoolConfigurationResponse = SetIdentityPoolConfigurationResponse
{ _sipcrCognitoStreams :: Maybe CognitoStreams
, _sipcrIdentityPoolId :: Maybe Text
, _sipcrPushSync :: Maybe PushSync
} deriving (Eq, Read, Show)
setIdentityPoolConfigurationResponse :: SetIdentityPoolConfigurationResponse
setIdentityPoolConfigurationResponse = SetIdentityPoolConfigurationResponse
{ _sipcrIdentityPoolId = Nothing
, _sipcrPushSync = Nothing
, _sipcrCognitoStreams = Nothing
}
sipcrCognitoStreams :: Lens' SetIdentityPoolConfigurationResponse (Maybe CognitoStreams)
sipcrCognitoStreams =
lens _sipcrCognitoStreams (\s a -> s { _sipcrCognitoStreams = a })
sipcrIdentityPoolId :: Lens' SetIdentityPoolConfigurationResponse (Maybe Text)
sipcrIdentityPoolId =
lens _sipcrIdentityPoolId (\s a -> s { _sipcrIdentityPoolId = a })
sipcrPushSync :: Lens' SetIdentityPoolConfigurationResponse (Maybe PushSync)
sipcrPushSync = lens _sipcrPushSync (\s a -> s { _sipcrPushSync = a })
instance ToPath SetIdentityPoolConfiguration where
toPath SetIdentityPoolConfiguration{..} = mconcat
[ "/identitypools/"
, toText _sipcIdentityPoolId
, "/configuration"
]
instance ToQuery SetIdentityPoolConfiguration where
toQuery = const mempty
instance ToHeaders SetIdentityPoolConfiguration
instance ToJSON SetIdentityPoolConfiguration where
toJSON SetIdentityPoolConfiguration{..} = object
[ "PushSync" .= _sipcPushSync
, "CognitoStreams" .= _sipcCognitoStreams
]
instance AWSRequest SetIdentityPoolConfiguration where
type Sv SetIdentityPoolConfiguration = CognitoSync
type Rs SetIdentityPoolConfiguration = SetIdentityPoolConfigurationResponse
request = post
response = jsonResponse
instance FromJSON SetIdentityPoolConfigurationResponse where
parseJSON = withObject "SetIdentityPoolConfigurationResponse" $ \o -> SetIdentityPoolConfigurationResponse
<$> o .:? "CognitoStreams"
<*> o .:? "IdentityPoolId"
<*> o .:? "PushSync"