{-# 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.CreateRouteTable
(
CreateRouteTable (..),
newCreateRouteTable,
createRouteTable_dryRun,
createRouteTable_tagSpecifications,
createRouteTable_vpcId,
CreateRouteTableResponse (..),
newCreateRouteTableResponse,
createRouteTableResponse_routeTable,
createRouteTableResponse_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 CreateRouteTable = CreateRouteTable'
{
CreateRouteTable -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
CreateRouteTable -> Maybe [TagSpecification]
tagSpecifications :: Prelude.Maybe [TagSpecification],
CreateRouteTable -> Text
vpcId :: Prelude.Text
}
deriving (CreateRouteTable -> CreateRouteTable -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRouteTable -> CreateRouteTable -> Bool
$c/= :: CreateRouteTable -> CreateRouteTable -> Bool
== :: CreateRouteTable -> CreateRouteTable -> Bool
$c== :: CreateRouteTable -> CreateRouteTable -> Bool
Prelude.Eq, ReadPrec [CreateRouteTable]
ReadPrec CreateRouteTable
Int -> ReadS CreateRouteTable
ReadS [CreateRouteTable]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateRouteTable]
$creadListPrec :: ReadPrec [CreateRouteTable]
readPrec :: ReadPrec CreateRouteTable
$creadPrec :: ReadPrec CreateRouteTable
readList :: ReadS [CreateRouteTable]
$creadList :: ReadS [CreateRouteTable]
readsPrec :: Int -> ReadS CreateRouteTable
$creadsPrec :: Int -> ReadS CreateRouteTable
Prelude.Read, Int -> CreateRouteTable -> ShowS
[CreateRouteTable] -> ShowS
CreateRouteTable -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRouteTable] -> ShowS
$cshowList :: [CreateRouteTable] -> ShowS
show :: CreateRouteTable -> String
$cshow :: CreateRouteTable -> String
showsPrec :: Int -> CreateRouteTable -> ShowS
$cshowsPrec :: Int -> CreateRouteTable -> ShowS
Prelude.Show, forall x. Rep CreateRouteTable x -> CreateRouteTable
forall x. CreateRouteTable -> Rep CreateRouteTable x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateRouteTable x -> CreateRouteTable
$cfrom :: forall x. CreateRouteTable -> Rep CreateRouteTable x
Prelude.Generic)
newCreateRouteTable ::
Prelude.Text ->
CreateRouteTable
newCreateRouteTable :: Text -> CreateRouteTable
newCreateRouteTable Text
pVpcId_ =
CreateRouteTable'
{ $sel:dryRun:CreateRouteTable' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
$sel:tagSpecifications:CreateRouteTable' :: Maybe [TagSpecification]
tagSpecifications = forall a. Maybe a
Prelude.Nothing,
$sel:vpcId:CreateRouteTable' :: Text
vpcId = Text
pVpcId_
}
createRouteTable_dryRun :: Lens.Lens' CreateRouteTable (Prelude.Maybe Prelude.Bool)
createRouteTable_dryRun :: Lens' CreateRouteTable (Maybe Bool)
createRouteTable_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteTable' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:CreateRouteTable' :: CreateRouteTable -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: CreateRouteTable
s@CreateRouteTable' {} Maybe Bool
a -> CreateRouteTable
s {$sel:dryRun:CreateRouteTable' :: Maybe Bool
dryRun = Maybe Bool
a} :: CreateRouteTable)
createRouteTable_tagSpecifications :: Lens.Lens' CreateRouteTable (Prelude.Maybe [TagSpecification])
createRouteTable_tagSpecifications :: Lens' CreateRouteTable (Maybe [TagSpecification])
createRouteTable_tagSpecifications = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteTable' {Maybe [TagSpecification]
tagSpecifications :: Maybe [TagSpecification]
$sel:tagSpecifications:CreateRouteTable' :: CreateRouteTable -> Maybe [TagSpecification]
tagSpecifications} -> Maybe [TagSpecification]
tagSpecifications) (\s :: CreateRouteTable
s@CreateRouteTable' {} Maybe [TagSpecification]
a -> CreateRouteTable
s {$sel:tagSpecifications:CreateRouteTable' :: Maybe [TagSpecification]
tagSpecifications = Maybe [TagSpecification]
a} :: CreateRouteTable) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createRouteTable_vpcId :: Lens.Lens' CreateRouteTable Prelude.Text
createRouteTable_vpcId :: Lens' CreateRouteTable Text
createRouteTable_vpcId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteTable' {Text
vpcId :: Text
$sel:vpcId:CreateRouteTable' :: CreateRouteTable -> Text
vpcId} -> Text
vpcId) (\s :: CreateRouteTable
s@CreateRouteTable' {} Text
a -> CreateRouteTable
s {$sel:vpcId:CreateRouteTable' :: Text
vpcId = Text
a} :: CreateRouteTable)
instance Core.AWSRequest CreateRouteTable where
type
AWSResponse CreateRouteTable =
CreateRouteTableResponse
request :: (Service -> Service)
-> CreateRouteTable -> Request CreateRouteTable
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 CreateRouteTable
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateRouteTable)))
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 RouteTable -> Int -> CreateRouteTableResponse
CreateRouteTableResponse'
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
"routeTable")
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 CreateRouteTable where
hashWithSalt :: Int -> CreateRouteTable -> Int
hashWithSalt Int
_salt CreateRouteTable' {Maybe Bool
Maybe [TagSpecification]
Text
vpcId :: Text
tagSpecifications :: Maybe [TagSpecification]
dryRun :: Maybe Bool
$sel:vpcId:CreateRouteTable' :: CreateRouteTable -> Text
$sel:tagSpecifications:CreateRouteTable' :: CreateRouteTable -> Maybe [TagSpecification]
$sel:dryRun:CreateRouteTable' :: CreateRouteTable -> 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` Maybe [TagSpecification]
tagSpecifications
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vpcId
instance Prelude.NFData CreateRouteTable where
rnf :: CreateRouteTable -> ()
rnf CreateRouteTable' {Maybe Bool
Maybe [TagSpecification]
Text
vpcId :: Text
tagSpecifications :: Maybe [TagSpecification]
dryRun :: Maybe Bool
$sel:vpcId:CreateRouteTable' :: CreateRouteTable -> Text
$sel:tagSpecifications:CreateRouteTable' :: CreateRouteTable -> Maybe [TagSpecification]
$sel:dryRun:CreateRouteTable' :: CreateRouteTable -> 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 Maybe [TagSpecification]
tagSpecifications
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
vpcId
instance Data.ToHeaders CreateRouteTable where
toHeaders :: CreateRouteTable -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath CreateRouteTable where
toPath :: CreateRouteTable -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateRouteTable where
toQuery :: CreateRouteTable -> QueryString
toQuery CreateRouteTable' {Maybe Bool
Maybe [TagSpecification]
Text
vpcId :: Text
tagSpecifications :: Maybe [TagSpecification]
dryRun :: Maybe Bool
$sel:vpcId:CreateRouteTable' :: CreateRouteTable -> Text
$sel:tagSpecifications:CreateRouteTable' :: CreateRouteTable -> Maybe [TagSpecification]
$sel:dryRun:CreateRouteTable' :: CreateRouteTable -> Maybe Bool
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"CreateRouteTable" :: 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,
forall a. ToQuery a => a -> QueryString
Data.toQuery
( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"TagSpecification"
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TagSpecification]
tagSpecifications
),
ByteString
"VpcId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
vpcId
]
data CreateRouteTableResponse = CreateRouteTableResponse'
{
CreateRouteTableResponse -> Maybe RouteTable
routeTable :: Prelude.Maybe RouteTable,
CreateRouteTableResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateRouteTableResponse -> CreateRouteTableResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRouteTableResponse -> CreateRouteTableResponse -> Bool
$c/= :: CreateRouteTableResponse -> CreateRouteTableResponse -> Bool
== :: CreateRouteTableResponse -> CreateRouteTableResponse -> Bool
$c== :: CreateRouteTableResponse -> CreateRouteTableResponse -> Bool
Prelude.Eq, ReadPrec [CreateRouteTableResponse]
ReadPrec CreateRouteTableResponse
Int -> ReadS CreateRouteTableResponse
ReadS [CreateRouteTableResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateRouteTableResponse]
$creadListPrec :: ReadPrec [CreateRouteTableResponse]
readPrec :: ReadPrec CreateRouteTableResponse
$creadPrec :: ReadPrec CreateRouteTableResponse
readList :: ReadS [CreateRouteTableResponse]
$creadList :: ReadS [CreateRouteTableResponse]
readsPrec :: Int -> ReadS CreateRouteTableResponse
$creadsPrec :: Int -> ReadS CreateRouteTableResponse
Prelude.Read, Int -> CreateRouteTableResponse -> ShowS
[CreateRouteTableResponse] -> ShowS
CreateRouteTableResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRouteTableResponse] -> ShowS
$cshowList :: [CreateRouteTableResponse] -> ShowS
show :: CreateRouteTableResponse -> String
$cshow :: CreateRouteTableResponse -> String
showsPrec :: Int -> CreateRouteTableResponse -> ShowS
$cshowsPrec :: Int -> CreateRouteTableResponse -> ShowS
Prelude.Show, forall x.
Rep CreateRouteTableResponse x -> CreateRouteTableResponse
forall x.
CreateRouteTableResponse -> Rep CreateRouteTableResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateRouteTableResponse x -> CreateRouteTableResponse
$cfrom :: forall x.
CreateRouteTableResponse -> Rep CreateRouteTableResponse x
Prelude.Generic)
newCreateRouteTableResponse ::
Prelude.Int ->
CreateRouteTableResponse
newCreateRouteTableResponse :: Int -> CreateRouteTableResponse
newCreateRouteTableResponse Int
pHttpStatus_ =
CreateRouteTableResponse'
{ $sel:routeTable:CreateRouteTableResponse' :: Maybe RouteTable
routeTable =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateRouteTableResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createRouteTableResponse_routeTable :: Lens.Lens' CreateRouteTableResponse (Prelude.Maybe RouteTable)
createRouteTableResponse_routeTable :: Lens' CreateRouteTableResponse (Maybe RouteTable)
createRouteTableResponse_routeTable = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteTableResponse' {Maybe RouteTable
routeTable :: Maybe RouteTable
$sel:routeTable:CreateRouteTableResponse' :: CreateRouteTableResponse -> Maybe RouteTable
routeTable} -> Maybe RouteTable
routeTable) (\s :: CreateRouteTableResponse
s@CreateRouteTableResponse' {} Maybe RouteTable
a -> CreateRouteTableResponse
s {$sel:routeTable:CreateRouteTableResponse' :: Maybe RouteTable
routeTable = Maybe RouteTable
a} :: CreateRouteTableResponse)
createRouteTableResponse_httpStatus :: Lens.Lens' CreateRouteTableResponse Prelude.Int
createRouteTableResponse_httpStatus :: Lens' CreateRouteTableResponse Int
createRouteTableResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteTableResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateRouteTableResponse' :: CreateRouteTableResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateRouteTableResponse
s@CreateRouteTableResponse' {} Int
a -> CreateRouteTableResponse
s {$sel:httpStatus:CreateRouteTableResponse' :: Int
httpStatus = Int
a} :: CreateRouteTableResponse)
instance Prelude.NFData CreateRouteTableResponse where
rnf :: CreateRouteTableResponse -> ()
rnf CreateRouteTableResponse' {Int
Maybe RouteTable
httpStatus :: Int
routeTable :: Maybe RouteTable
$sel:httpStatus:CreateRouteTableResponse' :: CreateRouteTableResponse -> Int
$sel:routeTable:CreateRouteTableResponse' :: CreateRouteTableResponse -> Maybe RouteTable
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe RouteTable
routeTable
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus