{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.ServiceCatalog.DescribeRecord
(
describeRecord
, DescribeRecord
, drAcceptLanguage
, drPageToken
, drPageSize
, drId
, describeRecordResponse
, DescribeRecordResponse
, drrsRecordDetail
, drrsNextPageToken
, drrsRecordOutputs
, drrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.ServiceCatalog.Types
import Network.AWS.ServiceCatalog.Types.Product
data DescribeRecord = DescribeRecord'
{ _drAcceptLanguage :: !(Maybe Text)
, _drPageToken :: !(Maybe Text)
, _drPageSize :: !(Maybe Nat)
, _drId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeRecord
:: Text
-> DescribeRecord
describeRecord pId_ =
DescribeRecord'
{ _drAcceptLanguage = Nothing
, _drPageToken = Nothing
, _drPageSize = Nothing
, _drId = pId_
}
drAcceptLanguage :: Lens' DescribeRecord (Maybe Text)
drAcceptLanguage = lens _drAcceptLanguage (\ s a -> s{_drAcceptLanguage = a});
drPageToken :: Lens' DescribeRecord (Maybe Text)
drPageToken = lens _drPageToken (\ s a -> s{_drPageToken = a});
drPageSize :: Lens' DescribeRecord (Maybe Natural)
drPageSize = lens _drPageSize (\ s a -> s{_drPageSize = a}) . mapping _Nat;
drId :: Lens' DescribeRecord Text
drId = lens _drId (\ s a -> s{_drId = a});
instance AWSRequest DescribeRecord where
type Rs DescribeRecord = DescribeRecordResponse
request = postJSON serviceCatalog
response
= receiveJSON
(\ s h x ->
DescribeRecordResponse' <$>
(x .?> "RecordDetail") <*> (x .?> "NextPageToken")
<*> (x .?> "RecordOutputs" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable DescribeRecord
instance NFData DescribeRecord
instance ToHeaders DescribeRecord where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWS242ServiceCatalogService.DescribeRecord" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeRecord where
toJSON DescribeRecord'{..}
= object
(catMaybes
[("AcceptLanguage" .=) <$> _drAcceptLanguage,
("PageToken" .=) <$> _drPageToken,
("PageSize" .=) <$> _drPageSize,
Just ("Id" .= _drId)])
instance ToPath DescribeRecord where
toPath = const "/"
instance ToQuery DescribeRecord where
toQuery = const mempty
data DescribeRecordResponse = DescribeRecordResponse'
{ _drrsRecordDetail :: !(Maybe RecordDetail)
, _drrsNextPageToken :: !(Maybe Text)
, _drrsRecordOutputs :: !(Maybe [RecordOutput])
, _drrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeRecordResponse
:: Int
-> DescribeRecordResponse
describeRecordResponse pResponseStatus_ =
DescribeRecordResponse'
{ _drrsRecordDetail = Nothing
, _drrsNextPageToken = Nothing
, _drrsRecordOutputs = Nothing
, _drrsResponseStatus = pResponseStatus_
}
drrsRecordDetail :: Lens' DescribeRecordResponse (Maybe RecordDetail)
drrsRecordDetail = lens _drrsRecordDetail (\ s a -> s{_drrsRecordDetail = a});
drrsNextPageToken :: Lens' DescribeRecordResponse (Maybe Text)
drrsNextPageToken = lens _drrsNextPageToken (\ s a -> s{_drrsNextPageToken = a});
drrsRecordOutputs :: Lens' DescribeRecordResponse [RecordOutput]
drrsRecordOutputs = lens _drrsRecordOutputs (\ s a -> s{_drrsRecordOutputs = a}) . _Default . _Coerce;
drrsResponseStatus :: Lens' DescribeRecordResponse Int
drrsResponseStatus = lens _drrsResponseStatus (\ s a -> s{_drrsResponseStatus = a});
instance NFData DescribeRecordResponse