{-# 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.RDS.Types.AvailableProcessorFeature
-- 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.RDS.Types.AvailableProcessorFeature 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

-- | Contains the available processor feature information for the DB instance
-- class of a DB instance.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html#USER_ConfigureProcessor Configuring the Processor of the DB Instance Class>
-- in the /Amazon RDS User Guide./
--
-- /See:/ 'newAvailableProcessorFeature' smart constructor.
data AvailableProcessorFeature = AvailableProcessorFeature'
  { -- | The allowed values for the processor feature of the DB instance class.
    AvailableProcessorFeature -> Maybe Text
allowedValues :: Prelude.Maybe Prelude.Text,
    -- | The default value for the processor feature of the DB instance class.
    AvailableProcessorFeature -> Maybe Text
defaultValue :: Prelude.Maybe Prelude.Text,
    -- | The name of the processor feature. Valid names are @coreCount@ and
    -- @threadsPerCore@.
    AvailableProcessorFeature -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (AvailableProcessorFeature -> AvailableProcessorFeature -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AvailableProcessorFeature -> AvailableProcessorFeature -> Bool
$c/= :: AvailableProcessorFeature -> AvailableProcessorFeature -> Bool
== :: AvailableProcessorFeature -> AvailableProcessorFeature -> Bool
$c== :: AvailableProcessorFeature -> AvailableProcessorFeature -> Bool
Prelude.Eq, ReadPrec [AvailableProcessorFeature]
ReadPrec AvailableProcessorFeature
Int -> ReadS AvailableProcessorFeature
ReadS [AvailableProcessorFeature]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AvailableProcessorFeature]
$creadListPrec :: ReadPrec [AvailableProcessorFeature]
readPrec :: ReadPrec AvailableProcessorFeature
$creadPrec :: ReadPrec AvailableProcessorFeature
readList :: ReadS [AvailableProcessorFeature]
$creadList :: ReadS [AvailableProcessorFeature]
readsPrec :: Int -> ReadS AvailableProcessorFeature
$creadsPrec :: Int -> ReadS AvailableProcessorFeature
Prelude.Read, Int -> AvailableProcessorFeature -> ShowS
[AvailableProcessorFeature] -> ShowS
AvailableProcessorFeature -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AvailableProcessorFeature] -> ShowS
$cshowList :: [AvailableProcessorFeature] -> ShowS
show :: AvailableProcessorFeature -> String
$cshow :: AvailableProcessorFeature -> String
showsPrec :: Int -> AvailableProcessorFeature -> ShowS
$cshowsPrec :: Int -> AvailableProcessorFeature -> ShowS
Prelude.Show, forall x.
Rep AvailableProcessorFeature x -> AvailableProcessorFeature
forall x.
AvailableProcessorFeature -> Rep AvailableProcessorFeature x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AvailableProcessorFeature x -> AvailableProcessorFeature
$cfrom :: forall x.
AvailableProcessorFeature -> Rep AvailableProcessorFeature x
Prelude.Generic)

-- |
-- Create a value of 'AvailableProcessorFeature' 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:
--
-- 'allowedValues', 'availableProcessorFeature_allowedValues' - The allowed values for the processor feature of the DB instance class.
--
-- 'defaultValue', 'availableProcessorFeature_defaultValue' - The default value for the processor feature of the DB instance class.
--
-- 'name', 'availableProcessorFeature_name' - The name of the processor feature. Valid names are @coreCount@ and
-- @threadsPerCore@.
newAvailableProcessorFeature ::
  AvailableProcessorFeature
