{-# 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.GetTransitGatewayRegistrations
-- 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 the transit gateway registrations in a specified
-- global network.
--
-- This operation returns paginated results.
module Amazonka.NetworkManager.GetTransitGatewayRegistrations
  ( -- * Creating a Request
    GetTransitGatewayRegistrations (..),
    newGetTransitGatewayRegistrations,

    -- * Request Lenses
    getTransitGatewayRegistrations_maxResults,
    getTransitGatewayRegistrations_nextToken,
    getTransitGatewayRegistrations_transitGatewayArns,
    getTransitGatewayRegistrations_globalNetworkId,

    -- * Destructuring the Response
    GetTransitGatewayRegistrationsResponse (..),
    newGetTransitGatewayRegistrationsResponse,

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

-- |
-- Create a value of 'GetTransitGatewayRegistrations' 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', 'getTransitGatewayRegistrations_maxResults' - The maximum number of results to return.
--
-- 'nextToken', 'getTransitGatewayRegistrations_nextToken' - The token for the next page of results.
--
-- 'transitGatewayArns', 'getTransitGatewayRegistrations_transitGatewayArns' - The Amazon Resource Names (ARNs) of one or more transit gateways. The
-- maximum is 10.
--
-- 'globalNetworkId', 'getTransitGatewayRegistrations_globalNetworkId' - The ID of the global network.
newGetTransitGatewayRegistrations ::
  -- | 'globalNetworkId'
  Prelude.Text ->
  GetTransitGatewayRegistrations
newGetTransitGatewayRegistrations :: Text -> GetTransitGatewayRegistrations
newGetTransitGatewayRegistrations Text
pGlobalNetworkId_ =
  GetTransitGatewayRegistrations'
    { $sel:maxResults:GetTransitGatewayRegistrations' :: Maybe Natural
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetTransitGatewayRegistrations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:transitGatewayArns:GetTransitGatewayRegistrations' :: Maybe [Text]
transitGatewayArns = forall a. Maybe a
Prelude.Nothing,
      $sel:globalNetworkId:GetTransitGatewayRegistrations' :: Text
globalNetworkId = Text
pGlobalNetworkId_
    }

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

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

-- | The Amazon Resource Names (ARNs) of one or more transit gateways. The
-- maximum is 10.
getTransitGatewayRegistrations_transitGatewayArns :: Lens.Lens' GetTransitGatewayRegistrations (Prelude.Maybe [Prelude.Text])
getTransitGatewayRegistrations_transitGatewayArns :: Lens' GetTransitGatewayRegistrations (Maybe [Text])
getTransitGatewayRegistrations_transitGatewayArns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayRegistrations' {Maybe [Text]
transitGatewayArns :: Maybe [Text]
$sel:transitGatewayArns:GetTransitGatewayRegistrations' :: GetTransitGatewayRegistrations -> Maybe [Text]
transitGatewayArns} -> Maybe [Text]
transitGatewayArns) (\s :: GetTransitGatewayRegistrations
s@GetTransitGatewayRegistrations' {} Maybe [Text]
a -> GetTransitGatewayRegistrations
s {$sel:transitGatewayArns:GetTransitGatewayRegistrations' :: Maybe [Text]
transitGatewayArns = Maybe [Text]
a} :: GetTransitGatewayRegistrations) 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.
getTransitGatewayRegistrations_globalNetworkId :: Lens.Lens' GetTransitGatewayRegistrations Prelude.Text
getTransitGatewayRegistrations_globalNetworkId :: Lens' GetTransitGatewayRegistrations Text
getTransitGatewayRegistrations_globalNetworkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayRegistrations' {Text
globalNetworkId :: Text
$sel:globalNetworkId:GetTransitGatewayRegistrations' :: GetTransitGatewayRegistrations -> Text
globalNetworkId} -> Text
globalNetworkId) (\s :: GetTransitGatewayRegistrations
s@GetTransitGatewayRegistrations' {} Text
a -> GetTransitGatewayRegistrations
s {$sel:globalNetworkId:GetTransitGatewayRegistrations' :: Text
globalNetworkId = Text
a} :: GetTransitGatewayRegistrations)

instance Core.AWSPager GetTransitGatewayRegistrations where
  page :: GetTransitGatewayRegistrations
