{-# 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.AccountSettings
-- 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.AccountSettings 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

-- | Settings related to the Amazon Chime account. This includes settings
-- that start or stop remote control of shared screens, or start or stop
-- the dial-out option in the Amazon Chime web application. For more
-- information about these settings, see
-- <https://docs.aws.amazon.com/chime/latest/ag/policies.html Use the Policies Page>
-- in the /Amazon Chime Administration Guide/.
--
-- /See:/ 'newAccountSettings' smart constructor.
data AccountSettings = AccountSettings'
  { -- | Setting that stops or starts remote control of shared screens during
    -- meetings.
    AccountSettings -> Maybe Bool
disableRemoteControl :: Prelude.Maybe Prelude.Bool,
    -- | Setting that allows meeting participants to choose the __Call me at a
    -- phone number__ option. For more information, see
    -- <https://docs.aws.amazon.com/chime/latest/ug/chime-join-meeting.html Join a Meeting without the Amazon Chime App>.
    AccountSettings -> Maybe Bool
enableDialOut :: Prelude.Maybe Prelude.Bool
  }
  deriving (AccountSettings -> AccountSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountSettings -> AccountSettings -> Bool
$c/= :: AccountSettings -> AccountSettings -> Bool
== :: AccountSettings -> AccountSettings -> Bool
$c== :: AccountSettings -> AccountSettings -> Bool
Prelude.Eq, ReadPrec [AccountSettings]
ReadPrec AccountSettings
Int -> ReadS AccountSettings
ReadS [AccountSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccountSettings]
$creadListPrec :: ReadPrec [AccountSettings]
readPrec :: ReadPrec AccountSettings
$creadPrec :: ReadPrec AccountSettings
readList :: ReadS [AccountSettings]
$creadList :: ReadS [AccountSettings]
readsPrec :: Int -> ReadS AccountSettings
$creadsPrec :: Int -> ReadS AccountSettings
Prelude.Read, Int -> AccountSettings -> ShowS
[AccountSettings] -> ShowS
AccountSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountSettings] -> ShowS
$cshowList :: [AccountSettings] -> ShowS
show :: AccountSettings -> String
$cshow :: AccountSettings -> String
showsPrec :: Int -> AccountSettings -> ShowS
$cshowsPrec :: Int -> AccountSettings -> ShowS
Prelude.Show, forall x. Rep AccountSettings x -> AccountSettings
forall x. AccountSettings -> Rep AccountSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccountSettings x -> AccountSettings
$cfrom :: forall x. AccountSettings -> Rep AccountSettings x
Prelude.Generic)

-- |
-- Create a value of 'AccountSettings' 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:
--
-- 'disableRemoteControl', 'accountSettings_disableRemoteControl' - Setting that stops or starts remote control of shared screens during
-- meetings.
--
-- 'enableDialOut', 'accountSettings_enableDialOut' - Setting that allows meeting participants to choose the __Call me at a
-- phone number__ option. For more information, see
-- <https://docs.aws.amazon.com/chime/latest/ug/chime-join-meeting.html Join a Meeting without the Amazon Chime App>.
newAccountSettings ::
  AccountSettings
newAccountSettings :: AccountSettings
newAccountSettings =
  AccountSettings'
    { $sel:disableRemoteControl:AccountSettings' :: Maybe Bool
disableRemoteControl =
        forall a. Maybe a
Prelude.Nothing,
      $sel:enableDialOut:AccountSettings' :: Maybe Bool
enableDialOut = forall a. Maybe a
Prelude.Nothing
    }

-- | Setting that stops or starts remote control of shared screens during
-- meetings.
accountSettings_disableRemoteControl :: Lens.Lens' AccountSettings (Prelude.Maybe Prelude.Bool)
accountSettings_disableRemoteControl :: Lens' AccountSettings (Maybe Bool)
accountSettings_disableRemoteControl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountSettings' {Maybe Bool
disableRemoteControl :: Maybe Bool
$sel:disableRemoteControl:AccountSettings' :: AccountSettings -> Maybe Bool
disableRemoteControl} -> Maybe Bool
disableRemoteControl) (\s :: AccountSettings
s@AccountSettings' {} Maybe Bool
a -> AccountSettings
s {$sel:disableRemoteControl:AccountSettings' :: Maybe Bool
disableRemoteControl = Maybe Bool
a} :: AccountSettings)

-- | Setting that allows meeting participants to choose the __Call me at a
-- phone number__ option. For more information, see
-- <https://docs.aws.amazon.com/chime/latest/ug/chime-join-meeting.html Join a Meeting without the Amazon Chime App>.
accountSettings_enableDialOut :: Lens.Lens' AccountSettings (Prelude.Maybe Prelude.Bool)
accountSettings_enableDialOut :: Lens' AccountSettings (Maybe Bool)
accountSettings_enableDialOut = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountSettings' {Maybe Bool
enableDialOut :: Maybe Bool
$sel:enableDialOut:AccountSettings' :: AccountSettings -> Maybe Bool
enableDialOut} -> Maybe Bool
enableDialOut) (\s :: AccountSettings
s@AccountSettings' {} Maybe Bool
a -> AccountSettings
s {$sel:enableDialOut:AccountSettings' :: Maybe Bool
enableDialOut = Maybe Bool
a} :: AccountSettings)

instance Data.FromJSON AccountSettings where
  parseJSON :: Value -> Parser AccountSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AccountSettings"
      ( \Object
x ->
          Maybe Bool -> Maybe Bool -> AccountSettings
AccountSettings'
            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
"DisableRemoteControl")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EnableDialOut")
      )

instance Prelude.Hashable AccountSettings where
  hashWithSalt :: Int -> AccountSettings -> Int
hashWithSalt Int
_salt AccountSettings' {Maybe Bool
enableDialOut :: Maybe Bool
disableRemoteControl :: Maybe Bool
$sel:enableDialOut:AccountSettings' :: AccountSettings -> Maybe Bool
$sel:disableRemoteControl:AccountSettings' :: AccountSettings -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
disableRemoteControl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enableDialOut

instance Prelude.NFData AccountSettings where
  rnf :: AccountSettings -> ()
rnf AccountSettings' {Maybe Bool
enableDialOut :: Maybe Bool
disableRemoteControl :: Maybe Bool
$sel:enableDialOut:AccountSettings' :: AccountSettings -> Maybe Bool
$sel:disableRemoteControl:AccountSettings' :: AccountSettings -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
disableRemoteControl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enableDialOut

instance Data.ToJSON AccountSettings where
  toJSON :: AccountSettings -> Value
toJSON AccountSettings' {Maybe Bool
enableDialOut :: Maybe Bool
disableRemoteControl :: Maybe Bool
$sel:enableDialOut:AccountSettings' :: AccountSettings -> Maybe Bool
$sel:disableRemoteControl:AccountSettings' :: AccountSettings -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"DisableRemoteControl" 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 Bool
disableRemoteControl,
            (Key
"EnableDialOut" 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 Bool
enableDialOut
          ]
      )