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

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

-- | Describes the execution property groups.
environmentProperties_propertyGroups :: Lens.Lens' EnvironmentProperties [PropertyGroup]
environmentProperties_propertyGroups :: Lens' EnvironmentProperties [PropertyGroup]
environmentProperties_propertyGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentProperties' {[PropertyGroup]
propertyGroups :: [PropertyGroup]
$sel:propertyGroups:EnvironmentProperties' :: EnvironmentProperties -> [PropertyGroup]
propertyGroups} -> [PropertyGroup]
propertyGroups) (\s :: EnvironmentProperties
s@EnvironmentProperties' {} [PropertyGroup]
a -> EnvironmentProperties
s {$sel:propertyGroups:EnvironmentProperties' :: [PropertyGroup]
propertyGroups = [PropertyGroup]
a} :: EnvironmentProperties) 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 EnvironmentProperties where
  hashWithSalt :: Int -> EnvironmentProperties -> Int
hashWithSalt Int
_salt EnvironmentProperties' {[PropertyGroup]
propertyGroups :: [PropertyGroup]
$sel:propertyGroups:EnvironmentProperties' :: EnvironmentProperties -> [PropertyGroup]
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [PropertyGroup]
propertyGroups

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

instance Data.ToJSON EnvironmentProperties where
  toJSON :: EnvironmentProperties -> Value
toJSON EnvironmentProperties' {[PropertyGroup]
propertyGroups :: [PropertyGroup]
$sel:propertyGroups:EnvironmentProperties' :: EnvironmentProperties -> [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)
          ]
      )