{-# 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.Discovery.Types.CustomerAgentInfo
-- 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.Discovery.Types.CustomerAgentInfo where

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

-- | Inventory data for installed discovery agents.
--
-- /See:/ 'newCustomerAgentInfo' smart constructor.
data CustomerAgentInfo = CustomerAgentInfo'
  { -- | Number of active discovery agents.
    CustomerAgentInfo -> Int
activeAgents :: Prelude.Int,
    -- | Number of healthy discovery agents
    CustomerAgentInfo -> Int
healthyAgents :: Prelude.Int,
    -- | Number of blacklisted discovery agents.
    CustomerAgentInfo -> Int
blackListedAgents :: Prelude.Int,
    -- | Number of discovery agents with status SHUTDOWN.
    CustomerAgentInfo -> Int
shutdownAgents :: Prelude.Int,
    -- | Number of unhealthy discovery agents.
    CustomerAgentInfo -> Int
unhealthyAgents :: Prelude.Int,
    -- | Total number of discovery agents.
    CustomerAgentInfo -> Int
totalAgents :: Prelude.Int,
    -- | Number of unknown discovery agents.
    CustomerAgentInfo -> Int
unknownAgents :: Prelude.Int
  }
  deriving (CustomerAgentInfo -> CustomerAgentInfo -> Bool
(CustomerAgentInfo -> CustomerAgentInfo -> Bool)
-> (CustomerAgentInfo -> CustomerAgentInfo -> Bool)
-> Eq CustomerAgentInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomerAgentInfo -> CustomerAgentInfo -> Bool
$c/= :: CustomerAgentInfo -> CustomerAgentInfo -> Bool
== :: CustomerAgentInfo -> CustomerAgentInfo -> Bool
$c== :: CustomerAgentInfo -> CustomerAgentInfo -> Bool
Prelude.Eq, ReadPrec [CustomerAgentInfo]
ReadPrec CustomerAgentInfo
Int -> ReadS CustomerAgentInfo
ReadS [CustomerAgentInfo]
(Int -> ReadS CustomerAgentInfo)
-> ReadS [CustomerAgentInfo]
-> ReadPrec CustomerAgentInfo
-> ReadPrec [CustomerAgentInfo]
-> Read CustomerAgentInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomerAgentInfo]
$creadListPrec :: ReadPrec [CustomerAgentInfo]
readPrec :: ReadPrec CustomerAgentInfo
$creadPrec :: ReadPrec CustomerAgentInfo
readList :: ReadS [CustomerAgentInfo]
$creadList :: ReadS [CustomerAgentInfo]
readsPrec :: Int -> ReadS CustomerAgentInfo
$creadsPrec :: Int -> ReadS CustomerAgentInfo
Prelude.Read, Int -> CustomerAgentInfo -> ShowS
[CustomerAgentInfo] -> ShowS
CustomerAgentInfo -> String
(Int -> CustomerAgentInfo -> ShowS)
-> (CustomerAgentInfo -> String)
-> ([CustomerAgentInfo] -> ShowS)
-> Show CustomerAgentInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomerAgentInfo] -> ShowS
$cshowList :: [CustomerAgentInfo] -> ShowS
show :: CustomerAgentInfo -> String
$cshow :: CustomerAgentInfo -> String
showsPrec :: Int -> CustomerAgentInfo -> ShowS
$cshowsPrec :: Int -> CustomerAgentInfo -> ShowS
Prelude.Show, (forall x. CustomerAgentInfo -> Rep CustomerAgentInfo x)
-> (forall x. Rep CustomerAgentInfo x -> CustomerAgentInfo)
-> Generic CustomerAgentInfo
forall x. Rep CustomerAgentInfo x -> CustomerAgentInfo
forall x. CustomerAgentInfo -> Rep CustomerAgentInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CustomerAgentInfo x -> CustomerAgentInfo
$cfrom :: forall x. CustomerAgentInfo -> Rep CustomerAgentInfo x
Prelude.Generic)

