{-# 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.GetTransitGatewayConnectPeerAssociations
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets information about one or more of your transit gateway Connect peer
-- associations in a global network.
--
-- This operation returns paginated results.
module Amazonka.NetworkManager.GetTransitGatewayConnectPeerAssociations
  ( -- * Creating a Request
    GetTransitGatewayConnectPeerAssociations (..),
    newGetTransitGatewayConnectPeerAssociations,

    -- * Request Lenses
    getTransitGatewayConnectPeerAssociations_maxResults,
    getTransitGatewayConnectPeerAssociations_nextToken,
    getTransitGatewayConnectPeerAssociations_transitGatewayConnectPeerArns,
    getTransitGatewayConnectPeerAssociations_globalNetworkId,

    -- * Destructuring the Response
    GetTransitGatewayConnectPeerAssociationsResponse (..),
    newGetTransitGatewayConnectPeerAssociationsResponse,

    -- * Response Lenses
    getTransitGatewayConnectPeerAssociationsResponse_nextToken,
    getTransitGatewayConnectPeerAssociationsResponse_transitGatewayConnectPeerAssociations,
    getTransitGatewayConnectPeerAssociationsResponse_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:/ 'newGetTransitGatewayConnectPeerAssociations' smart constructor.
data GetTransitGatewayConnectPeerAssociations = GetTransitGatewayConnectPeerAssociations'
  { -- | The maximum number of results to return.
    GetTransitGatewayConnectPeerAssociations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    GetTransitGatewayConnectPeerAssociations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | One or more transit gateway Connect peer Amazon Resource Names (ARNs).
    GetTransitGatewayConnectPeerAssociations -> Maybe [Text]
transitGatewayConnectPeerArns :: Prelude.Maybe [Prelude.Text],
    -- | The ID of the global network.
    GetTransitGatewayConnectPeerAssociations -> Text
globalNetworkId :: Prelude.Text
  }
  deriving (GetTransitGatewayConnectPeerAssociations
-> GetTransitGatewayConnectPeerAssociations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTransitGatewayConnectPeerAssociations
-> GetTransitGatewayConnectPeerAssociations -> Bool
$c/= :: GetTransitGatewayConnectPeerAssociations
-> GetTransitGatewayConnectPeerAssociations -> Bool
== :: GetTransitGatewayConnectPeerAssociations
-> GetTransitGatewayConnectPeerAssociations -> Bool
$c== :: GetTransitGatewayConnectPeerAssociations
-> GetTransitGatewayConnectPeerAssociations -> Bool
Prelude.Eq, ReadPrec [GetTransitGatewayConnectPeerAssociations]
ReadPrec GetTransitGatewayConnectPeerAssociations
Int -> ReadS GetTransitGatewayConnectPeerAssociations
ReadS [GetTransitGatewayConnectPeerAssociations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTransitGatewayConnectPeerAssociations]
$creadListPrec :: ReadPrec [GetTransitGatewayConnectPeerAssociations]
readPrec :: ReadPrec GetTransitGatewayConnectPeerAssociations
$creadPrec :: ReadPrec GetTransitGatewayConnectPeerAssociations
readList :: ReadS [GetTransitGatewayConnectPeerAssociations]
$creadList :: ReadS [GetTransitGatewayConnectPeerAssociations]
readsPrec :: Int -> ReadS GetTransitGatewayConnectPeerAssociations
$creadsPrec :: Int -> ReadS GetTransitGatewayConnectPeerAssociations
Prelude.Read, Int -> GetTransitGatewayConnectPeerAssociations -> ShowS
[GetTransitGatewayConnectPeerAssociations] -> ShowS
GetTransitGatewayConnectPeerAssociations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTransitGatewayConnectPeerAssociations] -> ShowS
$cshowList :: [GetTransitGatewayConnectPeerAssociations] -> ShowS
show :: GetTransitGatewayConnectPeerAssociations -> String
$cshow :: GetTransitGatewayConnectPeerAssociations -> String
showsPrec :: Int -> GetTransitGatewayConnectPeerAssociations -> ShowS
$cshowsPrec :: Int -> GetTransitGatewayConnectPeerAssociations -> ShowS
Prelude.Show, forall x.
Rep GetTransitGatewayConnectPeerAssociations x
-> GetTransitGatewayConnectPeerAssociations
forall x.
GetTransitGatewayConnectPeerAssociations
-> Rep GetTransitGatewayConnectPeerAssociations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetTransitGatewayConnectPeerAssociations x
-> GetTransitGatewayConnectPeerAssociations
$cfrom :: forall x.
GetTransitGatewayConnectPeerAssociations
-> Rep GetTransitGatewayConnectPeerAssociations x
Prelude.Generic)

-- |
-- Create a value of 'GetTransitGatewayConnectPeerAssociations' 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:
--
-- 'maxResults', 'getTransitGatewayConnectPeerAssociations_maxResults' - The maximum number of results to return.
--
-- 'nextToken', 'getTransitGatewayConnectPeerAssociations_nextToken' - The token for the next page of results.
--
-- 'transitGatewayConnectPeerArns', 'getTransitGatewayConnectPeerAssociations_transitGatewayConnectPeerArns' - One or more transit gateway Connect peer Amazon Resource Names (ARNs).
--
-- 'globalNetworkId', 'getTransitGatewayConnectPeerAssociations_globalNetworkId' - The ID of the global network.
newGetTransitGatewayConnectPeerAssociations ::
  -- | 'globalNetworkId'
  Prelude.Text ->
  GetTransitGatewayConnectPeerAssociations
newGetTransitGatewayConnectPeerAssociations :: Text -> GetTransitGatewayConnectPeerAssociations
newGetTransitGatewayConnectPeerAssociations
  Text
pGlobalNetworkId_ =
    GetTransitGatewayConnectPeerAssociations'
      { $sel:maxResults:GetTransitGatewayConnectPeerAssociations' :: Maybe Natural
maxResults =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetTransitGatewayConnectPeerAssociations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:transitGatewayConnectPeerArns:GetTransitGatewayConnectPeerAssociations' :: Maybe [Text]
transitGatewayConnectPeerArns =
          forall a. Maybe a
Prelude.Nothing,
        $sel:globalNetworkId:GetTransitGatewayConnectPeerAssociations' :: Text
globalNetworkId =
          Text
pGlobalNetworkId_
      }

-- | The maximum number of results to return.
getTransitGatewayConnectPeerAssociations_maxResults :: Lens.Lens' GetTransitGatewayConnectPeerAssociations (Prelude.Maybe Prelude.Natural)
getTransitGatewayConnectPeerAssociations_maxResults :: Lens' GetTransitGatewayConnectPeerAssociations (Maybe Natural)
getTransitGatewayConnectPeerAssociations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayConnectPeerAssociations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetTransitGatewayConnectPeerAssociations
s@GetTransitGatewayConnectPeerAssociations' {} Maybe Natural
a -> GetTransitGatewayConnectPeerAssociations
s {$sel:maxResults:GetTransitGatewayConnectPeerAssociations' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetTransitGatewayConnectPeerAssociations)

-- | The token for the next page of results.
getTransitGatewayConnectPeerAssociations_nextToken :: Lens.Lens' GetTransitGatewayConnectPeerAssociations (Prelude.Maybe Prelude.Text)
getTransitGatewayConnectPeerAssociations_nextToken :: Lens' GetTransitGatewayConnectPeerAssociations (Maybe Text)
getTransitGatewayConnectPeerAssociations_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayConnectPeerAssociations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetTransitGatewayConnectPeerAssociations
s@GetTransitGatewayConnectPeerAssociations' {} Maybe Text
a -> GetTransitGatewayConnectPeerAssociations
s {$sel:nextToken:GetTransitGatewayConnectPeerAssociations' :: Maybe Text
nextToken = Maybe Text
a} :: GetTransitGatewayConnectPeerAssociations)

-- | One or more transit gateway Connect peer Amazon Resource Names (ARNs).
getTransitGatewayConnectPeerAssociations_transitGatewayConnectPeerArns :: Lens.Lens' GetTransitGatewayConnectPeerAssociations (Prelude.Maybe [Prelude.Text])
getTransitGatewayConnectPeerAssociations_transitGatewayConnectPeerArns :: Lens' GetTransitGatewayConnectPeerAssociations (Maybe [Text])
getTransitGatewayConnectPeerAssociations_transitGatewayConnectPeerArns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayConnectPeerAssociations' {Maybe [Text]
transitGatewayConnectPeerArns :: Maybe [Text]
$sel:transitGatewayConnectPeerArns:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Maybe [Text]
transitGatewayConnectPeerArns} -> Maybe [Text]
transitGatewayConnectPeerArns) (\s :: GetTransitGatewayConnectPeerAssociations
s@GetTransitGatewayConnectPeerAssociations' {} Maybe [Text]
a -> GetTransitGatewayConnectPeerAssociations
s {$sel:transitGatewayConnectPeerArns:GetTransitGatewayConnectPeerAssociations' :: Maybe [Text]
transitGatewayConnectPeerArns = Maybe [Text]
a} :: GetTransitGatewayConnectPeerAssociations) 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 global network.
getTransitGatewayConnectPeerAssociations_globalNetworkId :: Lens.Lens' GetTransitGatewayConnectPeerAssociations Prelude.Text
getTransitGatewayConnectPeerAssociations_globalNetworkId :: Lens' GetTransitGatewayConnectPeerAssociations Text
getTransitGatewayConnectPeerAssociations_globalNetworkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayConnectPeerAssociations' {Text
globalNetworkId :: Text
$sel:globalNetworkId:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Text
globalNetworkId} -> Text
globalNetworkId) (\s :: GetTransitGatewayConnectPeerAssociations
s@GetTransitGatewayConnectPeerAssociations' {} Text
a -> GetTransitGatewayConnectPeerAssociations
s {$sel:globalNetworkId:GetTransitGatewayConnectPeerAssociations' :: Text
globalNetworkId = Text
a} :: GetTransitGatewayConnectPeerAssociations)

