{-# 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.InboundConnectionStatus where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpenSearch.Types.InboundConnectionStatusCode
import qualified Amazonka.Prelude as Prelude
data InboundConnectionStatus = InboundConnectionStatus'
{
InboundConnectionStatus -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
InboundConnectionStatus -> Maybe InboundConnectionStatusCode
statusCode :: Prelude.Maybe InboundConnectionStatusCode
}
deriving (InboundConnectionStatus -> InboundConnectionStatus -> Bool
(InboundConnectionStatus -> InboundConnectionStatus -> Bool)
-> (InboundConnectionStatus -> InboundConnectionStatus -> Bool)
-> Eq InboundConnectionStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InboundConnectionStatus -> InboundConnectionStatus -> Bool
$c/= :: InboundConnectionStatus -> InboundConnectionStatus -> Bool
== :: InboundConnectionStatus -> InboundConnectionStatus -> Bool
$c== :: InboundConnectionStatus -> InboundConnectionStatus -> Bool
Prelude.Eq, ReadPrec [InboundConnectionStatus]
ReadPrec InboundConnectionStatus
Int -> ReadS InboundConnectionStatus
ReadS [InboundConnectionStatus]
(Int -> ReadS InboundConnectionStatus)
-> ReadS [InboundConnectionStatus]
-> ReadPrec InboundConnectionStatus
-> ReadPrec [InboundConnectionStatus]
-> Read InboundConnectionStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InboundConnectionStatus]
$creadListPrec :: ReadPrec [InboundConnectionStatus]
readPrec :: ReadPrec InboundConnectionStatus
$creadPrec :: ReadPrec InboundConnectionStatus
readList :: ReadS [InboundConnectionStatus]
$creadList :: ReadS [InboundConnectionStatus]
readsPrec :: Int -> ReadS InboundConnectionStatus
$creadsPrec :: Int -> ReadS InboundConnectionStatus
Prelude.Read, Int -> InboundConnectionStatus -> ShowS
[InboundConnectionStatus] -> ShowS
InboundConnectionStatus -> String
(Int -> InboundConnectionStatus -> ShowS)
-> (InboundConnectionStatus -> String)
-> ([InboundConnectionStatus] -> ShowS)
-> Show InboundConnectionStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InboundConnectionStatus] -> ShowS
$cshowList :: [InboundConnectionStatus] -> ShowS
show :: InboundConnectionStatus -> String
$cshow :: InboundConnectionStatus -> String
showsPrec :: Int -> InboundConnectionStatus -> ShowS
$cshowsPrec :: Int -> InboundConnectionStatus -> ShowS
Prelude.Show, (forall x.
InboundConnectionStatus -> Rep InboundConnectionStatus x)
-> (forall x.
Rep InboundConnectionStatus x -> InboundConnectionStatus)
-> Generic InboundConnectionStatus
forall x. Rep InboundConnectionStatus x -> InboundConnectionStatus
forall x. InboundConnectionStatus -> Rep InboundConnectionStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InboundConnectionStatus x -> InboundConnectionStatus
$cfrom :: forall x. InboundConnectionStatus -> Rep InboundConnectionStatus x
Prelude.Generic)
newInboundConnectionStatus ::
InboundConnectionStatus
newInboundConnectionStatus :: InboundConnectionStatus
newInboundConnectionStatus =
InboundConnectionStatus' :: Maybe Text
-> Maybe InboundConnectionStatusCode -> InboundConnectionStatus
InboundConnectionStatus'
{ $sel:message:InboundConnectionStatus' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:statusCode:InboundConnectionStatus' :: Maybe InboundConnectionStatusCode
statusCode = Maybe InboundConnectionStatusCode
forall a. Maybe a
Prelude.Nothing
}
inboundConnectionStatus_message :: Lens.Lens' InboundConnectionStatus (Prelude.Maybe Prelude.Text)
inboundConnectionStatus_message :: (Maybe Text -> f (Maybe Text))
-> InboundConnectionStatus -> f InboundConnectionStatus
inboundConnectionStatus_message = (InboundConnectionStatus -> Maybe Text)
-> (InboundConnectionStatus
-> Maybe Text -> InboundConnectionStatus)
-> Lens
InboundConnectionStatus
InboundConnectionStatus
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InboundConnectionStatus' {Maybe Text
message :: Maybe Text
$sel:message:InboundConnectionStatus' :: InboundConnectionStatus -> Maybe Text
message} -> Maybe Text
message) (\s :: InboundConnectionStatus
s@InboundConnectionStatus' {} Maybe Text
a -> InboundConnectionStatus
s {$sel:message:InboundConnectionStatus' :: Maybe Text
message = Maybe Text
a} :: InboundConnectionStatus)
inboundConnectionStatus_statusCode :: Lens.Lens' InboundConnectionStatus (Prelude.Maybe InboundConnectionStatusCode)
inboundConnectionStatus_statusCode :: (Maybe InboundConnectionStatusCode
-> f (Maybe InboundConnectionStatusCode))
-> InboundConnectionStatus -> f InboundConnectionStatus
inboundConnectionStatus_statusCode = (InboundConnectionStatus -> Maybe InboundConnectionStatusCode)
-> (InboundConnectionStatus
-> Maybe InboundConnectionStatusCode -> InboundConnectionStatus)
-> Lens
InboundConnectionStatus
InboundConnectionStatus
(Maybe InboundConnectionStatusCode)
(Maybe InboundConnectionStatusCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InboundConnectionStatus' {Maybe InboundConnectionStatusCode
statusCode :: Maybe InboundConnectionStatusCode
$sel:statusCode:InboundConnectionStatus' :: InboundConnectionStatus -> Maybe InboundConnectionStatusCode
statusCode} -> Maybe InboundConnectionStatusCode
statusCode) (\s :: InboundConnectionStatus
s@InboundConnectionStatus' {} Maybe InboundConnectionStatusCode
a -> InboundConnectionStatus
s {$sel:statusCode:InboundConnectionStatus' :: Maybe InboundConnectionStatusCode
statusCode = Maybe InboundConnectionStatusCode
a} :: InboundConnectionStatus)
instance Core.FromJSON InboundConnectionStatus where
parseJSON :: Value -> Parser InboundConnectionStatus
parseJSON =
String
-> (Object -> Parser InboundConnectionStatus)
-> Value
-> Parser InboundConnectionStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InboundConnectionStatus"
( \Object
x ->
Maybe Text
-> Maybe InboundConnectionStatusCode -> InboundConnectionStatus
InboundConnectionStatus'
(Maybe Text
-> Maybe InboundConnectionStatusCode -> InboundConnectionStatus)
-> Parser (Maybe Text)
-> Parser
(Maybe InboundConnectionStatusCode -> InboundConnectionStatus)
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
"Message")
Parser
(Maybe InboundConnectionStatusCode -> InboundConnectionStatus)
-> Parser (Maybe InboundConnectionStatusCode)
-> Parser InboundConnectionStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InboundConnectionStatusCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StatusCode")
)
instance Prelude.Hashable InboundConnectionStatus
instance Prelude.NFData InboundConnectionStatus