{-# 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 #-}
module Amazonka.CostExplorer.Types.CostAllocationTagStatusEntry where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.CostExplorer.Types.CostAllocationTagStatus
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data CostAllocationTagStatusEntry = CostAllocationTagStatusEntry'
{
CostAllocationTagStatusEntry -> Text
tagKey :: Prelude.Text,
CostAllocationTagStatusEntry -> CostAllocationTagStatus
status :: CostAllocationTagStatus
}
deriving (CostAllocationTagStatusEntry
-> CostAllocationTagStatusEntry -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CostAllocationTagStatusEntry
-> CostAllocationTagStatusEntry -> Bool
$c/= :: CostAllocationTagStatusEntry
-> CostAllocationTagStatusEntry -> Bool
== :: CostAllocationTagStatusEntry
-> CostAllocationTagStatusEntry -> Bool
$c== :: CostAllocationTagStatusEntry
-> CostAllocationTagStatusEntry -> Bool
Prelude.Eq, ReadPrec [CostAllocationTagStatusEntry]
ReadPrec CostAllocationTagStatusEntry
Int -> ReadS CostAllocationTagStatusEntry
ReadS [CostAllocationTagStatusEntry]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CostAllocationTagStatusEntry]
$creadListPrec :: ReadPrec [CostAllocationTagStatusEntry]
readPrec :: ReadPrec CostAllocationTagStatusEntry
$creadPrec :: ReadPrec CostAllocationTagStatusEntry
readList :: ReadS [CostAllocationTagStatusEntry]
$creadList :: ReadS [CostAllocationTagStatusEntry]
readsPrec :: Int -> ReadS CostAllocationTagStatusEntry
$creadsPrec :: Int -> ReadS CostAllocationTagStatusEntry
Prelude.Read, Int -> CostAllocationTagStatusEntry -> ShowS
[CostAllocationTagStatusEntry] -> ShowS
CostAllocationTagStatusEntry -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CostAllocationTagStatusEntry] -> ShowS
$cshowList :: [CostAllocationTagStatusEntry] -> ShowS
show :: CostAllocationTagStatusEntry -> String
$cshow :: CostAllocationTagStatusEntry -> String
showsPrec :: Int -> CostAllocationTagStatusEntry -> ShowS
$cshowsPrec :: Int -> CostAllocationTagStatusEntry -> ShowS
Prelude.Show, forall x.
Rep CostAllocationTagStatusEntry x -> CostAllocationTagStatusEntry
forall x.
CostAllocationTagStatusEntry -> Rep CostAllocationTagStatusEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CostAllocationTagStatusEntry x -> CostAllocationTagStatusEntry
$cfrom :: forall x.
CostAllocationTagStatusEntry -> Rep CostAllocationTagStatusEntry x
Prelude.Generic)
newCostAllocationTagStatusEntry ::
Prelude.Text ->
CostAllocationTagStatus ->
CostAllocationTagStatusEntry
newCostAllocationTagStatusEntry :: Text -> CostAllocationTagStatus -> CostAllocationTagStatusEntry
newCostAllocationTagStatusEntry Text
pTagKey_ CostAllocationTagStatus
pStatus_ =
CostAllocationTagStatusEntry'
{ $sel:tagKey:CostAllocationTagStatusEntry' :: Text
tagKey = Text
pTagKey_,
$sel:status:CostAllocationTagStatusEntry' :: CostAllocationTagStatus
status = CostAllocationTagStatus
pStatus_
}
costAllocationTagStatusEntry_tagKey :: Lens.Lens' CostAllocationTagStatusEntry Prelude.Text
costAllocationTagStatusEntry_tagKey :: Lens' CostAllocationTagStatusEntry Text
costAllocationTagStatusEntry_tagKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostAllocationTagStatusEntry' {Text
tagKey :: Text
$sel:tagKey:CostAllocationTagStatusEntry' :: CostAllocationTagStatusEntry -> Text
tagKey} -> Text
tagKey) (\s :: CostAllocationTagStatusEntry
s@CostAllocationTagStatusEntry' {} Text
a -> CostAllocationTagStatusEntry
s {$sel:tagKey:CostAllocationTagStatusEntry' :: Text
tagKey = Text
a} :: CostAllocationTagStatusEntry)
costAllocationTagStatusEntry_status :: Lens.Lens' CostAllocationTagStatusEntry CostAllocationTagStatus
costAllocationTagStatusEntry_status :: Lens' CostAllocationTagStatusEntry CostAllocationTagStatus
costAllocationTagStatusEntry_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CostAllocationTagStatusEntry' {CostAllocationTagStatus
status :: CostAllocationTagStatus
$sel:status:CostAllocationTagStatusEntry' :: CostAllocationTagStatusEntry -> CostAllocationTagStatus
status} -> CostAllocationTagStatus
status) (\s :: CostAllocationTagStatusEntry
s@CostAllocationTagStatusEntry' {} CostAllocationTagStatus
a -> CostAllocationTagStatusEntry
s {$sel:status:CostAllocationTagStatusEntry' :: CostAllocationTagStatus
status = CostAllocationTagStatus
a} :: CostAllocationTagStatusEntry)
instance
Prelude.Hashable
CostAllocationTagStatusEntry
where
hashWithSalt :: Int -> CostAllocationTagStatusEntry -> Int
hashWithSalt Int
_salt CostAllocationTagStatusEntry' {Text
CostAllocationTagStatus
status :: CostAllocationTagStatus
tagKey :: Text
$sel:status:CostAllocationTagStatusEntry' :: CostAllocationTagStatusEntry -> CostAllocationTagStatus
$sel:tagKey:CostAllocationTagStatusEntry' :: CostAllocationTagStatusEntry -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
tagKey
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` CostAllocationTagStatus
status
instance Prelude.NFData CostAllocationTagStatusEntry where
rnf :: CostAllocationTagStatusEntry -> ()
rnf CostAllocationTagStatusEntry' {Text
CostAllocationTagStatus
status :: CostAllocationTagStatus
tagKey :: Text
$sel:status:CostAllocationTagStatusEntry' :: CostAllocationTagStatusEntry -> CostAllocationTagStatus
$sel:tagKey:CostAllocationTagStatusEntry' :: CostAllocationTagStatusEntry -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
tagKey seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf CostAllocationTagStatus
status
instance Data.ToJSON CostAllocationTagStatusEntry where
toJSON :: CostAllocationTagStatusEntry -> Value
toJSON CostAllocationTagStatusEntry' {Text
CostAllocationTagStatus
status :: CostAllocationTagStatus
tagKey :: Text
$sel:status:CostAllocationTagStatusEntry' :: CostAllocationTagStatusEntry -> CostAllocationTagStatus
$sel:tagKey:CostAllocationTagStatusEntry' :: CostAllocationTagStatusEntry -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"TagKey" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
tagKey),
forall a. a -> Maybe a
Prelude.Just (Key
"Status" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= CostAllocationTagStatus
status)
]
)