-- |
-- Create a value of 'CustomerAgentInfo' 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:
--
-- 'activeAgents', 'customerAgentInfo_activeAgents' - Number of active discovery agents.
--
-- 'healthyAgents', 'customerAgentInfo_healthyAgents' - Number of healthy discovery agents
--
-- 'blackListedAgents', 'customerAgentInfo_blackListedAgents' - Number of blacklisted discovery agents.
--
-- 'shutdownAgents', 'customerAgentInfo_shutdownAgents' - Number of discovery agents with status SHUTDOWN.
--
-- 'unhealthyAgents', 'customerAgentInfo_unhealthyAgents' - Number of unhealthy discovery agents.
--
-- 'totalAgents', 'customerAgentInfo_totalAgents' - Total number of discovery agents.
--
-- 'unknownAgents', 'customerAgentInfo_unknownAgents' - Number of unknown discovery agents.
newCustomerAgentInfo ::
  -- | 'activeAgents'
  Prelude.Int ->
  -- | 'healthyAgents'
  Prelude.Int ->
  -- | 'blackListedAgents'
  Prelude.Int ->
  -- | 'shutdownAgents'
  Prelude.Int ->
  -- | 'unhealthyAgents'
  Prelude.Int ->
  -- | 'totalAgents'
  Prelude.Int ->
  -- | 'unknownAgents'
  Prelude.Int ->
  CustomerAgentInfo
newCustomerAgentInfo :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> CustomerAgentInfo
newCustomerAgentInfo
  Int
pActiveAgents_
  Int
pHealthyAgents_
  Int
pBlackListedAgents_
  Int
pShutdownAgents_
  Int
pUnhealthyAgents_
  Int
pTotalAgents_
  Int
pUnknownAgents_ =
    CustomerAgentInfo' :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> CustomerAgentInfo
CustomerAgentInfo'
      { $sel:activeAgents:CustomerAgentInfo' :: Int
activeAgents = Int
pActiveAgents_,
        $sel:healthyAgents:CustomerAgentInfo' :: Int
healthyAgents = Int
pHealthyAgents_,
        $sel:blackListedAgents:CustomerAgentInfo' :: Int
blackListedAgents = Int
pBlackListedAgents_,
        $sel:shutdownAgents:CustomerAgentInfo' :: Int
shutdownAgents = Int
pShutdownAgents_,
        $sel:unhealthyAgents:CustomerAgentInfo' :: Int
unhealthyAgents = Int
pUnhealthyAgents_,
        $sel:totalAgents:CustomerAgentInfo' :: Int
totalAgents = Int
pTotalAgents_,
        $sel:unknownAgents:CustomerAgentInfo' :: Int
unknownAgents = Int
pUnknownAgents_
      }

-- | Number of active discovery agents.
customerAgentInfo_activeAgents :: Lens.Lens' CustomerAgentInfo Prelude.Int
customerAgentInfo_activeAgents :: (Int -> f Int) -> CustomerAgentInfo -> f CustomerAgentInfo
customerAgentInfo_activeAgents = (CustomerAgentInfo -> Int)
-> (CustomerAgentInfo -> Int -> CustomerAgentInfo)
-> Lens CustomerAgentInfo CustomerAgentInfo Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomerAgentInfo' {Int
activeAgents :: Int
$sel:activeAgents:CustomerAgentInfo' :: CustomerAgentInfo -> Int
activeAgents} -> Int
activeAgents) (\s :: CustomerAgentInfo
s@CustomerAgentInfo' {} Int
a -> CustomerAgentInfo
s {$sel:activeAgents:CustomerAgentInfo' :: Int
activeAgents = Int
a} :: CustomerAgentInfo)

