{-# 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.RootCause 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
data RootCause = RootCause'
{
RootCause -> Maybe Text
linkedAccount :: Prelude.Maybe Prelude.Text,
RootCause -> Maybe Text
linkedAccountName :: Prelude.Maybe Prelude.Text,
RootCause -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
RootCause -> Maybe Text
service :: Prelude.Maybe Prelude.Text,
RootCause -> Maybe Text
usageType :: Prelude.Maybe Prelude.Text
}
deriving (RootCause -> RootCause -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RootCause -> RootCause -> Bool
$c/= :: RootCause -> RootCause -> Bool
== :: RootCause -> RootCause -> Bool
$c== :: RootCause -> RootCause -> Bool
Prelude.Eq, ReadPrec [RootCause]
ReadPrec RootCause
Int -> ReadS RootCause
ReadS [RootCause]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RootCause]
$creadListPrec :: ReadPrec [RootCause]
readPrec :: ReadPrec RootCause
$creadPrec :: ReadPrec RootCause
readList :: ReadS [RootCause]
$creadList :: ReadS [RootCause]
readsPrec :: Int -> ReadS RootCause
$creadsPrec :: Int -> ReadS RootCause
Prelude.Read, Int -> RootCause -> ShowS
[RootCause] -> ShowS
RootCause -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RootCause] -> ShowS
$cshowList :: [RootCause] -> ShowS
show :: RootCause -> String
$cshow :: RootCause -> String
showsPrec :: Int -> RootCause -> ShowS
$cshowsPrec :: Int -> RootCause -> ShowS
Prelude.Show, forall x. Rep RootCause x -> RootCause
forall x. RootCause -> Rep RootCause x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RootCause x -> RootCause
$cfrom :: forall x. RootCause -> Rep RootCause x
Prelude.Generic)
newRootCause ::
RootCause
newRootCause :: RootCause
newRootCause =
RootCause'
{ $sel:linkedAccount:RootCause' :: Maybe Text
linkedAccount = forall a. Maybe a
Prelude.Nothing,
$sel:linkedAccountName:RootCause' :: Maybe Text
linkedAccountName = forall a. Maybe a
Prelude.Nothing,
$sel:region:RootCause' :: Maybe Text
region = forall a. Maybe a
Prelude.Nothing,
$sel:service:RootCause' :: Maybe Text
service = forall a. Maybe a
Prelude.Nothing,
$sel:usageType:RootCause' :: Maybe Text
usageType = forall a. Maybe a
Prelude.Nothing
}
rootCause_linkedAccount :: Lens.Lens' RootCause (Prelude.Maybe Prelude.Text)
rootCause_linkedAccount :: Lens' RootCause (Maybe Text)
rootCause_linkedAccount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RootCause' {Maybe Text
linkedAccount :: Maybe Text
$sel:linkedAccount:RootCause' :: RootCause -> Maybe Text
linkedAccount} -> Maybe Text
linkedAccount) (\s :: RootCause
s@RootCause' {} Maybe Text
a -> RootCause
s {$sel:linkedAccount:RootCause' :: Maybe Text
linkedAccount = Maybe Text
a} :: RootCause)
rootCause_linkedAccountName :: Lens.Lens' RootCause (Prelude.Maybe Prelude.Text)
rootCause_linkedAccountName :: Lens' RootCause (Maybe Text)
rootCause_linkedAccountName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RootCause' {Maybe Text
linkedAccountName :: Maybe Text
$sel:linkedAccountName:RootCause' :: RootCause -> Maybe Text
linkedAccountName} -> Maybe Text
linkedAccountName) (\s :: RootCause
s@RootCause' {} Maybe Text
a -> RootCause
s {$sel:linkedAccountName:RootCause' :: Maybe Text
linkedAccountName = Maybe Text
a} :: RootCause)
rootCause_region :: Lens.Lens' RootCause (Prelude.Maybe Prelude.Text)
rootCause_region :: Lens' RootCause (Maybe Text)
rootCause_region = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RootCause' {Maybe Text
region :: Maybe Text
$sel:region:RootCause' :: RootCause -> Maybe Text
region} -> Maybe Text
region) (\s :: RootCause
s@RootCause' {} Maybe Text
a -> RootCause
s {$sel:region:RootCause' :: Maybe Text
region = Maybe Text
a} :: RootCause)
rootCause_service :: Lens.Lens' RootCause (Prelude.Maybe Prelude.Text)
rootCause_service :: Lens' RootCause (Maybe Text)
rootCause_service = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RootCause' {Maybe Text
service :: Maybe Text
$sel:service:RootCause' :: RootCause -> Maybe Text
service} -> Maybe Text
service) (\s :: RootCause
s@RootCause' {} Maybe Text
a -> RootCause
s {$sel:service:RootCause' :: Maybe Text
service = Maybe Text
a} :: RootCause)
rootCause_usageType :: Lens.Lens' RootCause (Prelude.Maybe Prelude.Text)
rootCause_usageType :: Lens' RootCause (Maybe Text)
rootCause_usageType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RootCause' {Maybe Text
usageType :: Maybe Text
$sel:usageType:RootCause' :: RootCause -> Maybe Text
usageType} -> Maybe Text
usageType) (\s :: RootCause
s@RootCause' {} Maybe Text
a -> RootCause
s {$sel:usageType:RootCause' :: Maybe Text
usageType = Maybe Text
a} :: RootCause)
instance Data.FromJSON RootCause where
parseJSON :: Value -> Parser RootCause
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RootCause"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> RootCause
RootCause'
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
"LinkedAccount")
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
"LinkedAccountName")
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
"Region")
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
"Service")
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
"UsageType")
)
instance Prelude.Hashable RootCause where
hashWithSalt :: Int -> RootCause -> Int
hashWithSalt Int
_salt RootCause' {Maybe Text
usageType :: Maybe Text
service :: Maybe Text
region :: Maybe Text
linkedAccountName :: Maybe Text
linkedAccount :: Maybe Text
$sel:usageType:RootCause' :: RootCause -> Maybe Text
$sel:service:RootCause' :: RootCause -> Maybe Text
$sel:region:RootCause' :: RootCause -> Maybe Text
$sel:linkedAccountName:RootCause' :: RootCause -> Maybe Text
$sel:linkedAccount:RootCause' :: RootCause -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
linkedAccount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
linkedAccountName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
region
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
service
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
usageType
instance Prelude.NFData RootCause where
rnf :: RootCause -> ()
rnf RootCause' {Maybe Text
usageType :: Maybe Text
service :: Maybe Text
region :: Maybe Text
linkedAccountName :: Maybe Text
linkedAccount :: Maybe Text
$sel:usageType:RootCause' :: RootCause -> Maybe Text
$sel:service:RootCause' :: RootCause -> Maybe Text
$sel:region:RootCause' :: RootCause -> Maybe Text
$sel:linkedAccountName:RootCause' :: RootCause -> Maybe Text
$sel:linkedAccount:RootCause' :: RootCause -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
linkedAccount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
linkedAccountName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
region
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
service
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
usageType