{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.GameLift.CreateVpcPeeringAuthorization
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Requests authorization to create or delete a peer connection between the
-- VPC for your Amazon GameLift fleet and a virtual private cloud (VPC) in
-- your AWS account. VPC peering enables the game servers on your fleet to
-- communicate directly with other AWS resources. Once you\'ve received
-- authorization, call CreateVpcPeeringConnection to establish the peering
-- connection. For more information, see
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html VPC Peering with Amazon GameLift Fleets>.
--
-- You can peer with VPCs that are owned by any AWS account you have access
-- to, including the account that you use to manage your Amazon GameLift
-- fleets. You cannot peer with VPCs that are in different Regions.
--
-- To request authorization to create a connection, call this operation
-- from the AWS account with the VPC that you want to peer to your Amazon
-- GameLift fleet. For example, to enable your game servers to retrieve
-- data from a DynamoDB table, use the account that manages that DynamoDB
-- resource. Identify the following values: (1) The ID of the VPC that you
-- want to peer with, and (2) the ID of the AWS account that you use to
-- manage Amazon GameLift. If successful, VPC peering is authorized for the
-- specified VPC.
--
-- To request authorization to delete a connection, call this operation
-- from the AWS account with the VPC that is peered with your Amazon
-- GameLift fleet. Identify the following values: (1) VPC ID that you want
-- to delete the peering connection for, and (2) ID of the AWS account that
-- you use to manage Amazon GameLift.
--
-- The authorization remains valid for 24 hours unless it is canceled by a
-- call to DeleteVpcPeeringAuthorization. You must create or delete the
-- peering connection while the authorization is valid.
--
-- __Related actions__
--
-- CreateVpcPeeringAuthorization | DescribeVpcPeeringAuthorizations |
-- DeleteVpcPeeringAuthorization | CreateVpcPeeringConnection |
-- DescribeVpcPeeringConnections | DeleteVpcPeeringConnection |
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets All APIs by task>
module Amazonka.GameLift.CreateVpcPeeringAuthorization
  ( -- * Creating a Request
    CreateVpcPeeringAuthorization (..),
    newCreateVpcPeeringAuthorization,

    -- * Request Lenses
    createVpcPeeringAuthorization_gameLiftAwsAccountId,
    createVpcPeeringAuthorization_peerVpcId,

    -- * Destructuring the Response
    CreateVpcPeeringAuthorizationResponse (..),
    newCreateVpcPeeringAuthorizationResponse,

    -- * Response Lenses
    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

-- | Represents the input for a request operation.
--
-- /See:/ 'newCreateVpcPeeringAuthorization' smart constructor.
data CreateVpcPeeringAuthorization = CreateVpcPeeringAuthorization'
  { -- | A unique identifier for the AWS account that you use to manage your
    -- GameLift fleet. You can find your Account ID in the AWS Management
    -- Console under account settings.
    CreateVpcPeeringAuthorization -> Text
gameLiftAwsAccountId :: Prelude.Text,
    -- | A unique identifier for a VPC with resources to be accessed by your
    -- GameLift fleet. The VPC must be in the same Region as your fleet. To
    -- look up a VPC ID, use the
    -- <https://console.aws.amazon.com/vpc/ VPC Dashboard> in the AWS
    -- Management Console. Learn more about VPC peering in
    -- <https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html VPC Peering with GameLift Fleets>.
    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)

-- |
-- Create a value of 'CreateVpcPeeringAuthorization' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'gameLiftAwsAccountId', 'createVpcPeeringAuthorization_gameLiftAwsAccountId' - A unique identifier for the AWS account that you use to manage your
-- GameLift fleet. You can find your Account ID in the AWS Management
-- Console under account settings.
--
-- 'peerVpcId', 'createVpcPeeringAuthorization_peerVpcId' - A unique identifier for a VPC with resources to be accessed by your
-- GameLift fleet. The VPC must be in the same Region as your fleet. To
-- look up a VPC ID, use the
-- <https://console.aws.amazon.com/vpc/ VPC Dashboard> in the AWS
-- Management Console. Learn more about VPC peering in
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html VPC Peering with GameLift Fleets>.
newCreateVpcPeeringAuthorization ::
  -- | 'gameLiftAwsAccountId'
  Prelude.Text ->
  -- | 'peerVpcId'
  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_
      }

-- | A unique identifier for the AWS account that you use to manage your
-- GameLift fleet. You can find your Account ID in the AWS Management
-- Console under account settings.
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)

-- | A unique identifier for a VPC with resources to be accessed by your
-- GameLift fleet. The VPC must be in the same Region as your fleet. To
-- look up a VPC ID, use the
-- <https://console.aws.amazon.com/vpc/ VPC Dashboard> in the AWS
-- Management Console. Learn more about VPC peering in
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html VPC Peering with GameLift Fleets>.
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

-- | Represents the returned data in response to a request operation.
--
-- /See:/ 'newCreateVpcPeeringAuthorizationResponse' smart constructor.
data CreateVpcPeeringAuthorizationResponse = CreateVpcPeeringAuthorizationResponse'
  { -- | Details on the requested VPC peering authorization, including
    -- expiration.
    CreateVpcPeeringAuthorizationResponse
-> Maybe VpcPeeringAuthorization
vpcPeeringAuthorization :: Prelude.Maybe VpcPeeringAuthorization,
    -- | The response's http status code.
    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)

-- |
-- Create a value of 'CreateVpcPeeringAuthorizationResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'vpcPeeringAuthorization', 'createVpcPeeringAuthorizationResponse_vpcPeeringAuthorization' - Details on the requested VPC peering authorization, including
-- expiration.
--
-- 'httpStatus', 'createVpcPeeringAuthorizationResponse_httpStatus' - The response's http status code.
newCreateVpcPeeringAuthorizationResponse ::
  -- | 'httpStatus'
  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_
    }

-- | Details on the requested VPC peering authorization, including
-- expiration.
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)

-- | The response's http status code.
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