{-# 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.SecurityHub.Types.AwsElasticBeanstalkEnvironmentOptionSetting
-- 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.SecurityHub.Types.AwsElasticBeanstalkEnvironmentOptionSetting where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A configuration option setting for the environment.
--
-- /See:/ 'newAwsElasticBeanstalkEnvironmentOptionSetting' smart constructor.
data AwsElasticBeanstalkEnvironmentOptionSetting = AwsElasticBeanstalkEnvironmentOptionSetting'
  { -- | The name of the option.
    AwsElasticBeanstalkEnvironmentOptionSetting -> Maybe Text
optionName :: Prelude.Maybe Prelude.Text,
    -- | The name of the resource.
    AwsElasticBeanstalkEnvironmentOptionSetting -> Maybe Text
resourceName :: Prelude.Maybe Prelude.Text,
    -- | The type of resource that the configuration option is associated with.
    AwsElasticBeanstalkEnvironmentOptionSetting -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text,
    -- | The value of the configuration setting.
    AwsElasticBeanstalkEnvironmentOptionSetting -> Maybe Text
value :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsElasticBeanstalkEnvironmentOptionSetting
-> AwsElasticBeanstalkEnvironmentOptionSetting -> Bool
(AwsElasticBeanstalkEnvironmentOptionSetting
 -> AwsElasticBeanstalkEnvironmentOptionSetting -> Bool)
-> (AwsElasticBeanstalkEnvironmentOptionSetting
    -> AwsElasticBeanstalkEnvironmentOptionSetting -> Bool)
-> Eq AwsElasticBeanstalkEnvironmentOptionSetting
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsElasticBeanstalkEnvironmentOptionSetting
-> AwsElasticBeanstalkEnvironmentOptionSetting -> Bool
$c/= :: AwsElasticBeanstalkEnvironmentOptionSetting
-> AwsElasticBeanstalkEnvironmentOptionSetting -> Bool
== :: AwsElasticBeanstalkEnvironmentOptionSetting
-> AwsElasticBeanstalkEnvironmentOptionSetting -> Bool
$c== :: AwsElasticBeanstalkEnvironmentOptionSetting
-> AwsElasticBeanstalkEnvironmentOptionSetting -> Bool
Prelude.Eq, ReadPrec [AwsElasticBeanstalkEnvironmentOptionSetting]
ReadPrec AwsElasticBeanstalkEnvironmentOptionSetting
Int -> ReadS AwsElasticBeanstalkEnvironmentOptionSetting
ReadS [AwsElasticBeanstalkEnvironmentOptionSetting]
(Int -> ReadS AwsElasticBeanstalkEnvironmentOptionSetting)
-> ReadS [AwsElasticBeanstalkEnvironmentOptionSetting]
-> ReadPrec AwsElasticBeanstalkEnvironmentOptionSetting
-> ReadPrec [AwsElasticBeanstalkEnvironmentOptionSetting]
-> Read AwsElasticBeanstalkEnvironmentOptionSetting
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsElasticBeanstalkEnvironmentOptionSetting]
$creadListPrec :: ReadPrec [AwsElasticBeanstalkEnvironmentOptionSetting]
readPrec :: ReadPrec AwsElasticBeanstalkEnvironmentOptionSetting
$creadPrec :: ReadPrec AwsElasticBeanstalkEnvironmentOptionSetting
readList :: ReadS [AwsElasticBeanstalkEnvironmentOptionSetting]
$creadList :: ReadS [AwsElasticBeanstalkEnvironmentOptionSetting]
readsPrec :: Int -> ReadS AwsElasticBeanstalkEnvironmentOptionSetting
$creadsPrec :: Int -> ReadS AwsElasticBeanstalkEnvironmentOptionSetting
Prelude.Read, Int -> AwsElasticBeanstalkEnvironmentOptionSetting -> ShowS
[AwsElasticBeanstalkEnvironmentOptionSetting] -> ShowS
AwsElasticBeanstalkEnvironmentOptionSetting -> String
(Int -> AwsElasticBeanstalkEnvironmentOptionSetting -> ShowS)
-> (AwsElasticBeanstalkEnvironmentOptionSetting -> String)
-> ([AwsElasticBeanstalkEnvironmentOptionSetting] -> ShowS)
-> Show AwsElasticBeanstalkEnvironmentOptionSetting
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsElasticBeanstalkEnvironmentOptionSetting] -> ShowS
$cshowList :: [AwsElasticBeanstalkEnvironmentOptionSetting] -> ShowS
show :: AwsElasticBeanstalkEnvironmentOptionSetting -> String
$cshow :: AwsElasticBeanstalkEnvironmentOptionSetting -> String
showsPrec :: Int -> AwsElasticBeanstalkEnvironmentOptionSetting -> ShowS
$cshowsPrec :: Int -> AwsElasticBeanstalkEnvironmentOptionSetting -> ShowS
Prelude.Show, (forall x.
 AwsElasticBeanstalkEnvironmentOptionSetting
 -> Rep AwsElasticBeanstalkEnvironmentOptionSetting x)
