{-# 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.SageMaker.Types.EdgeModelStat
-- 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.SageMaker.Types.EdgeModelStat where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Status of edge devices with this model.
--
-- /See:/ 'newEdgeModelStat' smart constructor.
data EdgeModelStat = EdgeModelStat'
  { -- | The name of the model.
    EdgeModelStat -> Text
modelName :: Prelude.Text,
    -- | The model version.
    EdgeModelStat -> Text
modelVersion :: Prelude.Text,
    -- | The number of devices that have this model version and do not have a
    -- heart beat.
    EdgeModelStat -> Integer
offlineDeviceCount :: Prelude.Integer,
    -- | The number of devices that have this model version and have a heart
    -- beat.
    EdgeModelStat -> Integer
connectedDeviceCount :: Prelude.Integer,
    -- | The number of devices that have this model version, a heart beat, and
    -- are currently running.
    EdgeModelStat -> Integer
activeDeviceCount :: Prelude.Integer,
    -- | The number of devices with this model version and are producing sample
    -- data.
    EdgeModelStat -> Integer
samplingDeviceCount :: Prelude.Integer
  }
  deriving (EdgeModelStat -> EdgeModelStat -> Bool
(EdgeModelStat -> EdgeModelStat -> Bool)
-> (EdgeModelStat -> EdgeModelStat -> Bool) -> Eq EdgeModelStat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EdgeModelStat -> EdgeModelStat -> Bool
$c/= :: EdgeModelStat -> EdgeModelStat -> Bool
== :: EdgeModelStat -> EdgeModelStat -> Bool
$c== :: EdgeModelStat -> EdgeModelStat -> Bool
Prelude.Eq, ReadPrec [EdgeModelStat]
ReadPrec EdgeModelStat
Int -> ReadS EdgeModelStat
ReadS [EdgeModelStat]
(Int -> ReadS EdgeModelStat)
-> ReadS [EdgeModelStat]
-> ReadPrec EdgeModelStat
-> ReadPrec [EdgeModelStat]
-> Read EdgeModelStat
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EdgeModelStat]
$creadListPrec :: ReadPrec [EdgeModelStat]
readPrec :: ReadPrec EdgeModelStat
$creadPrec :: ReadPrec EdgeModelStat
readList :: ReadS [EdgeModelStat]
$creadList :: ReadS [EdgeModelStat]
readsPrec :: Int -> ReadS EdgeModelStat
$creadsPrec :: Int -> ReadS EdgeModelStat
Prelude.Read, Int -> EdgeModelStat -> ShowS
[EdgeModelStat] -> ShowS
EdgeModelStat -> String
(Int -> EdgeModelStat -> ShowS)
-> (EdgeModelStat -> String)
-> ([EdgeModelStat] -> ShowS)
-> Show EdgeModelStat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EdgeModelStat] -> ShowS
$cshowList :: [EdgeModelStat] -> ShowS
show :: EdgeModelStat -> String
$cshow :: EdgeModelStat -> String
showsPrec :: Int -> EdgeModelStat -> ShowS
$cshowsPrec :: Int -> EdgeModelStat -> ShowS
Prelude.Show, (forall x. EdgeModelStat -> Rep EdgeModelStat x)
-> (forall x. Rep EdgeModelStat x -> EdgeModelStat)
-> Generic EdgeModelStat
forall x. Rep EdgeModelStat x -> EdgeModelStat
forall x. EdgeModelStat -> Rep EdgeModelStat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EdgeModelStat x -> EdgeModelStat
$cfrom :: forall x. EdgeModelStat -> Rep EdgeModelStat x
Prelude.Generic)

-- |
-- Create a value of 'EdgeModelStat' 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:
--
-- 'modelName', 'edgeModelStat_modelName' - The name of the model.
--
-- 'modelVersion', 'edgeModelStat_modelVersion' - The model version.
--
-- 'offlineDeviceCount', 'edgeModelStat_offlineDeviceCount' - The number of devices that have this model version and do not have a
-- heart beat.
--
-- 'connectedDeviceCount', 'edgeModelStat_connectedDeviceCount' - The number of devices that have this model version and have a heart
-- beat.
--
-- 'activeDeviceCount', 'edgeModelStat_activeDeviceCount' - The number of devices that have this model version, a heart beat, and
-- are currently running.
--
-- 'samplingDeviceCount', 'edgeModelStat_samplingDeviceCount' - The number of devices with this model version and are producing sample
-- data.
newEdgeModelStat ::
  -- | 'modelName'
  Prelude.Text ->
  -- | 'modelVersion'
  Prelude.Text ->
  -- | 'offlineDeviceCount'
  Prelude.Integer ->
  -- | 'connectedDeviceCount'
  Prelude.Integer ->
  -- | 'activeDeviceCount'
  Prelude.Integer ->
  -- | 'samplingDeviceCount'
  Prelude.Integer ->
  EdgeModelStat
