{-# 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.CostCategoryReference
-- 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.CostCategoryReference where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.CostExplorer.Types.CostCategoryProcessingStatus
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | A reference to a Cost Category containing only enough information to
-- identify the Cost Category.
--
-- You can use this information to retrieve the full Cost Category
-- information using @DescribeCostCategory@.
--
-- /See:/ 'newCostCategoryReference' smart constructor.
data CostCategoryReference = CostCategoryReference'
  { -- | The unique identifier for your Cost Category.
    CostCategoryReference -> Maybe Text
costCategoryArn :: Prelude.Maybe Prelude.Text,
    CostCategoryReference -> Maybe Text
defaultValue :: Prelude.Maybe Prelude.Text,
    -- | The Cost Category\'s effective end date.
    CostCategoryReference -> Maybe Text
effectiveEnd :: Prelude.Maybe Prelude.Text,
    -- | The Cost Category\'s effective start date.
    CostCategoryReference -> Maybe Text
effectiveStart :: Prelude.Maybe Prelude.Text,
    CostCategoryReference -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The number of rules that are associated with a specific Cost Category.
    CostCategoryReference -> Maybe Natural
numberOfRules :: Prelude.Maybe Prelude.Natural,
    -- | The list of processing statuses for Cost Management products for a
    -- specific cost category.
    CostCategoryReference -> Maybe [CostCategoryProcessingStatus]
processingStatus :: Prelude.Maybe [CostCategoryProcessingStatus],
    -- | A list of unique cost category values in a specific cost category.
    CostCategoryReference -> Maybe [Text]
values :: Prelude.Maybe [Prelude.Text]
  }
  deriving (CostCategoryReference -> CostCategoryReference -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CostCategoryReference -> CostCategoryReference -> Bool
$c/= :: CostCategoryReference -> CostCategoryReference -> Bool
== :: CostCategoryReference -> CostCategoryReference -> Bool
$c== :: CostCategoryReference -> CostCategoryReference -> Bool
Prelude.Eq, ReadPrec [CostCategoryReference]
ReadPrec CostCategoryReference
Int -> ReadS CostCategoryReference
ReadS [CostCategoryReference]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CostCategoryReference]
$creadListPrec :: ReadPrec [CostCategoryReference]
readPrec :: ReadPrec CostCategoryReference
$creadPrec :: ReadPrec CostCategoryReference
readList :: ReadS [CostCategoryReference]
$creadList :: ReadS [CostCategoryReference]
readsPrec :: Int -> ReadS CostCategoryReference
$creadsPrec :: Int -> ReadS CostCategoryReference
Prelude.Read, Int -> CostCategoryReference -> ShowS
[CostCategoryReference] -> ShowS
CostCategoryReference -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CostCategoryReference] -> ShowS
$cshowList :: [CostCategoryReference] -> ShowS
show :: CostCategoryReference -> String
$cshow :: CostCategoryReference -> String
showsPrec :: Int -> CostCategoryReference -> ShowS
$cshowsPrec :: Int -> CostCategoryReference -> ShowS
Prelude.Show, forall x. Rep CostCategoryReference x -> CostCategoryReference
forall x. CostCategoryReference -> Rep CostCategoryReference x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CostCategoryReference x -> CostCategoryReference
$cfrom :: forall x. CostCategoryReference -> Rep CostCategoryReference x
Prelude.Generic)

-- |
-- Create a value of 'CostCategoryReference' 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:
--
-- 'costCategoryArn', 'costCategoryReference_costCategoryArn' - The unique identifier for your Cost Category.
--
-- 'defaultValue', 'costCategoryReference_defaultValue' - Undocumented member.
--
-- 'effectiveEnd', 'costCategoryReference_effectiveEnd' - The Cost Category\'s effective end date.
--
-- 'effectiveStart', 'costCategoryReference_effectiveStart' - The Cost Category\'s effective start date.
--
-- 'name', 'costCategoryReference_name' - Undocumented member.
--
-- 'numberOfRules', 'costCategoryReference_numberOfRules' - The number of rules that are associated with a specific Cost Category.
--
-- 'processingStatus', 'costCategoryReference_processingStatus' - The list of processing statuses for Cost Management products for a
-- specific cost category.
--
-- 'values', 'costCategoryReference_values' - A list of unique cost category values in a specific cost category.
newCostCategoryReference ::
  CostCategoryReference
newCostCategoryReference :: CostCategoryReference
newCostCategoryReference =
  CostCategoryReference'
    { $sel:costCategoryArn:CostCategoryReference' :: Maybe Text
costCategoryArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:defaultValue:CostCategoryReference' :: Maybe Text
defaultValue = forall a. Maybe a
Prelude.Nothing,
      $sel:effectiveEnd:CostCategoryReference' :: Maybe Text
effectiveEnd = forall a. Maybe a
Prelude.Nothing,
      $sel:effectiveStart:CostCategoryReference' :: Maybe Text
effectiveStart = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CostCategoryReference' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:numberOfRules:CostCategoryReference' :: Maybe Natural
numberOfRules = forall a. Maybe a
Prelude.Nothing,
      $sel:processingStatus:CostCategoryReference' :: Maybe [CostCategoryProcessingStatus]
processingStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:values:CostCategoryReference' :: Maybe [Text]
values = forall a. Maybe a
Prelude.Nothing
    }

