{-# 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.NetworkManager.AssociateTransitGatewayConnectPeer
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Associates a transit gateway Connect peer with a device, and optionally,
-- with a link. If you specify a link, it must be associated with the
-- specified device.
--
-- You can only associate transit gateway Connect peers that have been
-- created on a transit gateway that\'s registered in your global network.
--
-- You cannot associate a transit gateway Connect peer with more than one
-- device and link.
module Amazonka.NetworkManager.AssociateTransitGatewayConnectPeer
  ( -- * Creating a Request
    AssociateTransitGatewayConnectPeer (..),
    newAssociateTransitGatewayConnectPeer,

    -- * Request Lenses
    associateTransitGatewayConnectPeer_linkId,
    associateTransitGatewayConnectPeer_globalNetworkId,
    associateTransitGatewayConnectPeer_transitGatewayConnectPeerArn,
    associateTransitGatewayConnectPeer_deviceId,

    -- * Destructuring the Response
    AssociateTransitGatewayConnectPeerResponse (..),
    newAssociateTransitGatewayConnectPeerResponse,

    -- * Response Lenses
    associateTransitGatewayConnectPeerResponse_transitGatewayConnectPeerAssociation,
    associateTransitGatewayConnectPeerResponse_httpStatus,
  )
where

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

-- | /See:/ 'newAssociateTransitGatewayConnectPeer' smart constructor.
data AssociateTransitGatewayConnectPeer = AssociateTransitGatewayConnectPeer'
  { -- | The ID of the link.
    AssociateTransitGatewayConnectPeer -> Maybe Text
linkId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the global network.
    AssociateTransitGatewayConnectPeer -> Text
globalNetworkId :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the Connect peer.
    AssociateTransitGatewayConnectPeer -> Text
transitGatewayConnectPeerArn :: Prelude.Text,
    -- | The ID of the device.
    AssociateTransitGatewayConnectPeer -> Text
deviceId :: Prelude.Text
  }
  deriving (AssociateTransitGatewayConnectPeer
-> AssociateTransitGatewayConnectPeer -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateTransitGatewayConnectPeer
-> AssociateTransitGatewayConnectPeer -> Bool
$c/= :: AssociateTransitGatewayConnectPeer
-> AssociateTransitGatewayConnectPeer -> Bool
== :: AssociateTransitGatewayConnectPeer
-> AssociateTransitGatewayConnectPeer -> Bool
$c== :: AssociateTransitGatewayConnectPeer
-> AssociateTransitGatewayConnectPeer -> Bool
Prelude.Eq, ReadPrec [AssociateTransitGatewayConnectPeer]
ReadPrec AssociateTransitGatewayConnectPeer
Int -> ReadS AssociateTransitGatewayConnectPeer
ReadS [AssociateTransitGatewayConnectPeer]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateTransitGatewayConnectPeer]
$creadListPrec :: ReadPrec [AssociateTransitGatewayConnectPeer]
readPrec :: ReadPrec AssociateTransitGatewayConnectPeer
$creadPrec :: ReadPrec AssociateTransitGatewayConnectPeer
readList :: ReadS [AssociateTransitGatewayConnectPeer]
$creadList :: ReadS [AssociateTransitGatewayConnectPeer]
readsPrec :: Int -> ReadS AssociateTransitGatewayConnectPeer
$creadsPrec :: Int -> ReadS AssociateTransitGatewayConnectPeer
Prelude.Read, Int -> AssociateTransitGatewayConnectPeer -> ShowS
[AssociateTransitGatewayConnectPeer] -> ShowS
AssociateTransitGatewayConnectPeer -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateTransitGatewayConnectPeer] -> ShowS
$cshowList :: [AssociateTransitGatewayConnectPeer] -> ShowS
show :: AssociateTransitGatewayConnectPeer -> String
$cshow :: AssociateTransitGatewayConnectPeer -> String
showsPrec :: Int -> AssociateTransitGatewayConnectPeer -> ShowS
$cshowsPrec :: Int -> AssociateTransitGatewayConnectPeer -> ShowS
Prelude.Show, forall x.
Rep AssociateTransitGatewayConnectPeer x
-> AssociateTransitGatewayConnectPeer
forall x.
AssociateTransitGatewayConnectPeer
-> Rep AssociateTransitGatewayConnectPeer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateTransitGatewayConnectPeer x
-> AssociateTransitGatewayConnectPeer
$cfrom :: forall x.
AssociateTransitGatewayConnectPeer
-> Rep AssociateTransitGatewayConnectPeer x
Prelude.Generic)

