module Network.AWS.ServiceCatalog.CreateTagOption
(
createTagOption
, CreateTagOption
, ctoKey
, ctoValue
, createTagOptionResponse
, CreateTagOptionResponse
, ctorsTagOptionDetail
, ctorsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.ServiceCatalog.Types
import Network.AWS.ServiceCatalog.Types.Product
data CreateTagOption = CreateTagOption'
{ _ctoKey :: !Text
, _ctoValue :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createTagOption
:: Text
-> Text
-> CreateTagOption
createTagOption pKey_ pValue_ =
CreateTagOption' {_ctoKey = pKey_, _ctoValue = pValue_}
ctoKey :: Lens' CreateTagOption Text
ctoKey = lens _ctoKey (\ s a -> s{_ctoKey = a});
ctoValue :: Lens' CreateTagOption Text
ctoValue = lens _ctoValue (\ s a -> s{_ctoValue = a});
instance AWSRequest CreateTagOption where
type Rs CreateTagOption = CreateTagOptionResponse
request = postJSON serviceCatalog
response
= receiveJSON
(\ s h x ->
CreateTagOptionResponse' <$>
(x .?> "TagOptionDetail") <*> (pure (fromEnum s)))
instance Hashable CreateTagOption where
instance NFData CreateTagOption where
instance ToHeaders CreateTagOption where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWS242ServiceCatalogService.CreateTagOption" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateTagOption where
toJSON CreateTagOption'{..}
= object
(catMaybes
[Just ("Key" .= _ctoKey),
Just ("Value" .= _ctoValue)])
instance ToPath CreateTagOption where
toPath = const "/"
instance ToQuery CreateTagOption where
toQuery = const mempty
data CreateTagOptionResponse = CreateTagOptionResponse'
{ _ctorsTagOptionDetail :: !(Maybe TagOptionDetail)
, _ctorsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createTagOptionResponse
:: Int
-> CreateTagOptionResponse
createTagOptionResponse pResponseStatus_ =
CreateTagOptionResponse'
{_ctorsTagOptionDetail = Nothing, _ctorsResponseStatus = pResponseStatus_}
ctorsTagOptionDetail :: Lens' CreateTagOptionResponse (Maybe TagOptionDetail)
ctorsTagOptionDetail = lens _ctorsTagOptionDetail (\ s a -> s{_ctorsTagOptionDetail = a});
ctorsResponseStatus :: Lens' CreateTagOptionResponse Int
ctorsResponseStatus = lens _ctorsResponseStatus (\ s a -> s{_ctorsResponseStatus = a});
instance NFData CreateTagOptionResponse where