module Network.AWS.CloudDirectory.UpdateSchema
(
updateSchema
, UpdateSchema
, usSchemaARN
, usName
, updateSchemaResponse
, UpdateSchemaResponse
, usrsSchemaARN
, usrsResponseStatus
) 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 UpdateSchema = UpdateSchema'
{ _usSchemaARN :: !Text
, _usName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateSchema
:: Text
-> Text
-> UpdateSchema
updateSchema pSchemaARN_ pName_ =
UpdateSchema' {_usSchemaARN = pSchemaARN_, _usName = pName_}
usSchemaARN :: Lens' UpdateSchema Text
usSchemaARN = lens _usSchemaARN (\ s a -> s{_usSchemaARN = a});
usName :: Lens' UpdateSchema Text
usName = lens _usName (\ s a -> s{_usName = a});
instance AWSRequest UpdateSchema where
type Rs UpdateSchema = UpdateSchemaResponse
request = putJSON cloudDirectory
response
= receiveJSON
(\ s h x ->
UpdateSchemaResponse' <$>
(x .?> "SchemaArn") <*> (pure (fromEnum s)))
instance Hashable UpdateSchema where
instance NFData UpdateSchema where
instance ToHeaders UpdateSchema where
toHeaders UpdateSchema'{..}
= mconcat ["x-amz-data-partition" =# _usSchemaARN]
instance ToJSON UpdateSchema where
toJSON UpdateSchema'{..}
= object (catMaybes [Just ("Name" .= _usName)])
instance ToPath UpdateSchema where
toPath
= const
"/amazonclouddirectory/2017-01-11/schema/update"
instance ToQuery UpdateSchema where
toQuery = const mempty
data UpdateSchemaResponse = UpdateSchemaResponse'
{ _usrsSchemaARN :: !(Maybe Text)
, _usrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateSchemaResponse
:: Int
-> UpdateSchemaResponse
updateSchemaResponse pResponseStatus_ =
UpdateSchemaResponse'
{_usrsSchemaARN = Nothing, _usrsResponseStatus = pResponseStatus_}
usrsSchemaARN :: Lens' UpdateSchemaResponse (Maybe Text)
usrsSchemaARN = lens _usrsSchemaARN (\ s a -> s{_usrsSchemaARN = a});
usrsResponseStatus :: Lens' UpdateSchemaResponse Int
usrsResponseStatus = lens _usrsResponseStatus (\ s a -> s{_usrsResponseStatus = a});
instance NFData UpdateSchemaResponse where