-> AWSResponse GetTransitGatewayRegistrations
-> Maybe GetTransitGatewayRegistrations
page GetTransitGatewayRegistrations
rq AWSResponse GetTransitGatewayRegistrations
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetTransitGatewayRegistrations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetTransitGatewayRegistrationsResponse (Maybe Text)
getTransitGatewayRegistrationsResponse_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 GetTransitGatewayRegistrations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  GetTransitGatewayRegistrationsResponse
  (Maybe [TransitGatewayRegistration])
getTransitGatewayRegistrationsResponse_transitGatewayRegistrations
            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.$ GetTransitGatewayRegistrations
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' GetTransitGatewayRegistrations (Maybe Text)
getTransitGatewayRegistrations_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetTransitGatewayRegistrations
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetTransitGatewayRegistrationsResponse (Maybe Text)
getTransitGatewayRegistrationsResponse_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
    GetTransitGatewayRegistrations
  where
  type
    AWSResponse GetTransitGatewayRegistrations =
      GetTransitGatewayRegistrationsResponse
  request :: (Service -> Service)
-> GetTransitGatewayRegistrations
-> Request GetTransitGatewayRegistrations
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 GetTransitGatewayRegistrations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetTransitGatewayRegistrations)))
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 [TransitGatewayRegistration]
-> Int
-> GetTransitGatewayRegistrationsResponse
GetTransitGatewayRegistrationsResponse'
            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
"TransitGatewayRegistrations"
                            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
    GetTransitGatewayRegistrations
  where
  hashWithSalt :: Int -> GetTransitGatewayRegistrations -> Int
hashWithSalt
    Int
_salt
    GetTransitGatewayRegistrations' {Maybe Natural
Maybe [Text]
Maybe Text
Text
globalNetworkId :: Text
transitGatewayArns :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:globalNetworkId:GetTransitGatewayRegistrations' :: GetTransitGatewayRegistrations -> Text
$sel:transitGatewayArns:GetTransitGatewayRegistrations' :: GetTransitGatewayRegistrations -> Maybe [Text]
$sel:nextToken:GetTransitGatewayRegistrations' :: GetTransitGatewayRegistrations -> Maybe Text
$sel:maxResults:GetTransitGatewayRegistrations' :: GetTransitGatewayRegistrations -> 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]
transitGatewayArns
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
globalNetworkId

instance
  Prelude.NFData
    GetTransitGatewayRegistrations
  where
  rnf :: GetTransitGatewayRegistrations -> ()
rnf GetTransitGatewayRegistrations' {Maybe Natural
Maybe [Text]
Maybe Text
Text
globalNetworkId :: Text
transitGatewayArns :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:globalNetworkId:GetTransitGatewayRegistrations' :: GetTransitGatewayRegistrations -> Text
$sel:transitGatewayArns:GetTransitGatewayRegistrations' :: GetTransitGatewayRegistrations -> Maybe [Text]
$sel:nextToken:GetTransitGatewayRegistrations' :: GetTransitGatewayRegistrations -> Maybe Text
$sel:maxResults:GetTransitGatewayRegistrations' :: GetTransitGatewayRegistrations -> 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]
transitGatewayArns
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
globalNetworkId

instance
  Data.ToHeaders
    GetTransitGatewayRegistrations
  where
  toHeaders :: GetTransitGatewayRegistrations -> 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 GetTransitGatewayRegistrations where
  toPath :: GetTransitGatewayRegistrations -> ByteString
toPath GetTransitGatewayRegistrations' {Maybe Natural
Maybe [Text]
Maybe Text
Text
globalNetworkId :: Text
transitGatewayArns :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:globalNetworkId:GetTransitGatewayRegistrations' :: GetTransitGatewayRegistrations -> Text
$sel:transitGatewayArns:GetTransitGatewayRegistrations' :: GetTransitGatewayRegistrations -> Maybe [Text]
$sel:nextToken:GetTransitGatewayRegistrations' :: GetTransitGatewayRegistrations -> Maybe Text
$sel:maxResults:GetTransitGatewayRegistrations' :: GetTransitGatewayRegistrations -> 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-registrations"
      ]

instance Data.ToQuery GetTransitGatewayRegistrations where
  toQuery :: GetTransitGatewayRegistrations -> QueryString
toQuery GetTransitGatewayRegistrations' {Maybe Natural
Maybe [Text]
Maybe Text
Text
globalNetworkId :: Text
transitGatewayArns :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:globalNetworkId:GetTransitGatewayRegistrations' :: GetTransitGatewayRegistrations -> Text
$sel:transitGatewayArns:GetTransitGatewayRegistrations' :: GetTransitGatewayRegistrations -> Maybe [Text]
$sel:nextToken:GetTransitGatewayRegistrations' :: GetTransitGatewayRegistrations -> Maybe Text
$sel:maxResults:GetTransitGatewayRegistrations' :: GetTransitGatewayRegistrations -> 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
"transitGatewayArns"
          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]
