{-# 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.SageMaker.Types.ResourceConfigForUpdate
-- 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.SageMaker.Types.ResourceConfigForUpdate 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 @ResourceConfig@ to update @KeepAlivePeriodInSeconds@. Other fields
-- in the @ResourceConfig@ cannot be updated.
--
-- /See:/ 'newResourceConfigForUpdate' smart constructor.
data ResourceConfigForUpdate = ResourceConfigForUpdate'
  { -- | The @KeepAlivePeriodInSeconds@ value specified in the @ResourceConfig@
    -- to update.
    ResourceConfigForUpdate -> Natural
keepAlivePeriodInSeconds :: Prelude.Natural
  }
  deriving (ResourceConfigForUpdate -> ResourceConfigForUpdate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceConfigForUpdate -> ResourceConfigForUpdate -> Bool
$c/= :: ResourceConfigForUpdate -> ResourceConfigForUpdate -> Bool
== :: ResourceConfigForUpdate -> ResourceConfigForUpdate -> Bool
$c== :: ResourceConfigForUpdate -> ResourceConfigForUpdate -> Bool
Prelude.Eq, ReadPrec [ResourceConfigForUpdate]
ReadPrec ResourceConfigForUpdate
Int -> ReadS ResourceConfigForUpdate
ReadS [ResourceConfigForUpdate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceConfigForUpdate]
$creadListPrec :: ReadPrec [ResourceConfigForUpdate]
readPrec :: ReadPrec ResourceConfigForUpdate
$creadPrec :: ReadPrec ResourceConfigForUpdate
readList :: ReadS [ResourceConfigForUpdate]
$creadList :: ReadS [ResourceConfigForUpdate]
readsPrec :: Int -> ReadS ResourceConfigForUpdate
$creadsPrec :: Int -> ReadS ResourceConfigForUpdate
Prelude.Read, Int -> ResourceConfigForUpdate -> ShowS
[ResourceConfigForUpdate] -> ShowS
ResourceConfigForUpdate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceConfigForUpdate] -> ShowS
$cshowList :: [ResourceConfigForUpdate] -> ShowS
show :: ResourceConfigForUpdate -> String
$cshow :: ResourceConfigForUpdate -> String
showsPrec :: Int -> ResourceConfigForUpdate -> ShowS
$cshowsPrec :: Int -> ResourceConfigForUpdate -> ShowS
Prelude.Show, forall x. Rep ResourceConfigForUpdate x -> ResourceConfigForUpdate
forall x. ResourceConfigForUpdate -> Rep ResourceConfigForUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceConfigForUpdate x -> ResourceConfigForUpdate
$cfrom :: forall x. ResourceConfigForUpdate -> Rep ResourceConfigForUpdate x
Prelude.Generic)

-- |
-- Create a value of 'ResourceConfigForUpdate' 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:
--
-- 'keepAlivePeriodInSeconds', 'resourceConfigForUpdate_keepAlivePeriodInSeconds' - The @KeepAlivePeriodInSeconds@ value specified in the @ResourceConfig@
-- to update.
newResourceConfigForUpdate ::
  -- | 'keepAlivePeriodInSeconds'
  Prelude.Natural ->
  ResourceConfigForUpdate
newResourceConfigForUpdate :: Natural -> ResourceConfigForUpdate
newResourceConfigForUpdate Natural
pKeepAlivePeriodInSeconds_ =
  ResourceConfigForUpdate'
    { $sel:keepAlivePeriodInSeconds:ResourceConfigForUpdate' :: Natural
keepAlivePeriodInSeconds =
        Natural
pKeepAlivePeriodInSeconds_
    }

-- | The @KeepAlivePeriodInSeconds@ value specified in the @ResourceConfig@
-- to update.
resourceConfigForUpdate_keepAlivePeriodInSeconds :: Lens.Lens' ResourceConfigForUpdate Prelude.Natural
resourceConfigForUpdate_keepAlivePeriodInSeconds :: Lens' ResourceConfigForUpdate Natural
resourceConfigForUpdate_keepAlivePeriodInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceConfigForUpdate' {Natural
keepAlivePeriodInSeconds :: Natural
$sel:keepAlivePeriodInSeconds:ResourceConfigForUpdate' :: ResourceConfigForUpdate -> Natural
keepAlivePeriodInSeconds} -> Natural
keepAlivePeriodInSeconds) (\s :: ResourceConfigForUpdate
s@ResourceConfigForUpdate' {} Natural
a -> ResourceConfigForUpdate
s {$sel:keepAlivePeriodInSeconds:ResourceConfigForUpdate' :: Natural
keepAlivePeriodInSeconds = Natural
a} :: ResourceConfigForUpdate)

instance Prelude.Hashable ResourceConfigForUpdate where
  hashWithSalt :: Int -> ResourceConfigForUpdate -> Int
hashWithSalt Int
_salt ResourceConfigForUpdate' {Natural
keepAlivePeriodInSeconds :: Natural
$sel:keepAlivePeriodInSeconds:ResourceConfigForUpdate' :: ResourceConfigForUpdate -> Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
keepAlivePeriodInSeconds

instance Prelude.NFData ResourceConfigForUpdate where
  rnf :: ResourceConfigForUpdate -> ()
rnf ResourceConfigForUpdate' {Natural
keepAlivePeriodInSeconds :: Natural
$sel:keepAlivePeriodInSeconds:ResourceConfigForUpdate' :: ResourceConfigForUpdate -> Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Natural
keepAlivePeriodInSeconds

instance Data.ToJSON ResourceConfigForUpdate where
  toJSON :: ResourceConfigForUpdate -> Value
toJSON ResourceConfigForUpdate' {Natural
keepAlivePeriodInSeconds :: Natural
$sel:keepAlivePeriodInSeconds:ResourceConfigForUpdate' :: ResourceConfigForUpdate -> Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              ( Key
"KeepAlivePeriodInSeconds"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
keepAlivePeriodInSeconds
              )
          ]
      )