{-# 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.WorkerConfigurationRevisionSummary
-- 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.WorkerConfigurationRevisionSummary where

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

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

-- |
-- Create a value of 'WorkerConfigurationRevisionSummary' 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', 'workerConfigurationRevisionSummary_creationTime' - The time that a worker configuration revision was created.
--
-- 'revision', 'workerConfigurationRevisionSummary_revision' - The revision of a worker configuration.
--
-- 'description', 'workerConfigurationRevisionSummary_description' - The description of a worker configuration revision.
newWorkerConfigurationRevisionSummary ::
  WorkerConfigurationRevisionSummary
newWorkerConfigurationRevisionSummary :: WorkerConfigurationRevisionSummary
newWorkerConfigurationRevisionSummary =
  WorkerConfigurationRevisionSummary' :: Maybe POSIX
-> Maybe Integer
-> Maybe Text
-> WorkerConfigurationRevisionSummary
WorkerConfigurationRevisionSummary'
    { $sel:creationTime:WorkerConfigurationRevisionSummary' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:revision:WorkerConfigurationRevisionSummary' :: Maybe Integer
revision = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:description:WorkerConfigurationRevisionSummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The time that a worker configuration revision was created.
workerConfigurationRevisionSummary_creationTime :: Lens.Lens' WorkerConfigurationRevisionSummary (Prelude.Maybe Prelude.UTCTime)
workerConfigurationRevisionSummary_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> WorkerConfigurationRevisionSummary
-> f WorkerConfigurationRevisionSummary
workerConfigurationRevisionSummary_creationTime = (WorkerConfigurationRevisionSummary -> Maybe POSIX)
-> (WorkerConfigurationRevisionSummary
    -> Maybe POSIX -> WorkerConfigurationRevisionSummary)
-> Lens
     WorkerConfigurationRevisionSummary
     WorkerConfigurationRevisionSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkerConfigurationRevisionSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:WorkerConfigurationRevisionSummary' :: WorkerConfigurationRevisionSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: WorkerConfigurationRevisionSummary
s@WorkerConfigurationRevisionSummary' {} Maybe POSIX
a -> WorkerConfigurationRevisionSummary
s {$sel:creationTime:WorkerConfigurationRevisionSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: WorkerConfigurationRevisionSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> WorkerConfigurationRevisionSummary
 -> f WorkerConfigurationRevisionSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> WorkerConfigurationRevisionSummary
-> f WorkerConfigurationRevisionSummary
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 revision of a worker configuration.
workerConfigurationRevisionSummary_revision :: Lens.Lens' WorkerConfigurationRevisionSummary (Prelude.Maybe Prelude.Integer)
workerConfigurationRevisionSummary_revision :: (Maybe Integer -> f (Maybe Integer))
-> WorkerConfigurationRevisionSummary
-> f WorkerConfigurationRevisionSummary
workerConfigurationRevisionSummary_revision = (WorkerConfigurationRevisionSummary -> Maybe Integer)
-> (WorkerConfigurationRevisionSummary
    -> Maybe Integer -> WorkerConfigurationRevisionSummary)
-> Lens
     WorkerConfigurationRevisionSummary
     WorkerConfigurationRevisionSummary
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkerConfigurationRevisionSummary' {Maybe Integer
revision :: Maybe Integer
$sel:revision:WorkerConfigurationRevisionSummary' :: WorkerConfigurationRevisionSummary -> Maybe Integer
revision} -> Maybe Integer
revision) (\s :: WorkerConfigurationRevisionSummary
s@WorkerConfigurationRevisionSummary' {} Maybe Integer
a -> WorkerConfigurationRevisionSummary
s {$sel:revision:WorkerConfigurationRevisionSummary' :: Maybe Integer
revision = Maybe Integer
a} :: WorkerConfigurationRevisionSummary)

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

instance
  Core.FromJSON
    WorkerConfigurationRevisionSummary
  where
  parseJSON :: Value -> Parser WorkerConfigurationRevisionSummary
parseJSON =
    String
-> (Object -> Parser WorkerConfigurationRevisionSummary)
-> Value
-> Parser WorkerConfigurationRevisionSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"WorkerConfigurationRevisionSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Integer
-> Maybe Text
-> WorkerConfigurationRevisionSummary
WorkerConfigurationRevisionSummary'
            (Maybe POSIX
 -> Maybe Integer
 -> Maybe Text
 -> WorkerConfigurationRevisionSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Integer -> Maybe Text -> WorkerConfigurationRevisionSummary)
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 Integer -> Maybe Text -> WorkerConfigurationRevisionSummary)
-> Parser (Maybe Integer)
-> Parser (Maybe Text -> WorkerConfigurationRevisionSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"revision")
            Parser (Maybe Text -> WorkerConfigurationRevisionSummary)
-> Parser (Maybe Text) -> Parser WorkerConfigurationRevisionSummary
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
    WorkerConfigurationRevisionSummary

instance
  Prelude.NFData
    WorkerConfigurationRevisionSummary