module Network.AWS.ServiceCatalog.UpdateTagOption
    (
    
      updateTagOption
    , UpdateTagOption
    
    , utoValue
    , utoActive
    , utoId
    
    , updateTagOptionResponse
    , UpdateTagOptionResponse
    
    , utorsTagOptionDetail
    , utorsResponseStatus
    ) 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 UpdateTagOption = UpdateTagOption'
  { _utoValue  :: !(Maybe Text)
  , _utoActive :: !(Maybe Bool)
  , _utoId     :: !Text
  } deriving (Eq, Read, Show, Data, Typeable, Generic)
updateTagOption
    :: Text 
    -> UpdateTagOption
updateTagOption pId_ =
  UpdateTagOption' {_utoValue = Nothing, _utoActive = Nothing, _utoId = pId_}
utoValue :: Lens' UpdateTagOption (Maybe Text)
utoValue = lens _utoValue (\ s a -> s{_utoValue = a});
utoActive :: Lens' UpdateTagOption (Maybe Bool)
utoActive = lens _utoActive (\ s a -> s{_utoActive = a});
utoId :: Lens' UpdateTagOption Text
utoId = lens _utoId (\ s a -> s{_utoId = a});
instance AWSRequest UpdateTagOption where
        type Rs UpdateTagOption = UpdateTagOptionResponse
        request = postJSON serviceCatalog
        response
          = receiveJSON
              (\ s h x ->
                 UpdateTagOptionResponse' <$>
                   (x .?> "TagOptionDetail") <*> (pure (fromEnum s)))
instance Hashable UpdateTagOption where
instance NFData UpdateTagOption where
instance ToHeaders UpdateTagOption where
        toHeaders
          = const
              (mconcat
                 ["X-Amz-Target" =#
                    ("AWS242ServiceCatalogService.UpdateTagOption" ::
                       ByteString),
                  "Content-Type" =#
                    ("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateTagOption where
        toJSON UpdateTagOption'{..}
          = object
              (catMaybes
                 [("Value" .=) <$> _utoValue,
                  ("Active" .=) <$> _utoActive, Just ("Id" .= _utoId)])
instance ToPath UpdateTagOption where
        toPath = const "/"
instance ToQuery UpdateTagOption where
        toQuery = const mempty
data UpdateTagOptionResponse = UpdateTagOptionResponse'
  { _utorsTagOptionDetail :: !(Maybe TagOptionDetail)
  , _utorsResponseStatus  :: !Int
  } deriving (Eq, Read, Show, Data, Typeable, Generic)
updateTagOptionResponse
    :: Int 
    -> UpdateTagOptionResponse
updateTagOptionResponse pResponseStatus_ =
  UpdateTagOptionResponse'
  {_utorsTagOptionDetail = Nothing, _utorsResponseStatus = pResponseStatus_}
utorsTagOptionDetail :: Lens' UpdateTagOptionResponse (Maybe TagOptionDetail)
utorsTagOptionDetail = lens _utorsTagOptionDetail (\ s a -> s{_utorsTagOptionDetail = a});
utorsResponseStatus :: Lens' UpdateTagOptionResponse Int
utorsResponseStatus = lens _utorsResponseStatus (\ s a -> s{_utorsResponseStatus = a});
instance NFData UpdateTagOptionResponse where