{-# 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.IoTFleetWise.Types.NodeCounts
-- 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.IoTFleetWise.Types.NodeCounts 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

-- | Information about the number of nodes and node types in a vehicle
-- network.
--
-- /See:/ 'newNodeCounts' smart constructor.
data NodeCounts = NodeCounts'
  { -- | The total number of nodes in a vehicle network that represent actuators.
    NodeCounts -> Maybe Int
totalActuators :: Prelude.Maybe Prelude.Int,
    -- | The total number of nodes in a vehicle network that represent
    -- attributes.
    NodeCounts -> Maybe Int
totalAttributes :: Prelude.Maybe Prelude.Int,
    -- | The total number of nodes in a vehicle network that represent branches.
    NodeCounts -> Maybe Int
totalBranches :: Prelude.Maybe Prelude.Int,
    -- | The total number of nodes in a vehicle network.
    NodeCounts -> Maybe Int
totalNodes :: Prelude.Maybe Prelude.Int,
    -- | The total number of nodes in a vehicle network that represent sensors.
    NodeCounts -> Maybe Int
totalSensors :: Prelude.Maybe Prelude.Int
  }
  deriving (NodeCounts -> NodeCounts -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NodeCounts -> NodeCounts -> Bool
$c/= :: NodeCounts -> NodeCounts -> Bool
== :: NodeCounts -> NodeCounts -> Bool
$c== :: NodeCounts -> NodeCounts -> Bool
Prelude.Eq, ReadPrec [NodeCounts]
ReadPrec NodeCounts
Int -> ReadS NodeCounts
ReadS [NodeCounts]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NodeCounts]
$creadListPrec :: ReadPrec [NodeCounts]
readPrec :: ReadPrec NodeCounts
$creadPrec :: ReadPrec NodeCounts
readList :: ReadS [NodeCounts]
$creadList :: ReadS [NodeCounts]
readsPrec :: Int -> ReadS NodeCounts
$creadsPrec :: Int -> ReadS NodeCounts
Prelude.Read, Int -> NodeCounts -> ShowS
[NodeCounts] -> ShowS
NodeCounts -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NodeCounts] -> ShowS
$cshowList :: [NodeCounts] -> ShowS
show :: NodeCounts -> String
$cshow :: NodeCounts -> String
showsPrec :: Int -> NodeCounts -> ShowS
$cshowsPrec :: Int -> NodeCounts -> ShowS
Prelude.Show, forall x. Rep NodeCounts x -> NodeCounts
forall x. NodeCounts -> Rep NodeCounts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NodeCounts x -> NodeCounts
$cfrom :: forall x. NodeCounts -> Rep NodeCounts x
Prelude.Generic)

-- |
-- Create a value of 'NodeCounts' 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:
--
-- 'totalActuators', 'nodeCounts_totalActuators' - The total number of nodes in a vehicle network that represent actuators.
--
-- 'totalAttributes', 'nodeCounts_totalAttributes' - The total number of nodes in a vehicle network that represent
-- attributes.
--
-- 'totalBranches', 'nodeCounts_totalBranches' - The total number of nodes in a vehicle network that represent branches.
--
-- 'totalNodes', 'nodeCounts_totalNodes' - The total number of nodes in a vehicle network.
--
-- 'totalSensors', 'nodeCounts_totalSensors' - The total number of nodes in a vehicle network that represent sensors.
newNodeCounts ::
  NodeCounts
newNodeCounts :: NodeCounts
newNodeCounts =
  NodeCounts'
    { $sel:totalActuators:NodeCounts' :: Maybe Int
totalActuators = forall a. Maybe a
Prelude.Nothing,
      $sel:totalAttributes:NodeCounts' :: Maybe Int
totalAttributes = forall a. Maybe a
Prelude.Nothing,
      $sel:totalBranches:NodeCounts' :: Maybe Int
totalBranches = forall a. Maybe a
Prelude.Nothing,
      $sel:totalNodes:NodeCounts' :: Maybe Int
totalNodes = forall a. Maybe a
Prelude.Nothing,
      $sel:totalSensors:NodeCounts' :: Maybe Int
totalSensors = forall a. Maybe a
Prelude.Nothing
    }

-- | The total number of nodes in a vehicle network that represent actuators.
nodeCounts_totalActuators :: Lens.Lens' NodeCounts (Prelude.Maybe Prelude.Int)
nodeCounts_totalActuators :: Lens' NodeCounts (Maybe Int)
nodeCounts_totalActuators = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeCounts' {Maybe Int
totalActuators :: Maybe Int
$sel:totalActuators:NodeCounts' :: NodeCounts -> Maybe Int
totalActuators} -> Maybe Int
totalActuators) (\s :: NodeCounts
s@NodeCounts' {} Maybe Int
a -> NodeCounts
s {$sel:totalActuators:NodeCounts' :: Maybe Int
totalActuators = Maybe Int
a} :: NodeCounts)

