{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

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

-- | The address of a room profile.
profileData_address :: Lens.Lens' ProfileData (Prelude.Maybe Prelude.Text)
profileData_address :: Lens' ProfileData (Maybe Text)
profileData_address = 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 distance unit of a room profile.
profileData_distanceUnit :: Lens.Lens' ProfileData (Prelude.Maybe DistanceUnit)
profileData_distanceUnit :: Lens' ProfileData (Maybe DistanceUnit)
profileData_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)

-- | Retrieves if the profile data is default or not.
profileData_isDefault :: Lens.Lens' ProfileData (Prelude.Maybe Prelude.Bool)
profileData_isDefault :: Lens' ProfileData (Maybe Bool)
profileData_isDefault = 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)

-- | 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 :: Lens' ProfileData (Maybe Text)
profileData_locale = 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 ARN of a room profile.
profileData_profileArn :: Lens.Lens' ProfileData (Prelude.Maybe Prelude.Text)
profileData_profileArn :: Lens' ProfileData (Maybe Text)
profileData_profileArn = 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 name of a room profile.
profileData_profileName :: Lens.Lens' ProfileData (Prelude.Maybe Prelude.Text)
profileData_profileName :: Lens' ProfileData (Maybe Text)
profileData_profileName = 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 :: Lens' ProfileData (Maybe TemperatureUnit)
profileData_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 :: Lens' ProfileData (Maybe Text)
profileData_timezone = 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)

-- | The wake word of a room profile.
profileData_wakeWord :: Lens.Lens' ProfileData (Prelude.Maybe WakeWord)
profileData_wakeWord :: Lens' ProfileData (Maybe WakeWord)
profileData_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)

instance Data.FromJSON ProfileData where
  parseJSON :: Value -> Parser ProfileData
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ProfileData"
      ( \Object
x ->
          Maybe Text
-> Maybe DistanceUnit
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe TemperatureUnit
-> Maybe Text
-> Maybe WakeWord
-> ProfileData
ProfileData'
            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
"Address")
            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
"DistanceUnit")
            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
"IsDefault")
            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
"Locale")
            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
"ProfileArn")
            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
"ProfileName")
            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
"TemperatureUnit")
            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
"Timezone")
            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
"WakeWord")
      )

instance Prelude.Hashable ProfileData where
  hashWithSalt :: Int -> ProfileData -> Int
hashWithSalt Int
_salt ProfileData' {Maybe Bool
Maybe Text
Maybe DistanceUnit
Maybe TemperatureUnit
Maybe WakeWord
wakeWord :: Maybe WakeWord
timezone :: Maybe Text
temperatureUnit :: Maybe TemperatureUnit
profileName :: Maybe Text
profileArn :: Maybe Text
locale :: Maybe Text
isDefault :: Maybe Bool
distanceUnit :: Maybe DistanceUnit
address :: Maybe Text
$sel:wakeWord:ProfileData' :: ProfileData -> Maybe WakeWord
$sel:timezone:ProfileData' :: ProfileData -> Maybe Text
$sel:temperatureUnit:ProfileData' :: ProfileData -> Maybe TemperatureUnit
$sel:profileName:ProfileData' :: ProfileData -> Maybe Text
$sel:profileArn:ProfileData' :: ProfileData -> Maybe Text
$sel:locale:ProfileData' :: ProfileData -> Maybe Text
$sel:isDefault:ProfileData' :: ProfileData -> Maybe Bool
$sel:distanceUnit:ProfileData' :: ProfileData -> Maybe DistanceUnit
$sel:address:ProfileData' :: ProfileData -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
address
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DistanceUnit
distanceUnit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isDefault
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
locale
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
profileArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
profileName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TemperatureUnit
temperatureUnit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
timezone
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WakeWord
wakeWord

instance Prelude.NFData ProfileData where
  rnf :: ProfileData -> ()
rnf ProfileData' {Maybe Bool
Maybe Text
Maybe DistanceUnit
Maybe TemperatureUnit
Maybe WakeWord
wakeWord :: Maybe WakeWord
timezone :: Maybe Text
temperatureUnit :: Maybe TemperatureUnit
profileName :: Maybe Text
profileArn :: Maybe Text
locale :: Maybe Text
isDefault :: Maybe Bool
distanceUnit :: Maybe DistanceUnit
address :: Maybe Text
$sel:wakeWord:ProfileData' :: ProfileData -> Maybe WakeWord
$sel:timezone:ProfileData' :: ProfileData -> Maybe Text
$sel:temperatureUnit:ProfileData' :: ProfileData -> Maybe TemperatureUnit
$sel:profileName:ProfileData' :: ProfileData -> Maybe Text
$sel:profileArn:ProfileData' :: ProfileData -> Maybe Text
$sel:locale:ProfileData' :: ProfileData -> Maybe Text
$sel:isDefault:ProfileData' :: ProfileData -> Maybe Bool
$sel:distanceUnit:ProfileData' :: ProfileData -> Maybe DistanceUnit
$sel:address:ProfileData' :: ProfileData -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
address
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DistanceUnit
distanceUnit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isDefault
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
locale
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
profileArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
profileName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TemperatureUnit
temperatureUnit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
timezone
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WakeWord
wakeWord