{-# 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.Lightsail.Types.Bundle where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lightsail.Types.InstancePlatform
import qualified Amazonka.Prelude as Prelude
data Bundle = Bundle'
{
Bundle -> Maybe Text
bundleId :: Prelude.Maybe Prelude.Text,
Bundle -> Maybe Int
cpuCount :: Prelude.Maybe Prelude.Int,
Bundle -> Maybe Int
diskSizeInGb :: Prelude.Maybe Prelude.Int,
Bundle -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
Bundle -> Maybe Bool
isActive :: Prelude.Maybe Prelude.Bool,
Bundle -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Bundle -> Maybe Int
power :: Prelude.Maybe Prelude.Int,
Bundle -> Maybe Double
price :: Prelude.Maybe Prelude.Double,
Bundle -> Maybe Double
ramSizeInGb :: Prelude.Maybe Prelude.Double,
Bundle -> Maybe [InstancePlatform]
supportedPlatforms :: Prelude.Maybe [InstancePlatform],
Bundle -> Maybe Int
transferPerMonthInGb :: Prelude.Maybe Prelude.Int
}
deriving (Bundle -> Bundle -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Bundle -> Bundle -> Bool
$c/= :: Bundle -> Bundle -> Bool
== :: Bundle -> Bundle -> Bool
$c== :: Bundle -> Bundle -> Bool
Prelude.Eq, ReadPrec [Bundle]
ReadPrec Bundle
Int -> ReadS Bundle
ReadS [Bundle]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Bundle]
$creadListPrec :: ReadPrec [Bundle]
readPrec :: ReadPrec Bundle
$creadPrec :: ReadPrec Bundle
readList :: ReadS [Bundle]
$creadList :: ReadS [Bundle]
readsPrec :: Int -> ReadS Bundle
$creadsPrec :: Int -> ReadS Bundle
Prelude.Read, Int -> Bundle -> ShowS
[Bundle] -> ShowS
Bundle -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Bundle] -> ShowS
$cshowList :: [Bundle] -> ShowS
show :: Bundle -> String
$cshow :: Bundle -> String
showsPrec :: Int -> Bundle -> ShowS
$cshowsPrec :: Int -> Bundle -> ShowS
Prelude.Show, forall x. Rep Bundle x -> Bundle
forall x. Bundle -> Rep Bundle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Bundle x -> Bundle
$cfrom :: forall x. Bundle -> Rep Bundle x
Prelude.Generic)
newBundle ::
Bundle
newBundle :: Bundle
newBundle =
Bundle'
{ $sel:bundleId:Bundle' :: Maybe Text
bundleId = forall a. Maybe a
Prelude.Nothing,
$sel:cpuCount:Bundle' :: Maybe Int
cpuCount = forall a. Maybe a
Prelude.Nothing,
$sel:diskSizeInGb:Bundle' :: Maybe Int
diskSizeInGb = forall a. Maybe a
Prelude.Nothing,
$sel:instanceType:Bundle' :: Maybe Text
instanceType = forall a. Maybe a
Prelude.Nothing,
$sel:isActive:Bundle' :: Maybe Bool
isActive = forall a. Maybe a
Prelude.Nothing,
$sel:name:Bundle' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:power:Bundle' :: Maybe Int
power = forall a. Maybe a
Prelude.Nothing,
$sel:price:Bundle' :: Maybe Double
price = forall a. Maybe a
Prelude.Nothing,
$sel:ramSizeInGb:Bundle' :: Maybe Double
ramSizeInGb = forall a. Maybe a
Prelude.Nothing,
$sel:supportedPlatforms:Bundle' :: Maybe [InstancePlatform]
supportedPlatforms = forall a. Maybe a
Prelude.Nothing,
$sel:transferPerMonthInGb:Bundle' :: Maybe Int
transferPerMonthInGb = forall a. Maybe a
Prelude.Nothing
}
bundle_bundleId :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Text)
bundle_bundleId :: Lens' Bundle (Maybe Text)
bundle_bundleId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Bundle' {Maybe Text
bundleId :: Maybe Text
$sel:bundleId:Bundle' :: Bundle -> Maybe Text
bundleId} -> Maybe Text
bundleId) (\s :: Bundle
s@Bundle' {} Maybe Text
a -> Bundle
s {$sel:bundleId:Bundle' :: Maybe Text
bundleId = Maybe Text
a} :: Bundle)
bundle_cpuCount :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Int)
bundle_cpuCount :: Lens' Bundle (Maybe Int)
bundle_cpuCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Bundle' {Maybe Int
cpuCount :: Maybe Int
$sel:cpuCount:Bundle' :: Bundle -> Maybe Int
cpuCount} -> Maybe Int
cpuCount) (\s :: Bundle
s@Bundle' {} Maybe Int
a -> Bundle
s {$sel:cpuCount:Bundle' :: Maybe Int
cpuCount = Maybe Int
a} :: Bundle)
bundle_diskSizeInGb :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Int)
bundle_diskSizeInGb :: Lens' Bundle (Maybe Int)
bundle_diskSizeInGb = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Bundle' {Maybe Int
diskSizeInGb :: Maybe Int
$sel:diskSizeInGb:Bundle' :: Bundle -> Maybe Int
diskSizeInGb} -> Maybe Int
diskSizeInGb) (\s :: Bundle
s@Bundle' {} Maybe Int
a -> Bundle
s {$sel:diskSizeInGb:Bundle' :: Maybe Int
diskSizeInGb = Maybe Int
a} :: Bundle)
bundle_instanceType :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Text)
bundle_instanceType :: Lens' Bundle (Maybe Text)
bundle_instanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Bundle' {Maybe Text
instanceType :: Maybe Text
$sel:instanceType:Bundle' :: Bundle -> Maybe Text
instanceType} -> Maybe Text
instanceType) (\s :: Bundle
s@Bundle' {} Maybe Text
a -> Bundle
s {$sel:instanceType:Bundle' :: Maybe Text
instanceType = Maybe Text
a} :: Bundle)
bundle_isActive :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Bool)
bundle_isActive :: Lens' Bundle (Maybe Bool)
bundle_isActive = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Bundle' {Maybe Bool
isActive :: Maybe Bool
$sel:isActive:Bundle' :: Bundle -> Maybe Bool
isActive} -> Maybe Bool
isActive) (\s :: Bundle
s@Bundle' {} Maybe Bool
a -> Bundle
s {$sel:isActive:Bundle' :: Maybe Bool
isActive = Maybe Bool
a} :: Bundle)
bundle_name :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Text)
bundle_name :: Lens' Bundle (Maybe Text)
bundle_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Bundle' {Maybe Text
name :: Maybe Text
$sel:name:Bundle' :: Bundle -> Maybe Text
name} -> Maybe Text
name) (\s :: Bundle
s@Bundle' {} Maybe Text
a -> Bundle
s {$sel:name:Bundle' :: Maybe Text
name = Maybe Text
a} :: Bundle)
bundle_power :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Int)
bundle_power :: Lens' Bundle (Maybe Int)
bundle_power = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Bundle' {Maybe Int
power :: Maybe Int
$sel:power:Bundle' :: Bundle -> Maybe Int
power} -> Maybe Int
power) (\s :: Bundle
s@Bundle' {} Maybe Int
a -> Bundle
s {$sel:power:Bundle' :: Maybe Int
power = Maybe Int
a} :: Bundle)
bundle_price :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Double)
bundle_price :: Lens' Bundle (Maybe Double)
bundle_price = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Bundle' {Maybe Double
price :: Maybe Double
$sel:price:Bundle' :: Bundle -> Maybe Double
price} -> Maybe Double
price) (\s :: Bundle
s@Bundle' {} Maybe Double
a -> Bundle
s {$sel:price:Bundle' :: Maybe Double
price = Maybe Double
a} :: Bundle)
bundle_ramSizeInGb :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Double)
bundle_ramSizeInGb :: Lens' Bundle (Maybe Double)
bundle_ramSizeInGb = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Bundle' {Maybe Double
ramSizeInGb :: Maybe Double
$sel:ramSizeInGb:Bundle' :: Bundle -> Maybe Double
ramSizeInGb} -> Maybe Double
ramSizeInGb) (\s :: Bundle
s@Bundle' {} Maybe Double
a -> Bundle
s {$sel:ramSizeInGb:Bundle' :: Maybe Double
ramSizeInGb = Maybe Double
a} :: Bundle)
bundle_supportedPlatforms :: Lens.Lens' Bundle (Prelude.Maybe [InstancePlatform])
bundle_supportedPlatforms :: Lens' Bundle (Maybe [InstancePlatform])
bundle_supportedPlatforms = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Bundle' {Maybe [InstancePlatform]
supportedPlatforms :: Maybe [InstancePlatform]
$sel:supportedPlatforms:Bundle' :: Bundle -> Maybe [InstancePlatform]
supportedPlatforms} -> Maybe [InstancePlatform]
supportedPlatforms) (\s :: Bundle
s@Bundle' {} Maybe [InstancePlatform]
a -> Bundle
s {$sel:supportedPlatforms:Bundle' :: Maybe [InstancePlatform]
supportedPlatforms = Maybe [InstancePlatform]
a} :: Bundle) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
bundle_transferPerMonthInGb :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Int)
bundle_transferPerMonthInGb :: Lens' Bundle (Maybe Int)
bundle_transferPerMonthInGb = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Bundle' {Maybe Int
transferPerMonthInGb :: Maybe Int
$sel:transferPerMonthInGb:Bundle' :: Bundle -> Maybe Int
transferPerMonthInGb} -> Maybe Int
transferPerMonthInGb) (\s :: Bundle
s@Bundle' {} Maybe Int
a -> Bundle
s {$sel:transferPerMonthInGb:Bundle' :: Maybe Int
transferPerMonthInGb = Maybe Int
a} :: Bundle)
instance Data.FromJSON Bundle where
parseJSON :: Value -> Parser Bundle
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Bundle"
( \Object
x ->
Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe Double
-> Maybe Double
-> Maybe [InstancePlatform]
-> Maybe Int
-> Bundle
Bundle'
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
"bundleId")
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
"cpuCount")
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
"diskSizeInGb")
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
"instanceType")
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
"isActive")
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
"name")
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
"power")
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
"price")
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
"ramSizeInGb")
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
"supportedPlatforms"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
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
"transferPerMonthInGb")
)
instance Prelude.Hashable Bundle where
hashWithSalt :: Int -> Bundle -> Int
hashWithSalt Int
_salt Bundle' {Maybe Bool
Maybe Double
Maybe Int
Maybe [InstancePlatform]
Maybe Text
transferPerMonthInGb :: Maybe Int
supportedPlatforms :: Maybe [InstancePlatform]
ramSizeInGb :: Maybe Double
price :: Maybe Double
power :: Maybe Int
name :: Maybe Text
isActive :: Maybe Bool
instanceType :: Maybe Text
diskSizeInGb :: Maybe Int
cpuCount :: Maybe Int
bundleId :: Maybe Text
$sel:transferPerMonthInGb:Bundle' :: Bundle -> Maybe Int
$sel:supportedPlatforms:Bundle' :: Bundle -> Maybe [InstancePlatform]
$sel:ramSizeInGb:Bundle' :: Bundle -> Maybe Double
$sel:price:Bundle' :: Bundle -> Maybe Double
$sel:power:Bundle' :: Bundle -> Maybe Int
$sel:name:Bundle' :: Bundle -> Maybe Text
$sel:isActive:Bundle' :: Bundle -> Maybe Bool
$sel:instanceType:Bundle' :: Bundle -> Maybe Text
$sel:diskSizeInGb:Bundle' :: Bundle -> Maybe Int
$sel:cpuCount:Bundle' :: Bundle -> Maybe Int
$sel:bundleId:Bundle' :: Bundle -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bundleId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
cpuCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
diskSizeInGb
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isActive
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
power
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
price
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
ramSizeInGb
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [InstancePlatform]
supportedPlatforms
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
transferPerMonthInGb
instance Prelude.NFData Bundle where
rnf :: Bundle -> ()
rnf Bundle' {Maybe Bool
Maybe Double
Maybe Int
Maybe [InstancePlatform]
Maybe Text
transferPerMonthInGb :: Maybe Int
supportedPlatforms :: Maybe [InstancePlatform]
ramSizeInGb :: Maybe Double
price :: Maybe Double
power :: Maybe Int
name :: Maybe Text
isActive :: Maybe Bool
instanceType :: Maybe Text
diskSizeInGb :: Maybe Int
cpuCount :: Maybe Int
bundleId :: Maybe Text
$sel:transferPerMonthInGb:Bundle' :: Bundle -> Maybe Int
$sel:supportedPlatforms:Bundle' :: Bundle -> Maybe [InstancePlatform]
$sel:ramSizeInGb:Bundle' :: Bundle -> Maybe Double
$sel:price:Bundle' :: Bundle -> Maybe Double
$sel:power:Bundle' :: Bundle -> Maybe Int
$sel:name:Bundle' :: Bundle -> Maybe Text
$sel:isActive:Bundle' :: Bundle -> Maybe Bool
$sel:instanceType:Bundle' :: Bundle -> Maybe Text
$sel:diskSizeInGb:Bundle' :: Bundle -> Maybe Int
$sel:cpuCount:Bundle' :: Bundle -> Maybe Int
$sel:bundleId:Bundle' :: Bundle -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bundleId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
cpuCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
diskSizeInGb
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isActive
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
power
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
price
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
ramSizeInGb
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [InstancePlatform]
supportedPlatforms
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
transferPerMonthInGb