{-# 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.RefreshSchemas
(
refreshSchemas
, RefreshSchemas
, rsEndpointARN
, rsReplicationInstanceARN
, refreshSchemasResponse
, RefreshSchemasResponse
, rsrsRefreshSchemasStatus
, rsrsResponseStatus
) 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 RefreshSchemas = RefreshSchemas'
{ _rsEndpointARN :: !Text
, _rsReplicationInstanceARN :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
refreshSchemas
:: Text
-> Text
-> RefreshSchemas
refreshSchemas pEndpointARN_ pReplicationInstanceARN_ =
RefreshSchemas'
{ _rsEndpointARN = pEndpointARN_
, _rsReplicationInstanceARN = pReplicationInstanceARN_
}
rsEndpointARN :: Lens' RefreshSchemas Text
rsEndpointARN = lens _rsEndpointARN (\ s a -> s{_rsEndpointARN = a})
rsReplicationInstanceARN :: Lens' RefreshSchemas Text
rsReplicationInstanceARN = lens _rsReplicationInstanceARN (\ s a -> s{_rsReplicationInstanceARN = a})
instance AWSRequest RefreshSchemas where
type Rs RefreshSchemas = RefreshSchemasResponse
request = postJSON dms
response
= receiveJSON
(\ s h x ->
RefreshSchemasResponse' <$>
(x .?> "RefreshSchemasStatus") <*>
(pure (fromEnum s)))
instance Hashable RefreshSchemas where
instance NFData RefreshSchemas where
instance ToHeaders RefreshSchemas where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonDMSv20160101.RefreshSchemas" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON RefreshSchemas where
toJSON RefreshSchemas'{..}
= object
(catMaybes
[Just ("EndpointArn" .= _rsEndpointARN),
Just
("ReplicationInstanceArn" .=
_rsReplicationInstanceARN)])
instance ToPath RefreshSchemas where
toPath = const "/"
instance ToQuery RefreshSchemas where
toQuery = const mempty
data RefreshSchemasResponse = RefreshSchemasResponse'
{ _rsrsRefreshSchemasStatus :: !(Maybe RefreshSchemasStatus)
, _rsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
refreshSchemasResponse
:: Int
-> RefreshSchemasResponse
refreshSchemasResponse pResponseStatus_ =
RefreshSchemasResponse'
{ _rsrsRefreshSchemasStatus = Nothing
, _rsrsResponseStatus = pResponseStatus_
}
rsrsRefreshSchemasStatus :: Lens' RefreshSchemasResponse (Maybe RefreshSchemasStatus)
rsrsRefreshSchemasStatus = lens _rsrsRefreshSchemasStatus (\ s a -> s{_rsrsRefreshSchemasStatus = a})
rsrsResponseStatus :: Lens' RefreshSchemasResponse Int
rsrsResponseStatus = lens _rsrsResponseStatus (\ s a -> s{_rsrsResponseStatus = a})
instance NFData RefreshSchemasResponse where