{-# 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.CreateDirectConnectGatewayAssociation
-- 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 an association between a Direct Connect gateway and a virtual
-- private gateway. The virtual private gateway must be attached to a VPC
-- and must not be associated with another Direct Connect gateway.
module Amazonka.DirectConnect.CreateDirectConnectGatewayAssociation
  ( -- * Creating a Request
    CreateDirectConnectGatewayAssociation (..),
    newCreateDirectConnectGatewayAssociation,

    -- * Request Lenses
    createDirectConnectGatewayAssociation_addAllowedPrefixesToDirectConnectGateway,
    createDirectConnectGatewayAssociation_gatewayId,
    createDirectConnectGatewayAssociation_virtualGatewayId,
    createDirectConnectGatewayAssociation_directConnectGatewayId,

    -- * Destructuring the Response
    CreateDirectConnectGatewayAssociationResponse (..),
    newCreateDirectConnectGatewayAssociationResponse,

    -- * Response Lenses
    createDirectConnectGatewayAssociationResponse_directConnectGatewayAssociation,
    createDirectConnectGatewayAssociationResponse_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:/ 'newCreateDirectConnectGatewayAssociation' smart constructor.
data CreateDirectConnectGatewayAssociation = CreateDirectConnectGatewayAssociation'
  { -- | The Amazon VPC prefixes to advertise to the Direct Connect gateway
    --
    -- This parameter is required when you create an association to a transit
    -- gateway.
    --
    -- For information about how to set the prefixes, see
    -- <https://docs.aws.amazon.com/directconnect/latest/UserGuide/multi-account-associate-vgw.html#allowed-prefixes Allowed Prefixes>
    -- in the /Direct Connect User Guide/.
    CreateDirectConnectGatewayAssociation -> Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway :: Prelude.Maybe [RouteFilterPrefix],
    -- | The ID of the virtual private gateway or transit gateway.
    CreateDirectConnectGatewayAssociation -> Maybe Text
gatewayId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the virtual private gateway.
    CreateDirectConnectGatewayAssociation -> Maybe Text
virtualGatewayId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Direct Connect gateway.
    CreateDirectConnectGatewayAssociation -> Text
directConnectGatewayId :: Prelude.Text
  }
  deriving (CreateDirectConnectGatewayAssociation
-> CreateDirectConnectGatewayAssociation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDirectConnectGatewayAssociation
-> CreateDirectConnectGatewayAssociation -> Bool
$c/= :: CreateDirectConnectGatewayAssociation
-> CreateDirectConnectGatewayAssociation -> Bool
== :: CreateDirectConnectGatewayAssociation
-> CreateDirectConnectGatewayAssociation -> Bool
$c== :: CreateDirectConnectGatewayAssociation
-> CreateDirectConnectGatewayAssociation -> Bool
Prelude.Eq, ReadPrec [CreateDirectConnectGatewayAssociation]
ReadPrec CreateDirectConnectGatewayAssociation
Int -> ReadS CreateDirectConnectGatewayAssociation
ReadS [CreateDirectConnectGatewayAssociation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDirectConnectGatewayAssociation]
$creadListPrec :: ReadPrec [CreateDirectConnectGatewayAssociation]
readPrec :: ReadPrec CreateDirectConnectGatewayAssociation
$creadPrec :: ReadPrec CreateDirectConnectGatewayAssociation
readList :: ReadS [CreateDirectConnectGatewayAssociation]
$creadList :: ReadS [CreateDirectConnectGatewayAssociation]
readsPrec :: Int -> ReadS CreateDirectConnectGatewayAssociation
$creadsPrec :: Int -> ReadS CreateDirectConnectGatewayAssociation
Prelude.Read, Int -> CreateDirectConnectGatewayAssociation -> ShowS
[CreateDirectConnectGatewayAssociation] -> ShowS
CreateDirectConnectGatewayAssociation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDirectConnectGatewayAssociation] -> ShowS
$cshowList :: [CreateDirectConnectGatewayAssociation] -> ShowS
show :: CreateDirectConnectGatewayAssociation -> String
$cshow :: CreateDirectConnectGatewayAssociation -> String
showsPrec :: Int -> CreateDirectConnectGatewayAssociation -> ShowS
$cshowsPrec :: Int -> CreateDirectConnectGatewayAssociation -> ShowS
Prelude.Show, forall x.
Rep CreateDirectConnectGatewayAssociation x
-> CreateDirectConnectGatewayAssociation
forall x.
CreateDirectConnectGatewayAssociation
-> Rep CreateDirectConnectGatewayAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDirectConnectGatewayAssociation x
-> CreateDirectConnectGatewayAssociation
$cfrom :: forall x.
CreateDirectConnectGatewayAssociation
-> Rep CreateDirectConnectGatewayAssociation x
Prelude.Generic)

-- |
-- Create a value of 'CreateDirectConnectGatewayAssociation' 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', 'createDirectConnectGatewayAssociation_addAllowedPrefixesToDirectConnectGateway' - The Amazon VPC prefixes to advertise to the Direct Connect gateway
--
-- This parameter is required when you create an association to a transit
-- gateway.
--
-- For information about how to set the prefixes, see
-- <https://docs.aws.amazon.com/directconnect/latest/UserGuide/multi-account-associate-vgw.html#allowed-prefixes Allowed Prefixes>
-- in the /Direct Connect User Guide/.
--
-- 'gatewayId', 'createDirectConnectGatewayAssociation_gatewayId' - The ID of the virtual private gateway or transit gateway.
--
-- 'virtualGatewayId', 'createDirectConnectGatewayAssociation_virtualGatewayId' - The ID of the virtual private gateway.
--
-- 'directConnectGatewayId', 'createDirectConnectGatewayAssociation_directConnectGatewayId' - The ID of the Direct Connect gateway.
newCreateDirectConnectGatewayAssociation ::
  -- | 'directConnectGatewayId'
  Prelude.Text ->
  CreateDirectConnectGatewayAssociation
newCreateDirectConnectGatewayAssociation :: Text -> CreateDirectConnectGatewayAssociation
newCreateDirectConnectGatewayAssociation
  Text
pDirectConnectGatewayId_ =
    CreateDirectConnectGatewayAssociation'
      { $sel:addAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociation' :: Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway =
          forall a. Maybe a
Prelude.Nothing,
        $sel:gatewayId:CreateDirectConnectGatewayAssociation' :: Maybe Text
gatewayId = forall a. Maybe a
Prelude.Nothing,
        $sel:virtualGatewayId:CreateDirectConnectGatewayAssociation' :: Maybe Text
virtualGatewayId = forall a. Maybe a
Prelude.Nothing,
        $sel:directConnectGatewayId:CreateDirectConnectGatewayAssociation' :: Text
directConnectGatewayId =
          Text
pDirectConnectGatewayId_
      }

-- | The Amazon VPC prefixes to advertise to the Direct Connect gateway
--
-- This parameter is required when you create an association to a transit
-- gateway.
--
-- For information about how to set the prefixes, see
-- <https://docs.aws.amazon.com/directconnect/latest/UserGuide/multi-account-associate-vgw.html#allowed-prefixes Allowed Prefixes>
-- in the /Direct Connect User Guide/.
createDirectConnectGatewayAssociation_addAllowedPrefixesToDirectConnectGateway :: Lens.Lens' CreateDirectConnectGatewayAssociation (Prelude.Maybe [RouteFilterPrefix])
createDirectConnectGatewayAssociation_addAllowedPrefixesToDirectConnectGateway :: Lens'
  CreateDirectConnectGatewayAssociation (Maybe [RouteFilterPrefix])
createDirectConnectGatewayAssociation_addAllowedPrefixesToDirectConnectGateway = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDirectConnectGatewayAssociation' {Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
$sel:addAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociation' :: CreateDirectConnectGatewayAssociation -> Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway} -> Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway) (\s :: CreateDirectConnectGatewayAssociation
s@CreateDirectConnectGatewayAssociation' {} Maybe [RouteFilterPrefix]
a -> CreateDirectConnectGatewayAssociation
s {$sel:addAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociation' :: Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway = Maybe [RouteFilterPrefix]
a} :: CreateDirectConnectGatewayAssociation) 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 virtual private gateway or transit gateway.
createDirectConnectGatewayAssociation_gatewayId :: Lens.Lens' CreateDirectConnectGatewayAssociation (Prelude.Maybe Prelude.Text)
createDirectConnectGatewayAssociation_gatewayId :: Lens' CreateDirectConnectGatewayAssociation (Maybe Text)
createDirectConnectGatewayAssociation_gatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDirectConnectGatewayAssociation' {Maybe Text
gatewayId :: Maybe Text
$sel:gatewayId:CreateDirectConnectGatewayAssociation' :: CreateDirectConnectGatewayAssociation -> Maybe Text
gatewayId} -> Maybe Text
gatewayId) (\s :: CreateDirectConnectGatewayAssociation
s@CreateDirectConnectGatewayAssociation' {} Maybe Text
a -> CreateDirectConnectGatewayAssociation
s {$sel:gatewayId:CreateDirectConnectGatewayAssociation' :: Maybe Text
gatewayId = Maybe Text
a} :: CreateDirectConnectGatewayAssociation)

