{-# 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.CostExplorer.Types.UpdateCostAllocationTagsStatusError
-- 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.CostExplorer.Types.UpdateCostAllocationTagsStatusError 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

-- | Gives a detailed description of the result of an action. It\'s on each
-- cost allocation tag entry in the request.
--
-- /See:/ 'newUpdateCostAllocationTagsStatusError' smart constructor.
data UpdateCostAllocationTagsStatusError = UpdateCostAllocationTagsStatusError'
  { -- | An error code representing why the action failed on this entry.
    UpdateCostAllocationTagsStatusError -> Maybe Text
code :: Prelude.Maybe Prelude.Text,
    -- | A message explaining why the action failed on this entry.
    UpdateCostAllocationTagsStatusError -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
    -- | The key for the cost allocation tag.
    UpdateCostAllocationTagsStatusError -> Maybe Text
tagKey :: Prelude.Maybe Prelude.Text
  }
  deriving (UpdateCostAllocationTagsStatusError
-> UpdateCostAllocationTagsStatusError -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCostAllocationTagsStatusError
-> UpdateCostAllocationTagsStatusError -> Bool
$c/= :: UpdateCostAllocationTagsStatusError
-> UpdateCostAllocationTagsStatusError -> Bool
== :: UpdateCostAllocationTagsStatusError
-> UpdateCostAllocationTagsStatusError -> Bool
$c== :: UpdateCostAllocationTagsStatusError
-> UpdateCostAllocationTagsStatusError -> Bool
Prelude.Eq, ReadPrec [UpdateCostAllocationTagsStatusError]
ReadPrec UpdateCostAllocationTagsStatusError
Int -> ReadS UpdateCostAllocationTagsStatusError
ReadS [UpdateCostAllocationTagsStatusError]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCostAllocationTagsStatusError]
$creadListPrec :: ReadPrec [UpdateCostAllocationTagsStatusError]
readPrec :: ReadPrec UpdateCostAllocationTagsStatusError
$creadPrec :: ReadPrec UpdateCostAllocationTagsStatusError
readList :: ReadS [UpdateCostAllocationTagsStatusError]
$creadList :: ReadS [UpdateCostAllocationTagsStatusError]
readsPrec :: Int -> ReadS UpdateCostAllocationTagsStatusError
$creadsPrec :: Int -> ReadS UpdateCostAllocationTagsStatusError
Prelude.Read, Int -> UpdateCostAllocationTagsStatusError -> ShowS
[UpdateCostAllocationTagsStatusError] -> ShowS
UpdateCostAllocationTagsStatusError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCostAllocationTagsStatusError] -> ShowS
$cshowList :: [UpdateCostAllocationTagsStatusError] -> ShowS
show :: UpdateCostAllocationTagsStatusError -> String
$cshow :: UpdateCostAllocationTagsStatusError -> String
showsPrec :: Int -> UpdateCostAllocationTagsStatusError -> ShowS
$cshowsPrec :: Int -> UpdateCostAllocationTagsStatusError -> ShowS
Prelude.Show, forall x.
Rep UpdateCostAllocationTagsStatusError x
-> UpdateCostAllocationTagsStatusError
forall x.
UpdateCostAllocationTagsStatusError
-> Rep UpdateCostAllocationTagsStatusError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateCostAllocationTagsStatusError x
-> UpdateCostAllocationTagsStatusError
$cfrom :: forall x.
UpdateCostAllocationTagsStatusError
-> Rep UpdateCostAllocationTagsStatusError x
Prelude.Generic)

-- |
-- Create a value of 'UpdateCostAllocationTagsStatusError' 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:
--
-- 'code', 'updateCostAllocationTagsStatusError_code' - An error code representing why the action failed on this entry.
--
-- 'message', 'updateCostAllocationTagsStatusError_message' - A message explaining why the action failed on this entry.
--
-- 'tagKey', 'updateCostAllocationTagsStatusError_tagKey' - The key for the cost allocation tag.
newUpdateCostAllocationTagsStatusError ::
  UpdateCostAllocationTagsStatusError
newUpdateCostAllocationTagsStatusError :: UpdateCostAllocationTagsStatusError
newUpdateCostAllocationTagsStatusError =
  UpdateCostAllocationTagsStatusError'
    { $sel:code:UpdateCostAllocationTagsStatusError' :: Maybe Text
code =
        forall a. Maybe a
Prelude.Nothing,
      $sel:message:UpdateCostAllocationTagsStatusError' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing,
      $sel:tagKey:UpdateCostAllocationTagsStatusError' :: Maybe Text
tagKey = forall a. Maybe a
Prelude.Nothing
    }

