{-# 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.EC2.GetTransitGatewayMulticastDomainAssociations
-- 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 associations for the transit gateway
-- multicast domain.
--
-- This operation returns paginated results.
module Amazonka.EC2.GetTransitGatewayMulticastDomainAssociations
  ( -- * Creating a Request
    GetTransitGatewayMulticastDomainAssociations (..),
    newGetTransitGatewayMulticastDomainAssociations,

    -- * Request Lenses
    getTransitGatewayMulticastDomainAssociations_dryRun,
    getTransitGatewayMulticastDomainAssociations_filters,
    getTransitGatewayMulticastDomainAssociations_maxResults,
    getTransitGatewayMulticastDomainAssociations_nextToken,
    getTransitGatewayMulticastDomainAssociations_transitGatewayMulticastDomainId,

    -- * Destructuring the Response
    GetTransitGatewayMulticastDomainAssociationsResponse (..),
    newGetTransitGatewayMulticastDomainAssociationsResponse,

    -- * Response Lenses
    getTransitGatewayMulticastDomainAssociationsResponse_multicastDomainAssociations,
    getTransitGatewayMulticastDomainAssociationsResponse_nextToken,
    getTransitGatewayMulticastDomainAssociationsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetTransitGatewayMulticastDomainAssociations' smart constructor.
data GetTransitGatewayMulticastDomainAssociations = GetTransitGatewayMulticastDomainAssociations'
  { -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    GetTransitGatewayMulticastDomainAssociations -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters. The possible values are:
    --
    -- -   @resource-id@ - The ID of the resource.
    --
    -- -   @resource-type@ - The type of resource. The valid value is: @vpc@.
    --
    -- -   @state@ - The state of the subnet association. Valid values are
    --     @associated@ | @associating@ | @disassociated@ | @disassociating@.
    --
    -- -   @subnet-id@ - The ID of the subnet.
    --
    -- -   @transit-gateway-attachment-id@ - The id of the transit gateway
    --     attachment.
    GetTransitGatewayMulticastDomainAssociations -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The maximum number of results to return with a single call. To retrieve
    -- the remaining results, make another call with the returned @nextToken@
    -- value.
    GetTransitGatewayMulticastDomainAssociations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    GetTransitGatewayMulticastDomainAssociations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the transit gateway multicast domain.
    GetTransitGatewayMulticastDomainAssociations -> Maybe Text
transitGatewayMulticastDomainId :: Prelude.Maybe Prelude.Text
  }
  deriving (GetTransitGatewayMulticastDomainAssociations
-> GetTransitGatewayMulticastDomainAssociations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTransitGatewayMulticastDomainAssociations
-> GetTransitGatewayMulticastDomainAssociations -> Bool
$c/= :: GetTransitGatewayMulticastDomainAssociations
-> GetTransitGatewayMulticastDomainAssociations -> Bool
== :: GetTransitGatewayMulticastDomainAssociations
-> GetTransitGatewayMulticastDomainAssociations -> Bool
$c== :: GetTransitGatewayMulticastDomainAssociations
-> GetTransitGatewayMulticastDomainAssociations -> Bool
Prelude.Eq, ReadPrec [GetTransitGatewayMulticastDomainAssociations]
ReadPrec GetTransitGatewayMulticastDomainAssociations
Int -> ReadS GetTransitGatewayMulticastDomainAssociations
ReadS [GetTransitGatewayMulticastDomainAssociations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTransitGatewayMulticastDomainAssociations]
$creadListPrec :: ReadPrec [GetTransitGatewayMulticastDomainAssociations]
readPrec :: ReadPrec GetTransitGatewayMulticastDomainAssociations
$creadPrec :: ReadPrec GetTransitGatewayMulticastDomainAssociations
readList :: ReadS [GetTransitGatewayMulticastDomainAssociations]
$creadList :: ReadS [GetTransitGatewayMulticastDomainAssociations]
readsPrec :: Int -> ReadS GetTransitGatewayMulticastDomainAssociations
$creadsPrec :: Int -> ReadS GetTransitGatewayMulticastDomainAssociations
Prelude.Read, Int -> GetTransitGatewayMulticastDomainAssociations -> ShowS
[GetTransitGatewayMulticastDomainAssociations] -> ShowS
GetTransitGatewayMulticastDomainAssociations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTransitGatewayMulticastDomainAssociations] -> ShowS
$cshowList :: [GetTransitGatewayMulticastDomainAssociations] -> ShowS
show :: GetTransitGatewayMulticastDomainAssociations -> String
$cshow :: GetTransitGatewayMulticastDomainAssociations -> String
showsPrec :: Int -> GetTransitGatewayMulticastDomainAssociations -> ShowS
$cshowsPrec :: Int -> GetTransitGatewayMulticastDomainAssociations -> ShowS
Prelude.Show, forall x.
Rep GetTransitGatewayMulticastDomainAssociations x
-> GetTransitGatewayMulticastDomainAssociations
forall x.
GetTransitGatewayMulticastDomainAssociations
-> Rep GetTransitGatewayMulticastDomainAssociations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetTransitGatewayMulticastDomainAssociations x
-> GetTransitGatewayMulticastDomainAssociations
$cfrom :: forall x.
GetTransitGatewayMulticastDomainAssociations
-> Rep GetTransitGatewayMulticastDomainAssociations x
Prelude.Generic)

-- |
-- Create a value of 'GetTransitGatewayMulticastDomainAssociations' 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:
--
-- 'dryRun', 'getTransitGatewayMulticastDomainAssociations_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'filters', 'getTransitGatewayMulticastDomainAssociations_filters' - One or more filters. The possible values are:
--
-- -   @resource-id@ - The ID of the resource.
--
-- -   @resource-type@ - The type of resource. The valid value is: @vpc@.
--
-- -   @state@ - The state of the subnet association. Valid values are
--     @associated@ | @associating@ | @disassociated@ | @disassociating@.
--
-- -   @subnet-id@ - The ID of the subnet.
--
-- -   @transit-gateway-attachment-id@ - The id of the transit gateway
--     attachment.
--
-- 'maxResults', 'getTransitGatewayMulticastDomainAssociations_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.
--
-- 'nextToken', 'getTransitGatewayMulticastDomainAssociations_nextToken' - The token for the next page of results.
--
-- 'transitGatewayMulticastDomainId', 'getTransitGatewayMulticastDomainAssociations_transitGatewayMulticastDomainId' - The ID of the transit gateway multicast domain.
newGetTransitGatewayMulticastDomainAssociations ::
  GetTransitGatewayMulticastDomainAssociations
newGetTransitGatewayMulticastDomainAssociations :: GetTransitGatewayMulticastDomainAssociations
newGetTransitGatewayMulticastDomainAssociations =
  GetTransitGatewayMulticastDomainAssociations'
    { $sel:dryRun:GetTransitGatewayMulticastDomainAssociations' :: Maybe Bool
dryRun =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filters:GetTransitGatewayMulticastDomainAssociations' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetTransitGatewayMulticastDomainAssociations' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetTransitGatewayMulticastDomainAssociations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:transitGatewayMulticastDomainId:GetTransitGatewayMulticastDomainAssociations' :: Maybe Text
transitGatewayMulticastDomainId =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
getTransitGatewayMulticastDomainAssociations_dryRun :: Lens.Lens' GetTransitGatewayMulticastDomainAssociations (Prelude.Maybe Prelude.Bool)
getTransitGatewayMulticastDomainAssociations_dryRun :: Lens' GetTransitGatewayMulticastDomainAssociations (Maybe Bool)
getTransitGatewayMulticastDomainAssociations_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayMulticastDomainAssociations' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: GetTransitGatewayMulticastDomainAssociations
s@GetTransitGatewayMulticastDomainAssociations' {} Maybe Bool
a -> GetTransitGatewayMulticastDomainAssociations
s {$sel:dryRun:GetTransitGatewayMulticastDomainAssociations' :: Maybe Bool
dryRun = Maybe Bool
a} :: GetTransitGatewayMulticastDomainAssociations)

-- | One or more filters. The possible values are:
--
-- -   @resource-id@ - The ID of the resource.
--
-- -   @resource-type@ - The type of resource. The valid value is: @vpc@.
--
-- -   @state@ - The state of the subnet association. Valid values are
--     @associated@ | @associating@ | @disassociated@ | @disassociating@.
--
-- -   @subnet-id@ - The ID of the subnet.
--
-- -   @transit-gateway-attachment-id@ - The id of the transit gateway
--     attachment.
getTransitGatewayMulticastDomainAssociations_filters :: Lens.Lens' GetTransitGatewayMulticastDomainAssociations (Prelude.Maybe [Filter])
getTransitGatewayMulticastDomainAssociations_filters :: Lens' GetTransitGatewayMulticastDomainAssociations (Maybe [Filter])
getTransitGatewayMulticastDomainAssociations_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayMulticastDomainAssociations' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: GetTransitGatewayMulticastDomainAssociations
s@GetTransitGatewayMulticastDomainAssociations' {} Maybe [Filter]
a -> GetTransitGatewayMulticastDomainAssociations
s {$sel:filters:GetTransitGatewayMulticastDomainAssociations' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: GetTransitGatewayMulticastDomainAssociations) 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 with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
getTransitGatewayMulticastDomainAssociations_maxResults :: Lens.Lens' GetTransitGatewayMulticastDomainAssociations (Prelude.Maybe Prelude.Natural)
getTransitGatewayMulticastDomainAssociations_maxResults :: Lens' GetTransitGatewayMulticastDomainAssociations (Maybe Natural)
getTransitGatewayMulticastDomainAssociations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayMulticastDomainAssociations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetTransitGatewayMulticastDomainAssociations
s@GetTransitGatewayMulticastDomainAssociations' {} Maybe Natural
a -> GetTransitGatewayMulticastDomainAssociations
s {$sel:maxResults:GetTransitGatewayMulticastDomainAssociations' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetTransitGatewayMulticastDomainAssociations)

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

-- | The ID of the transit gateway multicast domain.
getTransitGatewayMulticastDomainAssociations_transitGatewayMulticastDomainId :: Lens.Lens' GetTransitGatewayMulticastDomainAssociations (Prelude.Maybe Prelude.Text)
getTransitGatewayMulticastDomainAssociations_transitGatewayMulticastDomainId :: Lens' GetTransitGatewayMulticastDomainAssociations (Maybe Text)
getTransitGatewayMulticastDomainAssociations_transitGatewayMulticastDomainId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayMulticastDomainAssociations' {Maybe Text
transitGatewayMulticastDomainId :: Maybe Text
$sel:transitGatewayMulticastDomainId:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe Text
transitGatewayMulticastDomainId} -> Maybe Text
transitGatewayMulticastDomainId) (\s :: GetTransitGatewayMulticastDomainAssociations
s@GetTransitGatewayMulticastDomainAssociations' {} Maybe Text
a -> GetTransitGatewayMulticastDomainAssociations
s {$sel:transitGatewayMulticastDomainId:GetTransitGatewayMulticastDomainAssociations' :: Maybe Text
transitGatewayMulticastDomainId = Maybe Text
a} :: GetTransitGatewayMulticastDomainAssociations)

instance
  Core.AWSPager
    GetTransitGatewayMulticastDomainAssociations
  where
  page :: GetTransitGatewayMulticastDomainAssociations
-> AWSResponse GetTransitGatewayMulticastDomainAssociations
-> Maybe GetTransitGatewayMulticastDomainAssociations
page GetTransitGatewayMulticastDomainAssociations
rq AWSResponse GetTransitGatewayMulticastDomainAssociations
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetTransitGatewayMulticastDomainAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  GetTransitGatewayMulticastDomainAssociationsResponse (Maybe Text)
getTransitGatewayMulticastDomainAssociationsResponse_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 GetTransitGatewayMulticastDomainAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  GetTransitGatewayMulticastDomainAssociationsResponse
  (Maybe [TransitGatewayMulticastDomainAssociation])
getTransitGatewayMulticastDomainAssociationsResponse_multicastDomainAssociations
            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.$ GetTransitGatewayMulticastDomainAssociations
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' GetTransitGatewayMulticastDomainAssociations (Maybe Text)
getTransitGatewayMulticastDomainAssociations_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetTransitGatewayMulticastDomainAssociations
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  GetTransitGatewayMulticastDomainAssociationsResponse (Maybe Text)
getTransitGatewayMulticastDomainAssociationsResponse_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
    GetTransitGatewayMulticastDomainAssociations
  where
  type
    AWSResponse
      GetTransitGatewayMulticastDomainAssociations =
      GetTransitGatewayMulticastDomainAssociationsResponse
  request :: (Service -> Service)
-> GetTransitGatewayMulticastDomainAssociations
-> Request GetTransitGatewayMulticastDomainAssociations
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetTransitGatewayMulticastDomainAssociations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse GetTransitGatewayMulticastDomainAssociations)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [TransitGatewayMulticastDomainAssociation]
-> Maybe Text
-> Int
-> GetTransitGatewayMulticastDomainAssociationsResponse
GetTransitGatewayMulticastDomainAssociationsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"multicastDomainAssociations"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"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
    GetTransitGatewayMulticastDomainAssociations
  where
  hashWithSalt :: Int -> GetTransitGatewayMulticastDomainAssociations -> Int
