{-# 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.CreateVpcPeeringAuthorization
(
CreateVpcPeeringAuthorization (..),
newCreateVpcPeeringAuthorization,
createVpcPeeringAuthorization_gameLiftAwsAccountId,
createVpcPeeringAuthorization_peerVpcId,
CreateVpcPeeringAuthorizationResponse (..),
newCreateVpcPeeringAuthorizationResponse,
createVpcPeeringAuthorizationResponse_vpcPeeringAuthorization,
createVpcPeeringAuthorizationResponse_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 CreateVpcPeeringAuthorization = CreateVpcPeeringAuthorization'
{
CreateVpcPeeringAuthorization -> Text
gameLiftAwsAccountId :: Prelude.Text,
CreateVpcPeeringAuthorization -> Text
peerVpcId :: Prelude.Text
}
deriving (CreateVpcPeeringAuthorization
-> CreateVpcPeeringAuthorization -> Bool
(CreateVpcPeeringAuthorization
-> CreateVpcPeeringAuthorization -> Bool)
-> (CreateVpcPeeringAuthorization
-> CreateVpcPeeringAuthorization -> Bool)
-> Eq CreateVpcPeeringAuthorization
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVpcPeeringAuthorization
-> CreateVpcPeeringAuthorization -> Bool
$c/= :: CreateVpcPeeringAuthorization
-> CreateVpcPeeringAuthorization -> Bool
== :: CreateVpcPeeringAuthorization
-> CreateVpcPeeringAuthorization -> Bool
$c== :: CreateVpcPeeringAuthorization
-> CreateVpcPeeringAuthorization -> Bool
Prelude.Eq, ReadPrec [CreateVpcPeeringAuthorization]
ReadPrec CreateVpcPeeringAuthorization
Int -> ReadS CreateVpcPeeringAuthorization
ReadS [CreateVpcPeeringAuthorization]
(Int -> ReadS CreateVpcPeeringAuthorization)
-> ReadS [CreateVpcPeeringAuthorization]
-> ReadPrec CreateVpcPeeringAuthorization
-> ReadPrec [CreateVpcPeeringAuthorization]
-> Read CreateVpcPeeringAuthorization
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVpcPeeringAuthorization]
$creadListPrec :: ReadPrec [CreateVpcPeeringAuthorization]
readPrec :: ReadPrec CreateVpcPeeringAuthorization
$creadPrec :: ReadPrec CreateVpcPeeringAuthorization
readList :: ReadS [CreateVpcPeeringAuthorization]
$creadList :: ReadS [CreateVpcPeeringAuthorization]
readsPrec :: Int -> ReadS CreateVpcPeeringAuthorization
$creadsPrec :: Int -> ReadS CreateVpcPeeringAuthorization
Prelude.Read, Int -> CreateVpcPeeringAuthorization -> ShowS
[CreateVpcPeeringAuthorization] -> ShowS
CreateVpcPeeringAuthorization -> String
(Int -> CreateVpcPeeringAuthorization -> ShowS)
-> (CreateVpcPeeringAuthorization -> String)
-> ([CreateVpcPeeringAuthorization] -> ShowS)
-> Show CreateVpcPeeringAuthorization
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVpcPeeringAuthorization] -> ShowS
$cshowList :: [CreateVpcPeeringAuthorization] -> ShowS
show :: CreateVpcPeeringAuthorization -> String
$cshow :: CreateVpcPeeringAuthorization -> String
showsPrec :: Int -> CreateVpcPeeringAuthorization -> ShowS
$cshowsPrec :: Int -> CreateVpcPeeringAuthorization -> ShowS
Prelude.Show, (forall x.
CreateVpcPeeringAuthorization
-> Rep CreateVpcPeeringAuthorization x)
-> (forall x.
Rep CreateVpcPeeringAuthorization x
-> CreateVpcPeeringAuthorization)
-> Generic CreateVpcPeeringAuthorization
forall x.
Rep CreateVpcPeeringAuthorization x
-> CreateVpcPeeringAuthorization
forall x.
CreateVpcPeeringAuthorization
-> Rep CreateVpcPeeringAuthorization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateVpcPeeringAuthorization x
-> CreateVpcPeeringAuthorization
$cfrom :: forall x.
CreateVpcPeeringAuthorization
-> Rep CreateVpcPeeringAuthorization x
Prelude.Generic)
newCreateVpcPeeringAuthorization ::
Prelude.Text ->
Prelude.Text ->
CreateVpcPeeringAuthorization
newCreateVpcPeeringAuthorization :: Text -> Text -> CreateVpcPeeringAuthorization
newCreateVpcPeeringAuthorization
Text
pGameLiftAwsAccountId_
Text
pPeerVpcId_ =
CreateVpcPeeringAuthorization' :: Text -> Text -> CreateVpcPeeringAuthorization
CreateVpcPeeringAuthorization'
{ $sel:gameLiftAwsAccountId:CreateVpcPeeringAuthorization' :: Text
gameLiftAwsAccountId =
Text
pGameLiftAwsAccountId_,
$sel:peerVpcId:CreateVpcPeeringAuthorization' :: Text
peerVpcId = Text
pPeerVpcId_
}
createVpcPeeringAuthorization_gameLiftAwsAccountId :: Lens.Lens' CreateVpcPeeringAuthorization Prelude.Text
createVpcPeeringAuthorization_gameLiftAwsAccountId :: (Text -> f Text)
-> CreateVpcPeeringAuthorization -> f CreateVpcPeeringAuthorization
createVpcPeeringAuthorization_gameLiftAwsAccountId = (CreateVpcPeeringAuthorization -> Text)
-> (CreateVpcPeeringAuthorization
-> Text -> CreateVpcPeeringAuthorization)
-> Lens
CreateVpcPeeringAuthorization
CreateVpcPeeringAuthorization
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcPeeringAuthorization' {Text
gameLiftAwsAccountId :: Text
$sel:gameLiftAwsAccountId:CreateVpcPeeringAuthorization' :: CreateVpcPeeringAuthorization -> Text
gameLiftAwsAccountId} -> Text
gameLiftAwsAccountId) (\s :: CreateVpcPeeringAuthorization
s@CreateVpcPeeringAuthorization' {} Text
a -> CreateVpcPeeringAuthorization
s {$sel:gameLiftAwsAccountId:CreateVpcPeeringAuthorization' :: Text
gameLiftAwsAccountId = Text
a} :: CreateVpcPeeringAuthorization)
createVpcPeeringAuthorization_peerVpcId :: Lens.Lens' CreateVpcPeeringAuthorization Prelude.Text
createVpcPeeringAuthorization_peerVpcId :: (Text -> f Text)
-> CreateVpcPeeringAuthorization -> f CreateVpcPeeringAuthorization
createVpcPeeringAuthorization_peerVpcId = (CreateVpcPeeringAuthorization -> Text)
-> (CreateVpcPeeringAuthorization
-> Text -> CreateVpcPeeringAuthorization)
-> Lens
CreateVpcPeeringAuthorization
CreateVpcPeeringAuthorization
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcPeeringAuthorization' {Text
peerVpcId :: Text
$sel:peerVpcId:CreateVpcPeeringAuthorization' :: CreateVpcPeeringAuthorization -> Text
peerVpcId} -> Text
peerVpcId) (\s :: CreateVpcPeeringAuthorization
s@CreateVpcPeeringAuthorization' {} Text
a -> CreateVpcPeeringAuthorization
s {$sel:peerVpcId:CreateVpcPeeringAuthorization' :: Text
peerVpcId = Text
a} :: CreateVpcPeeringAuthorization)
instance
Core.AWSRequest
CreateVpcPeeringAuthorization
where
type
AWSResponse CreateVpcPeeringAuthorization =
CreateVpcPeeringAuthorizationResponse
request :: CreateVpcPeeringAuthorization
-> Request CreateVpcPeeringAuthorization
request = Service
-> CreateVpcPeeringAuthorization
-> Request CreateVpcPeeringAuthorization
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateVpcPeeringAuthorization
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateVpcPeeringAuthorization)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateVpcPeeringAuthorization))
-> Logger
-> Service
-> Proxy CreateVpcPeeringAuthorization
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateVpcPeeringAuthorization)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe VpcPeeringAuthorization
-> Int -> CreateVpcPeeringAuthorizationResponse
CreateVpcPeeringAuthorizationResponse'
(Maybe VpcPeeringAuthorization
-> Int -> CreateVpcPeeringAuthorizationResponse)
-> Either String (Maybe VpcPeeringAuthorization)
-> Either String (Int -> CreateVpcPeeringAuthorizationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe VpcPeeringAuthorization)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"VpcPeeringAuthorization")
Either String (Int -> CreateVpcPeeringAuthorizationResponse)
-> Either String Int
-> Either String CreateVpcPeeringAuthorizationResponse
forall (f :: * -> *) a b. Applicative f => 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
CreateVpcPeeringAuthorization
instance Prelude.NFData CreateVpcPeeringAuthorization
instance Core.ToHeaders CreateVpcPeeringAuthorization where
toHeaders :: CreateVpcPeeringAuthorization -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateVpcPeeringAuthorization -> 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.CreateVpcPeeringAuthorization" ::
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 CreateVpcPeeringAuthorization where
toJSON :: CreateVpcPeeringAuthorization -> Value
toJSON CreateVpcPeeringAuthorization' {Text
peerVpcId :: Text
gameLiftAwsAccountId :: Text
$sel:peerVpcId:CreateVpcPeeringAuthorization' :: CreateVpcPeeringAuthorization -> Text
$sel:gameLiftAwsAccountId:CreateVpcPeeringAuthorization' :: CreateVpcPeeringAuthorization -> 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
"GameLiftAwsAccountId"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
gameLiftAwsAccountId
),
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 CreateVpcPeeringAuthorization where
toPath :: CreateVpcPeeringAuthorization -> ByteString
toPath = ByteString -> CreateVpcPeeringAuthorization -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateVpcPeeringAuthorization where
toQuery :: CreateVpcPeeringAuthorization -> QueryString
toQuery = QueryString -> CreateVpcPeeringAuthorization -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateVpcPeeringAuthorizationResponse = CreateVpcPeeringAuthorizationResponse'
{
CreateVpcPeeringAuthorizationResponse
-> Maybe VpcPeeringAuthorization
vpcPeeringAuthorization :: Prelude.Maybe VpcPeeringAuthorization,
CreateVpcPeeringAuthorizationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateVpcPeeringAuthorizationResponse
-> CreateVpcPeeringAuthorizationResponse -> Bool
(CreateVpcPeeringAuthorizationResponse
-> CreateVpcPeeringAuthorizationResponse -> Bool)
-> (CreateVpcPeeringAuthorizationResponse
-> CreateVpcPeeringAuthorizationResponse -> Bool)
-> Eq CreateVpcPeeringAuthorizationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVpcPeeringAuthorizationResponse
-> CreateVpcPeeringAuthorizationResponse -> Bool
$c/= :: CreateVpcPeeringAuthorizationResponse
-> CreateVpcPeeringAuthorizationResponse -> Bool
== :: CreateVpcPeeringAuthorizationResponse
-> CreateVpcPeeringAuthorizationResponse -> Bool
$c== :: CreateVpcPeeringAuthorizationResponse
-> CreateVpcPeeringAuthorizationResponse -> Bool
Prelude.Eq, ReadPrec [CreateVpcPeeringAuthorizationResponse]
ReadPrec CreateVpcPeeringAuthorizationResponse
Int -> ReadS CreateVpcPeeringAuthorizationResponse
ReadS [CreateVpcPeeringAuthorizationResponse]
(Int -> ReadS CreateVpcPeeringAuthorizationResponse)
-> ReadS [CreateVpcPeeringAuthorizationResponse]
-> ReadPrec CreateVpcPeeringAuthorizationResponse
-> ReadPrec [CreateVpcPeeringAuthorizationResponse]
-> Read CreateVpcPeeringAuthorizationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVpcPeeringAuthorizationResponse]
$creadListPrec :: ReadPrec [CreateVpcPeeringAuthorizationResponse]
readPrec :: ReadPrec CreateVpcPeeringAuthorizationResponse
$creadPrec :: ReadPrec CreateVpcPeeringAuthorizationResponse
readList :: ReadS [CreateVpcPeeringAuthorizationResponse]
$creadList :: ReadS [CreateVpcPeeringAuthorizationResponse]
readsPrec :: Int -> ReadS CreateVpcPeeringAuthorizationResponse
$creadsPrec :: Int -> ReadS CreateVpcPeeringAuthorizationResponse
Prelude.Read, Int -> CreateVpcPeeringAuthorizationResponse -> ShowS
[CreateVpcPeeringAuthorizationResponse] -> ShowS
CreateVpcPeeringAuthorizationResponse -> String
(Int -> CreateVpcPeeringAuthorizationResponse -> ShowS)
-> (CreateVpcPeeringAuthorizationResponse -> String)
-> ([CreateVpcPeeringAuthorizationResponse] -> ShowS)
-> Show CreateVpcPeeringAuthorizationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVpcPeeringAuthorizationResponse] -> ShowS
$cshowList :: [CreateVpcPeeringAuthorizationResponse] -> ShowS
show :: CreateVpcPeeringAuthorizationResponse -> String
$cshow :: CreateVpcPeeringAuthorizationResponse -> String
showsPrec :: Int -> CreateVpcPeeringAuthorizationResponse -> ShowS
$cshowsPrec :: Int -> CreateVpcPeeringAuthorizationResponse -> ShowS
Prelude.Show, (forall x.
CreateVpcPeeringAuthorizationResponse
-> Rep CreateVpcPeeringAuthorizationResponse x)
-> (forall x.
Rep CreateVpcPeeringAuthorizationResponse x
-> CreateVpcPeeringAuthorizationResponse)
-> Generic CreateVpcPeeringAuthorizationResponse
forall x.
Rep CreateVpcPeeringAuthorizationResponse x
-> CreateVpcPeeringAuthorizationResponse
forall x.
CreateVpcPeeringAuthorizationResponse
-> Rep CreateVpcPeeringAuthorizationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateVpcPeeringAuthorizationResponse x
-> CreateVpcPeeringAuthorizationResponse
$cfrom :: forall x.
CreateVpcPeeringAuthorizationResponse
-> Rep CreateVpcPeeringAuthorizationResponse x
Prelude.Generic)
newCreateVpcPeeringAuthorizationResponse ::
Prelude.Int ->
CreateVpcPeeringAuthorizationResponse
newCreateVpcPeeringAuthorizationResponse :: Int -> CreateVpcPeeringAuthorizationResponse
newCreateVpcPeeringAuthorizationResponse Int
pHttpStatus_ =
CreateVpcPeeringAuthorizationResponse' :: Maybe VpcPeeringAuthorization
-> Int -> CreateVpcPeeringAuthorizationResponse
CreateVpcPeeringAuthorizationResponse'
{ $sel:vpcPeeringAuthorization:CreateVpcPeeringAuthorizationResponse' :: Maybe VpcPeeringAuthorization
vpcPeeringAuthorization =
Maybe VpcPeeringAuthorization
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateVpcPeeringAuthorizationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createVpcPeeringAuthorizationResponse_vpcPeeringAuthorization :: Lens.Lens' CreateVpcPeeringAuthorizationResponse (Prelude.Maybe VpcPeeringAuthorization)
createVpcPeeringAuthorizationResponse_vpcPeeringAuthorization :: (Maybe VpcPeeringAuthorization
-> f (Maybe VpcPeeringAuthorization))
-> CreateVpcPeeringAuthorizationResponse
-> f CreateVpcPeeringAuthorizationResponse
createVpcPeeringAuthorizationResponse_vpcPeeringAuthorization = (CreateVpcPeeringAuthorizationResponse
-> Maybe VpcPeeringAuthorization)
-> (CreateVpcPeeringAuthorizationResponse
-> Maybe VpcPeeringAuthorization
-> CreateVpcPeeringAuthorizationResponse)
-> Lens
CreateVpcPeeringAuthorizationResponse
CreateVpcPeeringAuthorizationResponse
(Maybe VpcPeeringAuthorization)
(Maybe VpcPeeringAuthorization)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcPeeringAuthorizationResponse' {Maybe VpcPeeringAuthorization
vpcPeeringAuthorization :: Maybe VpcPeeringAuthorization
$sel:vpcPeeringAuthorization:CreateVpcPeeringAuthorizationResponse' :: CreateVpcPeeringAuthorizationResponse
-> Maybe VpcPeeringAuthorization
vpcPeeringAuthorization} -> Maybe VpcPeeringAuthorization
vpcPeeringAuthorization) (\s :: CreateVpcPeeringAuthorizationResponse
s@CreateVpcPeeringAuthorizationResponse' {} Maybe VpcPeeringAuthorization
a -> CreateVpcPeeringAuthorizationResponse
s {$sel:vpcPeeringAuthorization:CreateVpcPeeringAuthorizationResponse' :: Maybe VpcPeeringAuthorization
vpcPeeringAuthorization = Maybe VpcPeeringAuthorization
a} :: CreateVpcPeeringAuthorizationResponse)
createVpcPeeringAuthorizationResponse_httpStatus :: Lens.Lens' CreateVpcPeeringAuthorizationResponse Prelude.Int
createVpcPeeringAuthorizationResponse_httpStatus :: (Int -> f Int)
-> CreateVpcPeeringAuthorizationResponse
-> f CreateVpcPeeringAuthorizationResponse
createVpcPeeringAuthorizationResponse_httpStatus = (CreateVpcPeeringAuthorizationResponse -> Int)
-> (CreateVpcPeeringAuthorizationResponse
-> Int -> CreateVpcPeeringAuthorizationResponse)
-> Lens
CreateVpcPeeringAuthorizationResponse
CreateVpcPeeringAuthorizationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcPeeringAuthorizationResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateVpcPeeringAuthorizationResponse' :: CreateVpcPeeringAuthorizationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateVpcPeeringAuthorizationResponse
s@CreateVpcPeeringAuthorizationResponse' {} Int
a -> CreateVpcPeeringAuthorizationResponse
s {$sel:httpStatus:CreateVpcPeeringAuthorizationResponse' :: Int
httpStatus = Int
a} :: CreateVpcPeeringAuthorizationResponse)
instance
Prelude.NFData
CreateVpcPeeringAuthorizationResponse