{-# 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.DirectConnect.CreateDirectConnectGatewayAssociationProposal
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a proposal to associate the specified virtual private gateway or
-- transit gateway with the specified Direct Connect gateway.
--
-- You can associate a Direct Connect gateway and virtual private gateway
-- or transit gateway that is owned by any Amazon Web Services account.
module Amazonka.DirectConnect.CreateDirectConnectGatewayAssociationProposal
  ( -- * Creating a Request
    CreateDirectConnectGatewayAssociationProposal (..),
    newCreateDirectConnectGatewayAssociationProposal,

    -- * Request Lenses
    createDirectConnectGatewayAssociationProposal_addAllowedPrefixesToDirectConnectGateway,
    createDirectConnectGatewayAssociationProposal_removeAllowedPrefixesToDirectConnectGateway,
    createDirectConnectGatewayAssociationProposal_directConnectGatewayId,
    createDirectConnectGatewayAssociationProposal_directConnectGatewayOwnerAccount,
    createDirectConnectGatewayAssociationProposal_gatewayId,

    -- * Destructuring the Response
    CreateDirectConnectGatewayAssociationProposalResponse (..),
    newCreateDirectConnectGatewayAssociationProposalResponse,

    -- * Response Lenses
    createDirectConnectGatewayAssociationProposalResponse_directConnectGatewayAssociationProposal,
    createDirectConnectGatewayAssociationProposalResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DirectConnect.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateDirectConnectGatewayAssociationProposal' smart constructor.
data CreateDirectConnectGatewayAssociationProposal = CreateDirectConnectGatewayAssociationProposal'
  { -- | The Amazon VPC prefixes to advertise to the Direct Connect gateway.
    CreateDirectConnectGatewayAssociationProposal
-> Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway :: Prelude.Maybe [RouteFilterPrefix],
    -- | The Amazon VPC prefixes to no longer advertise to the Direct Connect
    -- gateway.
    CreateDirectConnectGatewayAssociationProposal
-> Maybe [RouteFilterPrefix]
removeAllowedPrefixesToDirectConnectGateway :: Prelude.Maybe [RouteFilterPrefix],
    -- | The ID of the Direct Connect gateway.
    CreateDirectConnectGatewayAssociationProposal -> Text
directConnectGatewayId :: Prelude.Text,
    -- | The ID of the Amazon Web Services account that owns the Direct Connect
    -- gateway.
    CreateDirectConnectGatewayAssociationProposal -> Text
directConnectGatewayOwnerAccount :: Prelude.Text,
    -- | The ID of the virtual private gateway or transit gateway.
    CreateDirectConnectGatewayAssociationProposal -> Text
gatewayId :: Prelude.Text
  }
  deriving (CreateDirectConnectGatewayAssociationProposal
-> CreateDirectConnectGatewayAssociationProposal -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDirectConnectGatewayAssociationProposal
-> CreateDirectConnectGatewayAssociationProposal -> Bool
$c/= :: CreateDirectConnectGatewayAssociationProposal
-> CreateDirectConnectGatewayAssociationProposal -> Bool
== :: CreateDirectConnectGatewayAssociationProposal
-> CreateDirectConnectGatewayAssociationProposal -> Bool
$c== :: CreateDirectConnectGatewayAssociationProposal
-> CreateDirectConnectGatewayAssociationProposal -> Bool
Prelude.Eq, ReadPrec [CreateDirectConnectGatewayAssociationProposal]
ReadPrec CreateDirectConnectGatewayAssociationProposal
Int -> ReadS CreateDirectConnectGatewayAssociationProposal
ReadS [CreateDirectConnectGatewayAssociationProposal]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDirectConnectGatewayAssociationProposal]
$creadListPrec :: ReadPrec [CreateDirectConnectGatewayAssociationProposal]
readPrec :: ReadPrec CreateDirectConnectGatewayAssociationProposal
$creadPrec :: ReadPrec CreateDirectConnectGatewayAssociationProposal
readList :: ReadS [CreateDirectConnectGatewayAssociationProposal]
$creadList :: ReadS [CreateDirectConnectGatewayAssociationProposal]
readsPrec :: Int -> ReadS CreateDirectConnectGatewayAssociationProposal
$creadsPrec :: Int -> ReadS CreateDirectConnectGatewayAssociationProposal
Prelude.Read, Int -> CreateDirectConnectGatewayAssociationProposal -> ShowS
[CreateDirectConnectGatewayAssociationProposal] -> ShowS
CreateDirectConnectGatewayAssociationProposal -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDirectConnectGatewayAssociationProposal] -> ShowS
$cshowList :: [CreateDirectConnectGatewayAssociationProposal] -> ShowS
show :: CreateDirectConnectGatewayAssociationProposal -> String
$cshow :: CreateDirectConnectGatewayAssociationProposal -> String
showsPrec :: Int -> CreateDirectConnectGatewayAssociationProposal -> ShowS
$cshowsPrec :: Int -> CreateDirectConnectGatewayAssociationProposal -> ShowS
Prelude.Show, forall x.
Rep CreateDirectConnectGatewayAssociationProposal x
-> CreateDirectConnectGatewayAssociationProposal
forall x.
CreateDirectConnectGatewayAssociationProposal
-> Rep CreateDirectConnectGatewayAssociationProposal x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDirectConnectGatewayAssociationProposal x
-> CreateDirectConnectGatewayAssociationProposal
$cfrom :: forall x.
CreateDirectConnectGatewayAssociationProposal
-> Rep CreateDirectConnectGatewayAssociationProposal x
Prelude.Generic)

-- |
-- Create a value of 'CreateDirectConnectGatewayAssociationProposal' 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:
--
-- 'addAllowedPrefixesToDirectConnectGateway', 'createDirectConnectGatewayAssociationProposal_addAllowedPrefixesToDirectConnectGateway' - The Amazon VPC prefixes to advertise to the Direct Connect gateway.
--
-- 'removeAllowedPrefixesToDirectConnectGateway', 'createDirectConnectGatewayAssociationProposal_removeAllowedPrefixesToDirectConnectGateway' - The Amazon VPC prefixes to no longer advertise to the Direct Connect
-- gateway.
--
-- 'directConnectGatewayId', 'createDirectConnectGatewayAssociationProposal_directConnectGatewayId' - The ID of the Direct Connect gateway.
--
-- 'directConnectGatewayOwnerAccount', 'createDirectConnectGatewayAssociationProposal_directConnectGatewayOwnerAccount' - The ID of the Amazon Web Services account that owns the Direct Connect
-- gateway.
--
-- 'gatewayId', 'createDirectConnectGatewayAssociationProposal_gatewayId' - The ID of the virtual private gateway or transit gateway.
newCreateDirectConnectGatewayAssociationProposal ::
  -- | 'directConnectGatewayId'
  Prelude.Text ->
  -- | 'directConnectGatewayOwnerAccount'
  Prelude.Text ->
  -- | 'gatewayId'
  Prelude.Text ->
  CreateDirectConnectGatewayAssociationProposal
newCreateDirectConnectGatewayAssociationProposal :: Text
-> Text -> Text -> CreateDirectConnectGatewayAssociationProposal
newCreateDirectConnectGatewayAssociationProposal
  Text
pDirectConnectGatewayId_
  Text
pDirectConnectGatewayOwnerAccount_
  Text
