{-# 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.CloudFront.TagResource
(
tagResource
, TagResource
, trResource
, trTags
, tagResourceResponse
, TagResourceResponse
) where
import Network.AWS.CloudFront.Types
import Network.AWS.CloudFront.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data TagResource = TagResource'
{ _trResource :: !Text
, _trTags :: !Tags
} deriving (Eq,Read,Show,Data,Typeable,Generic)
tagResource
:: Text
-> Tags
-> TagResource
tagResource pResource_ pTags_ =
TagResource'
{ _trResource = pResource_
, _trTags = pTags_
}
trResource :: Lens' TagResource Text
trResource = lens _trResource (\ s a -> s{_trResource = a});
trTags :: Lens' TagResource Tags
trTags = lens _trTags (\ s a -> s{_trTags = a});
instance AWSRequest TagResource where
type Rs TagResource = TagResourceResponse
request = postXML cloudFront
response = receiveNull TagResourceResponse'
instance Hashable TagResource
instance NFData TagResource
instance ToElement TagResource where
toElement
= mkElement
"{http://cloudfront.amazonaws.com/doc/2016-09-29/}Tags"
.
_trTags
instance ToHeaders TagResource where
toHeaders = const mempty
instance ToPath TagResource where
toPath = const "/2016-09-29/tagging"
instance ToQuery TagResource where
toQuery TagResource'{..}
= mconcat
["Resource" =: _trResource, "Operation=Tag"]
data TagResourceResponse =
TagResourceResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)
tagResourceResponse
:: TagResourceResponse
tagResourceResponse = TagResourceResponse'
instance NFData TagResourceResponse