{-# 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.EMRServerless.Types.WorkerTypeSpecificationInput
-- 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.EMRServerless.Types.WorkerTypeSpecificationInput where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EMRServerless.Types.ImageConfigurationInput
import qualified Amazonka.Prelude as Prelude

-- | The specifications for a worker type.
--
-- /See:/ 'newWorkerTypeSpecificationInput' smart constructor.
data WorkerTypeSpecificationInput = WorkerTypeSpecificationInput'
  { -- | The image configuration for a worker type.
    WorkerTypeSpecificationInput -> Maybe ImageConfigurationInput
imageConfiguration :: Prelude.Maybe ImageConfigurationInput
  }
  deriving (WorkerTypeSpecificationInput
-> WorkerTypeSpecificationInput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkerTypeSpecificationInput
-> WorkerTypeSpecificationInput -> Bool
$c/= :: WorkerTypeSpecificationInput
-> WorkerTypeSpecificationInput -> Bool
== :: WorkerTypeSpecificationInput
-> WorkerTypeSpecificationInput -> Bool
$c== :: WorkerTypeSpecificationInput
-> WorkerTypeSpecificationInput -> Bool
Prelude.Eq, ReadPrec [WorkerTypeSpecificationInput]
ReadPrec WorkerTypeSpecificationInput
Int -> ReadS WorkerTypeSpecificationInput
ReadS [WorkerTypeSpecificationInput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkerTypeSpecificationInput]
$creadListPrec :: ReadPrec [WorkerTypeSpecificationInput]
readPrec :: ReadPrec WorkerTypeSpecificationInput
$creadPrec :: ReadPrec WorkerTypeSpecificationInput
readList :: ReadS [WorkerTypeSpecificationInput]
$creadList :: ReadS [WorkerTypeSpecificationInput]
readsPrec :: Int -> ReadS WorkerTypeSpecificationInput
$creadsPrec :: Int -> ReadS WorkerTypeSpecificationInput
Prelude.Read, Int -> WorkerTypeSpecificationInput -> ShowS
[WorkerTypeSpecificationInput] -> ShowS
WorkerTypeSpecificationInput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkerTypeSpecificationInput] -> ShowS
$cshowList :: [WorkerTypeSpecificationInput] -> ShowS
show :: WorkerTypeSpecificationInput -> String
$cshow :: WorkerTypeSpecificationInput -> String
showsPrec :: Int -> WorkerTypeSpecificationInput -> ShowS
$cshowsPrec :: Int -> WorkerTypeSpecificationInput -> ShowS
Prelude.Show, forall x.
Rep WorkerTypeSpecificationInput x -> WorkerTypeSpecificationInput
forall x.
WorkerTypeSpecificationInput -> Rep WorkerTypeSpecificationInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WorkerTypeSpecificationInput x -> WorkerTypeSpecificationInput
$cfrom :: forall x.
WorkerTypeSpecificationInput -> Rep WorkerTypeSpecificationInput x
Prelude.Generic)

-- |
-- Create a value of 'WorkerTypeSpecificationInput' 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:
--
-- 'imageConfiguration', 'workerTypeSpecificationInput_imageConfiguration' - The image configuration for a worker type.
newWorkerTypeSpecificationInput ::
  WorkerTypeSpecificationInput
newWorkerTypeSpecificationInput :: WorkerTypeSpecificationInput
newWorkerTypeSpecificationInput =
  WorkerTypeSpecificationInput'
    { $sel:imageConfiguration:WorkerTypeSpecificationInput' :: Maybe ImageConfigurationInput
imageConfiguration =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The image configuration for a worker type.
workerTypeSpecificationInput_imageConfiguration :: Lens.Lens' WorkerTypeSpecificationInput (Prelude.Maybe ImageConfigurationInput)
workerTypeSpecificationInput_imageConfiguration :: Lens' WorkerTypeSpecificationInput (Maybe ImageConfigurationInput)
workerTypeSpecificationInput_imageConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkerTypeSpecificationInput' {Maybe ImageConfigurationInput
imageConfiguration :: Maybe ImageConfigurationInput
$sel:imageConfiguration:WorkerTypeSpecificationInput' :: WorkerTypeSpecificationInput -> Maybe ImageConfigurationInput
imageConfiguration} -> Maybe ImageConfigurationInput
imageConfiguration) (\s :: WorkerTypeSpecificationInput
s@WorkerTypeSpecificationInput' {} Maybe ImageConfigurationInput
a -> WorkerTypeSpecificationInput
s {$sel:imageConfiguration:WorkerTypeSpecificationInput' :: Maybe ImageConfigurationInput
imageConfiguration = Maybe ImageConfigurationInput
a} :: WorkerTypeSpecificationInput)

instance
  Prelude.Hashable
    WorkerTypeSpecificationInput
  where
  hashWithSalt :: Int -> WorkerTypeSpecificationInput -> Int
hashWithSalt Int
_salt WorkerTypeSpecificationInput' {Maybe ImageConfigurationInput
imageConfiguration :: Maybe ImageConfigurationInput
$sel:imageConfiguration:WorkerTypeSpecificationInput' :: WorkerTypeSpecificationInput -> Maybe ImageConfigurationInput
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ImageConfigurationInput
imageConfiguration

instance Prelude.NFData WorkerTypeSpecificationInput where
  rnf :: WorkerTypeSpecificationInput -> ()
rnf WorkerTypeSpecificationInput' {Maybe ImageConfigurationInput
imageConfiguration :: Maybe ImageConfigurationInput
$sel:imageConfiguration:WorkerTypeSpecificationInput' :: WorkerTypeSpecificationInput -> Maybe ImageConfigurationInput
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ImageConfigurationInput
imageConfiguration

instance Data.ToJSON WorkerTypeSpecificationInput where
  toJSON :: WorkerTypeSpecificationInput -> Value
toJSON WorkerTypeSpecificationInput' {Maybe ImageConfigurationInput
imageConfiguration :: Maybe ImageConfigurationInput
$sel:imageConfiguration:WorkerTypeSpecificationInput' :: WorkerTypeSpecificationInput -> Maybe ImageConfigurationInput
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"imageConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ImageConfigurationInput
imageConfiguration
          ]
      )