{-# 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.SmartHomeAppliance where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SmartHomeAppliance = SmartHomeAppliance'
{
SmartHomeAppliance -> Maybe Text
friendlyName :: Prelude.Maybe Prelude.Text,
SmartHomeAppliance -> Maybe Text
manufacturerName :: Prelude.Maybe Prelude.Text,
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)
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
}
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)
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)
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