-- | An error code representing why the action failed on this entry.
updateCostAllocationTagsStatusError_code :: Lens.Lens' UpdateCostAllocationTagsStatusError (Prelude.Maybe Prelude.Text)
updateCostAllocationTagsStatusError_code :: Lens' UpdateCostAllocationTagsStatusError (Maybe Text)
updateCostAllocationTagsStatusError_code = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCostAllocationTagsStatusError' {Maybe Text
code :: Maybe Text
$sel:code:UpdateCostAllocationTagsStatusError' :: UpdateCostAllocationTagsStatusError -> Maybe Text
code} -> Maybe Text
code) (\s :: UpdateCostAllocationTagsStatusError
s@UpdateCostAllocationTagsStatusError' {} Maybe Text
a -> UpdateCostAllocationTagsStatusError
s {$sel:code:UpdateCostAllocationTagsStatusError' :: Maybe Text
code = Maybe Text
a} :: UpdateCostAllocationTagsStatusError)

-- | A message explaining why the action failed on this entry.
updateCostAllocationTagsStatusError_message :: Lens.Lens' UpdateCostAllocationTagsStatusError (Prelude.Maybe Prelude.Text)
updateCostAllocationTagsStatusError_message :: Lens' UpdateCostAllocationTagsStatusError (Maybe Text)
updateCostAllocationTagsStatusError_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCostAllocationTagsStatusError' {Maybe Text
message :: Maybe Text
$sel:message:UpdateCostAllocationTagsStatusError' :: UpdateCostAllocationTagsStatusError -> Maybe Text
message} -> Maybe Text
message) (\s :: UpdateCostAllocationTagsStatusError
s@UpdateCostAllocationTagsStatusError' {} Maybe Text
a -> UpdateCostAllocationTagsStatusError
s {$sel:message:UpdateCostAllocationTagsStatusError' :: Maybe Text
message = Maybe Text
a} :: UpdateCostAllocationTagsStatusError)

-- | The key for the cost allocation tag.
updateCostAllocationTagsStatusError_tagKey :: Lens.Lens' UpdateCostAllocationTagsStatusError (Prelude.Maybe Prelude.Text)
updateCostAllocationTagsStatusError_tagKey :: Lens' UpdateCostAllocationTagsStatusError (Maybe Text)
updateCostAllocationTagsStatusError_tagKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCostAllocationTagsStatusError' {Maybe Text
tagKey :: Maybe Text
$sel:tagKey:UpdateCostAllocationTagsStatusError' :: UpdateCostAllocationTagsStatusError -> Maybe Text
tagKey} -> Maybe Text
tagKey) (\s :: UpdateCostAllocationTagsStatusError
s@UpdateCostAllocationTagsStatusError' {} Maybe Text
a -> UpdateCostAllocationTagsStatusError
s {$sel:tagKey:UpdateCostAllocationTagsStatusError' :: Maybe Text
tagKey = Maybe Text
a} :: UpdateCostAllocationTagsStatusError)

instance
  Data.FromJSON
    UpdateCostAllocationTagsStatusError
  where
  parseJSON :: Value -> Parser UpdateCostAllocationTagsStatusError
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"UpdateCostAllocationTagsStatusError"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> UpdateCostAllocationTagsStatusError
UpdateCostAllocationTagsStatusError'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Code")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Message")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"TagKey")
      )

instance
  Prelude.Hashable
    UpdateCostAllocationTagsStatusError
  where
  hashWithSalt :: Int -> UpdateCostAllocationTagsStatusError -> Int
hashWithSalt
    Int
_salt
    UpdateCostAllocationTagsStatusError' {Maybe Text
tagKey :: Maybe Text
message :: Maybe Text
code :: Maybe Text
$sel:tagKey:UpdateCostAllocationTagsStatusError' :: UpdateCostAllocationTagsStatusError -> Maybe Text
$sel:message:UpdateCostAllocationTagsStatusError' :: UpdateCostAllocationTagsStatusError -> Maybe Text
$sel:code:UpdateCostAllocationTagsStatusError' :: UpdateCostAllocationTagsStatusError -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
code
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
tagKey

instance
  Prelude.NFData
    UpdateCostAllocationTagsStatusError
  where
  rnf :: UpdateCostAllocationTagsStatusError -> ()
rnf UpdateCostAllocationTagsStatusError' {Maybe Text
tagKey :: Maybe Text
message :: Maybe Text
code :: Maybe Text
$sel:tagKey:UpdateCostAllocationTagsStatusError' :: UpdateCostAllocationTagsStatusError -> Maybe Text
$sel:message:UpdateCostAllocationTagsStatusError' :: UpdateCostAllocationTagsStatusError -> Maybe Text
$sel:code:UpdateCostAllocationTagsStatusError' :: UpdateCostAllocationTagsStatusError -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
code
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
tagKey