{-# 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.MigrationHubStrategy.Types.Collector
-- 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.MigrationHubStrategy.Types.Collector where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MigrationHubStrategy.Types.CollectorHealth
import Amazonka.MigrationHubStrategy.Types.ConfigurationSummary
import qualified Amazonka.Prelude as Prelude

-- | Process data collector that runs in the environment that you specify.
--
-- /See:/ 'newCollector' smart constructor.
data Collector = Collector'
  { -- | Indicates the health of a collector.
    Collector -> Maybe CollectorHealth
collectorHealth :: Prelude.Maybe CollectorHealth,
    -- | The ID of the collector.
    Collector -> Maybe Text
collectorId :: Prelude.Maybe Prelude.Text,
    -- | Current version of the collector that is running in the environment that
    -- you specify.
    Collector -> Maybe Text
collectorVersion :: Prelude.Maybe Prelude.Text,
    -- | Summary of the collector configuration.
    Collector -> Maybe ConfigurationSummary
configurationSummary :: Prelude.Maybe ConfigurationSummary,
    -- | Hostname of the server that is hosting the collector.
    Collector -> Maybe Text
hostName :: Prelude.Maybe Prelude.Text,
    -- | IP address of the server that is hosting the collector.
    Collector -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text,
    -- | Time when the collector last pinged the service.
    Collector -> Maybe Text
lastActivityTimeStamp :: Prelude.Maybe Prelude.Text,
    -- | Time when the collector registered with the service.
    Collector -> Maybe Text
registeredTimeStamp :: Prelude.Maybe Prelude.Text
  }
  deriving (Collector -> Collector -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Collector -> Collector -> Bool
$c/= :: Collector -> Collector -> Bool
== :: Collector -> Collector -> Bool
$c== :: Collector -> Collector -> Bool
Prelude.Eq, ReadPrec [Collector]
ReadPrec Collector
Int -> ReadS Collector
ReadS [Collector]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Collector]
$creadListPrec :: ReadPrec [Collector]
readPrec :: ReadPrec Collector
$creadPrec :: ReadPrec Collector
readList :: ReadS [Collector]
$creadList :: ReadS [Collector]
readsPrec :: Int -> ReadS Collector
$creadsPrec :: Int -> ReadS Collector
Prelude.Read, Int -> Collector -> ShowS
[Collector] -> ShowS
Collector -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Collector] -> ShowS
$cshowList :: [Collector] -> ShowS
show :: Collector -> String
$cshow :: Collector -> String
showsPrec :: Int -> Collector -> ShowS
$cshowsPrec :: Int -> Collector -> ShowS
Prelude.Show, forall x. Rep Collector x -> Collector
forall x. Collector -> Rep Collector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Collector x -> Collector
$cfrom :: forall x. Collector -> Rep Collector x
Prelude.Generic)

-- |
-- Create a value of 'Collector' 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:
--
-- 'collectorHealth', 'collector_collectorHealth' - Indicates the health of a collector.
--
-- 'collectorId', 'collector_collectorId' - The ID of the collector.
--
-- 'collectorVersion', 'collector_collectorVersion' - Current version of the collector that is running in the environment that
-- you specify.
--
-- 'configurationSummary', 'collector_configurationSummary' - Summary of the collector configuration.
--
-- 'hostName', 'collector_hostName' - Hostname of the server that is hosting the collector.
--
-- 'ipAddress', 'collector_ipAddress' - IP address of the server that is hosting the collector.
--
-- 'lastActivityTimeStamp', 'collector_lastActivityTimeStamp' - Time when the collector last pinged the service.
--
-- 'registeredTimeStamp', 'collector_registeredTimeStamp' - Time when the collector registered with the service.
newCollector ::
  Collector
