{-# 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.KafkaConnect.Types.WorkerConfigurationSummary
-- 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.KafkaConnect.Types.WorkerConfigurationSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.KafkaConnect.Types.WorkerConfigurationRevisionSummary
import qualified Amazonka.Prelude as Prelude

-- | The summary of a worker configuration.
--
-- /See:/ 'newWorkerConfigurationSummary' smart constructor.
data WorkerConfigurationSummary = WorkerConfigurationSummary'
  { -- | The time that a worker configuration was created.
    WorkerConfigurationSummary -> Maybe ISO8601
creationTime :: Prelude.Maybe Data.ISO8601,
    -- | The description of a worker configuration.
    WorkerConfigurationSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The latest revision of a worker configuration.
    WorkerConfigurationSummary
-> Maybe WorkerConfigurationRevisionSummary
latestRevision :: Prelude.Maybe WorkerConfigurationRevisionSummary,
    -- | The name of the worker configuration.
    WorkerConfigurationSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the worker configuration.
    WorkerConfigurationSummary -> Maybe Text
workerConfigurationArn :: Prelude.Maybe Prelude.Text
  }
  deriving (WorkerConfigurationSummary -> WorkerConfigurationSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkerConfigurationSummary -> WorkerConfigurationSummary -> Bool
$c/= :: WorkerConfigurationSummary -> WorkerConfigurationSummary -> Bool
== :: WorkerConfigurationSummary -> WorkerConfigurationSummary -> Bool
$c== :: WorkerConfigurationSummary -> WorkerConfigurationSummary -> Bool
Prelude.Eq, ReadPrec [WorkerConfigurationSummary]
ReadPrec WorkerConfigurationSummary
Int -> ReadS WorkerConfigurationSummary
ReadS [WorkerConfigurationSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkerConfigurationSummary]
$creadListPrec :: ReadPrec [WorkerConfigurationSummary]
readPrec :: ReadPrec WorkerConfigurationSummary
$creadPrec :: ReadPrec WorkerConfigurationSummary
readList :: ReadS [WorkerConfigurationSummary]
$creadList :: ReadS [WorkerConfigurationSummary]
readsPrec :: Int -> ReadS WorkerConfigurationSummary
$creadsPrec :: Int -> ReadS WorkerConfigurationSummary
Prelude.Read, Int -> WorkerConfigurationSummary -> ShowS
[WorkerConfigurationSummary] -> ShowS
WorkerConfigurationSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkerConfigurationSummary] -> ShowS
$cshowList :: [WorkerConfigurationSummary] -> ShowS
show :: WorkerConfigurationSummary -> String
$cshow :: WorkerConfigurationSummary -> String
showsPrec :: Int -> WorkerConfigurationSummary -> ShowS
$cshowsPrec :: Int -> WorkerConfigurationSummary -> ShowS
Prelude.Show, forall x.
Rep WorkerConfigurationSummary x -> WorkerConfigurationSummary
forall x.
WorkerConfigurationSummary -> Rep WorkerConfigurationSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WorkerConfigurationSummary x -> WorkerConfigurationSummary
$cfrom :: forall x.
WorkerConfigurationSummary -> Rep WorkerConfigurationSummary x
Prelude.Generic)

-- |
-- Create a value of 'WorkerConfigurationSummary' 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:
--
-- 'creationTime', 'workerConfigurationSummary_creationTime' - The time that a worker configuration was created.
--
-- 'description', 'workerConfigurationSummary_description' - The description of a worker configuration.
--
-- 'latestRevision', 'workerConfigurationSummary_latestRevision' - The latest revision of a worker configuration.
--
-- 'name', 'workerConfigurationSummary_name' - The name of the worker configuration.
--
-- 'workerConfigurationArn', 'workerConfigurationSummary_workerConfigurationArn' - The Amazon Resource Name (ARN) of the worker configuration.
newWorkerConfigurationSummary ::
  WorkerConfigurationSummary
