{-# 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.DirectConnect.DescribeDirectConnectGatewayAssociations
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the associations between your Direct Connect gateways and virtual
-- private gateways and transit gateways. You must specify one of the
-- following:
--
-- -   A Direct Connect gateway
--
--     The response contains all virtual private gateways and transit
--     gateways associated with the Direct Connect gateway.
--
-- -   A virtual private gateway
--
--     The response contains the Direct Connect gateway.
--
-- -   A transit gateway
--
--     The response contains the Direct Connect gateway.
--
-- -   A Direct Connect gateway and a virtual private gateway
--
--     The response contains the association between the Direct Connect
--     gateway and virtual private gateway.
--
-- -   A Direct Connect gateway and a transit gateway
--
--     The response contains the association between the Direct Connect
--     gateway and transit gateway.
--
-- This operation returns paginated results.
module Amazonka.DirectConnect.DescribeDirectConnectGatewayAssociations
  ( -- * Creating a Request
    DescribeDirectConnectGatewayAssociations (..),
    newDescribeDirectConnectGatewayAssociations,

    -- * Request Lenses
    describeDirectConnectGatewayAssociations_associatedGatewayId,
    describeDirectConnectGatewayAssociations_associationId,
    describeDirectConnectGatewayAssociations_directConnectGatewayId,
    describeDirectConnectGatewayAssociations_maxResults,
    describeDirectConnectGatewayAssociations_nextToken,
    describeDirectConnectGatewayAssociations_virtualGatewayId,

    -- * Destructuring the Response
    DescribeDirectConnectGatewayAssociationsResponse (..),
    newDescribeDirectConnectGatewayAssociationsResponse,

    -- * Response Lenses
    describeDirectConnectGatewayAssociationsResponse_directConnectGatewayAssociations,
    describeDirectConnectGatewayAssociationsResponse_nextToken,
    describeDirectConnectGatewayAssociationsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeDirectConnectGatewayAssociations' smart constructor.
data DescribeDirectConnectGatewayAssociations = DescribeDirectConnectGatewayAssociations'
  { -- | The ID of the associated gateway.
    DescribeDirectConnectGatewayAssociations -> Maybe Text
associatedGatewayId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Direct Connect gateway association.
    DescribeDirectConnectGatewayAssociations -> Maybe Text
associationId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Direct Connect gateway.
    DescribeDirectConnectGatewayAssociations -> Maybe Text
directConnectGatewayId :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return with a single call. To retrieve
    -- the remaining results, make another call with the returned @nextToken@
    -- value.
    --
    -- If @MaxResults@ is given a value larger than 100, only 100 results are
    -- returned.
    DescribeDirectConnectGatewayAssociations -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | The token provided in the previous call to retrieve the next page.
    DescribeDirectConnectGatewayAssociations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the virtual private gateway or transit gateway.
    DescribeDirectConnectGatewayAssociations -> Maybe Text
virtualGatewayId :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeDirectConnectGatewayAssociations
-> DescribeDirectConnectGatewayAssociations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDirectConnectGatewayAssociations
-> DescribeDirectConnectGatewayAssociations -> Bool
$c/= :: DescribeDirectConnectGatewayAssociations
-> DescribeDirectConnectGatewayAssociations -> Bool
== :: DescribeDirectConnectGatewayAssociations
-> DescribeDirectConnectGatewayAssociations -> Bool
$c== :: DescribeDirectConnectGatewayAssociations
-> DescribeDirectConnectGatewayAssociations -> Bool
Prelude.Eq, ReadPrec [DescribeDirectConnectGatewayAssociations]
ReadPrec DescribeDirectConnectGatewayAssociations
Int -> ReadS DescribeDirectConnectGatewayAssociations
ReadS [DescribeDirectConnectGatewayAssociations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDirectConnectGatewayAssociations]
$creadListPrec :: ReadPrec [DescribeDirectConnectGatewayAssociations]
readPrec :: ReadPrec DescribeDirectConnectGatewayAssociations
$creadPrec :: ReadPrec DescribeDirectConnectGatewayAssociations
readList :: ReadS [DescribeDirectConnectGatewayAssociations]
$creadList :: ReadS [DescribeDirectConnectGatewayAssociations]
readsPrec :: Int -> ReadS DescribeDirectConnectGatewayAssociations
$creadsPrec :: Int -> ReadS DescribeDirectConnectGatewayAssociations
Prelude.Read, Int -> DescribeDirectConnectGatewayAssociations -> ShowS
[DescribeDirectConnectGatewayAssociations] -> ShowS
DescribeDirectConnectGatewayAssociations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDirectConnectGatewayAssociations] -> ShowS
$cshowList :: [DescribeDirectConnectGatewayAssociations] -> ShowS
show :: DescribeDirectConnectGatewayAssociations -> String
$cshow :: DescribeDirectConnectGatewayAssociations -> String
showsPrec :: Int -> DescribeDirectConnectGatewayAssociations -> ShowS
$cshowsPrec :: Int -> DescribeDirectConnectGatewayAssociations -> ShowS
Prelude.Show, forall x.
Rep DescribeDirectConnectGatewayAssociations x
-> DescribeDirectConnectGatewayAssociations
forall x.
DescribeDirectConnectGatewayAssociations
-> Rep DescribeDirectConnectGatewayAssociations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDirectConnectGatewayAssociations x
-> DescribeDirectConnectGatewayAssociations
$cfrom :: forall x.
DescribeDirectConnectGatewayAssociations
-> Rep DescribeDirectConnectGatewayAssociations x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDirectConnectGatewayAssociations' 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:
--
-- 'associatedGatewayId', 'describeDirectConnectGatewayAssociations_associatedGatewayId' - The ID of the associated gateway.
--
-- 'associationId', 'describeDirectConnectGatewayAssociations_associationId' - The ID of the Direct Connect gateway association.
--
-- 'directConnectGatewayId', 'describeDirectConnectGatewayAssociations_directConnectGatewayId' - The ID of the Direct Connect gateway.
--
-- 'maxResults', 'describeDirectConnectGatewayAssociations_maxResults' - The maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
--
-- If @MaxResults@ is given a value larger than 100, only 100 results are
-- returned.
--
-- 'nextToken', 'describeDirectConnectGatewayAssociations_nextToken' - The token provided in the previous call to retrieve the next page.
--
-- 'virtualGatewayId', 'describeDirectConnectGatewayAssociations_virtualGatewayId' - The ID of the virtual private gateway or transit gateway.
newDescribeDirectConnectGatewayAssociations ::
  DescribeDirectConnectGatewayAssociations
newDescribeDirectConnectGatewayAssociations :: DescribeDirectConnectGatewayAssociations
newDescribeDirectConnectGatewayAssociations =
  DescribeDirectConnectGatewayAssociations'
    { $sel:associatedGatewayId:DescribeDirectConnectGatewayAssociations' :: Maybe Text
associatedGatewayId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:associationId:DescribeDirectConnectGatewayAssociations' :: Maybe Text
associationId = forall a. Maybe a
Prelude.Nothing,
      $sel:directConnectGatewayId:DescribeDirectConnectGatewayAssociations' :: Maybe Text
directConnectGatewayId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeDirectConnectGatewayAssociations' :: Maybe Int
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeDirectConnectGatewayAssociations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:virtualGatewayId:DescribeDirectConnectGatewayAssociations' :: Maybe Text
virtualGatewayId =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the associated gateway.
describeDirectConnectGatewayAssociations_associatedGatewayId :: Lens.Lens' DescribeDirectConnectGatewayAssociations (Prelude.Maybe Prelude.Text)
describeDirectConnectGatewayAssociations_associatedGatewayId :: Lens' DescribeDirectConnectGatewayAssociations (Maybe Text)
describeDirectConnectGatewayAssociations_associatedGatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDirectConnectGatewayAssociations' {Maybe Text
associatedGatewayId :: Maybe Text
$sel:associatedGatewayId:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
associatedGatewayId} -> Maybe Text
associatedGatewayId) (\s :: DescribeDirectConnectGatewayAssociations
s@DescribeDirectConnectGatewayAssociations' {} Maybe Text
a -> DescribeDirectConnectGatewayAssociations
s {$sel:associatedGatewayId:DescribeDirectConnectGatewayAssociations' :: Maybe Text
associatedGatewayId = Maybe Text
a} :: DescribeDirectConnectGatewayAssociations)

-- | The ID of the Direct Connect gateway association.
describeDirectConnectGatewayAssociations_associationId :: Lens.Lens' DescribeDirectConnectGatewayAssociations (Prelude.Maybe Prelude.Text)
describeDirectConnectGatewayAssociations_associationId :: Lens' DescribeDirectConnectGatewayAssociations (Maybe Text)
describeDirectConnectGatewayAssociations_associationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDirectConnectGatewayAssociations' {Maybe Text
associationId :: Maybe Text
$sel:associationId:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
associationId} -> Maybe Text
associationId) (\s :: DescribeDirectConnectGatewayAssociations
s@DescribeDirectConnectGatewayAssociations' {} Maybe Text
a -> DescribeDirectConnectGatewayAssociations
s {$sel:associationId:DescribeDirectConnectGatewayAssociations' :: Maybe Text
associationId = Maybe Text
a} :: DescribeDirectConnectGatewayAssociations)