newCollector :: Collector
newCollector =
  Collector'
    { $sel:collectorHealth:Collector' :: Maybe CollectorHealth
collectorHealth = forall a. Maybe a
Prelude.Nothing,
      $sel:collectorId:Collector' :: Maybe Text
collectorId = forall a. Maybe a
Prelude.Nothing,
      $sel:collectorVersion:Collector' :: Maybe Text
collectorVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:configurationSummary:Collector' :: Maybe ConfigurationSummary
configurationSummary = forall a. Maybe a
Prelude.Nothing,
      $sel:hostName:Collector' :: Maybe Text
hostName = forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddress:Collector' :: Maybe Text
ipAddress = forall a. Maybe a
Prelude.Nothing,
      $sel:lastActivityTimeStamp:Collector' :: Maybe Text
lastActivityTimeStamp = forall a. Maybe a
Prelude.Nothing,
      $sel:registeredTimeStamp:Collector' :: Maybe Text
registeredTimeStamp = forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates the health of a collector.
collector_collectorHealth :: Lens.Lens' Collector (Prelude.Maybe CollectorHealth)
collector_collectorHealth :: Lens' Collector (Maybe CollectorHealth)
collector_collectorHealth = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Collector' {Maybe CollectorHealth
collectorHealth :: Maybe CollectorHealth
$sel:collectorHealth:Collector' :: Collector -> Maybe CollectorHealth
collectorHealth} -> Maybe CollectorHealth
collectorHealth) (\s :: Collector
s@Collector' {} Maybe CollectorHealth
a -> Collector
s {$sel:collectorHealth:Collector' :: Maybe CollectorHealth
collectorHealth = Maybe CollectorHealth
a} :: Collector)

-- | The ID of the collector.
collector_collectorId :: Lens.Lens' Collector (Prelude.Maybe Prelude.Text)
collector_collectorId :: Lens' Collector (Maybe Text)
collector_collectorId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Collector' {Maybe Text
collectorId :: Maybe Text
$sel:collectorId:Collector' :: Collector -> Maybe Text
collectorId} -> Maybe Text
collectorId) (\s :: Collector
s@Collector' {} Maybe Text
a -> Collector
s {$sel:collectorId:Collector' :: Maybe Text
collectorId = Maybe Text
a} :: Collector)

-- | Current version of the collector that is running in the environment that
-- you specify.
collector_collectorVersion :: Lens.Lens' Collector (Prelude.Maybe Prelude.Text)
collector_collectorVersion :: Lens' Collector (Maybe Text)
collector_collectorVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Collector' {Maybe Text
collectorVersion :: Maybe Text
$sel:collectorVersion:Collector' :: Collector -> Maybe Text
collectorVersion} -> Maybe Text
collectorVersion) (\s :: Collector
s@Collector' {} Maybe Text
a -> Collector
s {$sel:collectorVersion:Collector' :: Maybe Text
collectorVersion = Maybe Text
a} :: Collector)

-- | Summary of the collector configuration.
collector_configurationSummary :: Lens.Lens' Collector (Prelude.Maybe ConfigurationSummary)
collector_configurationSummary :: Lens' Collector (Maybe ConfigurationSummary)
collector_configurationSummary = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Collector' {Maybe ConfigurationSummary
configurationSummary :: Maybe ConfigurationSummary
$sel:configurationSummary:Collector' :: Collector -> Maybe ConfigurationSummary
configurationSummary} -> Maybe ConfigurationSummary
configurationSummary) (\s :: Collector
s@Collector' {} Maybe ConfigurationSummary
a -> Collector
s {$sel:configurationSummary:Collector' :: Maybe ConfigurationSummary
configurationSummary = Maybe ConfigurationSummary
a} :: Collector)

-- | Hostname of the server that is hosting the collector.
collector_hostName :: Lens.Lens' Collector (Prelude.Maybe Prelude.Text)
collector_hostName :: Lens' Collector (Maybe Text)
collector_hostName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Collector' {Maybe Text
hostName :: Maybe Text
$sel:hostName:Collector' :: Collector -> Maybe Text
hostName} -> Maybe Text
hostName) (\s :: Collector
s@Collector' {} Maybe Text
a -> Collector
s {$sel:hostName:Collector' :: Maybe Text
hostName = Maybe Text
a} :: Collector)

-- | IP address of the server that is hosting the collector.
collector_ipAddress :: Lens.Lens' Collector (Prelude.Maybe Prelude.Text)
collector_ipAddress :: Lens' Collector (Maybe Text)
collector_ipAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Collector' {Maybe Text
ipAddress :: Maybe Text
$sel:ipAddress:Collector' :: Collector -> Maybe Text
ipAddress} -> Maybe Text
ipAddress) (\s :: Collector
s@Collector' {} Maybe Text
a -> Collector
s {$sel:ipAddress:Collector' :: Maybe Text
ipAddress = Maybe Text
a} :: Collector)