newWorkerConfigurationSummary :: WorkerConfigurationSummary
newWorkerConfigurationSummary =
  WorkerConfigurationSummary'
    { $sel:creationTime:WorkerConfigurationSummary' :: Maybe ISO8601
creationTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:description:WorkerConfigurationSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:latestRevision:WorkerConfigurationSummary' :: Maybe WorkerConfigurationRevisionSummary
latestRevision = forall a. Maybe a
Prelude.Nothing,
      $sel:name:WorkerConfigurationSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:workerConfigurationArn:WorkerConfigurationSummary' :: Maybe Text
workerConfigurationArn = forall a. Maybe a
Prelude.Nothing
    }

-- | The time that a worker configuration was created.
workerConfigurationSummary_creationTime :: Lens.Lens' WorkerConfigurationSummary (Prelude.Maybe Prelude.UTCTime)
workerConfigurationSummary_creationTime :: Lens' WorkerConfigurationSummary (Maybe UTCTime)
workerConfigurationSummary_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkerConfigurationSummary' {Maybe ISO8601
creationTime :: Maybe ISO8601
$sel:creationTime:WorkerConfigurationSummary' :: WorkerConfigurationSummary -> Maybe ISO8601
creationTime} -> Maybe ISO8601
creationTime) (\s :: WorkerConfigurationSummary
s@WorkerConfigurationSummary' {} Maybe ISO8601
a -> WorkerConfigurationSummary
s {$sel:creationTime:WorkerConfigurationSummary' :: Maybe ISO8601
creationTime = Maybe ISO8601
a} :: WorkerConfigurationSummary) 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

-- | The description of a worker configuration.
workerConfigurationSummary_description :: Lens.Lens' WorkerConfigurationSummary (Prelude.Maybe Prelude.Text)
workerConfigurationSummary_description :: Lens' WorkerConfigurationSummary (Maybe Text)
workerConfigurationSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkerConfigurationSummary' {Maybe Text
description :: Maybe Text
$sel:description:WorkerConfigurationSummary' :: WorkerConfigurationSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: WorkerConfigurationSummary
s@WorkerConfigurationSummary' {} Maybe Text
a -> WorkerConfigurationSummary
s {$sel:description:WorkerConfigurationSummary' :: Maybe Text
description = Maybe Text
a} :: WorkerConfigurationSummary)

-- | The latest revision of a worker configuration.
workerConfigurationSummary_latestRevision :: Lens.Lens' WorkerConfigurationSummary (Prelude.Maybe WorkerConfigurationRevisionSummary)
workerConfigurationSummary_latestRevision :: Lens'
  WorkerConfigurationSummary
  (Maybe WorkerConfigurationRevisionSummary)
workerConfigurationSummary_latestRevision = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkerConfigurationSummary' {Maybe WorkerConfigurationRevisionSummary
latestRevision :: Maybe WorkerConfigurationRevisionSummary
$sel:latestRevision:WorkerConfigurationSummary' :: WorkerConfigurationSummary
-> Maybe WorkerConfigurationRevisionSummary
latestRevision} -> Maybe WorkerConfigurationRevisionSummary
latestRevision) (\s :: WorkerConfigurationSummary
s@WorkerConfigurationSummary' {} Maybe WorkerConfigurationRevisionSummary
a -> WorkerConfigurationSummary
s {$sel:latestRevision:WorkerConfigurationSummary' :: Maybe WorkerConfigurationRevisionSummary
latestRevision = Maybe WorkerConfigurationRevisionSummary
a} :: WorkerConfigurationSummary)

-- | The name of the worker configuration.
workerConfigurationSummary_name :: Lens.Lens' WorkerConfigurationSummary (Prelude.Maybe Prelude.Text)
workerConfigurationSummary_name :: Lens' WorkerConfigurationSummary (Maybe Text)
workerConfigurationSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkerConfigurationSummary' {Maybe Text
name :: Maybe Text
$sel:name:WorkerConfigurationSummary' :: WorkerConfigurationSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: WorkerConfigurationSummary
s@WorkerConfigurationSummary' {} Maybe Text
a -> WorkerConfigurationSummary
s {$sel:name:WorkerConfigurationSummary' :: Maybe Text
name = Maybe Text
a} :: WorkerConfigurationSummary)

