module Network.AWS.CloudDirectory.PutSchemaFromJSON
(
putSchemaFromJSON
, PutSchemaFromJSON
, psfjSchemaARN
, psfjDocument
, putSchemaFromJSONResponse
, PutSchemaFromJSONResponse
, psfjrsARN
, psfjrsResponseStatus
) where
import Network.AWS.CloudDirectory.Types
import Network.AWS.CloudDirectory.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data PutSchemaFromJSON = PutSchemaFromJSON'
{ _psfjSchemaARN :: !Text
, _psfjDocument :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putSchemaFromJSON
:: Text
-> Text
-> PutSchemaFromJSON
putSchemaFromJSON pSchemaARN_ pDocument_ =
PutSchemaFromJSON' {_psfjSchemaARN = pSchemaARN_, _psfjDocument = pDocument_}
psfjSchemaARN :: Lens' PutSchemaFromJSON Text
psfjSchemaARN = lens _psfjSchemaARN (\ s a -> s{_psfjSchemaARN = a});
psfjDocument :: Lens' PutSchemaFromJSON Text
psfjDocument = lens _psfjDocument (\ s a -> s{_psfjDocument = a});
instance AWSRequest PutSchemaFromJSON where
type Rs PutSchemaFromJSON = PutSchemaFromJSONResponse
request = putJSON cloudDirectory
response
= receiveJSON
(\ s h x ->
PutSchemaFromJSONResponse' <$>
(x .?> "Arn") <*> (pure (fromEnum s)))
instance Hashable PutSchemaFromJSON where
instance NFData PutSchemaFromJSON where
instance ToHeaders PutSchemaFromJSON where
toHeaders PutSchemaFromJSON'{..}
= mconcat ["x-amz-data-partition" =# _psfjSchemaARN]
instance ToJSON PutSchemaFromJSON where
toJSON PutSchemaFromJSON'{..}
= object
(catMaybes [Just ("Document" .= _psfjDocument)])
instance ToPath PutSchemaFromJSON where
toPath
= const
"/amazonclouddirectory/2017-01-11/schema/json"
instance ToQuery PutSchemaFromJSON where
toQuery = const mempty
data PutSchemaFromJSONResponse = PutSchemaFromJSONResponse'
{ _psfjrsARN :: !(Maybe Text)
, _psfjrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putSchemaFromJSONResponse
:: Int
-> PutSchemaFromJSONResponse
putSchemaFromJSONResponse pResponseStatus_ =
PutSchemaFromJSONResponse'
{_psfjrsARN = Nothing, _psfjrsResponseStatus = pResponseStatus_}
psfjrsARN :: Lens' PutSchemaFromJSONResponse (Maybe Text)
psfjrsARN = lens _psfjrsARN (\ s a -> s{_psfjrsARN = a});
psfjrsResponseStatus :: Lens' PutSchemaFromJSONResponse Int
psfjrsResponseStatus = lens _psfjrsResponseStatus (\ s a -> s{_psfjrsResponseStatus = a});
instance NFData PutSchemaFromJSONResponse where