{-# 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.Device
-- 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.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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | A device with attributes.
--
-- /See:/ 'newDevice' smart constructor.
data Device = Device'
  { -- | The ARN of a device.
    Device -> Maybe Text
deviceArn :: Prelude.Maybe Prelude.Text,
    -- | The name of a device.
    Device -> Maybe Text
deviceName :: Prelude.Maybe Prelude.Text,
    -- | The serial number of a device.
    Device -> Maybe Text
deviceSerialNumber :: Prelude.Maybe Prelude.Text,
    -- | The status of a device. If the status is not READY, check the
    -- DeviceStatusInfo value for details.
    Device -> Maybe DeviceStatus
deviceStatus :: Prelude.Maybe DeviceStatus,
    -- | Detailed information about a device\'s status.
    Device -> Maybe DeviceStatusInfo
deviceStatusInfo :: Prelude.Maybe DeviceStatusInfo,
    -- | The type of a device.
    Device -> Maybe Text
deviceType :: Prelude.Maybe Prelude.Text,
    -- | The MAC address of a device.
    Device -> Maybe Text
macAddress :: Prelude.Maybe Prelude.Text,
    -- | Detailed information about a device\'s network profile.
    Device -> Maybe DeviceNetworkProfileInfo
networkProfileInfo :: Prelude.Maybe DeviceNetworkProfileInfo,
    -- | The room ARN of a device.
    Device -> Maybe Text
roomArn :: Prelude.Maybe Prelude.Text,
    -- | The software version of a device.
    Device -> Maybe Text
softwareVersion :: Prelude.Maybe Prelude.Text
  }
  deriving (Device -> Device -> Bool
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]
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
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. 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)

-- |
-- Create a value of 'Device' 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:
--
-- 'deviceArn', 'device_deviceArn' - The ARN of a device.
--
-- 'deviceName', 'device_deviceName' - The name of a device.
--
-- 'deviceSerialNumber', 'device_deviceSerialNumber' - The serial number of a device.
--
-- 'deviceStatus', 'device_deviceStatus' - The status of a device. If the status is not READY, check the
-- DeviceStatusInfo value for details.
--
-- 'deviceStatusInfo', 'device_deviceStatusInfo' - Detailed information about a device\'s status.
--
-- 'deviceType', 'device_deviceType' - The type of a device.
--
-- 'macAddress', 'device_macAddress' - The MAC address of a device.
--
-- 'networkProfileInfo', 'device_networkProfileInfo' - Detailed information about a device\'s network profile.
--
-- 'roomArn', 'device_roomArn' - The room ARN of a device.
--
-- 'softwareVersion', 'device_softwareVersion' - The software version of a device.
newDevice ::
  Device
newDevice :: Device
newDevice =
  Device'
    { $sel:deviceArn:Device' :: Maybe Text
deviceArn = forall a. Maybe a
Prelude.Nothing,
      $sel:deviceName:Device' :: Maybe Text
deviceName = forall a. Maybe a
Prelude.Nothing,
      $sel:deviceSerialNumber:Device' :: Maybe Text
deviceSerialNumber = forall a. Maybe a
Prelude.Nothing,
      $sel:deviceStatus:Device' :: Maybe DeviceStatus
deviceStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:deviceStatusInfo:Device' :: Maybe DeviceStatusInfo
deviceStatusInfo = forall a. Maybe a
Prelude.Nothing,
      $sel:deviceType:Device' :: Maybe Text
deviceType = forall a. Maybe a
Prelude.Nothing,
      $sel:macAddress:Device' :: Maybe Text
macAddress = forall a. Maybe a
Prelude.Nothing,
      $sel:networkProfileInfo:Device' :: Maybe DeviceNetworkProfileInfo
networkProfileInfo = forall a. Maybe a
Prelude.Nothing,
      $sel:roomArn:Device' :: Maybe Text
roomArn = forall a. Maybe a
Prelude.Nothing,
      $sel:softwareVersion:Device' :: Maybe Text
softwareVersion = forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of a device.
device_deviceArn :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_deviceArn :: Lens' Device (Maybe Text)
device_deviceArn = 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)

-- | The name of a device.
device_deviceName :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_deviceName :: Lens' Device (Maybe Text)
device_deviceName = 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)

-- | The serial number of a device.
device_deviceSerialNumber :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_deviceSerialNumber :: Lens' Device (Maybe Text)
device_deviceSerialNumber = 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)

-- | The status of a device. If the status is not READY, check the
-- DeviceStatusInfo value for details.
device_deviceStatus :: Lens.Lens' Device (Prelude.Maybe DeviceStatus)
device_deviceStatus :: Lens' Device (Maybe DeviceStatus)
device_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)

-- | Detailed information about a device\'s status.
device_deviceStatusInfo :: Lens.Lens' Device (Prelude.Maybe DeviceStatusInfo)
device_deviceStatusInfo :: Lens' Device (Maybe DeviceStatusInfo)
device_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)