-- | Time when the collector last pinged the service.
collector_lastActivityTimeStamp :: Lens.Lens' Collector (Prelude.Maybe Prelude.Text)
collector_lastActivityTimeStamp :: Lens' Collector (Maybe Text)
collector_lastActivityTimeStamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Collector' {Maybe Text
lastActivityTimeStamp :: Maybe Text
$sel:lastActivityTimeStamp:Collector' :: Collector -> Maybe Text
lastActivityTimeStamp} -> Maybe Text
lastActivityTimeStamp) (\s :: Collector
s@Collector' {} Maybe Text
a -> Collector
s {$sel:lastActivityTimeStamp:Collector' :: Maybe Text
lastActivityTimeStamp = Maybe Text
a} :: Collector)

-- | Time when the collector registered with the service.
collector_registeredTimeStamp :: Lens.Lens' Collector (Prelude.Maybe Prelude.Text)
collector_registeredTimeStamp :: Lens' Collector (Maybe Text)
collector_registeredTimeStamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Collector' {Maybe Text
registeredTimeStamp :: Maybe Text
$sel:registeredTimeStamp:Collector' :: Collector -> Maybe Text
registeredTimeStamp} -> Maybe Text
registeredTimeStamp) (\s :: Collector
s@Collector' {} Maybe Text
a -> Collector
s {$sel:registeredTimeStamp:Collector' :: Maybe Text
registeredTimeStamp = Maybe Text
a} :: Collector)

instance Data.FromJSON Collector where
  parseJSON :: Value -> Parser Collector
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Collector"
      ( \Object
x ->
          Maybe CollectorHealth
-> Maybe Text
-> Maybe Text
-> Maybe ConfigurationSummary
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Collector
Collector'
            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
"collectorHealth")
            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
"collectorId")
            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
"collectorVersion")
            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
"configurationSummary")
            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
"hostName")
            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
"ipAddress")
            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
"lastActivityTimeStamp")
            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
"registeredTimeStamp")
      )

instance Prelude.Hashable Collector where
  hashWithSalt :: Int -> Collector -> Int
hashWithSalt Int
_salt Collector' {Maybe Text
Maybe CollectorHealth
Maybe ConfigurationSummary
registeredTimeStamp :: Maybe Text
lastActivityTimeStamp :: Maybe Text
ipAddress :: Maybe Text
hostName :: Maybe Text
configurationSummary :: Maybe ConfigurationSummary
collectorVersion :: Maybe Text
collectorId :: Maybe Text
collectorHealth :: Maybe CollectorHealth
$sel:registeredTimeStamp:Collector' :: Collector -> Maybe Text
$sel:lastActivityTimeStamp:Collector' :: Collector -> Maybe Text
$sel:ipAddress:Collector' :: Collector -> Maybe Text
$sel:hostName:Collector' :: Collector -> Maybe Text
$sel:configurationSummary:Collector' :: Collector -> Maybe ConfigurationSummary
$sel:collectorVersion:Collector' :: Collector -> Maybe Text
$sel:collectorId:Collector' :: Collector -> Maybe Text
$sel:collectorHealth:Collector' :: Collector -> Maybe CollectorHealth
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CollectorHealth
collectorHealth
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
collectorId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
collectorVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConfigurationSummary
configurationSummary
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hostName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipAddress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lastActivityTimeStamp
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
registeredTimeStamp

instance Prelude.NFData Collector where
  rnf :: Collector -> ()
rnf Collector' {Maybe Text
Maybe CollectorHealth
Maybe ConfigurationSummary
registeredTimeStamp :: Maybe Text
lastActivityTimeStamp :: Maybe Text
ipAddress :: Maybe Text
hostName :: Maybe Text
configurationSummary :: Maybe ConfigurationSummary
collectorVersion :: Maybe Text
collectorId :: Maybe Text
collectorHealth :: Maybe CollectorHealth
$sel:registeredTimeStamp:Collector' :: Collector -> Maybe Text
$sel:lastActivityTimeStamp:Collector' :: Collector -> Maybe Text
$sel:ipAddress:Collector' :: Collector -> Maybe Text
$sel:hostName:Collector' :: Collector -> Maybe Text
$sel:configurationSummary:Collector' :: Collector -> Maybe ConfigurationSummary
$sel:collectorVersion:Collector' :: Collector -> Maybe Text
$sel:collectorId:Collector' :: Collector -> Maybe Text
$sel:collectorHealth:Collector' :: Collector -> Maybe CollectorHealth
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe CollectorHealth
collectorHealth
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
collectorId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
collectorVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConfigurationSummary
configurationSummary
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hostName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ipAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lastActivityTimeStamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
registeredTimeStamp