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