-- | The total number of nodes in a vehicle network that represent
-- attributes.
nodeCounts_totalAttributes :: Lens.Lens' NodeCounts (Prelude.Maybe Prelude.Int)
nodeCounts_totalAttributes :: Lens' NodeCounts (Maybe Int)
nodeCounts_totalAttributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeCounts' {Maybe Int
totalAttributes :: Maybe Int
$sel:totalAttributes:NodeCounts' :: NodeCounts -> Maybe Int
totalAttributes} -> Maybe Int
totalAttributes) (\s :: NodeCounts
s@NodeCounts' {} Maybe Int
a -> NodeCounts
s {$sel:totalAttributes:NodeCounts' :: Maybe Int
totalAttributes = Maybe Int
a} :: NodeCounts)

-- | The total number of nodes in a vehicle network that represent branches.
nodeCounts_totalBranches :: Lens.Lens' NodeCounts (Prelude.Maybe Prelude.Int)
nodeCounts_totalBranches :: Lens' NodeCounts (Maybe Int)
nodeCounts_totalBranches = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeCounts' {Maybe Int
totalBranches :: Maybe Int
$sel:totalBranches:NodeCounts' :: NodeCounts -> Maybe Int
totalBranches} -> Maybe Int
totalBranches) (\s :: NodeCounts
s@NodeCounts' {} Maybe Int
a -> NodeCounts
s {$sel:totalBranches:NodeCounts' :: Maybe Int
totalBranches = Maybe Int
a} :: NodeCounts)

-- | The total number of nodes in a vehicle network.
nodeCounts_totalNodes :: Lens.Lens' NodeCounts (Prelude.Maybe Prelude.Int)
nodeCounts_totalNodes :: Lens' NodeCounts (Maybe Int)
nodeCounts_totalNodes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeCounts' {Maybe Int
totalNodes :: Maybe Int
$sel:totalNodes:NodeCounts' :: NodeCounts -> Maybe Int
totalNodes} -> Maybe Int
totalNodes) (\s :: NodeCounts
s@NodeCounts' {} Maybe Int
a -> NodeCounts
s {$sel:totalNodes:NodeCounts' :: Maybe Int
totalNodes = Maybe Int
a} :: NodeCounts)

-- | The total number of nodes in a vehicle network that represent sensors.
nodeCounts_totalSensors :: Lens.Lens' NodeCounts (Prelude.Maybe Prelude.Int)
nodeCounts_totalSensors :: Lens' NodeCounts (Maybe Int)
nodeCounts_totalSensors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeCounts' {Maybe Int
totalSensors :: Maybe Int
$sel:totalSensors:NodeCounts' :: NodeCounts -> Maybe Int
totalSensors} -> Maybe Int
totalSensors) (\s :: NodeCounts
s@NodeCounts' {} Maybe Int
a -> NodeCounts
s {$sel:totalSensors:NodeCounts' :: Maybe Int
totalSensors = Maybe Int
a} :: NodeCounts)

instance Data.FromJSON NodeCounts where
  parseJSON :: Value -> Parser NodeCounts
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"NodeCounts"
      ( \Object
x ->
          Maybe Int
-> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> NodeCounts
NodeCounts'
            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
"totalActuators")
            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
"totalAttributes")
            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
"totalBranches")
            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
"totalNodes")
            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
"totalSensors")
      )

instance Prelude.Hashable NodeCounts where
  hashWithSalt :: Int -> NodeCounts -> Int
hashWithSalt Int
_salt NodeCounts' {Maybe Int
totalSensors :: Maybe Int
totalNodes :: Maybe Int
totalBranches :: Maybe Int
totalAttributes :: Maybe Int
totalActuators :: Maybe Int
$sel:totalSensors:NodeCounts' :: NodeCounts -> Maybe Int
$sel:totalNodes:NodeCounts' :: NodeCounts -> Maybe Int
$sel:totalBranches:NodeCounts' :: NodeCounts -> Maybe Int
$sel:totalAttributes:NodeCounts' :: NodeCounts -> Maybe Int
$sel:totalActuators:NodeCounts' :: NodeCounts -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
totalActuators
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
totalAttributes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
totalBranches
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
totalNodes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
totalSensors

instance Prelude.NFData NodeCounts where
  rnf :: NodeCounts -> ()
rnf NodeCounts' {Maybe Int
totalSensors :: Maybe Int
totalNodes :: Maybe Int
totalBranches :: Maybe Int
totalAttributes :: Maybe Int
totalActuators :: Maybe Int
$sel:totalSensors:NodeCounts' :: NodeCounts -> Maybe Int
$sel:totalNodes:NodeCounts' :: NodeCounts -> Maybe Int
$sel:totalBranches:NodeCounts' :: NodeCounts -> Maybe Int
$sel:totalAttributes:NodeCounts' :: NodeCounts -> Maybe Int
$sel:totalActuators:NodeCounts' :: NodeCounts -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
totalActuators
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
totalAttributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
totalBranches
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
totalNodes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
totalSensors