{-# 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.APIGateway.Types.SdkConfigurationProperty
-- 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.APIGateway.Types.SdkConfigurationProperty where

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

-- | A configuration property of an SDK type.
--
-- /See:/ 'newSdkConfigurationProperty' smart constructor.
data SdkConfigurationProperty = SdkConfigurationProperty'
  { -- | The user-friendly name of an SdkType configuration property.
    SdkConfigurationProperty -> Maybe Text
friendlyName :: Prelude.Maybe Prelude.Text,
    -- | A boolean flag of an SdkType configuration property to indicate if the
    -- associated SDK configuration property is required (@true@) or not
    -- (@false@).
    SdkConfigurationProperty -> Maybe Bool
required :: Prelude.Maybe Prelude.Bool,
    -- | The name of a an SdkType configuration property.
    SdkConfigurationProperty -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The default value of an SdkType configuration property.
    SdkConfigurationProperty -> Maybe Text
defaultValue :: Prelude.Maybe Prelude.Text,
    -- | The description of an SdkType configuration property.
    SdkConfigurationProperty -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (SdkConfigurationProperty -> SdkConfigurationProperty -> Bool
(SdkConfigurationProperty -> SdkConfigurationProperty -> Bool)
-> (SdkConfigurationProperty -> SdkConfigurationProperty -> Bool)
-> Eq SdkConfigurationProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SdkConfigurationProperty -> SdkConfigurationProperty -> Bool
$c/= :: SdkConfigurationProperty -> SdkConfigurationProperty -> Bool
== :: SdkConfigurationProperty -> SdkConfigurationProperty -> Bool
$c== :: SdkConfigurationProperty -> SdkConfigurationProperty -> Bool
Prelude.Eq, ReadPrec [SdkConfigurationProperty]
ReadPrec SdkConfigurationProperty
Int -> ReadS SdkConfigurationProperty
ReadS [SdkConfigurationProperty]
(Int -> ReadS SdkConfigurationProperty)
-> ReadS [SdkConfigurationProperty]
-> ReadPrec SdkConfigurationProperty
-> ReadPrec [SdkConfigurationProperty]
-> Read SdkConfigurationProperty
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SdkConfigurationProperty]
$creadListPrec :: ReadPrec [SdkConfigurationProperty]
readPrec :: ReadPrec SdkConfigurationProperty
$creadPrec :: ReadPrec SdkConfigurationProperty
readList :: ReadS [SdkConfigurationProperty]
$creadList :: ReadS [SdkConfigurationProperty]
readsPrec :: Int -> ReadS SdkConfigurationProperty
$creadsPrec :: Int -> ReadS SdkConfigurationProperty
Prelude.Read, Int -> SdkConfigurationProperty -> ShowS
[SdkConfigurationProperty] -> ShowS
SdkConfigurationProperty -> String
(Int -> SdkConfigurationProperty -> ShowS)
-> (SdkConfigurationProperty -> String)
-> ([SdkConfigurationProperty] -> ShowS)
-> Show SdkConfigurationProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SdkConfigurationProperty] -> ShowS
$cshowList :: [SdkConfigurationProperty] -> ShowS
show :: SdkConfigurationProperty -> String
$cshow :: SdkConfigurationProperty -> String
showsPrec :: Int -> SdkConfigurationProperty -> ShowS
$cshowsPrec :: Int -> SdkConfigurationProperty -> ShowS
Prelude.Show, (forall x.
 SdkConfigurationProperty -> Rep SdkConfigurationProperty x)
-> (forall x.
    Rep SdkConfigurationProperty x -> SdkConfigurationProperty)
-> Generic SdkConfigurationProperty
forall x.
Rep SdkConfigurationProperty x -> SdkConfigurationProperty
forall x.
SdkConfigurationProperty -> Rep SdkConfigurationProperty x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SdkConfigurationProperty x -> SdkConfigurationProperty
$cfrom :: forall x.
SdkConfigurationProperty -> Rep SdkConfigurationProperty x
Prelude.Generic)

