{-# 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.KinesisAnalyticsV2.Types.EnvironmentPropertyUpdates
-- 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.KinesisAnalyticsV2.Types.EnvironmentPropertyUpdates where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.KinesisAnalyticsV2.Types.PropertyGroup
import qualified Amazonka.Prelude as Prelude

-- | Describes updates to the execution property groups for a Flink-based
-- Kinesis Data Analytics application or a Studio notebook.
--
-- /See:/ 'newEnvironmentPropertyUpdates' smart constructor.
data EnvironmentPropertyUpdates = EnvironmentPropertyUpdates'
  { -- | Describes updates to the execution property groups.
    EnvironmentPropertyUpdates -> [PropertyGroup]
propertyGroups :: [PropertyGroup]
  }
  deriving (EnvironmentPropertyUpdates -> EnvironmentPropertyUpdates -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnvironmentPropertyUpdates -> EnvironmentPropertyUpdates -> Bool
$c/= :: EnvironmentPropertyUpdates -> EnvironmentPropertyUpdates -> Bool
== :: EnvironmentPropertyUpdates -> EnvironmentPropertyUpdates -> Bool
$c== :: EnvironmentPropertyUpdates -> EnvironmentPropertyUpdates -> Bool
Prelude.Eq, ReadPrec [EnvironmentPropertyUpdates]
ReadPrec EnvironmentPropertyUpdates
Int -> ReadS EnvironmentPropertyUpdates
ReadS [EnvironmentPropertyUpdates]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnvironmentPropertyUpdates]
$creadListPrec :: ReadPrec [EnvironmentPropertyUpdates]
readPrec :: ReadPrec EnvironmentPropertyUpdates
$creadPrec :: ReadPrec EnvironmentPropertyUpdates
readList :: ReadS [EnvironmentPropertyUpdates]
$creadList :: ReadS [EnvironmentPropertyUpdates]
readsPrec :: Int -> ReadS EnvironmentPropertyUpdates
$creadsPrec :: Int -> ReadS EnvironmentPropertyUpdates
Prelude.Read, Int -> EnvironmentPropertyUpdates -> ShowS
[EnvironmentPropertyUpdates] -> ShowS
EnvironmentPropertyUpdates -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnvironmentPropertyUpdates] -> ShowS
$cshowList :: [EnvironmentPropertyUpdates] -> ShowS
show :: EnvironmentPropertyUpdates -> String
$cshow :: EnvironmentPropertyUpdates -> String
showsPrec :: Int -> EnvironmentPropertyUpdates -> ShowS
$cshowsPrec :: Int -> EnvironmentPropertyUpdates -> ShowS
Prelude.Show, forall x.
Rep EnvironmentPropertyUpdates x -> EnvironmentPropertyUpdates
forall x.
EnvironmentPropertyUpdates -> Rep EnvironmentPropertyUpdates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EnvironmentPropertyUpdates x -> EnvironmentPropertyUpdates
$cfrom :: forall x.
EnvironmentPropertyUpdates -> Rep EnvironmentPropertyUpdates x
Prelude.Generic)

-- |
-- Create a value of 'EnvironmentPropertyUpdates' 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:
--
-- 'propertyGroups', 'environmentPropertyUpdates_propertyGroups' - Describes updates to the execution property groups.
newEnvironmentPropertyUpdates ::
  EnvironmentPropertyUpdates
newEnvironmentPropertyUpdates :: EnvironmentPropertyUpdates
newEnvironmentPropertyUpdates =
  EnvironmentPropertyUpdates'
    { $sel:propertyGroups:EnvironmentPropertyUpdates' :: [PropertyGroup]
propertyGroups =
        forall a. Monoid a => a
Prelude.mempty
    }

-- | Describes updates to the execution property groups.
environmentPropertyUpdates_propertyGroups :: Lens.Lens' EnvironmentPropertyUpdates [PropertyGroup]
environmentPropertyUpdates_propertyGroups :: Lens' EnvironmentPropertyUpdates [PropertyGroup]
environmentPropertyUpdates_propertyGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentPropertyUpdates' {[PropertyGroup]
propertyGroups :: [PropertyGroup]
$sel:propertyGroups:EnvironmentPropertyUpdates' :: EnvironmentPropertyUpdates -> [PropertyGroup]
propertyGroups} -> [PropertyGroup]
propertyGroups) (\s :: EnvironmentPropertyUpdates
s@EnvironmentPropertyUpdates' {} [PropertyGroup]
a -> EnvironmentPropertyUpdates
s {$sel:propertyGroups:EnvironmentPropertyUpdates' :: [PropertyGroup]
propertyGroups = [PropertyGroup]
a} :: EnvironmentPropertyUpdates) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.Hashable EnvironmentPropertyUpdates where
  hashWithSalt :: Int -> EnvironmentPropertyUpdates -> Int
hashWithSalt Int
_salt EnvironmentPropertyUpdates' {[PropertyGroup]
propertyGroups :: [PropertyGroup]
$sel:propertyGroups:EnvironmentPropertyUpdates' :: EnvironmentPropertyUpdates -> [PropertyGroup]
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [PropertyGroup]
propertyGroups

instance Prelude.NFData EnvironmentPropertyUpdates where
  rnf :: EnvironmentPropertyUpdates -> ()
rnf EnvironmentPropertyUpdates' {[PropertyGroup]
propertyGroups :: [PropertyGroup]
$sel:propertyGroups:EnvironmentPropertyUpdates' :: EnvironmentPropertyUpdates -> [PropertyGroup]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf [PropertyGroup]
propertyGroups

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