{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.DMS.Types.Connection where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Connection = Connection'
{
Connection -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
Connection -> Maybe Text
replicationInstanceArn :: Prelude.Maybe Prelude.Text,
Connection -> Maybe Text
endpointIdentifier :: Prelude.Maybe Prelude.Text,
Connection -> Maybe Text
replicationInstanceIdentifier :: Prelude.Maybe Prelude.Text,
Connection -> Maybe Text
endpointArn :: Prelude.Maybe Prelude.Text,
Connection -> Maybe Text
lastFailureMessage :: Prelude.Maybe Prelude.Text
}
deriving (Connection -> Connection -> Bool
(Connection -> Connection -> Bool)
-> (Connection -> Connection -> Bool) -> Eq Connection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Connection -> Connection -> Bool
$c/= :: Connection -> Connection -> Bool
== :: Connection -> Connection -> Bool
$c== :: Connection -> Connection -> Bool
Prelude.Eq, ReadPrec [Connection]
ReadPrec Connection
Int -> ReadS Connection
ReadS [Connection]
(Int -> ReadS Connection)
-> ReadS [Connection]
-> ReadPrec Connection
-> ReadPrec [Connection]
-> Read Connection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Connection]
$creadListPrec :: ReadPrec [Connection]
readPrec :: ReadPrec Connection
$creadPrec :: ReadPrec Connection
readList :: ReadS [Connection]
$creadList :: ReadS [Connection]
readsPrec :: Int -> ReadS Connection
$creadsPrec :: Int -> ReadS Connection
Prelude.Read, Int -> Connection -> ShowS
[Connection] -> ShowS
Connection -> String
(Int -> Connection -> ShowS)
-> (Connection -> String)
-> ([Connection] -> ShowS)
-> Show Connection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Connection] -> ShowS
$cshowList :: [Connection] -> ShowS
show :: Connection -> String
$cshow :: Connection -> String
showsPrec :: Int -> Connection -> ShowS
$cshowsPrec :: Int -> Connection -> ShowS
Prelude.Show, (forall x. Connection -> Rep Connection x)
-> (forall x. Rep Connection x -> Connection) -> Generic Connection
forall x. Rep Connection x -> Connection
forall x. Connection -> Rep Connection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Connection x -> Connection
$cfrom :: forall x. Connection -> Rep Connection x
Prelude.Generic)
newConnection ::
Connection
newConnection :: Connection
newConnection =
Connection' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Connection
Connection'
{ $sel:status:Connection' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:replicationInstanceArn:Connection' :: Maybe Text
replicationInstanceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endpointIdentifier:Connection' :: Maybe Text
endpointIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:replicationInstanceIdentifier:Connection' :: Maybe Text
replicationInstanceIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endpointArn:Connection' :: Maybe Text
endpointArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastFailureMessage:Connection' :: Maybe Text
lastFailureMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
connection_status :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_status :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_status = (Connection -> Maybe Text)
-> (Connection -> Maybe Text -> Connection)
-> Lens Connection Connection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
status :: Maybe Text
$sel:status:Connection' :: Connection -> Maybe Text
status} -> Maybe Text
status) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:status:Connection' :: Maybe Text
status = Maybe Text
a} :: Connection)
connection_replicationInstanceArn :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_replicationInstanceArn :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_replicationInstanceArn = (Connection -> Maybe Text)
-> (Connection -> Maybe Text -> Connection)
-> Lens Connection Connection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
replicationInstanceArn :: Maybe Text
$sel:replicationInstanceArn:Connection' :: Connection -> Maybe Text
replicationInstanceArn} -> Maybe Text
replicationInstanceArn) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:replicationInstanceArn:Connection' :: Maybe Text
replicationInstanceArn = Maybe Text
a} :: Connection)
connection_endpointIdentifier :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_endpointIdentifier :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_endpointIdentifier = (Connection -> Maybe Text)
-> (Connection -> Maybe Text -> Connection)
-> Lens Connection Connection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
endpointIdentifier :: Maybe Text
$sel:endpointIdentifier:Connection' :: Connection -> Maybe Text
endpointIdentifier} -> Maybe Text
endpointIdentifier) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:endpointIdentifier:Connection' :: Maybe Text
endpointIdentifier = Maybe Text
a} :: Connection)
connection_replicationInstanceIdentifier :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_replicationInstanceIdentifier :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_replicationInstanceIdentifier = (Connection -> Maybe Text)
-> (Connection -> Maybe Text -> Connection)
-> Lens Connection Connection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
replicationInstanceIdentifier :: Maybe Text
$sel:replicationInstanceIdentifier:Connection' :: Connection -> Maybe Text
replicationInstanceIdentifier} -> Maybe Text
replicationInstanceIdentifier) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:replicationInstanceIdentifier:Connection' :: Maybe Text
replicationInstanceIdentifier = Maybe Text
a} :: Connection)
connection_endpointArn :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_endpointArn :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_endpointArn = (Connection -> Maybe Text)
-> (Connection -> Maybe Text -> Connection)
-> Lens Connection Connection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
endpointArn :: Maybe Text
$sel:endpointArn:Connection' :: Connection -> Maybe Text
endpointArn} -> Maybe Text
endpointArn) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:endpointArn:Connection' :: Maybe Text
endpointArn = Maybe Text
a} :: Connection)
connection_lastFailureMessage :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_lastFailureMessage :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_lastFailureMessage = (Connection -> Maybe Text)
-> (Connection -> Maybe Text -> Connection)
-> Lens Connection Connection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
lastFailureMessage :: Maybe Text
$sel:lastFailureMessage:Connection' :: Connection -> Maybe Text
lastFailureMessage} -> Maybe Text
lastFailureMessage) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:lastFailureMessage:Connection' :: Maybe Text
lastFailureMessage = Maybe Text
a} :: Connection)
instance Core.FromJSON Connection where
parseJSON :: Value -> Parser Connection
parseJSON =
String
-> (Object -> Parser Connection) -> Value -> Parser Connection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Connection"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Connection
Connection'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Connection)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Connection)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Connection)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Connection)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReplicationInstanceArn")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Connection)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Connection)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndpointIdentifier")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> Connection)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Connection)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReplicationInstanceIdentifier")
Parser (Maybe Text -> Maybe Text -> Connection)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Connection)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndpointArn")
Parser (Maybe Text -> Connection)
-> Parser (Maybe Text) -> Parser Connection
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastFailureMessage")
)
instance Prelude.Hashable Connection
instance Prelude.NFData Connection