-- | The ID of the Direct Connect gateway.
describeDirectConnectGatewayAssociations_directConnectGatewayId :: Lens.Lens' DescribeDirectConnectGatewayAssociations (Prelude.Maybe Prelude.Text)
describeDirectConnectGatewayAssociations_directConnectGatewayId :: Lens' DescribeDirectConnectGatewayAssociations (Maybe Text)
describeDirectConnectGatewayAssociations_directConnectGatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDirectConnectGatewayAssociations' {Maybe Text
directConnectGatewayId :: Maybe Text
$sel:directConnectGatewayId:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
directConnectGatewayId} -> Maybe Text
directConnectGatewayId) (\s :: DescribeDirectConnectGatewayAssociations
s@DescribeDirectConnectGatewayAssociations' {} Maybe Text
a -> DescribeDirectConnectGatewayAssociations
s {$sel:directConnectGatewayId:DescribeDirectConnectGatewayAssociations' :: Maybe Text
directConnectGatewayId = Maybe Text
a} :: DescribeDirectConnectGatewayAssociations)

-- | The maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
--
-- If @MaxResults@ is given a value larger than 100, only 100 results are
-- returned.
describeDirectConnectGatewayAssociations_maxResults :: Lens.Lens' DescribeDirectConnectGatewayAssociations (Prelude.Maybe Prelude.Int)
describeDirectConnectGatewayAssociations_maxResults :: Lens' DescribeDirectConnectGatewayAssociations (Maybe Int)
describeDirectConnectGatewayAssociations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDirectConnectGatewayAssociations' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribeDirectConnectGatewayAssociations
s@DescribeDirectConnectGatewayAssociations' {} Maybe Int
a -> DescribeDirectConnectGatewayAssociations
s {$sel:maxResults:DescribeDirectConnectGatewayAssociations' :: Maybe Int
maxResults = Maybe Int
a} :: DescribeDirectConnectGatewayAssociations)

-- | The token provided in the previous call to retrieve the next page.
describeDirectConnectGatewayAssociations_nextToken :: Lens.Lens' DescribeDirectConnectGatewayAssociations (Prelude.Maybe Prelude.Text)
describeDirectConnectGatewayAssociations_nextToken :: Lens' DescribeDirectConnectGatewayAssociations (Maybe Text)
describeDirectConnectGatewayAssociations_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDirectConnectGatewayAssociations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeDirectConnectGatewayAssociations
s@DescribeDirectConnectGatewayAssociations' {} Maybe Text
a -> DescribeDirectConnectGatewayAssociations
s {$sel:nextToken:DescribeDirectConnectGatewayAssociations' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeDirectConnectGatewayAssociations)

-- | The ID of the virtual private gateway or transit gateway.
describeDirectConnectGatewayAssociations_virtualGatewayId :: Lens.Lens' DescribeDirectConnectGatewayAssociations (Prelude.Maybe Prelude.Text)
describeDirectConnectGatewayAssociations_virtualGatewayId :: Lens' DescribeDirectConnectGatewayAssociations (Maybe Text)
describeDirectConnectGatewayAssociations_virtualGatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDirectConnectGatewayAssociations' {Maybe Text
virtualGatewayId :: Maybe Text
$sel:virtualGatewayId:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
virtualGatewayId} -> Maybe Text
virtualGatewayId) (\s :: DescribeDirectConnectGatewayAssociations
s@DescribeDirectConnectGatewayAssociations' {} Maybe Text
a -> DescribeDirectConnectGatewayAssociations
s {$sel:virtualGatewayId:DescribeDirectConnectGatewayAssociations' :: Maybe Text
virtualGatewayId = Maybe Text
a} :: DescribeDirectConnectGatewayAssociations)

