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

-- | A smart home appliance that can connect to a central system. Any
-- domestic device can be a smart appliance.
--
-- /See:/ 'newSmartHomeAppliance' smart constructor.
data SmartHomeAppliance = SmartHomeAppliance'
  { -- | The description of the smart home appliance.
    SmartHomeAppliance -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The friendly name of the smart home appliance.
    SmartHomeAppliance -> Maybe Text
friendlyName :: Prelude.Maybe Prelude.Text,
    -- | The name of the manufacturer of the smart home appliance.
    SmartHomeAppliance -> Maybe Text
manufacturerName :: Prelude.Maybe Prelude.Text
  }
  deriving (SmartHomeAppliance -> SmartHomeAppliance -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SmartHomeAppliance -> SmartHomeAppliance -> Bool
$c/= :: SmartHomeAppliance -> SmartHomeAppliance -> Bool
== :: SmartHomeAppliance -> SmartHomeAppliance -> Bool
$c== :: SmartHomeAppliance -> SmartHomeAppliance -> Bool
Prelude.Eq, ReadPrec [SmartHomeAppliance]
ReadPrec SmartHomeAppliance
Int -> ReadS SmartHomeAppliance
ReadS [SmartHomeAppliance]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SmartHomeAppliance]
$creadListPrec :: ReadPrec [SmartHomeAppliance]
readPrec :: ReadPrec SmartHomeAppliance
$creadPrec :: ReadPrec SmartHomeAppliance
readList :: ReadS [SmartHomeAppliance]
$creadList :: ReadS [SmartHomeAppliance]
readsPrec :: Int -> ReadS SmartHomeAppliance
$creadsPrec :: Int -> ReadS SmartHomeAppliance
Prelude.Read, Int -> SmartHomeAppliance -> ShowS
[SmartHomeAppliance] -> ShowS
SmartHomeAppliance -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SmartHomeAppliance] -> ShowS
$cshowList :: [SmartHomeAppliance] -> ShowS
show :: SmartHomeAppliance -> String
$cshow :: SmartHomeAppliance -> String
showsPrec :: Int -> SmartHomeAppliance -> ShowS
$cshowsPrec :: Int -> SmartHomeAppliance -> ShowS
Prelude.Show, forall x. Rep SmartHomeAppliance x -> SmartHomeAppliance
forall x. SmartHomeAppliance -> Rep SmartHomeAppliance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SmartHomeAppliance x -> SmartHomeAppliance
$cfrom :: forall x. SmartHomeAppliance -> Rep SmartHomeAppliance x
Prelude.Generic)

-- |
-- Create a value of 'SmartHomeAppliance' 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:
--
-- 'description', 'smartHomeAppliance_description' - The description of the smart home appliance.
--
-- 'friendlyName', 'smartHomeAppliance_friendlyName' - The friendly name of the smart home appliance.
--
-- 'manufacturerName', 'smartHomeAppliance_manufacturerName' - The name of the manufacturer of the smart home appliance.
newSmartHomeAppliance ::
  SmartHomeAppliance
newSmartHomeAppliance :: SmartHomeAppliance
newSmartHomeAppliance =
  SmartHomeAppliance'
    { $sel:description:SmartHomeAppliance' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:friendlyName:SmartHomeAppliance' :: Maybe Text
friendlyName = forall a. Maybe a
Prelude.Nothing,
      $sel:manufacturerName:SmartHomeAppliance' :: Maybe Text
manufacturerName = forall a. Maybe a
Prelude.Nothing
    }

-- | The description of the smart home appliance.
smartHomeAppliance_description :: Lens.Lens' SmartHomeAppliance (Prelude.Maybe Prelude.Text)
smartHomeAppliance_description :: Lens' SmartHomeAppliance (Maybe Text)
smartHomeAppliance_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SmartHomeAppliance' {Maybe Text
description :: Maybe Text
$sel:description:SmartHomeAppliance' :: SmartHomeAppliance -> Maybe Text
description} -> Maybe Text
description) (\s :: SmartHomeAppliance
s@SmartHomeAppliance' {} Maybe Text
a -> SmartHomeAppliance
s {$sel:description:SmartHomeAppliance' :: Maybe Text
description = Maybe Text
a} :: SmartHomeAppliance)

-- | The friendly name of the smart home appliance.
smartHomeAppliance_friendlyName :: Lens.Lens' SmartHomeAppliance (Prelude.Maybe Prelude.Text)
smartHomeAppliance_friendlyName :: Lens' SmartHomeAppliance (Maybe Text)
smartHomeAppliance_friendlyName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SmartHomeAppliance' {Maybe Text
friendlyName :: Maybe Text
$sel:friendlyName:SmartHomeAppliance' :: SmartHomeAppliance -> Maybe Text
friendlyName} -> Maybe Text
friendlyName) (\s :: SmartHomeAppliance
s@SmartHomeAppliance' {} Maybe Text
a -> SmartHomeAppliance
s {$sel:friendlyName:SmartHomeAppliance' :: Maybe Text
friendlyName = Maybe Text
a} :: SmartHomeAppliance)

-- | The name of the manufacturer of the smart home appliance.
smartHomeAppliance_manufacturerName :: Lens.Lens' SmartHomeAppliance (Prelude.Maybe Prelude.Text)
smartHomeAppliance_manufacturerName :: Lens' SmartHomeAppliance (Maybe Text)
smartHomeAppliance_manufacturerName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SmartHomeAppliance' {Maybe Text
manufacturerName :: Maybe Text
$sel:manufacturerName:SmartHomeAppliance' :: SmartHomeAppliance -> Maybe Text
manufacturerName} -> Maybe Text
manufacturerName) (\s :: SmartHomeAppliance
s@SmartHomeAppliance' {} Maybe Text
a -> SmartHomeAppliance
s {$sel:manufacturerName:SmartHomeAppliance' :: Maybe Text
manufacturerName = Maybe Text
a} :: SmartHomeAppliance)

instance Data.FromJSON SmartHomeAppliance where
  parseJSON :: Value -> Parser SmartHomeAppliance
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SmartHomeAppliance"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> SmartHomeAppliance
SmartHomeAppliance'
            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
"Description")
            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
"FriendlyName")
            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
"ManufacturerName")
      )

instance Prelude.Hashable SmartHomeAppliance where
  hashWithSalt :: Int -> SmartHomeAppliance -> Int
hashWithSalt Int
_salt SmartHomeAppliance' {Maybe Text
manufacturerName :: Maybe Text
friendlyName :: Maybe Text
description :: Maybe Text
$sel:manufacturerName:SmartHomeAppliance' :: SmartHomeAppliance -> Maybe Text
$sel:friendlyName:SmartHomeAppliance' :: SmartHomeAppliance -> Maybe Text
$sel:description:SmartHomeAppliance' :: SmartHomeAppliance -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
friendlyName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
manufacturerName

instance Prelude.NFData SmartHomeAppliance where
  rnf :: SmartHomeAppliance -> ()
rnf SmartHomeAppliance' {Maybe Text
manufacturerName :: Maybe Text
friendlyName :: Maybe Text
description :: Maybe Text
$sel:manufacturerName:SmartHomeAppliance' :: SmartHomeAppliance -> Maybe Text
$sel:friendlyName:SmartHomeAppliance' :: SmartHomeAppliance -> Maybe Text
$sel:description:SmartHomeAppliance' :: SmartHomeAppliance -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
friendlyName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
manufacturerName