{-# 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.WorkerConfigurationDescription
-- 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.WorkerConfigurationDescription 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.
--
-- /See:/ 'newWorkerConfigurationDescription' smart constructor.
data WorkerConfigurationDescription = WorkerConfigurationDescription'
  { -- | The revision of the worker configuration.
    WorkerConfigurationDescription -> Maybe Integer
revision :: Prelude.Maybe Prelude.Integer,
    -- | The Amazon Resource Name (ARN) of the worker configuration.
    WorkerConfigurationDescription -> Maybe Text
workerConfigurationArn :: Prelude.Maybe Prelude.Text
  }
  deriving (WorkerConfigurationDescription
-> WorkerConfigurationDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkerConfigurationDescription
-> WorkerConfigurationDescription -> Bool
$c/= :: WorkerConfigurationDescription
-> WorkerConfigurationDescription -> Bool
== :: WorkerConfigurationDescription
-> WorkerConfigurationDescription -> Bool
$c== :: WorkerConfigurationDescription
-> WorkerConfigurationDescription -> Bool
Prelude.Eq, ReadPrec [WorkerConfigurationDescription]
ReadPrec WorkerConfigurationDescription
Int -> ReadS WorkerConfigurationDescription
ReadS [WorkerConfigurationDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkerConfigurationDescription]
$creadListPrec :: ReadPrec [WorkerConfigurationDescription]
readPrec :: ReadPrec WorkerConfigurationDescription
$creadPrec :: ReadPrec WorkerConfigurationDescription
readList :: ReadS [WorkerConfigurationDescription]
$creadList :: ReadS [WorkerConfigurationDescription]
readsPrec :: Int -> ReadS WorkerConfigurationDescription
$creadsPrec :: Int -> ReadS WorkerConfigurationDescription
Prelude.Read, Int -> WorkerConfigurationDescription -> ShowS
[WorkerConfigurationDescription] -> ShowS
WorkerConfigurationDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkerConfigurationDescription] -> ShowS
$cshowList :: [WorkerConfigurationDescription] -> ShowS
show :: WorkerConfigurationDescription -> String
$cshow :: WorkerConfigurationDescription -> String
showsPrec :: Int -> WorkerConfigurationDescription -> ShowS
$cshowsPrec :: Int -> WorkerConfigurationDescription -> ShowS
Prelude.Show, forall x.
Rep WorkerConfigurationDescription x
-> WorkerConfigurationDescription
forall x.
WorkerConfigurationDescription
-> Rep WorkerConfigurationDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WorkerConfigurationDescription x
-> WorkerConfigurationDescription
$cfrom :: forall x.
WorkerConfigurationDescription
-> Rep WorkerConfigurationDescription x
Prelude.Generic)

-- |
-- Create a value of 'WorkerConfigurationDescription' 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:
--
-- 'revision', 'workerConfigurationDescription_revision' - The revision of the worker configuration.
--
-- 'workerConfigurationArn', 'workerConfigurationDescription_workerConfigurationArn' - The Amazon Resource Name (ARN) of the worker configuration.
newWorkerConfigurationDescription ::
  WorkerConfigurationDescription
newWorkerConfigurationDescription :: WorkerConfigurationDescription
newWorkerConfigurationDescription =
  WorkerConfigurationDescription'
    { $sel:revision:WorkerConfigurationDescription' :: Maybe Integer
revision =
        forall a. Maybe a
Prelude.Nothing,
      $sel:workerConfigurationArn:WorkerConfigurationDescription' :: Maybe Text
workerConfigurationArn = forall a. Maybe a
Prelude.Nothing
    }

-- | The revision of the worker configuration.
workerConfigurationDescription_revision :: Lens.Lens' WorkerConfigurationDescription (Prelude.Maybe Prelude.Integer)
workerConfigurationDescription_revision :: Lens' WorkerConfigurationDescription (Maybe Integer)
workerConfigurationDescription_revision = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkerConfigurationDescription' {Maybe Integer
revision :: Maybe Integer
$sel:revision:WorkerConfigurationDescription' :: WorkerConfigurationDescription -> Maybe Integer
revision} -> Maybe Integer
revision) (\s :: WorkerConfigurationDescription
s@WorkerConfigurationDescription' {} Maybe Integer
a -> WorkerConfigurationDescription
s {$sel:revision:WorkerConfigurationDescription' :: Maybe Integer
revision = Maybe Integer
a} :: WorkerConfigurationDescription)

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

instance Data.FromJSON WorkerConfigurationDescription where
  parseJSON :: Value -> Parser WorkerConfigurationDescription
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"WorkerConfigurationDescription"
      ( \Object
x ->
          Maybe Integer -> Maybe Text -> WorkerConfigurationDescription
WorkerConfigurationDescription'
            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
"revision")
            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
    WorkerConfigurationDescription
  where
  hashWithSalt :: Int -> WorkerConfigurationDescription -> Int
hashWithSalt
    Int
_salt
    WorkerConfigurationDescription' {Maybe Integer
Maybe Text
workerConfigurationArn :: Maybe Text
revision :: Maybe Integer
$sel:workerConfigurationArn:WorkerConfigurationDescription' :: WorkerConfigurationDescription -> Maybe Text
$sel:revision:WorkerConfigurationDescription' :: WorkerConfigurationDescription -> Maybe Integer
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
revision
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
workerConfigurationArn

instance
  Prelude.NFData
    WorkerConfigurationDescription
  where
  rnf :: WorkerConfigurationDescription -> ()
rnf WorkerConfigurationDescription' {Maybe Integer
Maybe Text
workerConfigurationArn :: Maybe Text
revision :: Maybe Integer
$sel:workerConfigurationArn:WorkerConfigurationDescription' :: WorkerConfigurationDescription -> Maybe Text
$sel:revision:WorkerConfigurationDescription' :: WorkerConfigurationDescription -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
revision
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
workerConfigurationArn