pGatewayId_ =
    CreateDirectConnectGatewayAssociationProposal'
      { $sel:addAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociationProposal' :: Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway =
          forall a. Maybe a
Prelude.Nothing,
        $sel:removeAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociationProposal' :: Maybe [RouteFilterPrefix]
removeAllowedPrefixesToDirectConnectGateway =
          forall a. Maybe a
Prelude.Nothing,
        $sel:directConnectGatewayId:CreateDirectConnectGatewayAssociationProposal' :: Text
directConnectGatewayId =
          Text
pDirectConnectGatewayId_,
        $sel:directConnectGatewayOwnerAccount:CreateDirectConnectGatewayAssociationProposal' :: Text
directConnectGatewayOwnerAccount =
          Text
pDirectConnectGatewayOwnerAccount_,
        $sel:gatewayId:CreateDirectConnectGatewayAssociationProposal' :: Text
gatewayId = Text
pGatewayId_
      }

-- | The Amazon VPC prefixes to advertise to the Direct Connect gateway.
createDirectConnectGatewayAssociationProposal_addAllowedPrefixesToDirectConnectGateway :: Lens.Lens' CreateDirectConnectGatewayAssociationProposal (Prelude.Maybe [RouteFilterPrefix])
createDirectConnectGatewayAssociationProposal_addAllowedPrefixesToDirectConnectGateway :: Lens'
  CreateDirectConnectGatewayAssociationProposal
  (Maybe [RouteFilterPrefix])
createDirectConnectGatewayAssociationProposal_addAllowedPrefixesToDirectConnectGateway = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDirectConnectGatewayAssociationProposal' {Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
$sel:addAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal
-> Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway} -> Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway) (\s :: CreateDirectConnectGatewayAssociationProposal
s@CreateDirectConnectGatewayAssociationProposal' {} Maybe [RouteFilterPrefix]
a -> CreateDirectConnectGatewayAssociationProposal
s {$sel:addAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociationProposal' :: Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway = Maybe [RouteFilterPrefix]
a} :: CreateDirectConnectGatewayAssociationProposal) 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

-- | The Amazon VPC prefixes to no longer advertise to the Direct Connect
-- gateway.
createDirectConnectGatewayAssociationProposal_removeAllowedPrefixesToDirectConnectGateway :: Lens.Lens' CreateDirectConnectGatewayAssociationProposal (Prelude.Maybe [RouteFilterPrefix])
createDirectConnectGatewayAssociationProposal_removeAllowedPrefixesToDirectConnectGateway :: Lens'
  CreateDirectConnectGatewayAssociationProposal
  (Maybe [RouteFilterPrefix])
createDirectConnectGatewayAssociationProposal_removeAllowedPrefixesToDirectConnectGateway = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDirectConnectGatewayAssociationProposal' {Maybe [RouteFilterPrefix]
removeAllowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
$sel:removeAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal
-> Maybe [RouteFilterPrefix]
removeAllowedPrefixesToDirectConnectGateway} -> Maybe [RouteFilterPrefix]
removeAllowedPrefixesToDirectConnectGateway) (\s :: CreateDirectConnectGatewayAssociationProposal
s@CreateDirectConnectGatewayAssociationProposal' {} Maybe [RouteFilterPrefix]
a -> CreateDirectConnectGatewayAssociationProposal
s {$sel:removeAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociationProposal' :: Maybe [RouteFilterPrefix]
removeAllowedPrefixesToDirectConnectGateway = Maybe [RouteFilterPrefix]
a} :: CreateDirectConnectGatewayAssociationProposal) 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

-- | The ID of the Direct Connect gateway.
createDirectConnectGatewayAssociationProposal_directConnectGatewayId :: Lens.Lens' CreateDirectConnectGatewayAssociationProposal Prelude.Text
createDirectConnectGatewayAssociationProposal_directConnectGatewayId :: Lens' CreateDirectConnectGatewayAssociationProposal Text
createDirectConnectGatewayAssociationProposal_directConnectGatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDirectConnectGatewayAssociationProposal' {Text
directConnectGatewayId :: Text
$sel:directConnectGatewayId:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal -> Text
directConnectGatewayId} -> Text
directConnectGatewayId) (\s :: CreateDirectConnectGatewayAssociationProposal
s@CreateDirectConnectGatewayAssociationProposal' {} Text
a -> CreateDirectConnectGatewayAssociationProposal
s {$sel:directConnectGatewayId:CreateDirectConnectGatewayAssociationProposal' :: Text
directConnectGatewayId = Text
a} :: CreateDirectConnectGatewayAssociationProposal)