newEdgeModelStat :: Text
-> Text
-> Integer
-> Integer
-> Integer
-> Integer
-> EdgeModelStat
newEdgeModelStat
  Text
pModelName_
  Text
pModelVersion_
  Integer
pOfflineDeviceCount_
  Integer
pConnectedDeviceCount_
  Integer
pActiveDeviceCount_
  Integer
pSamplingDeviceCount_ =
    EdgeModelStat' :: Text
-> Text
-> Integer
-> Integer
-> Integer
-> Integer
-> EdgeModelStat
EdgeModelStat'
      { $sel:modelName:EdgeModelStat' :: Text
modelName = Text
pModelName_,
        $sel:modelVersion:EdgeModelStat' :: Text
modelVersion = Text
pModelVersion_,
        $sel:offlineDeviceCount:EdgeModelStat' :: Integer
offlineDeviceCount = Integer
pOfflineDeviceCount_,
        $sel:connectedDeviceCount:EdgeModelStat' :: Integer
connectedDeviceCount = Integer
pConnectedDeviceCount_,
        $sel:activeDeviceCount:EdgeModelStat' :: Integer
activeDeviceCount = Integer
pActiveDeviceCount_,
        $sel:samplingDeviceCount:EdgeModelStat' :: Integer
samplingDeviceCount = Integer
pSamplingDeviceCount_
      }

-- | The name of the model.
edgeModelStat_modelName :: Lens.Lens' EdgeModelStat Prelude.Text
edgeModelStat_modelName :: (Text -> f Text) -> EdgeModelStat -> f EdgeModelStat
edgeModelStat_modelName = (EdgeModelStat -> Text)
-> (EdgeModelStat -> Text -> EdgeModelStat)
-> Lens EdgeModelStat EdgeModelStat Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EdgeModelStat' {Text
modelName :: Text
$sel:modelName:EdgeModelStat' :: EdgeModelStat -> Text
modelName} -> Text
modelName) (\s :: EdgeModelStat
s@EdgeModelStat' {} Text
a -> EdgeModelStat
s {$sel:modelName:EdgeModelStat' :: Text
modelName = Text
a} :: EdgeModelStat)

-- | The model version.
edgeModelStat_modelVersion :: Lens.Lens' EdgeModelStat Prelude.Text
edgeModelStat_modelVersion :: (Text -> f Text) -> EdgeModelStat -> f EdgeModelStat
edgeModelStat_modelVersion = (EdgeModelStat -> Text)
-> (EdgeModelStat -> Text -> EdgeModelStat)
-> Lens EdgeModelStat EdgeModelStat Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EdgeModelStat' {Text
modelVersion :: Text
$sel:modelVersion:EdgeModelStat' :: EdgeModelStat -> Text
modelVersion} -> Text
modelVersion) (\s :: EdgeModelStat
s@EdgeModelStat' {} Text
a -> EdgeModelStat
s {$sel:modelVersion:EdgeModelStat' :: Text
modelVersion = Text
a} :: EdgeModelStat)

-- | The number of devices that have this model version and do not have a
-- heart beat.
edgeModelStat_offlineDeviceCount :: Lens.Lens' EdgeModelStat Prelude.Integer
edgeModelStat_offlineDeviceCount :: (Integer -> f Integer) -> EdgeModelStat -> f EdgeModelStat
edgeModelStat_offlineDeviceCount = (EdgeModelStat -> Integer)
-> (EdgeModelStat -> Integer -> EdgeModelStat)
-> Lens EdgeModelStat EdgeModelStat Integer Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EdgeModelStat' {Integer
offlineDeviceCount :: Integer
$sel:offlineDeviceCount:EdgeModelStat' :: EdgeModelStat -> Integer
offlineDeviceCount} -> Integer
offlineDeviceCount) (\s :: EdgeModelStat
s@EdgeModelStat' {} Integer
a -> EdgeModelStat
s {$sel:offlineDeviceCount:EdgeModelStat' :: Integer
offlineDeviceCount = Integer
a} :: EdgeModelStat)