instance
  Core.AWSPager
    DescribeDirectConnectGatewayAssociations
  where
  page :: DescribeDirectConnectGatewayAssociations
-> AWSResponse DescribeDirectConnectGatewayAssociations
-> Maybe DescribeDirectConnectGatewayAssociations
page DescribeDirectConnectGatewayAssociations
rq AWSResponse DescribeDirectConnectGatewayAssociations
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeDirectConnectGatewayAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeDirectConnectGatewayAssociationsResponse (Maybe Text)
describeDirectConnectGatewayAssociationsResponse_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 DescribeDirectConnectGatewayAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeDirectConnectGatewayAssociationsResponse
  (Maybe [DirectConnectGatewayAssociation])
describeDirectConnectGatewayAssociationsResponse_directConnectGatewayAssociations
            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.$ DescribeDirectConnectGatewayAssociations
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeDirectConnectGatewayAssociations (Maybe Text)
describeDirectConnectGatewayAssociations_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeDirectConnectGatewayAssociations
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeDirectConnectGatewayAssociationsResponse (Maybe Text)
describeDirectConnectGatewayAssociationsResponse_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
    DescribeDirectConnectGatewayAssociations
  where
  type
    AWSResponse
      DescribeDirectConnectGatewayAssociations =
      DescribeDirectConnectGatewayAssociationsResponse
  request :: (Service -> Service)
-> DescribeDirectConnectGatewayAssociations
-> Request DescribeDirectConnectGatewayAssociations
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeDirectConnectGatewayAssociations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DescribeDirectConnectGatewayAssociations)))
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 [DirectConnectGatewayAssociation]
-> Maybe Text
-> Int
-> DescribeDirectConnectGatewayAssociationsResponse
DescribeDirectConnectGatewayAssociationsResponse'
            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
"directConnectGatewayAssociations"
                            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
    DescribeDirectConnectGatewayAssociations
  where
  hashWithSalt :: Int -> DescribeDirectConnectGatewayAssociations -> Int
hashWithSalt
    Int
_salt
    DescribeDirectConnectGatewayAssociations' {Maybe Int
Maybe Text
virtualGatewayId :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
directConnectGatewayId :: Maybe Text
associationId :: Maybe Text
associatedGatewayId :: Maybe Text
$sel:virtualGatewayId:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
$sel:nextToken:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
$sel:maxResults:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Int
$sel:directConnectGatewayId:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
$sel:associationId:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
$sel:associatedGatewayId:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
associatedGatewayId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
associationId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
directConnectGatewayId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxResults
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
virtualGatewayId

instance
  Prelude.NFData
    DescribeDirectConnectGatewayAssociations
  where
  rnf :: DescribeDirectConnectGatewayAssociations -> ()
rnf DescribeDirectConnectGatewayAssociations' {Maybe Int
Maybe Text
virtualGatewayId :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
directConnectGatewayId :: Maybe Text
associationId :: Maybe Text
associatedGatewayId :: Maybe Text
$sel:virtualGatewayId:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
$sel:nextToken:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
$sel:maxResults:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Int
$sel:directConnectGatewayId:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
$sel:associationId:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
$sel:associatedGatewayId:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
associatedGatewayId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
associationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
directConnectGatewayId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
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
virtualGatewayId

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

instance
  Data.ToJSON
    DescribeDirectConnectGatewayAssociations
  where
  toJSON :: DescribeDirectConnectGatewayAssociations -> Value
