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

import qualified Amazonka.Core as Core
import Amazonka.KafkaConnect.Types.WorkerConfigurationRevisionSummary
import qualified Amazonka.Lens as Lens
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 POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | 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,
    -- | The description of a worker configuration.
    WorkerConfigurationSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (WorkerConfigurationSummary -> WorkerConfigurationSummary -> Bool
(WorkerConfigurationSummary -> WorkerConfigurationSummary -> Bool)
-> (WorkerConfigurationSummary
    -> WorkerConfigurationSummary -> Bool)
-> Eq WorkerConfigurationSummary
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]
(Int -> ReadS WorkerConfigurationSummary)
-> ReadS [WorkerConfigurationSummary]
-> ReadPrec WorkerConfigurationSummary
-> ReadPrec [WorkerConfigurationSummary]
-> Read 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
(Int -> WorkerConfigurationSummary -> ShowS)
-> (WorkerConfigurationSummary -> String)
-> ([WorkerConfigurationSummary] -> ShowS)
-> Show WorkerConfigurationSummary
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.
 WorkerConfigurationSummary -> Rep WorkerConfigurationSummary x)
-> (forall x.
    Rep WorkerConfigurationSummary x -> WorkerConfigurationSummary)
-> Generic WorkerConfigurationSummary
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.
--
-- '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.
--
-- 'description', 'workerConfigurationSummary_description' - The description of a worker configuration.
newWorkerConfigurationSummary ::
  WorkerConfigurationSummary
newWorkerConfigurationSummary :: WorkerConfigurationSummary
newWorkerConfigurationSummary =
  WorkerConfigurationSummary' :: Maybe POSIX
-> Maybe WorkerConfigurationRevisionSummary
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> WorkerConfigurationSummary
WorkerConfigurationSummary'
    { $sel:creationTime:WorkerConfigurationSummary' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:latestRevision:WorkerConfigurationSummary' :: Maybe WorkerConfigurationRevisionSummary
latestRevision = Maybe WorkerConfigurationRevisionSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:name:WorkerConfigurationSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:workerConfigurationArn:WorkerConfigurationSummary' :: Maybe Text
workerConfigurationArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:WorkerConfigurationSummary' :: Maybe Text
description = Maybe Text
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 :: (Maybe UTCTime -> f (Maybe UTCTime))
-> WorkerConfigurationSummary -> f WorkerConfigurationSummary
workerConfigurationSummary_creationTime = (WorkerConfigurationSummary -> Maybe POSIX)
-> (WorkerConfigurationSummary
    -> Maybe POSIX -> WorkerConfigurationSummary)
-> Lens
     WorkerConfigurationSummary
     WorkerConfigurationSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkerConfigurationSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:WorkerConfigurationSummary' :: WorkerConfigurationSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: WorkerConfigurationSummary
s@WorkerConfigurationSummary' {} Maybe POSIX
a -> WorkerConfigurationSummary
s {$sel:creationTime:WorkerConfigurationSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: WorkerConfigurationSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> WorkerConfigurationSummary -> f WorkerConfigurationSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> WorkerConfigurationSummary
-> f WorkerConfigurationSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The latest revision of a worker configuration.
workerConfigurationSummary_latestRevision :: Lens.Lens' WorkerConfigurationSummary (Prelude.Maybe WorkerConfigurationRevisionSummary)
workerConfigurationSummary_latestRevision :: (Maybe WorkerConfigurationRevisionSummary
 -> f (Maybe WorkerConfigurationRevisionSummary))
-> WorkerConfigurationSummary -> f WorkerConfigurationSummary
workerConfigurationSummary_latestRevision = (WorkerConfigurationSummary
 -> Maybe WorkerConfigurationRevisionSummary)
-> (WorkerConfigurationSummary
    -> Maybe WorkerConfigurationRevisionSummary
    -> WorkerConfigurationSummary)
-> Lens
     WorkerConfigurationSummary
     WorkerConfigurationSummary
     (Maybe WorkerConfigurationRevisionSummary)
     (Maybe WorkerConfigurationRevisionSummary)
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 :: (Maybe Text -> f (Maybe Text))
-> WorkerConfigurationSummary -> f WorkerConfigurationSummary
workerConfigurationSummary_name = (WorkerConfigurationSummary -> Maybe Text)
-> (WorkerConfigurationSummary
    -> Maybe Text -> WorkerConfigurationSummary)
-> Lens
     WorkerConfigurationSummary
     WorkerConfigurationSummary
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> WorkerConfigurationSummary -> f WorkerConfigurationSummary
workerConfigurationSummary_workerConfigurationArn = (WorkerConfigurationSummary -> Maybe Text)
-> (WorkerConfigurationSummary
    -> Maybe Text -> WorkerConfigurationSummary)
-> Lens
     WorkerConfigurationSummary
     WorkerConfigurationSummary
     (Maybe Text)
     (Maybe Text)
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)

-- | The description of a worker configuration.
workerConfigurationSummary_description :: Lens.Lens' WorkerConfigurationSummary (Prelude.Maybe Prelude.Text)
workerConfigurationSummary_description :: (Maybe Text -> f (Maybe Text))
-> WorkerConfigurationSummary -> f WorkerConfigurationSummary
workerConfigurationSummary_description = (WorkerConfigurationSummary -> Maybe Text)
-> (WorkerConfigurationSummary
    -> Maybe Text -> WorkerConfigurationSummary)
-> Lens
     WorkerConfigurationSummary
     WorkerConfigurationSummary
     (Maybe Text)
     (Maybe Text)
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)

instance Core.FromJSON WorkerConfigurationSummary where
  parseJSON :: Value -> Parser WorkerConfigurationSummary
parseJSON =
    String
-> (Object -> Parser WorkerConfigurationSummary)
-> Value
-> Parser WorkerConfigurationSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"WorkerConfigurationSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe WorkerConfigurationRevisionSummary
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> WorkerConfigurationSummary
WorkerConfigurationSummary'
            (Maybe POSIX
 -> Maybe WorkerConfigurationRevisionSummary
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> WorkerConfigurationSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe WorkerConfigurationRevisionSummary
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> WorkerConfigurationSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"creationTime")
            Parser
  (Maybe WorkerConfigurationRevisionSummary
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> WorkerConfigurationSummary)
-> Parser (Maybe WorkerConfigurationRevisionSummary)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> WorkerConfigurationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe WorkerConfigurationRevisionSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"latestRevision")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> WorkerConfigurationSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> WorkerConfigurationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
            Parser (Maybe Text -> Maybe Text -> WorkerConfigurationSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> WorkerConfigurationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"workerConfigurationArn")
            Parser (Maybe Text -> WorkerConfigurationSummary)
-> Parser (Maybe Text) -> Parser WorkerConfigurationSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"description")
      )

instance Prelude.Hashable WorkerConfigurationSummary

instance Prelude.NFData WorkerConfigurationSummary