{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Lightsail.Types.Bundle
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Lightsail.Types.Bundle where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.InstancePlatform
import qualified Amazonka.Prelude as Prelude

-- | Describes a bundle, which is a set of specs describing your virtual
-- private server (or /instance/).
--
-- /See:/ 'newBundle' smart constructor.
data Bundle = Bundle'
  { -- | The number of vCPUs included in the bundle (e.g., @2@).
    Bundle -> Maybe Int
cpuCount :: Prelude.Maybe Prelude.Int,
    -- | The data transfer rate per month in GB (e.g., @2000@).
    Bundle -> Maybe Int
transferPerMonthInGb :: Prelude.Maybe Prelude.Int,
    -- | The bundle ID (e.g., @micro_1_0@).
    Bundle -> Maybe Text
bundleId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon EC2 instance type (e.g., @t2.micro@).
    Bundle -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
    -- | A friendly name for the bundle (e.g., @Micro@).
    Bundle -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | A numeric value that represents the power of the bundle (e.g., @500@).
    -- You can use the bundle\'s power value in conjunction with a blueprint\'s
    -- minimum power value to determine whether the blueprint will run on the
    -- bundle. For example, you need a bundle with a power value of 500 or more
    -- to create an instance that uses a blueprint with a minimum power value
    -- of 500.
    Bundle -> Maybe Int
power :: Prelude.Maybe Prelude.Int,
    -- | The size of the SSD (e.g., @30@).
    Bundle -> Maybe Int
diskSizeInGb :: Prelude.Maybe Prelude.Int,
    -- | The operating system platform (Linux\/Unix-based or Windows
    -- Server-based) that the bundle supports. You can only launch a @WINDOWS@
    -- bundle on a blueprint that supports the @WINDOWS@ platform. @LINUX_UNIX@
    -- blueprints require a @LINUX_UNIX@ bundle.
    Bundle -> Maybe [InstancePlatform]
supportedPlatforms :: Prelude.Maybe [InstancePlatform],
    -- | The price in US dollars (e.g., @5.0@) of the bundle.
    Bundle -> Maybe Double
price :: Prelude.Maybe Prelude.Double,
    -- | A Boolean value indicating whether the bundle is active.
    Bundle -> Maybe Bool
isActive :: Prelude.Maybe Prelude.Bool,
    -- | The amount of RAM in GB (e.g., @2.0@).
    Bundle -> Maybe Double
ramSizeInGb :: Prelude.Maybe Prelude.Double
  }
  deriving (Bundle -> Bundle -> Bool
(Bundle -> Bundle -> Bool)
-> (Bundle -> Bundle -> Bool) -> Eq Bundle
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]
(Int -> ReadS Bundle)
-> ReadS [Bundle]
-> ReadPrec Bundle
-> ReadPrec [Bundle]
-> Read 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
(Int -> Bundle -> ShowS)
-> (Bundle -> String) -> ([Bundle] -> ShowS) -> Show Bundle
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. Bundle -> Rep Bundle x)
-> (forall x. Rep Bundle x -> Bundle) -> Generic Bundle
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)