-- | The number of devices that have this model version and have a heart
-- beat.
edgeModelStat_connectedDeviceCount :: Lens.Lens' EdgeModelStat Prelude.Integer
edgeModelStat_connectedDeviceCount :: (Integer -> f Integer) -> EdgeModelStat -> f EdgeModelStat
edgeModelStat_connectedDeviceCount = (EdgeModelStat -> Integer)
-> (EdgeModelStat -> Integer -> EdgeModelStat)
-> Lens EdgeModelStat EdgeModelStat Integer Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EdgeModelStat' {Integer
connectedDeviceCount :: Integer
$sel:connectedDeviceCount:EdgeModelStat' :: EdgeModelStat -> Integer
connectedDeviceCount} -> Integer
connectedDeviceCount) (\s :: EdgeModelStat
s@EdgeModelStat' {} Integer
a -> EdgeModelStat
s {$sel:connectedDeviceCount:EdgeModelStat' :: Integer
connectedDeviceCount = Integer
a} :: EdgeModelStat)

-- | The number of devices that have this model version, a heart beat, and
-- are currently running.
edgeModelStat_activeDeviceCount :: Lens.Lens' EdgeModelStat Prelude.Integer
edgeModelStat_activeDeviceCount :: (Integer -> f Integer) -> EdgeModelStat -> f EdgeModelStat
edgeModelStat_activeDeviceCount = (EdgeModelStat -> Integer)
-> (EdgeModelStat -> Integer -> EdgeModelStat)
-> Lens EdgeModelStat EdgeModelStat Integer Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EdgeModelStat' {Integer
activeDeviceCount :: Integer
$sel:activeDeviceCount:EdgeModelStat' :: EdgeModelStat -> Integer
activeDeviceCount} -> Integer
activeDeviceCount) (\s :: EdgeModelStat
s@EdgeModelStat' {} Integer
a -> EdgeModelStat
s {$sel:activeDeviceCount:EdgeModelStat' :: Integer
activeDeviceCount = Integer
a} :: EdgeModelStat)

-- | The number of devices with this model version and are producing sample
-- data.
edgeModelStat_samplingDeviceCount :: Lens.Lens' EdgeModelStat Prelude.Integer
edgeModelStat_samplingDeviceCount :: (Integer -> f Integer) -> EdgeModelStat -> f EdgeModelStat
edgeModelStat_samplingDeviceCount = (EdgeModelStat -> Integer)
-> (EdgeModelStat -> Integer -> EdgeModelStat)
-> Lens EdgeModelStat EdgeModelStat Integer Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EdgeModelStat' {Integer
samplingDeviceCount :: Integer
$sel:samplingDeviceCount:EdgeModelStat' :: EdgeModelStat -> Integer
samplingDeviceCount} -> Integer
samplingDeviceCount) (\s :: EdgeModelStat
s@EdgeModelStat' {} Integer
a -> EdgeModelStat
s {$sel:samplingDeviceCount:EdgeModelStat' :: Integer
samplingDeviceCount = Integer
a} :: EdgeModelStat)

instance Core.FromJSON EdgeModelStat where
  parseJSON :: Value -> Parser EdgeModelStat
parseJSON =
    String
-> (Object -> Parser EdgeModelStat)
-> Value
-> Parser EdgeModelStat
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EdgeModelStat"
      ( \Object
x ->
          Text
-> Text
-> Integer
-> Integer
-> Integer
-> Integer
-> EdgeModelStat
EdgeModelStat'
            (Text
 -> Text
 -> Integer
 -> Integer
 -> Integer
 -> Integer
 -> EdgeModelStat)
-> Parser Text
-> Parser
     (Text -> Integer -> Integer -> Integer -> Integer -> EdgeModelStat)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ModelName")
            Parser
  (Text -> Integer -> Integer -> Integer -> Integer -> EdgeModelStat)
-> Parser Text
-> Parser
     (Integer -> Integer -> Integer -> Integer -> EdgeModelStat)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ModelVersion")
            Parser (Integer -> Integer -> Integer -> Integer -> EdgeModelStat)
-> Parser Integer
-> Parser (Integer -> Integer -> Integer -> EdgeModelStat)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Integer
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"OfflineDeviceCount")
            Parser (Integer -> Integer -> Integer -> EdgeModelStat)
-> Parser Integer -> Parser (Integer -> Integer -> EdgeModelStat)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Integer
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ConnectedDeviceCount")
            Parser (Integer -> Integer -> EdgeModelStat)
-> Parser Integer -> Parser (Integer -> EdgeModelStat)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Integer
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ActiveDeviceCount")
            Parser (Integer -> EdgeModelStat)
-> Parser Integer -> Parser EdgeModelStat
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Integer
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SamplingDeviceCount")
      )

instance Prelude.Hashable EdgeModelStat

instance Prelude.NFData EdgeModelStat