{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.DMS.RefreshSchemas
(
RefreshSchemas (..),
newRefreshSchemas,
refreshSchemas_endpointArn,
refreshSchemas_replicationInstanceArn,
RefreshSchemasResponse (..),
newRefreshSchemasResponse,
refreshSchemasResponse_refreshSchemasStatus,
refreshSchemasResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DMS.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data RefreshSchemas = RefreshSchemas'
{
RefreshSchemas -> Text
endpointArn :: Prelude.Text,
RefreshSchemas -> Text
replicationInstanceArn :: Prelude.Text
}
deriving (RefreshSchemas -> RefreshSchemas -> Bool
(RefreshSchemas -> RefreshSchemas -> Bool)
-> (RefreshSchemas -> RefreshSchemas -> Bool) -> Eq RefreshSchemas
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RefreshSchemas -> RefreshSchemas -> Bool
$c/= :: RefreshSchemas -> RefreshSchemas -> Bool
== :: RefreshSchemas -> RefreshSchemas -> Bool
$c== :: RefreshSchemas -> RefreshSchemas -> Bool
Prelude.Eq, ReadPrec [RefreshSchemas]
ReadPrec RefreshSchemas
Int -> ReadS RefreshSchemas
ReadS [RefreshSchemas]
(Int -> ReadS RefreshSchemas)
-> ReadS [RefreshSchemas]
-> ReadPrec RefreshSchemas
-> ReadPrec [RefreshSchemas]
-> Read RefreshSchemas
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RefreshSchemas]
$creadListPrec :: ReadPrec [RefreshSchemas]
readPrec :: ReadPrec RefreshSchemas
$creadPrec :: ReadPrec RefreshSchemas
readList :: ReadS [RefreshSchemas]
$creadList :: ReadS [RefreshSchemas]
readsPrec :: Int -> ReadS RefreshSchemas
$creadsPrec :: Int -> ReadS RefreshSchemas
Prelude.Read, Int -> RefreshSchemas -> ShowS
[RefreshSchemas] -> ShowS
RefreshSchemas -> String
(Int -> RefreshSchemas -> ShowS)
-> (RefreshSchemas -> String)
-> ([RefreshSchemas] -> ShowS)
-> Show RefreshSchemas
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RefreshSchemas] -> ShowS
$cshowList :: [RefreshSchemas] -> ShowS
show :: RefreshSchemas -> String
$cshow :: RefreshSchemas -> String
showsPrec :: Int -> RefreshSchemas -> ShowS
$cshowsPrec :: Int -> RefreshSchemas -> ShowS
Prelude.Show, (forall x. RefreshSchemas -> Rep RefreshSchemas x)
-> (forall x. Rep RefreshSchemas x -> RefreshSchemas)
-> Generic RefreshSchemas
forall x. Rep RefreshSchemas x -> RefreshSchemas
forall x. RefreshSchemas -> Rep RefreshSchemas x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RefreshSchemas x -> RefreshSchemas
$cfrom :: forall x. RefreshSchemas -> Rep RefreshSchemas x
Prelude.Generic)
newRefreshSchemas ::
Prelude.Text ->
Prelude.Text ->
RefreshSchemas
newRefreshSchemas :: Text -> Text -> RefreshSchemas
newRefreshSchemas
Text
pEndpointArn_
Text
pReplicationInstanceArn_ =
RefreshSchemas' :: Text -> Text -> RefreshSchemas
RefreshSchemas'
{ $sel:endpointArn:RefreshSchemas' :: Text
endpointArn = Text
pEndpointArn_,
$sel:replicationInstanceArn:RefreshSchemas' :: Text
replicationInstanceArn = Text
pReplicationInstanceArn_
}
refreshSchemas_endpointArn :: Lens.Lens' RefreshSchemas Prelude.Text
refreshSchemas_endpointArn :: (Text -> f Text) -> RefreshSchemas -> f RefreshSchemas
refreshSchemas_endpointArn = (RefreshSchemas -> Text)
-> (RefreshSchemas -> Text -> RefreshSchemas)
-> Lens RefreshSchemas RefreshSchemas Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RefreshSchemas' {Text
endpointArn :: Text
$sel:endpointArn:RefreshSchemas' :: RefreshSchemas -> Text
endpointArn} -> Text
endpointArn) (\s :: RefreshSchemas
s@RefreshSchemas' {} Text
a -> RefreshSchemas
s {$sel:endpointArn:RefreshSchemas' :: Text
endpointArn = Text
a} :: RefreshSchemas)
refreshSchemas_replicationInstanceArn :: Lens.Lens' RefreshSchemas Prelude.Text
refreshSchemas_replicationInstanceArn :: (Text -> f Text) -> RefreshSchemas -> f RefreshSchemas
refreshSchemas_replicationInstanceArn = (RefreshSchemas -> Text)
-> (RefreshSchemas -> Text -> RefreshSchemas)
-> Lens RefreshSchemas RefreshSchemas Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RefreshSchemas' {Text
replicationInstanceArn :: Text
$sel:replicationInstanceArn:RefreshSchemas' :: RefreshSchemas -> Text
replicationInstanceArn} -> Text
replicationInstanceArn) (\s :: RefreshSchemas
s@RefreshSchemas' {} Text
a -> RefreshSchemas
s {$sel:replicationInstanceArn:RefreshSchemas' :: Text
replicationInstanceArn = Text
a} :: RefreshSchemas)
instance Core.AWSRequest RefreshSchemas where
type
AWSResponse RefreshSchemas =
RefreshSchemasResponse
request :: RefreshSchemas -> Request RefreshSchemas
request = Service -> RefreshSchemas -> Request RefreshSchemas
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RefreshSchemas
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RefreshSchemas)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse RefreshSchemas))
-> Logger
-> Service
-> Proxy RefreshSchemas
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RefreshSchemas)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe RefreshSchemasStatus -> Int -> RefreshSchemasResponse
RefreshSchemasResponse'
(Maybe RefreshSchemasStatus -> Int -> RefreshSchemasResponse)
-> Either String (Maybe RefreshSchemasStatus)
-> Either String (Int -> RefreshSchemasResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe RefreshSchemasStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RefreshSchemasStatus")
Either String (Int -> RefreshSchemasResponse)
-> Either String Int -> Either String RefreshSchemasResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable RefreshSchemas
instance Prelude.NFData RefreshSchemas
instance Core.ToHeaders RefreshSchemas where
toHeaders :: RefreshSchemas -> ResponseHeaders
toHeaders =
ResponseHeaders -> RefreshSchemas -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonDMSv20160101.RefreshSchemas" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON RefreshSchemas where
toJSON :: RefreshSchemas -> Value
toJSON RefreshSchemas' {Text
replicationInstanceArn :: Text
endpointArn :: Text
$sel:replicationInstanceArn:RefreshSchemas' :: RefreshSchemas -> Text
$sel:endpointArn:RefreshSchemas' :: RefreshSchemas -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"EndpointArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
endpointArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"ReplicationInstanceArn"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
replicationInstanceArn
)
]
)
instance Core.ToPath RefreshSchemas where
toPath :: RefreshSchemas -> ByteString
toPath = ByteString -> RefreshSchemas -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RefreshSchemas where
toQuery :: RefreshSchemas -> QueryString
toQuery = QueryString -> RefreshSchemas -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RefreshSchemasResponse = RefreshSchemasResponse'
{
RefreshSchemasResponse -> Maybe RefreshSchemasStatus
refreshSchemasStatus :: Prelude.Maybe RefreshSchemasStatus,
RefreshSchemasResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RefreshSchemasResponse -> RefreshSchemasResponse -> Bool
(RefreshSchemasResponse -> RefreshSchemasResponse -> Bool)
-> (RefreshSchemasResponse -> RefreshSchemasResponse -> Bool)
-> Eq RefreshSchemasResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RefreshSchemasResponse -> RefreshSchemasResponse -> Bool
$c/= :: RefreshSchemasResponse -> RefreshSchemasResponse -> Bool
== :: RefreshSchemasResponse -> RefreshSchemasResponse -> Bool
$c== :: RefreshSchemasResponse -> RefreshSchemasResponse -> Bool
Prelude.Eq, ReadPrec [RefreshSchemasResponse]
ReadPrec RefreshSchemasResponse
Int -> ReadS RefreshSchemasResponse
ReadS [RefreshSchemasResponse]
(Int -> ReadS RefreshSchemasResponse)
-> ReadS [RefreshSchemasResponse]
-> ReadPrec RefreshSchemasResponse
-> ReadPrec [RefreshSchemasResponse]
-> Read RefreshSchemasResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RefreshSchemasResponse]
$creadListPrec :: ReadPrec [RefreshSchemasResponse]
readPrec :: ReadPrec RefreshSchemasResponse
$creadPrec :: ReadPrec RefreshSchemasResponse
readList :: ReadS [RefreshSchemasResponse]
$creadList :: ReadS [RefreshSchemasResponse]
readsPrec :: Int -> ReadS RefreshSchemasResponse
$creadsPrec :: Int -> ReadS RefreshSchemasResponse
Prelude.Read, Int -> RefreshSchemasResponse -> ShowS
[RefreshSchemasResponse] -> ShowS
RefreshSchemasResponse -> String
(Int -> RefreshSchemasResponse -> ShowS)
-> (RefreshSchemasResponse -> String)
-> ([RefreshSchemasResponse] -> ShowS)
-> Show RefreshSchemasResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RefreshSchemasResponse] -> ShowS
$cshowList :: [RefreshSchemasResponse] -> ShowS
show :: RefreshSchemasResponse -> String
$cshow :: RefreshSchemasResponse -> String
showsPrec :: Int -> RefreshSchemasResponse -> ShowS
$cshowsPrec :: Int -> RefreshSchemasResponse -> ShowS
Prelude.Show, (forall x. RefreshSchemasResponse -> Rep RefreshSchemasResponse x)
-> (forall x.
Rep RefreshSchemasResponse x -> RefreshSchemasResponse)
-> Generic RefreshSchemasResponse
forall x. Rep RefreshSchemasResponse x -> RefreshSchemasResponse
forall x. RefreshSchemasResponse -> Rep RefreshSchemasResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RefreshSchemasResponse x -> RefreshSchemasResponse
$cfrom :: forall x. RefreshSchemasResponse -> Rep RefreshSchemasResponse x
Prelude.Generic)
newRefreshSchemasResponse ::
Prelude.Int ->
RefreshSchemasResponse
newRefreshSchemasResponse :: Int -> RefreshSchemasResponse
newRefreshSchemasResponse Int
pHttpStatus_ =
RefreshSchemasResponse' :: Maybe RefreshSchemasStatus -> Int -> RefreshSchemasResponse
RefreshSchemasResponse'
{ $sel:refreshSchemasStatus:RefreshSchemasResponse' :: Maybe RefreshSchemasStatus
refreshSchemasStatus =
Maybe RefreshSchemasStatus
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RefreshSchemasResponse' :: Int
httpStatus = Int
pHttpStatus_
}
refreshSchemasResponse_refreshSchemasStatus :: Lens.Lens' RefreshSchemasResponse (Prelude.Maybe RefreshSchemasStatus)
refreshSchemasResponse_refreshSchemasStatus :: (Maybe RefreshSchemasStatus -> f (Maybe RefreshSchemasStatus))
-> RefreshSchemasResponse -> f RefreshSchemasResponse
refreshSchemasResponse_refreshSchemasStatus = (RefreshSchemasResponse -> Maybe RefreshSchemasStatus)
-> (RefreshSchemasResponse
-> Maybe RefreshSchemasStatus -> RefreshSchemasResponse)
-> Lens
RefreshSchemasResponse
RefreshSchemasResponse
(Maybe RefreshSchemasStatus)
(Maybe RefreshSchemasStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RefreshSchemasResponse' {Maybe RefreshSchemasStatus
refreshSchemasStatus :: Maybe RefreshSchemasStatus
$sel:refreshSchemasStatus:RefreshSchemasResponse' :: RefreshSchemasResponse -> Maybe RefreshSchemasStatus
refreshSchemasStatus} -> Maybe RefreshSchemasStatus
refreshSchemasStatus) (\s :: RefreshSchemasResponse
s@RefreshSchemasResponse' {} Maybe RefreshSchemasStatus
a -> RefreshSchemasResponse
s {$sel:refreshSchemasStatus:RefreshSchemasResponse' :: Maybe RefreshSchemasStatus
refreshSchemasStatus = Maybe RefreshSchemasStatus
a} :: RefreshSchemasResponse)
refreshSchemasResponse_httpStatus :: Lens.Lens' RefreshSchemasResponse Prelude.Int
refreshSchemasResponse_httpStatus :: (Int -> f Int)
-> RefreshSchemasResponse -> f RefreshSchemasResponse
refreshSchemasResponse_httpStatus = (RefreshSchemasResponse -> Int)
-> (RefreshSchemasResponse -> Int -> RefreshSchemasResponse)
-> Lens RefreshSchemasResponse RefreshSchemasResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RefreshSchemasResponse' {Int
httpStatus :: Int
$sel:httpStatus:RefreshSchemasResponse' :: RefreshSchemasResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RefreshSchemasResponse
s@RefreshSchemasResponse' {} Int
a -> RefreshSchemasResponse
s {$sel:httpStatus:RefreshSchemasResponse' :: Int
httpStatus = Int
a} :: RefreshSchemasResponse)
instance Prelude.NFData RefreshSchemasResponse