module Network.AWS.ServiceCatalog.DescribeTagOption
(
describeTagOption
, DescribeTagOption
, dtoId
, describeTagOptionResponse
, DescribeTagOptionResponse
, dtorsTagOptionDetail
, dtorsResponseStatus
) 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
newtype DescribeTagOption = DescribeTagOption'
{ _dtoId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeTagOption
:: Text
-> DescribeTagOption
describeTagOption pId_ = DescribeTagOption' {_dtoId = pId_}
dtoId :: Lens' DescribeTagOption Text
dtoId = lens _dtoId (\ s a -> s{_dtoId = a});
instance AWSRequest DescribeTagOption where
type Rs DescribeTagOption = DescribeTagOptionResponse
request = postJSON serviceCatalog
response
= receiveJSON
(\ s h x ->
DescribeTagOptionResponse' <$>
(x .?> "TagOptionDetail") <*> (pure (fromEnum s)))
instance Hashable DescribeTagOption where
instance NFData DescribeTagOption where
instance ToHeaders DescribeTagOption where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWS242ServiceCatalogService.DescribeTagOption" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeTagOption where
toJSON DescribeTagOption'{..}
= object (catMaybes [Just ("Id" .= _dtoId)])
instance ToPath DescribeTagOption where
toPath = const "/"
instance ToQuery DescribeTagOption where
toQuery = const mempty
data DescribeTagOptionResponse = DescribeTagOptionResponse'
{ _dtorsTagOptionDetail :: !(Maybe TagOptionDetail)
, _dtorsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeTagOptionResponse
:: Int
-> DescribeTagOptionResponse
describeTagOptionResponse pResponseStatus_ =
DescribeTagOptionResponse'
{_dtorsTagOptionDetail = Nothing, _dtorsResponseStatus = pResponseStatus_}
dtorsTagOptionDetail :: Lens' DescribeTagOptionResponse (Maybe TagOptionDetail)
dtorsTagOptionDetail = lens _dtorsTagOptionDetail (\ s a -> s{_dtorsTagOptionDetail = a});
dtorsResponseStatus :: Lens' DescribeTagOptionResponse Int
dtorsResponseStatus = lens _dtorsResponseStatus (\ s a -> s{_dtorsResponseStatus = a});
instance NFData DescribeTagOptionResponse where