-- |
-- Create a value of 'Bundle' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'cpuCount', 'bundle_cpuCount' - The number of vCPUs included in the bundle (e.g., @2@).
--
-- 'transferPerMonthInGb', 'bundle_transferPerMonthInGb' - The data transfer rate per month in GB (e.g., @2000@).
--
-- 'bundleId', 'bundle_bundleId' - The bundle ID (e.g., @micro_1_0@).
--
-- 'instanceType', 'bundle_instanceType' - The Amazon EC2 instance type (e.g., @t2.micro@).
--
-- 'name', 'bundle_name' - A friendly name for the bundle (e.g., @Micro@).
--
-- 'power', 'bundle_power' - A numeric value that represents the power of the bundle (e.g., @500@).
-- You can use the bundle\'s power value in conjunction with a blueprint\'s
-- minimum power value to determine whether the blueprint will run on the
-- bundle. For example, you need a bundle with a power value of 500 or more
-- to create an instance that uses a blueprint with a minimum power value
-- of 500.
--
-- 'diskSizeInGb', 'bundle_diskSizeInGb' - The size of the SSD (e.g., @30@).
--
-- 'supportedPlatforms', 'bundle_supportedPlatforms' - The operating system platform (Linux\/Unix-based or Windows
-- Server-based) that the bundle supports. You can only launch a @WINDOWS@
-- bundle on a blueprint that supports the @WINDOWS@ platform. @LINUX_UNIX@
-- blueprints require a @LINUX_UNIX@ bundle.
--
-- 'price', 'bundle_price' - The price in US dollars (e.g., @5.0@) of the bundle.
--
-- 'isActive', 'bundle_isActive' - A Boolean value indicating whether the bundle is active.
--
-- 'ramSizeInGb', 'bundle_ramSizeInGb' - The amount of RAM in GB (e.g., @2.0@).
newBundle ::
  Bundle
newBundle :: Bundle
newBundle =
  Bundle' :: Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe [InstancePlatform]
-> Maybe Double
-> Maybe Bool
-> Maybe Double
-> Bundle
Bundle'
    { $sel:cpuCount:Bundle' :: Maybe Int
cpuCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:transferPerMonthInGb:Bundle' :: Maybe Int
transferPerMonthInGb = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:bundleId:Bundle' :: Maybe Text
bundleId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:Bundle' :: Maybe Text
instanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Bundle' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:power:Bundle' :: Maybe Int
power = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:diskSizeInGb:Bundle' :: Maybe Int
diskSizeInGb = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:supportedPlatforms:Bundle' :: Maybe [InstancePlatform]
supportedPlatforms = Maybe [InstancePlatform]
forall a. Maybe a
Prelude.Nothing,
      $sel:price:Bundle' :: Maybe Double
price = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:isActive:Bundle' :: Maybe Bool
isActive = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:ramSizeInGb:Bundle' :: Maybe Double
ramSizeInGb = Maybe Double
forall a. Maybe a
Prelude.Nothing
    }

-- | The number of vCPUs included in the bundle (e.g., @2@).
bundle_cpuCount :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Int)
bundle_cpuCount :: (Maybe Int -> f (Maybe Int)) -> Bundle -> f Bundle
bundle_cpuCount = (Bundle -> Maybe Int)
-> (Bundle -> Maybe Int -> Bundle)
-> Lens Bundle Bundle (Maybe Int) (Maybe Int)
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)

-- | The data transfer rate per month in GB (e.g., @2000@).
bundle_transferPerMonthInGb :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Int)
bundle_transferPerMonthInGb :: (Maybe Int -> f (Maybe Int)) -> Bundle -> f Bundle
bundle_transferPerMonthInGb = (Bundle -> Maybe Int)
-> (Bundle -> Maybe Int -> Bundle)
-> Lens Bundle Bundle (Maybe Int) (Maybe Int)
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)

-- | The bundle ID (e.g., @micro_1_0@).
bundle_bundleId :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Text)
bundle_bundleId :: (Maybe Text -> f (Maybe Text)) -> Bundle -> f Bundle
bundle_bundleId = (Bundle -> Maybe Text)
-> (Bundle -> Maybe Text -> Bundle)
-> Lens Bundle Bundle (Maybe Text) (Maybe Text)
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)

-- | The Amazon EC2 instance type (e.g., @t2.micro@).
bundle_instanceType :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Text)
bundle_instanceType :: (Maybe Text -> f (Maybe Text)) -> Bundle -> f Bundle
bundle_instanceType = (Bundle -> Maybe Text)
-> (Bundle -> Maybe Text -> Bundle)
-> Lens Bundle Bundle (Maybe Text) (Maybe Text)
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)

