{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.DMS.DescribeSchemas
(
describeSchemas
, DescribeSchemas
, dsMarker
, dsMaxRecords
, dsEndpointARN
, describeSchemasResponse
, DescribeSchemasResponse
, dsrsSchemas
, dsrsMarker
, dsrsResponseStatus
) where
import Network.AWS.DMS.Types
import Network.AWS.DMS.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DescribeSchemas = DescribeSchemas'
{ _dsMarker :: !(Maybe Text)
, _dsMaxRecords :: !(Maybe Int)
, _dsEndpointARN :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeSchemas
:: Text
-> DescribeSchemas
describeSchemas pEndpointARN_ =
DescribeSchemas'
{ _dsMarker = Nothing
, _dsMaxRecords = Nothing
, _dsEndpointARN = pEndpointARN_
}
dsMarker :: Lens' DescribeSchemas (Maybe Text)
dsMarker = lens _dsMarker (\ s a -> s{_dsMarker = a});
dsMaxRecords :: Lens' DescribeSchemas (Maybe Int)
dsMaxRecords = lens _dsMaxRecords (\ s a -> s{_dsMaxRecords = a});
dsEndpointARN :: Lens' DescribeSchemas Text
dsEndpointARN = lens _dsEndpointARN (\ s a -> s{_dsEndpointARN = a});
instance AWSRequest DescribeSchemas where
type Rs DescribeSchemas = DescribeSchemasResponse
request = postJSON dms
response
= receiveJSON
(\ s h x ->
DescribeSchemasResponse' <$>
(x .?> "Schemas" .!@ mempty) <*> (x .?> "Marker") <*>
(pure (fromEnum s)))
instance Hashable DescribeSchemas
instance NFData DescribeSchemas
instance ToHeaders DescribeSchemas where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonDMSv20160101.DescribeSchemas" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeSchemas where
toJSON DescribeSchemas'{..}
= object
(catMaybes
[("Marker" .=) <$> _dsMarker,
("MaxRecords" .=) <$> _dsMaxRecords,
Just ("EndpointArn" .= _dsEndpointARN)])
instance ToPath DescribeSchemas where
toPath = const "/"
instance ToQuery DescribeSchemas where
toQuery = const mempty
data DescribeSchemasResponse = DescribeSchemasResponse'
{ _dsrsSchemas :: !(Maybe [Text])
, _dsrsMarker :: !(Maybe Text)
, _dsrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeSchemasResponse
:: Int
-> DescribeSchemasResponse
describeSchemasResponse pResponseStatus_ =
DescribeSchemasResponse'
{ _dsrsSchemas = Nothing
, _dsrsMarker = Nothing
, _dsrsResponseStatus = pResponseStatus_
}
dsrsSchemas :: Lens' DescribeSchemasResponse [Text]
dsrsSchemas = lens _dsrsSchemas (\ s a -> s{_dsrsSchemas = a}) . _Default . _Coerce;
dsrsMarker :: Lens' DescribeSchemasResponse (Maybe Text)
dsrsMarker = lens _dsrsMarker (\ s a -> s{_dsrsMarker = a});
dsrsResponseStatus :: Lens' DescribeSchemasResponse Int
dsrsResponseStatus = lens _dsrsResponseStatus (\ s a -> s{_dsrsResponseStatus = a});
instance NFData DescribeSchemasResponse