{-# 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-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)
--
-- 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.Lens as Lens
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
(AssociateTransitGatewayConnectPeer
 -> AssociateTransitGatewayConnectPeer -> Bool)
-> (AssociateTransitGatewayConnectPeer
    -> AssociateTransitGatewayConnectPeer -> Bool)
-> Eq AssociateTransitGatewayConnectPeer
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]
(Int -> ReadS AssociateTransitGatewayConnectPeer)
-> ReadS [AssociateTransitGatewayConnectPeer]
-> ReadPrec AssociateTransitGatewayConnectPeer
-> ReadPrec [AssociateTransitGatewayConnectPeer]
-> Read 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
(Int -> AssociateTransitGatewayConnectPeer -> ShowS)
-> (AssociateTransitGatewayConnectPeer -> String)
-> ([AssociateTransitGatewayConnectPeer] -> ShowS)
-> Show AssociateTransitGatewayConnectPeer
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.
 AssociateTransitGatewayConnectPeer
 -> Rep AssociateTransitGatewayConnectPeer x)
-> (forall x.
    Rep AssociateTransitGatewayConnectPeer x
    -> AssociateTransitGatewayConnectPeer)
-> Generic AssociateTransitGatewayConnectPeer
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' :: Maybe Text
-> Text -> Text -> Text -> AssociateTransitGatewayConnectPeer
AssociateTransitGatewayConnectPeer'
      { $sel:linkId:AssociateTransitGatewayConnectPeer' :: Maybe Text
linkId =
          Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> AssociateTransitGatewayConnectPeer
-> f AssociateTransitGatewayConnectPeer
associateTransitGatewayConnectPeer_linkId = (AssociateTransitGatewayConnectPeer -> Maybe Text)
-> (AssociateTransitGatewayConnectPeer
    -> Maybe Text -> AssociateTransitGatewayConnectPeer)
-> Lens
     AssociateTransitGatewayConnectPeer
     AssociateTransitGatewayConnectPeer
     (Maybe Text)
     (Maybe Text)
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 :: (Text -> f Text)
-> AssociateTransitGatewayConnectPeer
-> f AssociateTransitGatewayConnectPeer
associateTransitGatewayConnectPeer_globalNetworkId = (AssociateTransitGatewayConnectPeer -> Text)
-> (AssociateTransitGatewayConnectPeer
    -> Text -> AssociateTransitGatewayConnectPeer)
-> Lens
     AssociateTransitGatewayConnectPeer
     AssociateTransitGatewayConnectPeer
     Text
     Text
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 :: (Text -> f Text)
-> AssociateTransitGatewayConnectPeer
-> f AssociateTransitGatewayConnectPeer
associateTransitGatewayConnectPeer_transitGatewayConnectPeerArn = (AssociateTransitGatewayConnectPeer -> Text)
-> (AssociateTransitGatewayConnectPeer
    -> Text -> AssociateTransitGatewayConnectPeer)
-> Lens
     AssociateTransitGatewayConnectPeer
     AssociateTransitGatewayConnectPeer
     Text
     Text
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 :: (Text -> f Text)
-> AssociateTransitGatewayConnectPeer
-> f AssociateTransitGatewayConnectPeer
associateTransitGatewayConnectPeer_deviceId = (AssociateTransitGatewayConnectPeer -> Text)
-> (AssociateTransitGatewayConnectPeer
    -> Text -> AssociateTransitGatewayConnectPeer)
-> Lens
     AssociateTransitGatewayConnectPeer
     AssociateTransitGatewayConnectPeer
     Text
     Text
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 :: AssociateTransitGatewayConnectPeer
-> Request AssociateTransitGatewayConnectPeer
request = Service
-> AssociateTransitGatewayConnectPeer
-> Request AssociateTransitGatewayConnectPeer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy AssociateTransitGatewayConnectPeer
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse AssociateTransitGatewayConnectPeer)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse AssociateTransitGatewayConnectPeer))
-> Logger
-> Service
-> Proxy AssociateTransitGatewayConnectPeer
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse AssociateTransitGatewayConnectPeer)))
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 TransitGatewayConnectPeerAssociation
-> Int -> AssociateTransitGatewayConnectPeerResponse
AssociateTransitGatewayConnectPeerResponse'
            (Maybe TransitGatewayConnectPeerAssociation
 -> Int -> AssociateTransitGatewayConnectPeerResponse)
