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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 ISO8601
creationTime :: Prelude.Maybe Data.ISO8601,
    -- | The description of the worker configuration revision.
    WorkerConfigurationRevisionDescription -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Base64 encoded contents of the connect-distributed.properties file.
    WorkerConfigurationRevisionDescription -> Maybe (Sensitive Text)
propertiesFileContent :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The description of a revision of the worker configuration.
    WorkerConfigurationRevisionDescription -> Maybe Integer
revision :: Prelude.Maybe Prelude.Integer
  }
  deriving (WorkerConfigurationRevisionDescription
-> WorkerConfigurationRevisionDescription -> Bool
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, Int -> WorkerConfigurationRevisionDescription -> ShowS
[WorkerConfigurationRevisionDescription] -> ShowS
WorkerConfigurationRevisionDescription -> String
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.
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.
--
-- 'description', 'workerConfigurationRevisionDescription_description' - The description of the worker configuration revision.
--
-- 'propertiesFileContent', 'workerConfigurationRevisionDescription_propertiesFileContent' - Base64 encoded contents of the connect-distributed.properties file.
--
-- 'revision', 'workerConfigurationRevisionDescription_revision' - The description of a revision of the worker configuration.
newWorkerConfigurationRevisionDescription ::
  WorkerConfigurationRevisionDescription
newWorkerConfigurationRevisionDescription :: WorkerConfigurationRevisionDescription
newWorkerConfigurationRevisionDescription =
  WorkerConfigurationRevisionDescription'
    { $sel:creationTime:WorkerConfigurationRevisionDescription' :: Maybe ISO8601
creationTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:description:WorkerConfigurationRevisionDescription' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:propertiesFileContent:WorkerConfigurationRevisionDescription' :: Maybe (Sensitive Text)
propertiesFileContent =
        forall a. Maybe a
Prelude.Nothing,
      $sel:revision:WorkerConfigurationRevisionDescription' :: Maybe Integer
revision = 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 :: Lens' WorkerConfigurationRevisionDescription (Maybe UTCTime)
workerConfigurationRevisionDescription_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkerConfigurationRevisionDescription' {Maybe ISO8601
creationTime :: Maybe ISO8601
$sel:creationTime:WorkerConfigurationRevisionDescription' :: WorkerConfigurationRevisionDescription -> Maybe ISO8601
creationTime} -> Maybe ISO8601
creationTime) (\s :: WorkerConfigurationRevisionDescription
s@WorkerConfigurationRevisionDescription' {} Maybe ISO8601
a -> WorkerConfigurationRevisionDescription
s {$sel:creationTime:WorkerConfigurationRevisionDescription' :: Maybe ISO8601
creationTime = Maybe ISO8601
a} :: WorkerConfigurationRevisionDescription) 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 the worker configuration revision.
workerConfigurationRevisionDescription_description :: Lens.Lens' WorkerConfigurationRevisionDescription (Prelude.Maybe Prelude.Text)
workerConfigurationRevisionDescription_description :: Lens' WorkerConfigurationRevisionDescription (Maybe Text)
workerConfigurationRevisionDescription_description = 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)

-- | Base64 encoded contents of the connect-distributed.properties file.
workerConfigurationRevisionDescription_propertiesFileContent :: Lens.Lens' WorkerConfigurationRevisionDescription (Prelude.Maybe Prelude.Text)
workerConfigurationRevisionDescription_propertiesFileContent :: Lens' WorkerConfigurationRevisionDescription (Maybe Text)
workerConfigurationRevisionDescription_propertiesFileContent = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkerConfigurationRevisionDescription' {Maybe (Sensitive Text)
propertiesFileContent :: Maybe (Sensitive Text)
$sel:propertiesFileContent:WorkerConfigurationRevisionDescription' :: WorkerConfigurationRevisionDescription -> Maybe (Sensitive Text)
propertiesFileContent} -> Maybe (Sensitive Text)
propertiesFileContent) (\s :: WorkerConfigurationRevisionDescription
s@WorkerConfigurationRevisionDescription' {} Maybe (Sensitive Text)
a -> WorkerConfigurationRevisionDescription
s {$sel:propertiesFileContent:WorkerConfigurationRevisionDescription' :: Maybe (Sensitive Text)
propertiesFileContent = Maybe (Sensitive Text)
a} :: WorkerConfigurationRevisionDescription) 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. Iso' (Sensitive a) a
Data._Sensitive

-- | The description of a revision of the worker configuration.
workerConfigurationRevisionDescription_revision :: Lens.Lens' WorkerConfigurationRevisionDescription (Prelude.Maybe Prelude.Integer)
workerConfigurationRevisionDescription_revision :: Lens' WorkerConfigurationRevisionDescription (Maybe Integer)
workerConfigurationRevisionDescription_revision = 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)

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

instance
  Prelude.Hashable
    WorkerConfigurationRevisionDescription
  where
  hashWithSalt :: Int -> WorkerConfigurationRevisionDescription -> Int
hashWithSalt
    Int
_salt
    WorkerConfigurationRevisionDescription' {Maybe Integer
Maybe Text
Maybe (Sensitive Text)
Maybe ISO8601
revision :: Maybe Integer
propertiesFileContent :: Maybe (Sensitive Text)
description :: Maybe Text
creationTime :: Maybe ISO8601
$sel:revision:WorkerConfigurationRevisionDescription' :: WorkerConfigurationRevisionDescription -> Maybe Integer
$sel:propertiesFileContent:WorkerConfigurationRevisionDescription' :: WorkerConfigurationRevisionDescription -> Maybe (Sensitive Text)
$sel:description:WorkerConfigurationRevisionDescription' :: WorkerConfigurationRevisionDescription -> Maybe Text
$sel:creationTime:WorkerConfigurationRevisionDescription' :: WorkerConfigurationRevisionDescription -> 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 (Sensitive Text)
propertiesFileContent
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
revision

instance
  Prelude.NFData
    WorkerConfigurationRevisionDescription
  where
  rnf :: WorkerConfigurationRevisionDescription -> ()
rnf WorkerConfigurationRevisionDescription' {Maybe Integer
Maybe Text
Maybe (Sensitive Text)
Maybe ISO8601
revision :: Maybe Integer
propertiesFileContent :: Maybe (Sensitive Text)
description :: Maybe Text
creationTime :: Maybe ISO8601
$sel:revision:WorkerConfigurationRevisionDescription' :: WorkerConfigurationRevisionDescription -> Maybe Integer
$sel:propertiesFileContent:WorkerConfigurationRevisionDescription' :: WorkerConfigurationRevisionDescription -> Maybe (Sensitive Text)
$sel:description:WorkerConfigurationRevisionDescription' :: WorkerConfigurationRevisionDescription -> Maybe Text
$sel:creationTime:WorkerConfigurationRevisionDescription' :: WorkerConfigurationRevisionDescription -> 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 (Sensitive Text)
propertiesFileContent
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
revision