-- | A friendly name for the bundle (e.g., @Micro@).
bundle_name :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Text)
bundle_name :: (Maybe Text -> f (Maybe Text)) -> Bundle -> f Bundle
bundle_name = (Bundle -> Maybe Text)
-> (Bundle -> Maybe Text -> Bundle)
-> Lens Bundle Bundle (Maybe Text) (Maybe Text)
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)

-- | A numeric value that represents the power of the bundle (e.g., @500@).
-- You can use the bundle\'s power value in conjunction with a blueprint\'s
-- minimum power value to determine whether the blueprint will run on the
-- bundle. For example, you need a bundle with a power value of 500 or more
-- to create an instance that uses a blueprint with a minimum power value
-- of 500.
bundle_power :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Int)
bundle_power :: (Maybe Int -> f (Maybe Int)) -> Bundle -> f Bundle
bundle_power = (Bundle -> Maybe Int)
-> (Bundle -> Maybe Int -> Bundle)
-> Lens Bundle Bundle (Maybe Int) (Maybe Int)
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)

-- | The size of the SSD (e.g., @30@).
bundle_diskSizeInGb :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Int)
bundle_diskSizeInGb :: (Maybe Int -> f (Maybe Int)) -> Bundle -> f Bundle
bundle_diskSizeInGb = (Bundle -> Maybe Int)
-> (Bundle -> Maybe Int -> Bundle)
-> Lens Bundle Bundle (Maybe Int) (Maybe Int)
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)

-- | The operating system platform (Linux\/Unix-based or Windows
-- Server-based) that the bundle supports. You can only launch a @WINDOWS@
-- bundle on a blueprint that supports the @WINDOWS@ platform. @LINUX_UNIX@
-- blueprints require a @LINUX_UNIX@ bundle.
bundle_supportedPlatforms :: Lens.Lens' Bundle (Prelude.Maybe [InstancePlatform])
bundle_supportedPlatforms :: (Maybe [InstancePlatform] -> f (Maybe [InstancePlatform]))
-> Bundle -> f Bundle
bundle_supportedPlatforms = (Bundle -> Maybe [InstancePlatform])
-> (Bundle -> Maybe [InstancePlatform] -> Bundle)
-> Lens
     Bundle Bundle (Maybe [InstancePlatform]) (Maybe [InstancePlatform])
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) ((Maybe [InstancePlatform] -> f (Maybe [InstancePlatform]))
 -> Bundle -> f Bundle)
-> ((Maybe [InstancePlatform] -> f (Maybe [InstancePlatform]))
    -> Maybe [InstancePlatform] -> f (Maybe [InstancePlatform]))
-> (Maybe [InstancePlatform] -> f (Maybe [InstancePlatform]))
-> Bundle
-> f Bundle
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InstancePlatform]
  [InstancePlatform]
  [InstancePlatform]
  [InstancePlatform]
-> Iso
     (Maybe [InstancePlatform])
     (Maybe [InstancePlatform])
     (Maybe [InstancePlatform])
     (Maybe [InstancePlatform])
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 AnIso
  [InstancePlatform]
  [InstancePlatform]
  [InstancePlatform]
  [InstancePlatform]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The price in US dollars (e.g., @5.0@) of the bundle.
bundle_price :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Double)
bundle_price :: (Maybe Double -> f (Maybe Double)) -> Bundle -> f Bundle
bundle_price = (Bundle -> Maybe Double)
-> (Bundle -> Maybe Double -> Bundle)
-> Lens Bundle Bundle (Maybe Double) (Maybe Double)
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)

-- | A Boolean value indicating whether the bundle is active.
bundle_isActive :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Bool)
bundle_isActive :: (Maybe Bool -> f (Maybe Bool)) -> Bundle -> f Bundle
bundle_isActive = (Bundle -> Maybe Bool)
-> (Bundle -> Maybe Bool -> Bundle)
-> Lens Bundle Bundle (Maybe Bool) (Maybe Bool)
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)

