{-# 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.ResourceGroups.Untag
(
untag
, Untag
, uARN
, uKeys
, untagResponse
, UntagResponse
, ursARN
, ursKeys
, ursResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.ResourceGroups.Types
import Network.AWS.ResourceGroups.Types.Product
import Network.AWS.Response
data Untag = Untag'
{ _uARN :: !Text
, _uKeys :: ![Text]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
untag
:: Text
-> Untag
untag pARN_ = Untag' {_uARN = pARN_, _uKeys = mempty}
uARN :: Lens' Untag Text
uARN = lens _uARN (\ s a -> s{_uARN = a})
uKeys :: Lens' Untag [Text]
uKeys = lens _uKeys (\ s a -> s{_uKeys = a}) . _Coerce
instance AWSRequest Untag where
type Rs Untag = UntagResponse
request = patchJSON resourceGroups
response
= receiveJSON
(\ s h x ->
UntagResponse' <$>
(x .?> "Arn") <*> (x .?> "Keys" .!@ mempty) <*>
(pure (fromEnum s)))
instance Hashable Untag where
instance NFData Untag where
instance ToHeaders Untag where
toHeaders = const mempty
instance ToJSON Untag where
toJSON Untag'{..}
= object (catMaybes [Just ("Keys" .= _uKeys)])
instance ToPath Untag where
toPath Untag'{..}
= mconcat ["/resources/", toBS _uARN, "/tags"]
instance ToQuery Untag where
toQuery = const mempty
data UntagResponse = UntagResponse'
{ _ursARN :: !(Maybe Text)
, _ursKeys :: !(Maybe [Text])
, _ursResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
untagResponse
:: Int
-> UntagResponse
untagResponse pResponseStatus_ =
UntagResponse'
{ _ursARN = Nothing
, _ursKeys = Nothing
, _ursResponseStatus = pResponseStatus_
}
ursARN :: Lens' UntagResponse (Maybe Text)
ursARN = lens _ursARN (\ s a -> s{_ursARN = a})
ursKeys :: Lens' UntagResponse [Text]
ursKeys = lens _ursKeys (\ s a -> s{_ursKeys = a}) . _Default . _Coerce
ursResponseStatus :: Lens' UntagResponse Int
ursResponseStatus = lens _ursResponseStatus (\ s a -> s{_ursResponseStatus = a})
instance NFData UntagResponse where