{-# 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.BucketBundle where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BucketBundle = BucketBundle'
{
BucketBundle -> Maybe Int
storagePerMonthInGb :: Prelude.Maybe Prelude.Int,
BucketBundle -> Maybe Int
transferPerMonthInGb :: Prelude.Maybe Prelude.Int,
BucketBundle -> Maybe Text
bundleId :: Prelude.Maybe Prelude.Text,
BucketBundle -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
BucketBundle -> Maybe Double
price :: Prelude.Maybe Prelude.Double,
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)
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
}
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)
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)
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)
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)
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)
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