module Network.AWS.CognitoSync.SetIdentityPoolConfiguration
(
SetIdentityPoolConfiguration
, setIdentityPoolConfiguration
, sipcIdentityPoolId
, sipcPushSync
, SetIdentityPoolConfigurationResponse
, setIdentityPoolConfigurationResponse
, sipcrIdentityPoolId
, sipcrPushSync
) where
import Network.AWS.Prelude
import Network.AWS.Request.RestJSON
import Network.AWS.CognitoSync.Types
import qualified GHC.Exts
data SetIdentityPoolConfiguration = SetIdentityPoolConfiguration
{ _sipcIdentityPoolId :: Text
, _sipcPushSync :: Maybe PushSync
} deriving (Eq, Show)
setIdentityPoolConfiguration :: Text
-> SetIdentityPoolConfiguration
setIdentityPoolConfiguration p1 = SetIdentityPoolConfiguration
{ _sipcIdentityPoolId = p1
, _sipcPushSync = Nothing
}
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
{ _sipcrIdentityPoolId :: Maybe Text
, _sipcrPushSync :: Maybe PushSync
} deriving (Eq, Show)
setIdentityPoolConfigurationResponse :: SetIdentityPoolConfigurationResponse
setIdentityPoolConfigurationResponse = SetIdentityPoolConfigurationResponse
{ _sipcrIdentityPoolId = Nothing
, _sipcrPushSync = Nothing
}
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
]
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 .:? "IdentityPoolId"
<*> o .:? "PushSync"