-- | The ID of the Amazon Web Services account that owns the Direct Connect
-- gateway.
createDirectConnectGatewayAssociationProposal_directConnectGatewayOwnerAccount :: Lens.Lens' CreateDirectConnectGatewayAssociationProposal Prelude.Text
createDirectConnectGatewayAssociationProposal_directConnectGatewayOwnerAccount :: Lens' CreateDirectConnectGatewayAssociationProposal Text
createDirectConnectGatewayAssociationProposal_directConnectGatewayOwnerAccount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDirectConnectGatewayAssociationProposal' {Text
directConnectGatewayOwnerAccount :: Text
$sel:directConnectGatewayOwnerAccount:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal -> Text
directConnectGatewayOwnerAccount} -> Text
directConnectGatewayOwnerAccount) (\s :: CreateDirectConnectGatewayAssociationProposal
s@CreateDirectConnectGatewayAssociationProposal' {} Text
a -> CreateDirectConnectGatewayAssociationProposal
s {$sel:directConnectGatewayOwnerAccount:CreateDirectConnectGatewayAssociationProposal' :: Text
directConnectGatewayOwnerAccount = Text
a} :: CreateDirectConnectGatewayAssociationProposal)

-- | The ID of the virtual private gateway or transit gateway.
createDirectConnectGatewayAssociationProposal_gatewayId :: Lens.Lens' CreateDirectConnectGatewayAssociationProposal Prelude.Text
createDirectConnectGatewayAssociationProposal_gatewayId :: Lens' CreateDirectConnectGatewayAssociationProposal Text
createDirectConnectGatewayAssociationProposal_gatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDirectConnectGatewayAssociationProposal' {Text
gatewayId :: Text
$sel:gatewayId:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal -> Text
gatewayId} -> Text
gatewayId) (\s :: CreateDirectConnectGatewayAssociationProposal
s@CreateDirectConnectGatewayAssociationProposal' {} Text
a -> CreateDirectConnectGatewayAssociationProposal
s {$sel:gatewayId:CreateDirectConnectGatewayAssociationProposal' :: Text
gatewayId = Text
a} :: CreateDirectConnectGatewayAssociationProposal)

instance
  Core.AWSRequest
    CreateDirectConnectGatewayAssociationProposal
  where
  type
    AWSResponse
      CreateDirectConnectGatewayAssociationProposal =
      CreateDirectConnectGatewayAssociationProposalResponse
  request :: (Service -> Service)
-> CreateDirectConnectGatewayAssociationProposal
-> Request CreateDirectConnectGatewayAssociationProposal
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateDirectConnectGatewayAssociationProposal
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse CreateDirectConnectGatewayAssociationProposal)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe DirectConnectGatewayAssociationProposal
-> Int -> CreateDirectConnectGatewayAssociationProposalResponse
CreateDirectConnectGatewayAssociationProposalResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"directConnectGatewayAssociationProposal"
                        )
            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
    CreateDirectConnectGatewayAssociationProposal
  where
  hashWithSalt :: Int -> CreateDirectConnectGatewayAssociationProposal -> Int
hashWithSalt
    Int
_salt
    CreateDirectConnectGatewayAssociationProposal' {Maybe [RouteFilterPrefix]
Text
gatewayId :: Text
directConnectGatewayOwnerAccount :: Text
directConnectGatewayId :: Text
removeAllowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
$sel:gatewayId:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal -> Text
$sel:directConnectGatewayOwnerAccount:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal -> Text
$sel:directConnectGatewayId:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal -> Text
$sel:removeAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal
-> Maybe [RouteFilterPrefix]
$sel:addAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal
-> Maybe [RouteFilterPrefix]
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [RouteFilterPrefix]
removeAllowedPrefixesToDirectConnectGateway
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
directConnectGatewayId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
directConnectGatewayOwnerAccount
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
gatewayId

