{-# 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.AlexaBusiness.Types.ProfileData
-- 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.AlexaBusiness.Types.ProfileData where

import Amazonka.AlexaBusiness.Types.DistanceUnit
import Amazonka.AlexaBusiness.Types.TemperatureUnit
import Amazonka.AlexaBusiness.Types.WakeWord
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The data of a room profile.
--
-- /See:/ 'newProfileData' smart constructor.
data ProfileData = ProfileData'
  { -- | The distance unit of a room profile.
    ProfileData -> Maybe DistanceUnit
distanceUnit :: Prelude.Maybe DistanceUnit,
    -- | The locale of a room profile. (This is currently available only to a
    -- limited preview audience.)
    ProfileData -> Maybe Text
locale :: Prelude.Maybe Prelude.Text,
    -- | The address of a room profile.
    ProfileData -> Maybe Text
address :: Prelude.Maybe Prelude.Text,
    -- | The ARN of a room profile.
    ProfileData -> Maybe Text
profileArn :: Prelude.Maybe Prelude.Text,
    -- | The wake word of a room profile.
    ProfileData -> Maybe WakeWord
wakeWord :: Prelude.Maybe WakeWord,
    -- | The name of a room profile.
    ProfileData -> Maybe Text
profileName :: Prelude.Maybe Prelude.Text,
    -- | The temperature unit of a room profile.
    ProfileData -> Maybe TemperatureUnit
temperatureUnit :: Prelude.Maybe TemperatureUnit,
    -- | The time zone of a room profile.
    ProfileData -> Maybe Text
timezone :: Prelude.Maybe Prelude.Text,
    -- | Retrieves if the profile data is default or not.
    ProfileData -> Maybe Bool
isDefault :: Prelude.Maybe Prelude.Bool
  }
  deriving (ProfileData -> ProfileData -> Bool
(ProfileData -> ProfileData -> Bool)
-> (ProfileData -> ProfileData -> Bool) -> Eq ProfileData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProfileData -> ProfileData -> Bool
$c/= :: ProfileData -> ProfileData -> Bool
== :: ProfileData -> ProfileData -> Bool
$c== :: ProfileData -> ProfileData -> Bool
Prelude.Eq, ReadPrec [ProfileData]
ReadPrec ProfileData
Int -> ReadS ProfileData
ReadS [ProfileData]
(Int -> ReadS ProfileData)
-> ReadS [ProfileData]
-> ReadPrec ProfileData
-> ReadPrec [ProfileData]
-> Read ProfileData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProfileData]
$creadListPrec :: ReadPrec [ProfileData]
readPrec :: ReadPrec ProfileData
$creadPrec :: ReadPrec ProfileData
readList :: ReadS [ProfileData]
$creadList :: ReadS [ProfileData]
readsPrec :: Int -> ReadS ProfileData
$creadsPrec :: Int -> ReadS ProfileData
Prelude.Read, Int -> ProfileData -> ShowS
[ProfileData] -> ShowS
ProfileData -> String
(Int -> ProfileData -> ShowS)
-> (ProfileData -> String)
-> ([ProfileData] -> ShowS)
-> Show ProfileData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProfileData] -> ShowS
$cshowList :: [ProfileData] -> ShowS
show :: ProfileData -> String
$cshow :: ProfileData -> String
showsPrec :: Int -> ProfileData -> ShowS
$cshowsPrec :: Int -> ProfileData -> ShowS
Prelude.Show, (forall x. ProfileData -> Rep ProfileData x)
-> (forall x. Rep ProfileData x -> ProfileData)
-> Generic ProfileData
forall x. Rep ProfileData x -> ProfileData
forall x. ProfileData -> Rep ProfileData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProfileData x -> ProfileData
$cfrom :: forall x. ProfileData -> Rep ProfileData x
Prelude.Generic)

-- |
-- Create a value of 'ProfileData' 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:
--
-- 'distanceUnit', 'profileData_distanceUnit' - The distance unit of a room profile.
--
-- 'locale', 'profileData_locale' - The locale of a room profile. (This is currently available only to a
-- limited preview audience.)
--
-- 'address', 'profileData_address' - The address of a room profile.
--
-- 'profileArn', 'profileData_profileArn' - The ARN of a room profile.
--
-- 'wakeWord', 'profileData_wakeWord' - The wake word of a room profile.
--
-- 'profileName', 'profileData_profileName' - The name of a room profile.
--
-- 'temperatureUnit', 'profileData_temperatureUnit' - The temperature unit of a room profile.
--
-- 'timezone', 'profileData_timezone' - The time zone of a room profile.
--
-- 'isDefault', 'profileData_isDefault' - Retrieves if the profile data is default or not.
newProfileData ::
  ProfileData
