{-# 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 #-}
module Amazonka.AlexaBusiness.Types.Audio where
import Amazonka.AlexaBusiness.Types.Locale
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Audio = Audio'
{
Audio -> Locale
locale :: Locale,
Audio -> Text
location :: Prelude.Text
}
deriving (Audio -> Audio -> Bool
(Audio -> Audio -> Bool) -> (Audio -> Audio -> Bool) -> Eq Audio
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Audio -> Audio -> Bool
$c/= :: Audio -> Audio -> Bool
== :: Audio -> Audio -> Bool
$c== :: Audio -> Audio -> Bool
Prelude.Eq, ReadPrec [Audio]
ReadPrec Audio
Int -> ReadS Audio
ReadS [Audio]
(Int -> ReadS Audio)
-> ReadS [Audio]
-> ReadPrec Audio
-> ReadPrec [Audio]
-> Read Audio
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Audio]
$creadListPrec :: ReadPrec [Audio]
readPrec :: ReadPrec Audio
$creadPrec :: ReadPrec Audio
readList :: ReadS [Audio]
$creadList :: ReadS [Audio]
readsPrec :: Int -> ReadS Audio
$creadsPrec :: Int -> ReadS Audio
Prelude.Read, Int -> Audio -> ShowS
[Audio] -> ShowS
Audio -> String
(Int -> Audio -> ShowS)
-> (Audio -> String) -> ([Audio] -> ShowS) -> Show Audio
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Audio] -> ShowS
$cshowList :: [Audio] -> ShowS
show :: Audio -> String
$cshow :: Audio -> String
showsPrec :: Int -> Audio -> ShowS
$cshowsPrec :: Int -> Audio -> ShowS
Prelude.Show, (forall x. Audio -> Rep Audio x)
-> (forall x. Rep Audio x -> Audio) -> Generic Audio
forall x. Rep Audio x -> Audio
forall x. Audio -> Rep Audio x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Audio x -> Audio
$cfrom :: forall x. Audio -> Rep Audio x
Prelude.Generic)
newAudio ::
Locale ->
Prelude.Text ->
Audio
newAudio :: Locale -> Text -> Audio
newAudio Locale
pLocale_ Text
pLocation_ =
Audio' :: Locale -> Text -> Audio
Audio' {$sel:locale:Audio' :: Locale
locale = Locale
pLocale_, $sel:location:Audio' :: Text
location = Text
pLocation_}
audio_locale :: Lens.Lens' Audio Locale
audio_locale :: (Locale -> f Locale) -> Audio -> f Audio
audio_locale = (Audio -> Locale)
-> (Audio -> Locale -> Audio) -> Lens Audio Audio Locale Locale
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Audio' {Locale
locale :: Locale
$sel:locale:Audio' :: Audio -> Locale
locale} -> Locale
locale) (\s :: Audio
s@Audio' {} Locale
a -> Audio
s {$sel:locale:Audio' :: Locale
locale = Locale
a} :: Audio)
audio_location :: Lens.Lens' Audio Prelude.Text
audio_location :: (Text -> f Text) -> Audio -> f Audio
audio_location = (Audio -> Text)
-> (Audio -> Text -> Audio) -> Lens Audio Audio Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Audio' {Text
location :: Text
$sel:location:Audio' :: Audio -> Text
location} -> Text
location) (\s :: Audio
s@Audio' {} Text
a -> Audio
s {$sel:location:Audio' :: Text
location = Text
a} :: Audio)
instance Prelude.Hashable Audio
instance Prelude.NFData Audio
instance Core.ToJSON Audio where
toJSON :: Audio -> Value
toJSON Audio' {Text
Locale
location :: Text
locale :: Locale
$sel:location:Audio' :: Audio -> Text
$sel:locale:Audio' :: Audio -> Locale
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Locale" Text -> Locale -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Locale
locale),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Location" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
location)
]
)