-- |
-- Create a value of 'AssociateTransitGatewayConnectPeer' 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:
--
-- 'linkId', 'associateTransitGatewayConnectPeer_linkId' - The ID of the link.
--
-- 'globalNetworkId', 'associateTransitGatewayConnectPeer_globalNetworkId' - The ID of the global network.
--
-- 'transitGatewayConnectPeerArn', 'associateTransitGatewayConnectPeer_transitGatewayConnectPeerArn' - The Amazon Resource Name (ARN) of the Connect peer.
--
-- 'deviceId', 'associateTransitGatewayConnectPeer_deviceId' - The ID of the device.
newAssociateTransitGatewayConnectPeer ::
  -- | 'globalNetworkId'
  Prelude.Text ->
  -- | 'transitGatewayConnectPeerArn'
  Prelude.Text ->
  -- | 'deviceId'
  Prelude.Text ->
  AssociateTransitGatewayConnectPeer
newAssociateTransitGatewayConnectPeer :: Text -> Text -> Text -> AssociateTransitGatewayConnectPeer
newAssociateTransitGatewayConnectPeer
  Text
pGlobalNetworkId_
  Text
pTransitGatewayConnectPeerArn_
  Text
pDeviceId_ =
    AssociateTransitGatewayConnectPeer'
      { $sel:linkId:AssociateTransitGatewayConnectPeer' :: Maybe Text
linkId =
          forall a. Maybe a
Prelude.Nothing,
        $sel:globalNetworkId:AssociateTransitGatewayConnectPeer' :: Text
globalNetworkId = Text
pGlobalNetworkId_,
        $sel:transitGatewayConnectPeerArn:AssociateTransitGatewayConnectPeer' :: Text
transitGatewayConnectPeerArn =
          Text
pTransitGatewayConnectPeerArn_,
        $sel:deviceId:AssociateTransitGatewayConnectPeer' :: Text
deviceId = Text
pDeviceId_
      }

-- | The ID of the link.
associateTransitGatewayConnectPeer_linkId :: Lens.Lens' AssociateTransitGatewayConnectPeer (Prelude.Maybe Prelude.Text)
associateTransitGatewayConnectPeer_linkId :: Lens' AssociateTransitGatewayConnectPeer (Maybe Text)
associateTransitGatewayConnectPeer_linkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTransitGatewayConnectPeer' {Maybe Text
linkId :: Maybe Text
$sel:linkId:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Maybe Text
linkId} -> Maybe Text
linkId) (\s :: AssociateTransitGatewayConnectPeer
s@AssociateTransitGatewayConnectPeer' {} Maybe Text
a -> AssociateTransitGatewayConnectPeer
s {$sel:linkId:AssociateTransitGatewayConnectPeer' :: Maybe Text
linkId = Maybe Text
a} :: AssociateTransitGatewayConnectPeer)

-- | The ID of the global network.
associateTransitGatewayConnectPeer_globalNetworkId :: Lens.Lens' AssociateTransitGatewayConnectPeer Prelude.Text
associateTransitGatewayConnectPeer_globalNetworkId :: Lens' AssociateTransitGatewayConnectPeer Text
associateTransitGatewayConnectPeer_globalNetworkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTransitGatewayConnectPeer' {Text
globalNetworkId :: Text
$sel:globalNetworkId:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Text
globalNetworkId} -> Text
globalNetworkId) (\s :: AssociateTransitGatewayConnectPeer
s@AssociateTransitGatewayConnectPeer' {} Text
a -> AssociateTransitGatewayConnectPeer
s {$sel:globalNetworkId:AssociateTransitGatewayConnectPeer' :: Text
globalNetworkId = Text
a} :: AssociateTransitGatewayConnectPeer)

