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

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

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

-- |
-- Create a value of 'WorkerConfigurationRevisionDescription' 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', 'workerConfigurationRevisionDescription_creationTime' - The time that the worker configuration was created.
--
-- 'revision', 'workerConfigurationRevisionDescription_revision' - The description of a revision of the worker configuration.
--
-- 'propertiesFileContent', 'workerConfigurationRevisionDescription_propertiesFileContent' - Base64 encoded contents of the connect-distributed.properties file.
--
-- 'description', 'workerConfigurationRevisionDescription_description' - The description of the worker configuration revision.
newWorkerConfigurationRevisionDescription ::
  WorkerConfigurationRevisionDescription
newWorkerConfigurationRevisionDescription :: WorkerConfigurationRevisionDescription
newWorkerConfigurationRevisionDescription =
  WorkerConfigurationRevisionDescription' :: Maybe POSIX
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> WorkerConfigurationRevisionDescription
WorkerConfigurationRevisionDescription'
    { $sel:creationTime:WorkerConfigurationRevisionDescription' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:revision:WorkerConfigurationRevisionDescription' :: Maybe Integer
revision = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:propertiesFileContent:WorkerConfigurationRevisionDescription' :: Maybe Text
propertiesFileContent =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:WorkerConfigurationRevisionDescription' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

-- | Base64 encoded contents of the connect-distributed.properties file.
workerConfigurationRevisionDescription_propertiesFileContent :: Lens.Lens' WorkerConfigurationRevisionDescription (Prelude.Maybe Prelude.Text)
workerConfigurationRevisionDescription_propertiesFileContent :: (Maybe Text -> f (Maybe Text))
-> WorkerConfigurationRevisionDescription
-> f WorkerConfigurationRevisionDescription
workerConfigurationRevisionDescription_propertiesFileContent = (WorkerConfigurationRevisionDescription -> Maybe Text)
-> (WorkerConfigurationRevisionDescription
    -> Maybe Text -> WorkerConfigurationRevisionDescription)
-> Lens
     WorkerConfigurationRevisionDescription
     WorkerConfigurationRevisionDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkerConfigurationRevisionDescription' {Maybe Text
propertiesFileContent :: Maybe Text
$sel:propertiesFileContent:WorkerConfigurationRevisionDescription' :: WorkerConfigurationRevisionDescription -> Maybe Text
propertiesFileContent} -> Maybe Text
propertiesFileContent) (\s :: WorkerConfigurationRevisionDescription
s@WorkerConfigurationRevisionDescription' {} Maybe Text
a -> WorkerConfigurationRevisionDescription
s {$sel:propertiesFileContent:WorkerConfigurationRevisionDescription' :: Maybe Text
propertiesFileContent = Maybe Text
a} :: WorkerConfigurationRevisionDescription)

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

instance
  Core.FromJSON
    WorkerConfigurationRevisionDescription
  where
  parseJSON :: Value -> Parser WorkerConfigurationRevisionDescription
parseJSON =
    String
-> (Object -> Parser WorkerConfigurationRevisionDescription)
-> Value
-> Parser WorkerConfigurationRevisionDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"WorkerConfigurationRevisionDescription"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> WorkerConfigurationRevisionDescription
WorkerConfigurationRevisionDescription'
            (Maybe POSIX
 -> Maybe Integer
 -> Maybe Text
 -> Maybe Text
 -> WorkerConfigurationRevisionDescription)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> WorkerConfigurationRevisionDescription)
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
   -> Maybe Text
   -> WorkerConfigurationRevisionDescription)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Text
      -> Maybe Text -> WorkerConfigurationRevisionDescription)
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
   -> Maybe Text -> WorkerConfigurationRevisionDescription)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> WorkerConfigurationRevisionDescription)
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
"propertiesFileContent")
            Parser (Maybe Text -> WorkerConfigurationRevisionDescription)
-> Parser (Maybe Text)
-> Parser WorkerConfigurationRevisionDescription
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
    WorkerConfigurationRevisionDescription

instance
  Prelude.NFData
    WorkerConfigurationRevisionDescription