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

import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalyticsV2.Types.PropertyGroup
import qualified Amazonka.Lens as Lens
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
(EnvironmentPropertyUpdates -> EnvironmentPropertyUpdates -> Bool)
-> (EnvironmentPropertyUpdates
    -> EnvironmentPropertyUpdates -> Bool)
-> Eq EnvironmentPropertyUpdates
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]
(Int -> ReadS EnvironmentPropertyUpdates)
-> ReadS [EnvironmentPropertyUpdates]
-> ReadPrec EnvironmentPropertyUpdates
-> ReadPrec [EnvironmentPropertyUpdates]
-> Read 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
(Int -> EnvironmentPropertyUpdates -> ShowS)
-> (EnvironmentPropertyUpdates -> String)
-> ([EnvironmentPropertyUpdates] -> ShowS)
-> Show EnvironmentPropertyUpdates
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.
 EnvironmentPropertyUpdates -> Rep EnvironmentPropertyUpdates x)
-> (forall x.
    Rep EnvironmentPropertyUpdates x -> EnvironmentPropertyUpdates)
-> Generic EnvironmentPropertyUpdates
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' :: [PropertyGroup] -> EnvironmentPropertyUpdates
EnvironmentPropertyUpdates'
    { $sel:propertyGroups:EnvironmentPropertyUpdates' :: [PropertyGroup]
propertyGroups =
        [PropertyGroup]
forall a. Monoid a => a
Prelude.mempty
    }

-- | Describes updates to the execution property groups.
environmentPropertyUpdates_propertyGroups :: Lens.Lens' EnvironmentPropertyUpdates [PropertyGroup]
environmentPropertyUpdates_propertyGroups :: ([PropertyGroup] -> f [PropertyGroup])
-> EnvironmentPropertyUpdates -> f EnvironmentPropertyUpdates
environmentPropertyUpdates_propertyGroups = (EnvironmentPropertyUpdates -> [PropertyGroup])
-> (EnvironmentPropertyUpdates
    -> [PropertyGroup] -> EnvironmentPropertyUpdates)
-> Lens
     EnvironmentPropertyUpdates
     EnvironmentPropertyUpdates
     [PropertyGroup]
     [PropertyGroup]
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) (([PropertyGroup] -> f [PropertyGroup])
 -> EnvironmentPropertyUpdates -> f EnvironmentPropertyUpdates)
-> (([PropertyGroup] -> f [PropertyGroup])
    -> [PropertyGroup] -> f [PropertyGroup])
-> ([PropertyGroup] -> f [PropertyGroup])
-> EnvironmentPropertyUpdates
-> f EnvironmentPropertyUpdates
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([PropertyGroup] -> f [PropertyGroup])
-> [PropertyGroup] -> f [PropertyGroup]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.Hashable EnvironmentPropertyUpdates

instance Prelude.NFData EnvironmentPropertyUpdates

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