-- | The Amazon Resource Name (ARN) of the Connect peer.
associateTransitGatewayConnectPeer_transitGatewayConnectPeerArn :: Lens.Lens' AssociateTransitGatewayConnectPeer Prelude.Text
associateTransitGatewayConnectPeer_transitGatewayConnectPeerArn :: Lens' AssociateTransitGatewayConnectPeer Text
associateTransitGatewayConnectPeer_transitGatewayConnectPeerArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTransitGatewayConnectPeer' {Text
transitGatewayConnectPeerArn :: Text
$sel:transitGatewayConnectPeerArn:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Text
transitGatewayConnectPeerArn} -> Text
transitGatewayConnectPeerArn) (\s :: AssociateTransitGatewayConnectPeer
s@AssociateTransitGatewayConnectPeer' {} Text
a -> AssociateTransitGatewayConnectPeer
s {$sel:transitGatewayConnectPeerArn:AssociateTransitGatewayConnectPeer' :: Text
transitGatewayConnectPeerArn = Text
a} :: AssociateTransitGatewayConnectPeer)

-- | The ID of the device.
associateTransitGatewayConnectPeer_deviceId :: Lens.Lens' AssociateTransitGatewayConnectPeer Prelude.Text
associateTransitGatewayConnectPeer_deviceId :: Lens' AssociateTransitGatewayConnectPeer Text
associateTransitGatewayConnectPeer_deviceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTransitGatewayConnectPeer' {Text
deviceId :: Text
$sel:deviceId:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Text
deviceId} -> Text
deviceId) (\s :: AssociateTransitGatewayConnectPeer
s@AssociateTransitGatewayConnectPeer' {} Text
a -> AssociateTransitGatewayConnectPeer
s {$sel:deviceId:AssociateTransitGatewayConnectPeer' :: Text
deviceId = Text
a} :: AssociateTransitGatewayConnectPeer)

instance
  Core.AWSRequest
    AssociateTransitGatewayConnectPeer
  where
  type
    AWSResponse AssociateTransitGatewayConnectPeer =
      AssociateTransitGatewayConnectPeerResponse
  request :: (Service -> Service)
-> AssociateTransitGatewayConnectPeer
-> Request AssociateTransitGatewayConnectPeer
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 AssociateTransitGatewayConnectPeer
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse AssociateTransitGatewayConnectPeer)))
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 TransitGatewayConnectPeerAssociation
-> Int -> AssociateTransitGatewayConnectPeerResponse
AssociateTransitGatewayConnectPeerResponse'
            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
"TransitGatewayConnectPeerAssociation")
            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
    AssociateTransitGatewayConnectPeer
  where
  hashWithSalt :: Int -> AssociateTransitGatewayConnectPeer -> Int
hashWithSalt
    Int
_salt
    AssociateTransitGatewayConnectPeer' {Maybe Text
Text
deviceId :: Text
transitGatewayConnectPeerArn :: Text
globalNetworkId :: Text
linkId :: Maybe Text
$sel:deviceId:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Text
$sel:transitGatewayConnectPeerArn:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Text
$sel:globalNetworkId:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Text
$sel:linkId:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
linkId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
globalNetworkId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
transitGatewayConnectPeerArn
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
deviceId

instance
  Prelude.NFData
    AssociateTransitGatewayConnectPeer
  where
  rnf :: AssociateTransitGatewayConnectPeer -> ()
rnf AssociateTransitGatewayConnectPeer' {Maybe Text
Text
deviceId :: Text
transitGatewayConnectPeerArn :: Text
globalNetworkId :: Text
linkId :: Maybe Text
$sel:deviceId:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Text
$sel:transitGatewayConnectPeerArn:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Text
$sel:globalNetworkId:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Text
$sel:linkId:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
linkId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
globalNetworkId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
transitGatewayConnectPeerArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
deviceId

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

instance
  Data.ToJSON
    AssociateTransitGatewayConnectPeer
  where
  toJSON :: AssociateTransitGatewayConnectPeer -> Value
