{-# 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.UpdateTypedLinkFacet
(
updateTypedLinkFacet
, UpdateTypedLinkFacet
, utlfSchemaARN
, utlfName
, utlfAttributeUpdates
, utlfIdentityAttributeOrder
, updateTypedLinkFacetResponse
, UpdateTypedLinkFacetResponse
, utlfrsResponseStatus
) 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 UpdateTypedLinkFacet = UpdateTypedLinkFacet'
{ _utlfSchemaARN :: !Text
, _utlfName :: !Text
, _utlfAttributeUpdates :: ![TypedLinkFacetAttributeUpdate]
, _utlfIdentityAttributeOrder :: ![Text]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateTypedLinkFacet
:: Text
-> Text
-> UpdateTypedLinkFacet
updateTypedLinkFacet pSchemaARN_ pName_ =
UpdateTypedLinkFacet'
{ _utlfSchemaARN = pSchemaARN_
, _utlfName = pName_
, _utlfAttributeUpdates = mempty
, _utlfIdentityAttributeOrder = mempty
}
utlfSchemaARN :: Lens' UpdateTypedLinkFacet Text
utlfSchemaARN = lens _utlfSchemaARN (\ s a -> s{_utlfSchemaARN = a})
utlfName :: Lens' UpdateTypedLinkFacet Text
utlfName = lens _utlfName (\ s a -> s{_utlfName = a})
utlfAttributeUpdates :: Lens' UpdateTypedLinkFacet [TypedLinkFacetAttributeUpdate]
utlfAttributeUpdates = lens _utlfAttributeUpdates (\ s a -> s{_utlfAttributeUpdates = a}) . _Coerce
utlfIdentityAttributeOrder :: Lens' UpdateTypedLinkFacet [Text]
utlfIdentityAttributeOrder = lens _utlfIdentityAttributeOrder (\ s a -> s{_utlfIdentityAttributeOrder = a}) . _Coerce
instance AWSRequest UpdateTypedLinkFacet where
type Rs UpdateTypedLinkFacet =
UpdateTypedLinkFacetResponse
request = putJSON cloudDirectory
response
= receiveEmpty
(\ s h x ->
UpdateTypedLinkFacetResponse' <$>
(pure (fromEnum s)))
instance Hashable UpdateTypedLinkFacet where
instance NFData UpdateTypedLinkFacet where
instance ToHeaders UpdateTypedLinkFacet where
toHeaders UpdateTypedLinkFacet'{..}
= mconcat ["x-amz-data-partition" =# _utlfSchemaARN]
instance ToJSON UpdateTypedLinkFacet where
toJSON UpdateTypedLinkFacet'{..}
= object
(catMaybes
[Just ("Name" .= _utlfName),
Just ("AttributeUpdates" .= _utlfAttributeUpdates),
Just
("IdentityAttributeOrder" .=
_utlfIdentityAttributeOrder)])
instance ToPath UpdateTypedLinkFacet where
toPath
= const
"/amazonclouddirectory/2017-01-11/typedlink/facet"
instance ToQuery UpdateTypedLinkFacet where
toQuery = const mempty
newtype UpdateTypedLinkFacetResponse = UpdateTypedLinkFacetResponse'
{ _utlfrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateTypedLinkFacetResponse
:: Int
-> UpdateTypedLinkFacetResponse
updateTypedLinkFacetResponse pResponseStatus_ =
UpdateTypedLinkFacetResponse' {_utlfrsResponseStatus = pResponseStatus_}
utlfrsResponseStatus :: Lens' UpdateTypedLinkFacetResponse Int
utlfrsResponseStatus = lens _utlfrsResponseStatus (\ s a -> s{_utlfrsResponseStatus = a})
instance NFData UpdateTypedLinkFacetResponse where