module Network.AWS.KMS.GetKeyRotationStatus
(
GetKeyRotationStatus
, getKeyRotationStatus
, gkrsKeyId
, GetKeyRotationStatusResponse
, getKeyRotationStatusResponse
, gkrsrKeyRotationEnabled
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.KMS.Types
import qualified GHC.Exts
newtype GetKeyRotationStatus = GetKeyRotationStatus
{ _gkrsKeyId :: Text
} deriving (Eq, Ord, Show, Monoid, IsString)
getKeyRotationStatus :: Text
-> GetKeyRotationStatus
getKeyRotationStatus p1 = GetKeyRotationStatus
{ _gkrsKeyId = p1
}
gkrsKeyId :: Lens' GetKeyRotationStatus Text
gkrsKeyId = lens _gkrsKeyId (\s a -> s { _gkrsKeyId = a })
newtype GetKeyRotationStatusResponse = GetKeyRotationStatusResponse
{ _gkrsrKeyRotationEnabled :: Maybe Bool
} deriving (Eq, Ord, Show)
getKeyRotationStatusResponse :: GetKeyRotationStatusResponse
getKeyRotationStatusResponse = GetKeyRotationStatusResponse
{ _gkrsrKeyRotationEnabled = Nothing
}
gkrsrKeyRotationEnabled :: Lens' GetKeyRotationStatusResponse (Maybe Bool)
gkrsrKeyRotationEnabled =
lens _gkrsrKeyRotationEnabled (\s a -> s { _gkrsrKeyRotationEnabled = a })
instance ToPath GetKeyRotationStatus where
toPath = const "/"
instance ToQuery GetKeyRotationStatus where
toQuery = const mempty
instance ToHeaders GetKeyRotationStatus
instance ToJSON GetKeyRotationStatus where
toJSON GetKeyRotationStatus{..} = object
[ "KeyId" .= _gkrsKeyId
]
instance AWSRequest GetKeyRotationStatus where
type Sv GetKeyRotationStatus = KMS
type Rs GetKeyRotationStatus = GetKeyRotationStatusResponse
request = post "GetKeyRotationStatus"
response = jsonResponse
instance FromJSON GetKeyRotationStatusResponse where
parseJSON = withObject "GetKeyRotationStatusResponse" $ \o -> GetKeyRotationStatusResponse
<$> o .:? "KeyRotationEnabled"