{-# 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.ElasticBeanstalk.Types.OptionSpecification
-- 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.ElasticBeanstalk.Types.OptionSpecification where

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

-- | A specification identifying an individual configuration option.
--
-- /See:/ 'newOptionSpecification' smart constructor.
data OptionSpecification = OptionSpecification'
  { -- | The name of the configuration option.
    OptionSpecification -> Maybe Text
optionName :: Prelude.Maybe Prelude.Text,
    -- | A unique resource name for a time-based scaling configuration option.
    OptionSpecification -> Maybe Text
resourceName :: Prelude.Maybe Prelude.Text,
    -- | A unique namespace identifying the option\'s associated AWS resource.
    OptionSpecification -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text
  }
  deriving (OptionSpecification -> OptionSpecification -> Bool
(OptionSpecification -> OptionSpecification -> Bool)
-> (OptionSpecification -> OptionSpecification -> Bool)
-> Eq OptionSpecification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OptionSpecification -> OptionSpecification -> Bool
$c/= :: OptionSpecification -> OptionSpecification -> Bool
== :: OptionSpecification -> OptionSpecification -> Bool
$c== :: OptionSpecification -> OptionSpecification -> Bool
Prelude.Eq, ReadPrec [OptionSpecification]
ReadPrec OptionSpecification
Int -> ReadS OptionSpecification
ReadS [OptionSpecification]
(Int -> ReadS OptionSpecification)
-> ReadS [OptionSpecification]
-> ReadPrec OptionSpecification
-> ReadPrec [OptionSpecification]
-> Read OptionSpecification
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OptionSpecification]
$creadListPrec :: ReadPrec [OptionSpecification]
readPrec :: ReadPrec OptionSpecification
$creadPrec :: ReadPrec OptionSpecification
readList :: ReadS [OptionSpecification]
$creadList :: ReadS [OptionSpecification]
readsPrec :: Int -> ReadS OptionSpecification
$creadsPrec :: Int -> ReadS OptionSpecification
Prelude.Read, Int -> OptionSpecification -> ShowS
[OptionSpecification] -> ShowS
OptionSpecification -> String
(Int -> OptionSpecification -> ShowS)
-> (OptionSpecification -> String)
-> ([OptionSpecification] -> ShowS)
-> Show OptionSpecification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OptionSpecification] -> ShowS
$cshowList :: [OptionSpecification] -> ShowS
show :: OptionSpecification -> String
$cshow :: OptionSpecification -> String
showsPrec :: Int -> OptionSpecification -> ShowS
$cshowsPrec :: Int -> OptionSpecification -> ShowS
Prelude.Show, (forall x. OptionSpecification -> Rep OptionSpecification x)
-> (forall x. Rep OptionSpecification x -> OptionSpecification)
-> Generic OptionSpecification
forall x. Rep OptionSpecification x -> OptionSpecification
forall x. OptionSpecification -> Rep OptionSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OptionSpecification x -> OptionSpecification
$cfrom :: forall x. OptionSpecification -> Rep OptionSpecification x
Prelude.Generic)

-- |
-- Create a value of 'OptionSpecification' 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', 'optionSpecification_optionName' - The name of the configuration option.
--
-- 'resourceName', 'optionSpecification_resourceName' - A unique resource name for a time-based scaling configuration option.
--
-- 'namespace', 'optionSpecification_namespace' - A unique namespace identifying the option\'s associated AWS resource.
newOptionSpecification ::
  OptionSpecification
newOptionSpecification :: OptionSpecification
newOptionSpecification =
  OptionSpecification' :: Maybe Text -> Maybe Text -> Maybe Text -> OptionSpecification
OptionSpecification'
    { $sel:optionName:OptionSpecification' :: Maybe Text
optionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceName:OptionSpecification' :: Maybe Text
resourceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:namespace:OptionSpecification' :: Maybe Text
namespace = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

-- | A unique resource name for a time-based scaling configuration option.
optionSpecification_resourceName :: Lens.Lens' OptionSpecification (Prelude.Maybe Prelude.Text)
optionSpecification_resourceName :: (Maybe Text -> f (Maybe Text))
-> OptionSpecification -> f OptionSpecification
optionSpecification_resourceName = (OptionSpecification -> Maybe Text)
-> (OptionSpecification -> Maybe Text -> OptionSpecification)
-> Lens
     OptionSpecification OptionSpecification (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OptionSpecification' {Maybe Text
resourceName :: Maybe Text
$sel:resourceName:OptionSpecification' :: OptionSpecification -> Maybe Text
resourceName} -> Maybe Text
resourceName) (\s :: OptionSpecification
s@OptionSpecification' {} Maybe Text
a -> OptionSpecification
s {$sel:resourceName:OptionSpecification' :: Maybe Text
resourceName = Maybe Text
a} :: OptionSpecification)

-- | A unique namespace identifying the option\'s associated AWS resource.
optionSpecification_namespace :: Lens.Lens' OptionSpecification (Prelude.Maybe Prelude.Text)
optionSpecification_namespace :: (Maybe Text -> f (Maybe Text))
-> OptionSpecification -> f OptionSpecification
optionSpecification_namespace = (OptionSpecification -> Maybe Text)
-> (OptionSpecification -> Maybe Text -> OptionSpecification)
-> Lens
     OptionSpecification OptionSpecification (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OptionSpecification' {Maybe Text
namespace :: Maybe Text
$sel:namespace:OptionSpecification' :: OptionSpecification -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: OptionSpecification
s@OptionSpecification' {} Maybe Text
a -> OptionSpecification
s {$sel:namespace:OptionSpecification' :: Maybe Text
namespace = Maybe Text
a} :: OptionSpecification)

instance Prelude.Hashable OptionSpecification

instance Prelude.NFData OptionSpecification

instance Core.ToQuery OptionSpecification where
  toQuery :: OptionSpecification -> QueryString
toQuery OptionSpecification' {Maybe Text
namespace :: Maybe Text
resourceName :: Maybe Text
optionName :: Maybe Text
$sel:namespace:OptionSpecification' :: OptionSpecification -> Maybe Text
$sel:resourceName:OptionSpecification' :: OptionSpecification -> Maybe Text
$sel:optionName:OptionSpecification' :: OptionSpecification -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"OptionName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
optionName,
        ByteString
"ResourceName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
resourceName,
        ByteString
"Namespace" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
namespace
      ]