-> (forall x.
    Rep AwsElasticBeanstalkEnvironmentOptionSetting x
    -> AwsElasticBeanstalkEnvironmentOptionSetting)
-> Generic AwsElasticBeanstalkEnvironmentOptionSetting
forall x.
Rep AwsElasticBeanstalkEnvironmentOptionSetting x
-> AwsElasticBeanstalkEnvironmentOptionSetting
forall x.
AwsElasticBeanstalkEnvironmentOptionSetting
-> Rep AwsElasticBeanstalkEnvironmentOptionSetting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsElasticBeanstalkEnvironmentOptionSetting x
-> AwsElasticBeanstalkEnvironmentOptionSetting
$cfrom :: forall x.
AwsElasticBeanstalkEnvironmentOptionSetting
-> Rep AwsElasticBeanstalkEnvironmentOptionSetting x
Prelude.Generic)

-- |
-- Create a value of 'AwsElasticBeanstalkEnvironmentOptionSetting' 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:
--
-- 'optionName', 'awsElasticBeanstalkEnvironmentOptionSetting_optionName' - The name of the option.
--
-- 'resourceName', 'awsElasticBeanstalkEnvironmentOptionSetting_resourceName' - The name of the resource.
--
-- 'namespace', 'awsElasticBeanstalkEnvironmentOptionSetting_namespace' - The type of resource that the configuration option is associated with.
--
-- 'value', 'awsElasticBeanstalkEnvironmentOptionSetting_value' - The value of the configuration setting.
newAwsElasticBeanstalkEnvironmentOptionSetting ::
  AwsElasticBeanstalkEnvironmentOptionSetting
newAwsElasticBeanstalkEnvironmentOptionSetting :: AwsElasticBeanstalkEnvironmentOptionSetting
newAwsElasticBeanstalkEnvironmentOptionSetting =
  AwsElasticBeanstalkEnvironmentOptionSetting' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsElasticBeanstalkEnvironmentOptionSetting
AwsElasticBeanstalkEnvironmentOptionSetting'
    { $sel:optionName:AwsElasticBeanstalkEnvironmentOptionSetting' :: Maybe Text
optionName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceName:AwsElasticBeanstalkEnvironmentOptionSetting' :: Maybe Text
resourceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:namespace:AwsElasticBeanstalkEnvironmentOptionSetting' :: Maybe Text
namespace = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:value:AwsElasticBeanstalkEnvironmentOptionSetting' :: Maybe Text
value = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the option.
awsElasticBeanstalkEnvironmentOptionSetting_optionName :: Lens.Lens' AwsElasticBeanstalkEnvironmentOptionSetting (Prelude.Maybe Prelude.Text)
awsElasticBeanstalkEnvironmentOptionSetting_optionName :: (Maybe Text -> f (Maybe Text))
-> AwsElasticBeanstalkEnvironmentOptionSetting
-> f AwsElasticBeanstalkEnvironmentOptionSetting
awsElasticBeanstalkEnvironmentOptionSetting_optionName = (AwsElasticBeanstalkEnvironmentOptionSetting -> Maybe Text)
-> (AwsElasticBeanstalkEnvironmentOptionSetting
    -> Maybe Text -> AwsElasticBeanstalkEnvironmentOptionSetting)
-> Lens
     AwsElasticBeanstalkEnvironmentOptionSetting
     AwsElasticBeanstalkEnvironmentOptionSetting
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsElasticBeanstalkEnvironmentOptionSetting' {Maybe Text
optionName :: Maybe Text
$sel:optionName:AwsElasticBeanstalkEnvironmentOptionSetting' :: AwsElasticBeanstalkEnvironmentOptionSetting -> Maybe Text
optionName} -> Maybe Text
optionName) (\s :: AwsElasticBeanstalkEnvironmentOptionSetting
s@AwsElasticBeanstalkEnvironmentOptionSetting' {} Maybe Text
a -> AwsElasticBeanstalkEnvironmentOptionSetting
s {$sel:optionName:AwsElasticBeanstalkEnvironmentOptionSetting' :: Maybe Text
optionName = Maybe Text
a} :: AwsElasticBeanstalkEnvironmentOptionSetting)

