{-# 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 #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Network.AWS.WorkSpaces.DescribeTags -- Copyright : (c) 2013-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Describes tags for a WorkSpace. -- -- module Network.AWS.WorkSpaces.DescribeTags ( -- * Creating a Request describeTags , DescribeTags -- * Request Lenses , dtResourceId -- * Destructuring the Response , describeTagsResponse , DescribeTagsResponse -- * Response Lenses , dtrsTagList , dtrsResponseStatus ) where import Network.AWS.Lens import Network.AWS.Prelude import Network.AWS.Request import Network.AWS.Response import Network.AWS.WorkSpaces.Types import Network.AWS.WorkSpaces.Types.Product -- | The request of the 'DescribeTags' operation. -- -- -- -- /See:/ 'describeTags' smart constructor. newtype DescribeTags = DescribeTags' { _dtResourceId :: Text } deriving (Eq,Read,Show,Data,Typeable,Generic) -- | Creates a value of 'DescribeTags' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'dtResourceId' - The resource ID of the request. describeTags :: Text -- ^ 'dtResourceId' -> DescribeTags describeTags pResourceId_ = DescribeTags' { _dtResourceId = pResourceId_ } -- | The resource ID of the request. dtResourceId :: Lens' DescribeTags Text dtResourceId = lens _dtResourceId (\ s a -> s{_dtResourceId = a}); instance AWSRequest DescribeTags where type Rs DescribeTags = DescribeTagsResponse request = postJSON workSpaces response = receiveJSON (\ s h x -> DescribeTagsResponse' <$> (x .?> "TagList" .!@ mempty) <*> (pure (fromEnum s))) instance Hashable DescribeTags instance NFData DescribeTags instance ToHeaders DescribeTags where toHeaders = const (mconcat ["X-Amz-Target" =# ("WorkspacesService.DescribeTags" :: ByteString), "Content-Type" =# ("application/x-amz-json-1.1" :: ByteString)]) instance ToJSON DescribeTags where toJSON DescribeTags'{..} = object (catMaybes [Just ("ResourceId" .= _dtResourceId)]) instance ToPath DescribeTags where toPath = const "/" instance ToQuery DescribeTags where toQuery = const mempty -- | The result of the 'DescribeTags' operation. -- -- -- -- /See:/ 'describeTagsResponse' smart constructor. data DescribeTagsResponse = DescribeTagsResponse' { _dtrsTagList :: !(Maybe [Tag]) , _dtrsResponseStatus :: !Int } deriving (Eq,Read,Show,Data,Typeable,Generic) -- | Creates a value of 'DescribeTagsResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'dtrsTagList' - The list of tags. -- -- * 'dtrsResponseStatus' - -- | The response status code. describeTagsResponse :: Int -- ^ 'dtrsResponseStatus' -> DescribeTagsResponse describeTagsResponse pResponseStatus_ = DescribeTagsResponse' { _dtrsTagList = Nothing , _dtrsResponseStatus = pResponseStatus_ } -- | The list of tags. dtrsTagList :: Lens' DescribeTagsResponse [Tag] dtrsTagList = lens _dtrsTagList (\ s a -> s{_dtrsTagList = a}) . _Default . _Coerce; -- | -- | The response status code. dtrsResponseStatus :: Lens' DescribeTagsResponse Int dtrsResponseStatus = lens _dtrsResponseStatus (\ s a -> s{_dtrsResponseStatus = a}); instance NFData DescribeTagsResponse