newAvailableProcessorFeature :: AvailableProcessorFeature
newAvailableProcessorFeature =
  AvailableProcessorFeature'
    { $sel:allowedValues:AvailableProcessorFeature' :: Maybe Text
allowedValues =
        forall a. Maybe a
Prelude.Nothing,
      $sel:defaultValue:AvailableProcessorFeature' :: Maybe Text
defaultValue = forall a. Maybe a
Prelude.Nothing,
      $sel:name:AvailableProcessorFeature' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The allowed values for the processor feature of the DB instance class.
availableProcessorFeature_allowedValues :: Lens.Lens' AvailableProcessorFeature (Prelude.Maybe Prelude.Text)
availableProcessorFeature_allowedValues :: Lens' AvailableProcessorFeature (Maybe Text)
availableProcessorFeature_allowedValues = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AvailableProcessorFeature' {Maybe Text
allowedValues :: Maybe Text
$sel:allowedValues:AvailableProcessorFeature' :: AvailableProcessorFeature -> Maybe Text
allowedValues} -> Maybe Text
allowedValues) (\s :: AvailableProcessorFeature
s@AvailableProcessorFeature' {} Maybe Text
a -> AvailableProcessorFeature
s {$sel:allowedValues:AvailableProcessorFeature' :: Maybe Text
allowedValues = Maybe Text
a} :: AvailableProcessorFeature)

-- | The default value for the processor feature of the DB instance class.
availableProcessorFeature_defaultValue :: Lens.Lens' AvailableProcessorFeature (Prelude.Maybe Prelude.Text)
availableProcessorFeature_defaultValue :: Lens' AvailableProcessorFeature (Maybe Text)
availableProcessorFeature_defaultValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AvailableProcessorFeature' {Maybe Text
defaultValue :: Maybe Text
$sel:defaultValue:AvailableProcessorFeature' :: AvailableProcessorFeature -> Maybe Text
defaultValue} -> Maybe Text
defaultValue) (\s :: AvailableProcessorFeature
s@AvailableProcessorFeature' {} Maybe Text
a -> AvailableProcessorFeature
s {$sel:defaultValue:AvailableProcessorFeature' :: Maybe Text
defaultValue = Maybe Text
a} :: AvailableProcessorFeature)

-- | The name of the processor feature. Valid names are @coreCount@ and
-- @threadsPerCore@.
availableProcessorFeature_name :: Lens.Lens' AvailableProcessorFeature (Prelude.Maybe Prelude.Text)
availableProcessorFeature_name :: Lens' AvailableProcessorFeature (Maybe Text)
availableProcessorFeature_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AvailableProcessorFeature' {Maybe Text
name :: Maybe Text
$sel:name:AvailableProcessorFeature' :: AvailableProcessorFeature -> Maybe Text
name} -> Maybe Text
name) (\s :: AvailableProcessorFeature
s@AvailableProcessorFeature' {} Maybe Text
a -> AvailableProcessorFeature
s {$sel:name:AvailableProcessorFeature' :: Maybe Text
name = Maybe Text
a} :: AvailableProcessorFeature)

instance Data.FromXML AvailableProcessorFeature where
  parseXML :: [Node] -> Either String AvailableProcessorFeature
parseXML [Node]
x =
    Maybe Text -> Maybe Text -> Maybe Text -> AvailableProcessorFeature
AvailableProcessorFeature'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"AllowedValues")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"DefaultValue")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Name")

instance Prelude.Hashable AvailableProcessorFeature where
  hashWithSalt :: Int -> AvailableProcessorFeature -> Int
hashWithSalt Int
_salt AvailableProcessorFeature' {Maybe Text
name :: Maybe Text
defaultValue :: Maybe Text
allowedValues :: Maybe Text
$sel:name:AvailableProcessorFeature' :: AvailableProcessorFeature -> Maybe Text
$sel:defaultValue:AvailableProcessorFeature' :: AvailableProcessorFeature -> Maybe Text
$sel:allowedValues:AvailableProcessorFeature' :: AvailableProcessorFeature -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
allowedValues
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultValue
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData AvailableProcessorFeature where
  rnf :: AvailableProcessorFeature -> ()
rnf AvailableProcessorFeature' {Maybe Text
name :: Maybe Text
defaultValue :: Maybe Text
allowedValues :: Maybe Text
$sel:name:AvailableProcessorFeature' :: AvailableProcessorFeature -> Maybe Text
$sel:defaultValue:AvailableProcessorFeature' :: AvailableProcessorFeature -> Maybe Text
$sel:allowedValues:AvailableProcessorFeature' :: AvailableProcessorFeature -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
allowedValues
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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
name