module Network.AWS.Config.DeliverConfigSnapshot
(
deliverConfigSnapshot
, DeliverConfigSnapshot
, dcsDeliveryChannelName
, deliverConfigSnapshotResponse
, DeliverConfigSnapshotResponse
, dcsrsConfigSnapshotId
, dcsrsStatus
) where
import Network.AWS.Config.Types
import Network.AWS.Config.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeliverConfigSnapshot = DeliverConfigSnapshot'
{ _dcsDeliveryChannelName :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deliverConfigSnapshot
:: Text
-> DeliverConfigSnapshot
deliverConfigSnapshot pDeliveryChannelName_ =
DeliverConfigSnapshot'
{ _dcsDeliveryChannelName = pDeliveryChannelName_
}
dcsDeliveryChannelName :: Lens' DeliverConfigSnapshot Text
dcsDeliveryChannelName = lens _dcsDeliveryChannelName (\ s a -> s{_dcsDeliveryChannelName = a});
instance AWSRequest DeliverConfigSnapshot where
type Sv DeliverConfigSnapshot = Config
type Rs DeliverConfigSnapshot =
DeliverConfigSnapshotResponse
request = postJSON
response
= receiveJSON
(\ s h x ->
DeliverConfigSnapshotResponse' <$>
(x .?> "configSnapshotId") <*> (pure (fromEnum s)))
instance ToHeaders DeliverConfigSnapshot where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StarlingDoveService.DeliverConfigSnapshot" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeliverConfigSnapshot where
toJSON DeliverConfigSnapshot'{..}
= object
["deliveryChannelName" .= _dcsDeliveryChannelName]
instance ToPath DeliverConfigSnapshot where
toPath = const "/"
instance ToQuery DeliverConfigSnapshot where
toQuery = const mempty
data DeliverConfigSnapshotResponse = DeliverConfigSnapshotResponse'
{ _dcsrsConfigSnapshotId :: !(Maybe Text)
, _dcsrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deliverConfigSnapshotResponse
:: Int
-> DeliverConfigSnapshotResponse
deliverConfigSnapshotResponse pStatus_ =
DeliverConfigSnapshotResponse'
{ _dcsrsConfigSnapshotId = Nothing
, _dcsrsStatus = pStatus_
}
dcsrsConfigSnapshotId :: Lens' DeliverConfigSnapshotResponse (Maybe Text)
dcsrsConfigSnapshotId = lens _dcsrsConfigSnapshotId (\ s a -> s{_dcsrsConfigSnapshotId = a});
dcsrsStatus :: Lens' DeliverConfigSnapshotResponse Int
dcsrsStatus = lens _dcsrsStatus (\ s a -> s{_dcsrsStatus = a});