instance
  Prelude.NFData
    CreateDirectConnectGatewayAssociationProposal
  where
  rnf :: CreateDirectConnectGatewayAssociationProposal -> ()
rnf
    CreateDirectConnectGatewayAssociationProposal' {Maybe [RouteFilterPrefix]
Text
gatewayId :: Text
directConnectGatewayOwnerAccount :: Text
directConnectGatewayId :: Text
removeAllowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
$sel:gatewayId:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal -> Text
$sel:directConnectGatewayOwnerAccount:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal -> Text
$sel:directConnectGatewayId:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal -> Text
$sel:removeAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal
-> Maybe [RouteFilterPrefix]
$sel:addAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal
-> Maybe [RouteFilterPrefix]
..} =
      forall a. NFData a => a -> ()
Prelude.rnf
        Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
          Maybe [RouteFilterPrefix]
removeAllowedPrefixesToDirectConnectGateway
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
directConnectGatewayId
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
directConnectGatewayOwnerAccount
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
gatewayId

instance
  Data.ToHeaders
    CreateDirectConnectGatewayAssociationProposal
  where
  toHeaders :: CreateDirectConnectGatewayAssociationProposal -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"OvertureService.CreateDirectConnectGatewayAssociationProposal" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Data.ToJSON
    CreateDirectConnectGatewayAssociationProposal
  where
  toJSON :: CreateDirectConnectGatewayAssociationProposal -> Value
toJSON
    CreateDirectConnectGatewayAssociationProposal' {Maybe [RouteFilterPrefix]
Text
gatewayId :: Text
directConnectGatewayOwnerAccount :: Text
directConnectGatewayId :: Text
removeAllowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
$sel:gatewayId:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal -> Text
$sel:directConnectGatewayOwnerAccount:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal -> Text
$sel:directConnectGatewayId:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal -> Text
$sel:removeAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal
-> Maybe [RouteFilterPrefix]
$sel:addAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociationProposal' :: CreateDirectConnectGatewayAssociationProposal
-> Maybe [RouteFilterPrefix]
..} =
      [Pair] -> Value
Data.object
        ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Key
"addAllowedPrefixesToDirectConnectGateway" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway,
              ( Key
"removeAllowedPrefixesToDirectConnectGateway"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=
              )
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RouteFilterPrefix]
removeAllowedPrefixesToDirectConnectGateway,
              forall a. a -> Maybe a
Prelude.Just
                ( Key
"directConnectGatewayId"
                    forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
directConnectGatewayId
                ),
              forall a. a -> Maybe a
Prelude.Just
                ( Key
"directConnectGatewayOwnerAccount"
                    forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
directConnectGatewayOwnerAccount
                ),
              forall a. a -> Maybe a
Prelude.Just (Key
"gatewayId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
gatewayId)
            ]
        )

instance
  Data.ToPath
    CreateDirectConnectGatewayAssociationProposal
  where
  toPath :: CreateDirectConnectGatewayAssociationProposal -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance
  Data.ToQuery
    CreateDirectConnectGatewayAssociationProposal
  where
  toQuery :: CreateDirectConnectGatewayAssociationProposal -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateDirectConnectGatewayAssociationProposalResponse' smart constructor.