instance
  Core.AWSPager
    GetTransitGatewayConnectPeerAssociations
  where
  page :: GetTransitGatewayConnectPeerAssociations
-> AWSResponse GetTransitGatewayConnectPeerAssociations
-> Maybe GetTransitGatewayConnectPeerAssociations
page GetTransitGatewayConnectPeerAssociations
rq AWSResponse GetTransitGatewayConnectPeerAssociations
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetTransitGatewayConnectPeerAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetTransitGatewayConnectPeerAssociationsResponse (Maybe Text)
getTransitGatewayConnectPeerAssociationsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetTransitGatewayConnectPeerAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  GetTransitGatewayConnectPeerAssociationsResponse
  (Maybe [TransitGatewayConnectPeerAssociation])
getTransitGatewayConnectPeerAssociationsResponse_transitGatewayConnectPeerAssociations
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ GetTransitGatewayConnectPeerAssociations
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' GetTransitGatewayConnectPeerAssociations (Maybe Text)
getTransitGatewayConnectPeerAssociations_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetTransitGatewayConnectPeerAssociations
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetTransitGatewayConnectPeerAssociationsResponse (Maybe Text)
getTransitGatewayConnectPeerAssociationsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance
  Core.AWSRequest
    GetTransitGatewayConnectPeerAssociations
  where
  type
    AWSResponse
      GetTransitGatewayConnectPeerAssociations =
      GetTransitGatewayConnectPeerAssociationsResponse
  request :: (Service -> Service)