transitGatewayArns
            )
      ]

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

-- |
-- Create a value of 'GetTransitGatewayRegistrationsResponse' 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', 'getTransitGatewayRegistrationsResponse_nextToken' - The token for the next page of results.
--
-- 'transitGatewayRegistrations', 'getTransitGatewayRegistrationsResponse_transitGatewayRegistrations' - The transit gateway registrations.
--
-- 'httpStatus', 'getTransitGatewayRegistrationsResponse_httpStatus' - The response's http status code.
newGetTransitGatewayRegistrationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetTransitGatewayRegistrationsResponse
newGetTransitGatewayRegistrationsResponse :: Int -> GetTransitGatewayRegistrationsResponse
newGetTransitGatewayRegistrationsResponse
  Int
pHttpStatus_ =
    GetTransitGatewayRegistrationsResponse'
      { $sel:nextToken:GetTransitGatewayRegistrationsResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:transitGatewayRegistrations:GetTransitGatewayRegistrationsResponse' :: Maybe [TransitGatewayRegistration]
transitGatewayRegistrations =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetTransitGatewayRegistrationsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

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

-- | The transit gateway registrations.
getTransitGatewayRegistrationsResponse_transitGatewayRegistrations :: Lens.Lens' GetTransitGatewayRegistrationsResponse (Prelude.Maybe [TransitGatewayRegistration])
getTransitGatewayRegistrationsResponse_transitGatewayRegistrations :: Lens'
  GetTransitGatewayRegistrationsResponse
  (Maybe [TransitGatewayRegistration])
getTransitGatewayRegistrationsResponse_transitGatewayRegistrations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayRegistrationsResponse' {Maybe [TransitGatewayRegistration]
transitGatewayRegistrations :: Maybe [TransitGatewayRegistration]
$sel:transitGatewayRegistrations:GetTransitGatewayRegistrationsResponse' :: GetTransitGatewayRegistrationsResponse
-> Maybe [TransitGatewayRegistration]
transitGatewayRegistrations} -> Maybe [TransitGatewayRegistration]
transitGatewayRegistrations) (\s :: GetTransitGatewayRegistrationsResponse
s@GetTransitGatewayRegistrationsResponse' {} Maybe [TransitGatewayRegistration]
a -> GetTransitGatewayRegistrationsResponse
s {$sel:transitGatewayRegistrations:GetTransitGatewayRegistrationsResponse' :: Maybe [TransitGatewayRegistration]
transitGatewayRegistrations = Maybe [TransitGatewayRegistration]
a} :: GetTransitGatewayRegistrationsResponse) 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.
getTransitGatewayRegistrationsResponse_httpStatus :: Lens.Lens' GetTransitGatewayRegistrationsResponse Prelude.Int
getTransitGatewayRegistrationsResponse_httpStatus :: Lens' GetTransitGatewayRegistrationsResponse Int
getTransitGatewayRegistrationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayRegistrationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetTransitGatewayRegistrationsResponse' :: GetTransitGatewayRegistrationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetTransitGatewayRegistrationsResponse
s@GetTransitGatewayRegistrationsResponse' {} Int
a -> GetTransitGatewayRegistrationsResponse
s {$sel:httpStatus:GetTransitGatewayRegistrationsResponse' :: Int
httpStatus = Int
a} :: GetTransitGatewayRegistrationsResponse)

instance
  Prelude.NFData
    GetTransitGatewayRegistrationsResponse
  where
  rnf :: GetTransitGatewayRegistrationsResponse -> ()
rnf GetTransitGatewayRegistrationsResponse' {Int
Maybe [TransitGatewayRegistration]
Maybe Text
httpStatus :: Int
transitGatewayRegistrations :: Maybe [TransitGatewayRegistration]
nextToken :: Maybe Text
$sel:httpStatus:GetTransitGatewayRegistrationsResponse' :: GetTransitGatewayRegistrationsResponse -> Int
$sel:transitGatewayRegistrations:GetTransitGatewayRegistrationsResponse' :: GetTransitGatewayRegistrationsResponse
-> Maybe [TransitGatewayRegistration]
$sel:nextToken:GetTransitGatewayRegistrationsResponse' :: GetTransitGatewayRegistrationsResponse -> 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 [TransitGatewayRegistration]
transitGatewayRegistrations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus