{-# 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.EC2.Types.AccountAttributeValue
-- 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.EC2.Types.AccountAttributeValue where

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

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

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

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

instance Data.FromXML AccountAttributeValue where
  parseXML :: [Node] -> Either String AccountAttributeValue
parseXML [Node]
x =
    Maybe Text -> AccountAttributeValue
AccountAttributeValue'
      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 AccountAttributeValue where
  hashWithSalt :: Int -> AccountAttributeValue -> Int
hashWithSalt Int
_salt AccountAttributeValue' {Maybe Text
attributeValue :: Maybe Text
$sel:attributeValue:AccountAttributeValue' :: AccountAttributeValue -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
attributeValue

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