-> GetTransitGatewayConnectPeerAssociations
-> Request GetTransitGatewayConnectPeerAssociations
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetTransitGatewayConnectPeerAssociations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse GetTransitGatewayConnectPeerAssociations)))
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 Text
-> Maybe [TransitGatewayConnectPeerAssociation]
-> Int
-> GetTransitGatewayConnectPeerAssociationsResponse
GetTransitGatewayConnectPeerAssociationsResponse'
            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
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"TransitGatewayConnectPeerAssociations"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            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
    GetTransitGatewayConnectPeerAssociations
  where
  hashWithSalt :: Int -> GetTransitGatewayConnectPeerAssociations -> Int
hashWithSalt
    Int
_salt
    GetTransitGatewayConnectPeerAssociations' {Maybe Natural
Maybe [Text]
Maybe Text
Text
globalNetworkId :: Text
transitGatewayConnectPeerArns :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:globalNetworkId:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Text
$sel:transitGatewayConnectPeerArns:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Maybe [Text]
$sel:nextToken:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Maybe Text
$sel:maxResults:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Maybe Natural
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
transitGatewayConnectPeerArns
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
globalNetworkId

instance
  Prelude.NFData
    GetTransitGatewayConnectPeerAssociations
  where
  rnf :: GetTransitGatewayConnectPeerAssociations -> ()
