{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.APIGateway.Types.SdkConfigurationProperty where

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

-- | A configuration property of an SDK type.
--
-- /See:/ 'newSdkConfigurationProperty' smart constructor.
data SdkConfigurationProperty = SdkConfigurationProperty'
  { -- | 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,
    -- | The user-friendly name of an SdkType configuration property.
    SdkConfigurationProperty -> Maybe Text
friendlyName :: Prelude.Maybe Prelude.Text,
    -- | The name of a an SdkType configuration property.
    SdkConfigurationProperty -> Maybe Text
name :: 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
  }
  deriving (SdkConfigurationProperty -> SdkConfigurationProperty -> Bool
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]
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
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.
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:
--
-- 'defaultValue', 'sdkConfigurationProperty_defaultValue' - The default value of an SdkType configuration property.
--
-- 'description', 'sdkConfigurationProperty_description' - The description of an SdkType configuration property.
--
-- 'friendlyName', 'sdkConfigurationProperty_friendlyName' - The user-friendly name of an SdkType configuration property.
--
-- 'name', 'sdkConfigurationProperty_name' - The name of a 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@).
newSdkConfigurationProperty ::
  SdkConfigurationProperty
newSdkConfigurationProperty :: SdkConfigurationProperty
newSdkConfigurationProperty =
  SdkConfigurationProperty'
    { $sel:defaultValue:SdkConfigurationProperty' :: Maybe Text
defaultValue =
        forall a. Maybe a
Prelude.Nothing,
      $sel:description:SdkConfigurationProperty' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:friendlyName:SdkConfigurationProperty' :: Maybe Text
friendlyName = forall a. Maybe a
Prelude.Nothing,
      $sel:name:SdkConfigurationProperty' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:required:SdkConfigurationProperty' :: Maybe Bool
required = forall a. Maybe a
Prelude.Nothing
    }

-- | The default value of an SdkType configuration property.
sdkConfigurationProperty_defaultValue :: Lens.Lens' SdkConfigurationProperty (Prelude.Maybe Prelude.Text)
sdkConfigurationProperty_defaultValue :: Lens' SdkConfigurationProperty (Maybe Text)
sdkConfigurationProperty_defaultValue = 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 :: Lens' SdkConfigurationProperty (Maybe Text)
sdkConfigurationProperty_description = 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)

-- | The user-friendly name of an SdkType configuration property.
sdkConfigurationProperty_friendlyName :: Lens.Lens' SdkConfigurationProperty (Prelude.Maybe Prelude.Text)
sdkConfigurationProperty_friendlyName :: Lens' SdkConfigurationProperty (Maybe Text)
sdkConfigurationProperty_friendlyName = 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)

-- | The name of a an SdkType configuration property.
sdkConfigurationProperty_name :: Lens.Lens' SdkConfigurationProperty (Prelude.Maybe Prelude.Text)
sdkConfigurationProperty_name :: Lens' SdkConfigurationProperty (Maybe Text)
sdkConfigurationProperty_name = 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)

-- | 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 :: Lens' SdkConfigurationProperty (Maybe Bool)
sdkConfigurationProperty_required = 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)

instance Data.FromJSON SdkConfigurationProperty where
  parseJSON :: Value -> Parser SdkConfigurationProperty
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SdkConfigurationProperty"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> SdkConfigurationProperty
SdkConfigurationProperty'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"defaultValue")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"friendlyName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"required")
      )

instance Prelude.Hashable SdkConfigurationProperty where
  hashWithSalt :: Int -> SdkConfigurationProperty -> Int
hashWithSalt Int
_salt SdkConfigurationProperty' {Maybe Bool
Maybe Text
required :: Maybe Bool
name :: Maybe Text
friendlyName :: Maybe Text
description :: Maybe Text
defaultValue :: Maybe Text
$sel:required:SdkConfigurationProperty' :: SdkConfigurationProperty -> Maybe Bool
$sel:name:SdkConfigurationProperty' :: SdkConfigurationProperty -> Maybe Text
$sel:friendlyName:SdkConfigurationProperty' :: SdkConfigurationProperty -> Maybe Text
$sel:description:SdkConfigurationProperty' :: SdkConfigurationProperty -> Maybe Text
$sel:defaultValue:SdkConfigurationProperty' :: SdkConfigurationProperty -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultValue
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
friendlyName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
required

instance Prelude.NFData SdkConfigurationProperty where
  rnf :: SdkConfigurationProperty -> ()
rnf SdkConfigurationProperty' {Maybe Bool
Maybe Text
required :: Maybe Bool
name :: Maybe Text
friendlyName :: Maybe Text
description :: Maybe Text
defaultValue :: Maybe Text
$sel:required:SdkConfigurationProperty' :: SdkConfigurationProperty -> Maybe Bool
$sel:name:SdkConfigurationProperty' :: SdkConfigurationProperty -> Maybe Text
$sel:friendlyName:SdkConfigurationProperty' :: SdkConfigurationProperty -> Maybe Text
$sel:description:SdkConfigurationProperty' :: SdkConfigurationProperty -> Maybe Text
$sel:defaultValue:SdkConfigurationProperty' :: SdkConfigurationProperty -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultValue
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
friendlyName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
required