{-# 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.GetCustomerGatewayAssociations
-- 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 the association information for customer gateways that are
-- associated with devices and links in your global network.
--
-- This operation returns paginated results.
module Amazonka.NetworkManager.GetCustomerGatewayAssociations
  ( -- * Creating a Request
    GetCustomerGatewayAssociations (..),
    newGetCustomerGatewayAssociations,

    -- * Request Lenses
    getCustomerGatewayAssociations_customerGatewayArns,
    getCustomerGatewayAssociations_maxResults,
    getCustomerGatewayAssociations_nextToken,
    getCustomerGatewayAssociations_globalNetworkId,

    -- * Destructuring the Response
    GetCustomerGatewayAssociationsResponse (..),
    newGetCustomerGatewayAssociationsResponse,

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

-- |
-- Create a value of 'GetCustomerGatewayAssociations' 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:
--
-- 'customerGatewayArns', 'getCustomerGatewayAssociations_customerGatewayArns' - One or more customer gateway Amazon Resource Names (ARNs). The maximum
-- is 10.
--
-- 'maxResults', 'getCustomerGatewayAssociations_maxResults' - The maximum number of results to return.
--
-- 'nextToken', 'getCustomerGatewayAssociations_nextToken' - The token for the next page of results.
--
-- 'globalNetworkId', 'getCustomerGatewayAssociations_globalNetworkId' - The ID of the global network.
newGetCustomerGatewayAssociations ::
  -- | 'globalNetworkId'
  Prelude.Text ->
  GetCustomerGatewayAssociations
newGetCustomerGatewayAssociations :: Text -> GetCustomerGatewayAssociations
newGetCustomerGatewayAssociations Text
pGlobalNetworkId_ =
  GetCustomerGatewayAssociations'
    { $sel:customerGatewayArns:GetCustomerGatewayAssociations' :: Maybe [Text]
customerGatewayArns =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetCustomerGatewayAssociations' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetCustomerGatewayAssociations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:globalNetworkId:GetCustomerGatewayAssociations' :: Text
globalNetworkId = Text
pGlobalNetworkId_
    }

-- | One or more customer gateway Amazon Resource Names (ARNs). The maximum
-- is 10.
getCustomerGatewayAssociations_customerGatewayArns :: Lens.Lens' GetCustomerGatewayAssociations (Prelude.Maybe [Prelude.Text])
getCustomerGatewayAssociations_customerGatewayArns :: Lens' GetCustomerGatewayAssociations (Maybe [Text])
getCustomerGatewayAssociations_customerGatewayArns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCustomerGatewayAssociations' {Maybe [Text]
customerGatewayArns :: Maybe [Text]
$sel:customerGatewayArns:GetCustomerGatewayAssociations' :: GetCustomerGatewayAssociations -> Maybe [Text]
customerGatewayArns} -> Maybe [Text]
customerGatewayArns) (\s :: GetCustomerGatewayAssociations
s@GetCustomerGatewayAssociations' {} Maybe [Text]
a -> GetCustomerGatewayAssociations
s {$sel:customerGatewayArns:GetCustomerGatewayAssociations' :: Maybe [Text]
customerGatewayArns = Maybe [Text]
a} :: GetCustomerGatewayAssociations) 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 maximum number of results to return.
getCustomerGatewayAssociations_maxResults :: Lens.Lens' GetCustomerGatewayAssociations (Prelude.Maybe Prelude.Natural)
getCustomerGatewayAssociations_maxResults :: Lens' GetCustomerGatewayAssociations (Maybe Natural)
getCustomerGatewayAssociations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCustomerGatewayAssociations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetCustomerGatewayAssociations' :: GetCustomerGatewayAssociations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetCustomerGatewayAssociations
s@GetCustomerGatewayAssociations' {} Maybe Natural
a -> GetCustomerGatewayAssociations
s {$sel:maxResults:GetCustomerGatewayAssociations' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetCustomerGatewayAssociations)

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

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

instance Core.AWSPager GetCustomerGatewayAssociations where
  page :: GetCustomerGatewayAssociations
-> AWSResponse GetCustomerGatewayAssociations
-> Maybe GetCustomerGatewayAssociations
page GetCustomerGatewayAssociations
rq AWSResponse GetCustomerGatewayAssociations
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetCustomerGatewayAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetCustomerGatewayAssociationsResponse (Maybe Text)
getCustomerGatewayAssociationsResponse_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 GetCustomerGatewayAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  GetCustomerGatewayAssociationsResponse
  (Maybe [CustomerGatewayAssociation])
getCustomerGatewayAssociationsResponse_customerGatewayAssociations
            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.$ GetCustomerGatewayAssociations
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' GetCustomerGatewayAssociations (Maybe Text)
getCustomerGatewayAssociations_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetCustomerGatewayAssociations
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetCustomerGatewayAssociationsResponse (Maybe Text)
getCustomerGatewayAssociationsResponse_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
    GetCustomerGatewayAssociations
  where
  type
    AWSResponse GetCustomerGatewayAssociations =
      GetCustomerGatewayAssociationsResponse
  request :: (Service -> Service)
-> GetCustomerGatewayAssociations
-> Request GetCustomerGatewayAssociations
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 GetCustomerGatewayAssociations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetCustomerGatewayAssociations)))
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 [CustomerGatewayAssociation]
-> Maybe Text -> Int -> GetCustomerGatewayAssociationsResponse
GetCustomerGatewayAssociationsResponse'
            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
