{-# 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.ESInstanceDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ESInstanceDetails = ESInstanceDetails'
{
ESInstanceDetails -> Maybe Bool
currentGeneration :: Prelude.Maybe Prelude.Bool,
ESInstanceDetails -> Maybe Text
instanceClass :: Prelude.Maybe Prelude.Text,
ESInstanceDetails -> Maybe Text
instanceSize :: Prelude.Maybe Prelude.Text,
ESInstanceDetails -> Maybe Bool
sizeFlexEligible :: Prelude.Maybe Prelude.Bool,
ESInstanceDetails -> Maybe Text
region :: Prelude.Maybe Prelude.Text
}
deriving (ESInstanceDetails -> ESInstanceDetails -> Bool
(ESInstanceDetails -> ESInstanceDetails -> Bool)
-> (ESInstanceDetails -> ESInstanceDetails -> Bool)
-> Eq ESInstanceDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ESInstanceDetails -> ESInstanceDetails -> Bool
$c/= :: ESInstanceDetails -> ESInstanceDetails -> Bool
== :: ESInstanceDetails -> ESInstanceDetails -> Bool
$c== :: ESInstanceDetails -> ESInstanceDetails -> Bool
Prelude.Eq, ReadPrec [ESInstanceDetails]
ReadPrec ESInstanceDetails
Int -> ReadS ESInstanceDetails
ReadS [ESInstanceDetails]
(Int -> ReadS ESInstanceDetails)
-> ReadS [ESInstanceDetails]
-> ReadPrec ESInstanceDetails
-> ReadPrec [ESInstanceDetails]
-> Read ESInstanceDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ESInstanceDetails]
$creadListPrec :: ReadPrec [ESInstanceDetails]
readPrec :: ReadPrec ESInstanceDetails
$creadPrec :: ReadPrec ESInstanceDetails
readList :: ReadS [ESInstanceDetails]
$creadList :: ReadS [ESInstanceDetails]
readsPrec :: Int -> ReadS ESInstanceDetails
$creadsPrec :: Int -> ReadS ESInstanceDetails
Prelude.Read, Int -> ESInstanceDetails -> ShowS
[ESInstanceDetails] -> ShowS
ESInstanceDetails -> String
(Int -> ESInstanceDetails -> ShowS)
-> (ESInstanceDetails -> String)
-> ([ESInstanceDetails] -> ShowS)
-> Show ESInstanceDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ESInstanceDetails] -> ShowS
$cshowList :: [ESInstanceDetails] -> ShowS
show :: ESInstanceDetails -> String
$cshow :: ESInstanceDetails -> String
showsPrec :: Int -> ESInstanceDetails -> ShowS
$cshowsPrec :: Int -> ESInstanceDetails -> ShowS
Prelude.Show, (forall x. ESInstanceDetails -> Rep ESInstanceDetails x)
-> (forall x. Rep ESInstanceDetails x -> ESInstanceDetails)
-> Generic ESInstanceDetails
forall x. Rep ESInstanceDetails x -> ESInstanceDetails
forall x. ESInstanceDetails -> Rep ESInstanceDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ESInstanceDetails x -> ESInstanceDetails
$cfrom :: forall x. ESInstanceDetails -> Rep ESInstanceDetails x
Prelude.Generic)
newESInstanceDetails ::
ESInstanceDetails
newESInstanceDetails :: ESInstanceDetails
newESInstanceDetails =
ESInstanceDetails' :: Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> ESInstanceDetails
ESInstanceDetails'
{ $sel:currentGeneration:ESInstanceDetails' :: Maybe Bool
currentGeneration =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:instanceClass:ESInstanceDetails' :: Maybe Text
instanceClass = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceSize:ESInstanceDetails' :: Maybe Text
instanceSize = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sizeFlexEligible:ESInstanceDetails' :: Maybe Bool
sizeFlexEligible = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:region:ESInstanceDetails' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
eSInstanceDetails_currentGeneration :: Lens.Lens' ESInstanceDetails (Prelude.Maybe Prelude.Bool)
eSInstanceDetails_currentGeneration :: (Maybe Bool -> f (Maybe Bool))
-> ESInstanceDetails -> f ESInstanceDetails
eSInstanceDetails_currentGeneration = (ESInstanceDetails -> Maybe Bool)
-> (ESInstanceDetails -> Maybe Bool -> ESInstanceDetails)
-> Lens
ESInstanceDetails ESInstanceDetails (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ESInstanceDetails' {Maybe Bool
currentGeneration :: Maybe Bool
$sel:currentGeneration:ESInstanceDetails' :: ESInstanceDetails -> Maybe Bool
currentGeneration} -> Maybe Bool
currentGeneration) (\s :: ESInstanceDetails
s@ESInstanceDetails' {} Maybe Bool
a -> ESInstanceDetails
s {$sel:currentGeneration:ESInstanceDetails' :: Maybe Bool
currentGeneration = Maybe Bool
a} :: ESInstanceDetails)
eSInstanceDetails_instanceClass :: Lens.Lens' ESInstanceDetails (Prelude.Maybe Prelude.Text)
eSInstanceDetails_instanceClass :: (Maybe Text -> f (Maybe Text))
-> ESInstanceDetails -> f ESInstanceDetails
eSInstanceDetails_instanceClass = (ESInstanceDetails -> Maybe Text)
-> (ESInstanceDetails -> Maybe Text -> ESInstanceDetails)
-> Lens
ESInstanceDetails ESInstanceDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ESInstanceDetails' {Maybe Text
instanceClass :: Maybe Text
$sel:instanceClass:ESInstanceDetails' :: ESInstanceDetails -> Maybe Text
instanceClass} -> Maybe Text
instanceClass) (\s :: ESInstanceDetails
s@ESInstanceDetails' {} Maybe Text
a -> ESInstanceDetails
s {$sel:instanceClass:ESInstanceDetails' :: Maybe Text
instanceClass = Maybe Text
a} :: ESInstanceDetails)
eSInstanceDetails_instanceSize :: Lens.Lens' ESInstanceDetails (Prelude.Maybe Prelude.Text)
eSInstanceDetails_instanceSize :: (Maybe Text -> f (Maybe Text))
-> ESInstanceDetails -> f ESInstanceDetails
eSInstanceDetails_instanceSize = (ESInstanceDetails -> Maybe Text)
-> (ESInstanceDetails -> Maybe Text -> ESInstanceDetails)
-> Lens
ESInstanceDetails ESInstanceDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ESInstanceDetails' {Maybe Text
instanceSize :: Maybe Text
$sel:instanceSize:ESInstanceDetails' :: ESInstanceDetails -> Maybe Text
instanceSize} -> Maybe Text
instanceSize) (\s :: ESInstanceDetails
s@ESInstanceDetails' {} Maybe Text
a -> ESInstanceDetails
s {$sel:instanceSize:ESInstanceDetails' :: Maybe Text
instanceSize = Maybe Text
a} :: ESInstanceDetails)
eSInstanceDetails_sizeFlexEligible :: Lens.Lens' ESInstanceDetails (Prelude.Maybe Prelude.Bool)
eSInstanceDetails_sizeFlexEligible :: (Maybe Bool -> f (Maybe Bool))
-> ESInstanceDetails -> f ESInstanceDetails
eSInstanceDetails_sizeFlexEligible = (ESInstanceDetails -> Maybe Bool)
-> (ESInstanceDetails -> Maybe Bool -> ESInstanceDetails)
-> Lens
ESInstanceDetails ESInstanceDetails (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ESInstanceDetails' {Maybe Bool
sizeFlexEligible :: Maybe Bool
$sel:sizeFlexEligible:ESInstanceDetails' :: ESInstanceDetails -> Maybe Bool
sizeFlexEligible} -> Maybe Bool
sizeFlexEligible) (\s :: ESInstanceDetails
s@ESInstanceDetails' {} Maybe Bool
a -> ESInstanceDetails
s {$sel:sizeFlexEligible:ESInstanceDetails' :: Maybe Bool
sizeFlexEligible = Maybe Bool
a} :: ESInstanceDetails)
eSInstanceDetails_region :: Lens.Lens' ESInstanceDetails (Prelude.Maybe Prelude.Text)
eSInstanceDetails_region :: (Maybe Text -> f (Maybe Text))
-> ESInstanceDetails -> f ESInstanceDetails
eSInstanceDetails_region = (ESInstanceDetails -> Maybe Text)
-> (ESInstanceDetails -> Maybe Text -> ESInstanceDetails)
-> Lens
ESInstanceDetails ESInstanceDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ESInstanceDetails' {Maybe Text
region :: Maybe Text
$sel:region:ESInstanceDetails' :: ESInstanceDetails -> Maybe Text
region} -> Maybe Text
region) (\s :: ESInstanceDetails
s@ESInstanceDetails' {} Maybe Text
a -> ESInstanceDetails
s {$sel:region:ESInstanceDetails' :: Maybe Text
region = Maybe Text
a} :: ESInstanceDetails)
instance Core.FromJSON ESInstanceDetails where
parseJSON :: Value -> Parser ESInstanceDetails
parseJSON =
String
-> (Object -> Parser ESInstanceDetails)
-> Value
-> Parser ESInstanceDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ESInstanceDetails"
( \Object
x ->
Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> ESInstanceDetails
ESInstanceDetails'
(Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> ESInstanceDetails)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Bool -> Maybe Text -> ESInstanceDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CurrentGeneration")
Parser
(Maybe Text
-> Maybe Text -> Maybe Bool -> Maybe Text -> ESInstanceDetails)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Bool -> Maybe Text -> ESInstanceDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceClass")
Parser
(Maybe Text -> Maybe Bool -> Maybe Text -> ESInstanceDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> Maybe Text -> ESInstanceDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceSize")
Parser (Maybe Bool -> Maybe Text -> ESInstanceDetails)
-> Parser (Maybe Bool) -> Parser (Maybe Text -> ESInstanceDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SizeFlexEligible")
Parser (Maybe Text -> ESInstanceDetails)
-> Parser (Maybe Text) -> Parser ESInstanceDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Region")
)
instance Prelude.Hashable ESInstanceDetails
instance Prelude.NFData ESInstanceDetails