newProfileData :: ProfileData
newProfileData =
  ProfileData' :: Maybe DistanceUnit
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe WakeWord
-> Maybe Text
-> Maybe TemperatureUnit
-> Maybe Text
-> Maybe Bool
-> ProfileData
ProfileData'
    { $sel:distanceUnit:ProfileData' :: Maybe DistanceUnit
distanceUnit = Maybe DistanceUnit
forall a. Maybe a
Prelude.Nothing,
      $sel:locale:ProfileData' :: Maybe Text
locale = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:address:ProfileData' :: Maybe Text
address = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:profileArn:ProfileData' :: Maybe Text
profileArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:wakeWord:ProfileData' :: Maybe WakeWord
wakeWord = Maybe WakeWord
forall a. Maybe a
Prelude.Nothing,
      $sel:profileName:ProfileData' :: Maybe Text
profileName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:temperatureUnit:ProfileData' :: Maybe TemperatureUnit
temperatureUnit = Maybe TemperatureUnit
forall a. Maybe a
Prelude.Nothing,
      $sel:timezone:ProfileData' :: Maybe Text
timezone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isDefault:ProfileData' :: Maybe Bool
isDefault = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | The distance unit of a room profile.
profileData_distanceUnit :: Lens.Lens' ProfileData (Prelude.Maybe DistanceUnit)
profileData_distanceUnit :: (Maybe DistanceUnit -> f (Maybe DistanceUnit))
-> ProfileData -> f ProfileData
profileData_distanceUnit = (ProfileData -> Maybe DistanceUnit)
-> (ProfileData -> Maybe DistanceUnit -> ProfileData)
-> Lens
     ProfileData ProfileData (Maybe DistanceUnit) (Maybe DistanceUnit)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfileData' {Maybe DistanceUnit
distanceUnit :: Maybe DistanceUnit
$sel:distanceUnit:ProfileData' :: ProfileData -> Maybe DistanceUnit
distanceUnit} -> Maybe DistanceUnit
distanceUnit) (\s :: ProfileData
s@ProfileData' {} Maybe DistanceUnit
a -> ProfileData
s {$sel:distanceUnit:ProfileData' :: Maybe DistanceUnit
distanceUnit = Maybe DistanceUnit
a} :: ProfileData)

-- | The locale of a room profile. (This is currently available only to a
-- limited preview audience.)
profileData_locale :: Lens.Lens' ProfileData (Prelude.Maybe Prelude.Text)
profileData_locale :: (Maybe Text -> f (Maybe Text)) -> ProfileData -> f ProfileData
profileData_locale = (ProfileData -> Maybe Text)
-> (ProfileData -> Maybe Text -> ProfileData)
-> Lens ProfileData ProfileData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfileData' {Maybe Text
locale :: Maybe Text
$sel:locale:ProfileData' :: ProfileData -> Maybe Text
locale} -> Maybe Text
locale) (\s :: ProfileData
s@ProfileData' {} Maybe Text
a -> ProfileData
s {$sel:locale:ProfileData' :: Maybe Text
locale = Maybe Text
a} :: ProfileData)

-- | The address of a room profile.
profileData_address :: Lens.Lens' ProfileData (Prelude.Maybe Prelude.Text)
profileData_address :: (Maybe Text -> f (Maybe Text)) -> ProfileData -> f ProfileData
profileData_address = (ProfileData -> Maybe Text)
-> (ProfileData -> Maybe Text -> ProfileData)
-> Lens ProfileData ProfileData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfileData' {Maybe Text
address :: Maybe Text
$sel:address:ProfileData' :: ProfileData -> Maybe Text
address} -> Maybe Text
address) (\s :: ProfileData
s@ProfileData' {} Maybe Text
a -> ProfileData
s {$sel:address:ProfileData' :: Maybe Text
address = Maybe Text
a} :: ProfileData)

