module Network.AWS.EC2.ModifyReservedInstances
(
ModifyReservedInstances
, modifyReservedInstances
, mriClientToken
, mriReservedInstancesIds
, mriTargetConfigurations
, ModifyReservedInstancesResponse
, modifyReservedInstancesResponse
, mrirReservedInstancesModificationId
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.EC2.Types
import qualified GHC.Exts
data ModifyReservedInstances = ModifyReservedInstances
{ _mriClientToken :: Maybe Text
, _mriReservedInstancesIds :: List "ReservedInstancesId" Text
, _mriTargetConfigurations :: List "item" ReservedInstancesConfiguration
} deriving (Eq, Show)
modifyReservedInstances :: ModifyReservedInstances
modifyReservedInstances = ModifyReservedInstances
{ _mriClientToken = Nothing
, _mriReservedInstancesIds = mempty
, _mriTargetConfigurations = mempty
}
mriClientToken :: Lens' ModifyReservedInstances (Maybe Text)
mriClientToken = lens _mriClientToken (\s a -> s { _mriClientToken = a })
mriReservedInstancesIds :: Lens' ModifyReservedInstances [Text]
mriReservedInstancesIds =
lens _mriReservedInstancesIds (\s a -> s { _mriReservedInstancesIds = a })
. _List
mriTargetConfigurations :: Lens' ModifyReservedInstances [ReservedInstancesConfiguration]
mriTargetConfigurations =
lens _mriTargetConfigurations (\s a -> s { _mriTargetConfigurations = a })
. _List
newtype ModifyReservedInstancesResponse = ModifyReservedInstancesResponse
{ _mrirReservedInstancesModificationId :: Maybe Text
} deriving (Eq, Ord, Show, Monoid)
modifyReservedInstancesResponse :: ModifyReservedInstancesResponse
modifyReservedInstancesResponse = ModifyReservedInstancesResponse
{ _mrirReservedInstancesModificationId = Nothing
}
mrirReservedInstancesModificationId :: Lens' ModifyReservedInstancesResponse (Maybe Text)
mrirReservedInstancesModificationId =
lens _mrirReservedInstancesModificationId
(\s a -> s { _mrirReservedInstancesModificationId = a })
instance ToPath ModifyReservedInstances where
toPath = const "/"
instance ToQuery ModifyReservedInstances where
toQuery ModifyReservedInstances{..} = mconcat
[ "clientToken" =? _mriClientToken
, "ReservedInstancesId" `toQueryList` _mriReservedInstancesIds
, "ReservedInstancesConfigurationSetItemType" `toQueryList` _mriTargetConfigurations
]
instance ToHeaders ModifyReservedInstances
instance AWSRequest ModifyReservedInstances where
type Sv ModifyReservedInstances = EC2
type Rs ModifyReservedInstances = ModifyReservedInstancesResponse
request = post "ModifyReservedInstances"
response = xmlResponse
instance FromXML ModifyReservedInstancesResponse where
parseXML x = ModifyReservedInstancesResponse
<$> x .@? "reservedInstancesModificationId"