{-# 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.DirectConnect.Types.VirtualGateway where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data VirtualGateway = VirtualGateway'
{
VirtualGateway -> Maybe Text
virtualGatewayId :: Prelude.Maybe Prelude.Text,
VirtualGateway -> Maybe Text
virtualGatewayState :: Prelude.Maybe Prelude.Text
}
deriving (VirtualGateway -> VirtualGateway -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VirtualGateway -> VirtualGateway -> Bool
$c/= :: VirtualGateway -> VirtualGateway -> Bool
== :: VirtualGateway -> VirtualGateway -> Bool
$c== :: VirtualGateway -> VirtualGateway -> Bool
Prelude.Eq, ReadPrec [VirtualGateway]
ReadPrec VirtualGateway
Int -> ReadS VirtualGateway
ReadS [VirtualGateway]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VirtualGateway]
$creadListPrec :: ReadPrec [VirtualGateway]
readPrec :: ReadPrec VirtualGateway
$creadPrec :: ReadPrec VirtualGateway
readList :: ReadS [VirtualGateway]
$creadList :: ReadS [VirtualGateway]
readsPrec :: Int -> ReadS VirtualGateway
$creadsPrec :: Int -> ReadS VirtualGateway
Prelude.Read, Int -> VirtualGateway -> ShowS
[VirtualGateway] -> ShowS
VirtualGateway -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VirtualGateway] -> ShowS
$cshowList :: [VirtualGateway] -> ShowS
show :: VirtualGateway -> String
$cshow :: VirtualGateway -> String
showsPrec :: Int -> VirtualGateway -> ShowS
$cshowsPrec :: Int -> VirtualGateway -> ShowS
Prelude.Show, forall x. Rep VirtualGateway x -> VirtualGateway
forall x. VirtualGateway -> Rep VirtualGateway x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VirtualGateway x -> VirtualGateway
$cfrom :: forall x. VirtualGateway -> Rep VirtualGateway x
Prelude.Generic)
newVirtualGateway ::
VirtualGateway
newVirtualGateway :: VirtualGateway
newVirtualGateway =
VirtualGateway'
{ $sel:virtualGatewayId:VirtualGateway' :: Maybe Text
virtualGatewayId = forall a. Maybe a
Prelude.Nothing,
$sel:virtualGatewayState:VirtualGateway' :: Maybe Text
virtualGatewayState = forall a. Maybe a
Prelude.Nothing
}
virtualGateway_virtualGatewayId :: Lens.Lens' VirtualGateway (Prelude.Maybe Prelude.Text)
virtualGateway_virtualGatewayId :: Lens' VirtualGateway (Maybe Text)
virtualGateway_virtualGatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualGateway' {Maybe Text
virtualGatewayId :: Maybe Text
$sel:virtualGatewayId:VirtualGateway' :: VirtualGateway -> Maybe Text
virtualGatewayId} -> Maybe Text
virtualGatewayId) (\s :: VirtualGateway
s@VirtualGateway' {} Maybe Text
a -> VirtualGateway
s {$sel:virtualGatewayId:VirtualGateway' :: Maybe Text
virtualGatewayId = Maybe Text
a} :: VirtualGateway)
virtualGateway_virtualGatewayState :: Lens.Lens' VirtualGateway (Prelude.Maybe Prelude.Text)
virtualGateway_virtualGatewayState :: Lens' VirtualGateway (Maybe Text)
virtualGateway_virtualGatewayState = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualGateway' {Maybe Text
virtualGatewayState :: Maybe Text
$sel:virtualGatewayState:VirtualGateway' :: VirtualGateway -> Maybe Text
virtualGatewayState} -> Maybe Text
virtualGatewayState) (\s :: VirtualGateway
s@VirtualGateway' {} Maybe Text
a -> VirtualGateway
s {$sel:virtualGatewayState:VirtualGateway' :: Maybe Text
virtualGatewayState = Maybe Text
a} :: VirtualGateway)
instance Data.FromJSON VirtualGateway where
parseJSON :: Value -> Parser VirtualGateway
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"VirtualGateway"
( \Object
x ->
Maybe Text -> Maybe Text -> VirtualGateway
VirtualGateway'
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
"virtualGatewayId")
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
"virtualGatewayState")
)
instance Prelude.Hashable VirtualGateway where
hashWithSalt :: Int -> VirtualGateway -> Int
hashWithSalt Int
_salt VirtualGateway' {Maybe Text
virtualGatewayState :: Maybe Text
virtualGatewayId :: Maybe Text
$sel:virtualGatewayState:VirtualGateway' :: VirtualGateway -> Maybe Text
$sel:virtualGatewayId:VirtualGateway' :: VirtualGateway -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
virtualGatewayId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
virtualGatewayState
instance Prelude.NFData VirtualGateway where
rnf :: VirtualGateway -> ()
rnf VirtualGateway' {Maybe Text
virtualGatewayState :: Maybe Text
virtualGatewayId :: Maybe Text
$sel:virtualGatewayState:VirtualGateway' :: VirtualGateway -> Maybe Text
$sel:virtualGatewayId:VirtualGateway' :: VirtualGateway -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
virtualGatewayId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
virtualGatewayState