hashWithSalt
    Int
_salt
    GetTransitGatewayMulticastDomainAssociations' {Maybe Bool
Maybe Natural
Maybe [Filter]
Maybe Text
transitGatewayMulticastDomainId :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:transitGatewayMulticastDomainId:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe Text
$sel:nextToken:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe Text
$sel:maxResults:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe Natural
$sel:filters:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe [Filter]
$sel:dryRun:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe Bool
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
        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
transitGatewayMulticastDomainId

instance
  Prelude.NFData
    GetTransitGatewayMulticastDomainAssociations
  where
  rnf :: GetTransitGatewayMulticastDomainAssociations -> ()
rnf GetTransitGatewayMulticastDomainAssociations' {Maybe Bool
Maybe Natural
Maybe [Filter]
Maybe Text
transitGatewayMulticastDomainId :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:transitGatewayMulticastDomainId:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe Text
$sel:nextToken:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe Text
$sel:maxResults:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe Natural
$sel:filters:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe [Filter]
$sel:dryRun:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      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 Maybe Text
transitGatewayMulticastDomainId

instance
  Data.ToHeaders
    GetTransitGatewayMulticastDomainAssociations
  where
  toHeaders :: GetTransitGatewayMulticastDomainAssociations -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

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

instance
  Data.ToQuery
    GetTransitGatewayMulticastDomainAssociations
  where
  toQuery :: GetTransitGatewayMulticastDomainAssociations -> QueryString
