{-# 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.GameLift.CreateVpcPeeringConnection
(
CreateVpcPeeringConnection (..),
newCreateVpcPeeringConnection,
createVpcPeeringConnection_fleetId,
createVpcPeeringConnection_peerVpcAwsAccountId,
createVpcPeeringConnection_peerVpcId,
CreateVpcPeeringConnectionResponse (..),
newCreateVpcPeeringConnectionResponse,
createVpcPeeringConnectionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateVpcPeeringConnection = CreateVpcPeeringConnection'
{
CreateVpcPeeringConnection -> Text
fleetId :: Prelude.Text,
CreateVpcPeeringConnection -> Text
peerVpcAwsAccountId :: Prelude.Text,
CreateVpcPeeringConnection -> Text
peerVpcId :: Prelude.Text
}
deriving (CreateVpcPeeringConnection -> CreateVpcPeeringConnection -> Bool
(CreateVpcPeeringConnection -> CreateVpcPeeringConnection -> Bool)
-> (CreateVpcPeeringConnection
-> CreateVpcPeeringConnection -> Bool)
-> Eq CreateVpcPeeringConnection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVpcPeeringConnection -> CreateVpcPeeringConnection -> Bool
$c/= :: CreateVpcPeeringConnection -> CreateVpcPeeringConnection -> Bool
== :: CreateVpcPeeringConnection -> CreateVpcPeeringConnection -> Bool
$c== :: CreateVpcPeeringConnection -> CreateVpcPeeringConnection -> Bool
Prelude.Eq, ReadPrec [CreateVpcPeeringConnection]
ReadPrec CreateVpcPeeringConnection
Int -> ReadS CreateVpcPeeringConnection
ReadS [CreateVpcPeeringConnection]
(Int -> ReadS CreateVpcPeeringConnection)
-> ReadS [CreateVpcPeeringConnection]
-> ReadPrec CreateVpcPeeringConnection
-> ReadPrec [CreateVpcPeeringConnection]
-> Read CreateVpcPeeringConnection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVpcPeeringConnection]
$creadListPrec :: ReadPrec [CreateVpcPeeringConnection]
readPrec :: ReadPrec CreateVpcPeeringConnection
$creadPrec :: ReadPrec CreateVpcPeeringConnection
readList :: ReadS [CreateVpcPeeringConnection]
$creadList :: ReadS [CreateVpcPeeringConnection]
readsPrec :: Int -> ReadS CreateVpcPeeringConnection
$creadsPrec :: Int -> ReadS CreateVpcPeeringConnection
Prelude.Read, Int -> CreateVpcPeeringConnection -> ShowS
[CreateVpcPeeringConnection] -> ShowS
CreateVpcPeeringConnection -> String
(Int -> CreateVpcPeeringConnection -> ShowS)
-> (CreateVpcPeeringConnection -> String)
-> ([CreateVpcPeeringConnection] -> ShowS)
-> Show CreateVpcPeeringConnection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVpcPeeringConnection] -> ShowS
$cshowList :: [CreateVpcPeeringConnection] -> ShowS
show :: CreateVpcPeeringConnection -> String
$cshow :: CreateVpcPeeringConnection -> String
showsPrec :: Int -> CreateVpcPeeringConnection -> ShowS
$cshowsPrec :: Int -> CreateVpcPeeringConnection -> ShowS
Prelude.Show, (forall x.
CreateVpcPeeringConnection -> Rep CreateVpcPeeringConnection x)
-> (forall x.
Rep CreateVpcPeeringConnection x -> CreateVpcPeeringConnection)
-> Generic CreateVpcPeeringConnection
forall x.
Rep CreateVpcPeeringConnection x -> CreateVpcPeeringConnection
forall x.
CreateVpcPeeringConnection -> Rep CreateVpcPeeringConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateVpcPeeringConnection x -> CreateVpcPeeringConnection
$cfrom :: forall x.
CreateVpcPeeringConnection -> Rep CreateVpcPeeringConnection x
Prelude.Generic)
newCreateVpcPeeringConnection ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
CreateVpcPeeringConnection
newCreateVpcPeeringConnection :: Text -> Text -> Text -> CreateVpcPeeringConnection
newCreateVpcPeeringConnection
Text
pFleetId_
Text
pPeerVpcAwsAccountId_
Text
pPeerVpcId_ =
CreateVpcPeeringConnection' :: Text -> Text -> Text -> CreateVpcPeeringConnection
CreateVpcPeeringConnection'
{ $sel:fleetId:CreateVpcPeeringConnection' :: Text
fleetId = Text
pFleetId_,
$sel:peerVpcAwsAccountId:CreateVpcPeeringConnection' :: Text
peerVpcAwsAccountId = Text
pPeerVpcAwsAccountId_,
$sel:peerVpcId:CreateVpcPeeringConnection' :: Text
peerVpcId = Text
pPeerVpcId_
}
createVpcPeeringConnection_fleetId :: Lens.Lens' CreateVpcPeeringConnection Prelude.Text
createVpcPeeringConnection_fleetId :: (Text -> f Text)
-> CreateVpcPeeringConnection -> f CreateVpcPeeringConnection
createVpcPeeringConnection_fleetId = (CreateVpcPeeringConnection -> Text)
-> (CreateVpcPeeringConnection
-> Text -> CreateVpcPeeringConnection)
-> Lens
CreateVpcPeeringConnection CreateVpcPeeringConnection Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcPeeringConnection' {Text
fleetId :: Text
$sel:fleetId:CreateVpcPeeringConnection' :: CreateVpcPeeringConnection -> Text
fleetId} -> Text
fleetId) (\s :: CreateVpcPeeringConnection
s@CreateVpcPeeringConnection' {} Text
a -> CreateVpcPeeringConnection
s {$sel:fleetId:CreateVpcPeeringConnection' :: Text
fleetId = Text
a} :: CreateVpcPeeringConnection)
createVpcPeeringConnection_peerVpcAwsAccountId :: Lens.Lens' CreateVpcPeeringConnection Prelude.Text
createVpcPeeringConnection_peerVpcAwsAccountId :: (Text -> f Text)
-> CreateVpcPeeringConnection -> f CreateVpcPeeringConnection
createVpcPeeringConnection_peerVpcAwsAccountId = (CreateVpcPeeringConnection -> Text)
-> (CreateVpcPeeringConnection
-> Text -> CreateVpcPeeringConnection)
-> Lens
CreateVpcPeeringConnection CreateVpcPeeringConnection Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcPeeringConnection' {Text
peerVpcAwsAccountId :: Text
$sel:peerVpcAwsAccountId:CreateVpcPeeringConnection' :: CreateVpcPeeringConnection -> Text
peerVpcAwsAccountId} -> Text
peerVpcAwsAccountId) (\s :: CreateVpcPeeringConnection
s@CreateVpcPeeringConnection' {} Text
a -> CreateVpcPeeringConnection
s {$sel:peerVpcAwsAccountId:CreateVpcPeeringConnection' :: Text
peerVpcAwsAccountId = Text
a} :: CreateVpcPeeringConnection)
createVpcPeeringConnection_peerVpcId :: Lens.Lens' CreateVpcPeeringConnection Prelude.Text
createVpcPeeringConnection_peerVpcId :: (Text -> f Text)
-> CreateVpcPeeringConnection -> f CreateVpcPeeringConnection
createVpcPeeringConnection_peerVpcId = (CreateVpcPeeringConnection -> Text)
-> (CreateVpcPeeringConnection
-> Text -> CreateVpcPeeringConnection)
-> Lens
CreateVpcPeeringConnection CreateVpcPeeringConnection Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcPeeringConnection' {Text
peerVpcId :: Text
$sel:peerVpcId:CreateVpcPeeringConnection' :: CreateVpcPeeringConnection -> Text
peerVpcId} -> Text
peerVpcId) (\s :: CreateVpcPeeringConnection
s@CreateVpcPeeringConnection' {} Text
a -> CreateVpcPeeringConnection
s {$sel:peerVpcId:CreateVpcPeeringConnection' :: Text
peerVpcId = Text
a} :: CreateVpcPeeringConnection)
instance Core.AWSRequest CreateVpcPeeringConnection where
type
AWSResponse CreateVpcPeeringConnection =
CreateVpcPeeringConnectionResponse
request :: CreateVpcPeeringConnection -> Request CreateVpcPeeringConnection
request = Service
-> CreateVpcPeeringConnection -> Request CreateVpcPeeringConnection
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateVpcPeeringConnection
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateVpcPeeringConnection)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse CreateVpcPeeringConnection))
-> Logger
-> Service
-> Proxy CreateVpcPeeringConnection
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateVpcPeeringConnection)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> CreateVpcPeeringConnectionResponse
CreateVpcPeeringConnectionResponse'
(Int -> CreateVpcPeeringConnectionResponse)
-> Either String Int
-> Either String CreateVpcPeeringConnectionResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateVpcPeeringConnection
instance Prelude.NFData CreateVpcPeeringConnection
instance Core.ToHeaders CreateVpcPeeringConnection where
toHeaders :: CreateVpcPeeringConnection -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateVpcPeeringConnection -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"GameLift.CreateVpcPeeringConnection" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON CreateVpcPeeringConnection where
toJSON :: CreateVpcPeeringConnection -> Value
toJSON CreateVpcPeeringConnection' {Text
peerVpcId :: Text
peerVpcAwsAccountId :: Text
fleetId :: Text
$sel:peerVpcId:CreateVpcPeeringConnection' :: CreateVpcPeeringConnection -> Text
$sel:peerVpcAwsAccountId:CreateVpcPeeringConnection' :: CreateVpcPeeringConnection -> Text
$sel:fleetId:CreateVpcPeeringConnection' :: CreateVpcPeeringConnection -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"FleetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fleetId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"PeerVpcAwsAccountId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
peerVpcAwsAccountId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"PeerVpcId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
peerVpcId)
]
)
instance Core.ToPath CreateVpcPeeringConnection where
toPath :: CreateVpcPeeringConnection -> ByteString
toPath = ByteString -> CreateVpcPeeringConnection -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateVpcPeeringConnection where
toQuery :: CreateVpcPeeringConnection -> QueryString
toQuery = QueryString -> CreateVpcPeeringConnection -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateVpcPeeringConnectionResponse = CreateVpcPeeringConnectionResponse'
{
CreateVpcPeeringConnectionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateVpcPeeringConnectionResponse
-> CreateVpcPeeringConnectionResponse -> Bool
(CreateVpcPeeringConnectionResponse
-> CreateVpcPeeringConnectionResponse -> Bool)
-> (CreateVpcPeeringConnectionResponse
-> CreateVpcPeeringConnectionResponse -> Bool)
-> Eq CreateVpcPeeringConnectionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVpcPeeringConnectionResponse
-> CreateVpcPeeringConnectionResponse -> Bool
$c/= :: CreateVpcPeeringConnectionResponse
-> CreateVpcPeeringConnectionResponse -> Bool
== :: CreateVpcPeeringConnectionResponse
-> CreateVpcPeeringConnectionResponse -> Bool
$c== :: CreateVpcPeeringConnectionResponse
-> CreateVpcPeeringConnectionResponse -> Bool
Prelude.Eq, ReadPrec [CreateVpcPeeringConnectionResponse]
ReadPrec CreateVpcPeeringConnectionResponse
Int -> ReadS CreateVpcPeeringConnectionResponse
ReadS [CreateVpcPeeringConnectionResponse]
(Int -> ReadS CreateVpcPeeringConnectionResponse)
-> ReadS [CreateVpcPeeringConnectionResponse]
-> ReadPrec CreateVpcPeeringConnectionResponse
-> ReadPrec [CreateVpcPeeringConnectionResponse]
-> Read CreateVpcPeeringConnectionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVpcPeeringConnectionResponse]
$creadListPrec :: ReadPrec [CreateVpcPeeringConnectionResponse]
readPrec :: ReadPrec CreateVpcPeeringConnectionResponse
$creadPrec :: ReadPrec CreateVpcPeeringConnectionResponse
readList :: ReadS [CreateVpcPeeringConnectionResponse]
$creadList :: ReadS [CreateVpcPeeringConnectionResponse]
readsPrec :: Int -> ReadS CreateVpcPeeringConnectionResponse
$creadsPrec :: Int -> ReadS CreateVpcPeeringConnectionResponse
Prelude.Read, Int -> CreateVpcPeeringConnectionResponse -> ShowS
[CreateVpcPeeringConnectionResponse] -> ShowS
CreateVpcPeeringConnectionResponse -> String
(Int -> CreateVpcPeeringConnectionResponse -> ShowS)
-> (CreateVpcPeeringConnectionResponse -> String)
-> ([CreateVpcPeeringConnectionResponse] -> ShowS)
-> Show CreateVpcPeeringConnectionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVpcPeeringConnectionResponse] -> ShowS
$cshowList :: [CreateVpcPeeringConnectionResponse] -> ShowS
show :: CreateVpcPeeringConnectionResponse -> String
$cshow :: CreateVpcPeeringConnectionResponse -> String
showsPrec :: Int -> CreateVpcPeeringConnectionResponse -> ShowS
$cshowsPrec :: Int -> CreateVpcPeeringConnectionResponse -> ShowS
Prelude.Show, (forall x.
CreateVpcPeeringConnectionResponse
-> Rep CreateVpcPeeringConnectionResponse x)
-> (forall x.
Rep CreateVpcPeeringConnectionResponse x
-> CreateVpcPeeringConnectionResponse)
-> Generic CreateVpcPeeringConnectionResponse
forall x.
Rep CreateVpcPeeringConnectionResponse x
-> CreateVpcPeeringConnectionResponse
forall x.
CreateVpcPeeringConnectionResponse
-> Rep CreateVpcPeeringConnectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateVpcPeeringConnectionResponse x
-> CreateVpcPeeringConnectionResponse
$cfrom :: forall x.
CreateVpcPeeringConnectionResponse
-> Rep CreateVpcPeeringConnectionResponse x
Prelude.Generic)
newCreateVpcPeeringConnectionResponse ::
Prelude.Int ->
CreateVpcPeeringConnectionResponse
newCreateVpcPeeringConnectionResponse :: Int -> CreateVpcPeeringConnectionResponse
newCreateVpcPeeringConnectionResponse Int
pHttpStatus_ =
CreateVpcPeeringConnectionResponse' :: Int -> CreateVpcPeeringConnectionResponse
CreateVpcPeeringConnectionResponse'
{ $sel:httpStatus:CreateVpcPeeringConnectionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
createVpcPeeringConnectionResponse_httpStatus :: Lens.Lens' CreateVpcPeeringConnectionResponse Prelude.Int
createVpcPeeringConnectionResponse_httpStatus :: (Int -> f Int)
-> CreateVpcPeeringConnectionResponse
-> f CreateVpcPeeringConnectionResponse
createVpcPeeringConnectionResponse_httpStatus = (CreateVpcPeeringConnectionResponse -> Int)
-> (CreateVpcPeeringConnectionResponse
-> Int -> CreateVpcPeeringConnectionResponse)
-> Lens
CreateVpcPeeringConnectionResponse
CreateVpcPeeringConnectionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcPeeringConnectionResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateVpcPeeringConnectionResponse' :: CreateVpcPeeringConnectionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateVpcPeeringConnectionResponse
s@CreateVpcPeeringConnectionResponse' {} Int
a -> CreateVpcPeeringConnectionResponse
s {$sel:httpStatus:CreateVpcPeeringConnectionResponse' :: Int
httpStatus = Int
a} :: CreateVpcPeeringConnectionResponse)
instance
Prelude.NFData
CreateVpcPeeringConnectionResponse