{-# 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.DirectConnectGateway where
import qualified Amazonka.Core as Core
import Amazonka.DirectConnect.Types.DirectConnectGatewayState
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DirectConnectGateway = DirectConnectGateway'
{
DirectConnectGateway -> Maybe Text
directConnectGatewayId :: Prelude.Maybe Prelude.Text,
DirectConnectGateway -> Maybe Text
stateChangeError :: Prelude.Maybe Prelude.Text,
DirectConnectGateway -> Maybe Integer
amazonSideAsn :: Prelude.Maybe Prelude.Integer,
DirectConnectGateway -> Maybe Text
directConnectGatewayName :: Prelude.Maybe Prelude.Text,
DirectConnectGateway -> Maybe DirectConnectGatewayState
directConnectGatewayState :: Prelude.Maybe DirectConnectGatewayState,
DirectConnectGateway -> Maybe Text
ownerAccount :: Prelude.Maybe Prelude.Text
}
deriving (DirectConnectGateway -> DirectConnectGateway -> Bool
(DirectConnectGateway -> DirectConnectGateway -> Bool)
-> (DirectConnectGateway -> DirectConnectGateway -> Bool)
-> Eq DirectConnectGateway
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DirectConnectGateway -> DirectConnectGateway -> Bool
$c/= :: DirectConnectGateway -> DirectConnectGateway -> Bool
== :: DirectConnectGateway -> DirectConnectGateway -> Bool
$c== :: DirectConnectGateway -> DirectConnectGateway -> Bool
Prelude.Eq, ReadPrec [DirectConnectGateway]
ReadPrec DirectConnectGateway
Int -> ReadS DirectConnectGateway
ReadS [DirectConnectGateway]
(Int -> ReadS DirectConnectGateway)
-> ReadS [DirectConnectGateway]
-> ReadPrec DirectConnectGateway
-> ReadPrec [DirectConnectGateway]
-> Read DirectConnectGateway
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DirectConnectGateway]
$creadListPrec :: ReadPrec [DirectConnectGateway]
readPrec :: ReadPrec DirectConnectGateway
$creadPrec :: ReadPrec DirectConnectGateway
readList :: ReadS [DirectConnectGateway]
$creadList :: ReadS [DirectConnectGateway]
readsPrec :: Int -> ReadS DirectConnectGateway
$creadsPrec :: Int -> ReadS DirectConnectGateway
Prelude.Read, Int -> DirectConnectGateway -> ShowS
[DirectConnectGateway] -> ShowS
DirectConnectGateway -> String
(Int -> DirectConnectGateway -> ShowS)
-> (DirectConnectGateway -> String)
-> ([DirectConnectGateway] -> ShowS)
-> Show DirectConnectGateway
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DirectConnectGateway] -> ShowS
$cshowList :: [DirectConnectGateway] -> ShowS
show :: DirectConnectGateway -> String
$cshow :: DirectConnectGateway -> String
showsPrec :: Int -> DirectConnectGateway -> ShowS
$cshowsPrec :: Int -> DirectConnectGateway -> ShowS
Prelude.Show, (forall x. DirectConnectGateway -> Rep DirectConnectGateway x)
-> (forall x. Rep DirectConnectGateway x -> DirectConnectGateway)
-> Generic DirectConnectGateway
forall x. Rep DirectConnectGateway x -> DirectConnectGateway
forall x. DirectConnectGateway -> Rep DirectConnectGateway x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DirectConnectGateway x -> DirectConnectGateway
$cfrom :: forall x. DirectConnectGateway -> Rep DirectConnectGateway x
Prelude.Generic)
newDirectConnectGateway ::
DirectConnectGateway
newDirectConnectGateway :: DirectConnectGateway
newDirectConnectGateway =
DirectConnectGateway' :: Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe DirectConnectGatewayState
-> Maybe Text
-> DirectConnectGateway
DirectConnectGateway'
{ $sel:directConnectGatewayId:DirectConnectGateway' :: Maybe Text
directConnectGatewayId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:stateChangeError:DirectConnectGateway' :: Maybe Text
stateChangeError = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:amazonSideAsn:DirectConnectGateway' :: Maybe Integer
amazonSideAsn = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:directConnectGatewayName:DirectConnectGateway' :: Maybe Text
directConnectGatewayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:directConnectGatewayState:DirectConnectGateway' :: Maybe DirectConnectGatewayState
directConnectGatewayState = Maybe DirectConnectGatewayState
forall a. Maybe a
Prelude.Nothing,
$sel:ownerAccount:DirectConnectGateway' :: Maybe Text
ownerAccount = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
directConnectGateway_directConnectGatewayId :: Lens.Lens' DirectConnectGateway (Prelude.Maybe Prelude.Text)
directConnectGateway_directConnectGatewayId :: (Maybe Text -> f (Maybe Text))
-> DirectConnectGateway -> f DirectConnectGateway
directConnectGateway_directConnectGatewayId = (DirectConnectGateway -> Maybe Text)
-> (DirectConnectGateway -> Maybe Text -> DirectConnectGateway)
-> Lens
DirectConnectGateway DirectConnectGateway (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGateway' {Maybe Text
directConnectGatewayId :: Maybe Text
$sel:directConnectGatewayId:DirectConnectGateway' :: DirectConnectGateway -> Maybe Text
directConnectGatewayId} -> Maybe Text
directConnectGatewayId) (\s :: DirectConnectGateway
s@DirectConnectGateway' {} Maybe Text
a -> DirectConnectGateway
s {$sel:directConnectGatewayId:DirectConnectGateway' :: Maybe Text
directConnectGatewayId = Maybe Text
a} :: DirectConnectGateway)
directConnectGateway_stateChangeError :: Lens.Lens' DirectConnectGateway (Prelude.Maybe Prelude.Text)
directConnectGateway_stateChangeError :: (Maybe Text -> f (Maybe Text))
-> DirectConnectGateway -> f DirectConnectGateway
directConnectGateway_stateChangeError = (DirectConnectGateway -> Maybe Text)
-> (DirectConnectGateway -> Maybe Text -> DirectConnectGateway)
-> Lens
DirectConnectGateway DirectConnectGateway (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGateway' {Maybe Text
stateChangeError :: Maybe Text
$sel:stateChangeError:DirectConnectGateway' :: DirectConnectGateway -> Maybe Text
stateChangeError} -> Maybe Text
stateChangeError) (\s :: DirectConnectGateway
s@DirectConnectGateway' {} Maybe Text
a -> DirectConnectGateway
s {$sel:stateChangeError:DirectConnectGateway' :: Maybe Text
stateChangeError = Maybe Text
a} :: DirectConnectGateway)
directConnectGateway_amazonSideAsn :: Lens.Lens' DirectConnectGateway (Prelude.Maybe Prelude.Integer)
directConnectGateway_amazonSideAsn :: (Maybe Integer -> f (Maybe Integer))
-> DirectConnectGateway -> f DirectConnectGateway
directConnectGateway_amazonSideAsn = (DirectConnectGateway -> Maybe Integer)
-> (DirectConnectGateway -> Maybe Integer -> DirectConnectGateway)
-> Lens
DirectConnectGateway
DirectConnectGateway
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGateway' {Maybe Integer
amazonSideAsn :: Maybe Integer
$sel:amazonSideAsn:DirectConnectGateway' :: DirectConnectGateway -> Maybe Integer
amazonSideAsn} -> Maybe Integer
amazonSideAsn) (\s :: DirectConnectGateway
s@DirectConnectGateway' {} Maybe Integer
a -> DirectConnectGateway
s {$sel:amazonSideAsn:DirectConnectGateway' :: Maybe Integer
amazonSideAsn = Maybe Integer
a} :: DirectConnectGateway)
directConnectGateway_directConnectGatewayName :: Lens.Lens' DirectConnectGateway (Prelude.Maybe Prelude.Text)
directConnectGateway_directConnectGatewayName :: (Maybe Text -> f (Maybe Text))
-> DirectConnectGateway -> f DirectConnectGateway
directConnectGateway_directConnectGatewayName = (DirectConnectGateway -> Maybe Text)
-> (DirectConnectGateway -> Maybe Text -> DirectConnectGateway)
-> Lens
DirectConnectGateway DirectConnectGateway (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGateway' {Maybe Text
directConnectGatewayName :: Maybe Text
$sel:directConnectGatewayName:DirectConnectGateway' :: DirectConnectGateway -> Maybe Text
directConnectGatewayName} -> Maybe Text
directConnectGatewayName) (\s :: DirectConnectGateway
s@DirectConnectGateway' {} Maybe Text
a -> DirectConnectGateway
s {$sel:directConnectGatewayName:DirectConnectGateway' :: Maybe Text
directConnectGatewayName = Maybe Text
a} :: DirectConnectGateway)
directConnectGateway_directConnectGatewayState :: Lens.Lens' DirectConnectGateway (Prelude.Maybe DirectConnectGatewayState)
directConnectGateway_directConnectGatewayState :: (Maybe DirectConnectGatewayState
-> f (Maybe DirectConnectGatewayState))
-> DirectConnectGateway -> f DirectConnectGateway
directConnectGateway_directConnectGatewayState = (DirectConnectGateway -> Maybe DirectConnectGatewayState)
-> (DirectConnectGateway
-> Maybe DirectConnectGatewayState -> DirectConnectGateway)
-> Lens
DirectConnectGateway
DirectConnectGateway
(Maybe DirectConnectGatewayState)
(Maybe DirectConnectGatewayState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGateway' {Maybe DirectConnectGatewayState
directConnectGatewayState :: Maybe DirectConnectGatewayState
$sel:directConnectGatewayState:DirectConnectGateway' :: DirectConnectGateway -> Maybe DirectConnectGatewayState
directConnectGatewayState} -> Maybe DirectConnectGatewayState
directConnectGatewayState) (\s :: DirectConnectGateway
s@DirectConnectGateway' {} Maybe DirectConnectGatewayState
a -> DirectConnectGateway
s {$sel:directConnectGatewayState:DirectConnectGateway' :: Maybe DirectConnectGatewayState
directConnectGatewayState = Maybe DirectConnectGatewayState
a} :: DirectConnectGateway)
directConnectGateway_ownerAccount :: Lens.Lens' DirectConnectGateway (Prelude.Maybe Prelude.Text)
directConnectGateway_ownerAccount :: (Maybe Text -> f (Maybe Text))
-> DirectConnectGateway -> f DirectConnectGateway
directConnectGateway_ownerAccount = (DirectConnectGateway -> Maybe Text)
-> (DirectConnectGateway -> Maybe Text -> DirectConnectGateway)
-> Lens
DirectConnectGateway DirectConnectGateway (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectConnectGateway' {Maybe Text
ownerAccount :: Maybe Text
$sel:ownerAccount:DirectConnectGateway' :: DirectConnectGateway -> Maybe Text
ownerAccount} -> Maybe Text
ownerAccount) (\s :: DirectConnectGateway
s@DirectConnectGateway' {} Maybe Text
a -> DirectConnectGateway
s {$sel:ownerAccount:DirectConnectGateway' :: Maybe Text
ownerAccount = Maybe Text
a} :: DirectConnectGateway)
instance Core.FromJSON DirectConnectGateway where
parseJSON :: Value -> Parser DirectConnectGateway
parseJSON =
String
-> (Object -> Parser DirectConnectGateway)
-> Value
-> Parser DirectConnectGateway
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DirectConnectGateway"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe DirectConnectGatewayState
-> Maybe Text
-> DirectConnectGateway
DirectConnectGateway'
(Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe DirectConnectGatewayState
-> Maybe Text
-> DirectConnectGateway)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe DirectConnectGatewayState
-> Maybe Text
-> DirectConnectGateway)
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
"directConnectGatewayId")
Parser
(Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe DirectConnectGatewayState
-> Maybe Text
-> DirectConnectGateway)
-> Parser (Maybe Text)
-> Parser
(Maybe Integer
-> Maybe Text
-> Maybe DirectConnectGatewayState
-> Maybe Text
-> DirectConnectGateway)
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
"stateChangeError")
Parser
(Maybe Integer
-> Maybe Text
-> Maybe DirectConnectGatewayState
-> Maybe Text
-> DirectConnectGateway)
-> Parser (Maybe Integer)
-> Parser
(Maybe Text
-> Maybe DirectConnectGatewayState
-> Maybe Text
-> DirectConnectGateway)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"amazonSideAsn")
Parser
(Maybe Text
-> Maybe DirectConnectGatewayState
-> Maybe Text
-> DirectConnectGateway)
-> Parser (Maybe Text)
-> Parser
(Maybe DirectConnectGatewayState
-> Maybe Text -> DirectConnectGateway)
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
"directConnectGatewayName")
Parser
(Maybe DirectConnectGatewayState
-> Maybe Text -> DirectConnectGateway)
-> Parser (Maybe DirectConnectGatewayState)
-> Parser (Maybe Text -> DirectConnectGateway)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DirectConnectGatewayState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"directConnectGatewayState")
Parser (Maybe Text -> DirectConnectGateway)
-> Parser (Maybe Text) -> Parser DirectConnectGateway
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")
)
instance Prelude.Hashable DirectConnectGateway
instance Prelude.NFData DirectConnectGateway