{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Lightsail.Types.BucketBundle where

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

-- | The ID of the bundle.
bucketBundle_bundleId :: Lens.Lens' BucketBundle (Prelude.Maybe Prelude.Text)
bucketBundle_bundleId :: Lens' BucketBundle (Maybe Text)
bucketBundle_bundleId = 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)

-- | Indicates whether the bundle is active. Use for a new or existing
-- bucket.
bucketBundle_isActive :: Lens.Lens' BucketBundle (Prelude.Maybe Prelude.Bool)
bucketBundle_isActive :: Lens' BucketBundle (Maybe Bool)
bucketBundle_isActive = 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)

-- | The name of the bundle.
bucketBundle_name :: Lens.Lens' BucketBundle (Prelude.Maybe Prelude.Text)
bucketBundle_name :: Lens' BucketBundle (Maybe Text)
bucketBundle_name = 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 :: Lens' BucketBundle (Maybe Double)
bucketBundle_price = 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)

-- | The storage size of the bundle, in GB.
bucketBundle_storagePerMonthInGb :: Lens.Lens' BucketBundle (Prelude.Maybe Prelude.Int)
bucketBundle_storagePerMonthInGb :: Lens' BucketBundle (Maybe Int)
bucketBundle_storagePerMonthInGb = 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 :: Lens' BucketBundle (Maybe Int)
bucketBundle_transferPerMonthInGb = 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)

instance Data.FromJSON BucketBundle where
  parseJSON :: Value -> Parser BucketBundle
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BucketBundle"
      ( \Object
x ->
          Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe Int
-> BucketBundle
BucketBundle'
            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
"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
"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
"storagePerMonthInGb")
            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 BucketBundle where
  hashWithSalt :: Int -> BucketBundle -> Int
hashWithSalt Int
_salt BucketBundle' {Maybe Bool
Maybe Double
Maybe Int
Maybe Text
transferPerMonthInGb :: Maybe Int
storagePerMonthInGb :: Maybe Int
price :: Maybe Double
name :: Maybe Text
isActive :: Maybe Bool
bundleId :: Maybe Text
$sel:transferPerMonthInGb:BucketBundle' :: BucketBundle -> Maybe Int
$sel:storagePerMonthInGb:BucketBundle' :: BucketBundle -> Maybe Int
$sel:price:BucketBundle' :: BucketBundle -> Maybe Double
$sel:name:BucketBundle' :: BucketBundle -> Maybe Text
$sel:isActive:BucketBundle' :: BucketBundle -> Maybe Bool
$sel:bundleId:BucketBundle' :: BucketBundle -> 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 Bool
isActive
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
price
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
storagePerMonthInGb
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
transferPerMonthInGb

instance Prelude.NFData BucketBundle where
  rnf :: BucketBundle -> ()
rnf BucketBundle' {Maybe Bool
Maybe Double
Maybe Int
Maybe Text
transferPerMonthInGb :: Maybe Int
storagePerMonthInGb :: Maybe Int
price :: Maybe Double
name :: Maybe Text
isActive :: Maybe Bool
bundleId :: Maybe Text
$sel:transferPerMonthInGb:BucketBundle' :: BucketBundle -> Maybe Int
$sel:storagePerMonthInGb:BucketBundle' :: BucketBundle -> Maybe Int
$sel:price:BucketBundle' :: BucketBundle -> Maybe Double
$sel:name:BucketBundle' :: BucketBundle -> Maybe Text
$sel:isActive:BucketBundle' :: BucketBundle -> Maybe Bool
$sel:bundleId:BucketBundle' :: BucketBundle -> 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 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 Double
price
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
storagePerMonthInGb
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
transferPerMonthInGb