{-# 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.NetworkManager.Types.Device
-- 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.NetworkManager.Types.Device where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.NetworkManager.Types.AWSLocation
import Amazonka.NetworkManager.Types.DeviceState
import Amazonka.NetworkManager.Types.Location
import Amazonka.NetworkManager.Types.Tag
import qualified Amazonka.Prelude as Prelude

-- | Describes a device.
--
-- /See:/ 'newDevice' smart constructor.
data Device = Device'
  { -- | The device vendor.
    Device -> Maybe Text
vendor :: Prelude.Maybe Prelude.Text,
    -- | The device state.
    Device -> Maybe DeviceState
state :: Prelude.Maybe DeviceState,
    -- | The site location.
    Device -> Maybe (Sensitive Location)
location :: Prelude.Maybe (Core.Sensitive Location),
    -- | The date and time that the site was created.
    Device -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the device.
    Device -> Maybe Text
deviceArn :: Prelude.Maybe Prelude.Text,
    -- | The AWS location of the device.
    Device -> Maybe AWSLocation
aWSLocation :: Prelude.Maybe AWSLocation,
    -- | The ID of the global network.
    Device -> Maybe Text
globalNetworkId :: Prelude.Maybe Prelude.Text,
    -- | The device model.
    Device -> Maybe Text
model :: Prelude.Maybe Prelude.Text,
    -- | The ID of the device.
    Device -> Maybe Text
deviceId :: Prelude.Maybe Prelude.Text,
    -- | The device type.
    Device -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
    -- | The device serial number.
    Device -> Maybe Text
serialNumber :: Prelude.Maybe Prelude.Text,
    -- | The site ID.
    Device -> Maybe Text
siteId :: Prelude.Maybe Prelude.Text,
    -- | The description of the device.
    Device -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags for the device.
    Device -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
  }
  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, 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)

-- |
-- 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:
--
-- 'vendor', 'device_vendor' - The device vendor.
--
-- 'state', 'device_state' - The device state.
--
-- 'location', 'device_location' - The site location.
--
-- 'createdAt', 'device_createdAt' - The date and time that the site was created.
--
-- 'deviceArn', 'device_deviceArn' - The Amazon Resource Name (ARN) of the device.
--
-- 'aWSLocation', 'device_aWSLocation' - The AWS location of the device.
--
-- 'globalNetworkId', 'device_globalNetworkId' - The ID of the global network.
--
-- 'model', 'device_model' - The device model.
--
-- 'deviceId', 'device_deviceId' - The ID of the device.
--
-- 'type'', 'device_type' - The device type.
--
-- 'serialNumber', 'device_serialNumber' - The device serial number.
--
-- 'siteId', 'device_siteId' - The site ID.
--
-- 'description', 'device_description' - The description of the device.
--
-- 'tags', 'device_tags' - The tags for the device.
newDevice ::
  Device
newDevice :: Device
newDevice =
  Device' :: Maybe Text
-> Maybe DeviceState
-> Maybe (Sensitive Location)
-> Maybe POSIX
-> Maybe Text
-> Maybe AWSLocation
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Device
Device'
    { $sel:vendor:Device' :: Maybe Text
vendor = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:state:Device' :: Maybe DeviceState
state = Maybe DeviceState
forall a. Maybe a
Prelude.Nothing,
      $sel:location:Device' :: Maybe (Sensitive Location)
location = Maybe (Sensitive Location)
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:Device' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceArn:Device' :: Maybe Text
deviceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:aWSLocation:Device' :: Maybe AWSLocation
aWSLocation = Maybe AWSLocation
forall a. Maybe a
Prelude.Nothing,
      $sel:globalNetworkId:Device' :: Maybe Text
globalNetworkId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:model:Device' :: Maybe Text
model = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceId:Device' :: Maybe Text
deviceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':Device' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serialNumber:Device' :: Maybe Text
serialNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:siteId:Device' :: Maybe Text
siteId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:Device' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Device' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
    }

-- | The device vendor.
device_vendor :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_vendor :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_vendor = (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
vendor :: Maybe Text
$sel:vendor:Device' :: Device -> Maybe Text
vendor} -> Maybe Text
vendor) (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:vendor:Device' :: Maybe Text
vendor = Maybe Text
a} :: Device)

