module Network.AWS.Config.DeliverConfigSnapshot
(
deliverConfigSnapshot
, DeliverConfigSnapshot
, dcsDeliveryChannelName
, deliverConfigSnapshotResponse
, DeliverConfigSnapshotResponse
, dcsrsConfigSnapshotId
, dcsrsResponseStatus
) 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 Rs DeliverConfigSnapshot =
DeliverConfigSnapshotResponse
request = postJSON config
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
(catMaybes
[Just
("deliveryChannelName" .= _dcsDeliveryChannelName)])
instance ToPath DeliverConfigSnapshot where
toPath = const "/"
instance ToQuery DeliverConfigSnapshot where
toQuery = const mempty
data DeliverConfigSnapshotResponse = DeliverConfigSnapshotResponse'
{ _dcsrsConfigSnapshotId :: !(Maybe Text)
, _dcsrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deliverConfigSnapshotResponse
:: Int
-> DeliverConfigSnapshotResponse
deliverConfigSnapshotResponse pResponseStatus_ =
DeliverConfigSnapshotResponse'
{ _dcsrsConfigSnapshotId = Nothing
, _dcsrsResponseStatus = pResponseStatus_
}
dcsrsConfigSnapshotId :: Lens' DeliverConfigSnapshotResponse (Maybe Text)
dcsrsConfigSnapshotId = lens _dcsrsConfigSnapshotId (\ s a -> s{_dcsrsConfigSnapshotId = a});
dcsrsResponseStatus :: Lens' DeliverConfigSnapshotResponse Int
dcsrsResponseStatus = lens _dcsrsResponseStatus (\ s a -> s{_dcsrsResponseStatus = a});