{-# 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.Chime.Types.MeetingNotificationConfiguration
-- 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.Chime.Types.MeetingNotificationConfiguration where

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

-- | The resource target configurations for receiving Amazon Chime SDK
-- meeting and attendee event notifications. The Amazon Chime SDK supports
-- resource targets located in the US East (N. Virginia) AWS Region
-- (@us-east-1@).
--
-- /See:/ 'newMeetingNotificationConfiguration' smart constructor.
data MeetingNotificationConfiguration = MeetingNotificationConfiguration'
  { -- | The SNS topic ARN.
    MeetingNotificationConfiguration -> Maybe (Sensitive Text)
snsTopicArn :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The SQS queue ARN.
    MeetingNotificationConfiguration -> Maybe (Sensitive Text)
sqsQueueArn :: Prelude.Maybe (Data.Sensitive Prelude.Text)
  }
  deriving (MeetingNotificationConfiguration
-> MeetingNotificationConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MeetingNotificationConfiguration
-> MeetingNotificationConfiguration -> Bool
$c/= :: MeetingNotificationConfiguration
-> MeetingNotificationConfiguration -> Bool
== :: MeetingNotificationConfiguration
-> MeetingNotificationConfiguration -> Bool
$c== :: MeetingNotificationConfiguration
-> MeetingNotificationConfiguration -> Bool
Prelude.Eq, Int -> MeetingNotificationConfiguration -> ShowS
[MeetingNotificationConfiguration] -> ShowS
MeetingNotificationConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MeetingNotificationConfiguration] -> ShowS
$cshowList :: [MeetingNotificationConfiguration] -> ShowS
show :: MeetingNotificationConfiguration -> String
$cshow :: MeetingNotificationConfiguration -> String
showsPrec :: Int -> MeetingNotificationConfiguration -> ShowS
$cshowsPrec :: Int -> MeetingNotificationConfiguration -> ShowS
Prelude.Show, forall x.
Rep MeetingNotificationConfiguration x
-> MeetingNotificationConfiguration
forall x.
MeetingNotificationConfiguration
-> Rep MeetingNotificationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MeetingNotificationConfiguration x
-> MeetingNotificationConfiguration
$cfrom :: forall x.
MeetingNotificationConfiguration
-> Rep MeetingNotificationConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'MeetingNotificationConfiguration' 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:
--
-- 'snsTopicArn', 'meetingNotificationConfiguration_snsTopicArn' - The SNS topic ARN.
--
-- 'sqsQueueArn', 'meetingNotificationConfiguration_sqsQueueArn' - The SQS queue ARN.
newMeetingNotificationConfiguration ::
  MeetingNotificationConfiguration
newMeetingNotificationConfiguration :: MeetingNotificationConfiguration
newMeetingNotificationConfiguration =
  MeetingNotificationConfiguration'
    { $sel:snsTopicArn:MeetingNotificationConfiguration' :: Maybe (Sensitive Text)
snsTopicArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:sqsQueueArn:MeetingNotificationConfiguration' :: Maybe (Sensitive Text)
sqsQueueArn = forall a. Maybe a
Prelude.Nothing
    }

-- | The SNS topic ARN.
meetingNotificationConfiguration_snsTopicArn :: Lens.Lens' MeetingNotificationConfiguration (Prelude.Maybe Prelude.Text)
meetingNotificationConfiguration_snsTopicArn :: Lens' MeetingNotificationConfiguration (Maybe Text)
meetingNotificationConfiguration_snsTopicArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MeetingNotificationConfiguration' {Maybe (Sensitive Text)
snsTopicArn :: Maybe (Sensitive Text)
$sel:snsTopicArn:MeetingNotificationConfiguration' :: MeetingNotificationConfiguration -> Maybe (Sensitive Text)
snsTopicArn} -> Maybe (Sensitive Text)
snsTopicArn) (\s :: MeetingNotificationConfiguration
s@MeetingNotificationConfiguration' {} Maybe (Sensitive Text)
a -> MeetingNotificationConfiguration
s {$sel:snsTopicArn:MeetingNotificationConfiguration' :: Maybe (Sensitive Text)
snsTopicArn = Maybe (Sensitive Text)
a} :: MeetingNotificationConfiguration) 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 a. Iso' (Sensitive a) a
Data._Sensitive

-- | The SQS queue ARN.
meetingNotificationConfiguration_sqsQueueArn :: Lens.Lens' MeetingNotificationConfiguration (Prelude.Maybe Prelude.Text)
meetingNotificationConfiguration_sqsQueueArn :: Lens' MeetingNotificationConfiguration (Maybe Text)
meetingNotificationConfiguration_sqsQueueArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MeetingNotificationConfiguration' {Maybe (Sensitive Text)
sqsQueueArn :: Maybe (Sensitive Text)
$sel:sqsQueueArn:MeetingNotificationConfiguration' :: MeetingNotificationConfiguration -> Maybe (Sensitive Text)
sqsQueueArn} -> Maybe (Sensitive Text)
sqsQueueArn) (\s :: MeetingNotificationConfiguration
s@MeetingNotificationConfiguration' {} Maybe (Sensitive Text)
a -> MeetingNotificationConfiguration
s {$sel:sqsQueueArn:MeetingNotificationConfiguration' :: Maybe (Sensitive Text)
sqsQueueArn = Maybe (Sensitive Text)
a} :: MeetingNotificationConfiguration) 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 a. Iso' (Sensitive a) a
Data._Sensitive

instance
  Prelude.Hashable
    MeetingNotificationConfiguration
  where
  hashWithSalt :: Int -> MeetingNotificationConfiguration -> Int
hashWithSalt
    Int
_salt
    MeetingNotificationConfiguration' {Maybe (Sensitive Text)
sqsQueueArn :: Maybe (Sensitive Text)
snsTopicArn :: Maybe (Sensitive Text)
$sel:sqsQueueArn:MeetingNotificationConfiguration' :: MeetingNotificationConfiguration -> Maybe (Sensitive Text)
$sel:snsTopicArn:MeetingNotificationConfiguration' :: MeetingNotificationConfiguration -> Maybe (Sensitive Text)
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
snsTopicArn
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
sqsQueueArn

instance
  Prelude.NFData
    MeetingNotificationConfiguration
  where
  rnf :: MeetingNotificationConfiguration -> ()
rnf MeetingNotificationConfiguration' {Maybe (Sensitive Text)
sqsQueueArn :: Maybe (Sensitive Text)
snsTopicArn :: Maybe (Sensitive Text)
$sel:sqsQueueArn:MeetingNotificationConfiguration' :: MeetingNotificationConfiguration -> Maybe (Sensitive Text)
$sel:snsTopicArn:MeetingNotificationConfiguration' :: MeetingNotificationConfiguration -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
snsTopicArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
sqsQueueArn

instance Data.ToJSON MeetingNotificationConfiguration where
  toJSON :: MeetingNotificationConfiguration -> Value
toJSON MeetingNotificationConfiguration' {Maybe (Sensitive Text)
sqsQueueArn :: Maybe (Sensitive Text)
snsTopicArn :: Maybe (Sensitive Text)
$sel:sqsQueueArn:MeetingNotificationConfiguration' :: MeetingNotificationConfiguration -> Maybe (Sensitive Text)
$sel:snsTopicArn:MeetingNotificationConfiguration' :: MeetingNotificationConfiguration -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"SnsTopicArn" 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 (Sensitive Text)
snsTopicArn,
            (Key
"SqsQueueArn" 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 (Sensitive Text)
sqsQueueArn
          ]
      )