toJSON AssociateTransitGatewayConnectPeer' {Maybe Text
Text
deviceId :: Text
transitGatewayConnectPeerArn :: Text
globalNetworkId :: Text
linkId :: Maybe Text
$sel:deviceId:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Text
$sel:transitGatewayConnectPeerArn:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Text
$sel:globalNetworkId:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Text
$sel:linkId:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"LinkId" 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
linkId,
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"TransitGatewayConnectPeerArn"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
transitGatewayConnectPeerArn
              ),
            forall a. a -> Maybe a
Prelude.Just (Key
"DeviceId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
deviceId)
          ]
      )

instance
  Data.ToPath
    AssociateTransitGatewayConnectPeer
  where
  toPath :: AssociateTransitGatewayConnectPeer -> ByteString
toPath AssociateTransitGatewayConnectPeer' {Maybe Text
Text
deviceId :: Text
transitGatewayConnectPeerArn :: Text
globalNetworkId :: Text
linkId :: Maybe Text
$sel:deviceId:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Text
$sel:transitGatewayConnectPeerArn:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Text
$sel:globalNetworkId:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Text
$sel:linkId:AssociateTransitGatewayConnectPeer' :: AssociateTransitGatewayConnectPeer -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/global-networks/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
globalNetworkId,
        ByteString
"/transit-gateway-connect-peer-associations"
      ]

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

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

-- |
-- Create a value of 'AssociateTransitGatewayConnectPeerResponse' 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:
--
-- 'transitGatewayConnectPeerAssociation', 'associateTransitGatewayConnectPeerResponse_transitGatewayConnectPeerAssociation' - The transit gateway Connect peer association.
--
-- 'httpStatus', 'associateTransitGatewayConnectPeerResponse_httpStatus' - The response's http status code.
newAssociateTransitGatewayConnectPeerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AssociateTransitGatewayConnectPeerResponse
newAssociateTransitGatewayConnectPeerResponse :: Int -> AssociateTransitGatewayConnectPeerResponse
newAssociateTransitGatewayConnectPeerResponse
  Int
pHttpStatus_ =
    AssociateTransitGatewayConnectPeerResponse'
      { $sel:transitGatewayConnectPeerAssociation:AssociateTransitGatewayConnectPeerResponse' :: Maybe TransitGatewayConnectPeerAssociation
transitGatewayConnectPeerAssociation =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:AssociateTransitGatewayConnectPeerResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The transit gateway Connect peer association.
associateTransitGatewayConnectPeerResponse_transitGatewayConnectPeerAssociation :: Lens.Lens' AssociateTransitGatewayConnectPeerResponse (Prelude.Maybe TransitGatewayConnectPeerAssociation)
associateTransitGatewayConnectPeerResponse_transitGatewayConnectPeerAssociation :: Lens'
  AssociateTransitGatewayConnectPeerResponse
  (Maybe TransitGatewayConnectPeerAssociation)
associateTransitGatewayConnectPeerResponse_transitGatewayConnectPeerAssociation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTransitGatewayConnectPeerResponse' {Maybe TransitGatewayConnectPeerAssociation
transitGatewayConnectPeerAssociation :: Maybe TransitGatewayConnectPeerAssociation
$sel:transitGatewayConnectPeerAssociation:AssociateTransitGatewayConnectPeerResponse' :: AssociateTransitGatewayConnectPeerResponse
-> Maybe TransitGatewayConnectPeerAssociation
transitGatewayConnectPeerAssociation} -> Maybe TransitGatewayConnectPeerAssociation
transitGatewayConnectPeerAssociation) (\s :: AssociateTransitGatewayConnectPeerResponse
s@AssociateTransitGatewayConnectPeerResponse' {} Maybe TransitGatewayConnectPeerAssociation
a -> AssociateTransitGatewayConnectPeerResponse
s {$sel:transitGatewayConnectPeerAssociation:AssociateTransitGatewayConnectPeerResponse' :: Maybe TransitGatewayConnectPeerAssociation
transitGatewayConnectPeerAssociation = Maybe TransitGatewayConnectPeerAssociation
a} :: AssociateTransitGatewayConnectPeerResponse)

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

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