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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 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,
    -- | The description of the smart home appliance.
    SmartHomeAppliance -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (SmartHomeAppliance -> SmartHomeAppliance -> Bool
(SmartHomeAppliance -> SmartHomeAppliance -> Bool)
-> (SmartHomeAppliance -> SmartHomeAppliance -> Bool)
-> Eq SmartHomeAppliance
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]
(Int -> ReadS SmartHomeAppliance)
-> ReadS [SmartHomeAppliance]
-> ReadPrec SmartHomeAppliance
-> ReadPrec [SmartHomeAppliance]
-> Read 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
(Int -> SmartHomeAppliance -> ShowS)
-> (SmartHomeAppliance -> String)
-> ([SmartHomeAppliance] -> ShowS)
-> Show SmartHomeAppliance
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. SmartHomeAppliance -> Rep SmartHomeAppliance x)
-> (forall x. Rep SmartHomeAppliance x -> SmartHomeAppliance)
-> Generic SmartHomeAppliance
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:
--
-- 'friendlyName', 'smartHomeAppliance_friendlyName' - The friendly name of the smart home appliance.
--
-- 'manufacturerName', 'smartHomeAppliance_manufacturerName' - The name of the manufacturer of the smart home appliance.
--
-- 'description', 'smartHomeAppliance_description' - The description of the smart home appliance.
newSmartHomeAppliance ::
  SmartHomeAppliance
newSmartHomeAppliance :: SmartHomeAppliance
newSmartHomeAppliance =
  SmartHomeAppliance' :: Maybe Text -> Maybe Text -> Maybe Text -> SmartHomeAppliance
SmartHomeAppliance'
    { $sel:friendlyName:SmartHomeAppliance' :: Maybe Text
friendlyName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:manufacturerName:SmartHomeAppliance' :: Maybe Text
manufacturerName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:SmartHomeAppliance' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The friendly name of the smart home appliance.
smartHomeAppliance_friendlyName :: Lens.Lens' SmartHomeAppliance (Prelude.Maybe Prelude.Text)
smartHomeAppliance_friendlyName :: (Maybe Text -> f (Maybe Text))
-> SmartHomeAppliance -> f SmartHomeAppliance
smartHomeAppliance_friendlyName = (SmartHomeAppliance -> Maybe Text)
-> (SmartHomeAppliance -> Maybe Text -> SmartHomeAppliance)
-> Lens
     SmartHomeAppliance SmartHomeAppliance (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> SmartHomeAppliance -> f SmartHomeAppliance
smartHomeAppliance_manufacturerName = (SmartHomeAppliance -> Maybe Text)
-> (SmartHomeAppliance -> Maybe Text -> SmartHomeAppliance)
-> Lens
     SmartHomeAppliance SmartHomeAppliance (Maybe Text) (Maybe Text)
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)

-- | The description of the smart home appliance.
smartHomeAppliance_description :: Lens.Lens' SmartHomeAppliance (Prelude.Maybe Prelude.Text)
smartHomeAppliance_description :: (Maybe Text -> f (Maybe Text))
-> SmartHomeAppliance -> f SmartHomeAppliance
smartHomeAppliance_description = (SmartHomeAppliance -> Maybe Text)
-> (SmartHomeAppliance -> Maybe Text -> SmartHomeAppliance)
-> Lens
     SmartHomeAppliance SmartHomeAppliance (Maybe Text) (Maybe Text)
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)

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

instance Prelude.Hashable SmartHomeAppliance

instance Prelude.NFData SmartHomeAppliance