{-# 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.DescribeProductView
(
describeProductView
, DescribeProductView
, dpvAcceptLanguage
, dpvId
, describeProductViewResponse
, DescribeProductViewResponse
, dpvrsProductViewSummary
, dpvrsProvisioningArtifacts
, dpvrsResponseStatus
) 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 DescribeProductView = DescribeProductView'
{ _dpvAcceptLanguage :: !(Maybe Text)
, _dpvId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeProductView
:: Text
-> DescribeProductView
describeProductView pId_ =
DescribeProductView'
{ _dpvAcceptLanguage = Nothing
, _dpvId = pId_
}
dpvAcceptLanguage :: Lens' DescribeProductView (Maybe Text)
dpvAcceptLanguage = lens _dpvAcceptLanguage (\ s a -> s{_dpvAcceptLanguage = a});
dpvId :: Lens' DescribeProductView Text
dpvId = lens _dpvId (\ s a -> s{_dpvId = a});
instance AWSRequest DescribeProductView where
type Rs DescribeProductView =
DescribeProductViewResponse
request = postJSON serviceCatalog
response
= receiveJSON
(\ s h x ->
DescribeProductViewResponse' <$>
(x .?> "ProductViewSummary") <*>
(x .?> "ProvisioningArtifacts" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable DescribeProductView
instance NFData DescribeProductView
instance ToHeaders DescribeProductView where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWS242ServiceCatalogService.DescribeProductView" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeProductView where
toJSON DescribeProductView'{..}
= object
(catMaybes
[("AcceptLanguage" .=) <$> _dpvAcceptLanguage,
Just ("Id" .= _dpvId)])
instance ToPath DescribeProductView where
toPath = const "/"
instance ToQuery DescribeProductView where
toQuery = const mempty
data DescribeProductViewResponse = DescribeProductViewResponse'
{ _dpvrsProductViewSummary :: !(Maybe ProductViewSummary)
, _dpvrsProvisioningArtifacts :: !(Maybe [ProvisioningArtifact])
, _dpvrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeProductViewResponse
:: Int
-> DescribeProductViewResponse
describeProductViewResponse pResponseStatus_ =
DescribeProductViewResponse'
{ _dpvrsProductViewSummary = Nothing
, _dpvrsProvisioningArtifacts = Nothing
, _dpvrsResponseStatus = pResponseStatus_
}
dpvrsProductViewSummary :: Lens' DescribeProductViewResponse (Maybe ProductViewSummary)
dpvrsProductViewSummary = lens _dpvrsProductViewSummary (\ s a -> s{_dpvrsProductViewSummary = a});
dpvrsProvisioningArtifacts :: Lens' DescribeProductViewResponse [ProvisioningArtifact]
dpvrsProvisioningArtifacts = lens _dpvrsProvisioningArtifacts (\ s a -> s{_dpvrsProvisioningArtifacts = a}) . _Default . _Coerce;
dpvrsResponseStatus :: Lens' DescribeProductViewResponse Int
dpvrsResponseStatus = lens _dpvrsResponseStatus (\ s a -> s{_dpvrsResponseStatus = a});
instance NFData DescribeProductViewResponse