{-# 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.BucketBundle
-- 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.BucketBundle where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes the specifications of a bundle that can be applied to an
-- Amazon Lightsail bucket.
--
-- A bucket bundle specifies the monthly cost, storage space, and data
-- transfer quota for a bucket.
--
-- /See:/ 'newBucketBundle' smart constructor.
data BucketBundle = BucketBundle'
  { -- | The storage size of the bundle, in GB.
    BucketBundle -> Maybe Int
storagePerMonthInGb :: Prelude.Maybe Prelude.Int,
    -- | The monthly network transfer quota of the bundle.
    BucketBundle -> Maybe Int
transferPerMonthInGb :: Prelude.Maybe Prelude.Int,
    -- | The ID of the bundle.
    BucketBundle -> Maybe Text
bundleId :: Prelude.Maybe Prelude.Text,
    -- | The name of the bundle.
    BucketBundle -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The monthly price of the bundle, in US dollars.
    BucketBundle -> Maybe Double
price :: Prelude.Maybe Prelude.Double,
    -- | Indicates whether the bundle is active. Use for a new or existing
    -- bucket.
    BucketBundle -> Maybe Bool
isActive :: Prelude.Maybe Prelude.Bool
  }
  deriving (BucketBundle -> BucketBundle -> Bool
(BucketBundle -> BucketBundle -> Bool)
-> (BucketBundle -> BucketBundle -> Bool) -> Eq BucketBundle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BucketBundle -> BucketBundle -> Bool
$c/= :: BucketBundle -> BucketBundle -> Bool
== :: BucketBundle -> BucketBundle -> Bool
$c== :: BucketBundle -> BucketBundle -> Bool
Prelude.Eq, ReadPrec [BucketBundle]
ReadPrec BucketBundle
Int -> ReadS BucketBundle
ReadS [BucketBundle]
(Int -> ReadS BucketBundle)
-> ReadS [BucketBundle]
-> ReadPrec BucketBundle
-> ReadPrec [BucketBundle]
-> Read BucketBundle
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BucketBundle]
$creadListPrec :: ReadPrec [BucketBundle]
readPrec :: ReadPrec BucketBundle
$creadPrec :: ReadPrec BucketBundle
readList :: ReadS [BucketBundle]
$creadList :: ReadS [BucketBundle]
readsPrec :: Int -> ReadS BucketBundle
$creadsPrec :: Int -> ReadS BucketBundle
Prelude.Read, Int -> BucketBundle -> ShowS
[BucketBundle] -> ShowS
BucketBundle -> String
(Int -> BucketBundle -> ShowS)
-> (BucketBundle -> String)
-> ([BucketBundle] -> ShowS)
-> Show BucketBundle
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BucketBundle] -> ShowS
$cshowList :: [BucketBundle] -> ShowS
show :: BucketBundle -> String
$cshow :: BucketBundle -> String
showsPrec :: Int -> BucketBundle -> ShowS
$cshowsPrec :: Int -> BucketBundle -> ShowS
Prelude.Show, (forall x. BucketBundle -> Rep BucketBundle x)
-> (forall x. Rep BucketBundle x -> BucketBundle)
-> Generic BucketBundle
forall x. Rep BucketBundle x -> BucketBundle
forall x. BucketBundle -> Rep BucketBundle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BucketBundle x -> BucketBundle
$cfrom :: forall x. BucketBundle -> Rep BucketBundle x
Prelude.Generic)

-- |
-- Create a value of 'BucketBundle' 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:
--
-- 'storagePerMonthInGb', 'bucketBundle_storagePerMonthInGb' - The storage size of the bundle, in GB.
--
-- 'transferPerMonthInGb', 'bucketBundle_transferPerMonthInGb' - The monthly network transfer quota of the bundle.
--
-- 'bundleId', 'bucketBundle_bundleId' - The ID of the bundle.
--
-- 'name', 'bucketBundle_name' - The name of the bundle.
--
-- 'price', 'bucketBundle_price' - The monthly price of the bundle, in US dollars.
--
-- 'isActive', 'bucketBundle_isActive' - Indicates whether the bundle is active. Use for a new or existing
-- bucket.
newBucketBundle ::
  BucketBundle
