{-# 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.Pinpoint.Types.VoiceChannelRequest
-- 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.Pinpoint.Types.VoiceChannelRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Specifies the status and settings of the voice channel for an
-- application.
--
-- /See:/ 'newVoiceChannelRequest' smart constructor.
data VoiceChannelRequest = VoiceChannelRequest'
  { -- | Specifies whether to enable the voice channel for the application.
    VoiceChannelRequest -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (VoiceChannelRequest -> VoiceChannelRequest -> Bool
(VoiceChannelRequest -> VoiceChannelRequest -> Bool)
-> (VoiceChannelRequest -> VoiceChannelRequest -> Bool)
-> Eq VoiceChannelRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VoiceChannelRequest -> VoiceChannelRequest -> Bool
$c/= :: VoiceChannelRequest -> VoiceChannelRequest -> Bool
== :: VoiceChannelRequest -> VoiceChannelRequest -> Bool
$c== :: VoiceChannelRequest -> VoiceChannelRequest -> Bool
Prelude.Eq, ReadPrec [VoiceChannelRequest]
ReadPrec VoiceChannelRequest
Int -> ReadS VoiceChannelRequest
ReadS [VoiceChannelRequest]
(Int -> ReadS VoiceChannelRequest)
-> ReadS [VoiceChannelRequest]
-> ReadPrec VoiceChannelRequest
-> ReadPrec [VoiceChannelRequest]
-> Read VoiceChannelRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VoiceChannelRequest]
$creadListPrec :: ReadPrec [VoiceChannelRequest]
readPrec :: ReadPrec VoiceChannelRequest
$creadPrec :: ReadPrec VoiceChannelRequest
readList :: ReadS [VoiceChannelRequest]
$creadList :: ReadS [VoiceChannelRequest]
readsPrec :: Int -> ReadS VoiceChannelRequest
$creadsPrec :: Int -> ReadS VoiceChannelRequest
Prelude.Read, Int -> VoiceChannelRequest -> ShowS
[VoiceChannelRequest] -> ShowS
VoiceChannelRequest -> String
(Int -> VoiceChannelRequest -> ShowS)
-> (VoiceChannelRequest -> String)
-> ([VoiceChannelRequest] -> ShowS)
-> Show VoiceChannelRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VoiceChannelRequest] -> ShowS
$cshowList :: [VoiceChannelRequest] -> ShowS
show :: VoiceChannelRequest -> String
$cshow :: VoiceChannelRequest -> String
showsPrec :: Int -> VoiceChannelRequest -> ShowS
$cshowsPrec :: Int -> VoiceChannelRequest -> ShowS
Prelude.Show, (forall x. VoiceChannelRequest -> Rep VoiceChannelRequest x)
-> (forall x. Rep VoiceChannelRequest x -> VoiceChannelRequest)
-> Generic VoiceChannelRequest
forall x. Rep VoiceChannelRequest x -> VoiceChannelRequest
forall x. VoiceChannelRequest -> Rep VoiceChannelRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VoiceChannelRequest x -> VoiceChannelRequest
$cfrom :: forall x. VoiceChannelRequest -> Rep VoiceChannelRequest x
Prelude.Generic)

-- |
-- Create a value of 'VoiceChannelRequest' 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:
--
-- 'enabled', 'voiceChannelRequest_enabled' - Specifies whether to enable the voice channel for the application.
newVoiceChannelRequest ::
  VoiceChannelRequest
newVoiceChannelRequest :: VoiceChannelRequest
newVoiceChannelRequest =
  VoiceChannelRequest' :: Maybe Bool -> VoiceChannelRequest
VoiceChannelRequest' {$sel:enabled:VoiceChannelRequest' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing}

-- | Specifies whether to enable the voice channel for the application.
voiceChannelRequest_enabled :: Lens.Lens' VoiceChannelRequest (Prelude.Maybe Prelude.Bool)
voiceChannelRequest_enabled :: (Maybe Bool -> f (Maybe Bool))
-> VoiceChannelRequest -> f VoiceChannelRequest
voiceChannelRequest_enabled = (VoiceChannelRequest -> Maybe Bool)
-> (VoiceChannelRequest -> Maybe Bool -> VoiceChannelRequest)
-> Lens
     VoiceChannelRequest VoiceChannelRequest (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VoiceChannelRequest' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:VoiceChannelRequest' :: VoiceChannelRequest -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: VoiceChannelRequest
s@VoiceChannelRequest' {} Maybe Bool
a -> VoiceChannelRequest
s {$sel:enabled:VoiceChannelRequest' :: Maybe Bool
enabled = Maybe Bool
a} :: VoiceChannelRequest)

instance Prelude.Hashable VoiceChannelRequest

instance Prelude.NFData VoiceChannelRequest

instance Core.ToJSON VoiceChannelRequest where
  toJSON :: VoiceChannelRequest -> Value
toJSON VoiceChannelRequest' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:VoiceChannelRequest' :: VoiceChannelRequest -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"Enabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enabled]
      )