{-# 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-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.Redshift.Types.AttributeValueTarget where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(AttributeValueTarget -> AttributeValueTarget -> Bool)
-> (AttributeValueTarget -> AttributeValueTarget -> Bool)
-> Eq AttributeValueTarget
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]
(Int -> ReadS AttributeValueTarget)
-> ReadS [AttributeValueTarget]
-> ReadPrec AttributeValueTarget
-> ReadPrec [AttributeValueTarget]
-> Read 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
(Int -> AttributeValueTarget -> ShowS)
-> (AttributeValueTarget -> String)
-> ([AttributeValueTarget] -> ShowS)
-> Show AttributeValueTarget
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. AttributeValueTarget -> Rep AttributeValueTarget x)
-> (forall x. Rep AttributeValueTarget x -> AttributeValueTarget)
-> Generic AttributeValueTarget
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' :: Maybe Text -> AttributeValueTarget
AttributeValueTarget'
    { $sel:attributeValue:AttributeValueTarget' :: Maybe Text
attributeValue =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The value of the attribute.
attributeValueTarget_attributeValue :: Lens.Lens' AttributeValueTarget (Prelude.Maybe Prelude.Text)
attributeValueTarget_attributeValue :: (Maybe Text -> f (Maybe Text))
-> AttributeValueTarget -> f AttributeValueTarget
attributeValueTarget_attributeValue = (AttributeValueTarget -> Maybe Text)
-> (AttributeValueTarget -> Maybe Text -> AttributeValueTarget)
-> Lens
     AttributeValueTarget AttributeValueTarget (Maybe Text) (Maybe Text)
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 Core.FromXML AttributeValueTarget where
  parseXML :: [Node] -> Either String AttributeValueTarget
parseXML [Node]
x =
    Maybe Text -> AttributeValueTarget
AttributeValueTarget'
      (Maybe Text -> AttributeValueTarget)
-> Either String (Maybe Text) -> Either String AttributeValueTarget
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
"AttributeValue")

instance Prelude.Hashable AttributeValueTarget

instance Prelude.NFData AttributeValueTarget