-- |
-- Create a value of 'SdkConfigurationProperty' 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:
--
-- 'friendlyName', 'sdkConfigurationProperty_friendlyName' - The user-friendly name of an SdkType configuration property.
--
-- 'required', 'sdkConfigurationProperty_required' - A boolean flag of an SdkType configuration property to indicate if the
-- associated SDK configuration property is required (@true@) or not
-- (@false@).
--
-- 'name', 'sdkConfigurationProperty_name' - The name of a an SdkType configuration property.
--
-- 'defaultValue', 'sdkConfigurationProperty_defaultValue' - The default value of an SdkType configuration property.
--
-- 'description', 'sdkConfigurationProperty_description' - The description of an SdkType configuration property.
newSdkConfigurationProperty ::
  SdkConfigurationProperty
newSdkConfigurationProperty :: SdkConfigurationProperty
newSdkConfigurationProperty =
  SdkConfigurationProperty' :: Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SdkConfigurationProperty
SdkConfigurationProperty'
    { $sel:friendlyName:SdkConfigurationProperty' :: Maybe Text
friendlyName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:required:SdkConfigurationProperty' :: Maybe Bool
required = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:name:SdkConfigurationProperty' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultValue:SdkConfigurationProperty' :: Maybe Text
defaultValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:SdkConfigurationProperty' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The user-friendly name of an SdkType configuration property.
sdkConfigurationProperty_friendlyName :: Lens.Lens' SdkConfigurationProperty (Prelude.Maybe Prelude.Text)
sdkConfigurationProperty_friendlyName :: (Maybe Text -> f (Maybe Text))
-> SdkConfigurationProperty -> f SdkConfigurationProperty
sdkConfigurationProperty_friendlyName = (SdkConfigurationProperty -> Maybe Text)
-> (SdkConfigurationProperty
    -> Maybe Text -> SdkConfigurationProperty)
-> Lens
     SdkConfigurationProperty
     SdkConfigurationProperty
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SdkConfigurationProperty' {Maybe Text
friendlyName :: Maybe Text
$sel:friendlyName:SdkConfigurationProperty' :: SdkConfigurationProperty -> Maybe Text
friendlyName} -> Maybe Text
friendlyName) (\s :: SdkConfigurationProperty
s@SdkConfigurationProperty' {} Maybe Text
a -> SdkConfigurationProperty
s {$sel:friendlyName:SdkConfigurationProperty' :: Maybe Text
friendlyName = Maybe Text
a} :: SdkConfigurationProperty)

-- | A boolean flag of an SdkType configuration property to indicate if the
-- associated SDK configuration property is required (@true@) or not
-- (@false@).
sdkConfigurationProperty_required :: Lens.Lens' SdkConfigurationProperty (Prelude.Maybe Prelude.Bool)
sdkConfigurationProperty_required :: (Maybe Bool -> f (Maybe Bool))
-> SdkConfigurationProperty -> f SdkConfigurationProperty
sdkConfigurationProperty_required = (SdkConfigurationProperty -> Maybe Bool)
-> (SdkConfigurationProperty
    -> Maybe Bool -> SdkConfigurationProperty)
-> Lens
     SdkConfigurationProperty
     SdkConfigurationProperty
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SdkConfigurationProperty' {Maybe Bool
required :: Maybe Bool
$sel:required:SdkConfigurationProperty' :: SdkConfigurationProperty -> Maybe Bool
required} -> Maybe Bool
required) (\s :: SdkConfigurationProperty
s@SdkConfigurationProperty' {} Maybe Bool
a -> SdkConfigurationProperty
s {$sel:required:SdkConfigurationProperty' :: Maybe Bool
required = Maybe Bool
a} :: SdkConfigurationProperty)

-- | The name of a an SdkType configuration property.
sdkConfigurationProperty_name :: Lens.Lens' SdkConfigurationProperty (Prelude.Maybe Prelude.Text)
sdkConfigurationProperty_name :: (Maybe Text -> f (Maybe Text))
-> SdkConfigurationProperty -> f SdkConfigurationProperty
sdkConfigurationProperty_name = (SdkConfigurationProperty -> Maybe Text)
-> (SdkConfigurationProperty
    -> Maybe Text -> SdkConfigurationProperty)
