{-# 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.OpenSearch.Types.InboundConnection where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.OpenSearch.Types.DomainInformationContainer
import Amazonka.OpenSearch.Types.InboundConnectionStatus
import qualified Amazonka.Prelude as Prelude
data InboundConnection = InboundConnection'
{
InboundConnection -> Maybe Text
connectionId :: Prelude.Maybe Prelude.Text,
InboundConnection -> Maybe InboundConnectionStatus
connectionStatus :: Prelude.Maybe InboundConnectionStatus,
InboundConnection -> Maybe DomainInformationContainer
localDomainInfo :: Prelude.Maybe DomainInformationContainer,
InboundConnection -> Maybe DomainInformationContainer
remoteDomainInfo :: Prelude.Maybe DomainInformationContainer
}
deriving (InboundConnection -> InboundConnection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InboundConnection -> InboundConnection -> Bool
$c/= :: InboundConnection -> InboundConnection -> Bool
== :: InboundConnection -> InboundConnection -> Bool
$c== :: InboundConnection -> InboundConnection -> Bool
Prelude.Eq, ReadPrec [InboundConnection]
ReadPrec InboundConnection
Int -> ReadS InboundConnection
ReadS [InboundConnection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InboundConnection]
$creadListPrec :: ReadPrec [InboundConnection]
readPrec :: ReadPrec InboundConnection
$creadPrec :: ReadPrec InboundConnection
readList :: ReadS [InboundConnection]
$creadList :: ReadS [InboundConnection]
readsPrec :: Int -> ReadS InboundConnection
$creadsPrec :: Int -> ReadS InboundConnection
Prelude.Read, Int -> InboundConnection -> ShowS
[InboundConnection] -> ShowS
InboundConnection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InboundConnection] -> ShowS
$cshowList :: [InboundConnection] -> ShowS
show :: InboundConnection -> String
$cshow :: InboundConnection -> String
showsPrec :: Int -> InboundConnection -> ShowS
$cshowsPrec :: Int -> InboundConnection -> ShowS
Prelude.Show, forall x. Rep InboundConnection x -> InboundConnection
forall x. InboundConnection -> Rep InboundConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InboundConnection x -> InboundConnection
$cfrom :: forall x. InboundConnection -> Rep InboundConnection x
Prelude.Generic)
newInboundConnection ::
InboundConnection
newInboundConnection :: InboundConnection
newInboundConnection =
InboundConnection'
{ $sel:connectionId:InboundConnection' :: Maybe Text
connectionId = forall a. Maybe a
Prelude.Nothing,
$sel:connectionStatus:InboundConnection' :: Maybe InboundConnectionStatus
connectionStatus = forall a. Maybe a
Prelude.Nothing,
$sel:localDomainInfo:InboundConnection' :: Maybe DomainInformationContainer
localDomainInfo = forall a. Maybe a
Prelude.Nothing,
$sel:remoteDomainInfo:InboundConnection' :: Maybe DomainInformationContainer
remoteDomainInfo = forall a. Maybe a
Prelude.Nothing
}
inboundConnection_connectionId :: Lens.Lens' InboundConnection (Prelude.Maybe Prelude.Text)
inboundConnection_connectionId :: Lens' InboundConnection (Maybe Text)
inboundConnection_connectionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InboundConnection' {Maybe Text
connectionId :: Maybe Text
$sel:connectionId:InboundConnection' :: InboundConnection -> Maybe Text
connectionId} -> Maybe Text
connectionId) (\s :: InboundConnection
s@InboundConnection' {} Maybe Text
a -> InboundConnection
s {$sel:connectionId:InboundConnection' :: Maybe Text
connectionId = Maybe Text
a} :: InboundConnection)
inboundConnection_connectionStatus :: Lens.Lens' InboundConnection (Prelude.Maybe InboundConnectionStatus)
inboundConnection_connectionStatus :: Lens' InboundConnection (Maybe InboundConnectionStatus)
inboundConnection_connectionStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InboundConnection' {Maybe InboundConnectionStatus
connectionStatus :: Maybe InboundConnectionStatus
$sel:connectionStatus:InboundConnection' :: InboundConnection -> Maybe InboundConnectionStatus
connectionStatus} -> Maybe InboundConnectionStatus
connectionStatus) (\s :: InboundConnection
s@InboundConnection' {} Maybe InboundConnectionStatus
a -> InboundConnection
s {$sel:connectionStatus:InboundConnection' :: Maybe InboundConnectionStatus
connectionStatus = Maybe InboundConnectionStatus
a} :: InboundConnection)
inboundConnection_localDomainInfo :: Lens.Lens' InboundConnection (Prelude.Maybe DomainInformationContainer)
inboundConnection_localDomainInfo :: Lens' InboundConnection (Maybe DomainInformationContainer)
inboundConnection_localDomainInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InboundConnection' {Maybe DomainInformationContainer
localDomainInfo :: Maybe DomainInformationContainer
$sel:localDomainInfo:InboundConnection' :: InboundConnection -> Maybe DomainInformationContainer
localDomainInfo} -> Maybe DomainInformationContainer
localDomainInfo) (\s :: InboundConnection
s@InboundConnection' {} Maybe DomainInformationContainer
a -> InboundConnection
s {$sel:localDomainInfo:InboundConnection' :: Maybe DomainInformationContainer
localDomainInfo = Maybe DomainInformationContainer
a} :: InboundConnection)
inboundConnection_remoteDomainInfo :: Lens.Lens' InboundConnection (Prelude.Maybe DomainInformationContainer)
inboundConnection_remoteDomainInfo :: Lens' InboundConnection (Maybe DomainInformationContainer)
inboundConnection_remoteDomainInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InboundConnection' {Maybe DomainInformationContainer
remoteDomainInfo :: Maybe DomainInformationContainer
$sel:remoteDomainInfo:InboundConnection' :: InboundConnection -> Maybe DomainInformationContainer
remoteDomainInfo} -> Maybe DomainInformationContainer
remoteDomainInfo) (\s :: InboundConnection
s@InboundConnection' {} Maybe DomainInformationContainer
a -> InboundConnection
s {$sel:remoteDomainInfo:InboundConnection' :: Maybe DomainInformationContainer
remoteDomainInfo = Maybe DomainInformationContainer
a} :: InboundConnection)
instance Data.FromJSON InboundConnection where
parseJSON :: Value -> Parser InboundConnection
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"InboundConnection"
( \Object
x ->
Maybe Text
-> Maybe InboundConnectionStatus
-> Maybe DomainInformationContainer
-> Maybe DomainInformationContainer
-> InboundConnection
InboundConnection'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ConnectionId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ConnectionStatus")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LocalDomainInfo")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RemoteDomainInfo")
)
instance Prelude.Hashable InboundConnection where
hashWithSalt :: Int -> InboundConnection -> Int
hashWithSalt Int
_salt InboundConnection' {Maybe Text
Maybe DomainInformationContainer
Maybe InboundConnectionStatus
remoteDomainInfo :: Maybe DomainInformationContainer
localDomainInfo :: Maybe DomainInformationContainer
connectionStatus :: Maybe InboundConnectionStatus
connectionId :: Maybe Text
$sel:remoteDomainInfo:InboundConnection' :: InboundConnection -> Maybe DomainInformationContainer
$sel:localDomainInfo:InboundConnection' :: InboundConnection -> Maybe DomainInformationContainer
$sel:connectionStatus:InboundConnection' :: InboundConnection -> Maybe InboundConnectionStatus
$sel:connectionId:InboundConnection' :: InboundConnection -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
connectionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InboundConnectionStatus
connectionStatus
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DomainInformationContainer
localDomainInfo
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DomainInformationContainer
remoteDomainInfo
instance Prelude.NFData InboundConnection where
rnf :: InboundConnection -> ()
rnf InboundConnection' {Maybe Text
Maybe DomainInformationContainer
Maybe InboundConnectionStatus
remoteDomainInfo :: Maybe DomainInformationContainer
localDomainInfo :: Maybe DomainInformationContainer
connectionStatus :: Maybe InboundConnectionStatus
connectionId :: Maybe Text
$sel:remoteDomainInfo:InboundConnection' :: InboundConnection -> Maybe DomainInformationContainer
$sel:localDomainInfo:InboundConnection' :: InboundConnection -> Maybe DomainInformationContainer
$sel:connectionStatus:InboundConnection' :: InboundConnection -> Maybe InboundConnectionStatus
$sel:connectionId:InboundConnection' :: InboundConnection -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InboundConnectionStatus
connectionStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DomainInformationContainer
localDomainInfo
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DomainInformationContainer
remoteDomainInfo