{-# 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-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.WorkerConfigurationDescription 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.
--
-- /See:/ 'newWorkerConfigurationDescription' smart constructor.
data WorkerConfigurationDescription = WorkerConfigurationDescription'
  { -- | The Amazon Resource Name (ARN) of the worker configuration.
    WorkerConfigurationDescription -> Maybe Text
workerConfigurationArn :: Prelude.Maybe Prelude.Text,
    -- | The revision of the worker configuration.
    WorkerConfigurationDescription -> Maybe Integer
revision :: Prelude.Maybe Prelude.Integer
  }
  deriving (WorkerConfigurationDescription
-> WorkerConfigurationDescription -> Bool
(WorkerConfigurationDescription
 -> WorkerConfigurationDescription -> Bool)
-> (WorkerConfigurationDescription
    -> WorkerConfigurationDescription -> Bool)
-> Eq WorkerConfigurationDescription
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]
(Int -> ReadS WorkerConfigurationDescription)
-> ReadS [WorkerConfigurationDescription]
-> ReadPrec WorkerConfigurationDescription
-> ReadPrec [WorkerConfigurationDescription]
-> Read 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
(Int -> WorkerConfigurationDescription -> ShowS)
-> (WorkerConfigurationDescription -> String)
-> ([WorkerConfigurationDescription] -> ShowS)
-> Show WorkerConfigurationDescription
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.
 WorkerConfigurationDescription
 -> Rep WorkerConfigurationDescription x)
-> (forall x.
    Rep WorkerConfigurationDescription x
    -> WorkerConfigurationDescription)
-> Generic WorkerConfigurationDescription
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:
--
-- 'workerConfigurationArn', 'workerConfigurationDescription_workerConfigurationArn' - The Amazon Resource Name (ARN) of the worker configuration.
--
-- 'revision', 'workerConfigurationDescription_revision' - The revision of the worker configuration.
newWorkerConfigurationDescription ::
  WorkerConfigurationDescription
newWorkerConfigurationDescription :: WorkerConfigurationDescription
newWorkerConfigurationDescription =
  WorkerConfigurationDescription' :: Maybe Text -> Maybe Integer -> WorkerConfigurationDescription
WorkerConfigurationDescription'
    { $sel:workerConfigurationArn:WorkerConfigurationDescription' :: Maybe Text
workerConfigurationArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:revision:WorkerConfigurationDescription' :: Maybe Integer
revision = Maybe Integer
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the worker configuration.
workerConfigurationDescription_workerConfigurationArn :: Lens.Lens' WorkerConfigurationDescription (Prelude.Maybe Prelude.Text)
workerConfigurationDescription_workerConfigurationArn :: (Maybe Text -> f (Maybe Text))
-> WorkerConfigurationDescription
-> f WorkerConfigurationDescription
workerConfigurationDescription_workerConfigurationArn = (WorkerConfigurationDescription -> Maybe Text)
-> (WorkerConfigurationDescription
    -> Maybe Text -> WorkerConfigurationDescription)
-> Lens
     WorkerConfigurationDescription
     WorkerConfigurationDescription
     (Maybe Text)
     (Maybe Text)
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)

-- | The revision of the worker configuration.
workerConfigurationDescription_revision :: Lens.Lens' WorkerConfigurationDescription (Prelude.Maybe Prelude.Integer)
workerConfigurationDescription_revision :: (Maybe Integer -> f (Maybe Integer))
-> WorkerConfigurationDescription
-> f WorkerConfigurationDescription
workerConfigurationDescription_revision = (WorkerConfigurationDescription -> Maybe Integer)
-> (WorkerConfigurationDescription
    -> Maybe Integer -> WorkerConfigurationDescription)
-> Lens
     WorkerConfigurationDescription
     WorkerConfigurationDescription
     (Maybe Integer)
     (Maybe Integer)
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)

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

instance
  Prelude.Hashable
    WorkerConfigurationDescription

instance
  Prelude.NFData
    WorkerConfigurationDescription