-- | The device state.
device_state :: Lens.Lens' Device (Prelude.Maybe DeviceState)
device_state :: (Maybe DeviceState -> f (Maybe DeviceState)) -> Device -> f Device
device_state = (Device -> Maybe DeviceState)
-> (Device -> Maybe DeviceState -> Device)
-> Lens Device Device (Maybe DeviceState) (Maybe DeviceState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe DeviceState
state :: Maybe DeviceState
$sel:state:Device' :: Device -> Maybe DeviceState
state} -> Maybe DeviceState
state) (\s :: Device
s@Device' {} Maybe DeviceState
a -> Device
s {$sel:state:Device' :: Maybe DeviceState
state = Maybe DeviceState
a} :: Device)

-- | The site location.
device_location :: Lens.Lens' Device (Prelude.Maybe Location)
device_location :: (Maybe Location -> f (Maybe Location)) -> Device -> f Device
device_location = (Device -> Maybe (Sensitive Location))
-> (Device -> Maybe (Sensitive Location) -> Device)
-> Lens
     Device
     Device
     (Maybe (Sensitive Location))
     (Maybe (Sensitive Location))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe (Sensitive Location)
location :: Maybe (Sensitive Location)
$sel:location:Device' :: Device -> Maybe (Sensitive Location)
location} -> Maybe (Sensitive Location)
location) (\s :: Device
s@Device' {} Maybe (Sensitive Location)
a -> Device
s {$sel:location:Device' :: Maybe (Sensitive Location)
location = Maybe (Sensitive Location)
a} :: Device) ((Maybe (Sensitive Location) -> f (Maybe (Sensitive Location)))
 -> Device -> f Device)
-> ((Maybe Location -> f (Maybe Location))
    -> Maybe (Sensitive Location) -> f (Maybe (Sensitive Location)))
-> (Maybe Location -> f (Maybe Location))
-> Device
-> f Device
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Location) (Sensitive Location) Location Location
-> Iso
     (Maybe (Sensitive Location))
     (Maybe (Sensitive Location))
     (Maybe Location)
     (Maybe Location)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Location) (Sensitive Location) Location Location
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The date and time that the site was created.
device_createdAt :: Lens.Lens' Device (Prelude.Maybe Prelude.UTCTime)
device_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Device -> f Device
device_createdAt = (Device -> Maybe POSIX)
-> (Device -> Maybe POSIX -> Device)
-> Lens Device Device (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:Device' :: Device -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: Device
s@Device' {} Maybe POSIX
a -> Device
s {$sel:createdAt:Device' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: Device) ((Maybe POSIX -> f (Maybe POSIX)) -> Device -> f Device)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Device
-> f Device
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The Amazon Resource Name (ARN) of the 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)

-- | The AWS location of the device.
device_aWSLocation :: Lens.Lens' Device (Prelude.Maybe AWSLocation)
device_aWSLocation :: (Maybe AWSLocation -> f (Maybe AWSLocation)) -> Device -> f Device
device_aWSLocation = (Device -> Maybe AWSLocation)
-> (Device -> Maybe AWSLocation -> Device)
-> Lens Device Device (Maybe AWSLocation) (Maybe AWSLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe AWSLocation
aWSLocation :: Maybe AWSLocation
$sel:aWSLocation:Device' :: Device -> Maybe AWSLocation
aWSLocation} -> Maybe AWSLocation
aWSLocation) (\s :: Device
s@Device' {} Maybe AWSLocation
a -> Device
s {$sel:aWSLocation:Device' :: Maybe AWSLocation
aWSLocation = Maybe AWSLocation
a} :: Device)

-- | The ID of the global network.
device_globalNetworkId :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_globalNetworkId :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_globalNetworkId = (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
globalNetworkId :: Maybe Text
$sel:globalNetworkId:Device' :: Device -> Maybe Text
globalNetworkId} -> Maybe Text
globalNetworkId) (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:globalNetworkId:Device' :: Maybe Text
globalNetworkId = Maybe Text
a} :: Device)

-- | The device model.
device_model :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_model :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_model = (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
model :: Maybe Text
$sel:model:Device' :: Device -> Maybe Text
model} -> Maybe Text
model) (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:model:Device' :: Maybe Text
model = Maybe Text
a} :: Device)