toQuery
    GetTransitGatewayMulticastDomainAssociations' {Maybe Bool
Maybe Natural
Maybe [Filter]
Maybe Text
transitGatewayMulticastDomainId :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:transitGatewayMulticastDomainId:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe Text
$sel:nextToken:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe Text
$sel:maxResults:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe Natural
$sel:filters:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe [Filter]
$sel:dryRun:GetTransitGatewayMulticastDomainAssociations' :: GetTransitGatewayMulticastDomainAssociations -> Maybe Bool
..} =
      forall a. Monoid a => [a] -> a
Prelude.mconcat
        [ ByteString
"Action"
            forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"GetTransitGatewayMulticastDomainAssociations" ::
                        Prelude.ByteString
                    ),
          ByteString
"Version"
            forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
          ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
          forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Filter" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
          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
"TransitGatewayMulticastDomainId"
            forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
transitGatewayMulticastDomainId
        ]

-- | /See:/ 'newGetTransitGatewayMulticastDomainAssociationsResponse' smart constructor.
data GetTransitGatewayMulticastDomainAssociationsResponse = GetTransitGatewayMulticastDomainAssociationsResponse'
  { -- | Information about the multicast domain associations.
    GetTransitGatewayMulticastDomainAssociationsResponse
-> Maybe [TransitGatewayMulticastDomainAssociation]
multicastDomainAssociations :: Prelude.Maybe [TransitGatewayMulticastDomainAssociation],
    -- | The token to use to retrieve the next page of results. This value is
    -- @null@ when there are no more results to return.
    GetTransitGatewayMulticastDomainAssociationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetTransitGatewayMulticastDomainAssociationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetTransitGatewayMulticastDomainAssociationsResponse
-> GetTransitGatewayMulticastDomainAssociationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTransitGatewayMulticastDomainAssociationsResponse
-> GetTransitGatewayMulticastDomainAssociationsResponse -> Bool
$c/= :: GetTransitGatewayMulticastDomainAssociationsResponse
-> GetTransitGatewayMulticastDomainAssociationsResponse -> Bool
== :: GetTransitGatewayMulticastDomainAssociationsResponse
-> GetTransitGatewayMulticastDomainAssociationsResponse -> Bool
$c== :: GetTransitGatewayMulticastDomainAssociationsResponse
-> GetTransitGatewayMulticastDomainAssociationsResponse -> Bool
Prelude.Eq, ReadPrec [GetTransitGatewayMulticastDomainAssociationsResponse]
ReadPrec GetTransitGatewayMulticastDomainAssociationsResponse
Int -> ReadS GetTransitGatewayMulticastDomainAssociationsResponse
ReadS [GetTransitGatewayMulticastDomainAssociationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTransitGatewayMulticastDomainAssociationsResponse]
$creadListPrec :: ReadPrec [GetTransitGatewayMulticastDomainAssociationsResponse]
readPrec :: ReadPrec GetTransitGatewayMulticastDomainAssociationsResponse
$creadPrec :: ReadPrec GetTransitGatewayMulticastDomainAssociationsResponse
readList :: ReadS [GetTransitGatewayMulticastDomainAssociationsResponse]
$creadList :: ReadS [GetTransitGatewayMulticastDomainAssociationsResponse]
readsPrec :: Int -> ReadS GetTransitGatewayMulticastDomainAssociationsResponse
$creadsPrec :: Int -> ReadS GetTransitGatewayMulticastDomainAssociationsResponse
Prelude.Read, Int
-> GetTransitGatewayMulticastDomainAssociationsResponse -> ShowS
[GetTransitGatewayMulticastDomainAssociationsResponse] -> ShowS
GetTransitGatewayMulticastDomainAssociationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTransitGatewayMulticastDomainAssociationsResponse] -> ShowS
$cshowList :: [GetTransitGatewayMulticastDomainAssociationsResponse] -> ShowS
show :: GetTransitGatewayMulticastDomainAssociationsResponse -> String
$cshow :: GetTransitGatewayMulticastDomainAssociationsResponse -> String
showsPrec :: Int
-> GetTransitGatewayMulticastDomainAssociationsResponse -> ShowS
$cshowsPrec :: Int
-> GetTransitGatewayMulticastDomainAssociationsResponse -> ShowS
Prelude.Show, forall x.
Rep GetTransitGatewayMulticastDomainAssociationsResponse x
-> GetTransitGatewayMulticastDomainAssociationsResponse
forall x.
GetTransitGatewayMulticastDomainAssociationsResponse
-> Rep GetTransitGatewayMulticastDomainAssociationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetTransitGatewayMulticastDomainAssociationsResponse x
-> GetTransitGatewayMulticastDomainAssociationsResponse
$cfrom :: forall x.
GetTransitGatewayMulticastDomainAssociationsResponse
-> Rep GetTransitGatewayMulticastDomainAssociationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetTransitGatewayMulticastDomainAssociationsResponse' 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:
--
-- 'multicastDomainAssociations', 'getTransitGatewayMulticastDomainAssociationsResponse_multicastDomainAssociations' - Information about the multicast domain associations.
--
-- 'nextToken', 'getTransitGatewayMulticastDomainAssociationsResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'httpStatus', 'getTransitGatewayMulticastDomainAssociationsResponse_httpStatus' - The response's http status code.
newGetTransitGatewayMulticastDomainAssociationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetTransitGatewayMulticastDomainAssociationsResponse
newGetTransitGatewayMulticastDomainAssociationsResponse :: Int -> GetTransitGatewayMulticastDomainAssociationsResponse
newGetTransitGatewayMulticastDomainAssociationsResponse
  Int
