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

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

-- | This data type is used as a response element in the action
-- @DescribeDBEngineVersions@.
--
-- /See:/ 'newCharacterSet' smart constructor.
data CharacterSet = CharacterSet'
  { -- | The name of the character set.
    CharacterSet -> Maybe Text
characterSetName :: Prelude.Maybe Prelude.Text,
    -- | The description of the character set.
    CharacterSet -> Maybe Text
characterSetDescription :: Prelude.Maybe Prelude.Text
  }
  deriving (CharacterSet -> CharacterSet -> Bool
(CharacterSet -> CharacterSet -> Bool)
-> (CharacterSet -> CharacterSet -> Bool) -> Eq CharacterSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CharacterSet -> CharacterSet -> Bool
$c/= :: CharacterSet -> CharacterSet -> Bool
== :: CharacterSet -> CharacterSet -> Bool
$c== :: CharacterSet -> CharacterSet -> Bool
Prelude.Eq, ReadPrec [CharacterSet]
ReadPrec CharacterSet
Int -> ReadS CharacterSet
ReadS [CharacterSet]
(Int -> ReadS CharacterSet)
-> ReadS [CharacterSet]
-> ReadPrec CharacterSet
-> ReadPrec [CharacterSet]
-> Read CharacterSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CharacterSet]
$creadListPrec :: ReadPrec [CharacterSet]
readPrec :: ReadPrec CharacterSet
$creadPrec :: ReadPrec CharacterSet
readList :: ReadS [CharacterSet]
$creadList :: ReadS [CharacterSet]
readsPrec :: Int -> ReadS CharacterSet
$creadsPrec :: Int -> ReadS CharacterSet
Prelude.Read, Int -> CharacterSet -> ShowS
[CharacterSet] -> ShowS
CharacterSet -> String
(Int -> CharacterSet -> ShowS)
-> (CharacterSet -> String)
-> ([CharacterSet] -> ShowS)
-> Show CharacterSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CharacterSet] -> ShowS
$cshowList :: [CharacterSet] -> ShowS
show :: CharacterSet -> String
$cshow :: CharacterSet -> String
showsPrec :: Int -> CharacterSet -> ShowS
$cshowsPrec :: Int -> CharacterSet -> ShowS
Prelude.Show, (forall x. CharacterSet -> Rep CharacterSet x)
-> (forall x. Rep CharacterSet x -> CharacterSet)
-> Generic CharacterSet
forall x. Rep CharacterSet x -> CharacterSet
forall x. CharacterSet -> Rep CharacterSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CharacterSet x -> CharacterSet
$cfrom :: forall x. CharacterSet -> Rep CharacterSet x
Prelude.Generic)

-- |
-- Create a value of 'CharacterSet' 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:
--
-- 'characterSetName', 'characterSet_characterSetName' - The name of the character set.
--
-- 'characterSetDescription', 'characterSet_characterSetDescription' - The description of the character set.
newCharacterSet ::
  CharacterSet
newCharacterSet :: CharacterSet
newCharacterSet =
  CharacterSet' :: Maybe Text -> Maybe Text -> CharacterSet
CharacterSet'
    { $sel:characterSetName:CharacterSet' :: Maybe Text
characterSetName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:characterSetDescription:CharacterSet' :: Maybe Text
characterSetDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the character set.
characterSet_characterSetName :: Lens.Lens' CharacterSet (Prelude.Maybe Prelude.Text)
characterSet_characterSetName :: (Maybe Text -> f (Maybe Text)) -> CharacterSet -> f CharacterSet
characterSet_characterSetName = (CharacterSet -> Maybe Text)
-> (CharacterSet -> Maybe Text -> CharacterSet)
-> Lens CharacterSet CharacterSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CharacterSet' {Maybe Text
characterSetName :: Maybe Text
$sel:characterSetName:CharacterSet' :: CharacterSet -> Maybe Text
characterSetName} -> Maybe Text
characterSetName) (\s :: CharacterSet
s@CharacterSet' {} Maybe Text
a -> CharacterSet
s {$sel:characterSetName:CharacterSet' :: Maybe Text
characterSetName = Maybe Text
a} :: CharacterSet)

-- | The description of the character set.
characterSet_characterSetDescription :: Lens.Lens' CharacterSet (Prelude.Maybe Prelude.Text)
characterSet_characterSetDescription :: (Maybe Text -> f (Maybe Text)) -> CharacterSet -> f CharacterSet
characterSet_characterSetDescription = (CharacterSet -> Maybe Text)
-> (CharacterSet -> Maybe Text -> CharacterSet)
-> Lens CharacterSet CharacterSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CharacterSet' {Maybe Text
characterSetDescription :: Maybe Text
$sel:characterSetDescription:CharacterSet' :: CharacterSet -> Maybe Text
characterSetDescription} -> Maybe Text
characterSetDescription) (\s :: CharacterSet
s@CharacterSet' {} Maybe Text
a -> CharacterSet
s {$sel:characterSetDescription:CharacterSet' :: Maybe Text
characterSetDescription = Maybe Text
a} :: CharacterSet)

instance Core.FromXML CharacterSet where
  parseXML :: [Node] -> Either String CharacterSet
parseXML [Node]
x =
    Maybe Text -> Maybe Text -> CharacterSet
CharacterSet'
      (Maybe Text -> Maybe Text -> CharacterSet)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> CharacterSet)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CharacterSetName")
      Either String (Maybe Text -> CharacterSet)
-> Either String (Maybe Text) -> Either String CharacterSet
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CharacterSetDescription")

instance Prelude.Hashable CharacterSet

instance Prelude.NFData CharacterSet