module Network.AWS.ServiceCatalog.DescribeConstraint
(
describeConstraint
, DescribeConstraint
, dAcceptLanguage
, dId
, describeConstraintResponse
, DescribeConstraintResponse
, desrsStatus
, desrsConstraintDetail
, desrsConstraintParameters
, desrsResponseStatus
) 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 DescribeConstraint = DescribeConstraint'
{ _dAcceptLanguage :: !(Maybe Text)
, _dId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeConstraint
:: Text
-> DescribeConstraint
describeConstraint pId_ =
DescribeConstraint' {_dAcceptLanguage = Nothing, _dId = pId_}
dAcceptLanguage :: Lens' DescribeConstraint (Maybe Text)
dAcceptLanguage = lens _dAcceptLanguage (\ s a -> s{_dAcceptLanguage = a});
dId :: Lens' DescribeConstraint Text
dId = lens _dId (\ s a -> s{_dId = a});
instance AWSRequest DescribeConstraint where
type Rs DescribeConstraint =
DescribeConstraintResponse
request = postJSON serviceCatalog
response
= receiveJSON
(\ s h x ->
DescribeConstraintResponse' <$>
(x .?> "Status") <*> (x .?> "ConstraintDetail") <*>
(x .?> "ConstraintParameters")
<*> (pure (fromEnum s)))
instance Hashable DescribeConstraint where
instance NFData DescribeConstraint where
instance ToHeaders DescribeConstraint where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWS242ServiceCatalogService.DescribeConstraint" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeConstraint where
toJSON DescribeConstraint'{..}
= object
(catMaybes
[("AcceptLanguage" .=) <$> _dAcceptLanguage,
Just ("Id" .= _dId)])
instance ToPath DescribeConstraint where
toPath = const "/"
instance ToQuery DescribeConstraint where
toQuery = const mempty
data DescribeConstraintResponse = DescribeConstraintResponse'
{ _desrsStatus :: !(Maybe RequestStatus)
, _desrsConstraintDetail :: !(Maybe ConstraintDetail)
, _desrsConstraintParameters :: !(Maybe Text)
, _desrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeConstraintResponse
:: Int
-> DescribeConstraintResponse
describeConstraintResponse pResponseStatus_ =
DescribeConstraintResponse'
{ _desrsStatus = Nothing
, _desrsConstraintDetail = Nothing
, _desrsConstraintParameters = Nothing
, _desrsResponseStatus = pResponseStatus_
}
desrsStatus :: Lens' DescribeConstraintResponse (Maybe RequestStatus)
desrsStatus = lens _desrsStatus (\ s a -> s{_desrsStatus = a});
desrsConstraintDetail :: Lens' DescribeConstraintResponse (Maybe ConstraintDetail)
desrsConstraintDetail = lens _desrsConstraintDetail (\ s a -> s{_desrsConstraintDetail = a});
desrsConstraintParameters :: Lens' DescribeConstraintResponse (Maybe Text)
desrsConstraintParameters = lens _desrsConstraintParameters (\ s a -> s{_desrsConstraintParameters = a});
desrsResponseStatus :: Lens' DescribeConstraintResponse Int
desrsResponseStatus = lens _desrsResponseStatus (\ s a -> s{_desrsResponseStatus = a});
instance NFData DescribeConstraintResponse where