-- | The ID of the device.
device_deviceId :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_deviceId :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_deviceId = (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
deviceId :: Maybe Text
$sel:deviceId:Device' :: Device -> Maybe Text
deviceId} -> Maybe Text
deviceId) (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:deviceId:Device' :: Maybe Text
deviceId = Maybe Text
a} :: Device)

-- | The device type.
device_type :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_type :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_type = (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
type' :: Maybe Text
$sel:type':Device' :: Device -> Maybe Text
type'} -> Maybe Text
type') (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:type':Device' :: Maybe Text
type' = Maybe Text
a} :: Device)

-- | The device serial number.
device_serialNumber :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_serialNumber :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_serialNumber = (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
serialNumber :: Maybe Text
$sel:serialNumber:Device' :: Device -> Maybe Text
serialNumber} -> Maybe Text
serialNumber) (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:serialNumber:Device' :: Maybe Text
serialNumber = Maybe Text
a} :: Device)

-- | The site ID.
device_siteId :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_siteId :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_siteId = (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
siteId :: Maybe Text
$sel:siteId:Device' :: Device -> Maybe Text
siteId} -> Maybe Text
siteId) (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:siteId:Device' :: Maybe Text
siteId = Maybe Text
a} :: Device)

-- | The description of the device.
device_description :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_description :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_description = (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
description :: Maybe Text
$sel:description:Device' :: Device -> Maybe Text
description} -> Maybe Text
description) (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:description:Device' :: Maybe Text
description = Maybe Text
a} :: Device)

-- | The tags for the device.
device_tags :: Lens.Lens' Device (Prelude.Maybe [Tag])
device_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> Device -> f Device
device_tags = (Device -> Maybe [Tag])
-> (Device -> Maybe [Tag] -> Device)
-> Lens Device Device (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:Device' :: Device -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: Device
s@Device' {} Maybe [Tag]
a -> Device
s {$sel:tags:Device' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: Device) ((Maybe [Tag] -> f (Maybe [Tag])) -> Device -> f Device)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> Device
-> f Device
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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 Text
-> Maybe DeviceState
-> Maybe (Sensitive Location)
-> Maybe POSIX
-> Maybe Text
-> Maybe AWSLocation
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Device
Device'
            (Maybe Text
 -> Maybe DeviceState
 -> Maybe (Sensitive Location)
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe AWSLocation
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Tag]
 -> Device)
-> Parser (Maybe Text)
-> Parser
     (Maybe DeviceState
      -> Maybe (Sensitive Location)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe AWSLocation
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Device)
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
"Vendor")
            Parser
  (Maybe DeviceState
   -> Maybe (Sensitive Location)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe AWSLocation
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Device)
-> Parser (Maybe DeviceState)
-> Parser
     (Maybe (Sensitive Location)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe AWSLocation
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Device)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DeviceState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
            Parser
  (Maybe (Sensitive Location)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe AWSLocation
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Device)
-> Parser (Maybe (Sensitive Location))
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe AWSLocation
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Device)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Location))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Location")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe AWSLocation
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Device)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe AWSLocation
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Device)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedAt")
            Parser
  (Maybe Text
   -> Maybe AWSLocation
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Device)
-> Parser (Maybe Text)
-> Parser
     (Maybe AWSLocation
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> 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 AWSLocation
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Device)
-> Parser (Maybe AWSLocation)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Device)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AWSLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AWSLocation")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Device)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> 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
"GlobalNetworkId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Device)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> 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
"Model")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Device)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe [Tag] -> 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
"DeviceId")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe [Tag] -> Device)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> Maybe [Tag] -> 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
"Type")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> Maybe [Tag] -> Device)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe [Tag] -> 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
"SerialNumber")
            Parser (Maybe Text -> Maybe Text -> Maybe [Tag] -> Device)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [Tag] -> 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
"SiteId")
            Parser (Maybe Text -> Maybe [Tag] -> Device)
-> Parser (Maybe Text) -> Parser (Maybe [Tag] -> 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
"Description")
            Parser (Maybe [Tag] -> Device)
-> Parser (Maybe [Tag]) -> Parser Device
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tags" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable Device

instance Prelude.NFData Device