module Network.AWS.EC2.ConfirmProductInstance
(
ConfirmProductInstance
, confirmProductInstance
, cpiDryRun
, cpiInstanceId
, cpiProductCode
, ConfirmProductInstanceResponse
, confirmProductInstanceResponse
, cpirOwnerId
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.EC2.Types
import qualified GHC.Exts
data ConfirmProductInstance = ConfirmProductInstance
{ _cpiDryRun :: Maybe Bool
, _cpiInstanceId :: Text
, _cpiProductCode :: Text
} deriving (Eq, Ord, Show)
confirmProductInstance :: Text
-> Text
-> ConfirmProductInstance
confirmProductInstance p1 p2 = ConfirmProductInstance
{ _cpiProductCode = p1
, _cpiInstanceId = p2
, _cpiDryRun = Nothing
}
cpiDryRun :: Lens' ConfirmProductInstance (Maybe Bool)
cpiDryRun = lens _cpiDryRun (\s a -> s { _cpiDryRun = a })
cpiInstanceId :: Lens' ConfirmProductInstance Text
cpiInstanceId = lens _cpiInstanceId (\s a -> s { _cpiInstanceId = a })
cpiProductCode :: Lens' ConfirmProductInstance Text
cpiProductCode = lens _cpiProductCode (\s a -> s { _cpiProductCode = a })
newtype ConfirmProductInstanceResponse = ConfirmProductInstanceResponse
{ _cpirOwnerId :: Maybe Text
} deriving (Eq, Ord, Show, Monoid)
confirmProductInstanceResponse :: ConfirmProductInstanceResponse
confirmProductInstanceResponse = ConfirmProductInstanceResponse
{ _cpirOwnerId = Nothing
}
cpirOwnerId :: Lens' ConfirmProductInstanceResponse (Maybe Text)
cpirOwnerId = lens _cpirOwnerId (\s a -> s { _cpirOwnerId = a })
instance ToPath ConfirmProductInstance where
toPath = const "/"
instance ToQuery ConfirmProductInstance where
toQuery ConfirmProductInstance{..} = mconcat
[ "dryRun" =? _cpiDryRun
, "InstanceId" =? _cpiInstanceId
, "ProductCode" =? _cpiProductCode
]
instance ToHeaders ConfirmProductInstance
instance AWSRequest ConfirmProductInstance where
type Sv ConfirmProductInstance = EC2
type Rs ConfirmProductInstance = ConfirmProductInstanceResponse
request = post "ConfirmProductInstance"
response = xmlResponse
instance FromXML ConfirmProductInstanceResponse where
parseXML x = ConfirmProductInstanceResponse
<$> x .@? "ownerId"