{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Chime.Types.MeetingNotificationConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 (Core.Sensitive Prelude.Text),
    -- | The SQS queue ARN.
    MeetingNotificationConfiguration -> Maybe (Sensitive Text)
sqsQueueArn :: Prelude.Maybe (Core.Sensitive Prelude.Text)
  }
  deriving (MeetingNotificationConfiguration
-> MeetingNotificationConfiguration -> Bool
(MeetingNotificationConfiguration
 -> MeetingNotificationConfiguration -> Bool)
-> (MeetingNotificationConfiguration
    -> MeetingNotificationConfiguration -> Bool)
-> Eq MeetingNotificationConfiguration
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
(Int -> MeetingNotificationConfiguration -> ShowS)
-> (MeetingNotificationConfiguration -> String)
-> ([MeetingNotificationConfiguration] -> ShowS)
-> Show MeetingNotificationConfiguration
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.
 MeetingNotificationConfiguration
 -> Rep MeetingNotificationConfiguration x)
-> (forall x.
    Rep MeetingNotificationConfiguration x
    -> MeetingNotificationConfiguration)
-> Generic MeetingNotificationConfiguration
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' :: Maybe (Sensitive Text)
-> Maybe (Sensitive Text) -> MeetingNotificationConfiguration
MeetingNotificationConfiguration'
    { $sel:snsTopicArn:MeetingNotificationConfiguration' :: Maybe (Sensitive Text)
snsTopicArn =
        Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:sqsQueueArn:MeetingNotificationConfiguration' :: Maybe (Sensitive Text)
sqsQueueArn = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The SNS topic ARN.
meetingNotificationConfiguration_snsTopicArn :: Lens.Lens' MeetingNotificationConfiguration (Prelude.Maybe Prelude.Text)
meetingNotificationConfiguration_snsTopicArn :: (Maybe Text -> f (Maybe Text))
-> MeetingNotificationConfiguration
-> f MeetingNotificationConfiguration
meetingNotificationConfiguration_snsTopicArn = (MeetingNotificationConfiguration -> Maybe (Sensitive Text))
-> (MeetingNotificationConfiguration
    -> Maybe (Sensitive Text) -> MeetingNotificationConfiguration)
-> Lens
     MeetingNotificationConfiguration
     MeetingNotificationConfiguration
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
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) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> MeetingNotificationConfiguration
 -> f MeetingNotificationConfiguration)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> MeetingNotificationConfiguration
-> f MeetingNotificationConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The SQS queue ARN.
meetingNotificationConfiguration_sqsQueueArn :: Lens.Lens' MeetingNotificationConfiguration (Prelude.Maybe Prelude.Text)
meetingNotificationConfiguration_sqsQueueArn :: (Maybe Text -> f (Maybe Text))
-> MeetingNotificationConfiguration
-> f MeetingNotificationConfiguration
meetingNotificationConfiguration_sqsQueueArn = (MeetingNotificationConfiguration -> Maybe (Sensitive Text))
-> (MeetingNotificationConfiguration
    -> Maybe (Sensitive Text) -> MeetingNotificationConfiguration)
-> Lens
     MeetingNotificationConfiguration
     MeetingNotificationConfiguration
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
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) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> MeetingNotificationConfiguration
 -> f MeetingNotificationConfiguration)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> MeetingNotificationConfiguration
-> f MeetingNotificationConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

instance
  Prelude.Hashable
    MeetingNotificationConfiguration

instance
  Prelude.NFData
    MeetingNotificationConfiguration

instance Core.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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SnsTopicArn" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
snsTopicArn,
            (Text
"SqsQueueArn" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
sqsQueueArn
          ]
      )