module Network.AWS.CloudHSM.GetConfig
(
GetConfig
, getConfig
, gcClientArn
, gcClientVersion
, gcHapgList
, GetConfigResponse
, getConfigResponse
, gcrConfigCred
, gcrConfigFile
, gcrConfigType
) where
import Network.AWS.Data (Object)
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CloudHSM.Types
import qualified GHC.Exts
data GetConfig = GetConfig
{ _gcClientArn :: Text
, _gcClientVersion :: ClientVersion
, _gcHapgList :: List "HapgList" Text
} deriving (Eq, Read, Show)
getConfig :: Text
-> ClientVersion
-> GetConfig
getConfig p1 p2 = GetConfig
{ _gcClientArn = p1
, _gcClientVersion = p2
, _gcHapgList = mempty
}
gcClientArn :: Lens' GetConfig Text
gcClientArn = lens _gcClientArn (\s a -> s { _gcClientArn = a })
gcClientVersion :: Lens' GetConfig ClientVersion
gcClientVersion = lens _gcClientVersion (\s a -> s { _gcClientVersion = a })
gcHapgList :: Lens' GetConfig [Text]
gcHapgList = lens _gcHapgList (\s a -> s { _gcHapgList = a }) . _List
data GetConfigResponse = GetConfigResponse
{ _gcrConfigCred :: Maybe Text
, _gcrConfigFile :: Maybe Text
, _gcrConfigType :: Maybe Text
} deriving (Eq, Ord, Read, Show)
getConfigResponse :: GetConfigResponse
getConfigResponse = GetConfigResponse
{ _gcrConfigType = Nothing
, _gcrConfigFile = Nothing
, _gcrConfigCred = Nothing
}
gcrConfigCred :: Lens' GetConfigResponse (Maybe Text)
gcrConfigCred = lens _gcrConfigCred (\s a -> s { _gcrConfigCred = a })
gcrConfigFile :: Lens' GetConfigResponse (Maybe Text)
gcrConfigFile = lens _gcrConfigFile (\s a -> s { _gcrConfigFile = a })
gcrConfigType :: Lens' GetConfigResponse (Maybe Text)
gcrConfigType = lens _gcrConfigType (\s a -> s { _gcrConfigType = a })
instance ToPath GetConfig where
toPath = const "/"
instance ToQuery GetConfig where
toQuery = const mempty
instance ToHeaders GetConfig
instance ToJSON GetConfig where
toJSON GetConfig{..} = object
[ "ClientArn" .= _gcClientArn
, "ClientVersion" .= _gcClientVersion
, "HapgList" .= _gcHapgList
]
instance AWSRequest GetConfig where
type Sv GetConfig = CloudHSM
type Rs GetConfig = GetConfigResponse
request = post "GetConfig"
response = jsonResponse
instance FromJSON GetConfigResponse where
parseJSON = withObject "GetConfigResponse" $ \o -> GetConfigResponse
<$> o .:? "ConfigCred"
<*> o .:? "ConfigFile"
<*> o .:? "ConfigType"