{-# 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.Route53Domains.Types.BillingRecord 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
import Amazonka.Route53Domains.Types.OperationType
data BillingRecord = BillingRecord'
{
BillingRecord -> Maybe POSIX
billDate :: Prelude.Maybe Data.POSIX,
BillingRecord -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text,
BillingRecord -> Maybe Text
invoiceId :: Prelude.Maybe Prelude.Text,
BillingRecord -> Maybe OperationType
operation :: Prelude.Maybe OperationType,
BillingRecord -> Maybe Double
price :: Prelude.Maybe Prelude.Double
}
deriving (BillingRecord -> BillingRecord -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BillingRecord -> BillingRecord -> Bool
$c/= :: BillingRecord -> BillingRecord -> Bool
== :: BillingRecord -> BillingRecord -> Bool
$c== :: BillingRecord -> BillingRecord -> Bool
Prelude.Eq, ReadPrec [BillingRecord]
ReadPrec BillingRecord
Int -> ReadS BillingRecord
ReadS [BillingRecord]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BillingRecord]
$creadListPrec :: ReadPrec [BillingRecord]
readPrec :: ReadPrec BillingRecord
$creadPrec :: ReadPrec BillingRecord
readList :: ReadS [BillingRecord]
$creadList :: ReadS [BillingRecord]
readsPrec :: Int -> ReadS BillingRecord
$creadsPrec :: Int -> ReadS BillingRecord
Prelude.Read, Int -> BillingRecord -> ShowS
[BillingRecord] -> ShowS
BillingRecord -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BillingRecord] -> ShowS
$cshowList :: [BillingRecord] -> ShowS
show :: BillingRecord -> String
$cshow :: BillingRecord -> String
showsPrec :: Int -> BillingRecord -> ShowS
$cshowsPrec :: Int -> BillingRecord -> ShowS
Prelude.Show, forall x. Rep BillingRecord x -> BillingRecord
forall x. BillingRecord -> Rep BillingRecord x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BillingRecord x -> BillingRecord
$cfrom :: forall x. BillingRecord -> Rep BillingRecord x
Prelude.Generic)
newBillingRecord ::
BillingRecord
newBillingRecord :: BillingRecord
newBillingRecord =
BillingRecord'
{ $sel:billDate:BillingRecord' :: Maybe POSIX
billDate = forall a. Maybe a
Prelude.Nothing,
$sel:domainName:BillingRecord' :: Maybe Text
domainName = forall a. Maybe a
Prelude.Nothing,
$sel:invoiceId:BillingRecord' :: Maybe Text
invoiceId = forall a. Maybe a
Prelude.Nothing,
$sel:operation:BillingRecord' :: Maybe OperationType
operation = forall a. Maybe a
Prelude.Nothing,
$sel:price:BillingRecord' :: Maybe Double
price = forall a. Maybe a
Prelude.Nothing
}
billingRecord_billDate :: Lens.Lens' BillingRecord (Prelude.Maybe Prelude.UTCTime)
billingRecord_billDate :: Lens' BillingRecord (Maybe UTCTime)
billingRecord_billDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BillingRecord' {Maybe POSIX
billDate :: Maybe POSIX
$sel:billDate:BillingRecord' :: BillingRecord -> Maybe POSIX
billDate} -> Maybe POSIX
billDate) (\s :: BillingRecord
s@BillingRecord' {} Maybe POSIX
a -> BillingRecord
s {$sel:billDate:BillingRecord' :: Maybe POSIX
billDate = Maybe POSIX
a} :: BillingRecord) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
billingRecord_domainName :: Lens.Lens' BillingRecord (Prelude.Maybe Prelude.Text)
billingRecord_domainName :: Lens' BillingRecord (Maybe Text)
billingRecord_domainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BillingRecord' {Maybe Text
domainName :: Maybe Text
$sel:domainName:BillingRecord' :: BillingRecord -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: BillingRecord
s@BillingRecord' {} Maybe Text
a -> BillingRecord
s {$sel:domainName:BillingRecord' :: Maybe Text
domainName = Maybe Text
a} :: BillingRecord)
billingRecord_invoiceId :: Lens.Lens' BillingRecord (Prelude.Maybe Prelude.Text)
billingRecord_invoiceId :: Lens' BillingRecord (Maybe Text)
billingRecord_invoiceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BillingRecord' {Maybe Text
invoiceId :: Maybe Text
$sel:invoiceId:BillingRecord' :: BillingRecord -> Maybe Text
invoiceId} -> Maybe Text
invoiceId) (\s :: BillingRecord
s@BillingRecord' {} Maybe Text
a -> BillingRecord
s {$sel:invoiceId:BillingRecord' :: Maybe Text
invoiceId = Maybe Text
a} :: BillingRecord)
billingRecord_operation :: Lens.Lens' BillingRecord (Prelude.Maybe OperationType)
billingRecord_operation :: Lens' BillingRecord (Maybe OperationType)
billingRecord_operation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BillingRecord' {Maybe OperationType
operation :: Maybe OperationType
$sel:operation:BillingRecord' :: BillingRecord -> Maybe OperationType
operation} -> Maybe OperationType
operation) (\s :: BillingRecord
s@BillingRecord' {} Maybe OperationType
a -> BillingRecord
s {$sel:operation:BillingRecord' :: Maybe OperationType
operation = Maybe OperationType
a} :: BillingRecord)
billingRecord_price :: Lens.Lens' BillingRecord (Prelude.Maybe Prelude.Double)
billingRecord_price :: Lens' BillingRecord (Maybe Double)
billingRecord_price = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BillingRecord' {Maybe Double
price :: Maybe Double
$sel:price:BillingRecord' :: BillingRecord -> Maybe Double
price} -> Maybe Double
price) (\s :: BillingRecord
s@BillingRecord' {} Maybe Double
a -> BillingRecord
s {$sel:price:BillingRecord' :: Maybe Double
price = Maybe Double
a} :: BillingRecord)
instance Data.FromJSON BillingRecord where
parseJSON :: Value -> Parser BillingRecord
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"BillingRecord"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe OperationType
-> Maybe Double
-> BillingRecord
BillingRecord'
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
"BillDate")
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
"DomainName")
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
"InvoiceId")
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
"Operation")
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")
)
instance Prelude.Hashable BillingRecord where
hashWithSalt :: Int -> BillingRecord -> Int
hashWithSalt Int
_salt BillingRecord' {Maybe Double
Maybe Text
Maybe POSIX
Maybe OperationType
price :: Maybe Double
operation :: Maybe OperationType
invoiceId :: Maybe Text
domainName :: Maybe Text
billDate :: Maybe POSIX
$sel:price:BillingRecord' :: BillingRecord -> Maybe Double
$sel:operation:BillingRecord' :: BillingRecord -> Maybe OperationType
$sel:invoiceId:BillingRecord' :: BillingRecord -> Maybe Text
$sel:domainName:BillingRecord' :: BillingRecord -> Maybe Text
$sel:billDate:BillingRecord' :: BillingRecord -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
billDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
domainName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
invoiceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OperationType
operation
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
price
instance Prelude.NFData BillingRecord where
rnf :: BillingRecord -> ()
rnf BillingRecord' {Maybe Double
Maybe Text
Maybe POSIX
Maybe OperationType
price :: Maybe Double
operation :: Maybe OperationType
invoiceId :: Maybe Text
domainName :: Maybe Text
billDate :: Maybe POSIX
$sel:price:BillingRecord' :: BillingRecord -> Maybe Double
$sel:operation:BillingRecord' :: BillingRecord -> Maybe OperationType
$sel:invoiceId:BillingRecord' :: BillingRecord -> Maybe Text
$sel:domainName:BillingRecord' :: BillingRecord -> Maybe Text
$sel:billDate:BillingRecord' :: BillingRecord -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
billDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
domainName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
invoiceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OperationType
operation
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
price