{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module RecurlyClient.Types.SubscriptionUpdate where
import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.Internal
import qualified Data.Aeson as Data.Aeson.Types
import qualified Data.Aeson as Data.Aeson.Types.FromJSON
import qualified Data.Aeson as Data.Aeson.Types.Internal
import qualified Data.Aeson as Data.Aeson.Types.ToJSON
import qualified Data.ByteString
import qualified Data.ByteString as Data.ByteString.Internal
import qualified Data.Foldable
import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified RecurlyClient.Common
import RecurlyClient.TypeAlias
import {-# SOURCE #-} RecurlyClient.Types.SubscriptionShippingUpdate
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe
data SubscriptionUpdate = SubscriptionUpdate
{ SubscriptionUpdate -> Maybe Bool
subscriptionUpdateAuto_renew :: (GHC.Maybe.Maybe GHC.Types.Bool)
, SubscriptionUpdate -> Maybe Text
subscriptionUpdateBilling_info_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, SubscriptionUpdate -> Maybe SubscriptionUpdateCollection_method
subscriptionUpdateCollection_method :: (GHC.Maybe.Maybe SubscriptionUpdateCollection_method)
, SubscriptionUpdate -> Maybe CustomFields
subscriptionUpdateCustom_fields :: (GHC.Maybe.Maybe CustomFields)
, SubscriptionUpdate -> Maybe Text
subscriptionUpdateCustomer_notes :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, SubscriptionUpdate -> Maybe Text
subscriptionUpdateGateway_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, SubscriptionUpdate -> Maybe Int
subscriptionUpdateNet_terms :: (GHC.Maybe.Maybe GHC.Types.Int)
, SubscriptionUpdate -> Maybe SubscriptionUpdateNet_terms_type
subscriptionUpdateNet_terms_type :: (GHC.Maybe.Maybe SubscriptionUpdateNet_terms_type)
, SubscriptionUpdate -> Maybe JsonDateTime
subscriptionUpdateNext_bill_date :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
, SubscriptionUpdate -> Maybe Text
subscriptionUpdatePo_number :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, SubscriptionUpdate -> Maybe Int
subscriptionUpdateRemaining_billing_cycles :: (GHC.Maybe.Maybe GHC.Types.Int)
, SubscriptionUpdate -> Maybe Int
subscriptionUpdateRenewal_billing_cycles :: (GHC.Maybe.Maybe GHC.Types.Int)
, SubscriptionUpdate -> Maybe SubscriptionUpdateRevenue_schedule_type
subscriptionUpdateRevenue_schedule_type :: (GHC.Maybe.Maybe SubscriptionUpdateRevenue_schedule_type)
, SubscriptionUpdate -> Maybe SubscriptionShippingUpdate
subscriptionUpdateShipping :: (GHC.Maybe.Maybe SubscriptionShippingUpdate)
, SubscriptionUpdate -> Maybe Bool
subscriptionUpdateTax_inclusive :: (GHC.Maybe.Maybe GHC.Types.Bool)
, SubscriptionUpdate -> Maybe Text
subscriptionUpdateTerms_and_conditions :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
}
deriving
( Int -> SubscriptionUpdate -> ShowS
[SubscriptionUpdate] -> ShowS
SubscriptionUpdate -> String
(Int -> SubscriptionUpdate -> ShowS)
-> (SubscriptionUpdate -> String)
-> ([SubscriptionUpdate] -> ShowS)
-> Show SubscriptionUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SubscriptionUpdate -> ShowS
showsPrec :: Int -> SubscriptionUpdate -> ShowS
$cshow :: SubscriptionUpdate -> String
show :: SubscriptionUpdate -> String
$cshowList :: [SubscriptionUpdate] -> ShowS
showList :: [SubscriptionUpdate] -> ShowS
GHC.Show.Show
, SubscriptionUpdate -> SubscriptionUpdate -> Bool
(SubscriptionUpdate -> SubscriptionUpdate -> Bool)
-> (SubscriptionUpdate -> SubscriptionUpdate -> Bool)
-> Eq SubscriptionUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubscriptionUpdate -> SubscriptionUpdate -> Bool
== :: SubscriptionUpdate -> SubscriptionUpdate -> Bool
$c/= :: SubscriptionUpdate -> SubscriptionUpdate -> Bool
/= :: SubscriptionUpdate -> SubscriptionUpdate -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionUpdate where
toJSON :: SubscriptionUpdate -> Value
toJSON SubscriptionUpdate
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Pair] -> (Bool -> [Pair]) -> Maybe Bool -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Bool -> Pair) -> Bool -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"auto_renew" Key -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Bool
subscriptionUpdateAuto_renew SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"billing_info_id" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdateBilling_info_id SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionUpdateCollection_method -> [Pair])
-> Maybe SubscriptionUpdateCollection_method
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (SubscriptionUpdateCollection_method -> Pair)
-> SubscriptionUpdateCollection_method
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"collection_method" Key -> SubscriptionUpdateCollection_method -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe SubscriptionUpdateCollection_method
subscriptionUpdateCollection_method SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (CustomFields -> [Pair]) -> Maybe CustomFields -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (CustomFields -> Pair) -> CustomFields -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"custom_fields" Key -> CustomFields -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe CustomFields
subscriptionUpdateCustom_fields SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"customer_notes" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdateCustomer_notes SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"gateway_code" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdateGateway_code SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Int -> [Pair]) -> Maybe Int -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Int -> Pair) -> Int -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"net_terms" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Int
subscriptionUpdateNet_terms SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionUpdateNet_terms_type -> [Pair])
-> Maybe SubscriptionUpdateNet_terms_type
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (SubscriptionUpdateNet_terms_type -> Pair)
-> SubscriptionUpdateNet_terms_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"net_terms_type" Key -> SubscriptionUpdateNet_terms_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe SubscriptionUpdateNet_terms_type
subscriptionUpdateNet_terms_type SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (JsonDateTime -> [Pair]) -> Maybe JsonDateTime -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (JsonDateTime -> Pair) -> JsonDateTime -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"next_bill_date" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe JsonDateTime
subscriptionUpdateNext_bill_date SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"po_number" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdatePo_number SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Int -> [Pair]) -> Maybe Int -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Int -> Pair) -> Int -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"remaining_billing_cycles" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Int
subscriptionUpdateRemaining_billing_cycles SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Int -> [Pair]) -> Maybe Int -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Int -> Pair) -> Int -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"renewal_billing_cycles" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Int
subscriptionUpdateRenewal_billing_cycles SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionUpdateRevenue_schedule_type -> [Pair])
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (SubscriptionUpdateRevenue_schedule_type -> Pair)
-> SubscriptionUpdateRevenue_schedule_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_schedule_type" Key -> SubscriptionUpdateRevenue_schedule_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe SubscriptionUpdateRevenue_schedule_type
subscriptionUpdateRevenue_schedule_type SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionShippingUpdate -> [Pair])
-> Maybe SubscriptionShippingUpdate
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (SubscriptionShippingUpdate -> Pair)
-> SubscriptionShippingUpdate
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"shipping" Key -> SubscriptionShippingUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe SubscriptionShippingUpdate
subscriptionUpdateShipping SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Bool -> [Pair]) -> Maybe Bool -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Bool -> Pair) -> Bool -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax_inclusive" Key -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Bool
subscriptionUpdateTax_inclusive SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"terms_and_conditions" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdateTerms_and_conditions SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
toEncoding :: SubscriptionUpdate -> Encoding
toEncoding SubscriptionUpdate
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ([Series] -> Series
forall a. Monoid a => [a] -> a
GHC.Base.mconcat ([[Series]] -> [Series]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Series] -> (Bool -> [Series]) -> Maybe Bool -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Bool -> Series) -> Bool -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"auto_renew" Key -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Bool
subscriptionUpdateAuto_renew SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"billing_info_id" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdateBilling_info_id SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionUpdateCollection_method -> [Series])
-> Maybe SubscriptionUpdateCollection_method
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (SubscriptionUpdateCollection_method -> Series)
-> SubscriptionUpdateCollection_method
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"collection_method" Key -> SubscriptionUpdateCollection_method -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe SubscriptionUpdateCollection_method
subscriptionUpdateCollection_method SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (CustomFields -> [Series]) -> Maybe CustomFields -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (CustomFields -> Series) -> CustomFields -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"custom_fields" Key -> CustomFields -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe CustomFields
subscriptionUpdateCustom_fields SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"customer_notes" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdateCustomer_notes SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"gateway_code" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdateGateway_code SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Int -> [Series]) -> Maybe Int -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Int -> Series) -> Int -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"net_terms" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Int
subscriptionUpdateNet_terms SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionUpdateNet_terms_type -> [Series])
-> Maybe SubscriptionUpdateNet_terms_type
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (SubscriptionUpdateNet_terms_type -> Series)
-> SubscriptionUpdateNet_terms_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"net_terms_type" Key -> SubscriptionUpdateNet_terms_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe SubscriptionUpdateNet_terms_type
subscriptionUpdateNet_terms_type SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (JsonDateTime -> [Series]) -> Maybe JsonDateTime -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (JsonDateTime -> Series) -> JsonDateTime -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"next_bill_date" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe JsonDateTime
subscriptionUpdateNext_bill_date SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"po_number" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdatePo_number SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Int -> [Series]) -> Maybe Int -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Int -> Series) -> Int -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"remaining_billing_cycles" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Int
subscriptionUpdateRemaining_billing_cycles SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Int -> [Series]) -> Maybe Int -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Int -> Series) -> Int -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"renewal_billing_cycles" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Int
subscriptionUpdateRenewal_billing_cycles SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionUpdateRevenue_schedule_type -> [Series])
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (SubscriptionUpdateRevenue_schedule_type -> Series)
-> SubscriptionUpdateRevenue_schedule_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_schedule_type" Key -> SubscriptionUpdateRevenue_schedule_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe SubscriptionUpdateRevenue_schedule_type
subscriptionUpdateRevenue_schedule_type SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionShippingUpdate -> [Series])
-> Maybe SubscriptionShippingUpdate
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (SubscriptionShippingUpdate -> Series)
-> SubscriptionShippingUpdate
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"shipping" Key -> SubscriptionShippingUpdate -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe SubscriptionShippingUpdate
subscriptionUpdateShipping SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Bool -> [Series]) -> Maybe Bool -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Bool -> Series) -> Bool -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax_inclusive" Key -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Bool
subscriptionUpdateTax_inclusive SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"terms_and_conditions" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdateTerms_and_conditions SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [[Series]]
forall a. Monoid a => a
GHC.Base.mempty)))
instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionUpdate where
parseJSON :: Value -> Parser SubscriptionUpdate
parseJSON = String
-> (Object -> Parser SubscriptionUpdate)
-> Value
-> Parser SubscriptionUpdate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"SubscriptionUpdate" (\Object
obj -> ((((((((((((((((Maybe Bool
-> Maybe Text
-> Maybe SubscriptionUpdateCollection_method
-> Maybe CustomFields
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
-> Parser
(Maybe Bool
-> Maybe Text
-> Maybe SubscriptionUpdateCollection_method
-> Maybe CustomFields
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Bool
-> Maybe Text
-> Maybe SubscriptionUpdateCollection_method
-> Maybe CustomFields
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate
SubscriptionUpdate Parser
(Maybe Bool
-> Maybe Text
-> Maybe SubscriptionUpdateCollection_method
-> Maybe CustomFields
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Maybe SubscriptionUpdateCollection_method
-> Maybe CustomFields
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"auto_renew")) Parser
(Maybe Text
-> Maybe SubscriptionUpdateCollection_method
-> Maybe CustomFields
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
-> Parser (Maybe Text)
-> Parser
(Maybe SubscriptionUpdateCollection_method
-> Maybe CustomFields
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"billing_info_id")) Parser
(Maybe SubscriptionUpdateCollection_method
-> Maybe CustomFields
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
-> Parser (Maybe SubscriptionUpdateCollection_method)
-> Parser
(Maybe CustomFields
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe SubscriptionUpdateCollection_method)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"collection_method")) Parser
(Maybe CustomFields
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
-> Parser (Maybe CustomFields)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe CustomFields)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"custom_fields")) Parser
(Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Int
-> Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"customer_notes")) Parser
(Maybe Text
-> Maybe Int
-> Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
-> Parser (Maybe Text)
-> Parser
(Maybe Int
-> Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"gateway_code")) Parser
(Maybe Int
-> Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
-> Parser (Maybe Int)
-> Parser
(Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"net_terms")) Parser
(Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
-> Parser (Maybe SubscriptionUpdateNet_terms_type)
-> Parser
(Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe SubscriptionUpdateNet_terms_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"net_terms_type")) Parser
(Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
-> Parser (Maybe JsonDateTime)
-> Parser
(Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe JsonDateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"next_bill_date")) Parser
(Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
-> Parser (Maybe Text)
-> Parser
(Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"po_number")) Parser
(Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"remaining_billing_cycles")) Parser
(Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
-> Parser (Maybe Int)
-> Parser
(Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"renewal_billing_cycles")) Parser
(Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate)
-> Parser (Maybe SubscriptionUpdateRevenue_schedule_type)
-> Parser
(Maybe SubscriptionShippingUpdate
-> Maybe Bool -> Maybe Text -> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Key -> Parser (Maybe SubscriptionUpdateRevenue_schedule_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"revenue_schedule_type")) Parser
(Maybe SubscriptionShippingUpdate
-> Maybe Bool -> Maybe Text -> SubscriptionUpdate)
-> Parser (Maybe SubscriptionShippingUpdate)
-> Parser (Maybe Bool -> Maybe Text -> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe SubscriptionShippingUpdate)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"shipping")) Parser (Maybe Bool -> Maybe Text -> SubscriptionUpdate)
-> Parser (Maybe Bool) -> Parser (Maybe Text -> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"tax_inclusive")) Parser (Maybe Text -> SubscriptionUpdate)
-> Parser (Maybe Text) -> Parser SubscriptionUpdate
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"terms_and_conditions"))
mkSubscriptionUpdate :: SubscriptionUpdate
mkSubscriptionUpdate :: SubscriptionUpdate
mkSubscriptionUpdate =
SubscriptionUpdate
{ subscriptionUpdateAuto_renew :: Maybe Bool
subscriptionUpdateAuto_renew = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
, subscriptionUpdateBilling_info_id :: Maybe Text
subscriptionUpdateBilling_info_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, subscriptionUpdateCollection_method :: Maybe SubscriptionUpdateCollection_method
subscriptionUpdateCollection_method = Maybe SubscriptionUpdateCollection_method
forall a. Maybe a
GHC.Maybe.Nothing
, subscriptionUpdateCustom_fields :: Maybe CustomFields
subscriptionUpdateCustom_fields = Maybe CustomFields
forall a. Maybe a
GHC.Maybe.Nothing
, subscriptionUpdateCustomer_notes :: Maybe Text
subscriptionUpdateCustomer_notes = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, subscriptionUpdateGateway_code :: Maybe Text
subscriptionUpdateGateway_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, subscriptionUpdateNet_terms :: Maybe Int
subscriptionUpdateNet_terms = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
, subscriptionUpdateNet_terms_type :: Maybe SubscriptionUpdateNet_terms_type
subscriptionUpdateNet_terms_type = Maybe SubscriptionUpdateNet_terms_type
forall a. Maybe a
GHC.Maybe.Nothing
, subscriptionUpdateNext_bill_date :: Maybe JsonDateTime
subscriptionUpdateNext_bill_date = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
, subscriptionUpdatePo_number :: Maybe Text
subscriptionUpdatePo_number = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, subscriptionUpdateRemaining_billing_cycles :: Maybe Int
subscriptionUpdateRemaining_billing_cycles = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
, subscriptionUpdateRenewal_billing_cycles :: Maybe Int
subscriptionUpdateRenewal_billing_cycles = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
, subscriptionUpdateRevenue_schedule_type :: Maybe SubscriptionUpdateRevenue_schedule_type
subscriptionUpdateRevenue_schedule_type = Maybe SubscriptionUpdateRevenue_schedule_type
forall a. Maybe a
GHC.Maybe.Nothing
, subscriptionUpdateShipping :: Maybe SubscriptionShippingUpdate
subscriptionUpdateShipping = Maybe SubscriptionShippingUpdate
forall a. Maybe a
GHC.Maybe.Nothing
, subscriptionUpdateTax_inclusive :: Maybe Bool
subscriptionUpdateTax_inclusive = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
, subscriptionUpdateTerms_and_conditions :: Maybe Text
subscriptionUpdateTerms_and_conditions = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
}
data SubscriptionUpdateCollection_method
=
SubscriptionUpdateCollection_methodOther Data.Aeson.Types.Internal.Value
|
SubscriptionUpdateCollection_methodTyped Data.Text.Internal.Text
|
SubscriptionUpdateCollection_methodEnumAutomatic
|
SubscriptionUpdateCollection_methodEnumManual
deriving (Int -> SubscriptionUpdateCollection_method -> ShowS
[SubscriptionUpdateCollection_method] -> ShowS
SubscriptionUpdateCollection_method -> String
(Int -> SubscriptionUpdateCollection_method -> ShowS)
-> (SubscriptionUpdateCollection_method -> String)
-> ([SubscriptionUpdateCollection_method] -> ShowS)
-> Show SubscriptionUpdateCollection_method
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SubscriptionUpdateCollection_method -> ShowS
showsPrec :: Int -> SubscriptionUpdateCollection_method -> ShowS
$cshow :: SubscriptionUpdateCollection_method -> String
show :: SubscriptionUpdateCollection_method -> String
$cshowList :: [SubscriptionUpdateCollection_method] -> ShowS
showList :: [SubscriptionUpdateCollection_method] -> ShowS
GHC.Show.Show, SubscriptionUpdateCollection_method
-> SubscriptionUpdateCollection_method -> Bool
(SubscriptionUpdateCollection_method
-> SubscriptionUpdateCollection_method -> Bool)
-> (SubscriptionUpdateCollection_method
-> SubscriptionUpdateCollection_method -> Bool)
-> Eq SubscriptionUpdateCollection_method
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubscriptionUpdateCollection_method
-> SubscriptionUpdateCollection_method -> Bool
== :: SubscriptionUpdateCollection_method
-> SubscriptionUpdateCollection_method -> Bool
$c/= :: SubscriptionUpdateCollection_method
-> SubscriptionUpdateCollection_method -> Bool
/= :: SubscriptionUpdateCollection_method
-> SubscriptionUpdateCollection_method -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionUpdateCollection_method where
toJSON :: SubscriptionUpdateCollection_method -> Value
toJSON (SubscriptionUpdateCollection_methodOther Value
val) = Value
val
toJSON (SubscriptionUpdateCollection_methodTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (SubscriptionUpdateCollection_method
SubscriptionUpdateCollection_methodEnumAutomatic) = Value
"automatic"
toJSON (SubscriptionUpdateCollection_method
SubscriptionUpdateCollection_methodEnumManual) = Value
"manual"
instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionUpdateCollection_method where
parseJSON :: Value -> Parser SubscriptionUpdateCollection_method
parseJSON Value
val =
SubscriptionUpdateCollection_method
-> Parser SubscriptionUpdateCollection_method
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
( if
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"automatic" -> SubscriptionUpdateCollection_method
SubscriptionUpdateCollection_methodEnumAutomatic
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"manual" -> SubscriptionUpdateCollection_method
SubscriptionUpdateCollection_methodEnumManual
| Bool
GHC.Base.otherwise -> Value -> SubscriptionUpdateCollection_method
SubscriptionUpdateCollection_methodOther Value
val
)
data SubscriptionUpdateNet_terms_type
=
SubscriptionUpdateNet_terms_typeOther Data.Aeson.Types.Internal.Value
|
SubscriptionUpdateNet_terms_typeTyped Data.Text.Internal.Text
|
SubscriptionUpdateNet_terms_typeEnumNet
|
SubscriptionUpdateNet_terms_typeEnumEom
deriving (Int -> SubscriptionUpdateNet_terms_type -> ShowS
[SubscriptionUpdateNet_terms_type] -> ShowS
SubscriptionUpdateNet_terms_type -> String
(Int -> SubscriptionUpdateNet_terms_type -> ShowS)
-> (SubscriptionUpdateNet_terms_type -> String)
-> ([SubscriptionUpdateNet_terms_type] -> ShowS)
-> Show SubscriptionUpdateNet_terms_type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SubscriptionUpdateNet_terms_type -> ShowS
showsPrec :: Int -> SubscriptionUpdateNet_terms_type -> ShowS
$cshow :: SubscriptionUpdateNet_terms_type -> String
show :: SubscriptionUpdateNet_terms_type -> String
$cshowList :: [SubscriptionUpdateNet_terms_type] -> ShowS
showList :: [SubscriptionUpdateNet_terms_type] -> ShowS
GHC.Show.Show, SubscriptionUpdateNet_terms_type
-> SubscriptionUpdateNet_terms_type -> Bool
(SubscriptionUpdateNet_terms_type
-> SubscriptionUpdateNet_terms_type -> Bool)
-> (SubscriptionUpdateNet_terms_type
-> SubscriptionUpdateNet_terms_type -> Bool)
-> Eq SubscriptionUpdateNet_terms_type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubscriptionUpdateNet_terms_type
-> SubscriptionUpdateNet_terms_type -> Bool
== :: SubscriptionUpdateNet_terms_type
-> SubscriptionUpdateNet_terms_type -> Bool
$c/= :: SubscriptionUpdateNet_terms_type
-> SubscriptionUpdateNet_terms_type -> Bool
/= :: SubscriptionUpdateNet_terms_type
-> SubscriptionUpdateNet_terms_type -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionUpdateNet_terms_type where
toJSON :: SubscriptionUpdateNet_terms_type -> Value
toJSON (SubscriptionUpdateNet_terms_typeOther Value
val) = Value
val
toJSON (SubscriptionUpdateNet_terms_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (SubscriptionUpdateNet_terms_type
SubscriptionUpdateNet_terms_typeEnumNet) = Value
"net"
toJSON (SubscriptionUpdateNet_terms_type
SubscriptionUpdateNet_terms_typeEnumEom) = Value
"eom"
instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionUpdateNet_terms_type where
parseJSON :: Value -> Parser SubscriptionUpdateNet_terms_type
parseJSON Value
val =
SubscriptionUpdateNet_terms_type
-> Parser SubscriptionUpdateNet_terms_type
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
( if
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"net" -> SubscriptionUpdateNet_terms_type
SubscriptionUpdateNet_terms_typeEnumNet
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"eom" -> SubscriptionUpdateNet_terms_type
SubscriptionUpdateNet_terms_typeEnumEom
| Bool
GHC.Base.otherwise -> Value -> SubscriptionUpdateNet_terms_type
SubscriptionUpdateNet_terms_typeOther Value
val
)
data SubscriptionUpdateRevenue_schedule_type
=
SubscriptionUpdateRevenue_schedule_typeOther Data.Aeson.Types.Internal.Value
|
SubscriptionUpdateRevenue_schedule_typeTyped Data.Text.Internal.Text
|
SubscriptionUpdateRevenue_schedule_typeEnumAt_range_end
|
SubscriptionUpdateRevenue_schedule_typeEnumAt_range_start
|
SubscriptionUpdateRevenue_schedule_typeEnumEvenly
|
SubscriptionUpdateRevenue_schedule_typeEnumNever
deriving (Int -> SubscriptionUpdateRevenue_schedule_type -> ShowS
[SubscriptionUpdateRevenue_schedule_type] -> ShowS
SubscriptionUpdateRevenue_schedule_type -> String
(Int -> SubscriptionUpdateRevenue_schedule_type -> ShowS)
-> (SubscriptionUpdateRevenue_schedule_type -> String)
-> ([SubscriptionUpdateRevenue_schedule_type] -> ShowS)
-> Show SubscriptionUpdateRevenue_schedule_type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SubscriptionUpdateRevenue_schedule_type -> ShowS
showsPrec :: Int -> SubscriptionUpdateRevenue_schedule_type -> ShowS
$cshow :: SubscriptionUpdateRevenue_schedule_type -> String
show :: SubscriptionUpdateRevenue_schedule_type -> String
$cshowList :: [SubscriptionUpdateRevenue_schedule_type] -> ShowS
showList :: [SubscriptionUpdateRevenue_schedule_type] -> ShowS
GHC.Show.Show, SubscriptionUpdateRevenue_schedule_type
-> SubscriptionUpdateRevenue_schedule_type -> Bool
(SubscriptionUpdateRevenue_schedule_type
-> SubscriptionUpdateRevenue_schedule_type -> Bool)
-> (SubscriptionUpdateRevenue_schedule_type
-> SubscriptionUpdateRevenue_schedule_type -> Bool)
-> Eq SubscriptionUpdateRevenue_schedule_type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubscriptionUpdateRevenue_schedule_type
-> SubscriptionUpdateRevenue_schedule_type -> Bool
== :: SubscriptionUpdateRevenue_schedule_type
-> SubscriptionUpdateRevenue_schedule_type -> Bool
$c/= :: SubscriptionUpdateRevenue_schedule_type
-> SubscriptionUpdateRevenue_schedule_type -> Bool
/= :: SubscriptionUpdateRevenue_schedule_type
-> SubscriptionUpdateRevenue_schedule_type -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionUpdateRevenue_schedule_type where
toJSON :: SubscriptionUpdateRevenue_schedule_type -> Value
toJSON (SubscriptionUpdateRevenue_schedule_typeOther Value
val) = Value
val
toJSON (SubscriptionUpdateRevenue_schedule_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (SubscriptionUpdateRevenue_schedule_type
SubscriptionUpdateRevenue_schedule_typeEnumAt_range_end) = Value
"at_range_end"
toJSON (SubscriptionUpdateRevenue_schedule_type
SubscriptionUpdateRevenue_schedule_typeEnumAt_range_start) = Value
"at_range_start"
toJSON (SubscriptionUpdateRevenue_schedule_type
SubscriptionUpdateRevenue_schedule_typeEnumEvenly) = Value
"evenly"
toJSON (SubscriptionUpdateRevenue_schedule_type
SubscriptionUpdateRevenue_schedule_typeEnumNever) = Value
"never"
instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionUpdateRevenue_schedule_type where
parseJSON :: Value -> Parser SubscriptionUpdateRevenue_schedule_type
parseJSON Value
val =
SubscriptionUpdateRevenue_schedule_type
-> Parser SubscriptionUpdateRevenue_schedule_type
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
( if
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"at_range_end" -> SubscriptionUpdateRevenue_schedule_type
SubscriptionUpdateRevenue_schedule_typeEnumAt_range_end
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"at_range_start" -> SubscriptionUpdateRevenue_schedule_type
SubscriptionUpdateRevenue_schedule_typeEnumAt_range_start
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"evenly" -> SubscriptionUpdateRevenue_schedule_type
SubscriptionUpdateRevenue_schedule_typeEnumEvenly
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"never" -> SubscriptionUpdateRevenue_schedule_type
SubscriptionUpdateRevenue_schedule_typeEnumNever
| Bool
GHC.Base.otherwise -> Value -> SubscriptionUpdateRevenue_schedule_type
SubscriptionUpdateRevenue_schedule_typeOther Value
val
)