module Network.AWS.ServiceCatalog.AssociateTagOptionWithResource
    (
    
      associateTagOptionWithResource
    , AssociateTagOptionWithResource
    
    , atowrResourceId
    , atowrTagOptionId
    
    , associateTagOptionWithResourceResponse
    , AssociateTagOptionWithResourceResponse
    
    , atowrrsResponseStatus
    ) 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 AssociateTagOptionWithResource = AssociateTagOptionWithResource'
  { _atowrResourceId  :: !Text
  , _atowrTagOptionId :: !Text
  } deriving (Eq, Read, Show, Data, Typeable, Generic)
associateTagOptionWithResource
    :: Text 
    -> Text 
    -> AssociateTagOptionWithResource
associateTagOptionWithResource pResourceId_ pTagOptionId_ =
  AssociateTagOptionWithResource'
  {_atowrResourceId = pResourceId_, _atowrTagOptionId = pTagOptionId_}
atowrResourceId :: Lens' AssociateTagOptionWithResource Text
atowrResourceId = lens _atowrResourceId (\ s a -> s{_atowrResourceId = a});
atowrTagOptionId :: Lens' AssociateTagOptionWithResource Text
atowrTagOptionId = lens _atowrTagOptionId (\ s a -> s{_atowrTagOptionId = a});
instance AWSRequest AssociateTagOptionWithResource
         where
        type Rs AssociateTagOptionWithResource =
             AssociateTagOptionWithResourceResponse
        request = postJSON serviceCatalog
        response
          = receiveEmpty
              (\ s h x ->
                 AssociateTagOptionWithResourceResponse' <$>
                   (pure (fromEnum s)))
instance Hashable AssociateTagOptionWithResource
         where
instance NFData AssociateTagOptionWithResource where
instance ToHeaders AssociateTagOptionWithResource
         where
        toHeaders
          = const
              (mconcat
                 ["X-Amz-Target" =#
                    ("AWS242ServiceCatalogService.AssociateTagOptionWithResource"
                       :: ByteString),
                  "Content-Type" =#
                    ("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AssociateTagOptionWithResource where
        toJSON AssociateTagOptionWithResource'{..}
          = object
              (catMaybes
                 [Just ("ResourceId" .= _atowrResourceId),
                  Just ("TagOptionId" .= _atowrTagOptionId)])
instance ToPath AssociateTagOptionWithResource where
        toPath = const "/"
instance ToQuery AssociateTagOptionWithResource where
        toQuery = const mempty
newtype AssociateTagOptionWithResourceResponse = AssociateTagOptionWithResourceResponse'
  { _atowrrsResponseStatus :: Int
  } deriving (Eq, Read, Show, Data, Typeable, Generic)
associateTagOptionWithResourceResponse
    :: Int 
    -> AssociateTagOptionWithResourceResponse
associateTagOptionWithResourceResponse pResponseStatus_ =
  AssociateTagOptionWithResourceResponse'
  {_atowrrsResponseStatus = pResponseStatus_}
atowrrsResponseStatus :: Lens' AssociateTagOptionWithResourceResponse Int
atowrrsResponseStatus = lens _atowrrsResponseStatus (\ s a -> s{_atowrrsResponseStatus = a});
instance NFData
           AssociateTagOptionWithResourceResponse
         where