rnf GetTransitGatewayConnectPeerAssociations' {Maybe Natural
Maybe [Text]
Maybe Text
Text
globalNetworkId :: Text
transitGatewayConnectPeerArns :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:globalNetworkId:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Text
$sel:transitGatewayConnectPeerArns:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Maybe [Text]
$sel:nextToken:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Maybe Text
$sel:maxResults:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
transitGatewayConnectPeerArns
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
globalNetworkId

instance
  Data.ToHeaders
    GetTransitGatewayConnectPeerAssociations
  where
  toHeaders :: GetTransitGatewayConnectPeerAssociations -> 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.ToPath
    GetTransitGatewayConnectPeerAssociations
  where
  toPath :: GetTransitGatewayConnectPeerAssociations -> ByteString
toPath GetTransitGatewayConnectPeerAssociations' {Maybe Natural
Maybe [Text]
Maybe Text
Text
globalNetworkId :: Text
transitGatewayConnectPeerArns :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:globalNetworkId:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Text
$sel:transitGatewayConnectPeerArns:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Maybe [Text]
$sel:nextToken:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Maybe Text
$sel:maxResults:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Maybe Natural
..} =
    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
    GetTransitGatewayConnectPeerAssociations
  where
  toQuery :: GetTransitGatewayConnectPeerAssociations -> QueryString
toQuery GetTransitGatewayConnectPeerAssociations' {Maybe Natural
Maybe [Text]
Maybe Text
Text
globalNetworkId :: Text
transitGatewayConnectPeerArns :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:globalNetworkId:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Text
$sel:transitGatewayConnectPeerArns:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Maybe [Text]
$sel:nextToken:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Maybe Text
$sel:maxResults:GetTransitGatewayConnectPeerAssociations' :: GetTransitGatewayConnectPeerAssociations -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
        ByteString
"transitGatewayConnectPeerArns"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
transitGatewayConnectPeerArns
            )
      ]

