{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.EC2.AssociateTransitGatewayRouteTable
(
AssociateTransitGatewayRouteTable (..),
newAssociateTransitGatewayRouteTable,
associateTransitGatewayRouteTable_dryRun,
associateTransitGatewayRouteTable_transitGatewayRouteTableId,
associateTransitGatewayRouteTable_transitGatewayAttachmentId,
AssociateTransitGatewayRouteTableResponse (..),
newAssociateTransitGatewayRouteTableResponse,
associateTransitGatewayRouteTableResponse_association,
associateTransitGatewayRouteTableResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data AssociateTransitGatewayRouteTable = AssociateTransitGatewayRouteTable'
{
AssociateTransitGatewayRouteTable -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
AssociateTransitGatewayRouteTable -> Text
transitGatewayRouteTableId :: Prelude.Text,
AssociateTransitGatewayRouteTable -> Text
transitGatewayAttachmentId :: Prelude.Text
}
deriving (AssociateTransitGatewayRouteTable
-> AssociateTransitGatewayRouteTable -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateTransitGatewayRouteTable
-> AssociateTransitGatewayRouteTable -> Bool
$c/= :: AssociateTransitGatewayRouteTable
-> AssociateTransitGatewayRouteTable -> Bool
== :: AssociateTransitGatewayRouteTable
-> AssociateTransitGatewayRouteTable -> Bool
$c== :: AssociateTransitGatewayRouteTable
-> AssociateTransitGatewayRouteTable -> Bool
Prelude.Eq, ReadPrec [AssociateTransitGatewayRouteTable]
ReadPrec AssociateTransitGatewayRouteTable
Int -> ReadS AssociateTransitGatewayRouteTable
ReadS [AssociateTransitGatewayRouteTable]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateTransitGatewayRouteTable]
$creadListPrec :: ReadPrec [AssociateTransitGatewayRouteTable]
readPrec :: ReadPrec AssociateTransitGatewayRouteTable
$creadPrec :: ReadPrec AssociateTransitGatewayRouteTable
readList :: ReadS [AssociateTransitGatewayRouteTable]
$creadList :: ReadS [AssociateTransitGatewayRouteTable]
readsPrec :: Int -> ReadS AssociateTransitGatewayRouteTable
$creadsPrec :: Int -> ReadS AssociateTransitGatewayRouteTable
Prelude.Read, Int -> AssociateTransitGatewayRouteTable -> ShowS
[AssociateTransitGatewayRouteTable] -> ShowS
AssociateTransitGatewayRouteTable -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateTransitGatewayRouteTable] -> ShowS
$cshowList :: [AssociateTransitGatewayRouteTable] -> ShowS
show :: AssociateTransitGatewayRouteTable -> String
$cshow :: AssociateTransitGatewayRouteTable -> String
showsPrec :: Int -> AssociateTransitGatewayRouteTable -> ShowS
$cshowsPrec :: Int -> AssociateTransitGatewayRouteTable -> ShowS
Prelude.Show, forall x.
Rep AssociateTransitGatewayRouteTable x
-> AssociateTransitGatewayRouteTable
forall x.
AssociateTransitGatewayRouteTable
-> Rep AssociateTransitGatewayRouteTable x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateTransitGatewayRouteTable x
-> AssociateTransitGatewayRouteTable
$cfrom :: forall x.
AssociateTransitGatewayRouteTable
-> Rep AssociateTransitGatewayRouteTable x
Prelude.Generic)
newAssociateTransitGatewayRouteTable ::
Prelude.Text ->
Prelude.Text ->
AssociateTransitGatewayRouteTable
newAssociateTransitGatewayRouteTable :: Text -> Text -> AssociateTransitGatewayRouteTable
newAssociateTransitGatewayRouteTable
Text
pTransitGatewayRouteTableId_
Text
pTransitGatewayAttachmentId_ =
AssociateTransitGatewayRouteTable'
{ $sel:dryRun:AssociateTransitGatewayRouteTable' :: Maybe Bool
dryRun =
forall a. Maybe a
Prelude.Nothing,
$sel:transitGatewayRouteTableId:AssociateTransitGatewayRouteTable' :: Text
transitGatewayRouteTableId =
Text
pTransitGatewayRouteTableId_,
$sel:transitGatewayAttachmentId:AssociateTransitGatewayRouteTable' :: Text
transitGatewayAttachmentId =
Text
pTransitGatewayAttachmentId_
}
associateTransitGatewayRouteTable_dryRun :: Lens.Lens' AssociateTransitGatewayRouteTable (Prelude.Maybe Prelude.Bool)
associateTransitGatewayRouteTable_dryRun :: Lens' AssociateTransitGatewayRouteTable (Maybe Bool)
associateTransitGatewayRouteTable_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTransitGatewayRouteTable' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:AssociateTransitGatewayRouteTable' :: AssociateTransitGatewayRouteTable -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: AssociateTransitGatewayRouteTable
s@AssociateTransitGatewayRouteTable' {} Maybe Bool
a -> AssociateTransitGatewayRouteTable
s {$sel:dryRun:AssociateTransitGatewayRouteTable' :: Maybe Bool
dryRun = Maybe Bool
a} :: AssociateTransitGatewayRouteTable)
associateTransitGatewayRouteTable_transitGatewayRouteTableId :: Lens.Lens' AssociateTransitGatewayRouteTable Prelude.Text
associateTransitGatewayRouteTable_transitGatewayRouteTableId :: Lens' AssociateTransitGatewayRouteTable Text
associateTransitGatewayRouteTable_transitGatewayRouteTableId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTransitGatewayRouteTable' {Text
transitGatewayRouteTableId :: Text
$sel:transitGatewayRouteTableId:AssociateTransitGatewayRouteTable' :: AssociateTransitGatewayRouteTable -> Text
transitGatewayRouteTableId} -> Text
transitGatewayRouteTableId) (\s :: AssociateTransitGatewayRouteTable
s@AssociateTransitGatewayRouteTable' {} Text
a -> AssociateTransitGatewayRouteTable
s {$sel:transitGatewayRouteTableId:AssociateTransitGatewayRouteTable' :: Text
transitGatewayRouteTableId = Text
a} :: AssociateTransitGatewayRouteTable)
associateTransitGatewayRouteTable_transitGatewayAttachmentId :: Lens.Lens' AssociateTransitGatewayRouteTable Prelude.Text
associateTransitGatewayRouteTable_transitGatewayAttachmentId :: Lens' AssociateTransitGatewayRouteTable Text
associateTransitGatewayRouteTable_transitGatewayAttachmentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTransitGatewayRouteTable' {Text
transitGatewayAttachmentId :: Text
$sel:transitGatewayAttachmentId:AssociateTransitGatewayRouteTable' :: AssociateTransitGatewayRouteTable -> Text
transitGatewayAttachmentId} -> Text
transitGatewayAttachmentId) (\s :: AssociateTransitGatewayRouteTable
s@AssociateTransitGatewayRouteTable' {} Text
a -> AssociateTransitGatewayRouteTable
s {$sel:transitGatewayAttachmentId:AssociateTransitGatewayRouteTable' :: Text
transitGatewayAttachmentId = Text
a} :: AssociateTransitGatewayRouteTable)
instance
Core.AWSRequest
AssociateTransitGatewayRouteTable
where
type
AWSResponse AssociateTransitGatewayRouteTable =
AssociateTransitGatewayRouteTableResponse
request :: (Service -> Service)
-> AssociateTransitGatewayRouteTable
-> Request AssociateTransitGatewayRouteTable
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy AssociateTransitGatewayRouteTable
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AssociateTransitGatewayRouteTable)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe TransitGatewayAssociation
-> Int -> AssociateTransitGatewayRouteTableResponse
AssociateTransitGatewayRouteTableResponse'
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
"association")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
AssociateTransitGatewayRouteTable
where
hashWithSalt :: Int -> AssociateTransitGatewayRouteTable -> Int
hashWithSalt
Int
_salt
AssociateTransitGatewayRouteTable' {Maybe Bool
Text
transitGatewayAttachmentId :: Text
transitGatewayRouteTableId :: Text
dryRun :: Maybe Bool
$sel:transitGatewayAttachmentId:AssociateTransitGatewayRouteTable' :: AssociateTransitGatewayRouteTable -> Text
$sel:transitGatewayRouteTableId:AssociateTransitGatewayRouteTable' :: AssociateTransitGatewayRouteTable -> Text
$sel:dryRun:AssociateTransitGatewayRouteTable' :: AssociateTransitGatewayRouteTable -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
transitGatewayRouteTableId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
transitGatewayAttachmentId
instance
Prelude.NFData
AssociateTransitGatewayRouteTable
where
rnf :: AssociateTransitGatewayRouteTable -> ()
rnf AssociateTransitGatewayRouteTable' {Maybe Bool
Text
transitGatewayAttachmentId :: Text
transitGatewayRouteTableId :: Text
dryRun :: Maybe Bool
$sel:transitGatewayAttachmentId:AssociateTransitGatewayRouteTable' :: AssociateTransitGatewayRouteTable -> Text
$sel:transitGatewayRouteTableId:AssociateTransitGatewayRouteTable' :: AssociateTransitGatewayRouteTable -> Text
$sel:dryRun:AssociateTransitGatewayRouteTable' :: AssociateTransitGatewayRouteTable -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
transitGatewayRouteTableId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
transitGatewayAttachmentId
instance
Data.ToHeaders
AssociateTransitGatewayRouteTable
where
toHeaders :: AssociateTransitGatewayRouteTable -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance
Data.ToPath
AssociateTransitGatewayRouteTable
where
toPath :: AssociateTransitGatewayRouteTable -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Data.ToQuery
AssociateTransitGatewayRouteTable
where
toQuery :: AssociateTransitGatewayRouteTable -> QueryString
toQuery AssociateTransitGatewayRouteTable' {Maybe Bool
Text
transitGatewayAttachmentId :: Text
transitGatewayRouteTableId :: Text
dryRun :: Maybe Bool
$sel:transitGatewayAttachmentId:AssociateTransitGatewayRouteTable' :: AssociateTransitGatewayRouteTable -> Text
$sel:transitGatewayRouteTableId:AssociateTransitGatewayRouteTable' :: AssociateTransitGatewayRouteTable -> Text
$sel:dryRun:AssociateTransitGatewayRouteTable' :: AssociateTransitGatewayRouteTable -> Maybe Bool
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"AssociateTransitGatewayRouteTable" ::
Prelude.ByteString
),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
ByteString
"TransitGatewayRouteTableId"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
transitGatewayRouteTableId,
ByteString
"TransitGatewayAttachmentId"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
transitGatewayAttachmentId
]
data AssociateTransitGatewayRouteTableResponse = AssociateTransitGatewayRouteTableResponse'
{
AssociateTransitGatewayRouteTableResponse
-> Maybe TransitGatewayAssociation
association :: Prelude.Maybe TransitGatewayAssociation,
AssociateTransitGatewayRouteTableResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AssociateTransitGatewayRouteTableResponse
-> AssociateTransitGatewayRouteTableResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateTransitGatewayRouteTableResponse
-> AssociateTransitGatewayRouteTableResponse -> Bool
$c/= :: AssociateTransitGatewayRouteTableResponse
-> AssociateTransitGatewayRouteTableResponse -> Bool
== :: AssociateTransitGatewayRouteTableResponse
-> AssociateTransitGatewayRouteTableResponse -> Bool
$c== :: AssociateTransitGatewayRouteTableResponse
-> AssociateTransitGatewayRouteTableResponse -> Bool
Prelude.Eq, ReadPrec [AssociateTransitGatewayRouteTableResponse]
ReadPrec AssociateTransitGatewayRouteTableResponse
Int -> ReadS AssociateTransitGatewayRouteTableResponse
ReadS [AssociateTransitGatewayRouteTableResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateTransitGatewayRouteTableResponse]
$creadListPrec :: ReadPrec [AssociateTransitGatewayRouteTableResponse]
readPrec :: ReadPrec AssociateTransitGatewayRouteTableResponse
$creadPrec :: ReadPrec AssociateTransitGatewayRouteTableResponse
readList :: ReadS [AssociateTransitGatewayRouteTableResponse]
$creadList :: ReadS [AssociateTransitGatewayRouteTableResponse]
readsPrec :: Int -> ReadS AssociateTransitGatewayRouteTableResponse
$creadsPrec :: Int -> ReadS AssociateTransitGatewayRouteTableResponse
Prelude.Read, Int -> AssociateTransitGatewayRouteTableResponse -> ShowS
[AssociateTransitGatewayRouteTableResponse] -> ShowS
AssociateTransitGatewayRouteTableResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateTransitGatewayRouteTableResponse] -> ShowS
$cshowList :: [AssociateTransitGatewayRouteTableResponse] -> ShowS
show :: AssociateTransitGatewayRouteTableResponse -> String
$cshow :: AssociateTransitGatewayRouteTableResponse -> String
showsPrec :: Int -> AssociateTransitGatewayRouteTableResponse -> ShowS
$cshowsPrec :: Int -> AssociateTransitGatewayRouteTableResponse -> ShowS
Prelude.Show, forall x.
Rep AssociateTransitGatewayRouteTableResponse x
-> AssociateTransitGatewayRouteTableResponse
forall x.
AssociateTransitGatewayRouteTableResponse
-> Rep AssociateTransitGatewayRouteTableResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateTransitGatewayRouteTableResponse x
-> AssociateTransitGatewayRouteTableResponse
$cfrom :: forall x.
AssociateTransitGatewayRouteTableResponse
-> Rep AssociateTransitGatewayRouteTableResponse x
Prelude.Generic)
newAssociateTransitGatewayRouteTableResponse ::
Prelude.Int ->
AssociateTransitGatewayRouteTableResponse
newAssociateTransitGatewayRouteTableResponse :: Int -> AssociateTransitGatewayRouteTableResponse
newAssociateTransitGatewayRouteTableResponse
Int
pHttpStatus_ =
AssociateTransitGatewayRouteTableResponse'
{ $sel:association:AssociateTransitGatewayRouteTableResponse' :: Maybe TransitGatewayAssociation
association =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:AssociateTransitGatewayRouteTableResponse' :: Int
httpStatus = Int
pHttpStatus_
}
associateTransitGatewayRouteTableResponse_association :: Lens.Lens' AssociateTransitGatewayRouteTableResponse (Prelude.Maybe TransitGatewayAssociation)
associateTransitGatewayRouteTableResponse_association :: Lens'
AssociateTransitGatewayRouteTableResponse
(Maybe TransitGatewayAssociation)
associateTransitGatewayRouteTableResponse_association = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTransitGatewayRouteTableResponse' {Maybe TransitGatewayAssociation
association :: Maybe TransitGatewayAssociation
$sel:association:AssociateTransitGatewayRouteTableResponse' :: AssociateTransitGatewayRouteTableResponse
-> Maybe TransitGatewayAssociation
association} -> Maybe TransitGatewayAssociation
association) (\s :: AssociateTransitGatewayRouteTableResponse
s@AssociateTransitGatewayRouteTableResponse' {} Maybe TransitGatewayAssociation
a -> AssociateTransitGatewayRouteTableResponse
s {$sel:association:AssociateTransitGatewayRouteTableResponse' :: Maybe TransitGatewayAssociation
association = Maybe TransitGatewayAssociation
a} :: AssociateTransitGatewayRouteTableResponse)
associateTransitGatewayRouteTableResponse_httpStatus :: Lens.Lens' AssociateTransitGatewayRouteTableResponse Prelude.Int
associateTransitGatewayRouteTableResponse_httpStatus :: Lens' AssociateTransitGatewayRouteTableResponse Int
associateTransitGatewayRouteTableResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTransitGatewayRouteTableResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateTransitGatewayRouteTableResponse' :: AssociateTransitGatewayRouteTableResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AssociateTransitGatewayRouteTableResponse
s@AssociateTransitGatewayRouteTableResponse' {} Int
a -> AssociateTransitGatewayRouteTableResponse
s {$sel:httpStatus:AssociateTransitGatewayRouteTableResponse' :: Int
httpStatus = Int
a} :: AssociateTransitGatewayRouteTableResponse)
instance
Prelude.NFData
AssociateTransitGatewayRouteTableResponse
where
rnf :: AssociateTransitGatewayRouteTableResponse -> ()
rnf AssociateTransitGatewayRouteTableResponse' {Int
Maybe TransitGatewayAssociation
httpStatus :: Int
association :: Maybe TransitGatewayAssociation
$sel:httpStatus:AssociateTransitGatewayRouteTableResponse' :: AssociateTransitGatewayRouteTableResponse -> Int
$sel:association:AssociateTransitGatewayRouteTableResponse' :: AssociateTransitGatewayRouteTableResponse
-> Maybe TransitGatewayAssociation
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe TransitGatewayAssociation
association
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus