{-# 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.ChimeSdkMeetings.Types.NotificationsConfiguration
-- 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.ChimeSdkMeetings.Types.NotificationsConfiguration 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 configuration for resource targets to receive notifications when
-- meeting and attendee events occur.
--
-- /See:/ 'newNotificationsConfiguration' smart constructor.
data NotificationsConfiguration = NotificationsConfiguration'
  { -- | The ARN of the AWS Lambda function in the notifications configuration.
    NotificationsConfiguration -> Maybe (Sensitive Text)
lambdaFunctionArn :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The ARN of the SNS topic.
    NotificationsConfiguration -> Maybe (Sensitive Text)
snsTopicArn :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The ARN of the SQS queue.
    NotificationsConfiguration -> Maybe (Sensitive Text)
sqsQueueArn :: Prelude.Maybe (Data.Sensitive Prelude.Text)
  }
  deriving (NotificationsConfiguration -> NotificationsConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NotificationsConfiguration -> NotificationsConfiguration -> Bool
$c/= :: NotificationsConfiguration -> NotificationsConfiguration -> Bool
== :: NotificationsConfiguration -> NotificationsConfiguration -> Bool
$c== :: NotificationsConfiguration -> NotificationsConfiguration -> Bool
Prelude.Eq, Int -> NotificationsConfiguration -> ShowS
[NotificationsConfiguration] -> ShowS
NotificationsConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NotificationsConfiguration] -> ShowS
$cshowList :: [NotificationsConfiguration] -> ShowS
show :: NotificationsConfiguration -> String
$cshow :: NotificationsConfiguration -> String
showsPrec :: Int -> NotificationsConfiguration -> ShowS
$cshowsPrec :: Int -> NotificationsConfiguration -> ShowS
Prelude.Show, forall x.
Rep NotificationsConfiguration x -> NotificationsConfiguration
forall x.
NotificationsConfiguration -> Rep NotificationsConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NotificationsConfiguration x -> NotificationsConfiguration
$cfrom :: forall x.
NotificationsConfiguration -> Rep NotificationsConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'NotificationsConfiguration' 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:
--
-- 'lambdaFunctionArn', 'notificationsConfiguration_lambdaFunctionArn' - The ARN of the AWS Lambda function in the notifications configuration.
--
-- 'snsTopicArn', 'notificationsConfiguration_snsTopicArn' - The ARN of the SNS topic.
--
-- 'sqsQueueArn', 'notificationsConfiguration_sqsQueueArn' - The ARN of the SQS queue.
newNotificationsConfiguration ::
  NotificationsConfiguration
newNotificationsConfiguration :: NotificationsConfiguration
newNotificationsConfiguration =
  NotificationsConfiguration'
    { $sel:lambdaFunctionArn:NotificationsConfiguration' :: Maybe (Sensitive Text)
lambdaFunctionArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:snsTopicArn:NotificationsConfiguration' :: Maybe (Sensitive Text)
snsTopicArn = forall a. Maybe a
Prelude.Nothing,
      $sel:sqsQueueArn:NotificationsConfiguration' :: Maybe (Sensitive Text)
sqsQueueArn = forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the AWS Lambda function in the notifications configuration.
notificationsConfiguration_lambdaFunctionArn :: Lens.Lens' NotificationsConfiguration (Prelude.Maybe Prelude.Text)
notificationsConfiguration_lambdaFunctionArn :: Lens' NotificationsConfiguration (Maybe Text)
notificationsConfiguration_lambdaFunctionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotificationsConfiguration' {Maybe (Sensitive Text)
lambdaFunctionArn :: Maybe (Sensitive Text)
$sel:lambdaFunctionArn:NotificationsConfiguration' :: NotificationsConfiguration -> Maybe (Sensitive Text)
lambdaFunctionArn} -> Maybe (Sensitive Text)
lambdaFunctionArn) (\s :: NotificationsConfiguration
s@NotificationsConfiguration' {} Maybe (Sensitive Text)
a -> NotificationsConfiguration
s {$sel:lambdaFunctionArn:NotificationsConfiguration' :: Maybe (Sensitive Text)
lambdaFunctionArn = Maybe (Sensitive Text)
a} :: NotificationsConfiguration) 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 ARN of the SNS topic.
notificationsConfiguration_snsTopicArn :: Lens.Lens' NotificationsConfiguration (Prelude.Maybe Prelude.Text)
notificationsConfiguration_snsTopicArn :: Lens' NotificationsConfiguration (Maybe Text)
notificationsConfiguration_snsTopicArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotificationsConfiguration' {Maybe (Sensitive Text)
snsTopicArn :: Maybe (Sensitive Text)
$sel:snsTopicArn:NotificationsConfiguration' :: NotificationsConfiguration -> Maybe (Sensitive Text)
snsTopicArn} -> Maybe (Sensitive Text)
snsTopicArn) (\s :: NotificationsConfiguration
s@NotificationsConfiguration' {} Maybe (Sensitive Text)
a -> NotificationsConfiguration
s {$sel:snsTopicArn:NotificationsConfiguration' :: Maybe (Sensitive Text)
snsTopicArn = Maybe (Sensitive Text)
a} :: NotificationsConfiguration) 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 ARN of the SQS queue.
notificationsConfiguration_sqsQueueArn :: Lens.Lens' NotificationsConfiguration (Prelude.Maybe Prelude.Text)
notificationsConfiguration_sqsQueueArn :: Lens' NotificationsConfiguration (Maybe Text)
notificationsConfiguration_sqsQueueArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotificationsConfiguration' {Maybe (Sensitive Text)
sqsQueueArn :: Maybe (Sensitive Text)
$sel:sqsQueueArn:NotificationsConfiguration' :: NotificationsConfiguration -> Maybe (Sensitive Text)
sqsQueueArn} -> Maybe (Sensitive Text)
sqsQueueArn) (\s :: NotificationsConfiguration
s@NotificationsConfiguration' {} Maybe (Sensitive Text)
a -> NotificationsConfiguration
s {$sel:sqsQueueArn:NotificationsConfiguration' :: Maybe (Sensitive Text)
sqsQueueArn = Maybe (Sensitive Text)
a} :: NotificationsConfiguration) 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 NotificationsConfiguration where
  hashWithSalt :: Int -> NotificationsConfiguration -> Int