-- | /See:/ 'newGetTransitGatewayConnectPeerAssociationsResponse' smart constructor.
data GetTransitGatewayConnectPeerAssociationsResponse = GetTransitGatewayConnectPeerAssociationsResponse'
  { -- | The token to use for the next page of results.
    GetTransitGatewayConnectPeerAssociationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Information about the transit gateway Connect peer associations.
    GetTransitGatewayConnectPeerAssociationsResponse
-> Maybe [TransitGatewayConnectPeerAssociation]
transitGatewayConnectPeerAssociations :: Prelude.Maybe [TransitGatewayConnectPeerAssociation],
    -- | The response's http status code.
    GetTransitGatewayConnectPeerAssociationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetTransitGatewayConnectPeerAssociationsResponse
-> GetTransitGatewayConnectPeerAssociationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTransitGatewayConnectPeerAssociationsResponse
-> GetTransitGatewayConnectPeerAssociationsResponse -> Bool
$c/= :: GetTransitGatewayConnectPeerAssociationsResponse
-> GetTransitGatewayConnectPeerAssociationsResponse -> Bool
== :: GetTransitGatewayConnectPeerAssociationsResponse
-> GetTransitGatewayConnectPeerAssociationsResponse -> Bool
$c== :: GetTransitGatewayConnectPeerAssociationsResponse
-> GetTransitGatewayConnectPeerAssociationsResponse -> Bool
Prelude.Eq, ReadPrec [GetTransitGatewayConnectPeerAssociationsResponse]
ReadPrec GetTransitGatewayConnectPeerAssociationsResponse
Int -> ReadS GetTransitGatewayConnectPeerAssociationsResponse
ReadS [GetTransitGatewayConnectPeerAssociationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTransitGatewayConnectPeerAssociationsResponse]
$creadListPrec :: ReadPrec [GetTransitGatewayConnectPeerAssociationsResponse]
readPrec :: ReadPrec GetTransitGatewayConnectPeerAssociationsResponse
$creadPrec :: ReadPrec GetTransitGatewayConnectPeerAssociationsResponse
readList :: ReadS [GetTransitGatewayConnectPeerAssociationsResponse]
$creadList :: ReadS [GetTransitGatewayConnectPeerAssociationsResponse]
readsPrec :: Int -> ReadS GetTransitGatewayConnectPeerAssociationsResponse
$creadsPrec :: Int -> ReadS GetTransitGatewayConnectPeerAssociationsResponse
Prelude.Read, Int -> GetTransitGatewayConnectPeerAssociationsResponse -> ShowS
[GetTransitGatewayConnectPeerAssociationsResponse] -> ShowS
GetTransitGatewayConnectPeerAssociationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTransitGatewayConnectPeerAssociationsResponse] -> ShowS
$cshowList :: [GetTransitGatewayConnectPeerAssociationsResponse] -> ShowS
show :: GetTransitGatewayConnectPeerAssociationsResponse -> String
$cshow :: GetTransitGatewayConnectPeerAssociationsResponse -> String
showsPrec :: Int -> GetTransitGatewayConnectPeerAssociationsResponse -> ShowS
$cshowsPrec :: Int -> GetTransitGatewayConnectPeerAssociationsResponse -> ShowS
Prelude.Show, forall x.
Rep GetTransitGatewayConnectPeerAssociationsResponse x
-> GetTransitGatewayConnectPeerAssociationsResponse
forall x.
GetTransitGatewayConnectPeerAssociationsResponse
-> Rep GetTransitGatewayConnectPeerAssociationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetTransitGatewayConnectPeerAssociationsResponse x
-> GetTransitGatewayConnectPeerAssociationsResponse
$cfrom :: forall x.
GetTransitGatewayConnectPeerAssociationsResponse
-> Rep GetTransitGatewayConnectPeerAssociationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetTransitGatewayConnectPeerAssociationsResponse' 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:
--
-- 'nextToken', 'getTransitGatewayConnectPeerAssociationsResponse_nextToken' - The token to use for the next page of results.
--
-- 'transitGatewayConnectPeerAssociations', 'getTransitGatewayConnectPeerAssociationsResponse_transitGatewayConnectPeerAssociations' - Information about the transit gateway Connect peer associations.
--
-- 'httpStatus', 'getTransitGatewayConnectPeerAssociationsResponse_httpStatus' - The response's http status code.
newGetTransitGatewayConnectPeerAssociationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetTransitGatewayConnectPeerAssociationsResponse
newGetTransitGatewayConnectPeerAssociationsResponse :: Int -> GetTransitGatewayConnectPeerAssociationsResponse
newGetTransitGatewayConnectPeerAssociationsResponse
  Int
