{-# 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.CloudDirectory.GetTypedLinkFacetInformation
(
getTypedLinkFacetInformation
, GetTypedLinkFacetInformation
, gtlfiSchemaARN
, gtlfiName
, getTypedLinkFacetInformationResponse
, GetTypedLinkFacetInformationResponse
, gtlfirsIdentityAttributeOrder
, gtlfirsResponseStatus
) where
import Network.AWS.CloudDirectory.Types
import Network.AWS.CloudDirectory.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data GetTypedLinkFacetInformation = GetTypedLinkFacetInformation'
{ _gtlfiSchemaARN :: !Text
, _gtlfiName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getTypedLinkFacetInformation
:: Text
-> Text
-> GetTypedLinkFacetInformation
getTypedLinkFacetInformation pSchemaARN_ pName_ =
GetTypedLinkFacetInformation'
{_gtlfiSchemaARN = pSchemaARN_, _gtlfiName = pName_}
gtlfiSchemaARN :: Lens' GetTypedLinkFacetInformation Text
gtlfiSchemaARN = lens _gtlfiSchemaARN (\ s a -> s{_gtlfiSchemaARN = a})
gtlfiName :: Lens' GetTypedLinkFacetInformation Text
gtlfiName = lens _gtlfiName (\ s a -> s{_gtlfiName = a})
instance AWSRequest GetTypedLinkFacetInformation
where
type Rs GetTypedLinkFacetInformation =
GetTypedLinkFacetInformationResponse
request = postJSON cloudDirectory
response
= receiveJSON
(\ s h x ->
GetTypedLinkFacetInformationResponse' <$>
(x .?> "IdentityAttributeOrder" .!@ mempty) <*>
(pure (fromEnum s)))
instance Hashable GetTypedLinkFacetInformation where
instance NFData GetTypedLinkFacetInformation where
instance ToHeaders GetTypedLinkFacetInformation where
toHeaders GetTypedLinkFacetInformation'{..}
= mconcat ["x-amz-data-partition" =# _gtlfiSchemaARN]
instance ToJSON GetTypedLinkFacetInformation where
toJSON GetTypedLinkFacetInformation'{..}
= object (catMaybes [Just ("Name" .= _gtlfiName)])
instance ToPath GetTypedLinkFacetInformation where
toPath
= const
"/amazonclouddirectory/2017-01-11/typedlink/facet/get"
instance ToQuery GetTypedLinkFacetInformation where
toQuery = const mempty
data GetTypedLinkFacetInformationResponse = GetTypedLinkFacetInformationResponse'
{ _gtlfirsIdentityAttributeOrder :: !(Maybe [Text])
, _gtlfirsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getTypedLinkFacetInformationResponse
:: Int
-> GetTypedLinkFacetInformationResponse
getTypedLinkFacetInformationResponse pResponseStatus_ =
GetTypedLinkFacetInformationResponse'
{ _gtlfirsIdentityAttributeOrder = Nothing
, _gtlfirsResponseStatus = pResponseStatus_
}
gtlfirsIdentityAttributeOrder :: Lens' GetTypedLinkFacetInformationResponse [Text]
gtlfirsIdentityAttributeOrder = lens _gtlfirsIdentityAttributeOrder (\ s a -> s{_gtlfirsIdentityAttributeOrder = a}) . _Default . _Coerce
gtlfirsResponseStatus :: Lens' GetTypedLinkFacetInformationResponse Int
gtlfirsResponseStatus = lens _gtlfirsResponseStatus (\ s a -> s{_gtlfirsResponseStatus = a})
instance NFData GetTypedLinkFacetInformationResponse
where