{-# 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.ChimeSdkVoice.Types.VoiceConnectorSettings
-- 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.ChimeSdkVoice.Types.VoiceConnectorSettings 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

-- | /See:/ 'newVoiceConnectorSettings' smart constructor.
data VoiceConnectorSettings = VoiceConnectorSettings'
  { VoiceConnectorSettings -> Maybe Text
cdrBucket :: Prelude.Maybe Prelude.Text
  }
  deriving (VoiceConnectorSettings -> VoiceConnectorSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VoiceConnectorSettings -> VoiceConnectorSettings -> Bool
$c/= :: VoiceConnectorSettings -> VoiceConnectorSettings -> Bool
== :: VoiceConnectorSettings -> VoiceConnectorSettings -> Bool
$c== :: VoiceConnectorSettings -> VoiceConnectorSettings -> Bool
Prelude.Eq, ReadPrec [VoiceConnectorSettings]
ReadPrec VoiceConnectorSettings
Int -> ReadS VoiceConnectorSettings
ReadS [VoiceConnectorSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VoiceConnectorSettings]
$creadListPrec :: ReadPrec [VoiceConnectorSettings]
readPrec :: ReadPrec VoiceConnectorSettings
$creadPrec :: ReadPrec VoiceConnectorSettings
readList :: ReadS [VoiceConnectorSettings]
$creadList :: ReadS [VoiceConnectorSettings]
readsPrec :: Int -> ReadS VoiceConnectorSettings
$creadsPrec :: Int -> ReadS VoiceConnectorSettings
Prelude.Read, Int -> VoiceConnectorSettings -> ShowS
[VoiceConnectorSettings] -> ShowS
VoiceConnectorSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VoiceConnectorSettings] -> ShowS
$cshowList :: [VoiceConnectorSettings] -> ShowS
show :: VoiceConnectorSettings -> String
$cshow :: VoiceConnectorSettings -> String
showsPrec :: Int -> VoiceConnectorSettings -> ShowS
$cshowsPrec :: Int -> VoiceConnectorSettings -> ShowS
Prelude.Show, forall x. Rep VoiceConnectorSettings x -> VoiceConnectorSettings
forall x. VoiceConnectorSettings -> Rep VoiceConnectorSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VoiceConnectorSettings x -> VoiceConnectorSettings
$cfrom :: forall x. VoiceConnectorSettings -> Rep VoiceConnectorSettings x
Prelude.Generic)

-- |
-- Create a value of 'VoiceConnectorSettings' 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:
--
-- 'cdrBucket', 'voiceConnectorSettings_cdrBucket' - Undocumented member.
newVoiceConnectorSettings ::
  VoiceConnectorSettings
newVoiceConnectorSettings :: VoiceConnectorSettings
newVoiceConnectorSettings =
  VoiceConnectorSettings'
    { $sel:cdrBucket:VoiceConnectorSettings' :: Maybe Text
cdrBucket =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
voiceConnectorSettings_cdrBucket :: Lens.Lens' VoiceConnectorSettings (Prelude.Maybe Prelude.Text)
voiceConnectorSettings_cdrBucket :: Lens' VoiceConnectorSettings (Maybe Text)
voiceConnectorSettings_cdrBucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VoiceConnectorSettings' {Maybe Text
cdrBucket :: Maybe Text
$sel:cdrBucket:VoiceConnectorSettings' :: VoiceConnectorSettings -> Maybe Text
cdrBucket} -> Maybe Text
cdrBucket) (\s :: VoiceConnectorSettings
s@VoiceConnectorSettings' {} Maybe Text
a -> VoiceConnectorSettings
s {$sel:cdrBucket:VoiceConnectorSettings' :: Maybe Text
cdrBucket = Maybe Text
a} :: VoiceConnectorSettings)

instance Data.FromJSON VoiceConnectorSettings where
  parseJSON :: Value -> Parser VoiceConnectorSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VoiceConnectorSettings"
      ( \Object
x ->
          Maybe Text -> VoiceConnectorSettings
VoiceConnectorSettings'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CdrBucket")
      )

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

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

instance Data.ToJSON VoiceConnectorSettings where
  toJSON :: VoiceConnectorSettings -> Value
toJSON VoiceConnectorSettings' {Maybe Text
cdrBucket :: Maybe Text
$sel:cdrBucket:VoiceConnectorSettings' :: VoiceConnectorSettings -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"CdrBucket" 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 Text
cdrBucket]
      )