{-# 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.DescribeProductAsAdmin
(
describeProductAsAdmin
, DescribeProductAsAdmin
, dpaaAcceptLanguage
, dpaaId
, describeProductAsAdminResponse
, DescribeProductAsAdminResponse
, dpaarsProductViewDetail
, dpaarsTags
, dpaarsResponseStatus
) 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 DescribeProductAsAdmin = DescribeProductAsAdmin'
{ _dpaaAcceptLanguage :: !(Maybe Text)
, _dpaaId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeProductAsAdmin
:: Text
-> DescribeProductAsAdmin
describeProductAsAdmin pId_ =
DescribeProductAsAdmin'
{ _dpaaAcceptLanguage = Nothing
, _dpaaId = pId_
}
dpaaAcceptLanguage :: Lens' DescribeProductAsAdmin (Maybe Text)
dpaaAcceptLanguage = lens _dpaaAcceptLanguage (\ s a -> s{_dpaaAcceptLanguage = a});
dpaaId :: Lens' DescribeProductAsAdmin Text
dpaaId = lens _dpaaId (\ s a -> s{_dpaaId = a});
instance AWSRequest DescribeProductAsAdmin where
type Rs DescribeProductAsAdmin =
DescribeProductAsAdminResponse
request = postJSON serviceCatalog
response
= receiveJSON
(\ s h x ->
DescribeProductAsAdminResponse' <$>
(x .?> "ProductViewDetail") <*>
(x .?> "Tags" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable DescribeProductAsAdmin
instance NFData DescribeProductAsAdmin
instance ToHeaders DescribeProductAsAdmin where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWS242ServiceCatalogService.DescribeProductAsAdmin"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeProductAsAdmin where
toJSON DescribeProductAsAdmin'{..}
= object
(catMaybes
[("AcceptLanguage" .=) <$> _dpaaAcceptLanguage,
Just ("Id" .= _dpaaId)])
instance ToPath DescribeProductAsAdmin where
toPath = const "/"
instance ToQuery DescribeProductAsAdmin where
toQuery = const mempty
data DescribeProductAsAdminResponse = DescribeProductAsAdminResponse'
{ _dpaarsProductViewDetail :: !(Maybe ProductViewDetail)
, _dpaarsTags :: !(Maybe [Tag])
, _dpaarsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeProductAsAdminResponse
:: Int
-> DescribeProductAsAdminResponse
describeProductAsAdminResponse pResponseStatus_ =
DescribeProductAsAdminResponse'
{ _dpaarsProductViewDetail = Nothing
, _dpaarsTags = Nothing
, _dpaarsResponseStatus = pResponseStatus_
}
dpaarsProductViewDetail :: Lens' DescribeProductAsAdminResponse (Maybe ProductViewDetail)
dpaarsProductViewDetail = lens _dpaarsProductViewDetail (\ s a -> s{_dpaarsProductViewDetail = a});
dpaarsTags :: Lens' DescribeProductAsAdminResponse [Tag]
dpaarsTags = lens _dpaarsTags (\ s a -> s{_dpaarsTags = a}) . _Default . _Coerce;
dpaarsResponseStatus :: Lens' DescribeProductAsAdminResponse Int
dpaarsResponseStatus = lens _dpaarsResponseStatus (\ s a -> s{_dpaarsResponseStatus = a});
instance NFData DescribeProductAsAdminResponse