-> Lens
     SdkConfigurationProperty
     SdkConfigurationProperty
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SdkConfigurationProperty' {Maybe Text
name :: Maybe Text
$sel:name:SdkConfigurationProperty' :: SdkConfigurationProperty -> Maybe Text
name} -> Maybe Text
name) (\s :: SdkConfigurationProperty
s@SdkConfigurationProperty' {} Maybe Text
a -> SdkConfigurationProperty
s {$sel:name:SdkConfigurationProperty' :: Maybe Text
name = Maybe Text
a} :: SdkConfigurationProperty)

-- | The default value of an SdkType configuration property.
sdkConfigurationProperty_defaultValue :: Lens.Lens' SdkConfigurationProperty (Prelude.Maybe Prelude.Text)
sdkConfigurationProperty_defaultValue :: (Maybe Text -> f (Maybe Text))
-> SdkConfigurationProperty -> f SdkConfigurationProperty
sdkConfigurationProperty_defaultValue = (SdkConfigurationProperty -> Maybe Text)
-> (SdkConfigurationProperty
    -> Maybe Text -> SdkConfigurationProperty)
-> Lens
     SdkConfigurationProperty
     SdkConfigurationProperty
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SdkConfigurationProperty' {Maybe Text
defaultValue :: Maybe Text
$sel:defaultValue:SdkConfigurationProperty' :: SdkConfigurationProperty -> Maybe Text
defaultValue} -> Maybe Text
defaultValue) (\s :: SdkConfigurationProperty
s@SdkConfigurationProperty' {} Maybe Text
a -> SdkConfigurationProperty
s {$sel:defaultValue:SdkConfigurationProperty' :: Maybe Text
defaultValue = Maybe Text
a} :: SdkConfigurationProperty)

-- | The description of an SdkType configuration property.
sdkConfigurationProperty_description :: Lens.Lens' SdkConfigurationProperty (Prelude.Maybe Prelude.Text)
sdkConfigurationProperty_description :: (Maybe Text -> f (Maybe Text))
-> SdkConfigurationProperty -> f SdkConfigurationProperty
sdkConfigurationProperty_description = (SdkConfigurationProperty -> Maybe Text)
-> (SdkConfigurationProperty
    -> Maybe Text -> SdkConfigurationProperty)
-> Lens
     SdkConfigurationProperty
     SdkConfigurationProperty
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SdkConfigurationProperty' {Maybe Text
description :: Maybe Text
$sel:description:SdkConfigurationProperty' :: SdkConfigurationProperty -> Maybe Text
description} -> Maybe Text
description) (\s :: SdkConfigurationProperty
s@SdkConfigurationProperty' {} Maybe Text
a -> SdkConfigurationProperty
s {$sel:description:SdkConfigurationProperty' :: Maybe Text
description = Maybe Text
a} :: SdkConfigurationProperty)

instance Core.FromJSON SdkConfigurationProperty where
  parseJSON :: Value -> Parser SdkConfigurationProperty
parseJSON =
    String
-> (Object -> Parser SdkConfigurationProperty)
-> Value
-> Parser SdkConfigurationProperty
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SdkConfigurationProperty"
      ( \Object
x ->
          Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SdkConfigurationProperty
SdkConfigurationProperty'
            (Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> SdkConfigurationProperty)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> SdkConfigurationProperty)
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
"friendlyName")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> SdkConfigurationProperty)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> SdkConfigurationProperty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"required")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> SdkConfigurationProperty)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> SdkConfigurationProperty)
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
"name")
            Parser (Maybe Text -> Maybe Text -> SdkConfigurationProperty)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> SdkConfigurationProperty)
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
"defaultValue")
            Parser (Maybe Text -> SdkConfigurationProperty)
-> Parser (Maybe Text) -> Parser SdkConfigurationProperty
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
"description")
      )

instance Prelude.Hashable SdkConfigurationProperty

instance Prelude.NFData SdkConfigurationProperty