{-# 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-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)
--
-- 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 Amazonka.DirectConnect.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

-- | /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
(CreateDirectConnectGatewayAssociationProposal
 -> CreateDirectConnectGatewayAssociationProposal -> Bool)
-> (CreateDirectConnectGatewayAssociationProposal
    -> CreateDirectConnectGatewayAssociationProposal -> Bool)
-> Eq CreateDirectConnectGatewayAssociationProposal
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]
(Int -> ReadS CreateDirectConnectGatewayAssociationProposal)
-> ReadS [CreateDirectConnectGatewayAssociationProposal]
-> ReadPrec CreateDirectConnectGatewayAssociationProposal
-> ReadPrec [CreateDirectConnectGatewayAssociationProposal]
-> Read 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
(Int -> CreateDirectConnectGatewayAssociationProposal -> ShowS)
-> (CreateDirectConnectGatewayAssociationProposal -> String)
-> ([CreateDirectConnectGatewayAssociationProposal] -> ShowS)
-> Show CreateDirectConnectGatewayAssociationProposal
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.
 CreateDirectConnectGatewayAssociationProposal
 -> Rep CreateDirectConnectGatewayAssociationProposal x)
-> (forall x.
    Rep CreateDirectConnectGatewayAssociationProposal x
    -> CreateDirectConnectGatewayAssociationProposal)