newBucketBundle :: BucketBundle
newBucketBundle =
  BucketBundle' :: Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Double
-> Maybe Bool
-> BucketBundle
BucketBundle'
    { $sel:storagePerMonthInGb:BucketBundle' :: Maybe Int
storagePerMonthInGb =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:transferPerMonthInGb:BucketBundle' :: Maybe Int
transferPerMonthInGb = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:bundleId:BucketBundle' :: Maybe Text
bundleId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:BucketBundle' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:price:BucketBundle' :: Maybe Double
price = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:isActive:BucketBundle' :: Maybe Bool
isActive = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | The storage size of the bundle, in GB.
bucketBundle_storagePerMonthInGb :: Lens.Lens' BucketBundle (Prelude.Maybe Prelude.Int)
bucketBundle_storagePerMonthInGb :: (Maybe Int -> f (Maybe Int)) -> BucketBundle -> f BucketBundle
bucketBundle_storagePerMonthInGb = (BucketBundle -> Maybe Int)
-> (BucketBundle -> Maybe Int -> BucketBundle)
-> Lens BucketBundle BucketBundle (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketBundle' {Maybe Int
storagePerMonthInGb :: Maybe Int
$sel:storagePerMonthInGb:BucketBundle' :: BucketBundle -> Maybe Int
storagePerMonthInGb} -> Maybe Int
storagePerMonthInGb) (\s :: BucketBundle
s@BucketBundle' {} Maybe Int
a -> BucketBundle
s {$sel:storagePerMonthInGb:BucketBundle' :: Maybe Int
storagePerMonthInGb = Maybe Int
a} :: BucketBundle)

-- | The monthly network transfer quota of the bundle.
bucketBundle_transferPerMonthInGb :: Lens.Lens' BucketBundle (Prelude.Maybe Prelude.Int)
bucketBundle_transferPerMonthInGb :: (Maybe Int -> f (Maybe Int)) -> BucketBundle -> f BucketBundle
bucketBundle_transferPerMonthInGb = (BucketBundle -> Maybe Int)
-> (BucketBundle -> Maybe Int -> BucketBundle)
-> Lens BucketBundle BucketBundle (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketBundle' {Maybe Int
transferPerMonthInGb :: Maybe Int
$sel:transferPerMonthInGb:BucketBundle' :: BucketBundle -> Maybe Int
transferPerMonthInGb} -> Maybe Int
transferPerMonthInGb) (\s :: BucketBundle
s@BucketBundle' {} Maybe Int
a -> BucketBundle
s {$sel:transferPerMonthInGb:BucketBundle' :: Maybe Int
transferPerMonthInGb = Maybe Int
a} :: BucketBundle)

-- | The ID of the bundle.
bucketBundle_bundleId :: Lens.Lens' BucketBundle (Prelude.Maybe Prelude.Text)
bucketBundle_bundleId :: (Maybe Text -> f (Maybe Text)) -> BucketBundle -> f BucketBundle
bucketBundle_bundleId = (BucketBundle -> Maybe Text)
-> (BucketBundle -> Maybe Text -> BucketBundle)
-> Lens BucketBundle BucketBundle (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketBundle' {Maybe Text
bundleId :: Maybe Text
$sel:bundleId:BucketBundle' :: BucketBundle -> Maybe Text
bundleId} -> Maybe Text
bundleId) (\s :: BucketBundle
s@BucketBundle' {} Maybe Text
a -> BucketBundle
s {$sel:bundleId:BucketBundle' :: Maybe Text
bundleId = Maybe Text
a} :: BucketBundle)