-- | The name of the resource.
awsElasticBeanstalkEnvironmentOptionSetting_resourceName :: Lens.Lens' AwsElasticBeanstalkEnvironmentOptionSetting (Prelude.Maybe Prelude.Text)
awsElasticBeanstalkEnvironmentOptionSetting_resourceName :: (Maybe Text -> f (Maybe Text))
-> AwsElasticBeanstalkEnvironmentOptionSetting
-> f AwsElasticBeanstalkEnvironmentOptionSetting
awsElasticBeanstalkEnvironmentOptionSetting_resourceName = (AwsElasticBeanstalkEnvironmentOptionSetting -> Maybe Text)
-> (AwsElasticBeanstalkEnvironmentOptionSetting
    -> Maybe Text -> AwsElasticBeanstalkEnvironmentOptionSetting)
-> Lens
     AwsElasticBeanstalkEnvironmentOptionSetting
     AwsElasticBeanstalkEnvironmentOptionSetting
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsElasticBeanstalkEnvironmentOptionSetting' {Maybe Text
resourceName :: Maybe Text
$sel:resourceName:AwsElasticBeanstalkEnvironmentOptionSetting' :: AwsElasticBeanstalkEnvironmentOptionSetting -> Maybe Text
resourceName} -> Maybe Text
resourceName) (\s :: AwsElasticBeanstalkEnvironmentOptionSetting
s@AwsElasticBeanstalkEnvironmentOptionSetting' {} Maybe Text
a -> AwsElasticBeanstalkEnvironmentOptionSetting
s {$sel:resourceName:AwsElasticBeanstalkEnvironmentOptionSetting' :: Maybe Text
resourceName = Maybe Text
a} :: AwsElasticBeanstalkEnvironmentOptionSetting)

-- | The type of resource that the configuration option is associated with.
awsElasticBeanstalkEnvironmentOptionSetting_namespace :: Lens.Lens' AwsElasticBeanstalkEnvironmentOptionSetting (Prelude.Maybe Prelude.Text)
awsElasticBeanstalkEnvironmentOptionSetting_namespace :: (Maybe Text -> f (Maybe Text))
-> AwsElasticBeanstalkEnvironmentOptionSetting
-> f AwsElasticBeanstalkEnvironmentOptionSetting
awsElasticBeanstalkEnvironmentOptionSetting_namespace = (AwsElasticBeanstalkEnvironmentOptionSetting -> Maybe Text)
-> (AwsElasticBeanstalkEnvironmentOptionSetting
    -> Maybe Text -> AwsElasticBeanstalkEnvironmentOptionSetting)
-> Lens
     AwsElasticBeanstalkEnvironmentOptionSetting
     AwsElasticBeanstalkEnvironmentOptionSetting
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsElasticBeanstalkEnvironmentOptionSetting' {Maybe Text
namespace :: Maybe Text
$sel:namespace:AwsElasticBeanstalkEnvironmentOptionSetting' :: AwsElasticBeanstalkEnvironmentOptionSetting -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: AwsElasticBeanstalkEnvironmentOptionSetting
s@AwsElasticBeanstalkEnvironmentOptionSetting' {} Maybe Text
a -> AwsElasticBeanstalkEnvironmentOptionSetting
s {$sel:namespace:AwsElasticBeanstalkEnvironmentOptionSetting' :: Maybe Text
namespace = Maybe Text
a} :: AwsElasticBeanstalkEnvironmentOptionSetting)

