{-# 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.EC2InstanceDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EC2InstanceDetails = EC2InstanceDetails'
{
EC2InstanceDetails -> Maybe Bool
currentGeneration :: Prelude.Maybe Prelude.Bool,
EC2InstanceDetails -> Maybe Text
platform :: Prelude.Maybe Prelude.Text,
EC2InstanceDetails -> Maybe Text
family :: Prelude.Maybe Prelude.Text,
EC2InstanceDetails -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
EC2InstanceDetails -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
EC2InstanceDetails -> Maybe Bool
sizeFlexEligible :: Prelude.Maybe Prelude.Bool,
EC2InstanceDetails -> Maybe Text
tenancy :: Prelude.Maybe Prelude.Text,
EC2InstanceDetails -> Maybe Text
region :: Prelude.Maybe Prelude.Text
}
deriving (EC2InstanceDetails -> EC2InstanceDetails -> Bool
(EC2InstanceDetails -> EC2InstanceDetails -> Bool)
-> (EC2InstanceDetails -> EC2InstanceDetails -> Bool)
-> Eq EC2InstanceDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EC2InstanceDetails -> EC2InstanceDetails -> Bool
$c/= :: EC2InstanceDetails -> EC2InstanceDetails -> Bool
== :: EC2InstanceDetails -> EC2InstanceDetails -> Bool
$c== :: EC2InstanceDetails -> EC2InstanceDetails -> Bool
Prelude.Eq, ReadPrec [EC2InstanceDetails]
ReadPrec EC2InstanceDetails
Int -> ReadS EC2InstanceDetails
ReadS [EC2InstanceDetails]
(Int -> ReadS EC2InstanceDetails)
-> ReadS [EC2InstanceDetails]
-> ReadPrec EC2InstanceDetails
-> ReadPrec [EC2InstanceDetails]
-> Read EC2InstanceDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EC2InstanceDetails]
$creadListPrec :: ReadPrec [EC2InstanceDetails]
readPrec :: ReadPrec EC2InstanceDetails
$creadPrec :: ReadPrec EC2InstanceDetails
readList :: ReadS [EC2InstanceDetails]
$creadList :: ReadS [EC2InstanceDetails]
readsPrec :: Int -> ReadS EC2InstanceDetails
$creadsPrec :: Int -> ReadS EC2InstanceDetails
Prelude.Read, Int -> EC2InstanceDetails -> ShowS
[EC2InstanceDetails] -> ShowS
EC2InstanceDetails -> String
(Int -> EC2InstanceDetails -> ShowS)
-> (EC2InstanceDetails -> String)
-> ([EC2InstanceDetails] -> ShowS)
-> Show EC2InstanceDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EC2InstanceDetails] -> ShowS
$cshowList :: [EC2InstanceDetails] -> ShowS
show :: EC2InstanceDetails -> String
$cshow :: EC2InstanceDetails -> String
showsPrec :: Int -> EC2InstanceDetails -> ShowS
$cshowsPrec :: Int -> EC2InstanceDetails -> ShowS
Prelude.Show, (forall x. EC2InstanceDetails -> Rep EC2InstanceDetails x)
-> (forall x. Rep EC2InstanceDetails x -> EC2InstanceDetails)
-> Generic EC2InstanceDetails
forall x. Rep EC2InstanceDetails x -> EC2InstanceDetails
forall x. EC2InstanceDetails -> Rep EC2InstanceDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EC2InstanceDetails x -> EC2InstanceDetails
$cfrom :: forall x. EC2InstanceDetails -> Rep EC2InstanceDetails x
Prelude.Generic)
newEC2InstanceDetails ::
EC2InstanceDetails
newEC2InstanceDetails :: EC2InstanceDetails
newEC2InstanceDetails =
EC2InstanceDetails' :: Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> EC2InstanceDetails
EC2InstanceDetails'
{ $sel:currentGeneration:EC2InstanceDetails' :: Maybe Bool
currentGeneration =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:platform:EC2InstanceDetails' :: Maybe Text
platform = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:family:EC2InstanceDetails' :: Maybe Text
family = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceType:EC2InstanceDetails' :: Maybe Text
instanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:availabilityZone:EC2InstanceDetails' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sizeFlexEligible:EC2InstanceDetails' :: Maybe Bool
sizeFlexEligible = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:tenancy:EC2InstanceDetails' :: Maybe Text
tenancy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:region:EC2InstanceDetails' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
eC2InstanceDetails_currentGeneration :: Lens.Lens' EC2InstanceDetails (Prelude.Maybe Prelude.Bool)
eC2InstanceDetails_currentGeneration :: (Maybe Bool -> f (Maybe Bool))
-> EC2InstanceDetails -> f EC2InstanceDetails
eC2InstanceDetails_currentGeneration = (EC2InstanceDetails -> Maybe Bool)
-> (EC2InstanceDetails -> Maybe Bool -> EC2InstanceDetails)
-> Lens
EC2InstanceDetails EC2InstanceDetails (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceDetails' {Maybe Bool
currentGeneration :: Maybe Bool
$sel:currentGeneration:EC2InstanceDetails' :: EC2InstanceDetails -> Maybe Bool
currentGeneration} -> Maybe Bool
currentGeneration) (\s :: EC2InstanceDetails
s@EC2InstanceDetails' {} Maybe Bool
a -> EC2InstanceDetails
s {$sel:currentGeneration:EC2InstanceDetails' :: Maybe Bool
currentGeneration = Maybe Bool
a} :: EC2InstanceDetails)
eC2InstanceDetails_platform :: Lens.Lens' EC2InstanceDetails (Prelude.Maybe Prelude.Text)
eC2InstanceDetails_platform :: (Maybe Text -> f (Maybe Text))
-> EC2InstanceDetails -> f EC2InstanceDetails
eC2InstanceDetails_platform = (EC2InstanceDetails -> Maybe Text)
-> (EC2InstanceDetails -> Maybe Text -> EC2InstanceDetails)
-> Lens
EC2InstanceDetails EC2InstanceDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceDetails' {Maybe Text
platform :: Maybe Text
$sel:platform:EC2InstanceDetails' :: EC2InstanceDetails -> Maybe Text
platform} -> Maybe Text
platform) (\s :: EC2InstanceDetails
s@EC2InstanceDetails' {} Maybe Text
a -> EC2InstanceDetails
s {$sel:platform:EC2InstanceDetails' :: Maybe Text
platform = Maybe Text
a} :: EC2InstanceDetails)
eC2InstanceDetails_family :: Lens.Lens' EC2InstanceDetails (Prelude.Maybe Prelude.Text)
eC2InstanceDetails_family :: (Maybe Text -> f (Maybe Text))
-> EC2InstanceDetails -> f EC2InstanceDetails
eC2InstanceDetails_family = (EC2InstanceDetails -> Maybe Text)
-> (EC2InstanceDetails -> Maybe Text -> EC2InstanceDetails)
-> Lens
EC2InstanceDetails EC2InstanceDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceDetails' {Maybe Text
family :: Maybe Text
$sel:family:EC2InstanceDetails' :: EC2InstanceDetails -> Maybe Text
family} -> Maybe Text
family) (\s :: EC2InstanceDetails
s@EC2InstanceDetails' {} Maybe Text
a -> EC2InstanceDetails
s {$sel:family:EC2InstanceDetails' :: Maybe Text
family = Maybe Text
a} :: EC2InstanceDetails)
eC2InstanceDetails_instanceType :: Lens.Lens' EC2InstanceDetails (Prelude.Maybe Prelude.Text)
eC2InstanceDetails_instanceType :: (Maybe Text -> f (Maybe Text))
-> EC2InstanceDetails -> f EC2InstanceDetails
eC2InstanceDetails_instanceType = (EC2InstanceDetails -> Maybe Text)
-> (EC2InstanceDetails -> Maybe Text -> EC2InstanceDetails)
-> Lens
EC2InstanceDetails EC2InstanceDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceDetails' {Maybe Text
instanceType :: Maybe Text
$sel:instanceType:EC2InstanceDetails' :: EC2InstanceDetails -> Maybe Text
instanceType} -> Maybe Text
instanceType) (\s :: EC2InstanceDetails
s@EC2InstanceDetails' {} Maybe Text
a -> EC2InstanceDetails
s {$sel:instanceType:EC2InstanceDetails' :: Maybe Text
instanceType = Maybe Text
a} :: EC2InstanceDetails)
eC2InstanceDetails_availabilityZone :: Lens.Lens' EC2InstanceDetails (Prelude.Maybe Prelude.Text)
eC2InstanceDetails_availabilityZone :: (Maybe Text -> f (Maybe Text))
-> EC2InstanceDetails -> f EC2InstanceDetails
eC2InstanceDetails_availabilityZone = (EC2InstanceDetails -> Maybe Text)
-> (EC2InstanceDetails -> Maybe Text -> EC2InstanceDetails)
-> Lens
EC2InstanceDetails EC2InstanceDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceDetails' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:EC2InstanceDetails' :: EC2InstanceDetails -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: EC2InstanceDetails
s@EC2InstanceDetails' {} Maybe Text
a -> EC2InstanceDetails
s {$sel:availabilityZone:EC2InstanceDetails' :: Maybe Text
availabilityZone = Maybe Text
a} :: EC2InstanceDetails)
eC2InstanceDetails_sizeFlexEligible :: Lens.Lens' EC2InstanceDetails (Prelude.Maybe Prelude.Bool)
eC2InstanceDetails_sizeFlexEligible :: (Maybe Bool -> f (Maybe Bool))
-> EC2InstanceDetails -> f EC2InstanceDetails
eC2InstanceDetails_sizeFlexEligible = (EC2InstanceDetails -> Maybe Bool)
-> (EC2InstanceDetails -> Maybe Bool -> EC2InstanceDetails)
-> Lens
EC2InstanceDetails EC2InstanceDetails (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceDetails' {Maybe Bool
sizeFlexEligible :: Maybe Bool
$sel:sizeFlexEligible:EC2InstanceDetails' :: EC2InstanceDetails -> Maybe Bool
sizeFlexEligible} -> Maybe Bool
sizeFlexEligible) (\s :: EC2InstanceDetails
s@EC2InstanceDetails' {} Maybe Bool
a -> EC2InstanceDetails
s {$sel:sizeFlexEligible:EC2InstanceDetails' :: Maybe Bool
sizeFlexEligible = Maybe Bool
a} :: EC2InstanceDetails)
eC2InstanceDetails_tenancy :: Lens.Lens' EC2InstanceDetails (Prelude.Maybe Prelude.Text)
eC2InstanceDetails_tenancy :: (Maybe Text -> f (Maybe Text))
-> EC2InstanceDetails -> f EC2InstanceDetails
eC2InstanceDetails_tenancy = (EC2InstanceDetails -> Maybe Text)
-> (EC2InstanceDetails -> Maybe Text -> EC2InstanceDetails)
-> Lens
EC2InstanceDetails EC2InstanceDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceDetails' {Maybe Text
tenancy :: Maybe Text
$sel:tenancy:EC2InstanceDetails' :: EC2InstanceDetails -> Maybe Text
tenancy} -> Maybe Text
tenancy) (\s :: EC2InstanceDetails
s@EC2InstanceDetails' {} Maybe Text
a -> EC2InstanceDetails
s {$sel:tenancy:EC2InstanceDetails' :: Maybe Text
tenancy = Maybe Text
a} :: EC2InstanceDetails)
eC2InstanceDetails_region :: Lens.Lens' EC2InstanceDetails (Prelude.Maybe Prelude.Text)
eC2InstanceDetails_region :: (Maybe Text -> f (Maybe Text))
-> EC2InstanceDetails -> f EC2InstanceDetails
eC2InstanceDetails_region = (EC2InstanceDetails -> Maybe Text)
-> (EC2InstanceDetails -> Maybe Text -> EC2InstanceDetails)
-> Lens
EC2InstanceDetails EC2InstanceDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceDetails' {Maybe Text
region :: Maybe Text
$sel:region:EC2InstanceDetails' :: EC2InstanceDetails -> Maybe Text
region} -> Maybe Text
region) (\s :: EC2InstanceDetails
s@EC2InstanceDetails' {} Maybe Text
a -> EC2InstanceDetails
s {$sel:region:EC2InstanceDetails' :: Maybe Text
region = Maybe Text
a} :: EC2InstanceDetails)
instance Core.FromJSON EC2InstanceDetails where
parseJSON :: Value -> Parser EC2InstanceDetails
parseJSON =
String
-> (Object -> Parser EC2InstanceDetails)
-> Value
-> Parser EC2InstanceDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EC2InstanceDetails"
( \Object
x ->
Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> EC2InstanceDetails
EC2InstanceDetails'
(Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> EC2InstanceDetails)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> EC2InstanceDetails)
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 Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> EC2InstanceDetails)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> EC2InstanceDetails)
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
"Platform")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> EC2InstanceDetails)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> EC2InstanceDetails)
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
"Family")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> EC2InstanceDetails)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Bool -> Maybe Text -> Maybe Text -> EC2InstanceDetails)
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
"InstanceType")
Parser
(Maybe Text
-> Maybe Bool -> Maybe Text -> Maybe Text -> EC2InstanceDetails)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool -> Maybe Text -> Maybe Text -> EC2InstanceDetails)
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
"AvailabilityZone")
Parser
(Maybe Bool -> Maybe Text -> Maybe Text -> EC2InstanceDetails)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> Maybe Text -> EC2InstanceDetails)
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 -> Maybe Text -> EC2InstanceDetails)
-> Parser (Maybe Text) -> Parser (Maybe Text -> EC2InstanceDetails)
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
"Tenancy")
Parser (Maybe Text -> EC2InstanceDetails)
-> Parser (Maybe Text) -> Parser EC2InstanceDetails
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 EC2InstanceDetails
instance Prelude.NFData EC2InstanceDetails