{-# 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.MonthlyTransfer where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MonthlyTransfer = MonthlyTransfer'
{
MonthlyTransfer -> Maybe Int
gbPerMonthAllocated :: Prelude.Maybe Prelude.Int
}
deriving (MonthlyTransfer -> MonthlyTransfer -> Bool
(MonthlyTransfer -> MonthlyTransfer -> Bool)
-> (MonthlyTransfer -> MonthlyTransfer -> Bool)
-> Eq MonthlyTransfer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MonthlyTransfer -> MonthlyTransfer -> Bool
$c/= :: MonthlyTransfer -> MonthlyTransfer -> Bool
== :: MonthlyTransfer -> MonthlyTransfer -> Bool
$c== :: MonthlyTransfer -> MonthlyTransfer -> Bool
Prelude.Eq, ReadPrec [MonthlyTransfer]
ReadPrec MonthlyTransfer
Int -> ReadS MonthlyTransfer
ReadS [MonthlyTransfer]
(Int -> ReadS MonthlyTransfer)
-> ReadS [MonthlyTransfer]
-> ReadPrec MonthlyTransfer
-> ReadPrec [MonthlyTransfer]
-> Read MonthlyTransfer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MonthlyTransfer]
$creadListPrec :: ReadPrec [MonthlyTransfer]
readPrec :: ReadPrec MonthlyTransfer
$creadPrec :: ReadPrec MonthlyTransfer
readList :: ReadS [MonthlyTransfer]
$creadList :: ReadS [MonthlyTransfer]
readsPrec :: Int -> ReadS MonthlyTransfer
$creadsPrec :: Int -> ReadS MonthlyTransfer
Prelude.Read, Int -> MonthlyTransfer -> ShowS
[MonthlyTransfer] -> ShowS
MonthlyTransfer -> String
(Int -> MonthlyTransfer -> ShowS)
-> (MonthlyTransfer -> String)
-> ([MonthlyTransfer] -> ShowS)
-> Show MonthlyTransfer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MonthlyTransfer] -> ShowS
$cshowList :: [MonthlyTransfer] -> ShowS
show :: MonthlyTransfer -> String
$cshow :: MonthlyTransfer -> String
showsPrec :: Int -> MonthlyTransfer -> ShowS
$cshowsPrec :: Int -> MonthlyTransfer -> ShowS
Prelude.Show, (forall x. MonthlyTransfer -> Rep MonthlyTransfer x)
-> (forall x. Rep MonthlyTransfer x -> MonthlyTransfer)
-> Generic MonthlyTransfer
forall x. Rep MonthlyTransfer x -> MonthlyTransfer
forall x. MonthlyTransfer -> Rep MonthlyTransfer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MonthlyTransfer x -> MonthlyTransfer
$cfrom :: forall x. MonthlyTransfer -> Rep MonthlyTransfer x
Prelude.Generic)
newMonthlyTransfer ::
MonthlyTransfer
newMonthlyTransfer :: MonthlyTransfer
newMonthlyTransfer =
MonthlyTransfer' :: Maybe Int -> MonthlyTransfer
MonthlyTransfer'
{ $sel:gbPerMonthAllocated:MonthlyTransfer' :: Maybe Int
gbPerMonthAllocated =
Maybe Int
forall a. Maybe a
Prelude.Nothing
}
monthlyTransfer_gbPerMonthAllocated :: Lens.Lens' MonthlyTransfer (Prelude.Maybe Prelude.Int)
monthlyTransfer_gbPerMonthAllocated :: (Maybe Int -> f (Maybe Int))
-> MonthlyTransfer -> f MonthlyTransfer
monthlyTransfer_gbPerMonthAllocated = (MonthlyTransfer -> Maybe Int)
-> (MonthlyTransfer -> Maybe Int -> MonthlyTransfer)
-> Lens MonthlyTransfer MonthlyTransfer (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonthlyTransfer' {Maybe Int
gbPerMonthAllocated :: Maybe Int
$sel:gbPerMonthAllocated:MonthlyTransfer' :: MonthlyTransfer -> Maybe Int
gbPerMonthAllocated} -> Maybe Int
gbPerMonthAllocated) (\s :: MonthlyTransfer
s@MonthlyTransfer' {} Maybe Int
a -> MonthlyTransfer
s {$sel:gbPerMonthAllocated:MonthlyTransfer' :: Maybe Int
gbPerMonthAllocated = Maybe Int
a} :: MonthlyTransfer)
instance Core.FromJSON MonthlyTransfer where
parseJSON :: Value -> Parser MonthlyTransfer
parseJSON =
String
-> (Object -> Parser MonthlyTransfer)
-> Value
-> Parser MonthlyTransfer
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MonthlyTransfer"
( \Object
x ->
Maybe Int -> MonthlyTransfer
MonthlyTransfer'
(Maybe Int -> MonthlyTransfer)
-> Parser (Maybe Int) -> Parser MonthlyTransfer
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
"gbPerMonthAllocated")
)
instance Prelude.Hashable MonthlyTransfer
instance Prelude.NFData MonthlyTransfer