toJSON DescribeDirectConnectGatewayAssociations' {Maybe Int
Maybe Text
virtualGatewayId :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
directConnectGatewayId :: Maybe Text
associationId :: Maybe Text
associatedGatewayId :: Maybe Text
$sel:virtualGatewayId:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
$sel:nextToken:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
$sel:maxResults:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Int
$sel:directConnectGatewayId:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
$sel:associationId:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
$sel:associatedGatewayId:DescribeDirectConnectGatewayAssociations' :: DescribeDirectConnectGatewayAssociations -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"associatedGatewayId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
associatedGatewayId,
            (Key
"associationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
associationId,
            (Key
"directConnectGatewayId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
directConnectGatewayId,
            (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults,
            (Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Key
"virtualGatewayId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
virtualGatewayId
          ]
      )

instance
  Data.ToPath
    DescribeDirectConnectGatewayAssociations
  where
  toPath :: DescribeDirectConnectGatewayAssociations -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'DescribeDirectConnectGatewayAssociationsResponse' 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:
--
-- 'directConnectGatewayAssociations', 'describeDirectConnectGatewayAssociationsResponse_directConnectGatewayAssociations' - Information about the associations.
--
-- 'nextToken', 'describeDirectConnectGatewayAssociationsResponse_nextToken' - The token to retrieve the next page.
--
-- 'httpStatus', 'describeDirectConnectGatewayAssociationsResponse_httpStatus' - The response's http status code.
newDescribeDirectConnectGatewayAssociationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeDirectConnectGatewayAssociationsResponse
newDescribeDirectConnectGatewayAssociationsResponse :: Int -> DescribeDirectConnectGatewayAssociationsResponse
newDescribeDirectConnectGatewayAssociationsResponse
  Int
pHttpStatus_ =
    DescribeDirectConnectGatewayAssociationsResponse'
      { $sel:directConnectGatewayAssociations:DescribeDirectConnectGatewayAssociationsResponse' :: Maybe [DirectConnectGatewayAssociation]
directConnectGatewayAssociations =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeDirectConnectGatewayAssociationsResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeDirectConnectGatewayAssociationsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Information about the associations.
describeDirectConnectGatewayAssociationsResponse_directConnectGatewayAssociations :: Lens.Lens' DescribeDirectConnectGatewayAssociationsResponse (Prelude.Maybe [DirectConnectGatewayAssociation])
describeDirectConnectGatewayAssociationsResponse_directConnectGatewayAssociations :: Lens'
  DescribeDirectConnectGatewayAssociationsResponse
  (Maybe [DirectConnectGatewayAssociation])
describeDirectConnectGatewayAssociationsResponse_directConnectGatewayAssociations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDirectConnectGatewayAssociationsResponse' {Maybe [DirectConnectGatewayAssociation]
directConnectGatewayAssociations :: Maybe [DirectConnectGatewayAssociation]
$sel:directConnectGatewayAssociations:DescribeDirectConnectGatewayAssociationsResponse' :: DescribeDirectConnectGatewayAssociationsResponse
-> Maybe [DirectConnectGatewayAssociation]
directConnectGatewayAssociations} -> Maybe [DirectConnectGatewayAssociation]
directConnectGatewayAssociations) (\s :: DescribeDirectConnectGatewayAssociationsResponse
s@DescribeDirectConnectGatewayAssociationsResponse' {} Maybe [DirectConnectGatewayAssociation]
a -> DescribeDirectConnectGatewayAssociationsResponse
s {$sel:directConnectGatewayAssociations:DescribeDirectConnectGatewayAssociationsResponse' :: Maybe [DirectConnectGatewayAssociation]
directConnectGatewayAssociations = Maybe [DirectConnectGatewayAssociation]
a} :: DescribeDirectConnectGatewayAssociationsResponse) 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 to retrieve the next page.
describeDirectConnectGatewayAssociationsResponse_nextToken :: Lens.Lens' DescribeDirectConnectGatewayAssociationsResponse (Prelude.Maybe Prelude.Text)
describeDirectConnectGatewayAssociationsResponse_nextToken :: Lens' DescribeDirectConnectGatewayAssociationsResponse (Maybe Text)
describeDirectConnectGatewayAssociationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDirectConnectGatewayAssociationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeDirectConnectGatewayAssociationsResponse' :: DescribeDirectConnectGatewayAssociationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeDirectConnectGatewayAssociationsResponse
s@DescribeDirectConnectGatewayAssociationsResponse' {} Maybe Text
a -> DescribeDirectConnectGatewayAssociationsResponse
s {$sel:nextToken:DescribeDirectConnectGatewayAssociationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeDirectConnectGatewayAssociationsResponse)

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

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