{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.TransitGatewayMulticastRegisteredGroupSources
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EC2.Types.TransitGatewayMulticastRegisteredGroupSources where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import qualified Amazonka.Prelude as Prelude

-- | Describes the members registered with the transit gateway multicast
-- group.
--
-- /See:/ 'newTransitGatewayMulticastRegisteredGroupSources' smart constructor.
data TransitGatewayMulticastRegisteredGroupSources = TransitGatewayMulticastRegisteredGroupSources'
  { -- | The IP address assigned to the transit gateway multicast group.
    TransitGatewayMulticastRegisteredGroupSources -> Maybe Text
groupIpAddress :: Prelude.Maybe Prelude.Text,
    -- | The IDs of the network interfaces members registered with the transit
    -- gateway multicast group.
    TransitGatewayMulticastRegisteredGroupSources -> Maybe [Text]
registeredNetworkInterfaceIds :: Prelude.Maybe [Prelude.Text],
    -- | The ID of the transit gateway multicast domain.
    TransitGatewayMulticastRegisteredGroupSources -> Maybe Text
transitGatewayMulticastDomainId :: Prelude.Maybe Prelude.Text
  }
  deriving (TransitGatewayMulticastRegisteredGroupSources
-> TransitGatewayMulticastRegisteredGroupSources -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TransitGatewayMulticastRegisteredGroupSources
-> TransitGatewayMulticastRegisteredGroupSources -> Bool
$c/= :: TransitGatewayMulticastRegisteredGroupSources
-> TransitGatewayMulticastRegisteredGroupSources -> Bool
== :: TransitGatewayMulticastRegisteredGroupSources
-> TransitGatewayMulticastRegisteredGroupSources -> Bool
$c== :: TransitGatewayMulticastRegisteredGroupSources
-> TransitGatewayMulticastRegisteredGroupSources -> Bool
Prelude.Eq, ReadPrec [TransitGatewayMulticastRegisteredGroupSources]
ReadPrec TransitGatewayMulticastRegisteredGroupSources
Int -> ReadS TransitGatewayMulticastRegisteredGroupSources
ReadS [TransitGatewayMulticastRegisteredGroupSources]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TransitGatewayMulticastRegisteredGroupSources]
$creadListPrec :: ReadPrec [TransitGatewayMulticastRegisteredGroupSources]
readPrec :: ReadPrec TransitGatewayMulticastRegisteredGroupSources
$creadPrec :: ReadPrec TransitGatewayMulticastRegisteredGroupSources
readList :: ReadS [TransitGatewayMulticastRegisteredGroupSources]
$creadList :: ReadS [TransitGatewayMulticastRegisteredGroupSources]
readsPrec :: Int -> ReadS TransitGatewayMulticastRegisteredGroupSources
$creadsPrec :: Int -> ReadS TransitGatewayMulticastRegisteredGroupSources
Prelude.Read, Int -> TransitGatewayMulticastRegisteredGroupSources -> ShowS
[TransitGatewayMulticastRegisteredGroupSources] -> ShowS
TransitGatewayMulticastRegisteredGroupSources -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TransitGatewayMulticastRegisteredGroupSources] -> ShowS
$cshowList :: [TransitGatewayMulticastRegisteredGroupSources] -> ShowS
show :: TransitGatewayMulticastRegisteredGroupSources -> String
$cshow :: TransitGatewayMulticastRegisteredGroupSources -> String
showsPrec :: Int -> TransitGatewayMulticastRegisteredGroupSources -> ShowS
$cshowsPrec :: Int -> TransitGatewayMulticastRegisteredGroupSources -> ShowS
Prelude.Show, forall x.
Rep TransitGatewayMulticastRegisteredGroupSources x
-> TransitGatewayMulticastRegisteredGroupSources
forall x.
TransitGatewayMulticastRegisteredGroupSources
-> Rep TransitGatewayMulticastRegisteredGroupSources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TransitGatewayMulticastRegisteredGroupSources x
-> TransitGatewayMulticastRegisteredGroupSources
$cfrom :: forall x.
TransitGatewayMulticastRegisteredGroupSources
-> Rep TransitGatewayMulticastRegisteredGroupSources x
Prelude.Generic)

-- |
-- Create a value of 'TransitGatewayMulticastRegisteredGroupSources' 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:
--
-- 'groupIpAddress', 'transitGatewayMulticastRegisteredGroupSources_groupIpAddress' - The IP address assigned to the transit gateway multicast group.
--
-- 'registeredNetworkInterfaceIds', 'transitGatewayMulticastRegisteredGroupSources_registeredNetworkInterfaceIds' - The IDs of the network interfaces members registered with the transit
-- gateway multicast group.
--
-- 'transitGatewayMulticastDomainId', 'transitGatewayMulticastRegisteredGroupSources_transitGatewayMulticastDomainId' - The ID of the transit gateway multicast domain.
newTransitGatewayMulticastRegisteredGroupSources ::
  TransitGatewayMulticastRegisteredGroupSources