-> Generic CreateDirectConnectGatewayAssociationProposal
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' :: Maybe [RouteFilterPrefix]
-> Maybe [RouteFilterPrefix]
-> Text
-> Text
-> Text
-> CreateDirectConnectGatewayAssociationProposal
CreateDirectConnectGatewayAssociationProposal'
      { $sel:addAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociationProposal' :: Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway =
          Maybe [RouteFilterPrefix]
forall a. Maybe a
Prelude.Nothing,
        $sel:removeAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociationProposal' :: Maybe [RouteFilterPrefix]
removeAllowedPrefixesToDirectConnectGateway =
          Maybe [RouteFilterPrefix]
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 :: (Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> CreateDirectConnectGatewayAssociationProposal
-> f CreateDirectConnectGatewayAssociationProposal
createDirectConnectGatewayAssociationProposal_addAllowedPrefixesToDirectConnectGateway = (CreateDirectConnectGatewayAssociationProposal
 -> Maybe [RouteFilterPrefix])
-> (CreateDirectConnectGatewayAssociationProposal
    -> Maybe [RouteFilterPrefix]
    -> CreateDirectConnectGatewayAssociationProposal)
-> Lens
     CreateDirectConnectGatewayAssociationProposal
     CreateDirectConnectGatewayAssociationProposal
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
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) ((Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
 -> CreateDirectConnectGatewayAssociationProposal
 -> f CreateDirectConnectGatewayAssociationProposal)
-> ((Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
    -> Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> (Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> CreateDirectConnectGatewayAssociationProposal
-> f CreateDirectConnectGatewayAssociationProposal
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
-> Iso
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
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 AnIso
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
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 :: (Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> CreateDirectConnectGatewayAssociationProposal
-> f CreateDirectConnectGatewayAssociationProposal
createDirectConnectGatewayAssociationProposal_removeAllowedPrefixesToDirectConnectGateway = (CreateDirectConnectGatewayAssociationProposal
 -> Maybe [RouteFilterPrefix])
-> (CreateDirectConnectGatewayAssociationProposal
    -> Maybe [RouteFilterPrefix]
    -> CreateDirectConnectGatewayAssociationProposal)
-> Lens
     CreateDirectConnectGatewayAssociationProposal
     CreateDirectConnectGatewayAssociationProposal
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
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) ((Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
 -> CreateDirectConnectGatewayAssociationProposal
 -> f CreateDirectConnectGatewayAssociationProposal)
-> ((Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
    -> Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> (Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> CreateDirectConnectGatewayAssociationProposal
-> f CreateDirectConnectGatewayAssociationProposal
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
-> Iso
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
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 AnIso
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
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 :: (Text -> f Text)
-> CreateDirectConnectGatewayAssociationProposal
-> f CreateDirectConnectGatewayAssociationProposal
createDirectConnectGatewayAssociationProposal_directConnectGatewayId = (CreateDirectConnectGatewayAssociationProposal -> Text)
-> (CreateDirectConnectGatewayAssociationProposal
    -> Text -> CreateDirectConnectGatewayAssociationProposal)
-> Lens
     CreateDirectConnectGatewayAssociationProposal
     CreateDirectConnectGatewayAssociationProposal
     Text
     Text
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 :: (Text -> f Text)
-> CreateDirectConnectGatewayAssociationProposal
-> f CreateDirectConnectGatewayAssociationProposal
createDirectConnectGatewayAssociationProposal_directConnectGatewayOwnerAccount = (CreateDirectConnectGatewayAssociationProposal -> Text)
-> (CreateDirectConnectGatewayAssociationProposal
    -> Text -> CreateDirectConnectGatewayAssociationProposal)
-> Lens
     CreateDirectConnectGatewayAssociationProposal
     CreateDirectConnectGatewayAssociationProposal
     Text
     Text
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 :: (Text -> f Text)
-> CreateDirectConnectGatewayAssociationProposal
-> f CreateDirectConnectGatewayAssociationProposal
createDirectConnectGatewayAssociationProposal_gatewayId = (CreateDirectConnectGatewayAssociationProposal -> Text)
-> (CreateDirectConnectGatewayAssociationProposal
    -> Text -> CreateDirectConnectGatewayAssociationProposal)
-> Lens
     CreateDirectConnectGatewayAssociationProposal
     CreateDirectConnectGatewayAssociationProposal
     Text
     Text
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 :: CreateDirectConnectGatewayAssociationProposal
-> Request CreateDirectConnectGatewayAssociationProposal
request = Service
-> CreateDirectConnectGatewayAssociationProposal
-> Request CreateDirectConnectGatewayAssociationProposal
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateDirectConnectGatewayAssociationProposal
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse CreateDirectConnectGatewayAssociationProposal)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse CreateDirectConnectGatewayAssociationProposal))
-> Logger
-> Service
-> Proxy CreateDirectConnectGatewayAssociationProposal
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse CreateDirectConnectGatewayAssociationProposal)))
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 DirectConnectGatewayAssociationProposal
-> Int -> CreateDirectConnectGatewayAssociationProposalResponse
CreateDirectConnectGatewayAssociationProposalResponse'
            (Maybe DirectConnectGatewayAssociationProposal
 -> Int -> CreateDirectConnectGatewayAssociationProposalResponse)
-> Either String (Maybe DirectConnectGatewayAssociationProposal)
-> Either
     String
     (Int -> CreateDirectConnectGatewayAssociationProposalResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            Object
-> Text
-> Either String (Maybe DirectConnectGatewayAssociationProposal)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"directConnectGatewayAssociationProposal"
                        )
              Either
  String
  (Int -> CreateDirectConnectGatewayAssociationProposalResponse)
-> Either String Int
-> Either
     String CreateDirectConnectGatewayAssociationProposalResponse
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
    CreateDirectConnectGatewayAssociationProposal

instance
  Prelude.NFData
    CreateDirectConnectGatewayAssociationProposal

instance
  Core.ToHeaders
    CreateDirectConnectGatewayAssociationProposal
  where
  toHeaders :: CreateDirectConnectGatewayAssociationProposal -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> CreateDirectConnectGatewayAssociationProposal -> 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
"OvertureService.CreateDirectConnectGatewayAssociationProposal" ::
                          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
    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
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"addAllowedPrefixesToDirectConnectGateway" Text -> [RouteFilterPrefix] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
                ([RouteFilterPrefix] -> Pair)
-> Maybe [RouteFilterPrefix] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway,
              ( Text
"removeAllowedPrefixesToDirectConnectGateway"
                  Text -> [RouteFilterPrefix] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=
              )
                ([RouteFilterPrefix] -> Pair)
-> Maybe [RouteFilterPrefix] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RouteFilterPrefix]
removeAllowedPrefixesToDirectConnectGateway,
              Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
                ( Text
"directConnectGatewayId"
                    Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
directConnectGatewayId
                ),
              Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
                ( Text
"directConnectGatewayOwnerAccount"
                    Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
directConnectGatewayOwnerAccount
                ),
              Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"gatewayId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
gatewayId)
            ]
        )

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

instance
  Core.ToQuery
    CreateDirectConnectGatewayAssociationProposal
  where
  toQuery :: CreateDirectConnectGatewayAssociationProposal -> QueryString
toQuery = QueryString
-> CreateDirectConnectGatewayAssociationProposal -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(CreateDirectConnectGatewayAssociationProposalResponse
 -> CreateDirectConnectGatewayAssociationProposalResponse -> Bool)
-> (CreateDirectConnectGatewayAssociationProposalResponse
    -> CreateDirectConnectGatewayAssociationProposalResponse -> Bool)
-> Eq CreateDirectConnectGatewayAssociationProposalResponse
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]
(Int
 -> ReadS CreateDirectConnectGatewayAssociationProposalResponse)
-> ReadS [CreateDirectConnectGatewayAssociationProposalResponse]
-> ReadPrec CreateDirectConnectGatewayAssociationProposalResponse
-> ReadPrec [CreateDirectConnectGatewayAssociationProposalResponse]
-> Read 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
(Int
 -> CreateDirectConnectGatewayAssociationProposalResponse -> ShowS)
-> (CreateDirectConnectGatewayAssociationProposalResponse
    -> String)
-> ([CreateDirectConnectGatewayAssociationProposalResponse]
    -> ShowS)
-> Show CreateDirectConnectGatewayAssociationProposalResponse
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.
 CreateDirectConnectGatewayAssociationProposalResponse
 -> Rep CreateDirectConnectGatewayAssociationProposalResponse x)
-> (forall x.
    Rep CreateDirectConnectGatewayAssociationProposalResponse x
    -> CreateDirectConnectGatewayAssociationProposalResponse)
-> Generic CreateDirectConnectGatewayAssociationProposalResponse
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' :: Maybe DirectConnectGatewayAssociationProposal
-> Int -> CreateDirectConnectGatewayAssociationProposalResponse
CreateDirectConnectGatewayAssociationProposalResponse'
      { $sel:directConnectGatewayAssociationProposal:CreateDirectConnectGatewayAssociationProposalResponse' :: Maybe DirectConnectGatewayAssociationProposal
directConnectGatewayAssociationProposal =
          Maybe 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 :: (Maybe DirectConnectGatewayAssociationProposal
 -> f (Maybe DirectConnectGatewayAssociationProposal))
-> CreateDirectConnectGatewayAssociationProposalResponse
-> f CreateDirectConnectGatewayAssociationProposalResponse
createDirectConnectGatewayAssociationProposalResponse_directConnectGatewayAssociationProposal = (CreateDirectConnectGatewayAssociationProposalResponse
 -> Maybe DirectConnectGatewayAssociationProposal)
-> (CreateDirectConnectGatewayAssociationProposalResponse
    -> Maybe DirectConnectGatewayAssociationProposal
    -> CreateDirectConnectGatewayAssociationProposalResponse)
-> Lens
     CreateDirectConnectGatewayAssociationProposalResponse
     CreateDirectConnectGatewayAssociationProposalResponse
     (Maybe DirectConnectGatewayAssociationProposal)
     (Maybe 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 :: (Int -> f Int)
-> CreateDirectConnectGatewayAssociationProposalResponse
-> f CreateDirectConnectGatewayAssociationProposalResponse
createDirectConnectGatewayAssociationProposalResponse_httpStatus = (CreateDirectConnectGatewayAssociationProposalResponse -> Int)
-> (CreateDirectConnectGatewayAssociationProposalResponse
    -> Int -> CreateDirectConnectGatewayAssociationProposalResponse)
-> Lens
     CreateDirectConnectGatewayAssociationProposalResponse
     CreateDirectConnectGatewayAssociationProposalResponse
     Int
     Int
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