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