-- | Number of healthy discovery agents
customerAgentInfo_healthyAgents :: Lens.Lens' CustomerAgentInfo Prelude.Int
customerAgentInfo_healthyAgents :: (Int -> f Int) -> CustomerAgentInfo -> f CustomerAgentInfo
customerAgentInfo_healthyAgents = (CustomerAgentInfo -> Int)
-> (CustomerAgentInfo -> Int -> CustomerAgentInfo)
-> Lens CustomerAgentInfo CustomerAgentInfo Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomerAgentInfo' {Int
healthyAgents :: Int
$sel:healthyAgents:CustomerAgentInfo' :: CustomerAgentInfo -> Int
healthyAgents} -> Int
healthyAgents) (\s :: CustomerAgentInfo
s@CustomerAgentInfo' {} Int
a -> CustomerAgentInfo
s {$sel:healthyAgents:CustomerAgentInfo' :: Int
healthyAgents = Int
a} :: CustomerAgentInfo)

-- | Number of blacklisted discovery agents.
customerAgentInfo_blackListedAgents :: Lens.Lens' CustomerAgentInfo Prelude.Int
customerAgentInfo_blackListedAgents :: (Int -> f Int) -> CustomerAgentInfo -> f CustomerAgentInfo
customerAgentInfo_blackListedAgents = (CustomerAgentInfo -> Int)
-> (CustomerAgentInfo -> Int -> CustomerAgentInfo)
-> Lens CustomerAgentInfo CustomerAgentInfo Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomerAgentInfo' {Int
blackListedAgents :: Int
$sel:blackListedAgents:CustomerAgentInfo' :: CustomerAgentInfo -> Int
blackListedAgents} -> Int
blackListedAgents) (\s :: CustomerAgentInfo
s@CustomerAgentInfo' {} Int
a -> CustomerAgentInfo
s {$sel:blackListedAgents:CustomerAgentInfo' :: Int
blackListedAgents = Int
a} :: CustomerAgentInfo)

-- | Number of discovery agents with status SHUTDOWN.
customerAgentInfo_shutdownAgents :: Lens.Lens' CustomerAgentInfo Prelude.Int
customerAgentInfo_shutdownAgents :: (Int -> f Int) -> CustomerAgentInfo -> f CustomerAgentInfo
customerAgentInfo_shutdownAgents = (CustomerAgentInfo -> Int)
-> (CustomerAgentInfo -> Int -> CustomerAgentInfo)
-> Lens CustomerAgentInfo CustomerAgentInfo Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomerAgentInfo' {Int
shutdownAgents :: Int
$sel:shutdownAgents:CustomerAgentInfo' :: CustomerAgentInfo -> Int
shutdownAgents} -> Int
shutdownAgents) (\s :: CustomerAgentInfo
s@CustomerAgentInfo' {} Int
a -> CustomerAgentInfo
s {$sel:shutdownAgents:CustomerAgentInfo' :: Int
shutdownAgents = Int
a} :: CustomerAgentInfo)

-- | Number of unhealthy discovery agents.
customerAgentInfo_unhealthyAgents :: Lens.Lens' CustomerAgentInfo Prelude.Int
customerAgentInfo_unhealthyAgents :: (Int -> f Int) -> CustomerAgentInfo -> f CustomerAgentInfo
customerAgentInfo_unhealthyAgents = (CustomerAgentInfo -> Int)
-> (CustomerAgentInfo -> Int -> CustomerAgentInfo)
-> Lens CustomerAgentInfo CustomerAgentInfo Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomerAgentInfo' {Int
unhealthyAgents :: Int
$sel:unhealthyAgents:CustomerAgentInfo' :: CustomerAgentInfo -> Int
unhealthyAgents} -> Int
unhealthyAgents) (\s :: CustomerAgentInfo
s@CustomerAgentInfo' {} Int
a -> CustomerAgentInfo
s {$sel:unhealthyAgents:CustomerAgentInfo' :: Int
unhealthyAgents = Int
a} :: CustomerAgentInfo)

