{-# 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.Connect.Types.ChatStreamingConfiguration
-- 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.Connect.Types.ChatStreamingConfiguration 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 streaming configuration, such as the Amazon SNS streaming endpoint.
--
-- /See:/ 'newChatStreamingConfiguration' smart constructor.
data ChatStreamingConfiguration = ChatStreamingConfiguration'
  { -- | The Amazon Resource Name (ARN) of the standard Amazon SNS topic. The
    -- Amazon Resource Name (ARN) of the streaming endpoint that is used to
    -- publish real-time message streaming for chat conversations.
    ChatStreamingConfiguration -> Text
streamingEndpointArn :: Prelude.Text
  }
  deriving (ChatStreamingConfiguration -> ChatStreamingConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChatStreamingConfiguration -> ChatStreamingConfiguration -> Bool
$c/= :: ChatStreamingConfiguration -> ChatStreamingConfiguration -> Bool
== :: ChatStreamingConfiguration -> ChatStreamingConfiguration -> Bool
$c== :: ChatStreamingConfiguration -> ChatStreamingConfiguration -> Bool
Prelude.Eq, ReadPrec [ChatStreamingConfiguration]
ReadPrec ChatStreamingConfiguration
Int -> ReadS ChatStreamingConfiguration
ReadS [ChatStreamingConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChatStreamingConfiguration]
$creadListPrec :: ReadPrec [ChatStreamingConfiguration]
readPrec :: ReadPrec ChatStreamingConfiguration
$creadPrec :: ReadPrec ChatStreamingConfiguration
readList :: ReadS [ChatStreamingConfiguration]
$creadList :: ReadS [ChatStreamingConfiguration]
readsPrec :: Int -> ReadS ChatStreamingConfiguration
$creadsPrec :: Int -> ReadS ChatStreamingConfiguration
Prelude.Read, Int -> ChatStreamingConfiguration -> ShowS
[ChatStreamingConfiguration] -> ShowS
ChatStreamingConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChatStreamingConfiguration] -> ShowS
$cshowList :: [ChatStreamingConfiguration] -> ShowS
show :: ChatStreamingConfiguration -> String
$cshow :: ChatStreamingConfiguration -> String
showsPrec :: Int -> ChatStreamingConfiguration -> ShowS
$cshowsPrec :: Int -> ChatStreamingConfiguration -> ShowS
Prelude.Show, forall x.
Rep ChatStreamingConfiguration x -> ChatStreamingConfiguration
forall x.
ChatStreamingConfiguration -> Rep ChatStreamingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ChatStreamingConfiguration x -> ChatStreamingConfiguration
$cfrom :: forall x.
ChatStreamingConfiguration -> Rep ChatStreamingConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'ChatStreamingConfiguration' 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:
--
-- 'streamingEndpointArn', 'chatStreamingConfiguration_streamingEndpointArn' - The Amazon Resource Name (ARN) of the standard Amazon SNS topic. The
-- Amazon Resource Name (ARN) of the streaming endpoint that is used to
-- publish real-time message streaming for chat conversations.
newChatStreamingConfiguration ::
  -- | 'streamingEndpointArn'
  Prelude.Text ->
  ChatStreamingConfiguration
newChatStreamingConfiguration :: Text -> ChatStreamingConfiguration
newChatStreamingConfiguration Text
pStreamingEndpointArn_ =
  ChatStreamingConfiguration'
    { $sel:streamingEndpointArn:ChatStreamingConfiguration' :: Text
streamingEndpointArn =
        Text
pStreamingEndpointArn_
    }

-- | The Amazon Resource Name (ARN) of the standard Amazon SNS topic. The
-- Amazon Resource Name (ARN) of the streaming endpoint that is used to
-- publish real-time message streaming for chat conversations.
chatStreamingConfiguration_streamingEndpointArn :: Lens.Lens' ChatStreamingConfiguration Prelude.Text
chatStreamingConfiguration_streamingEndpointArn :: Lens' ChatStreamingConfiguration Text
chatStreamingConfiguration_streamingEndpointArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChatStreamingConfiguration' {Text
streamingEndpointArn :: Text
$sel:streamingEndpointArn:ChatStreamingConfiguration' :: ChatStreamingConfiguration -> Text
streamingEndpointArn} -> Text
streamingEndpointArn) (\s :: ChatStreamingConfiguration
s@ChatStreamingConfiguration' {} Text
a -> ChatStreamingConfiguration
s {$sel:streamingEndpointArn:ChatStreamingConfiguration' :: Text
streamingEndpointArn = Text
a} :: ChatStreamingConfiguration)

instance Prelude.Hashable ChatStreamingConfiguration where
  hashWithSalt :: Int -> ChatStreamingConfiguration -> Int
hashWithSalt Int
_salt ChatStreamingConfiguration' {Text
streamingEndpointArn :: Text
$sel:streamingEndpointArn:ChatStreamingConfiguration' :: ChatStreamingConfiguration -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
streamingEndpointArn

instance Prelude.NFData ChatStreamingConfiguration where
  rnf :: ChatStreamingConfiguration -> ()
rnf ChatStreamingConfiguration' {Text
streamingEndpointArn :: Text
$sel:streamingEndpointArn:ChatStreamingConfiguration' :: ChatStreamingConfiguration -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
streamingEndpointArn

instance Data.ToJSON ChatStreamingConfiguration where
  toJSON :: ChatStreamingConfiguration -> Value
toJSON ChatStreamingConfiguration' {Text
streamingEndpointArn :: Text
$sel:streamingEndpointArn:ChatStreamingConfiguration' :: ChatStreamingConfiguration -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              ( Key
"StreamingEndpointArn"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
streamingEndpointArn
              )
          ]
      )