{-# 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.CloudHSMv2.UntagResource
(
untagResource
, UntagResource
, urResourceId
, urTagKeyList
, untagResourceResponse
, UntagResourceResponse
, urrsResponseStatus
) where
import Network.AWS.CloudHSMv2.Types
import Network.AWS.CloudHSMv2.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UntagResource = UntagResource'
{ _urResourceId :: !Text
, _urTagKeyList :: !(List1 Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
untagResource
:: Text
-> NonEmpty Text
-> UntagResource
untagResource pResourceId_ pTagKeyList_ =
UntagResource'
{_urResourceId = pResourceId_, _urTagKeyList = _List1 # pTagKeyList_}
urResourceId :: Lens' UntagResource Text
urResourceId = lens _urResourceId (\ s a -> s{_urResourceId = a})
urTagKeyList :: Lens' UntagResource (NonEmpty Text)
urTagKeyList = lens _urTagKeyList (\ s a -> s{_urTagKeyList = a}) . _List1
instance AWSRequest UntagResource where
type Rs UntagResource = UntagResourceResponse
request = postJSON cloudHSMv2
response
= receiveEmpty
(\ s h x ->
UntagResourceResponse' <$> (pure (fromEnum s)))
instance Hashable UntagResource where
instance NFData UntagResource where
instance ToHeaders UntagResource where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("BaldrApiService.UntagResource" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UntagResource where
toJSON UntagResource'{..}
= object
(catMaybes
[Just ("ResourceId" .= _urResourceId),
Just ("TagKeyList" .= _urTagKeyList)])
instance ToPath UntagResource where
toPath = const "/"
instance ToQuery UntagResource where
toQuery = const mempty
newtype UntagResourceResponse = UntagResourceResponse'
{ _urrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
untagResourceResponse
:: Int
-> UntagResourceResponse
untagResourceResponse pResponseStatus_ =
UntagResourceResponse' {_urrsResponseStatus = pResponseStatus_}
urrsResponseStatus :: Lens' UntagResourceResponse Int
urrsResponseStatus = lens _urrsResponseStatus (\ s a -> s{_urrsResponseStatus = a})
instance NFData UntagResourceResponse where