{-# 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.SageMaker.Types.DeviceSummary where
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
import Amazonka.SageMaker.Types.EdgeModelSummary
data DeviceSummary = DeviceSummary'
{
DeviceSummary -> Maybe Text
agentVersion :: Prelude.Maybe Prelude.Text,
DeviceSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
DeviceSummary -> Maybe Text
deviceFleetName :: Prelude.Maybe Prelude.Text,
DeviceSummary -> Maybe Text
iotThingName :: Prelude.Maybe Prelude.Text,
DeviceSummary -> Maybe POSIX
latestHeartbeat :: Prelude.Maybe Data.POSIX,
DeviceSummary -> Maybe [EdgeModelSummary]
models :: Prelude.Maybe [EdgeModelSummary],
DeviceSummary -> Maybe POSIX
registrationTime :: Prelude.Maybe Data.POSIX,
DeviceSummary -> Text
deviceName :: Prelude.Text,
DeviceSummary -> Text
deviceArn :: Prelude.Text
}
deriving (DeviceSummary -> DeviceSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceSummary -> DeviceSummary -> Bool
$c/= :: DeviceSummary -> DeviceSummary -> Bool
== :: DeviceSummary -> DeviceSummary -> Bool
$c== :: DeviceSummary -> DeviceSummary -> Bool
Prelude.Eq, ReadPrec [DeviceSummary]
ReadPrec DeviceSummary
Int -> ReadS DeviceSummary
ReadS [DeviceSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeviceSummary]
$creadListPrec :: ReadPrec [DeviceSummary]
readPrec :: ReadPrec DeviceSummary
$creadPrec :: ReadPrec DeviceSummary
readList :: ReadS [DeviceSummary]
$creadList :: ReadS [DeviceSummary]
readsPrec :: Int -> ReadS DeviceSummary
$creadsPrec :: Int -> ReadS DeviceSummary
Prelude.Read, Int -> DeviceSummary -> ShowS
[DeviceSummary] -> ShowS
DeviceSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeviceSummary] -> ShowS
$cshowList :: [DeviceSummary] -> ShowS
show :: DeviceSummary -> String
$cshow :: DeviceSummary -> String
showsPrec :: Int -> DeviceSummary -> ShowS
$cshowsPrec :: Int -> DeviceSummary -> ShowS
Prelude.Show, forall x. Rep DeviceSummary x -> DeviceSummary
forall x. DeviceSummary -> Rep DeviceSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeviceSummary x -> DeviceSummary
$cfrom :: forall x. DeviceSummary -> Rep DeviceSummary x
Prelude.Generic)
newDeviceSummary ::
Prelude.Text ->
Prelude.Text ->
DeviceSummary
newDeviceSummary :: Text -> Text -> DeviceSummary
newDeviceSummary Text
pDeviceName_ Text
pDeviceArn_ =
DeviceSummary'
{ $sel:agentVersion:DeviceSummary' :: Maybe Text
agentVersion = forall a. Maybe a
Prelude.Nothing,
$sel:description:DeviceSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:deviceFleetName:DeviceSummary' :: Maybe Text
deviceFleetName = forall a. Maybe a
Prelude.Nothing,
$sel:iotThingName:DeviceSummary' :: Maybe Text
iotThingName = forall a. Maybe a
Prelude.Nothing,
$sel:latestHeartbeat:DeviceSummary' :: Maybe POSIX
latestHeartbeat = forall a. Maybe a
Prelude.Nothing,
$sel:models:DeviceSummary' :: Maybe [EdgeModelSummary]
models = forall a. Maybe a
Prelude.Nothing,
$sel:registrationTime:DeviceSummary' :: Maybe POSIX
registrationTime = forall a. Maybe a
Prelude.Nothing,
$sel:deviceName:DeviceSummary' :: Text
deviceName = Text
pDeviceName_,
$sel:deviceArn:DeviceSummary' :: Text
deviceArn = Text
pDeviceArn_
}
deviceSummary_agentVersion :: Lens.Lens' DeviceSummary (Prelude.Maybe Prelude.Text)
deviceSummary_agentVersion :: Lens' DeviceSummary (Maybe Text)
deviceSummary_agentVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceSummary' {Maybe Text
agentVersion :: Maybe Text
$sel:agentVersion:DeviceSummary' :: DeviceSummary -> Maybe Text
agentVersion} -> Maybe Text
agentVersion) (\s :: DeviceSummary
s@DeviceSummary' {} Maybe Text
a -> DeviceSummary
s {$sel:agentVersion:DeviceSummary' :: Maybe Text
agentVersion = Maybe Text
a} :: DeviceSummary)
deviceSummary_description :: Lens.Lens' DeviceSummary (Prelude.Maybe Prelude.Text)
deviceSummary_description :: Lens' DeviceSummary (Maybe Text)
deviceSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceSummary' {Maybe Text
description :: Maybe Text
$sel:description:DeviceSummary' :: DeviceSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: DeviceSummary
s@DeviceSummary' {} Maybe Text
a -> DeviceSummary
s {$sel:description:DeviceSummary' :: Maybe Text
description = Maybe Text
a} :: DeviceSummary)
deviceSummary_deviceFleetName :: Lens.Lens' DeviceSummary (Prelude.Maybe Prelude.Text)
deviceSummary_deviceFleetName :: Lens' DeviceSummary (Maybe Text)
deviceSummary_deviceFleetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceSummary' {Maybe Text
deviceFleetName :: Maybe Text
$sel:deviceFleetName:DeviceSummary' :: DeviceSummary -> Maybe Text
deviceFleetName} -> Maybe Text
deviceFleetName) (\s :: DeviceSummary
s@DeviceSummary' {} Maybe Text
a -> DeviceSummary
s {$sel:deviceFleetName:DeviceSummary' :: Maybe Text
deviceFleetName = Maybe Text
a} :: DeviceSummary)
deviceSummary_iotThingName :: Lens.Lens' DeviceSummary (Prelude.Maybe Prelude.Text)
deviceSummary_iotThingName :: Lens' DeviceSummary (Maybe Text)
deviceSummary_iotThingName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceSummary' {Maybe Text
iotThingName :: Maybe Text
$sel:iotThingName:DeviceSummary' :: DeviceSummary -> Maybe Text
iotThingName} -> Maybe Text
iotThingName) (\s :: DeviceSummary
s@DeviceSummary' {} Maybe Text
a -> DeviceSummary
s {$sel:iotThingName:DeviceSummary' :: Maybe Text
iotThingName = Maybe Text
a} :: DeviceSummary)
deviceSummary_latestHeartbeat :: Lens.Lens' DeviceSummary (Prelude.Maybe Prelude.UTCTime)
deviceSummary_latestHeartbeat :: Lens' DeviceSummary (Maybe UTCTime)
deviceSummary_latestHeartbeat = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceSummary' {Maybe POSIX
latestHeartbeat :: Maybe POSIX
$sel:latestHeartbeat:DeviceSummary' :: DeviceSummary -> Maybe POSIX
latestHeartbeat} -> Maybe POSIX
latestHeartbeat) (\s :: DeviceSummary
s@DeviceSummary' {} Maybe POSIX
a -> DeviceSummary
s {$sel:latestHeartbeat:DeviceSummary' :: Maybe POSIX
latestHeartbeat = Maybe POSIX
a} :: DeviceSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
deviceSummary_models :: Lens.Lens' DeviceSummary (Prelude.Maybe [EdgeModelSummary])
deviceSummary_models :: Lens' DeviceSummary (Maybe [EdgeModelSummary])
deviceSummary_models = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceSummary' {Maybe [EdgeModelSummary]
models :: Maybe [EdgeModelSummary]
$sel:models:DeviceSummary' :: DeviceSummary -> Maybe [EdgeModelSummary]
models} -> Maybe [EdgeModelSummary]
models) (\s :: DeviceSummary
s@DeviceSummary' {} Maybe [EdgeModelSummary]
a -> DeviceSummary
s {$sel:models:DeviceSummary' :: Maybe [EdgeModelSummary]
models = Maybe [EdgeModelSummary]
a} :: DeviceSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
deviceSummary_registrationTime :: Lens.Lens' DeviceSummary (Prelude.Maybe Prelude.UTCTime)
deviceSummary_registrationTime :: Lens' DeviceSummary (Maybe UTCTime)
deviceSummary_registrationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceSummary' {Maybe POSIX
registrationTime :: Maybe POSIX
$sel:registrationTime:DeviceSummary' :: DeviceSummary -> Maybe POSIX
registrationTime} -> Maybe POSIX
registrationTime) (\s :: DeviceSummary
s@DeviceSummary' {} Maybe POSIX
a -> DeviceSummary
s {$sel:registrationTime:DeviceSummary' :: Maybe POSIX
registrationTime = Maybe POSIX
a} :: DeviceSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
deviceSummary_deviceName :: Lens.Lens' DeviceSummary Prelude.Text
deviceSummary_deviceName :: Lens' DeviceSummary Text
deviceSummary_deviceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceSummary' {Text
deviceName :: Text
$sel:deviceName:DeviceSummary' :: DeviceSummary -> Text
deviceName} -> Text
deviceName) (\s :: DeviceSummary
s@DeviceSummary' {} Text
a -> DeviceSummary
s {$sel:deviceName:DeviceSummary' :: Text
deviceName = Text
a} :: DeviceSummary)
deviceSummary_deviceArn :: Lens.Lens' DeviceSummary Prelude.Text
deviceSummary_deviceArn :: Lens' DeviceSummary Text
deviceSummary_deviceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceSummary' {Text
deviceArn :: Text
$sel:deviceArn:DeviceSummary' :: DeviceSummary -> Text
deviceArn} -> Text
deviceArn) (\s :: DeviceSummary
s@DeviceSummary' {} Text
a -> DeviceSummary
s {$sel:deviceArn:DeviceSummary' :: Text
deviceArn = Text
a} :: DeviceSummary)
instance Data.FromJSON DeviceSummary where
parseJSON :: Value -> Parser DeviceSummary
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DeviceSummary"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe [EdgeModelSummary]
-> Maybe POSIX
-> Text
-> Text
-> DeviceSummary
DeviceSummary'
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
"AgentVersion")
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
"Description")
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
"DeviceFleetName")
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
"IotThingName")
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
"LatestHeartbeat")
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
"Models" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"RegistrationTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser 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 a
Data..: Key
"DeviceArn")
)
instance Prelude.Hashable DeviceSummary where
hashWithSalt :: Int -> DeviceSummary -> Int
hashWithSalt Int
_salt DeviceSummary' {Maybe [EdgeModelSummary]
Maybe Text
Maybe POSIX
Text
deviceArn :: Text
deviceName :: Text
registrationTime :: Maybe POSIX
models :: Maybe [EdgeModelSummary]
latestHeartbeat :: Maybe POSIX
iotThingName :: Maybe Text
deviceFleetName :: Maybe Text
description :: Maybe Text
agentVersion :: Maybe Text
$sel:deviceArn:DeviceSummary' :: DeviceSummary -> Text
$sel:deviceName:DeviceSummary' :: DeviceSummary -> Text
$sel:registrationTime:DeviceSummary' :: DeviceSummary -> Maybe POSIX
$sel:models:DeviceSummary' :: DeviceSummary -> Maybe [EdgeModelSummary]
$sel:latestHeartbeat:DeviceSummary' :: DeviceSummary -> Maybe POSIX
$sel:iotThingName:DeviceSummary' :: DeviceSummary -> Maybe Text
$sel:deviceFleetName:DeviceSummary' :: DeviceSummary -> Maybe Text
$sel:description:DeviceSummary' :: DeviceSummary -> Maybe Text
$sel:agentVersion:DeviceSummary' :: DeviceSummary -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
agentVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deviceFleetName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
iotThingName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
latestHeartbeat
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [EdgeModelSummary]
models
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
registrationTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
deviceName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
deviceArn
instance Prelude.NFData DeviceSummary where
rnf :: DeviceSummary -> ()
rnf DeviceSummary' {Maybe [EdgeModelSummary]
Maybe Text
Maybe POSIX
Text
deviceArn :: Text
deviceName :: Text
registrationTime :: Maybe POSIX
models :: Maybe [EdgeModelSummary]
latestHeartbeat :: Maybe POSIX
iotThingName :: Maybe Text
deviceFleetName :: Maybe Text
description :: Maybe Text
agentVersion :: Maybe Text
$sel:deviceArn:DeviceSummary' :: DeviceSummary -> Text
$sel:deviceName:DeviceSummary' :: DeviceSummary -> Text
$sel:registrationTime:DeviceSummary' :: DeviceSummary -> Maybe POSIX
$sel:models:DeviceSummary' :: DeviceSummary -> Maybe [EdgeModelSummary]
$sel:latestHeartbeat:DeviceSummary' :: DeviceSummary -> Maybe POSIX
$sel:iotThingName:DeviceSummary' :: DeviceSummary -> Maybe Text
$sel:deviceFleetName:DeviceSummary' :: DeviceSummary -> Maybe Text
$sel:description:DeviceSummary' :: DeviceSummary -> Maybe Text
$sel:agentVersion:DeviceSummary' :: DeviceSummary -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
agentVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deviceFleetName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
iotThingName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
latestHeartbeat
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [EdgeModelSummary]
models
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
registrationTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
deviceName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
deviceArn