{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
{ $sel:message:OutboundConnectionStatus' :: Maybe Text
message =
forall a. Maybe a
Prelude.Nothing,
$sel:statusCode:OutboundConnectionStatus' :: Maybe OutboundConnectionStatusCode
statusCode = forall a. Maybe a
Prelude.Nothing
}
outboundConnectionStatus_message :: Lens.Lens' OutboundConnectionStatus (Prelude.Maybe Prelude.Text)
outboundConnectionStatus_message :: Lens' OutboundConnectionStatus (Maybe Text)
outboundConnectionStatus_message = 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 :: Lens' OutboundConnectionStatus (Maybe OutboundConnectionStatusCode)
outboundConnectionStatus_statusCode = 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 Data.FromJSON OutboundConnectionStatus where
parseJSON :: Value -> Parser OutboundConnectionStatus
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"OutboundConnectionStatus"
( \Object
x ->
Maybe Text
-> Maybe OutboundConnectionStatusCode -> OutboundConnectionStatus
OutboundConnectionStatus'
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
"Message")
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
"StatusCode")
)
instance Prelude.Hashable OutboundConnectionStatus where
hashWithSalt :: Int -> OutboundConnectionStatus -> Int
hashWithSalt Int
_salt OutboundConnectionStatus' {Maybe Text
Maybe OutboundConnectionStatusCode
statusCode :: Maybe OutboundConnectionStatusCode
message :: Maybe Text
$sel:statusCode:OutboundConnectionStatus' :: OutboundConnectionStatus -> Maybe OutboundConnectionStatusCode
$sel:message:OutboundConnectionStatus' :: OutboundConnectionStatus -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OutboundConnectionStatusCode
statusCode
instance Prelude.NFData OutboundConnectionStatus where
rnf :: OutboundConnectionStatus -> ()
rnf OutboundConnectionStatus' {Maybe Text
Maybe OutboundConnectionStatusCode
statusCode :: Maybe OutboundConnectionStatusCode
message :: Maybe Text
$sel:statusCode:OutboundConnectionStatus' :: OutboundConnectionStatus -> Maybe OutboundConnectionStatusCode
$sel:message:OutboundConnectionStatus' :: OutboundConnectionStatus -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OutboundConnectionStatusCode
statusCode