data CreateDirectConnectGatewayAssociationProposalResponse = CreateDirectConnectGatewayAssociationProposalResponse'
  { -- | Information about the Direct Connect gateway proposal.
    CreateDirectConnectGatewayAssociationProposalResponse
-> Maybe DirectConnectGatewayAssociationProposal
directConnectGatewayAssociationProposal :: Prelude.Maybe DirectConnectGatewayAssociationProposal,
    -- | The response's http status code.
    CreateDirectConnectGatewayAssociationProposalResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateDirectConnectGatewayAssociationProposalResponse
-> CreateDirectConnectGatewayAssociationProposalResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDirectConnectGatewayAssociationProposalResponse
-> CreateDirectConnectGatewayAssociationProposalResponse -> Bool
$c/= :: CreateDirectConnectGatewayAssociationProposalResponse
-> CreateDirectConnectGatewayAssociationProposalResponse -> Bool
== :: CreateDirectConnectGatewayAssociationProposalResponse
-> CreateDirectConnectGatewayAssociationProposalResponse -> Bool
$c== :: CreateDirectConnectGatewayAssociationProposalResponse
-> CreateDirectConnectGatewayAssociationProposalResponse -> Bool
Prelude.Eq, ReadPrec [CreateDirectConnectGatewayAssociationProposalResponse]
ReadPrec CreateDirectConnectGatewayAssociationProposalResponse
Int -> ReadS CreateDirectConnectGatewayAssociationProposalResponse
ReadS [CreateDirectConnectGatewayAssociationProposalResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDirectConnectGatewayAssociationProposalResponse]
$creadListPrec :: ReadPrec [CreateDirectConnectGatewayAssociationProposalResponse]
readPrec :: ReadPrec CreateDirectConnectGatewayAssociationProposalResponse
$creadPrec :: ReadPrec CreateDirectConnectGatewayAssociationProposalResponse
readList :: ReadS [CreateDirectConnectGatewayAssociationProposalResponse]
$creadList :: ReadS [CreateDirectConnectGatewayAssociationProposalResponse]
readsPrec :: Int -> ReadS CreateDirectConnectGatewayAssociationProposalResponse
$creadsPrec :: Int -> ReadS CreateDirectConnectGatewayAssociationProposalResponse
Prelude.Read, Int
-> CreateDirectConnectGatewayAssociationProposalResponse -> ShowS
[CreateDirectConnectGatewayAssociationProposalResponse] -> ShowS
CreateDirectConnectGatewayAssociationProposalResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDirectConnectGatewayAssociationProposalResponse] -> ShowS
$cshowList :: [CreateDirectConnectGatewayAssociationProposalResponse] -> ShowS
show :: CreateDirectConnectGatewayAssociationProposalResponse -> String
$cshow :: CreateDirectConnectGatewayAssociationProposalResponse -> String
showsPrec :: Int
-> CreateDirectConnectGatewayAssociationProposalResponse -> ShowS
$cshowsPrec :: Int
-> CreateDirectConnectGatewayAssociationProposalResponse -> ShowS
Prelude.Show, forall x.
Rep CreateDirectConnectGatewayAssociationProposalResponse x
-> CreateDirectConnectGatewayAssociationProposalResponse
forall x.
CreateDirectConnectGatewayAssociationProposalResponse
-> Rep CreateDirectConnectGatewayAssociationProposalResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDirectConnectGatewayAssociationProposalResponse x
-> CreateDirectConnectGatewayAssociationProposalResponse
$cfrom :: forall x.
CreateDirectConnectGatewayAssociationProposalResponse
-> Rep CreateDirectConnectGatewayAssociationProposalResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateDirectConnectGatewayAssociationProposalResponse' 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:
--
-- 'directConnectGatewayAssociationProposal', 'createDirectConnectGatewayAssociationProposalResponse_directConnectGatewayAssociationProposal' - Information about the Direct Connect gateway proposal.
--
-- 'httpStatus', 'createDirectConnectGatewayAssociationProposalResponse_httpStatus' - The response's http status code.
newCreateDirectConnectGatewayAssociationProposalResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateDirectConnectGatewayAssociationProposalResponse
newCreateDirectConnectGatewayAssociationProposalResponse :: Int -> CreateDirectConnectGatewayAssociationProposalResponse
newCreateDirectConnectGatewayAssociationProposalResponse
  Int
