module Network.AWS.StorageGateway.UpdateChapCredentials
(
UpdateChapCredentials
, updateChapCredentials
, uccInitiatorName
, uccSecretToAuthenticateInitiator
, uccSecretToAuthenticateTarget
, uccTargetARN
, UpdateChapCredentialsResponse
, updateChapCredentialsResponse
, uccrInitiatorName
, uccrTargetARN
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.StorageGateway.Types
import qualified GHC.Exts
data UpdateChapCredentials = UpdateChapCredentials
{ _uccInitiatorName :: Text
, _uccSecretToAuthenticateInitiator :: Text
, _uccSecretToAuthenticateTarget :: Maybe Text
, _uccTargetARN :: Text
} deriving (Eq, Ord, Show)
updateChapCredentials :: Text
-> Text
-> Text
-> UpdateChapCredentials
updateChapCredentials p1 p2 p3 = UpdateChapCredentials
{ _uccTargetARN = p1
, _uccSecretToAuthenticateInitiator = p2
, _uccInitiatorName = p3
, _uccSecretToAuthenticateTarget = Nothing
}
uccInitiatorName :: Lens' UpdateChapCredentials Text
uccInitiatorName = lens _uccInitiatorName (\s a -> s { _uccInitiatorName = a })
uccSecretToAuthenticateInitiator :: Lens' UpdateChapCredentials Text
uccSecretToAuthenticateInitiator =
lens _uccSecretToAuthenticateInitiator
(\s a -> s { _uccSecretToAuthenticateInitiator = a })
uccSecretToAuthenticateTarget :: Lens' UpdateChapCredentials (Maybe Text)
uccSecretToAuthenticateTarget =
lens _uccSecretToAuthenticateTarget
(\s a -> s { _uccSecretToAuthenticateTarget = a })
uccTargetARN :: Lens' UpdateChapCredentials Text
uccTargetARN = lens _uccTargetARN (\s a -> s { _uccTargetARN = a })
data UpdateChapCredentialsResponse = UpdateChapCredentialsResponse
{ _uccrInitiatorName :: Maybe Text
, _uccrTargetARN :: Maybe Text
} deriving (Eq, Ord, Show)
updateChapCredentialsResponse :: UpdateChapCredentialsResponse
updateChapCredentialsResponse = UpdateChapCredentialsResponse
{ _uccrTargetARN = Nothing
, _uccrInitiatorName = Nothing
}
uccrInitiatorName :: Lens' UpdateChapCredentialsResponse (Maybe Text)
uccrInitiatorName =
lens _uccrInitiatorName (\s a -> s { _uccrInitiatorName = a })
uccrTargetARN :: Lens' UpdateChapCredentialsResponse (Maybe Text)
uccrTargetARN = lens _uccrTargetARN (\s a -> s { _uccrTargetARN = a })
instance ToPath UpdateChapCredentials where
toPath = const "/"
instance ToQuery UpdateChapCredentials where
toQuery = const mempty
instance ToHeaders UpdateChapCredentials
instance ToJSON UpdateChapCredentials where
toJSON UpdateChapCredentials{..} = object
[ "TargetARN" .= _uccTargetARN
, "SecretToAuthenticateInitiator" .= _uccSecretToAuthenticateInitiator
, "InitiatorName" .= _uccInitiatorName
, "SecretToAuthenticateTarget" .= _uccSecretToAuthenticateTarget
]
instance AWSRequest UpdateChapCredentials where
type Sv UpdateChapCredentials = StorageGateway
type Rs UpdateChapCredentials = UpdateChapCredentialsResponse
request = post "UpdateChapCredentials"
response = jsonResponse
instance FromJSON UpdateChapCredentialsResponse where
parseJSON = withObject "UpdateChapCredentialsResponse" $ \o -> UpdateChapCredentialsResponse
<$> o .:? "InitiatorName"
<*> o .:? "TargetARN"