-- | The type of a device.
device_deviceType :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_deviceType :: Lens' Device (Maybe Text)
device_deviceType = 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)

-- | The MAC address of a device.
device_macAddress :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_macAddress :: Lens' Device (Maybe Text)
device_macAddress = 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)

-- | Detailed information about a device\'s network profile.
device_networkProfileInfo :: Lens.Lens' Device (Prelude.Maybe DeviceNetworkProfileInfo)
device_networkProfileInfo :: Lens' Device (Maybe DeviceNetworkProfileInfo)
device_networkProfileInfo = 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)

-- | The room ARN of a device.
device_roomArn :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_roomArn :: Lens' Device (Maybe Text)
device_roomArn = 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)

-- | The software version of a device.
device_softwareVersion :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_softwareVersion :: Lens' Device (Maybe Text)
device_softwareVersion = 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)

instance Data.FromJSON Device where
  parseJSON :: Value -> Parser Device
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Device"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DeviceStatus
-> Maybe DeviceStatusInfo
-> Maybe Text
-> Maybe Text
-> Maybe DeviceNetworkProfileInfo
-> Maybe Text
-> Maybe Text
-> Device
Device'
            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
"DeviceArn")
            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
"DeviceName")
            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
"DeviceSerialNumber")
            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
"DeviceStatus")
            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
"DeviceStatusInfo")
            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
"DeviceType")
            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
"MacAddress")
            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
"NetworkProfileInfo")
            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
"RoomArn")
            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
"SoftwareVersion")
      )

instance Prelude.Hashable Device where
  hashWithSalt :: Int -> Device -> Int
hashWithSalt Int
_salt Device' {Maybe Text
Maybe DeviceNetworkProfileInfo
Maybe DeviceStatus
Maybe DeviceStatusInfo
softwareVersion :: Maybe Text
roomArn :: Maybe Text
networkProfileInfo :: Maybe DeviceNetworkProfileInfo
macAddress :: Maybe Text
deviceType :: Maybe Text
deviceStatusInfo :: Maybe DeviceStatusInfo
deviceStatus :: Maybe DeviceStatus
deviceSerialNumber :: Maybe Text
deviceName :: Maybe Text
deviceArn :: Maybe Text
$sel:softwareVersion:Device' :: Device -> Maybe Text
$sel:roomArn:Device' :: Device -> Maybe Text
$sel:networkProfileInfo:Device' :: Device -> Maybe DeviceNetworkProfileInfo
$sel:macAddress:Device' :: Device -> Maybe Text
$sel:deviceType:Device' :: Device -> Maybe Text
$sel:deviceStatusInfo:Device' :: Device -> Maybe DeviceStatusInfo
$sel:deviceStatus:Device' :: Device -> Maybe DeviceStatus
$sel:deviceSerialNumber:Device' :: Device -> Maybe Text
$sel:deviceName:Device' :: Device -> Maybe Text
$sel:deviceArn:Device' :: Device -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deviceArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deviceName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deviceSerialNumber
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeviceStatus
deviceStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeviceStatusInfo
deviceStatusInfo
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deviceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
macAddress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeviceNetworkProfileInfo
networkProfileInfo
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roomArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
softwareVersion

instance Prelude.NFData Device where
  rnf :: Device -> ()
rnf Device' {Maybe Text
Maybe DeviceNetworkProfileInfo
Maybe DeviceStatus
Maybe DeviceStatusInfo
softwareVersion :: Maybe Text
roomArn :: Maybe Text
networkProfileInfo :: Maybe DeviceNetworkProfileInfo
macAddress :: Maybe Text
deviceType :: Maybe Text
deviceStatusInfo :: Maybe DeviceStatusInfo
deviceStatus :: Maybe DeviceStatus
deviceSerialNumber :: Maybe Text
deviceName :: Maybe Text
deviceArn :: Maybe Text
$sel:softwareVersion:Device' :: Device -> Maybe Text
$sel:roomArn:Device' :: Device -> Maybe Text
$sel:networkProfileInfo:Device' :: Device -> Maybe DeviceNetworkProfileInfo
$sel:macAddress:Device' :: Device -> Maybe Text
$sel:deviceType:Device' :: Device -> Maybe Text
$sel:deviceStatusInfo:Device' :: Device -> Maybe DeviceStatusInfo
$sel:deviceStatus:Device' :: Device -> Maybe DeviceStatus
$sel:deviceSerialNumber:Device' :: Device -> Maybe Text
$sel:deviceName:Device' :: Device -> Maybe Text
$sel:deviceArn:Device' :: Device -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deviceArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deviceName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deviceSerialNumber
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DeviceStatus
deviceStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DeviceStatusInfo
deviceStatusInfo
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deviceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
macAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DeviceNetworkProfileInfo
networkProfileInfo
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roomArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
softwareVersion