-- | Total number of discovery agents.
customerAgentInfo_totalAgents :: Lens.Lens' CustomerAgentInfo Prelude.Int
customerAgentInfo_totalAgents :: (Int -> f Int) -> CustomerAgentInfo -> f CustomerAgentInfo
customerAgentInfo_totalAgents = (CustomerAgentInfo -> Int)
-> (CustomerAgentInfo -> Int -> CustomerAgentInfo)
-> Lens CustomerAgentInfo CustomerAgentInfo Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomerAgentInfo' {Int
totalAgents :: Int
$sel:totalAgents:CustomerAgentInfo' :: CustomerAgentInfo -> Int
totalAgents} -> Int
totalAgents) (\s :: CustomerAgentInfo
s@CustomerAgentInfo' {} Int
a -> CustomerAgentInfo
s {$sel:totalAgents:CustomerAgentInfo' :: Int
totalAgents = Int
a} :: CustomerAgentInfo)

-- | Number of unknown discovery agents.
customerAgentInfo_unknownAgents :: Lens.Lens' CustomerAgentInfo Prelude.Int
customerAgentInfo_unknownAgents :: (Int -> f Int) -> CustomerAgentInfo -> f CustomerAgentInfo
customerAgentInfo_unknownAgents = (CustomerAgentInfo -> Int)
-> (CustomerAgentInfo -> Int -> CustomerAgentInfo)
-> Lens CustomerAgentInfo CustomerAgentInfo Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomerAgentInfo' {Int
unknownAgents :: Int
$sel:unknownAgents:CustomerAgentInfo' :: CustomerAgentInfo -> Int
unknownAgents} -> Int
unknownAgents) (\s :: CustomerAgentInfo
s@CustomerAgentInfo' {} Int
a -> CustomerAgentInfo
s {$sel:unknownAgents:CustomerAgentInfo' :: Int
unknownAgents = Int
a} :: CustomerAgentInfo)

instance Core.FromJSON CustomerAgentInfo where
  parseJSON :: Value -> Parser CustomerAgentInfo
parseJSON =
    String
-> (Object -> Parser CustomerAgentInfo)
-> Value
-> Parser CustomerAgentInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CustomerAgentInfo"
      ( \Object
x ->
          Int -> Int -> Int -> Int -> Int -> Int -> Int -> CustomerAgentInfo
CustomerAgentInfo'
            (Int
 -> Int -> Int -> Int -> Int -> Int -> Int -> CustomerAgentInfo)
-> Parser Int
-> Parser
     (Int -> Int -> Int -> Int -> Int -> Int -> CustomerAgentInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"activeAgents")
            Parser
  (Int -> Int -> Int -> Int -> Int -> Int -> CustomerAgentInfo)
-> Parser Int
-> Parser (Int -> Int -> Int -> Int -> Int -> CustomerAgentInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"healthyAgents")
            Parser (Int -> Int -> Int -> Int -> Int -> CustomerAgentInfo)
-> Parser Int
-> Parser (Int -> Int -> Int -> Int -> CustomerAgentInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"blackListedAgents")
            Parser (Int -> Int -> Int -> Int -> CustomerAgentInfo)
-> Parser Int -> Parser (Int -> Int -> Int -> CustomerAgentInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"shutdownAgents")
            Parser (Int -> Int -> Int -> CustomerAgentInfo)
-> Parser Int -> Parser (Int -> Int -> CustomerAgentInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"unhealthyAgents")
            Parser (Int -> Int -> CustomerAgentInfo)
-> Parser Int -> Parser (Int -> CustomerAgentInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"totalAgents")
            Parser (Int -> CustomerAgentInfo)
-> Parser Int -> Parser CustomerAgentInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"unknownAgents")
      )

instance Prelude.Hashable CustomerAgentInfo

instance Prelude.NFData CustomerAgentInfo