"CustomerGatewayAssociations"
                            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.<*> (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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    GetCustomerGatewayAssociations
  where
  hashWithSalt :: Int -> GetCustomerGatewayAssociations -> Int
hashWithSalt
    Int
_salt
    GetCustomerGatewayAssociations' {Maybe Natural
Maybe [Text]
Maybe Text
Text
globalNetworkId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
customerGatewayArns :: Maybe [Text]
$sel:globalNetworkId:GetCustomerGatewayAssociations' :: GetCustomerGatewayAssociations -> Text
$sel:nextToken:GetCustomerGatewayAssociations' :: GetCustomerGatewayAssociations -> Maybe Text
$sel:maxResults:GetCustomerGatewayAssociations' :: GetCustomerGatewayAssociations -> Maybe Natural
$sel:customerGatewayArns:GetCustomerGatewayAssociations' :: GetCustomerGatewayAssociations -> Maybe [Text]
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
customerGatewayArns
        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` Text
globalNetworkId

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

instance
  Data.ToHeaders
    GetCustomerGatewayAssociations
  where
  toHeaders :: GetCustomerGatewayAssociations -> 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 GetCustomerGatewayAssociations where
  toPath :: GetCustomerGatewayAssociations -> ByteString
toPath GetCustomerGatewayAssociations' {Maybe Natural
Maybe [Text]
Maybe Text
Text
globalNetworkId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
customerGatewayArns :: Maybe [Text]
$sel:globalNetworkId:GetCustomerGatewayAssociations' :: GetCustomerGatewayAssociations -> Text
$sel:nextToken:GetCustomerGatewayAssociations' :: GetCustomerGatewayAssociations -> Maybe Text
$sel:maxResults:GetCustomerGatewayAssociations' :: GetCustomerGatewayAssociations -> Maybe Natural
$sel:customerGatewayArns:GetCustomerGatewayAssociations' :: GetCustomerGatewayAssociations -> Maybe [Text]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/global-networks/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
globalNetworkId,
        ByteString
"/customer-gateway-associations"
      ]

instance Data.ToQuery GetCustomerGatewayAssociations where
  toQuery :: GetCustomerGatewayAssociations -> QueryString
toQuery GetCustomerGatewayAssociations' {Maybe Natural
Maybe [Text]
Maybe Text
Text
globalNetworkId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
customerGatewayArns :: Maybe [Text]
$sel:globalNetworkId:GetCustomerGatewayAssociations' :: GetCustomerGatewayAssociations -> Text
$sel:nextToken:GetCustomerGatewayAssociations' :: GetCustomerGatewayAssociations -> Maybe Text
$sel:maxResults:GetCustomerGatewayAssociations' :: GetCustomerGatewayAssociations -> Maybe Natural
$sel:customerGatewayArns:GetCustomerGatewayAssociations' :: GetCustomerGatewayAssociations -> Maybe [Text]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"customerGatewayArns"
          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]
customerGatewayArns
            ),
        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
      ]

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

-- |
-- Create a value of 'GetCustomerGatewayAssociationsResponse' 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:
--
-- 'customerGatewayAssociations', 'getCustomerGatewayAssociationsResponse_customerGatewayAssociations' - The customer gateway associations.
--
-- 'nextToken', 'getCustomerGatewayAssociationsResponse_nextToken' - The token for the next page of results.
--
-- 'httpStatus', 'getCustomerGatewayAssociationsResponse_httpStatus' - The response's http status code.
newGetCustomerGatewayAssociationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetCustomerGatewayAssociationsResponse
newGetCustomerGatewayAssociationsResponse :: Int -> GetCustomerGatewayAssociationsResponse
newGetCustomerGatewayAssociationsResponse
  Int
pHttpStatus_ =
    GetCustomerGatewayAssociationsResponse'
      { $sel:customerGatewayAssociations:GetCustomerGatewayAssociationsResponse' :: Maybe [CustomerGatewayAssociation]
customerGatewayAssociations =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetCustomerGatewayAssociationsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetCustomerGatewayAssociationsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The customer gateway associations.
getCustomerGatewayAssociationsResponse_customerGatewayAssociations :: Lens.Lens' GetCustomerGatewayAssociationsResponse (Prelude.Maybe [CustomerGatewayAssociation])
getCustomerGatewayAssociationsResponse_customerGatewayAssociations :: Lens'
  GetCustomerGatewayAssociationsResponse
  (Maybe [CustomerGatewayAssociation])
getCustomerGatewayAssociationsResponse_customerGatewayAssociations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCustomerGatewayAssociationsResponse' {Maybe [CustomerGatewayAssociation]
customerGatewayAssociations :: Maybe [CustomerGatewayAssociation]
$sel:customerGatewayAssociations:GetCustomerGatewayAssociationsResponse' :: GetCustomerGatewayAssociationsResponse
-> Maybe [CustomerGatewayAssociation]
customerGatewayAssociations} -> Maybe [CustomerGatewayAssociation]
customerGatewayAssociations) (\s :: GetCustomerGatewayAssociationsResponse
s@GetCustomerGatewayAssociationsResponse' {} Maybe [CustomerGatewayAssociation]
a -> GetCustomerGatewayAssociationsResponse
s {$sel:customerGatewayAssociations:GetCustomerGatewayAssociationsResponse' :: Maybe [CustomerGatewayAssociation]
customerGatewayAssociations = Maybe [CustomerGatewayAssociation]
a} :: GetCustomerGatewayAssociationsResponse) 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 token for the next page of results.
getCustomerGatewayAssociationsResponse_nextToken :: Lens.Lens' GetCustomerGatewayAssociationsResponse (Prelude.Maybe Prelude.Text)
getCustomerGatewayAssociationsResponse_nextToken :: Lens' GetCustomerGatewayAssociationsResponse (Maybe Text)
getCustomerGatewayAssociationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCustomerGatewayAssociationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetCustomerGatewayAssociationsResponse' :: GetCustomerGatewayAssociationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetCustomerGatewayAssociationsResponse
s@GetCustomerGatewayAssociationsResponse' {} Maybe Text
a -> GetCustomerGatewayAssociationsResponse
s {$sel:nextToken:GetCustomerGatewayAssociationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetCustomerGatewayAssociationsResponse)

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

instance
  Prelude.NFData
    GetCustomerGatewayAssociationsResponse
  where
  rnf :: GetCustomerGatewayAssociationsResponse -> ()
rnf GetCustomerGatewayAssociationsResponse' {Int
Maybe [CustomerGatewayAssociation]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
customerGatewayAssociations :: Maybe [CustomerGatewayAssociation]
$sel:httpStatus:GetCustomerGatewayAssociationsResponse' :: GetCustomerGatewayAssociationsResponse -> Int
$sel:nextToken:GetCustomerGatewayAssociationsResponse' :: GetCustomerGatewayAssociationsResponse -> Maybe Text
$sel:customerGatewayAssociations:GetCustomerGatewayAssociationsResponse' :: GetCustomerGatewayAssociationsResponse
-> Maybe [CustomerGatewayAssociation]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [CustomerGatewayAssociation]
customerGatewayAssociations
      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 Int
httpStatus