-- | The ID of the virtual private gateway.
createDirectConnectGatewayAssociation_virtualGatewayId :: Lens.Lens' CreateDirectConnectGatewayAssociation (Prelude.Maybe Prelude.Text)
createDirectConnectGatewayAssociation_virtualGatewayId :: Lens' CreateDirectConnectGatewayAssociation (Maybe Text)
createDirectConnectGatewayAssociation_virtualGatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDirectConnectGatewayAssociation' {Maybe Text
virtualGatewayId :: Maybe Text
$sel:virtualGatewayId:CreateDirectConnectGatewayAssociation' :: CreateDirectConnectGatewayAssociation -> Maybe Text
virtualGatewayId} -> Maybe Text
virtualGatewayId) (\s :: CreateDirectConnectGatewayAssociation
s@CreateDirectConnectGatewayAssociation' {} Maybe Text
a -> CreateDirectConnectGatewayAssociation
s {$sel:virtualGatewayId:CreateDirectConnectGatewayAssociation' :: Maybe Text
virtualGatewayId = Maybe Text
a} :: CreateDirectConnectGatewayAssociation)

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

instance
  Core.AWSRequest
    CreateDirectConnectGatewayAssociation
  where
  type
    AWSResponse
      CreateDirectConnectGatewayAssociation =
      CreateDirectConnectGatewayAssociationResponse
  request :: (Service -> Service)
-> CreateDirectConnectGatewayAssociation
-> Request CreateDirectConnectGatewayAssociation
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 CreateDirectConnectGatewayAssociation
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse CreateDirectConnectGatewayAssociation)))
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 DirectConnectGatewayAssociation
-> Int -> CreateDirectConnectGatewayAssociationResponse
CreateDirectConnectGatewayAssociationResponse'
            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
"directConnectGatewayAssociation")
            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
    CreateDirectConnectGatewayAssociation
  where
  hashWithSalt :: Int -> CreateDirectConnectGatewayAssociation -> Int
hashWithSalt
    Int
_salt
    CreateDirectConnectGatewayAssociation' {Maybe [RouteFilterPrefix]
Maybe Text
Text
directConnectGatewayId :: Text
virtualGatewayId :: Maybe Text
gatewayId :: Maybe Text
addAllowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
$sel:directConnectGatewayId:CreateDirectConnectGatewayAssociation' :: CreateDirectConnectGatewayAssociation -> Text
$sel:virtualGatewayId:CreateDirectConnectGatewayAssociation' :: CreateDirectConnectGatewayAssociation -> Maybe Text
$sel:gatewayId:CreateDirectConnectGatewayAssociation' :: CreateDirectConnectGatewayAssociation -> Maybe Text
$sel:addAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociation' :: CreateDirectConnectGatewayAssociation -> 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 Text
gatewayId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
virtualGatewayId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
directConnectGatewayId

instance
  Prelude.NFData
    CreateDirectConnectGatewayAssociation
  where
  rnf :: CreateDirectConnectGatewayAssociation -> ()
rnf CreateDirectConnectGatewayAssociation' {Maybe [RouteFilterPrefix]
Maybe Text
Text
directConnectGatewayId :: Text
virtualGatewayId :: Maybe Text
gatewayId :: Maybe Text
addAllowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
$sel:directConnectGatewayId:CreateDirectConnectGatewayAssociation' :: CreateDirectConnectGatewayAssociation -> Text
$sel:virtualGatewayId:CreateDirectConnectGatewayAssociation' :: CreateDirectConnectGatewayAssociation -> Maybe Text
$sel:gatewayId:CreateDirectConnectGatewayAssociation' :: CreateDirectConnectGatewayAssociation -> Maybe Text
$sel:addAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociation' :: CreateDirectConnectGatewayAssociation -> 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 Text
gatewayId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
virtualGatewayId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
directConnectGatewayId

instance
  Data.ToHeaders
    CreateDirectConnectGatewayAssociation
  where
  toHeaders :: CreateDirectConnectGatewayAssociation -> 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.CreateDirectConnectGatewayAssociation" ::
                          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
    CreateDirectConnectGatewayAssociation
  where
  toJSON :: CreateDirectConnectGatewayAssociation -> Value
toJSON CreateDirectConnectGatewayAssociation' {Maybe [RouteFilterPrefix]
Maybe Text
Text
directConnectGatewayId :: Text
virtualGatewayId :: Maybe Text
gatewayId :: Maybe Text
addAllowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
$sel:directConnectGatewayId:CreateDirectConnectGatewayAssociation' :: CreateDirectConnectGatewayAssociation -> Text
$sel:virtualGatewayId:CreateDirectConnectGatewayAssociation' :: CreateDirectConnectGatewayAssociation -> Maybe Text
$sel:gatewayId:CreateDirectConnectGatewayAssociation' :: CreateDirectConnectGatewayAssociation -> Maybe Text
$sel:addAllowedPrefixesToDirectConnectGateway:CreateDirectConnectGatewayAssociation' :: CreateDirectConnectGatewayAssociation -> 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
"gatewayId" 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 Text
gatewayId,
            (Key
"virtualGatewayId" 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 Text
virtualGatewayId,
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"directConnectGatewayId"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
directConnectGatewayId
              )
          ]
      )

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

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

-- | /See:/ 'newCreateDirectConnectGatewayAssociationResponse' smart constructor.
data CreateDirectConnectGatewayAssociationResponse = CreateDirectConnectGatewayAssociationResponse'
  { -- | The association to be created.
    CreateDirectConnectGatewayAssociationResponse
-> Maybe DirectConnectGatewayAssociation
directConnectGatewayAssociation :: Prelude.Maybe DirectConnectGatewayAssociation,
    -- | The response's http status code.
    CreateDirectConnectGatewayAssociationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateDirectConnectGatewayAssociationResponse
-> CreateDirectConnectGatewayAssociationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDirectConnectGatewayAssociationResponse
-> CreateDirectConnectGatewayAssociationResponse -> Bool
$c/= :: CreateDirectConnectGatewayAssociationResponse
-> CreateDirectConnectGatewayAssociationResponse -> Bool
== :: CreateDirectConnectGatewayAssociationResponse
-> CreateDirectConnectGatewayAssociationResponse -> Bool
$c== :: CreateDirectConnectGatewayAssociationResponse
-> CreateDirectConnectGatewayAssociationResponse -> Bool
Prelude.Eq, ReadPrec [CreateDirectConnectGatewayAssociationResponse]
ReadPrec CreateDirectConnectGatewayAssociationResponse
Int -> ReadS CreateDirectConnectGatewayAssociationResponse
ReadS [CreateDirectConnectGatewayAssociationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDirectConnectGatewayAssociationResponse]
$creadListPrec :: ReadPrec [CreateDirectConnectGatewayAssociationResponse]
readPrec :: ReadPrec CreateDirectConnectGatewayAssociationResponse
$creadPrec :: ReadPrec CreateDirectConnectGatewayAssociationResponse
readList :: ReadS [CreateDirectConnectGatewayAssociationResponse]
$creadList :: ReadS [CreateDirectConnectGatewayAssociationResponse]
readsPrec :: Int -> ReadS CreateDirectConnectGatewayAssociationResponse
$creadsPrec :: Int -> ReadS CreateDirectConnectGatewayAssociationResponse
Prelude.Read, Int -> CreateDirectConnectGatewayAssociationResponse -> ShowS
[CreateDirectConnectGatewayAssociationResponse] -> ShowS
CreateDirectConnectGatewayAssociationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDirectConnectGatewayAssociationResponse] -> ShowS
$cshowList :: [CreateDirectConnectGatewayAssociationResponse] -> ShowS
show :: CreateDirectConnectGatewayAssociationResponse -> String
$cshow :: CreateDirectConnectGatewayAssociationResponse -> String
showsPrec :: Int -> CreateDirectConnectGatewayAssociationResponse -> ShowS
$cshowsPrec :: Int -> CreateDirectConnectGatewayAssociationResponse -> ShowS
Prelude.Show, forall x.
Rep CreateDirectConnectGatewayAssociationResponse x
-> CreateDirectConnectGatewayAssociationResponse
forall x.
CreateDirectConnectGatewayAssociationResponse
-> Rep CreateDirectConnectGatewayAssociationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDirectConnectGatewayAssociationResponse x
-> CreateDirectConnectGatewayAssociationResponse
$cfrom :: forall x.
CreateDirectConnectGatewayAssociationResponse
-> Rep CreateDirectConnectGatewayAssociationResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateDirectConnectGatewayAssociationResponse' 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:
--
-- 'directConnectGatewayAssociation', 'createDirectConnectGatewayAssociationResponse_directConnectGatewayAssociation' - The association to be created.
--
-- 'httpStatus', 'createDirectConnectGatewayAssociationResponse_httpStatus' - The response's http status code.
newCreateDirectConnectGatewayAssociationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateDirectConnectGatewayAssociationResponse
newCreateDirectConnectGatewayAssociationResponse :: Int -> CreateDirectConnectGatewayAssociationResponse
newCreateDirectConnectGatewayAssociationResponse
  Int
pHttpStatus_ =
    CreateDirectConnectGatewayAssociationResponse'
      { $sel:directConnectGatewayAssociation:CreateDirectConnectGatewayAssociationResponse' :: Maybe DirectConnectGatewayAssociation
directConnectGatewayAssociation =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateDirectConnectGatewayAssociationResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The association to be created.
createDirectConnectGatewayAssociationResponse_directConnectGatewayAssociation :: Lens.Lens' CreateDirectConnectGatewayAssociationResponse (Prelude.Maybe DirectConnectGatewayAssociation)
createDirectConnectGatewayAssociationResponse_directConnectGatewayAssociation :: Lens'
  CreateDirectConnectGatewayAssociationResponse
  (Maybe DirectConnectGatewayAssociation)
createDirectConnectGatewayAssociationResponse_directConnectGatewayAssociation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDirectConnectGatewayAssociationResponse' {Maybe DirectConnectGatewayAssociation
directConnectGatewayAssociation :: Maybe DirectConnectGatewayAssociation
$sel:directConnectGatewayAssociation:CreateDirectConnectGatewayAssociationResponse' :: CreateDirectConnectGatewayAssociationResponse
-> Maybe DirectConnectGatewayAssociation
directConnectGatewayAssociation} -> Maybe DirectConnectGatewayAssociation
directConnectGatewayAssociation) (\s :: CreateDirectConnectGatewayAssociationResponse
s@CreateDirectConnectGatewayAssociationResponse' {} Maybe DirectConnectGatewayAssociation
a -> CreateDirectConnectGatewayAssociationResponse
s {$sel:directConnectGatewayAssociation:CreateDirectConnectGatewayAssociationResponse' :: Maybe DirectConnectGatewayAssociation
directConnectGatewayAssociation = Maybe DirectConnectGatewayAssociation
a} :: CreateDirectConnectGatewayAssociationResponse)

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

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