newTransitGatewayMulticastRegisteredGroupSources :: TransitGatewayMulticastRegisteredGroupSources
newTransitGatewayMulticastRegisteredGroupSources =
  TransitGatewayMulticastRegisteredGroupSources'
    { $sel:groupIpAddress:TransitGatewayMulticastRegisteredGroupSources' :: Maybe Text
groupIpAddress =
        forall a. Maybe a
Prelude.Nothing,
      $sel:registeredNetworkInterfaceIds:TransitGatewayMulticastRegisteredGroupSources' :: Maybe [Text]
registeredNetworkInterfaceIds =
        forall a. Maybe a
Prelude.Nothing,
      $sel:transitGatewayMulticastDomainId:TransitGatewayMulticastRegisteredGroupSources' :: Maybe Text
transitGatewayMulticastDomainId =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The IP address assigned to the transit gateway multicast group.
transitGatewayMulticastRegisteredGroupSources_groupIpAddress :: Lens.Lens' TransitGatewayMulticastRegisteredGroupSources (Prelude.Maybe Prelude.Text)
transitGatewayMulticastRegisteredGroupSources_groupIpAddress :: Lens' TransitGatewayMulticastRegisteredGroupSources (Maybe Text)
transitGatewayMulticastRegisteredGroupSources_groupIpAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransitGatewayMulticastRegisteredGroupSources' {Maybe Text
groupIpAddress :: Maybe Text
$sel:groupIpAddress:TransitGatewayMulticastRegisteredGroupSources' :: TransitGatewayMulticastRegisteredGroupSources -> Maybe Text
groupIpAddress} -> Maybe Text
groupIpAddress) (\s :: TransitGatewayMulticastRegisteredGroupSources
s@TransitGatewayMulticastRegisteredGroupSources' {} Maybe Text
a -> TransitGatewayMulticastRegisteredGroupSources
s {$sel:groupIpAddress:TransitGatewayMulticastRegisteredGroupSources' :: Maybe Text
groupIpAddress = Maybe Text
a} :: TransitGatewayMulticastRegisteredGroupSources)

-- | The IDs of the network interfaces members registered with the transit
-- gateway multicast group.
transitGatewayMulticastRegisteredGroupSources_registeredNetworkInterfaceIds :: Lens.Lens' TransitGatewayMulticastRegisteredGroupSources (Prelude.Maybe [Prelude.Text])
transitGatewayMulticastRegisteredGroupSources_registeredNetworkInterfaceIds :: Lens' TransitGatewayMulticastRegisteredGroupSources (Maybe [Text])
transitGatewayMulticastRegisteredGroupSources_registeredNetworkInterfaceIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransitGatewayMulticastRegisteredGroupSources' {Maybe [Text]
registeredNetworkInterfaceIds :: Maybe [Text]
$sel:registeredNetworkInterfaceIds:TransitGatewayMulticastRegisteredGroupSources' :: TransitGatewayMulticastRegisteredGroupSources -> Maybe [Text]
registeredNetworkInterfaceIds} -> Maybe [Text]
registeredNetworkInterfaceIds) (\s :: TransitGatewayMulticastRegisteredGroupSources
s@TransitGatewayMulticastRegisteredGroupSources' {} Maybe [Text]
a -> TransitGatewayMulticastRegisteredGroupSources
s {$sel:registeredNetworkInterfaceIds:TransitGatewayMulticastRegisteredGroupSources' :: Maybe [Text]
registeredNetworkInterfaceIds = Maybe [Text]
a} :: TransitGatewayMulticastRegisteredGroupSources) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Data.FromXML
    TransitGatewayMulticastRegisteredGroupSources
  where
  parseXML :: [Node]
-> Either String TransitGatewayMulticastRegisteredGroupSources
parseXML [Node]
x =
    Maybe Text
-> Maybe [Text]
-> Maybe Text
-> TransitGatewayMulticastRegisteredGroupSources
TransitGatewayMulticastRegisteredGroupSources'
      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
"groupIpAddress")
      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
"registeredNetworkInterfaceIds"
                      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
"transitGatewayMulticastDomainId")

instance
  Prelude.Hashable
    TransitGatewayMulticastRegisteredGroupSources
  where
  hashWithSalt :: Int -> TransitGatewayMulticastRegisteredGroupSources -> Int
hashWithSalt
    Int
_salt
    TransitGatewayMulticastRegisteredGroupSources' {Maybe [Text]
Maybe Text
transitGatewayMulticastDomainId :: Maybe Text
registeredNetworkInterfaceIds :: Maybe [Text]
groupIpAddress :: Maybe Text
$sel:transitGatewayMulticastDomainId:TransitGatewayMulticastRegisteredGroupSources' :: TransitGatewayMulticastRegisteredGroupSources -> Maybe Text
$sel:registeredNetworkInterfaceIds:TransitGatewayMulticastRegisteredGroupSources' :: TransitGatewayMulticastRegisteredGroupSources -> Maybe [Text]
$sel:groupIpAddress:TransitGatewayMulticastRegisteredGroupSources' :: TransitGatewayMulticastRegisteredGroupSources -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
groupIpAddress
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
registeredNetworkInterfaceIds
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
transitGatewayMulticastDomainId

instance
  Prelude.NFData
    TransitGatewayMulticastRegisteredGroupSources
  where
  rnf :: TransitGatewayMulticastRegisteredGroupSources -> ()
rnf
    TransitGatewayMulticastRegisteredGroupSources' {Maybe [Text]
Maybe Text
transitGatewayMulticastDomainId :: Maybe Text
registeredNetworkInterfaceIds :: Maybe [Text]
groupIpAddress :: Maybe Text
$sel:transitGatewayMulticastDomainId:TransitGatewayMulticastRegisteredGroupSources' :: TransitGatewayMulticastRegisteredGroupSources -> Maybe Text
$sel:registeredNetworkInterfaceIds:TransitGatewayMulticastRegisteredGroupSources' :: TransitGatewayMulticastRegisteredGroupSources -> Maybe [Text]
$sel:groupIpAddress:TransitGatewayMulticastRegisteredGroupSources' :: TransitGatewayMulticastRegisteredGroupSources -> Maybe Text
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
groupIpAddress
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
registeredNetworkInterfaceIds
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
transitGatewayMulticastDomainId