pHttpStatus_ =
    GetTransitGatewayConnectPeerAssociationsResponse'
      { $sel:nextToken:GetTransitGatewayConnectPeerAssociationsResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:transitGatewayConnectPeerAssociations:GetTransitGatewayConnectPeerAssociationsResponse' :: Maybe [TransitGatewayConnectPeerAssociation]
transitGatewayConnectPeerAssociations =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetTransitGatewayConnectPeerAssociationsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The token to use for the next page of results.
getTransitGatewayConnectPeerAssociationsResponse_nextToken :: Lens.Lens' GetTransitGatewayConnectPeerAssociationsResponse (Prelude.Maybe Prelude.Text)
getTransitGatewayConnectPeerAssociationsResponse_nextToken :: Lens' GetTransitGatewayConnectPeerAssociationsResponse (Maybe Text)
getTransitGatewayConnectPeerAssociationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayConnectPeerAssociationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetTransitGatewayConnectPeerAssociationsResponse' :: GetTransitGatewayConnectPeerAssociationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetTransitGatewayConnectPeerAssociationsResponse
s@GetTransitGatewayConnectPeerAssociationsResponse' {} Maybe Text
a -> GetTransitGatewayConnectPeerAssociationsResponse
s {$sel:nextToken:GetTransitGatewayConnectPeerAssociationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetTransitGatewayConnectPeerAssociationsResponse)

-- | Information about the transit gateway Connect peer associations.
getTransitGatewayConnectPeerAssociationsResponse_transitGatewayConnectPeerAssociations :: Lens.Lens' GetTransitGatewayConnectPeerAssociationsResponse (Prelude.Maybe [TransitGatewayConnectPeerAssociation])
getTransitGatewayConnectPeerAssociationsResponse_transitGatewayConnectPeerAssociations :: Lens'
  GetTransitGatewayConnectPeerAssociationsResponse
  (Maybe [TransitGatewayConnectPeerAssociation])
getTransitGatewayConnectPeerAssociationsResponse_transitGatewayConnectPeerAssociations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayConnectPeerAssociationsResponse' {Maybe [TransitGatewayConnectPeerAssociation]
transitGatewayConnectPeerAssociations :: Maybe [TransitGatewayConnectPeerAssociation]
$sel:transitGatewayConnectPeerAssociations:GetTransitGatewayConnectPeerAssociationsResponse' :: GetTransitGatewayConnectPeerAssociationsResponse
-> Maybe [TransitGatewayConnectPeerAssociation]
transitGatewayConnectPeerAssociations} -> Maybe [TransitGatewayConnectPeerAssociation]
transitGatewayConnectPeerAssociations) (\s :: GetTransitGatewayConnectPeerAssociationsResponse
s@GetTransitGatewayConnectPeerAssociationsResponse' {} Maybe [TransitGatewayConnectPeerAssociation]
a -> GetTransitGatewayConnectPeerAssociationsResponse
s {$sel:transitGatewayConnectPeerAssociations:GetTransitGatewayConnectPeerAssociationsResponse' :: Maybe [TransitGatewayConnectPeerAssociation]
transitGatewayConnectPeerAssociations = Maybe [TransitGatewayConnectPeerAssociation]
a} :: GetTransitGatewayConnectPeerAssociationsResponse) 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 response's http status code.
getTransitGatewayConnectPeerAssociationsResponse_httpStatus :: Lens.Lens' GetTransitGatewayConnectPeerAssociationsResponse Prelude.Int
getTransitGatewayConnectPeerAssociationsResponse_httpStatus :: Lens' GetTransitGatewayConnectPeerAssociationsResponse Int
getTransitGatewayConnectPeerAssociationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayConnectPeerAssociationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetTransitGatewayConnectPeerAssociationsResponse' :: GetTransitGatewayConnectPeerAssociationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetTransitGatewayConnectPeerAssociationsResponse
s@GetTransitGatewayConnectPeerAssociationsResponse' {} Int
a -> GetTransitGatewayConnectPeerAssociationsResponse
s {$sel:httpStatus:GetTransitGatewayConnectPeerAssociationsResponse' :: Int
httpStatus = Int
a} :: GetTransitGatewayConnectPeerAssociationsResponse)

instance
  Prelude.NFData
    GetTransitGatewayConnectPeerAssociationsResponse
  where
  rnf :: GetTransitGatewayConnectPeerAssociationsResponse -> ()
rnf
    GetTransitGatewayConnectPeerAssociationsResponse' {Int
Maybe [TransitGatewayConnectPeerAssociation]
Maybe Text
httpStatus :: Int
transitGatewayConnectPeerAssociations :: Maybe [TransitGatewayConnectPeerAssociation]
nextToken :: Maybe Text
$sel:httpStatus:GetTransitGatewayConnectPeerAssociationsResponse' :: GetTransitGatewayConnectPeerAssociationsResponse -> Int
$sel:transitGatewayConnectPeerAssociations:GetTransitGatewayConnectPeerAssociationsResponse' :: GetTransitGatewayConnectPeerAssociationsResponse
-> Maybe [TransitGatewayConnectPeerAssociation]
$sel:nextToken:GetTransitGatewayConnectPeerAssociationsResponse' :: GetTransitGatewayConnectPeerAssociationsResponse -> Maybe Text
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TransitGatewayConnectPeerAssociation]
transitGatewayConnectPeerAssociations
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus