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