-- | The name of the bundle.
bucketBundle_name :: Lens.Lens' BucketBundle (Prelude.Maybe Prelude.Text)
bucketBundle_name :: (Maybe Text -> f (Maybe Text)) -> BucketBundle -> f BucketBundle
bucketBundle_name = (BucketBundle -> Maybe Text)
-> (BucketBundle -> Maybe Text -> BucketBundle)
-> Lens BucketBundle BucketBundle (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketBundle' {Maybe Text
name :: Maybe Text
$sel:name:BucketBundle' :: BucketBundle -> Maybe Text
name} -> Maybe Text
name) (\s :: BucketBundle
s@BucketBundle' {} Maybe Text
a -> BucketBundle
s {$sel:name:BucketBundle' :: Maybe Text
name = Maybe Text
a} :: BucketBundle)

-- | The monthly price of the bundle, in US dollars.
bucketBundle_price :: Lens.Lens' BucketBundle (Prelude.Maybe Prelude.Double)
bucketBundle_price :: (Maybe Double -> f (Maybe Double))
-> BucketBundle -> f BucketBundle
bucketBundle_price = (BucketBundle -> Maybe Double)
-> (BucketBundle -> Maybe Double -> BucketBundle)
-> Lens BucketBundle BucketBundle (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketBundle' {Maybe Double
price :: Maybe Double
$sel:price:BucketBundle' :: BucketBundle -> Maybe Double
price} -> Maybe Double
price) (\s :: BucketBundle
s@BucketBundle' {} Maybe Double
a -> BucketBundle
s {$sel:price:BucketBundle' :: Maybe Double
price = Maybe Double
a} :: BucketBundle)

-- | Indicates whether the bundle is active. Use for a new or existing
-- bucket.
bucketBundle_isActive :: Lens.Lens' BucketBundle (Prelude.Maybe Prelude.Bool)
bucketBundle_isActive :: (Maybe Bool -> f (Maybe Bool)) -> BucketBundle -> f BucketBundle
bucketBundle_isActive = (BucketBundle -> Maybe Bool)
-> (BucketBundle -> Maybe Bool -> BucketBundle)
-> Lens BucketBundle BucketBundle (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketBundle' {Maybe Bool
isActive :: Maybe Bool
$sel:isActive:BucketBundle' :: BucketBundle -> Maybe Bool
isActive} -> Maybe Bool
isActive) (\s :: BucketBundle
s@BucketBundle' {} Maybe Bool
a -> BucketBundle
s {$sel:isActive:BucketBundle' :: Maybe Bool
isActive = Maybe Bool
a} :: BucketBundle)

instance Core.FromJSON BucketBundle where
  parseJSON :: Value -> Parser BucketBundle
parseJSON =
    String
-> (Object -> Parser BucketBundle) -> Value -> Parser BucketBundle
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BucketBundle"
      ( \Object
x ->
          Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Double
-> Maybe Bool
-> BucketBundle
BucketBundle'
            (Maybe Int
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe Double
 -> Maybe Bool
 -> BucketBundle)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Double
      -> Maybe Bool
      -> BucketBundle)
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
"storagePerMonthInGb")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Double
   -> Maybe Bool
   -> BucketBundle)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Double -> Maybe Bool -> BucketBundle)
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 Double -> Maybe Bool -> BucketBundle)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Double -> Maybe Bool -> BucketBundle)
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 Double -> Maybe Bool -> BucketBundle)
-> Parser (Maybe Text)
-> Parser (Maybe Double -> Maybe Bool -> BucketBundle)
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 Double -> Maybe Bool -> BucketBundle)
-> Parser (Maybe Double) -> Parser (Maybe Bool -> BucketBundle)
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 -> BucketBundle)
-> Parser (Maybe Bool) -> Parser BucketBundle
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")
      )

instance Prelude.Hashable BucketBundle

instance Prelude.NFData BucketBundle