pHttpStatus_ =
    GetTransitGatewayMulticastDomainAssociationsResponse'
      { $sel:multicastDomainAssociations:GetTransitGatewayMulticastDomainAssociationsResponse' :: Maybe [TransitGatewayMulticastDomainAssociation]
multicastDomainAssociations =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetTransitGatewayMulticastDomainAssociationsResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetTransitGatewayMulticastDomainAssociationsResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | Information about the multicast domain associations.
getTransitGatewayMulticastDomainAssociationsResponse_multicastDomainAssociations :: Lens.Lens' GetTransitGatewayMulticastDomainAssociationsResponse (Prelude.Maybe [TransitGatewayMulticastDomainAssociation])
getTransitGatewayMulticastDomainAssociationsResponse_multicastDomainAssociations :: Lens'
  GetTransitGatewayMulticastDomainAssociationsResponse
  (Maybe [TransitGatewayMulticastDomainAssociation])
getTransitGatewayMulticastDomainAssociationsResponse_multicastDomainAssociations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayMulticastDomainAssociationsResponse' {Maybe [TransitGatewayMulticastDomainAssociation]
multicastDomainAssociations :: Maybe [TransitGatewayMulticastDomainAssociation]
$sel:multicastDomainAssociations:GetTransitGatewayMulticastDomainAssociationsResponse' :: GetTransitGatewayMulticastDomainAssociationsResponse
-> Maybe [TransitGatewayMulticastDomainAssociation]
multicastDomainAssociations} -> Maybe [TransitGatewayMulticastDomainAssociation]
multicastDomainAssociations) (\s :: GetTransitGatewayMulticastDomainAssociationsResponse
s@GetTransitGatewayMulticastDomainAssociationsResponse' {} Maybe [TransitGatewayMulticastDomainAssociation]
a -> GetTransitGatewayMulticastDomainAssociationsResponse
s {$sel:multicastDomainAssociations:GetTransitGatewayMulticastDomainAssociationsResponse' :: Maybe [TransitGatewayMulticastDomainAssociation]
multicastDomainAssociations = Maybe [TransitGatewayMulticastDomainAssociation]
a} :: GetTransitGatewayMulticastDomainAssociationsResponse) 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 use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
getTransitGatewayMulticastDomainAssociationsResponse_nextToken :: Lens.Lens' GetTransitGatewayMulticastDomainAssociationsResponse (Prelude.Maybe Prelude.Text)
getTransitGatewayMulticastDomainAssociationsResponse_nextToken :: Lens'
  GetTransitGatewayMulticastDomainAssociationsResponse (Maybe Text)
getTransitGatewayMulticastDomainAssociationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTransitGatewayMulticastDomainAssociationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetTransitGatewayMulticastDomainAssociationsResponse' :: GetTransitGatewayMulticastDomainAssociationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetTransitGatewayMulticastDomainAssociationsResponse
s@GetTransitGatewayMulticastDomainAssociationsResponse' {} Maybe Text
a -> GetTransitGatewayMulticastDomainAssociationsResponse
s {$sel:nextToken:GetTransitGatewayMulticastDomainAssociationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetTransitGatewayMulticastDomainAssociationsResponse)

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

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