{-# 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.EC2.Types.TransitGatewayRouteAttachment where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.TransitGatewayAttachmentResourceType
import qualified Amazonka.Prelude as Prelude
data TransitGatewayRouteAttachment = TransitGatewayRouteAttachment'
{
TransitGatewayRouteAttachment -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
TransitGatewayRouteAttachment
-> Maybe TransitGatewayAttachmentResourceType
resourceType :: Prelude.Maybe TransitGatewayAttachmentResourceType,
TransitGatewayRouteAttachment -> Maybe Text
transitGatewayAttachmentId :: Prelude.Maybe Prelude.Text
}
deriving (TransitGatewayRouteAttachment
-> TransitGatewayRouteAttachment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TransitGatewayRouteAttachment
-> TransitGatewayRouteAttachment -> Bool
$c/= :: TransitGatewayRouteAttachment
-> TransitGatewayRouteAttachment -> Bool
== :: TransitGatewayRouteAttachment
-> TransitGatewayRouteAttachment -> Bool
$c== :: TransitGatewayRouteAttachment
-> TransitGatewayRouteAttachment -> Bool
Prelude.Eq, ReadPrec [TransitGatewayRouteAttachment]
ReadPrec TransitGatewayRouteAttachment
Int -> ReadS TransitGatewayRouteAttachment
ReadS [TransitGatewayRouteAttachment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TransitGatewayRouteAttachment]
$creadListPrec :: ReadPrec [TransitGatewayRouteAttachment]
readPrec :: ReadPrec TransitGatewayRouteAttachment
$creadPrec :: ReadPrec TransitGatewayRouteAttachment
readList :: ReadS [TransitGatewayRouteAttachment]
$creadList :: ReadS [TransitGatewayRouteAttachment]
readsPrec :: Int -> ReadS TransitGatewayRouteAttachment
$creadsPrec :: Int -> ReadS TransitGatewayRouteAttachment
Prelude.Read, Int -> TransitGatewayRouteAttachment -> ShowS
[TransitGatewayRouteAttachment] -> ShowS
TransitGatewayRouteAttachment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TransitGatewayRouteAttachment] -> ShowS
$cshowList :: [TransitGatewayRouteAttachment] -> ShowS
show :: TransitGatewayRouteAttachment -> String
$cshow :: TransitGatewayRouteAttachment -> String
showsPrec :: Int -> TransitGatewayRouteAttachment -> ShowS
$cshowsPrec :: Int -> TransitGatewayRouteAttachment -> ShowS
Prelude.Show, forall x.
Rep TransitGatewayRouteAttachment x
-> TransitGatewayRouteAttachment
forall x.
TransitGatewayRouteAttachment
-> Rep TransitGatewayRouteAttachment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TransitGatewayRouteAttachment x
-> TransitGatewayRouteAttachment
$cfrom :: forall x.
TransitGatewayRouteAttachment
-> Rep TransitGatewayRouteAttachment x
Prelude.Generic)
newTransitGatewayRouteAttachment ::
TransitGatewayRouteAttachment
newTransitGatewayRouteAttachment :: TransitGatewayRouteAttachment
newTransitGatewayRouteAttachment =
TransitGatewayRouteAttachment'
{ $sel:resourceId:TransitGatewayRouteAttachment' :: Maybe Text
resourceId =
forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:TransitGatewayRouteAttachment' :: Maybe TransitGatewayAttachmentResourceType
resourceType = forall a. Maybe a
Prelude.Nothing,
$sel:transitGatewayAttachmentId:TransitGatewayRouteAttachment' :: Maybe Text
transitGatewayAttachmentId = forall a. Maybe a
Prelude.Nothing
}
transitGatewayRouteAttachment_resourceId :: Lens.Lens' TransitGatewayRouteAttachment (Prelude.Maybe Prelude.Text)
transitGatewayRouteAttachment_resourceId :: Lens' TransitGatewayRouteAttachment (Maybe Text)
transitGatewayRouteAttachment_resourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransitGatewayRouteAttachment' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:TransitGatewayRouteAttachment' :: TransitGatewayRouteAttachment -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: TransitGatewayRouteAttachment
s@TransitGatewayRouteAttachment' {} Maybe Text
a -> TransitGatewayRouteAttachment
s {$sel:resourceId:TransitGatewayRouteAttachment' :: Maybe Text
resourceId = Maybe Text
a} :: TransitGatewayRouteAttachment)
transitGatewayRouteAttachment_resourceType :: Lens.Lens' TransitGatewayRouteAttachment (Prelude.Maybe TransitGatewayAttachmentResourceType)
transitGatewayRouteAttachment_resourceType :: Lens'
TransitGatewayRouteAttachment
(Maybe TransitGatewayAttachmentResourceType)
transitGatewayRouteAttachment_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransitGatewayRouteAttachment' {Maybe TransitGatewayAttachmentResourceType
resourceType :: Maybe TransitGatewayAttachmentResourceType
$sel:resourceType:TransitGatewayRouteAttachment' :: TransitGatewayRouteAttachment
-> Maybe TransitGatewayAttachmentResourceType
resourceType} -> Maybe TransitGatewayAttachmentResourceType
resourceType) (\s :: TransitGatewayRouteAttachment
s@TransitGatewayRouteAttachment' {} Maybe TransitGatewayAttachmentResourceType
a -> TransitGatewayRouteAttachment
s {$sel:resourceType:TransitGatewayRouteAttachment' :: Maybe TransitGatewayAttachmentResourceType
resourceType = Maybe TransitGatewayAttachmentResourceType
a} :: TransitGatewayRouteAttachment)
transitGatewayRouteAttachment_transitGatewayAttachmentId :: Lens.Lens' TransitGatewayRouteAttachment (Prelude.Maybe Prelude.Text)
transitGatewayRouteAttachment_transitGatewayAttachmentId :: Lens' TransitGatewayRouteAttachment (Maybe Text)
transitGatewayRouteAttachment_transitGatewayAttachmentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransitGatewayRouteAttachment' {Maybe Text
transitGatewayAttachmentId :: Maybe Text
$sel:transitGatewayAttachmentId:TransitGatewayRouteAttachment' :: TransitGatewayRouteAttachment -> Maybe Text
transitGatewayAttachmentId} -> Maybe Text
transitGatewayAttachmentId) (\s :: TransitGatewayRouteAttachment
s@TransitGatewayRouteAttachment' {} Maybe Text
a -> TransitGatewayRouteAttachment
s {$sel:transitGatewayAttachmentId:TransitGatewayRouteAttachment' :: Maybe Text
transitGatewayAttachmentId = Maybe Text
a} :: TransitGatewayRouteAttachment)
instance Data.FromXML TransitGatewayRouteAttachment where
parseXML :: [Node] -> Either String TransitGatewayRouteAttachment
parseXML [Node]
x =
Maybe Text
-> Maybe TransitGatewayAttachmentResourceType
-> Maybe Text
-> TransitGatewayRouteAttachment
TransitGatewayRouteAttachment'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"resourceId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"resourceType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"transitGatewayAttachmentId")
instance
Prelude.Hashable
TransitGatewayRouteAttachment
where
hashWithSalt :: Int -> TransitGatewayRouteAttachment -> Int
hashWithSalt Int
_salt TransitGatewayRouteAttachment' {Maybe Text
Maybe TransitGatewayAttachmentResourceType
transitGatewayAttachmentId :: Maybe Text
resourceType :: Maybe TransitGatewayAttachmentResourceType
resourceId :: Maybe Text
$sel:transitGatewayAttachmentId:TransitGatewayRouteAttachment' :: TransitGatewayRouteAttachment -> Maybe Text
$sel:resourceType:TransitGatewayRouteAttachment' :: TransitGatewayRouteAttachment
-> Maybe TransitGatewayAttachmentResourceType
$sel:resourceId:TransitGatewayRouteAttachment' :: TransitGatewayRouteAttachment -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TransitGatewayAttachmentResourceType
resourceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
transitGatewayAttachmentId
instance Prelude.NFData TransitGatewayRouteAttachment where
rnf :: TransitGatewayRouteAttachment -> ()
rnf TransitGatewayRouteAttachment' {Maybe Text
Maybe TransitGatewayAttachmentResourceType
transitGatewayAttachmentId :: Maybe Text
resourceType :: Maybe TransitGatewayAttachmentResourceType
resourceId :: Maybe Text
$sel:transitGatewayAttachmentId:TransitGatewayRouteAttachment' :: TransitGatewayRouteAttachment -> Maybe Text
$sel:resourceType:TransitGatewayRouteAttachment' :: TransitGatewayRouteAttachment
-> Maybe TransitGatewayAttachmentResourceType
$sel:resourceId:TransitGatewayRouteAttachment' :: TransitGatewayRouteAttachment -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TransitGatewayAttachmentResourceType
resourceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
transitGatewayAttachmentId