-- | The amount of RAM in GB (e.g., @2.0@).
bundle_ramSizeInGb :: Lens.Lens' Bundle (Prelude.Maybe Prelude.Double)
bundle_ramSizeInGb :: (Maybe Double -> f (Maybe Double)) -> Bundle -> f Bundle
bundle_ramSizeInGb = (Bundle -> Maybe Double)
-> (Bundle -> Maybe Double -> Bundle)
-> Lens Bundle Bundle (Maybe Double) (Maybe Double)
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)

instance Core.FromJSON Bundle where
  parseJSON :: Value -> Parser Bundle
parseJSON =
    String -> (Object -> Parser Bundle) -> Value -> Parser Bundle
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Bundle"
      ( \Object
x ->
          Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe [InstancePlatform]
-> Maybe Double
-> Maybe Bool
-> Maybe Double
-> Bundle
Bundle'
            (Maybe Int
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe Int
 -> Maybe [InstancePlatform]
 -> Maybe Double
 -> Maybe Bool
 -> Maybe Double
 -> Bundle)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe [InstancePlatform]
      -> Maybe Double
      -> Maybe Bool
      -> Maybe Double
      -> Bundle)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cpuCount")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe [InstancePlatform]
   -> Maybe Double
   -> Maybe Bool
   -> Maybe Double
   -> Bundle)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe [InstancePlatform]
      -> Maybe Double
      -> Maybe Bool
      -> Maybe Double
      -> Bundle)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"transferPerMonthInGb")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe [InstancePlatform]
   -> Maybe Double
   -> Maybe Bool
   -> Maybe Double
   -> Bundle)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe [InstancePlatform]
      -> Maybe Double
      -> Maybe Bool
      -> Maybe Double
      -> Bundle)
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
"bundleId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe [InstancePlatform]
   -> Maybe Double
   -> Maybe Bool
   -> Maybe Double
   -> Bundle)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe [InstancePlatform]
      -> Maybe Double
      -> Maybe Bool
      -> Maybe Double
      -> Bundle)
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 Int
   -> Maybe Int
   -> Maybe [InstancePlatform]
   -> Maybe Double
   -> Maybe Bool
   -> Maybe Double
   -> Bundle)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe [InstancePlatform]
      -> Maybe Double
      -> Maybe Bool
      -> Maybe Double
      -> Bundle)
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
"name")
            Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe [InstancePlatform]
   -> Maybe Double
   -> Maybe Bool
   -> Maybe Double
   -> Bundle)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe [InstancePlatform]
      -> Maybe Double
      -> Maybe Bool
      -> Maybe Double
      -> Bundle)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"power")
            Parser
  (Maybe Int
   -> Maybe [InstancePlatform]
   -> Maybe Double
   -> Maybe Bool
   -> Maybe Double
   -> Bundle)
-> Parser (Maybe Int)
-> Parser
     (Maybe [InstancePlatform]
      -> Maybe Double -> Maybe Bool -> Maybe Double -> Bundle)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"diskSizeInGb")
            Parser
  (Maybe [InstancePlatform]
   -> Maybe Double -> Maybe Bool -> Maybe Double -> Bundle)
-> Parser (Maybe [InstancePlatform])
-> Parser (Maybe Double -> Maybe Bool -> Maybe Double -> Bundle)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [InstancePlatform]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"supportedPlatforms"
                            Parser (Maybe (Maybe [InstancePlatform]))
-> Maybe [InstancePlatform] -> Parser (Maybe [InstancePlatform])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [InstancePlatform]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe Double -> Maybe Bool -> Maybe Double -> Bundle)
-> Parser (Maybe Double)
-> Parser (Maybe Bool -> Maybe Double -> Bundle)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"price")
            Parser (Maybe Bool -> Maybe Double -> Bundle)
-> Parser (Maybe Bool) -> Parser (Maybe Double -> Bundle)
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
"isActive")
            Parser (Maybe Double -> Bundle)
-> Parser (Maybe Double) -> Parser Bundle
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ramSizeInGb")
      )

instance Prelude.Hashable Bundle

instance Prelude.NFData Bundle