-- | The value of the configuration setting.
awsElasticBeanstalkEnvironmentOptionSetting_value :: Lens.Lens' AwsElasticBeanstalkEnvironmentOptionSetting (Prelude.Maybe Prelude.Text)
awsElasticBeanstalkEnvironmentOptionSetting_value :: (Maybe Text -> f (Maybe Text))
-> AwsElasticBeanstalkEnvironmentOptionSetting
-> f AwsElasticBeanstalkEnvironmentOptionSetting
awsElasticBeanstalkEnvironmentOptionSetting_value = (AwsElasticBeanstalkEnvironmentOptionSetting -> Maybe Text)
-> (AwsElasticBeanstalkEnvironmentOptionSetting
    -> Maybe Text -> AwsElasticBeanstalkEnvironmentOptionSetting)
-> Lens
     AwsElasticBeanstalkEnvironmentOptionSetting
     AwsElasticBeanstalkEnvironmentOptionSetting
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsElasticBeanstalkEnvironmentOptionSetting' {Maybe Text
value :: Maybe Text
$sel:value:AwsElasticBeanstalkEnvironmentOptionSetting' :: AwsElasticBeanstalkEnvironmentOptionSetting -> Maybe Text
value} -> Maybe Text
value) (\s :: AwsElasticBeanstalkEnvironmentOptionSetting
s@AwsElasticBeanstalkEnvironmentOptionSetting' {} Maybe Text
a -> AwsElasticBeanstalkEnvironmentOptionSetting
s {$sel:value:AwsElasticBeanstalkEnvironmentOptionSetting' :: Maybe Text
value = Maybe Text
a} :: AwsElasticBeanstalkEnvironmentOptionSetting)

instance
  Core.FromJSON
    AwsElasticBeanstalkEnvironmentOptionSetting
  where
  parseJSON :: Value -> Parser AwsElasticBeanstalkEnvironmentOptionSetting
parseJSON =
    String
-> (Object -> Parser AwsElasticBeanstalkEnvironmentOptionSetting)
-> Value
-> Parser AwsElasticBeanstalkEnvironmentOptionSetting
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsElasticBeanstalkEnvironmentOptionSetting"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsElasticBeanstalkEnvironmentOptionSetting
AwsElasticBeanstalkEnvironmentOptionSetting'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> AwsElasticBeanstalkEnvironmentOptionSetting)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AwsElasticBeanstalkEnvironmentOptionSetting)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OptionName")
              Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AwsElasticBeanstalkEnvironmentOptionSetting)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> AwsElasticBeanstalkEnvironmentOptionSetting)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceName")
              Parser
  (Maybe Text
   -> Maybe Text -> AwsElasticBeanstalkEnvironmentOptionSetting)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> AwsElasticBeanstalkEnvironmentOptionSetting)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Namespace")
              Parser (Maybe Text -> AwsElasticBeanstalkEnvironmentOptionSetting)
-> Parser (Maybe Text)
-> Parser AwsElasticBeanstalkEnvironmentOptionSetting
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Value")
      )

instance
  Prelude.Hashable
    AwsElasticBeanstalkEnvironmentOptionSetting

instance
  Prelude.NFData
    AwsElasticBeanstalkEnvironmentOptionSetting

instance
  Core.ToJSON
    AwsElasticBeanstalkEnvironmentOptionSetting
  where
  toJSON :: AwsElasticBeanstalkEnvironmentOptionSetting -> Value
toJSON
    AwsElasticBeanstalkEnvironmentOptionSetting' {Maybe Text
value :: Maybe Text
namespace :: Maybe Text
resourceName :: Maybe Text
optionName :: Maybe Text
$sel:value:AwsElasticBeanstalkEnvironmentOptionSetting' :: AwsElasticBeanstalkEnvironmentOptionSetting -> Maybe Text
$sel:namespace:AwsElasticBeanstalkEnvironmentOptionSetting' :: AwsElasticBeanstalkEnvironmentOptionSetting -> Maybe Text
$sel:resourceName:AwsElasticBeanstalkEnvironmentOptionSetting' :: AwsElasticBeanstalkEnvironmentOptionSetting -> Maybe Text
$sel:optionName:AwsElasticBeanstalkEnvironmentOptionSetting' :: AwsElasticBeanstalkEnvironmentOptionSetting -> Maybe Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"OptionName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
optionName,
              (Text
"ResourceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
resourceName,
              (Text
"Namespace" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
namespace,
              (Text
"Value" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
value
            ]
        )