{-# 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.Redshift.Types.AttributeValueTarget
-- 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.Redshift.Types.AttributeValueTarget 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
import Amazonka.Redshift.Internal

-- | Describes an attribute value.
--
-- /See:/ 'newAttributeValueTarget' smart constructor.
data AttributeValueTarget = AttributeValueTarget'
  { -- | The value of the attribute.
    AttributeValueTarget -> Maybe Text
attributeValue :: Prelude.Maybe Prelude.Text
  }
  deriving (AttributeValueTarget -> AttributeValueTarget -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttributeValueTarget -> AttributeValueTarget -> Bool
$c/= :: AttributeValueTarget -> AttributeValueTarget -> Bool
== :: AttributeValueTarget -> AttributeValueTarget -> Bool
$c== :: AttributeValueTarget -> AttributeValueTarget -> Bool
Prelude.Eq, ReadPrec [AttributeValueTarget]
ReadPrec AttributeValueTarget
Int -> ReadS AttributeValueTarget
ReadS [AttributeValueTarget]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttributeValueTarget]
$creadListPrec :: ReadPrec [AttributeValueTarget]
readPrec :: ReadPrec AttributeValueTarget
$creadPrec :: ReadPrec AttributeValueTarget
readList :: ReadS [AttributeValueTarget]
$creadList :: ReadS [AttributeValueTarget]
readsPrec :: Int -> ReadS AttributeValueTarget
$creadsPrec :: Int -> ReadS AttributeValueTarget
Prelude.Read, Int -> AttributeValueTarget -> ShowS
[AttributeValueTarget] -> ShowS
AttributeValueTarget -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttributeValueTarget] -> ShowS
$cshowList :: [AttributeValueTarget] -> ShowS
show :: AttributeValueTarget -> String
$cshow :: AttributeValueTarget -> String
showsPrec :: Int -> AttributeValueTarget -> ShowS
$cshowsPrec :: Int -> AttributeValueTarget -> ShowS
Prelude.Show, forall x. Rep AttributeValueTarget x -> AttributeValueTarget
forall x. AttributeValueTarget -> Rep AttributeValueTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AttributeValueTarget x -> AttributeValueTarget
$cfrom :: forall x. AttributeValueTarget -> Rep AttributeValueTarget x
Prelude.Generic)

-- |
-- Create a value of 'AttributeValueTarget' 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:
--
-- 'attributeValue', 'attributeValueTarget_attributeValue' - The value of the attribute.
newAttributeValueTarget ::
  AttributeValueTarget
newAttributeValueTarget :: AttributeValueTarget
newAttributeValueTarget =
  AttributeValueTarget'
    { $sel:attributeValue:AttributeValueTarget' :: Maybe Text
attributeValue =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The value of the attribute.
attributeValueTarget_attributeValue :: Lens.Lens' AttributeValueTarget (Prelude.Maybe Prelude.Text)
attributeValueTarget_attributeValue :: Lens' AttributeValueTarget (Maybe Text)
attributeValueTarget_attributeValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttributeValueTarget' {Maybe Text
attributeValue :: Maybe Text
$sel:attributeValue:AttributeValueTarget' :: AttributeValueTarget -> Maybe Text
attributeValue} -> Maybe Text
attributeValue) (\s :: AttributeValueTarget
s@AttributeValueTarget' {} Maybe Text
a -> AttributeValueTarget
s {$sel:attributeValue:AttributeValueTarget' :: Maybe Text
attributeValue = Maybe Text
a} :: AttributeValueTarget)

instance Data.FromXML AttributeValueTarget where
  parseXML :: [Node] -> Either String AttributeValueTarget
parseXML [Node]
x =
    Maybe Text -> AttributeValueTarget
AttributeValueTarget'
      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
"AttributeValue")

instance Prelude.Hashable AttributeValueTarget where
  hashWithSalt :: Int -> AttributeValueTarget -> Int
hashWithSalt Int
_salt AttributeValueTarget' {Maybe Text
attributeValue :: Maybe Text
$sel:attributeValue:AttributeValueTarget' :: AttributeValueTarget -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
attributeValue

instance Prelude.NFData AttributeValueTarget where
  rnf :: AttributeValueTarget -> ()
rnf AttributeValueTarget' {Maybe Text
attributeValue :: Maybe Text
$sel:attributeValue:AttributeValueTarget' :: AttributeValueTarget -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
attributeValue