{-# 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.DynamoDB.Types.BillingModeSummary where
import qualified Amazonka.Core as Core
import Amazonka.DynamoDB.Types.BillingMode
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BillingModeSummary = BillingModeSummary'
{
BillingModeSummary -> Maybe POSIX
lastUpdateToPayPerRequestDateTime :: Prelude.Maybe Core.POSIX,
BillingModeSummary -> Maybe BillingMode
billingMode :: Prelude.Maybe BillingMode
}
deriving (BillingModeSummary -> BillingModeSummary -> Bool
(BillingModeSummary -> BillingModeSummary -> Bool)
-> (BillingModeSummary -> BillingModeSummary -> Bool)
-> Eq BillingModeSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BillingModeSummary -> BillingModeSummary -> Bool
$c/= :: BillingModeSummary -> BillingModeSummary -> Bool
== :: BillingModeSummary -> BillingModeSummary -> Bool
$c== :: BillingModeSummary -> BillingModeSummary -> Bool
Prelude.Eq, ReadPrec [BillingModeSummary]
ReadPrec BillingModeSummary
Int -> ReadS BillingModeSummary
ReadS [BillingModeSummary]
(Int -> ReadS BillingModeSummary)
-> ReadS [BillingModeSummary]
-> ReadPrec BillingModeSummary
-> ReadPrec [BillingModeSummary]
-> Read BillingModeSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BillingModeSummary]
$creadListPrec :: ReadPrec [BillingModeSummary]
readPrec :: ReadPrec BillingModeSummary
$creadPrec :: ReadPrec BillingModeSummary
readList :: ReadS [BillingModeSummary]
$creadList :: ReadS [BillingModeSummary]
readsPrec :: Int -> ReadS BillingModeSummary
$creadsPrec :: Int -> ReadS BillingModeSummary
Prelude.Read, Int -> BillingModeSummary -> ShowS
[BillingModeSummary] -> ShowS
BillingModeSummary -> String
(Int -> BillingModeSummary -> ShowS)
-> (BillingModeSummary -> String)
-> ([BillingModeSummary] -> ShowS)
-> Show BillingModeSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BillingModeSummary] -> ShowS
$cshowList :: [BillingModeSummary] -> ShowS
show :: BillingModeSummary -> String
$cshow :: BillingModeSummary -> String
showsPrec :: Int -> BillingModeSummary -> ShowS
$cshowsPrec :: Int -> BillingModeSummary -> ShowS
Prelude.Show, (forall x. BillingModeSummary -> Rep BillingModeSummary x)
-> (forall x. Rep BillingModeSummary x -> BillingModeSummary)
-> Generic BillingModeSummary
forall x. Rep BillingModeSummary x -> BillingModeSummary
forall x. BillingModeSummary -> Rep BillingModeSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BillingModeSummary x -> BillingModeSummary
$cfrom :: forall x. BillingModeSummary -> Rep BillingModeSummary x
Prelude.Generic)
newBillingModeSummary ::
BillingModeSummary
newBillingModeSummary :: BillingModeSummary
newBillingModeSummary =
BillingModeSummary' :: Maybe POSIX -> Maybe BillingMode -> BillingModeSummary
BillingModeSummary'
{ $sel:lastUpdateToPayPerRequestDateTime:BillingModeSummary' :: Maybe POSIX
lastUpdateToPayPerRequestDateTime =
Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:billingMode:BillingModeSummary' :: Maybe BillingMode
billingMode = Maybe BillingMode
forall a. Maybe a
Prelude.Nothing
}
billingModeSummary_lastUpdateToPayPerRequestDateTime :: Lens.Lens' BillingModeSummary (Prelude.Maybe Prelude.UTCTime)
billingModeSummary_lastUpdateToPayPerRequestDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> BillingModeSummary -> f BillingModeSummary
billingModeSummary_lastUpdateToPayPerRequestDateTime = (BillingModeSummary -> Maybe POSIX)
-> (BillingModeSummary -> Maybe POSIX -> BillingModeSummary)
-> Lens
BillingModeSummary BillingModeSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BillingModeSummary' {Maybe POSIX
lastUpdateToPayPerRequestDateTime :: Maybe POSIX
$sel:lastUpdateToPayPerRequestDateTime:BillingModeSummary' :: BillingModeSummary -> Maybe POSIX
lastUpdateToPayPerRequestDateTime} -> Maybe POSIX
lastUpdateToPayPerRequestDateTime) (\s :: BillingModeSummary
s@BillingModeSummary' {} Maybe POSIX
a -> BillingModeSummary
s {$sel:lastUpdateToPayPerRequestDateTime:BillingModeSummary' :: Maybe POSIX
lastUpdateToPayPerRequestDateTime = Maybe POSIX
a} :: BillingModeSummary) ((Maybe POSIX -> f (Maybe POSIX))
-> BillingModeSummary -> f BillingModeSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> BillingModeSummary
-> f BillingModeSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
billingModeSummary_billingMode :: Lens.Lens' BillingModeSummary (Prelude.Maybe BillingMode)
billingModeSummary_billingMode :: (Maybe BillingMode -> f (Maybe BillingMode))
-> BillingModeSummary -> f BillingModeSummary
billingModeSummary_billingMode = (BillingModeSummary -> Maybe BillingMode)
-> (BillingModeSummary -> Maybe BillingMode -> BillingModeSummary)
-> Lens
BillingModeSummary
BillingModeSummary
(Maybe BillingMode)
(Maybe BillingMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BillingModeSummary' {Maybe BillingMode
billingMode :: Maybe BillingMode
$sel:billingMode:BillingModeSummary' :: BillingModeSummary -> Maybe BillingMode
billingMode} -> Maybe BillingMode
billingMode) (\s :: BillingModeSummary
s@BillingModeSummary' {} Maybe BillingMode
a -> BillingModeSummary
s {$sel:billingMode:BillingModeSummary' :: Maybe BillingMode
billingMode = Maybe BillingMode
a} :: BillingModeSummary)
instance Core.FromJSON BillingModeSummary where
parseJSON :: Value -> Parser BillingModeSummary
parseJSON =
String
-> (Object -> Parser BillingModeSummary)
-> Value
-> Parser BillingModeSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BillingModeSummary"
( \Object
x ->
Maybe POSIX -> Maybe BillingMode -> BillingModeSummary
BillingModeSummary'
(Maybe POSIX -> Maybe BillingMode -> BillingModeSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe BillingMode -> BillingModeSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastUpdateToPayPerRequestDateTime")
Parser (Maybe BillingMode -> BillingModeSummary)
-> Parser (Maybe BillingMode) -> Parser BillingModeSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BillingMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BillingMode")
)
instance Prelude.Hashable BillingModeSummary
instance Prelude.NFData BillingModeSummary