hashWithSalt Int
_salt NotificationsConfiguration' {Maybe (Sensitive Text)
sqsQueueArn :: Maybe (Sensitive Text)
snsTopicArn :: Maybe (Sensitive Text)
lambdaFunctionArn :: Maybe (Sensitive Text)
$sel:sqsQueueArn:NotificationsConfiguration' :: NotificationsConfiguration -> Maybe (Sensitive Text)
$sel:snsTopicArn:NotificationsConfiguration' :: NotificationsConfiguration -> Maybe (Sensitive Text)
$sel:lambdaFunctionArn:NotificationsConfiguration' :: NotificationsConfiguration -> Maybe (Sensitive Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
lambdaFunctionArn
      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 NotificationsConfiguration where
  rnf :: NotificationsConfiguration -> ()
rnf NotificationsConfiguration' {Maybe (Sensitive Text)
sqsQueueArn :: Maybe (Sensitive Text)
snsTopicArn :: Maybe (Sensitive Text)
lambdaFunctionArn :: Maybe (Sensitive Text)
$sel:sqsQueueArn:NotificationsConfiguration' :: NotificationsConfiguration -> Maybe (Sensitive Text)
$sel:snsTopicArn:NotificationsConfiguration' :: NotificationsConfiguration -> Maybe (Sensitive Text)
$sel:lambdaFunctionArn:NotificationsConfiguration' :: NotificationsConfiguration -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
lambdaFunctionArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 NotificationsConfiguration where
  toJSON :: NotificationsConfiguration -> Value
toJSON NotificationsConfiguration' {Maybe (Sensitive Text)
sqsQueueArn :: Maybe (Sensitive Text)
snsTopicArn :: Maybe (Sensitive Text)
lambdaFunctionArn :: Maybe (Sensitive Text)
$sel:sqsQueueArn:NotificationsConfiguration' :: NotificationsConfiguration -> Maybe (Sensitive Text)
$sel:snsTopicArn:NotificationsConfiguration' :: NotificationsConfiguration -> Maybe (Sensitive Text)
$sel:lambdaFunctionArn:NotificationsConfiguration' :: NotificationsConfiguration -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"LambdaFunctionArn" 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)
lambdaFunctionArn,
            (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
          ]
      )