module Network.AWS.Support.DescribeAttachment
(
describeAttachment
, DescribeAttachment
, daAttachmentId
, describeAttachmentResponse
, DescribeAttachmentResponse
, darsAttachment
, darsStatus
) where
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.Support.Types
import Network.AWS.Support.Types.Product
newtype DescribeAttachment = DescribeAttachment'
{ _daAttachmentId :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeAttachment
:: Text
-> DescribeAttachment
describeAttachment pAttachmentId_ =
DescribeAttachment'
{ _daAttachmentId = pAttachmentId_
}
daAttachmentId :: Lens' DescribeAttachment Text
daAttachmentId = lens _daAttachmentId (\ s a -> s{_daAttachmentId = a});
instance AWSRequest DescribeAttachment where
type Rs DescribeAttachment =
DescribeAttachmentResponse
request = postJSON support
response
= receiveJSON
(\ s h x ->
DescribeAttachmentResponse' <$>
(x .?> "attachment") <*> (pure (fromEnum s)))
instance ToHeaders DescribeAttachment where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSSupport_20130415.DescribeAttachment" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeAttachment where
toJSON DescribeAttachment'{..}
= object
(catMaybes
[Just ("attachmentId" .= _daAttachmentId)])
instance ToPath DescribeAttachment where
toPath = const "/"
instance ToQuery DescribeAttachment where
toQuery = const mempty
data DescribeAttachmentResponse = DescribeAttachmentResponse'
{ _darsAttachment :: !(Maybe Attachment)
, _darsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeAttachmentResponse
:: Int
-> DescribeAttachmentResponse
describeAttachmentResponse pStatus_ =
DescribeAttachmentResponse'
{ _darsAttachment = Nothing
, _darsStatus = pStatus_
}
darsAttachment :: Lens' DescribeAttachmentResponse (Maybe Attachment)
darsAttachment = lens _darsAttachment (\ s a -> s{_darsAttachment = a});
darsStatus :: Lens' DescribeAttachmentResponse Int
darsStatus = lens _darsStatus (\ s a -> s{_darsStatus = a});