-- | The Amazon Resource Name (ARN) of the worker configuration.
workerConfigurationSummary_workerConfigurationArn :: Lens.Lens' WorkerConfigurationSummary (Prelude.Maybe Prelude.Text)
workerConfigurationSummary_workerConfigurationArn :: Lens' WorkerConfigurationSummary (Maybe Text)
workerConfigurationSummary_workerConfigurationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkerConfigurationSummary' {Maybe Text
workerConfigurationArn :: Maybe Text
$sel:workerConfigurationArn:WorkerConfigurationSummary' :: WorkerConfigurationSummary -> Maybe Text
workerConfigurationArn} -> Maybe Text
workerConfigurationArn) (\s :: WorkerConfigurationSummary
s@WorkerConfigurationSummary' {} Maybe Text
a -> WorkerConfigurationSummary
s {$sel:workerConfigurationArn:WorkerConfigurationSummary' :: Maybe Text
workerConfigurationArn = Maybe Text
a} :: WorkerConfigurationSummary)

instance Data.FromJSON WorkerConfigurationSummary where
  parseJSON :: Value -> Parser WorkerConfigurationSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"WorkerConfigurationSummary"
      ( \Object
x ->
          Maybe ISO8601
-> Maybe Text
-> Maybe WorkerConfigurationRevisionSummary
-> Maybe Text
-> Maybe Text
-> WorkerConfigurationSummary
WorkerConfigurationSummary'
            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
"creationTime")
            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
"latestRevision")
            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
"name")
            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
"workerConfigurationArn")
      )

instance Prelude.Hashable WorkerConfigurationSummary where
  hashWithSalt :: Int -> WorkerConfigurationSummary -> Int
hashWithSalt Int
_salt WorkerConfigurationSummary' {Maybe Text
Maybe ISO8601
Maybe WorkerConfigurationRevisionSummary
workerConfigurationArn :: Maybe Text
name :: Maybe Text
latestRevision :: Maybe WorkerConfigurationRevisionSummary
description :: Maybe Text
creationTime :: Maybe ISO8601
$sel:workerConfigurationArn:WorkerConfigurationSummary' :: WorkerConfigurationSummary -> Maybe Text
$sel:name:WorkerConfigurationSummary' :: WorkerConfigurationSummary -> Maybe Text
$sel:latestRevision:WorkerConfigurationSummary' :: WorkerConfigurationSummary
-> Maybe WorkerConfigurationRevisionSummary
$sel:description:WorkerConfigurationSummary' :: WorkerConfigurationSummary -> Maybe Text
$sel:creationTime:WorkerConfigurationSummary' :: WorkerConfigurationSummary -> Maybe ISO8601
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WorkerConfigurationRevisionSummary
latestRevision
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
workerConfigurationArn

instance Prelude.NFData WorkerConfigurationSummary where
  rnf :: WorkerConfigurationSummary -> ()
rnf WorkerConfigurationSummary' {Maybe Text
Maybe ISO8601
Maybe WorkerConfigurationRevisionSummary
workerConfigurationArn :: Maybe Text
name :: Maybe Text
latestRevision :: Maybe WorkerConfigurationRevisionSummary
description :: Maybe Text
creationTime :: Maybe ISO8601
$sel:workerConfigurationArn:WorkerConfigurationSummary' :: WorkerConfigurationSummary -> Maybe Text
$sel:name:WorkerConfigurationSummary' :: WorkerConfigurationSummary -> Maybe Text
$sel:latestRevision:WorkerConfigurationSummary' :: WorkerConfigurationSummary
-> Maybe WorkerConfigurationRevisionSummary
$sel:description:WorkerConfigurationSummary' :: WorkerConfigurationSummary -> Maybe Text
$sel:creationTime:WorkerConfigurationSummary' :: WorkerConfigurationSummary -> Maybe ISO8601
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
creationTime
      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 WorkerConfigurationRevisionSummary
latestRevision
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
workerConfigurationArn