-- | The ARN of a room profile.
profileData_profileArn :: Lens.Lens' ProfileData (Prelude.Maybe Prelude.Text)
profileData_profileArn :: (Maybe Text -> f (Maybe Text)) -> ProfileData -> f ProfileData
profileData_profileArn = (ProfileData -> Maybe Text)
-> (ProfileData -> Maybe Text -> ProfileData)
-> Lens ProfileData ProfileData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfileData' {Maybe Text
profileArn :: Maybe Text
$sel:profileArn:ProfileData' :: ProfileData -> Maybe Text
profileArn} -> Maybe Text
profileArn) (\s :: ProfileData
s@ProfileData' {} Maybe Text
a -> ProfileData
s {$sel:profileArn:ProfileData' :: Maybe Text
profileArn = Maybe Text
a} :: ProfileData)

-- | The wake word of a room profile.
profileData_wakeWord :: Lens.Lens' ProfileData (Prelude.Maybe WakeWord)
profileData_wakeWord :: (Maybe WakeWord -> f (Maybe WakeWord))
-> ProfileData -> f ProfileData
profileData_wakeWord = (ProfileData -> Maybe WakeWord)
-> (ProfileData -> Maybe WakeWord -> ProfileData)
-> Lens ProfileData ProfileData (Maybe WakeWord) (Maybe WakeWord)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfileData' {Maybe WakeWord
wakeWord :: Maybe WakeWord
$sel:wakeWord:ProfileData' :: ProfileData -> Maybe WakeWord
wakeWord} -> Maybe WakeWord
wakeWord) (\s :: ProfileData
s@ProfileData' {} Maybe WakeWord
a -> ProfileData
s {$sel:wakeWord:ProfileData' :: Maybe WakeWord
wakeWord = Maybe WakeWord
a} :: ProfileData)

-- | The name of a room profile.
profileData_profileName :: Lens.Lens' ProfileData (Prelude.Maybe Prelude.Text)
profileData_profileName :: (Maybe Text -> f (Maybe Text)) -> ProfileData -> f ProfileData
profileData_profileName = (ProfileData -> Maybe Text)
-> (ProfileData -> Maybe Text -> ProfileData)
-> Lens ProfileData ProfileData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfileData' {Maybe Text
profileName :: Maybe Text
$sel:profileName:ProfileData' :: ProfileData -> Maybe Text
profileName} -> Maybe Text
profileName) (\s :: ProfileData
s@ProfileData' {} Maybe Text
a -> ProfileData
s {$sel:profileName:ProfileData' :: Maybe Text
profileName = Maybe Text
a} :: ProfileData)

-- | The temperature unit of a room profile.
profileData_temperatureUnit :: Lens.Lens' ProfileData (Prelude.Maybe TemperatureUnit)
profileData_temperatureUnit :: (Maybe TemperatureUnit -> f (Maybe TemperatureUnit))
-> ProfileData -> f ProfileData
profileData_temperatureUnit = (ProfileData -> Maybe TemperatureUnit)
-> (ProfileData -> Maybe TemperatureUnit -> ProfileData)
-> Lens
     ProfileData
     ProfileData
     (Maybe TemperatureUnit)
     (Maybe TemperatureUnit)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfileData' {Maybe TemperatureUnit
temperatureUnit :: Maybe TemperatureUnit
$sel:temperatureUnit:ProfileData' :: ProfileData -> Maybe TemperatureUnit
temperatureUnit} -> Maybe TemperatureUnit
temperatureUnit) (\s :: ProfileData
s@ProfileData' {} Maybe TemperatureUnit
a -> ProfileData
s {$sel:temperatureUnit:ProfileData' :: Maybe TemperatureUnit
temperatureUnit = Maybe TemperatureUnit
a} :: ProfileData)

-- | The time zone of a room profile.
profileData_timezone :: Lens.Lens' ProfileData (Prelude.Maybe Prelude.Text)
profileData_timezone :: (Maybe Text -> f (Maybe Text)) -> ProfileData -> f ProfileData
profileData_timezone = (ProfileData -> Maybe Text)
-> (ProfileData -> Maybe Text -> ProfileData)
-> Lens ProfileData ProfileData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfileData' {Maybe Text
timezone :: Maybe Text
$sel:timezone:ProfileData' :: ProfileData -> Maybe Text
timezone} -> Maybe Text
timezone) (\s :: ProfileData
s@ProfileData' {} Maybe Text
a -> ProfileData
s {$sel:timezone:ProfileData' :: Maybe Text
timezone = Maybe Text
a} :: ProfileData)

-- | Retrieves if the profile data is default or not.
profileData_isDefault :: Lens.Lens' ProfileData (Prelude.Maybe Prelude.Bool)
profileData_isDefault :: (Maybe Bool -> f (Maybe Bool)) -> ProfileData -> f ProfileData
profileData_isDefault = (ProfileData -> Maybe Bool)
-> (ProfileData -> Maybe Bool -> ProfileData)
-> Lens ProfileData ProfileData (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfileData' {Maybe Bool
isDefault :: Maybe Bool
$sel:isDefault:ProfileData' :: ProfileData -> Maybe Bool
isDefault} -> Maybe Bool
isDefault) (\s :: ProfileData
s@ProfileData' {} Maybe Bool
a -> ProfileData
s {$sel:isDefault:ProfileData' :: Maybe Bool
isDefault = Maybe Bool
a} :: ProfileData)

instance Core.FromJSON ProfileData where
  parseJSON :: Value -> Parser ProfileData
parseJSON =
    String
-> (Object -> Parser ProfileData) -> Value -> Parser ProfileData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ProfileData"
      ( \Object
x ->
          Maybe DistanceUnit
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe WakeWord
-> Maybe Text
-> Maybe TemperatureUnit
-> Maybe Text
-> Maybe Bool
-> ProfileData
ProfileData'
            (Maybe DistanceUnit
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe WakeWord
 -> Maybe Text
 -> Maybe TemperatureUnit
 -> Maybe Text
 -> Maybe Bool
 -> ProfileData)
-> Parser (Maybe DistanceUnit)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe WakeWord
      -> Maybe Text
      -> Maybe TemperatureUnit
      -> Maybe Text
      -> Maybe Bool
      -> ProfileData)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe DistanceUnit)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DistanceUnit")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe WakeWord
   -> Maybe Text
   -> Maybe TemperatureUnit
   -> Maybe Text
   -> Maybe Bool
   -> ProfileData)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe WakeWord
      -> Maybe Text
      -> Maybe TemperatureUnit
      -> Maybe Text
      -> Maybe Bool
      -> ProfileData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Locale")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe WakeWord
   -> Maybe Text
   -> Maybe TemperatureUnit
   -> Maybe Text
   -> Maybe Bool
   -> ProfileData)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe WakeWord
      -> Maybe Text
      -> Maybe TemperatureUnit
      -> Maybe Text
      -> Maybe Bool
      -> ProfileData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Address")
            Parser
  (Maybe Text
   -> Maybe WakeWord
   -> Maybe Text
   -> Maybe TemperatureUnit
   -> Maybe Text
   -> Maybe Bool
   -> ProfileData)
-> Parser (Maybe Text)
-> Parser
     (Maybe WakeWord
      -> Maybe Text
      -> Maybe TemperatureUnit
      -> Maybe Text
      -> Maybe Bool
      -> ProfileData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProfileArn")
            Parser
  (Maybe WakeWord
   -> Maybe Text
   -> Maybe TemperatureUnit
   -> Maybe Text
   -> Maybe Bool
   -> ProfileData)
-> Parser (Maybe WakeWord)
-> Parser
     (Maybe Text
      -> Maybe TemperatureUnit
      -> Maybe Text
      -> Maybe Bool
      -> ProfileData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe WakeWord)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WakeWord")
            Parser
  (Maybe Text
   -> Maybe TemperatureUnit
   -> Maybe Text
   -> Maybe Bool
   -> ProfileData)
-> Parser (Maybe Text)
-> Parser
     (Maybe TemperatureUnit -> Maybe Text -> Maybe Bool -> ProfileData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProfileName")
            Parser
  (Maybe TemperatureUnit -> Maybe Text -> Maybe Bool -> ProfileData)
-> Parser (Maybe TemperatureUnit)
-> Parser (Maybe Text -> Maybe Bool -> ProfileData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TemperatureUnit)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TemperatureUnit")
            Parser (Maybe Text -> Maybe Bool -> ProfileData)
-> Parser (Maybe Text) -> Parser (Maybe Bool -> ProfileData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Timezone")
            Parser (Maybe Bool -> ProfileData)
-> Parser (Maybe Bool) -> Parser ProfileData
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IsDefault")
      )

instance Prelude.Hashable ProfileData

instance Prelude.NFData ProfileData