-> Either String (Maybe TransitGatewayConnectPeerAssociation)
-> Either
     String (Int -> AssociateTransitGatewayConnectPeerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Either String (Maybe TransitGatewayConnectPeerAssociation)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TransitGatewayConnectPeerAssociation")
              Either String (Int -> AssociateTransitGatewayConnectPeerResponse)
-> Either String Int
-> Either String AssociateTransitGatewayConnectPeerResponse
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
    AssociateTransitGatewayConnectPeer

instance
  Prelude.NFData
    AssociateTransitGatewayConnectPeer

instance
  Core.ToHeaders
    AssociateTransitGatewayConnectPeer
  where
  toHeaders :: AssociateTransitGatewayConnectPeer -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> AssociateTransitGatewayConnectPeer -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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
    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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"LinkId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
linkId,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"TransitGatewayConnectPeerArn"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
transitGatewayConnectPeerArn
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DeviceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deviceId)
          ]
      )

instance
  Core.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
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/global-networks/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
globalNetworkId,
        ByteString
"/transit-gateway-connect-peer-associations"
      ]

instance
  Core.ToQuery
    AssociateTransitGatewayConnectPeer
  where
  toQuery :: AssociateTransitGatewayConnectPeer -> QueryString
toQuery = QueryString -> AssociateTransitGatewayConnectPeer -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(AssociateTransitGatewayConnectPeerResponse
 -> AssociateTransitGatewayConnectPeerResponse -> Bool)
-> (AssociateTransitGatewayConnectPeerResponse
    -> AssociateTransitGatewayConnectPeerResponse -> Bool)
-> Eq AssociateTransitGatewayConnectPeerResponse
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]
(Int -> ReadS AssociateTransitGatewayConnectPeerResponse)
-> ReadS [AssociateTransitGatewayConnectPeerResponse]
-> ReadPrec AssociateTransitGatewayConnectPeerResponse
-> ReadPrec [AssociateTransitGatewayConnectPeerResponse]
-> Read 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
(Int -> AssociateTransitGatewayConnectPeerResponse -> ShowS)
-> (AssociateTransitGatewayConnectPeerResponse -> String)
-> ([AssociateTransitGatewayConnectPeerResponse] -> ShowS)
-> Show AssociateTransitGatewayConnectPeerResponse
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.
 AssociateTransitGatewayConnectPeerResponse
 -> Rep AssociateTransitGatewayConnectPeerResponse x)
-> (forall x.
    Rep AssociateTransitGatewayConnectPeerResponse x
    -> AssociateTransitGatewayConnectPeerResponse)
-> Generic AssociateTransitGatewayConnectPeerResponse
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' :: Maybe TransitGatewayConnectPeerAssociation
-> Int -> AssociateTransitGatewayConnectPeerResponse
AssociateTransitGatewayConnectPeerResponse'
      { $sel:transitGatewayConnectPeerAssociation:AssociateTransitGatewayConnectPeerResponse' :: Maybe TransitGatewayConnectPeerAssociation
transitGatewayConnectPeerAssociation =
          Maybe 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 :: (Maybe TransitGatewayConnectPeerAssociation
 -> f (Maybe TransitGatewayConnectPeerAssociation))
-> AssociateTransitGatewayConnectPeerResponse
-> f AssociateTransitGatewayConnectPeerResponse
associateTransitGatewayConnectPeerResponse_transitGatewayConnectPeerAssociation = (AssociateTransitGatewayConnectPeerResponse
 -> Maybe TransitGatewayConnectPeerAssociation)
-> (AssociateTransitGatewayConnectPeerResponse
    -> Maybe TransitGatewayConnectPeerAssociation
    -> AssociateTransitGatewayConnectPeerResponse)
-> Lens
     AssociateTransitGatewayConnectPeerResponse
     AssociateTransitGatewayConnectPeerResponse
     (Maybe TransitGatewayConnectPeerAssociation)
     (Maybe 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 :: (Int -> f Int)
-> AssociateTransitGatewayConnectPeerResponse
-> f AssociateTransitGatewayConnectPeerResponse
associateTransitGatewayConnectPeerResponse_httpStatus = (AssociateTransitGatewayConnectPeerResponse -> Int)
-> (AssociateTransitGatewayConnectPeerResponse
    -> Int -> AssociateTransitGatewayConnectPeerResponse)
-> Lens
     AssociateTransitGatewayConnectPeerResponse
     AssociateTransitGatewayConnectPeerResponse
     Int
     Int
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