-- | The unique identifier for your Cost Category.
costCategoryReference_costCategoryArn :: Lens.Lens' CostCategoryReference (Prelude.Maybe Prelude.Text)
costCategoryReference_costCategoryArn :: Lens' CostCategoryReference (Maybe Text)
costCategoryReference_costCategoryArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostCategoryReference' {Maybe Text
costCategoryArn :: Maybe Text
$sel:costCategoryArn:CostCategoryReference' :: CostCategoryReference -> Maybe Text
costCategoryArn} -> Maybe Text
costCategoryArn) (\s :: CostCategoryReference
s@CostCategoryReference' {} Maybe Text
a -> CostCategoryReference
s {$sel:costCategoryArn:CostCategoryReference' :: Maybe Text
costCategoryArn = Maybe Text
a} :: CostCategoryReference)

-- | Undocumented member.
costCategoryReference_defaultValue :: Lens.Lens' CostCategoryReference (Prelude.Maybe Prelude.Text)
costCategoryReference_defaultValue :: Lens' CostCategoryReference (Maybe Text)
costCategoryReference_defaultValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostCategoryReference' {Maybe Text
defaultValue :: Maybe Text
$sel:defaultValue:CostCategoryReference' :: CostCategoryReference -> Maybe Text
defaultValue} -> Maybe Text
defaultValue) (\s :: CostCategoryReference
s@CostCategoryReference' {} Maybe Text
a -> CostCategoryReference
s {$sel:defaultValue:CostCategoryReference' :: Maybe Text
defaultValue = Maybe Text
a} :: CostCategoryReference)

-- | The Cost Category\'s effective end date.
costCategoryReference_effectiveEnd :: Lens.Lens' CostCategoryReference (Prelude.Maybe Prelude.Text)
costCategoryReference_effectiveEnd :: Lens' CostCategoryReference (Maybe Text)
costCategoryReference_effectiveEnd = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostCategoryReference' {Maybe Text
effectiveEnd :: Maybe Text
$sel:effectiveEnd:CostCategoryReference' :: CostCategoryReference -> Maybe Text
effectiveEnd} -> Maybe Text
effectiveEnd) (\s :: CostCategoryReference
s@CostCategoryReference' {} Maybe Text
a -> CostCategoryReference
s {$sel:effectiveEnd:CostCategoryReference' :: Maybe Text
effectiveEnd = Maybe Text
a} :: CostCategoryReference)

-- | The Cost Category\'s effective start date.
costCategoryReference_effectiveStart :: Lens.Lens' CostCategoryReference (Prelude.Maybe Prelude.Text)
costCategoryReference_effectiveStart :: Lens' CostCategoryReference (Maybe Text)
costCategoryReference_effectiveStart = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostCategoryReference' {Maybe Text
effectiveStart :: Maybe Text
$sel:effectiveStart:CostCategoryReference' :: CostCategoryReference -> Maybe Text
effectiveStart} -> Maybe Text
effectiveStart) (\s :: CostCategoryReference
s@CostCategoryReference' {} Maybe Text
a -> CostCategoryReference
s {$sel:effectiveStart:CostCategoryReference' :: Maybe Text
effectiveStart = Maybe Text
a} :: CostCategoryReference)

-- | Undocumented member.
costCategoryReference_name :: Lens.Lens' CostCategoryReference (Prelude.Maybe Prelude.Text)
costCategoryReference_name :: Lens' CostCategoryReference (Maybe Text)
costCategoryReference_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostCategoryReference' {Maybe Text
name :: Maybe Text
$sel:name:CostCategoryReference' :: CostCategoryReference -> Maybe Text
name} -> Maybe Text
name) (\s :: CostCategoryReference
s@CostCategoryReference' {} Maybe Text
a -> CostCategoryReference
s {$sel:name:CostCategoryReference' :: Maybe Text
name = Maybe Text
a} :: CostCategoryReference)

-- | The number of rules that are associated with a specific Cost Category.
costCategoryReference_numberOfRules :: Lens.Lens' CostCategoryReference (Prelude.Maybe Prelude.Natural)
costCategoryReference_numberOfRules :: Lens' CostCategoryReference (Maybe Natural)
costCategoryReference_numberOfRules = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostCategoryReference' {Maybe Natural
numberOfRules :: Maybe Natural
$sel:numberOfRules:CostCategoryReference' :: CostCategoryReference -> Maybe Natural
numberOfRules} -> Maybe Natural
numberOfRules) (\s :: CostCategoryReference
s@CostCategoryReference' {} Maybe Natural
a -> CostCategoryReference
s {$sel:numberOfRules:CostCategoryReference' :: Maybe Natural
numberOfRules = Maybe Natural
a} :: CostCategoryReference)