pHttpStatus_ =
    CreateDirectConnectGatewayAssociationProposalResponse'
      { $sel:directConnectGatewayAssociationProposal:CreateDirectConnectGatewayAssociationProposalResponse' :: Maybe DirectConnectGatewayAssociationProposal
directConnectGatewayAssociationProposal =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateDirectConnectGatewayAssociationProposalResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | Information about the Direct Connect gateway proposal.
createDirectConnectGatewayAssociationProposalResponse_directConnectGatewayAssociationProposal :: Lens.Lens' CreateDirectConnectGatewayAssociationProposalResponse (Prelude.Maybe DirectConnectGatewayAssociationProposal)
createDirectConnectGatewayAssociationProposalResponse_directConnectGatewayAssociationProposal :: Lens'
  CreateDirectConnectGatewayAssociationProposalResponse
  (Maybe DirectConnectGatewayAssociationProposal)
createDirectConnectGatewayAssociationProposalResponse_directConnectGatewayAssociationProposal = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDirectConnectGatewayAssociationProposalResponse' {Maybe DirectConnectGatewayAssociationProposal
directConnectGatewayAssociationProposal :: Maybe DirectConnectGatewayAssociationProposal
$sel:directConnectGatewayAssociationProposal:CreateDirectConnectGatewayAssociationProposalResponse' :: CreateDirectConnectGatewayAssociationProposalResponse
-> Maybe DirectConnectGatewayAssociationProposal
directConnectGatewayAssociationProposal} -> Maybe DirectConnectGatewayAssociationProposal
directConnectGatewayAssociationProposal) (\s :: CreateDirectConnectGatewayAssociationProposalResponse
s@CreateDirectConnectGatewayAssociationProposalResponse' {} Maybe DirectConnectGatewayAssociationProposal
a -> CreateDirectConnectGatewayAssociationProposalResponse
s {$sel:directConnectGatewayAssociationProposal:CreateDirectConnectGatewayAssociationProposalResponse' :: Maybe DirectConnectGatewayAssociationProposal
directConnectGatewayAssociationProposal = Maybe DirectConnectGatewayAssociationProposal
a} :: CreateDirectConnectGatewayAssociationProposalResponse)

-- | The response's http status code.
createDirectConnectGatewayAssociationProposalResponse_httpStatus :: Lens.Lens' CreateDirectConnectGatewayAssociationProposalResponse Prelude.Int
createDirectConnectGatewayAssociationProposalResponse_httpStatus :: Lens' CreateDirectConnectGatewayAssociationProposalResponse Int
createDirectConnectGatewayAssociationProposalResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDirectConnectGatewayAssociationProposalResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateDirectConnectGatewayAssociationProposalResponse' :: CreateDirectConnectGatewayAssociationProposalResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateDirectConnectGatewayAssociationProposalResponse
s@CreateDirectConnectGatewayAssociationProposalResponse' {} Int
a -> CreateDirectConnectGatewayAssociationProposalResponse
s {$sel:httpStatus:CreateDirectConnectGatewayAssociationProposalResponse' :: Int
httpStatus = Int
a} :: CreateDirectConnectGatewayAssociationProposalResponse)

instance
  Prelude.NFData
    CreateDirectConnectGatewayAssociationProposalResponse
  where
  rnf :: CreateDirectConnectGatewayAssociationProposalResponse -> ()
rnf
    CreateDirectConnectGatewayAssociationProposalResponse' {Int
Maybe DirectConnectGatewayAssociationProposal
httpStatus :: Int
directConnectGatewayAssociationProposal :: Maybe DirectConnectGatewayAssociationProposal
$sel:httpStatus:CreateDirectConnectGatewayAssociationProposalResponse' :: CreateDirectConnectGatewayAssociationProposalResponse -> Int
$sel:directConnectGatewayAssociationProposal:CreateDirectConnectGatewayAssociationProposalResponse' :: CreateDirectConnectGatewayAssociationProposalResponse
-> Maybe DirectConnectGatewayAssociationProposal
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe DirectConnectGatewayAssociationProposal
directConnectGatewayAssociationProposal
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus