{-# 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.Device where
import Amazonka.AlexaBusiness.Types.DeviceNetworkProfileInfo
import Amazonka.AlexaBusiness.Types.DeviceStatus
import Amazonka.AlexaBusiness.Types.DeviceStatusInfo
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Device = Device'
{
Device -> Maybe DeviceStatus
deviceStatus :: Prelude.Maybe DeviceStatus,
Device -> Maybe DeviceStatusInfo
deviceStatusInfo :: Prelude.Maybe DeviceStatusInfo,
Device -> Maybe Text
deviceArn :: Prelude.Maybe Prelude.Text,
Device -> Maybe Text
macAddress :: Prelude.Maybe Prelude.Text,
Device -> Maybe Text
deviceName :: Prelude.Maybe Prelude.Text,
Device -> Maybe Text
roomArn :: Prelude.Maybe Prelude.Text,
Device -> Maybe Text
softwareVersion :: Prelude.Maybe Prelude.Text,
Device -> Maybe Text
deviceType :: Prelude.Maybe Prelude.Text,
Device -> Maybe DeviceNetworkProfileInfo
networkProfileInfo :: Prelude.Maybe DeviceNetworkProfileInfo,
Device -> Maybe Text
deviceSerialNumber :: Prelude.Maybe Prelude.Text
}
deriving (Device -> Device -> Bool
(Device -> Device -> Bool)
-> (Device -> Device -> Bool) -> Eq Device
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Device -> Device -> Bool
$c/= :: Device -> Device -> Bool
== :: Device -> Device -> Bool
$c== :: Device -> Device -> Bool
Prelude.Eq, ReadPrec [Device]
ReadPrec Device
Int -> ReadS Device
ReadS [Device]
(Int -> ReadS Device)
-> ReadS [Device]
-> ReadPrec Device
-> ReadPrec [Device]
-> Read Device
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Device]
$creadListPrec :: ReadPrec [Device]
readPrec :: ReadPrec Device
$creadPrec :: ReadPrec Device
readList :: ReadS [Device]
$creadList :: ReadS [Device]
readsPrec :: Int -> ReadS Device
$creadsPrec :: Int -> ReadS Device
Prelude.Read, Int -> Device -> ShowS
[Device] -> ShowS
Device -> String
(Int -> Device -> ShowS)
-> (Device -> String) -> ([Device] -> ShowS) -> Show Device
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Device] -> ShowS
$cshowList :: [Device] -> ShowS
show :: Device -> String
$cshow :: Device -> String
showsPrec :: Int -> Device -> ShowS
$cshowsPrec :: Int -> Device -> ShowS
Prelude.Show, (forall x. Device -> Rep Device x)
-> (forall x. Rep Device x -> Device) -> Generic Device
forall x. Rep Device x -> Device
forall x. Device -> Rep Device x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Device x -> Device
$cfrom :: forall x. Device -> Rep Device x
Prelude.Generic)
newDevice ::
Device
newDevice :: Device
newDevice =
Device' :: Maybe DeviceStatus
-> Maybe DeviceStatusInfo
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DeviceNetworkProfileInfo
-> Maybe Text
-> Device
Device'
{ $sel:deviceStatus:Device' :: Maybe DeviceStatus
deviceStatus = Maybe DeviceStatus
forall a. Maybe a
Prelude.Nothing,
$sel:deviceStatusInfo:Device' :: Maybe DeviceStatusInfo
deviceStatusInfo = Maybe DeviceStatusInfo
forall a. Maybe a
Prelude.Nothing,
$sel:deviceArn:Device' :: Maybe Text
deviceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:macAddress:Device' :: Maybe Text
macAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deviceName:Device' :: Maybe Text
deviceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:roomArn:Device' :: Maybe Text
roomArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:softwareVersion:Device' :: Maybe Text
softwareVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deviceType:Device' :: Maybe Text
deviceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:networkProfileInfo:Device' :: Maybe DeviceNetworkProfileInfo
networkProfileInfo = Maybe DeviceNetworkProfileInfo
forall a. Maybe a
Prelude.Nothing,
$sel:deviceSerialNumber:Device' :: Maybe Text
deviceSerialNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
device_deviceStatus :: Lens.Lens' Device (Prelude.Maybe DeviceStatus)
device_deviceStatus :: (Maybe DeviceStatus -> f (Maybe DeviceStatus))
-> Device -> f Device
device_deviceStatus = (Device -> Maybe DeviceStatus)
-> (Device -> Maybe DeviceStatus -> Device)
-> Lens Device Device (Maybe DeviceStatus) (Maybe DeviceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe DeviceStatus
deviceStatus :: Maybe DeviceStatus
$sel:deviceStatus:Device' :: Device -> Maybe DeviceStatus
deviceStatus} -> Maybe DeviceStatus
deviceStatus) (\s :: Device
s@Device' {} Maybe DeviceStatus
a -> Device
s {$sel:deviceStatus:Device' :: Maybe DeviceStatus
deviceStatus = Maybe DeviceStatus
a} :: Device)
device_deviceStatusInfo :: Lens.Lens' Device (Prelude.Maybe DeviceStatusInfo)
device_deviceStatusInfo :: (Maybe DeviceStatusInfo -> f (Maybe DeviceStatusInfo))
-> Device -> f Device
device_deviceStatusInfo = (Device -> Maybe DeviceStatusInfo)
-> (Device -> Maybe DeviceStatusInfo -> Device)
-> Lens
Device Device (Maybe DeviceStatusInfo) (Maybe DeviceStatusInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe DeviceStatusInfo
deviceStatusInfo :: Maybe DeviceStatusInfo
$sel:deviceStatusInfo:Device' :: Device -> Maybe DeviceStatusInfo
deviceStatusInfo} -> Maybe DeviceStatusInfo
deviceStatusInfo) (\s :: Device
s@Device' {} Maybe DeviceStatusInfo
a -> Device
s {$sel:deviceStatusInfo:Device' :: Maybe DeviceStatusInfo
deviceStatusInfo = Maybe DeviceStatusInfo
a} :: Device)
device_deviceArn :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_deviceArn :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_deviceArn = (Device -> Maybe Text)
-> (Device -> Maybe Text -> Device)
-> Lens Device Device (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe Text
deviceArn :: Maybe Text
$sel:deviceArn:Device' :: Device -> Maybe Text
deviceArn} -> Maybe Text
deviceArn) (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:deviceArn:Device' :: Maybe Text
deviceArn = Maybe Text
a} :: Device)
device_macAddress :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_macAddress :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_macAddress = (Device -> Maybe Text)
-> (Device -> Maybe Text -> Device)
-> Lens Device Device (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe Text
macAddress :: Maybe Text
$sel:macAddress:Device' :: Device -> Maybe Text
macAddress} -> Maybe Text
macAddress) (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:macAddress:Device' :: Maybe Text
macAddress = Maybe Text
a} :: Device)
device_deviceName :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_deviceName :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_deviceName = (Device -> Maybe Text)
-> (Device -> Maybe Text -> Device)
-> Lens Device Device (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe Text
deviceName :: Maybe Text
$sel:deviceName:Device' :: Device -> Maybe Text
deviceName} -> Maybe Text
deviceName) (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:deviceName:Device' :: Maybe Text
deviceName = Maybe Text
a} :: Device)
device_roomArn :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_roomArn :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_roomArn = (Device -> Maybe Text)
-> (Device -> Maybe Text -> Device)
-> Lens Device Device (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe Text
roomArn :: Maybe Text
$sel:roomArn:Device' :: Device -> Maybe Text
roomArn} -> Maybe Text
roomArn) (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:roomArn:Device' :: Maybe Text
roomArn = Maybe Text
a} :: Device)
device_softwareVersion :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_softwareVersion :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_softwareVersion = (Device -> Maybe Text)
-> (Device -> Maybe Text -> Device)
-> Lens Device Device (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe Text
softwareVersion :: Maybe Text
$sel:softwareVersion:Device' :: Device -> Maybe Text
softwareVersion} -> Maybe Text
softwareVersion) (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:softwareVersion:Device' :: Maybe Text
softwareVersion = Maybe Text
a} :: Device)
device_deviceType :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_deviceType :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_deviceType = (Device -> Maybe Text)
-> (Device -> Maybe Text -> Device)
-> Lens Device Device (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe Text
deviceType :: Maybe Text
$sel:deviceType:Device' :: Device -> Maybe Text
deviceType} -> Maybe Text
deviceType) (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:deviceType:Device' :: Maybe Text
deviceType = Maybe Text
a} :: Device)
device_networkProfileInfo :: Lens.Lens' Device (Prelude.Maybe DeviceNetworkProfileInfo)
device_networkProfileInfo :: (Maybe DeviceNetworkProfileInfo
-> f (Maybe DeviceNetworkProfileInfo))
-> Device -> f Device
device_networkProfileInfo = (Device -> Maybe DeviceNetworkProfileInfo)
-> (Device -> Maybe DeviceNetworkProfileInfo -> Device)
-> Lens
Device
Device
(Maybe DeviceNetworkProfileInfo)
(Maybe DeviceNetworkProfileInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe DeviceNetworkProfileInfo
networkProfileInfo :: Maybe DeviceNetworkProfileInfo
$sel:networkProfileInfo:Device' :: Device -> Maybe DeviceNetworkProfileInfo
networkProfileInfo} -> Maybe DeviceNetworkProfileInfo
networkProfileInfo) (\s :: Device
s@Device' {} Maybe DeviceNetworkProfileInfo
a -> Device
s {$sel:networkProfileInfo:Device' :: Maybe DeviceNetworkProfileInfo
networkProfileInfo = Maybe DeviceNetworkProfileInfo
a} :: Device)
device_deviceSerialNumber :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_deviceSerialNumber :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_deviceSerialNumber = (Device -> Maybe Text)
-> (Device -> Maybe Text -> Device)
-> Lens Device Device (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe Text
deviceSerialNumber :: Maybe Text
$sel:deviceSerialNumber:Device' :: Device -> Maybe Text
deviceSerialNumber} -> Maybe Text
deviceSerialNumber) (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:deviceSerialNumber:Device' :: Maybe Text
deviceSerialNumber = Maybe Text
a} :: Device)
instance Core.FromJSON Device where
parseJSON :: Value -> Parser Device
parseJSON =
String -> (Object -> Parser Device) -> Value -> Parser Device
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Device"
( \Object
x ->
Maybe DeviceStatus
-> Maybe DeviceStatusInfo
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DeviceNetworkProfileInfo
-> Maybe Text
-> Device
Device'
(Maybe DeviceStatus
-> Maybe DeviceStatusInfo
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DeviceNetworkProfileInfo
-> Maybe Text
-> Device)
-> Parser (Maybe DeviceStatus)
-> Parser
(Maybe DeviceStatusInfo
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DeviceNetworkProfileInfo
-> Maybe Text
-> Device)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe DeviceStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DeviceStatus")
Parser
(Maybe DeviceStatusInfo
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DeviceNetworkProfileInfo
-> Maybe Text
-> Device)
-> Parser (Maybe DeviceStatusInfo)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DeviceNetworkProfileInfo
-> Maybe Text
-> Device)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DeviceStatusInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DeviceStatusInfo")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DeviceNetworkProfileInfo
-> Maybe Text
-> Device)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DeviceNetworkProfileInfo
-> Maybe Text
-> Device)
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
"DeviceArn")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DeviceNetworkProfileInfo
-> Maybe Text
-> Device)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DeviceNetworkProfileInfo
-> Maybe Text
-> Device)
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
"MacAddress")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DeviceNetworkProfileInfo
-> Maybe Text
-> Device)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DeviceNetworkProfileInfo
-> Maybe Text
-> Device)
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
"DeviceName")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DeviceNetworkProfileInfo
-> Maybe Text
-> Device)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe DeviceNetworkProfileInfo
-> Maybe Text
-> Device)
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
"RoomArn")
Parser
(Maybe Text
-> Maybe Text
-> Maybe DeviceNetworkProfileInfo
-> Maybe Text
-> Device)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe DeviceNetworkProfileInfo -> Maybe Text -> Device)
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
"SoftwareVersion")
Parser
(Maybe Text
-> Maybe DeviceNetworkProfileInfo -> Maybe Text -> Device)
-> Parser (Maybe Text)
-> Parser (Maybe DeviceNetworkProfileInfo -> Maybe Text -> Device)
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
"DeviceType")
Parser (Maybe DeviceNetworkProfileInfo -> Maybe Text -> Device)
-> Parser (Maybe DeviceNetworkProfileInfo)
-> Parser (Maybe Text -> Device)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DeviceNetworkProfileInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NetworkProfileInfo")
Parser (Maybe Text -> Device)
-> Parser (Maybe Text) -> Parser Device
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
"DeviceSerialNumber")
)
instance Prelude.Hashable Device
instance Prelude.NFData Device