-- | The list of processing statuses for Cost Management products for a
-- specific cost category.
costCategoryReference_processingStatus :: Lens.Lens' CostCategoryReference (Prelude.Maybe [CostCategoryProcessingStatus])
costCategoryReference_processingStatus :: Lens' CostCategoryReference (Maybe [CostCategoryProcessingStatus])
costCategoryReference_processingStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostCategoryReference' {Maybe [CostCategoryProcessingStatus]
processingStatus :: Maybe [CostCategoryProcessingStatus]
$sel:processingStatus:CostCategoryReference' :: CostCategoryReference -> Maybe [CostCategoryProcessingStatus]
processingStatus} -> Maybe [CostCategoryProcessingStatus]
processingStatus) (\s :: CostCategoryReference
s@CostCategoryReference' {} Maybe [CostCategoryProcessingStatus]
a -> CostCategoryReference
s {$sel:processingStatus:CostCategoryReference' :: Maybe [CostCategoryProcessingStatus]
processingStatus = Maybe [CostCategoryProcessingStatus]
a} :: CostCategoryReference) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of unique cost category values in a specific cost category.
costCategoryReference_values :: Lens.Lens' CostCategoryReference (Prelude.Maybe [Prelude.Text])
costCategoryReference_values :: Lens' CostCategoryReference (Maybe [Text])
costCategoryReference_values = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostCategoryReference' {Maybe [Text]
values :: Maybe [Text]
$sel:values:CostCategoryReference' :: CostCategoryReference -> Maybe [Text]
values} -> Maybe [Text]
values) (\s :: CostCategoryReference
s@CostCategoryReference' {} Maybe [Text]
a -> CostCategoryReference
s {$sel:values:CostCategoryReference' :: Maybe [Text]
values = Maybe [Text]
a} :: CostCategoryReference) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON CostCategoryReference where
  parseJSON :: Value -> Parser CostCategoryReference
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CostCategoryReference"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe [CostCategoryProcessingStatus]
-> Maybe [Text]
-> CostCategoryReference
CostCategoryReference'
            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
"CostCategoryArn")
            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
"DefaultValue")
            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
"EffectiveEnd")
            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
"EffectiveStart")
            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
"Name")
            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
"NumberOfRules")
            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
"ProcessingStatus"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            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
"Values" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable CostCategoryReference where
  hashWithSalt :: Int -> CostCategoryReference -> Int
hashWithSalt Int
_salt CostCategoryReference' {Maybe Natural
Maybe [Text]
Maybe [CostCategoryProcessingStatus]
Maybe Text
values :: Maybe [Text]
processingStatus :: Maybe [CostCategoryProcessingStatus]
numberOfRules :: Maybe Natural
name :: Maybe Text
effectiveStart :: Maybe Text
effectiveEnd :: Maybe Text
defaultValue :: Maybe Text
costCategoryArn :: Maybe Text
$sel:values:CostCategoryReference' :: CostCategoryReference -> Maybe [Text]
$sel:processingStatus:CostCategoryReference' :: CostCategoryReference -> Maybe [CostCategoryProcessingStatus]
$sel:numberOfRules:CostCategoryReference' :: CostCategoryReference -> Maybe Natural
$sel:name:CostCategoryReference' :: CostCategoryReference -> Maybe Text
$sel:effectiveStart:CostCategoryReference' :: CostCategoryReference -> Maybe Text
$sel:effectiveEnd:CostCategoryReference' :: CostCategoryReference -> Maybe Text
$sel:defaultValue:CostCategoryReference' :: CostCategoryReference -> Maybe Text
$sel:costCategoryArn:CostCategoryReference' :: CostCategoryReference -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
costCategoryArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultValue
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
effectiveEnd
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
effectiveStart
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
numberOfRules
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [CostCategoryProcessingStatus]
processingStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
values

instance Prelude.NFData CostCategoryReference where
  rnf :: CostCategoryReference -> ()
rnf CostCategoryReference' {Maybe Natural
Maybe [Text]
Maybe [CostCategoryProcessingStatus]
Maybe Text
values :: Maybe [Text]
processingStatus :: Maybe [CostCategoryProcessingStatus]
numberOfRules :: Maybe Natural
name :: Maybe Text
effectiveStart :: Maybe Text
effectiveEnd :: Maybe Text
defaultValue :: Maybe Text
costCategoryArn :: Maybe Text
$sel:values:CostCategoryReference' :: CostCategoryReference -> Maybe [Text]
$sel:processingStatus:CostCategoryReference' :: CostCategoryReference -> Maybe [CostCategoryProcessingStatus]
$sel:numberOfRules:CostCategoryReference' :: CostCategoryReference -> Maybe Natural
$sel:name:CostCategoryReference' :: CostCategoryReference -> Maybe Text
$sel:effectiveStart:CostCategoryReference' :: CostCategoryReference -> Maybe Text
$sel:effectiveEnd:CostCategoryReference' :: CostCategoryReference -> Maybe Text
$sel:defaultValue:CostCategoryReference' :: CostCategoryReference -> Maybe Text
$sel:costCategoryArn:CostCategoryReference' :: CostCategoryReference -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
costCategoryArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultValue
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
effectiveEnd
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
effectiveStart
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
numberOfRules
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [CostCategoryProcessingStatus]
processingStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
values