{-# 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.InstanceDetails where
import qualified Amazonka.Core as Core
import Amazonka.CostExplorer.Types.EC2InstanceDetails
import Amazonka.CostExplorer.Types.ESInstanceDetails
import Amazonka.CostExplorer.Types.ElastiCacheInstanceDetails
import Amazonka.CostExplorer.Types.RDSInstanceDetails
import Amazonka.CostExplorer.Types.RedshiftInstanceDetails
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InstanceDetails = InstanceDetails'
{
InstanceDetails -> Maybe ESInstanceDetails
eSInstanceDetails :: Prelude.Maybe ESInstanceDetails,
InstanceDetails -> Maybe RDSInstanceDetails
rDSInstanceDetails :: Prelude.Maybe RDSInstanceDetails,
InstanceDetails -> Maybe ElastiCacheInstanceDetails
elastiCacheInstanceDetails :: Prelude.Maybe ElastiCacheInstanceDetails,
InstanceDetails -> Maybe EC2InstanceDetails
eC2InstanceDetails :: Prelude.Maybe EC2InstanceDetails,
InstanceDetails -> Maybe RedshiftInstanceDetails
redshiftInstanceDetails :: Prelude.Maybe RedshiftInstanceDetails
}
deriving (InstanceDetails -> InstanceDetails -> Bool
(InstanceDetails -> InstanceDetails -> Bool)
-> (InstanceDetails -> InstanceDetails -> Bool)
-> Eq InstanceDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceDetails -> InstanceDetails -> Bool
$c/= :: InstanceDetails -> InstanceDetails -> Bool
== :: InstanceDetails -> InstanceDetails -> Bool
$c== :: InstanceDetails -> InstanceDetails -> Bool
Prelude.Eq, ReadPrec [InstanceDetails]
ReadPrec InstanceDetails
Int -> ReadS InstanceDetails
ReadS [InstanceDetails]
(Int -> ReadS InstanceDetails)
-> ReadS [InstanceDetails]
-> ReadPrec InstanceDetails
-> ReadPrec [InstanceDetails]
-> Read InstanceDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceDetails]
$creadListPrec :: ReadPrec [InstanceDetails]
readPrec :: ReadPrec InstanceDetails
$creadPrec :: ReadPrec InstanceDetails
readList :: ReadS [InstanceDetails]
$creadList :: ReadS [InstanceDetails]
readsPrec :: Int -> ReadS InstanceDetails
$creadsPrec :: Int -> ReadS InstanceDetails
Prelude.Read, Int -> InstanceDetails -> ShowS
[InstanceDetails] -> ShowS
InstanceDetails -> String
(Int -> InstanceDetails -> ShowS)
-> (InstanceDetails -> String)
-> ([InstanceDetails] -> ShowS)
-> Show InstanceDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceDetails] -> ShowS
$cshowList :: [InstanceDetails] -> ShowS
show :: InstanceDetails -> String
$cshow :: InstanceDetails -> String
showsPrec :: Int -> InstanceDetails -> ShowS
$cshowsPrec :: Int -> InstanceDetails -> ShowS
Prelude.Show, (forall x. InstanceDetails -> Rep InstanceDetails x)
-> (forall x. Rep InstanceDetails x -> InstanceDetails)
-> Generic InstanceDetails
forall x. Rep InstanceDetails x -> InstanceDetails
forall x. InstanceDetails -> Rep InstanceDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceDetails x -> InstanceDetails
$cfrom :: forall x. InstanceDetails -> Rep InstanceDetails x
Prelude.Generic)
newInstanceDetails ::
InstanceDetails
newInstanceDetails :: InstanceDetails
newInstanceDetails =
InstanceDetails' :: Maybe ESInstanceDetails
-> Maybe RDSInstanceDetails
-> Maybe ElastiCacheInstanceDetails
-> Maybe EC2InstanceDetails
-> Maybe RedshiftInstanceDetails
-> InstanceDetails
InstanceDetails'
{ $sel:eSInstanceDetails:InstanceDetails' :: Maybe ESInstanceDetails
eSInstanceDetails =
Maybe ESInstanceDetails
forall a. Maybe a
Prelude.Nothing,
$sel:rDSInstanceDetails:InstanceDetails' :: Maybe RDSInstanceDetails
rDSInstanceDetails = Maybe RDSInstanceDetails
forall a. Maybe a
Prelude.Nothing,
$sel:elastiCacheInstanceDetails:InstanceDetails' :: Maybe ElastiCacheInstanceDetails
elastiCacheInstanceDetails = Maybe ElastiCacheInstanceDetails
forall a. Maybe a
Prelude.Nothing,
$sel:eC2InstanceDetails:InstanceDetails' :: Maybe EC2InstanceDetails
eC2InstanceDetails = Maybe EC2InstanceDetails
forall a. Maybe a
Prelude.Nothing,
$sel:redshiftInstanceDetails:InstanceDetails' :: Maybe RedshiftInstanceDetails
redshiftInstanceDetails = Maybe RedshiftInstanceDetails
forall a. Maybe a
Prelude.Nothing
}
instanceDetails_eSInstanceDetails :: Lens.Lens' InstanceDetails (Prelude.Maybe ESInstanceDetails)
instanceDetails_eSInstanceDetails :: (Maybe ESInstanceDetails -> f (Maybe ESInstanceDetails))
-> InstanceDetails -> f InstanceDetails
instanceDetails_eSInstanceDetails = (InstanceDetails -> Maybe ESInstanceDetails)
-> (InstanceDetails -> Maybe ESInstanceDetails -> InstanceDetails)
-> Lens
InstanceDetails
InstanceDetails
(Maybe ESInstanceDetails)
(Maybe ESInstanceDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceDetails' {Maybe ESInstanceDetails
eSInstanceDetails :: Maybe ESInstanceDetails
$sel:eSInstanceDetails:InstanceDetails' :: InstanceDetails -> Maybe ESInstanceDetails
eSInstanceDetails} -> Maybe ESInstanceDetails
eSInstanceDetails) (\s :: InstanceDetails
s@InstanceDetails' {} Maybe ESInstanceDetails
a -> InstanceDetails
s {$sel:eSInstanceDetails:InstanceDetails' :: Maybe ESInstanceDetails
eSInstanceDetails = Maybe ESInstanceDetails
a} :: InstanceDetails)
instanceDetails_rDSInstanceDetails :: Lens.Lens' InstanceDetails (Prelude.Maybe RDSInstanceDetails)
instanceDetails_rDSInstanceDetails :: (Maybe RDSInstanceDetails -> f (Maybe RDSInstanceDetails))
-> InstanceDetails -> f InstanceDetails
instanceDetails_rDSInstanceDetails = (InstanceDetails -> Maybe RDSInstanceDetails)
-> (InstanceDetails -> Maybe RDSInstanceDetails -> InstanceDetails)
-> Lens
InstanceDetails
InstanceDetails
(Maybe RDSInstanceDetails)
(Maybe RDSInstanceDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceDetails' {Maybe RDSInstanceDetails
rDSInstanceDetails :: Maybe RDSInstanceDetails
$sel:rDSInstanceDetails:InstanceDetails' :: InstanceDetails -> Maybe RDSInstanceDetails
rDSInstanceDetails} -> Maybe RDSInstanceDetails
rDSInstanceDetails) (\s :: InstanceDetails
s@InstanceDetails' {} Maybe RDSInstanceDetails
a -> InstanceDetails
s {$sel:rDSInstanceDetails:InstanceDetails' :: Maybe RDSInstanceDetails
rDSInstanceDetails = Maybe RDSInstanceDetails
a} :: InstanceDetails)
instanceDetails_elastiCacheInstanceDetails :: Lens.Lens' InstanceDetails (Prelude.Maybe ElastiCacheInstanceDetails)
instanceDetails_elastiCacheInstanceDetails :: (Maybe ElastiCacheInstanceDetails
-> f (Maybe ElastiCacheInstanceDetails))
-> InstanceDetails -> f InstanceDetails
instanceDetails_elastiCacheInstanceDetails = (InstanceDetails -> Maybe ElastiCacheInstanceDetails)
-> (InstanceDetails
-> Maybe ElastiCacheInstanceDetails -> InstanceDetails)
-> Lens
InstanceDetails
InstanceDetails
(Maybe ElastiCacheInstanceDetails)
(Maybe ElastiCacheInstanceDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceDetails' {Maybe ElastiCacheInstanceDetails
elastiCacheInstanceDetails :: Maybe ElastiCacheInstanceDetails
$sel:elastiCacheInstanceDetails:InstanceDetails' :: InstanceDetails -> Maybe ElastiCacheInstanceDetails
elastiCacheInstanceDetails} -> Maybe ElastiCacheInstanceDetails
elastiCacheInstanceDetails) (\s :: InstanceDetails
s@InstanceDetails' {} Maybe ElastiCacheInstanceDetails
a -> InstanceDetails
s {$sel:elastiCacheInstanceDetails:InstanceDetails' :: Maybe ElastiCacheInstanceDetails
elastiCacheInstanceDetails = Maybe ElastiCacheInstanceDetails
a} :: InstanceDetails)
instanceDetails_eC2InstanceDetails :: Lens.Lens' InstanceDetails (Prelude.Maybe EC2InstanceDetails)
instanceDetails_eC2InstanceDetails :: (Maybe EC2InstanceDetails -> f (Maybe EC2InstanceDetails))
-> InstanceDetails -> f InstanceDetails
instanceDetails_eC2InstanceDetails = (InstanceDetails -> Maybe EC2InstanceDetails)
-> (InstanceDetails -> Maybe EC2InstanceDetails -> InstanceDetails)
-> Lens
InstanceDetails
InstanceDetails
(Maybe EC2InstanceDetails)
(Maybe EC2InstanceDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceDetails' {Maybe EC2InstanceDetails
eC2InstanceDetails :: Maybe EC2InstanceDetails
$sel:eC2InstanceDetails:InstanceDetails' :: InstanceDetails -> Maybe EC2InstanceDetails
eC2InstanceDetails} -> Maybe EC2InstanceDetails
eC2InstanceDetails) (\s :: InstanceDetails
s@InstanceDetails' {} Maybe EC2InstanceDetails
a -> InstanceDetails
s {$sel:eC2InstanceDetails:InstanceDetails' :: Maybe EC2InstanceDetails
eC2InstanceDetails = Maybe EC2InstanceDetails
a} :: InstanceDetails)
instanceDetails_redshiftInstanceDetails :: Lens.Lens' InstanceDetails (Prelude.Maybe RedshiftInstanceDetails)
instanceDetails_redshiftInstanceDetails :: (Maybe RedshiftInstanceDetails
-> f (Maybe RedshiftInstanceDetails))
-> InstanceDetails -> f InstanceDetails
instanceDetails_redshiftInstanceDetails = (InstanceDetails -> Maybe RedshiftInstanceDetails)
-> (InstanceDetails
-> Maybe RedshiftInstanceDetails -> InstanceDetails)
-> Lens
InstanceDetails
InstanceDetails
(Maybe RedshiftInstanceDetails)
(Maybe RedshiftInstanceDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceDetails' {Maybe RedshiftInstanceDetails
redshiftInstanceDetails :: Maybe RedshiftInstanceDetails
$sel:redshiftInstanceDetails:InstanceDetails' :: InstanceDetails -> Maybe RedshiftInstanceDetails
redshiftInstanceDetails} -> Maybe RedshiftInstanceDetails
redshiftInstanceDetails) (\s :: InstanceDetails
s@InstanceDetails' {} Maybe RedshiftInstanceDetails
a -> InstanceDetails
s {$sel:redshiftInstanceDetails:InstanceDetails' :: Maybe RedshiftInstanceDetails
redshiftInstanceDetails = Maybe RedshiftInstanceDetails
a} :: InstanceDetails)
instance Core.FromJSON InstanceDetails where
parseJSON :: Value -> Parser InstanceDetails
parseJSON =
String
-> (Object -> Parser InstanceDetails)
-> Value
-> Parser InstanceDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InstanceDetails"
( \Object
x ->
Maybe ESInstanceDetails
-> Maybe RDSInstanceDetails
-> Maybe ElastiCacheInstanceDetails
-> Maybe EC2InstanceDetails
-> Maybe RedshiftInstanceDetails
-> InstanceDetails
InstanceDetails'
(Maybe ESInstanceDetails
-> Maybe RDSInstanceDetails
-> Maybe ElastiCacheInstanceDetails
-> Maybe EC2InstanceDetails
-> Maybe RedshiftInstanceDetails
-> InstanceDetails)
-> Parser (Maybe ESInstanceDetails)
-> Parser
(Maybe RDSInstanceDetails
-> Maybe ElastiCacheInstanceDetails
-> Maybe EC2InstanceDetails
-> Maybe RedshiftInstanceDetails
-> InstanceDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ESInstanceDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ESInstanceDetails")
Parser
(Maybe RDSInstanceDetails
-> Maybe ElastiCacheInstanceDetails
-> Maybe EC2InstanceDetails
-> Maybe RedshiftInstanceDetails
-> InstanceDetails)
-> Parser (Maybe RDSInstanceDetails)
-> Parser
(Maybe ElastiCacheInstanceDetails
-> Maybe EC2InstanceDetails
-> Maybe RedshiftInstanceDetails
-> InstanceDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RDSInstanceDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RDSInstanceDetails")
Parser
(Maybe ElastiCacheInstanceDetails
-> Maybe EC2InstanceDetails
-> Maybe RedshiftInstanceDetails
-> InstanceDetails)
-> Parser (Maybe ElastiCacheInstanceDetails)
-> Parser
(Maybe EC2InstanceDetails
-> Maybe RedshiftInstanceDetails -> InstanceDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ElastiCacheInstanceDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ElastiCacheInstanceDetails")
Parser
(Maybe EC2InstanceDetails
-> Maybe RedshiftInstanceDetails -> InstanceDetails)
-> Parser (Maybe EC2InstanceDetails)
-> Parser (Maybe RedshiftInstanceDetails -> InstanceDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EC2InstanceDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EC2InstanceDetails")
Parser (Maybe RedshiftInstanceDetails -> InstanceDetails)
-> Parser (Maybe RedshiftInstanceDetails) -> Parser InstanceDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RedshiftInstanceDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RedshiftInstanceDetails")
)
instance Prelude.Hashable InstanceDetails
instance Prelude.NFData InstanceDetails