| All Verbs | /stripe-session/{Id} |
|---|
import Foundation
import ServiceStack
public class GetStripeSession : Codable
{
public var id:String
required public init(){}
}
public class Session : StripeEntity_1<Session>, IHasId, IHasMetadata, IHasObject
{
public var id:String
public var object:String
public var afterExpiration:SessionAfterExpiration
public var allowPromotionCodes:Bool?
public var amountSubtotal:Int?
public var amountTotal:Int?
public var automaticTax:SessionAutomaticTax
public var billingAddressCollection:String
public var cancelUrl:String
public var clientReferenceId:String
public var consent:SessionConsent
public var consentCollection:SessionConsentCollection
public var created:Date
public var currency:String
public var customFields:[SessionCustomField]
public var customText:SessionCustomText
public var customerCreation:String
public var customerDetails:SessionCustomerDetails
public var customerEmail:String
public var expiresAt:Date
public var invoiceCreation:SessionInvoiceCreation
public var lineItems:StripeList<LineItem>
public var livemode:Bool
public var locale:String
public var metadata:[String:String]
public var mode:String
public var paymentMethodCollection:String
public var paymentMethodOptions:SessionPaymentMethodOptions
public var paymentMethodTypes:[String]
public var paymentStatus:String
public var phoneNumberCollection:SessionPhoneNumberCollection
public var recoveredFrom:String
public var shippingAddressCollection:SessionShippingAddressCollection
public var shippingCost:SessionShippingCost
public var shippingDetails:SessionShippingDetails
public var shippingOptions:[SessionShippingOption]
public var status:String
public var submitType:String
public var successUrl:String
public var taxIdCollection:SessionTaxIdCollection
public var totalDetails:SessionTotalDetails
public var url:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case id
case object
case afterExpiration
case allowPromotionCodes
case amountSubtotal
case amountTotal
case automaticTax
case billingAddressCollection
case cancelUrl
case clientReferenceId
case consent
case consentCollection
case created
case currency
case customFields
case customText
case customerCreation
case customerDetails
case customerEmail
case expiresAt
case invoiceCreation
case lineItems
case livemode
case locale
case metadata
case mode
case paymentMethodCollection
case paymentMethodOptions
case paymentMethodTypes
case paymentStatus
case phoneNumberCollection
case recoveredFrom
case shippingAddressCollection
case shippingCost
case shippingDetails
case shippingOptions
case status
case submitType
case successUrl
case taxIdCollection
case totalDetails
case url
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decodeIfPresent(String.self, forKey: .id)
object = try container.decodeIfPresent(String.self, forKey: .object)
afterExpiration = try container.decodeIfPresent(SessionAfterExpiration.self, forKey: .afterExpiration)
allowPromotionCodes = try container.decodeIfPresent(Bool.self, forKey: .allowPromotionCodes)
amountSubtotal = try container.decodeIfPresent(Int.self, forKey: .amountSubtotal)
amountTotal = try container.decodeIfPresent(Int.self, forKey: .amountTotal)
automaticTax = try container.decodeIfPresent(SessionAutomaticTax.self, forKey: .automaticTax)
billingAddressCollection = try container.decodeIfPresent(String.self, forKey: .billingAddressCollection)
cancelUrl = try container.decodeIfPresent(String.self, forKey: .cancelUrl)
clientReferenceId = try container.decodeIfPresent(String.self, forKey: .clientReferenceId)
consent = try container.decodeIfPresent(SessionConsent.self, forKey: .consent)
consentCollection = try container.decodeIfPresent(SessionConsentCollection.self, forKey: .consentCollection)
created = try container.decodeIfPresent(Date.self, forKey: .created)
currency = try container.decodeIfPresent(String.self, forKey: .currency)
customFields = try container.decodeIfPresent([SessionCustomField].self, forKey: .customFields) ?? []
customText = try container.decodeIfPresent(SessionCustomText.self, forKey: .customText)
customerCreation = try container.decodeIfPresent(String.self, forKey: .customerCreation)
customerDetails = try container.decodeIfPresent(SessionCustomerDetails.self, forKey: .customerDetails)
customerEmail = try container.decodeIfPresent(String.self, forKey: .customerEmail)
expiresAt = try container.decodeIfPresent(Date.self, forKey: .expiresAt)
invoiceCreation = try container.decodeIfPresent(SessionInvoiceCreation.self, forKey: .invoiceCreation)
lineItems = try container.decodeIfPresent(StripeList<LineItem>.self, forKey: .lineItems)
livemode = try container.decodeIfPresent(Bool.self, forKey: .livemode)
locale = try container.decodeIfPresent(String.self, forKey: .locale)
metadata = try container.decodeIfPresent([String:String].self, forKey: .metadata) ?? [:]
mode = try container.decodeIfPresent(String.self, forKey: .mode)
paymentMethodCollection = try container.decodeIfPresent(String.self, forKey: .paymentMethodCollection)
paymentMethodOptions = try container.decodeIfPresent(SessionPaymentMethodOptions.self, forKey: .paymentMethodOptions)
paymentMethodTypes = try container.decodeIfPresent([String].self, forKey: .paymentMethodTypes) ?? []
paymentStatus = try container.decodeIfPresent(String.self, forKey: .paymentStatus)
phoneNumberCollection = try container.decodeIfPresent(SessionPhoneNumberCollection.self, forKey: .phoneNumberCollection)
recoveredFrom = try container.decodeIfPresent(String.self, forKey: .recoveredFrom)
shippingAddressCollection = try container.decodeIfPresent(SessionShippingAddressCollection.self, forKey: .shippingAddressCollection)
shippingCost = try container.decodeIfPresent(SessionShippingCost.self, forKey: .shippingCost)
shippingDetails = try container.decodeIfPresent(SessionShippingDetails.self, forKey: .shippingDetails)
shippingOptions = try container.decodeIfPresent([SessionShippingOption].self, forKey: .shippingOptions) ?? []
status = try container.decodeIfPresent(String.self, forKey: .status)
submitType = try container.decodeIfPresent(String.self, forKey: .submitType)
successUrl = try container.decodeIfPresent(String.self, forKey: .successUrl)
taxIdCollection = try container.decodeIfPresent(SessionTaxIdCollection.self, forKey: .taxIdCollection)
totalDetails = try container.decodeIfPresent(SessionTotalDetails.self, forKey: .totalDetails)
url = try container.decodeIfPresent(String.self, forKey: .url)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if id != nil { try container.encode(id, forKey: .id) }
if object != nil { try container.encode(object, forKey: .object) }
if afterExpiration != nil { try container.encode(afterExpiration, forKey: .afterExpiration) }
if allowPromotionCodes != nil { try container.encode(allowPromotionCodes, forKey: .allowPromotionCodes) }
if amountSubtotal != nil { try container.encode(amountSubtotal, forKey: .amountSubtotal) }
if amountTotal != nil { try container.encode(amountTotal, forKey: .amountTotal) }
if automaticTax != nil { try container.encode(automaticTax, forKey: .automaticTax) }
if billingAddressCollection != nil { try container.encode(billingAddressCollection, forKey: .billingAddressCollection) }
if cancelUrl != nil { try container.encode(cancelUrl, forKey: .cancelUrl) }
if clientReferenceId != nil { try container.encode(clientReferenceId, forKey: .clientReferenceId) }
if consent != nil { try container.encode(consent, forKey: .consent) }
if consentCollection != nil { try container.encode(consentCollection, forKey: .consentCollection) }
if created != nil { try container.encode(created, forKey: .created) }
if currency != nil { try container.encode(currency, forKey: .currency) }
if customFields != nil { try container.encode(customFields, forKey: .customFields) }
if customText != nil { try container.encode(customText, forKey: .customText) }
if customerCreation != nil { try container.encode(customerCreation, forKey: .customerCreation) }
if customerDetails != nil { try container.encode(customerDetails, forKey: .customerDetails) }
if customerEmail != nil { try container.encode(customerEmail, forKey: .customerEmail) }
if expiresAt != nil { try container.encode(expiresAt, forKey: .expiresAt) }
if invoiceCreation != nil { try container.encode(invoiceCreation, forKey: .invoiceCreation) }
if lineItems != nil { try container.encode(lineItems, forKey: .lineItems) }
if livemode != nil { try container.encode(livemode, forKey: .livemode) }
if locale != nil { try container.encode(locale, forKey: .locale) }
if metadata != nil { try container.encode(metadata, forKey: .metadata) }
if mode != nil { try container.encode(mode, forKey: .mode) }
if paymentMethodCollection != nil { try container.encode(paymentMethodCollection, forKey: .paymentMethodCollection) }
if paymentMethodOptions != nil { try container.encode(paymentMethodOptions, forKey: .paymentMethodOptions) }
if paymentMethodTypes != nil { try container.encode(paymentMethodTypes, forKey: .paymentMethodTypes) }
if paymentStatus != nil { try container.encode(paymentStatus, forKey: .paymentStatus) }
if phoneNumberCollection != nil { try container.encode(phoneNumberCollection, forKey: .phoneNumberCollection) }
if recoveredFrom != nil { try container.encode(recoveredFrom, forKey: .recoveredFrom) }
if shippingAddressCollection != nil { try container.encode(shippingAddressCollection, forKey: .shippingAddressCollection) }
if shippingCost != nil { try container.encode(shippingCost, forKey: .shippingCost) }
if shippingDetails != nil { try container.encode(shippingDetails, forKey: .shippingDetails) }
if shippingOptions != nil { try container.encode(shippingOptions, forKey: .shippingOptions) }
if status != nil { try container.encode(status, forKey: .status) }
if submitType != nil { try container.encode(submitType, forKey: .submitType) }
if successUrl != nil { try container.encode(successUrl, forKey: .successUrl) }
if taxIdCollection != nil { try container.encode(taxIdCollection, forKey: .taxIdCollection) }
if totalDetails != nil { try container.encode(totalDetails, forKey: .totalDetails) }
if url != nil { try container.encode(url, forKey: .url) }
}
}
public class StripeEntity_1<T : Codable> : StripeEntity
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
public class StripeEntity : IStripeEntity, Codable
{
required public init(){}
}
public class SessionAfterExpiration : StripeEntity_1<SessionAfterExpiration>
{
public var recovery:SessionAfterExpirationRecovery
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case recovery
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
recovery = try container.decodeIfPresent(SessionAfterExpirationRecovery.self, forKey: .recovery)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if recovery != nil { try container.encode(recovery, forKey: .recovery) }
}
}
public class SessionAfterExpirationRecovery : StripeEntity_1<SessionAfterExpirationRecovery>
{
public var allowPromotionCodes:Bool
public var enabled:Bool
public var expiresAt:Date?
public var url:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case allowPromotionCodes
case enabled
case expiresAt
case url
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
allowPromotionCodes = try container.decodeIfPresent(Bool.self, forKey: .allowPromotionCodes)
enabled = try container.decodeIfPresent(Bool.self, forKey: .enabled)
expiresAt = try container.decodeIfPresent(Date.self, forKey: .expiresAt)
url = try container.decodeIfPresent(String.self, forKey: .url)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if allowPromotionCodes != nil { try container.encode(allowPromotionCodes, forKey: .allowPromotionCodes) }
if enabled != nil { try container.encode(enabled, forKey: .enabled) }
if expiresAt != nil { try container.encode(expiresAt, forKey: .expiresAt) }
if url != nil { try container.encode(url, forKey: .url) }
}
}
public class SessionAutomaticTax : StripeEntity_1<SessionAutomaticTax>
{
public var enabled:Bool
public var status:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case enabled
case status
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
enabled = try container.decodeIfPresent(Bool.self, forKey: .enabled)
status = try container.decodeIfPresent(String.self, forKey: .status)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if enabled != nil { try container.encode(enabled, forKey: .enabled) }
if status != nil { try container.encode(status, forKey: .status) }
}
}
public class SessionConsent : StripeEntity_1<SessionConsent>
{
public var promotions:String
public var termsOfService:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case promotions
case termsOfService
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
promotions = try container.decodeIfPresent(String.self, forKey: .promotions)
termsOfService = try container.decodeIfPresent(String.self, forKey: .termsOfService)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if promotions != nil { try container.encode(promotions, forKey: .promotions) }
if termsOfService != nil { try container.encode(termsOfService, forKey: .termsOfService) }
}
}
public class SessionConsentCollection : StripeEntity_1<SessionConsentCollection>
{
public var promotions:String
public var termsOfService:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case promotions
case termsOfService
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
promotions = try container.decodeIfPresent(String.self, forKey: .promotions)
termsOfService = try container.decodeIfPresent(String.self, forKey: .termsOfService)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if promotions != nil { try container.encode(promotions, forKey: .promotions) }
if termsOfService != nil { try container.encode(termsOfService, forKey: .termsOfService) }
}
}
public class SessionCustomField : StripeEntity_1<SessionCustomField>
{
public var dropdown:SessionCustomFieldDropdown
public var key:String
public var label:SessionCustomFieldLabel
public var numeric:SessionCustomFieldNumeric
public var optional:Bool
public var text:SessionCustomFieldText
public var type:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case dropdown
case key
case label
case numeric
case optional
case text
case type
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
dropdown = try container.decodeIfPresent(SessionCustomFieldDropdown.self, forKey: .dropdown)
key = try container.decodeIfPresent(String.self, forKey: .key)
label = try container.decodeIfPresent(SessionCustomFieldLabel.self, forKey: .label)
numeric = try container.decodeIfPresent(SessionCustomFieldNumeric.self, forKey: .numeric)
optional = try container.decodeIfPresent(Bool.self, forKey: .optional)
text = try container.decodeIfPresent(SessionCustomFieldText.self, forKey: .text)
type = try container.decodeIfPresent(String.self, forKey: .type)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if dropdown != nil { try container.encode(dropdown, forKey: .dropdown) }
if key != nil { try container.encode(key, forKey: .key) }
if label != nil { try container.encode(label, forKey: .label) }
if numeric != nil { try container.encode(numeric, forKey: .numeric) }
if optional != nil { try container.encode(optional, forKey: .optional) }
if text != nil { try container.encode(text, forKey: .text) }
if type != nil { try container.encode(type, forKey: .type) }
}
}
public class SessionCustomFieldDropdown : StripeEntity_1<SessionCustomFieldDropdown>
{
public var options:[SessionCustomFieldDropdownOption]
public var value:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case options
case value
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
options = try container.decodeIfPresent([SessionCustomFieldDropdownOption].self, forKey: .options) ?? []
value = try container.decodeIfPresent(String.self, forKey: .value)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if options != nil { try container.encode(options, forKey: .options) }
if value != nil { try container.encode(value, forKey: .value) }
}
}
public class SessionCustomFieldDropdownOption : StripeEntity_1<SessionCustomFieldDropdownOption>
{
public var label:String
public var value:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case label
case value
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
label = try container.decodeIfPresent(String.self, forKey: .label)
value = try container.decodeIfPresent(String.self, forKey: .value)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if label != nil { try container.encode(label, forKey: .label) }
if value != nil { try container.encode(value, forKey: .value) }
}
}
public class SessionCustomFieldLabel : StripeEntity_1<SessionCustomFieldLabel>
{
public var custom:String
public var type:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case custom
case type
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
custom = try container.decodeIfPresent(String.self, forKey: .custom)
type = try container.decodeIfPresent(String.self, forKey: .type)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if custom != nil { try container.encode(custom, forKey: .custom) }
if type != nil { try container.encode(type, forKey: .type) }
}
}
public class SessionCustomFieldNumeric : StripeEntity_1<SessionCustomFieldNumeric>
{
public var value:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case value
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
value = try container.decodeIfPresent(String.self, forKey: .value)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if value != nil { try container.encode(value, forKey: .value) }
}
}
public class SessionCustomFieldText : StripeEntity_1<SessionCustomFieldText>
{
public var value:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case value
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
value = try container.decodeIfPresent(String.self, forKey: .value)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if value != nil { try container.encode(value, forKey: .value) }
}
}
public class SessionCustomText : StripeEntity_1<SessionCustomText>
{
public var shippingAddress:SessionCustomTextShippingAddress
public var submit:SessionCustomTextSubmit
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case shippingAddress
case submit
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
shippingAddress = try container.decodeIfPresent(SessionCustomTextShippingAddress.self, forKey: .shippingAddress)
submit = try container.decodeIfPresent(SessionCustomTextSubmit.self, forKey: .submit)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if shippingAddress != nil { try container.encode(shippingAddress, forKey: .shippingAddress) }
if submit != nil { try container.encode(submit, forKey: .submit) }
}
}
public class SessionCustomTextShippingAddress : StripeEntity_1<SessionCustomTextShippingAddress>
{
public var message:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case message
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
message = try container.decodeIfPresent(String.self, forKey: .message)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if message != nil { try container.encode(message, forKey: .message) }
}
}
public class SessionCustomTextSubmit : StripeEntity_1<SessionCustomTextSubmit>
{
public var message:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case message
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
message = try container.decodeIfPresent(String.self, forKey: .message)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if message != nil { try container.encode(message, forKey: .message) }
}
}
public class SessionCustomerDetails : StripeEntity_1<SessionCustomerDetails>
{
public var address:Address
public var email:String
public var name:String
public var phone:String
public var taxExempt:String
public var taxIds:[SessionCustomerDetailsTaxId]
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case address
case email
case name
case phone
case taxExempt
case taxIds
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
address = try container.decodeIfPresent(Address.self, forKey: .address)
email = try container.decodeIfPresent(String.self, forKey: .email)
name = try container.decodeIfPresent(String.self, forKey: .name)
phone = try container.decodeIfPresent(String.self, forKey: .phone)
taxExempt = try container.decodeIfPresent(String.self, forKey: .taxExempt)
taxIds = try container.decodeIfPresent([SessionCustomerDetailsTaxId].self, forKey: .taxIds) ?? []
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if address != nil { try container.encode(address, forKey: .address) }
if email != nil { try container.encode(email, forKey: .email) }
if name != nil { try container.encode(name, forKey: .name) }
if phone != nil { try container.encode(phone, forKey: .phone) }
if taxExempt != nil { try container.encode(taxExempt, forKey: .taxExempt) }
if taxIds != nil { try container.encode(taxIds, forKey: .taxIds) }
}
}
public class Address : StripeEntity_1<Address>
{
public var city:String
public var country:String
public var line1:String
public var line2:String
public var postalCode:String
public var state:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case city
case country
case line1
case line2
case postalCode
case state
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
city = try container.decodeIfPresent(String.self, forKey: .city)
country = try container.decodeIfPresent(String.self, forKey: .country)
line1 = try container.decodeIfPresent(String.self, forKey: .line1)
line2 = try container.decodeIfPresent(String.self, forKey: .line2)
postalCode = try container.decodeIfPresent(String.self, forKey: .postalCode)
state = try container.decodeIfPresent(String.self, forKey: .state)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if city != nil { try container.encode(city, forKey: .city) }
if country != nil { try container.encode(country, forKey: .country) }
if line1 != nil { try container.encode(line1, forKey: .line1) }
if line2 != nil { try container.encode(line2, forKey: .line2) }
if postalCode != nil { try container.encode(postalCode, forKey: .postalCode) }
if state != nil { try container.encode(state, forKey: .state) }
}
}
public class SessionCustomerDetailsTaxId : StripeEntity_1<SessionCustomerDetailsTaxId>
{
public var type:String
public var value:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case type
case value
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
type = try container.decodeIfPresent(String.self, forKey: .type)
value = try container.decodeIfPresent(String.self, forKey: .value)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if type != nil { try container.encode(type, forKey: .type) }
if value != nil { try container.encode(value, forKey: .value) }
}
}
public class SessionInvoiceCreation : StripeEntity_1<SessionInvoiceCreation>
{
public var enabled:Bool
public var invoiceData:SessionInvoiceCreationInvoiceData
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case enabled
case invoiceData
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
enabled = try container.decodeIfPresent(Bool.self, forKey: .enabled)
invoiceData = try container.decodeIfPresent(SessionInvoiceCreationInvoiceData.self, forKey: .invoiceData)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if enabled != nil { try container.encode(enabled, forKey: .enabled) }
if invoiceData != nil { try container.encode(invoiceData, forKey: .invoiceData) }
}
}
public class SessionInvoiceCreationInvoiceData : StripeEntity_1<SessionInvoiceCreationInvoiceData>, IHasMetadata
{
public var customFields:[SessionInvoiceCreationInvoiceDataCustomField]
public var Description:String
public var footer:String
public var metadata:[String:String]
public var renderingOptions:SessionInvoiceCreationInvoiceDataRenderingOptions
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case customFields
case Description
case footer
case metadata
case renderingOptions
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
customFields = try container.decodeIfPresent([SessionInvoiceCreationInvoiceDataCustomField].self, forKey: .customFields) ?? []
Description = try container.decodeIfPresent(String.self, forKey: .Description)
footer = try container.decodeIfPresent(String.self, forKey: .footer)
metadata = try container.decodeIfPresent([String:String].self, forKey: .metadata) ?? [:]
renderingOptions = try container.decodeIfPresent(SessionInvoiceCreationInvoiceDataRenderingOptions.self, forKey: .renderingOptions)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if customFields != nil { try container.encode(customFields, forKey: .customFields) }
if Description != nil { try container.encode(Description, forKey: .Description) }
if footer != nil { try container.encode(footer, forKey: .footer) }
if metadata != nil { try container.encode(metadata, forKey: .metadata) }
if renderingOptions != nil { try container.encode(renderingOptions, forKey: .renderingOptions) }
}
}
public class SessionInvoiceCreationInvoiceDataCustomField : StripeEntity_1<SessionInvoiceCreationInvoiceDataCustomField>
{
public var name:String
public var value:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case value
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
name = try container.decodeIfPresent(String.self, forKey: .name)
value = try container.decodeIfPresent(String.self, forKey: .value)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if name != nil { try container.encode(name, forKey: .name) }
if value != nil { try container.encode(value, forKey: .value) }
}
}
public class SessionInvoiceCreationInvoiceDataRenderingOptions : StripeEntity_1<SessionInvoiceCreationInvoiceDataRenderingOptions>
{
public var amountTaxDisplay:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case amountTaxDisplay
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
amountTaxDisplay = try container.decodeIfPresent(String.self, forKey: .amountTaxDisplay)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if amountTaxDisplay != nil { try container.encode(amountTaxDisplay, forKey: .amountTaxDisplay) }
}
}
public class StripeList<T : Codable> : StripeEntity_1<StripeList<T>>, IHasObject
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
public class LineItem : StripeEntity_1<LineItem>, IHasId, IHasObject
{
public var id:String
public var object:String
public var amountDiscount:Int
public var amountSubtotal:Int
public var amountTax:Int
public var amountTotal:Int
public var currency:String
public var deleted:Bool?
public var Description:String
public var discounts:[LineItemDiscount]
public var price:Price
public var quantity:Int?
public var taxes:[LineItemTax]
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case id
case object
case amountDiscount
case amountSubtotal
case amountTax
case amountTotal
case currency
case deleted
case Description
case discounts
case price
case quantity
case taxes
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decodeIfPresent(String.self, forKey: .id)
object = try container.decodeIfPresent(String.self, forKey: .object)
amountDiscount = try container.decodeIfPresent(Int.self, forKey: .amountDiscount)
amountSubtotal = try container.decodeIfPresent(Int.self, forKey: .amountSubtotal)
amountTax = try container.decodeIfPresent(Int.self, forKey: .amountTax)
amountTotal = try container.decodeIfPresent(Int.self, forKey: .amountTotal)
currency = try container.decodeIfPresent(String.self, forKey: .currency)
deleted = try container.decodeIfPresent(Bool.self, forKey: .deleted)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
discounts = try container.decodeIfPresent([LineItemDiscount].self, forKey: .discounts) ?? []
price = try container.decodeIfPresent(Price.self, forKey: .price)
quantity = try container.decodeIfPresent(Int.self, forKey: .quantity)
taxes = try container.decodeIfPresent([LineItemTax].self, forKey: .taxes) ?? []
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if id != nil { try container.encode(id, forKey: .id) }
if object != nil { try container.encode(object, forKey: .object) }
if amountDiscount != nil { try container.encode(amountDiscount, forKey: .amountDiscount) }
if amountSubtotal != nil { try container.encode(amountSubtotal, forKey: .amountSubtotal) }
if amountTax != nil { try container.encode(amountTax, forKey: .amountTax) }
if amountTotal != nil { try container.encode(amountTotal, forKey: .amountTotal) }
if currency != nil { try container.encode(currency, forKey: .currency) }
if deleted != nil { try container.encode(deleted, forKey: .deleted) }
if Description != nil { try container.encode(Description, forKey: .Description) }
if discounts != nil { try container.encode(discounts, forKey: .discounts) }
if price != nil { try container.encode(price, forKey: .price) }
if quantity != nil { try container.encode(quantity, forKey: .quantity) }
if taxes != nil { try container.encode(taxes, forKey: .taxes) }
}
}
public class LineItemDiscount : StripeEntity_1<LineItemDiscount>
{
public var amount:Int
public var discount:Discount
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case amount
case discount
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
amount = try container.decodeIfPresent(Int.self, forKey: .amount)
discount = try container.decodeIfPresent(Discount.self, forKey: .discount)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if amount != nil { try container.encode(amount, forKey: .amount) }
if discount != nil { try container.encode(discount, forKey: .discount) }
}
}
public class Discount : StripeEntity_1<Discount>, IHasId, IHasObject
{
public var id:String
public var object:String
public var checkoutSession:String
public var coupon:Coupon
public var deleted:Bool?
public var end:Date?
public var invoice:String
public var invoiceItem:String
public var start:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case id
case object
case checkoutSession
case coupon
case deleted
case end
case invoice
case invoiceItem
case start
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decodeIfPresent(String.self, forKey: .id)
object = try container.decodeIfPresent(String.self, forKey: .object)
checkoutSession = try container.decodeIfPresent(String.self, forKey: .checkoutSession)
coupon = try container.decodeIfPresent(Coupon.self, forKey: .coupon)
deleted = try container.decodeIfPresent(Bool.self, forKey: .deleted)
end = try container.decodeIfPresent(Date.self, forKey: .end)
invoice = try container.decodeIfPresent(String.self, forKey: .invoice)
invoiceItem = try container.decodeIfPresent(String.self, forKey: .invoiceItem)
start = try container.decodeIfPresent(Date.self, forKey: .start)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if id != nil { try container.encode(id, forKey: .id) }
if object != nil { try container.encode(object, forKey: .object) }
if checkoutSession != nil { try container.encode(checkoutSession, forKey: .checkoutSession) }
if coupon != nil { try container.encode(coupon, forKey: .coupon) }
if deleted != nil { try container.encode(deleted, forKey: .deleted) }
if end != nil { try container.encode(end, forKey: .end) }
if invoice != nil { try container.encode(invoice, forKey: .invoice) }
if invoiceItem != nil { try container.encode(invoiceItem, forKey: .invoiceItem) }
if start != nil { try container.encode(start, forKey: .start) }
}
}
public class Coupon : StripeEntity_1<Coupon>, IHasId, IHasMetadata, IHasObject
{
public var id:String
public var object:String
public var amountOff:Int?
public var appliesTo:CouponAppliesTo
public var created:Date
public var currency:String
public var currencyOptions:[String:CouponCurrencyOptions]
public var deleted:Bool?
public var duration:String
public var durationInMonths:Int?
public var livemode:Bool
public var maxRedemptions:Int?
public var metadata:[String:String]
public var name:String
public var percentOff:Double?
public var redeemBy:Date?
public var timesRedeemed:Int
public var valid:Bool
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case id
case object
case amountOff
case appliesTo
case created
case currency
case currencyOptions
case deleted
case duration
case durationInMonths
case livemode
case maxRedemptions
case metadata
case name
case percentOff
case redeemBy
case timesRedeemed
case valid
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decodeIfPresent(String.self, forKey: .id)
object = try container.decodeIfPresent(String.self, forKey: .object)
amountOff = try container.decodeIfPresent(Int.self, forKey: .amountOff)
appliesTo = try container.decodeIfPresent(CouponAppliesTo.self, forKey: .appliesTo)
created = try container.decodeIfPresent(Date.self, forKey: .created)
currency = try container.decodeIfPresent(String.self, forKey: .currency)
currencyOptions = try container.decodeIfPresent([String:CouponCurrencyOptions].self, forKey: .currencyOptions) ?? [:]
deleted = try container.decodeIfPresent(Bool.self, forKey: .deleted)
duration = try container.decodeIfPresent(String.self, forKey: .duration)
durationInMonths = try container.decodeIfPresent(Int.self, forKey: .durationInMonths)
livemode = try container.decodeIfPresent(Bool.self, forKey: .livemode)
maxRedemptions = try container.decodeIfPresent(Int.self, forKey: .maxRedemptions)
metadata = try container.decodeIfPresent([String:String].self, forKey: .metadata) ?? [:]
name = try container.decodeIfPresent(String.self, forKey: .name)
percentOff = try container.decodeIfPresent(Double.self, forKey: .percentOff)
redeemBy = try container.decodeIfPresent(Date.self, forKey: .redeemBy)
timesRedeemed = try container.decodeIfPresent(Int.self, forKey: .timesRedeemed)
valid = try container.decodeIfPresent(Bool.self, forKey: .valid)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if id != nil { try container.encode(id, forKey: .id) }
if object != nil { try container.encode(object, forKey: .object) }
if amountOff != nil { try container.encode(amountOff, forKey: .amountOff) }
if appliesTo != nil { try container.encode(appliesTo, forKey: .appliesTo) }
if created != nil { try container.encode(created, forKey: .created) }
if currency != nil { try container.encode(currency, forKey: .currency) }
if currencyOptions != nil { try container.encode(currencyOptions, forKey: .currencyOptions) }
if deleted != nil { try container.encode(deleted, forKey: .deleted) }
if duration != nil { try container.encode(duration, forKey: .duration) }
if durationInMonths != nil { try container.encode(durationInMonths, forKey: .durationInMonths) }
if livemode != nil { try container.encode(livemode, forKey: .livemode) }
if maxRedemptions != nil { try container.encode(maxRedemptions, forKey: .maxRedemptions) }
if metadata != nil { try container.encode(metadata, forKey: .metadata) }
if name != nil { try container.encode(name, forKey: .name) }
if percentOff != nil { try container.encode(percentOff, forKey: .percentOff) }
if redeemBy != nil { try container.encode(redeemBy, forKey: .redeemBy) }
if timesRedeemed != nil { try container.encode(timesRedeemed, forKey: .timesRedeemed) }
if valid != nil { try container.encode(valid, forKey: .valid) }
}
}
public class CouponAppliesTo : StripeEntity_1<CouponAppliesTo>
{
public var products:[String]
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case products
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
products = try container.decodeIfPresent([String].self, forKey: .products) ?? []
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if products != nil { try container.encode(products, forKey: .products) }
}
}
public class CouponCurrencyOptions : StripeEntity_1<CouponCurrencyOptions>
{
public var amountOff:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case amountOff
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
amountOff = try container.decodeIfPresent(Int.self, forKey: .amountOff)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if amountOff != nil { try container.encode(amountOff, forKey: .amountOff) }
}
}
public class Price : StripeEntity_1<Price>, IHasId, IHasMetadata, IHasObject
{
public var id:String
public var object:String
public var active:Bool
public var billingScheme:String
public var created:Date
public var currency:String
public var currencyOptions:[String:PriceCurrencyOptions]
public var customUnitAmount:PriceCustomUnitAmount
public var deleted:Bool?
public var livemode:Bool
public var lookupKey:String
public var metadata:[String:String]
public var nickname:String
public var recurring:PriceRecurring
public var taxBehavior:String
public var tiers:[PriceTier]
public var tiersMode:String
public var transformQuantity:PriceTransformQuantity
public var type:String
public var unitAmount:Int?
public var unitAmountDecimal:Double?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case id
case object
case active
case billingScheme
case created
case currency
case currencyOptions
case customUnitAmount
case deleted
case livemode
case lookupKey
case metadata
case nickname
case recurring
case taxBehavior
case tiers
case tiersMode
case transformQuantity
case type
case unitAmount
case unitAmountDecimal
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decodeIfPresent(String.self, forKey: .id)
object = try container.decodeIfPresent(String.self, forKey: .object)
active = try container.decodeIfPresent(Bool.self, forKey: .active)
billingScheme = try container.decodeIfPresent(String.self, forKey: .billingScheme)
created = try container.decodeIfPresent(Date.self, forKey: .created)
currency = try container.decodeIfPresent(String.self, forKey: .currency)
currencyOptions = try container.decodeIfPresent([String:PriceCurrencyOptions].self, forKey: .currencyOptions) ?? [:]
customUnitAmount = try container.decodeIfPresent(PriceCustomUnitAmount.self, forKey: .customUnitAmount)
deleted = try container.decodeIfPresent(Bool.self, forKey: .deleted)
livemode = try container.decodeIfPresent(Bool.self, forKey: .livemode)
lookupKey = try container.decodeIfPresent(String.self, forKey: .lookupKey)
metadata = try container.decodeIfPresent([String:String].self, forKey: .metadata) ?? [:]
nickname = try container.decodeIfPresent(String.self, forKey: .nickname)
recurring = try container.decodeIfPresent(PriceRecurring.self, forKey: .recurring)
taxBehavior = try container.decodeIfPresent(String.self, forKey: .taxBehavior)
tiers = try container.decodeIfPresent([PriceTier].self, forKey: .tiers) ?? []
tiersMode = try container.decodeIfPresent(String.self, forKey: .tiersMode)
transformQuantity = try container.decodeIfPresent(PriceTransformQuantity.self, forKey: .transformQuantity)
type = try container.decodeIfPresent(String.self, forKey: .type)
unitAmount = try container.decodeIfPresent(Int.self, forKey: .unitAmount)
unitAmountDecimal = try container.decodeIfPresent(Double.self, forKey: .unitAmountDecimal)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if id != nil { try container.encode(id, forKey: .id) }
if object != nil { try container.encode(object, forKey: .object) }
if active != nil { try container.encode(active, forKey: .active) }
if billingScheme != nil { try container.encode(billingScheme, forKey: .billingScheme) }
if created != nil { try container.encode(created, forKey: .created) }
if currency != nil { try container.encode(currency, forKey: .currency) }
if currencyOptions != nil { try container.encode(currencyOptions, forKey: .currencyOptions) }
if customUnitAmount != nil { try container.encode(customUnitAmount, forKey: .customUnitAmount) }
if deleted != nil { try container.encode(deleted, forKey: .deleted) }
if livemode != nil { try container.encode(livemode, forKey: .livemode) }
if lookupKey != nil { try container.encode(lookupKey, forKey: .lookupKey) }
if metadata != nil { try container.encode(metadata, forKey: .metadata) }
if nickname != nil { try container.encode(nickname, forKey: .nickname) }
if recurring != nil { try container.encode(recurring, forKey: .recurring) }
if taxBehavior != nil { try container.encode(taxBehavior, forKey: .taxBehavior) }
if tiers != nil { try container.encode(tiers, forKey: .tiers) }
if tiersMode != nil { try container.encode(tiersMode, forKey: .tiersMode) }
if transformQuantity != nil { try container.encode(transformQuantity, forKey: .transformQuantity) }
if type != nil { try container.encode(type, forKey: .type) }
if unitAmount != nil { try container.encode(unitAmount, forKey: .unitAmount) }
if unitAmountDecimal != nil { try container.encode(unitAmountDecimal, forKey: .unitAmountDecimal) }
}
}
public class PriceCurrencyOptions : StripeEntity_1<PriceCurrencyOptions>
{
public var customUnitAmount:PriceCurrencyOptionsCustomUnitAmount
public var taxBehavior:String
public var tiers:[PriceCurrencyOptionsTier]
public var unitAmount:Int?
public var unitAmountDecimal:Double?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case customUnitAmount
case taxBehavior
case tiers
case unitAmount
case unitAmountDecimal
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
customUnitAmount = try container.decodeIfPresent(PriceCurrencyOptionsCustomUnitAmount.self, forKey: .customUnitAmount)
taxBehavior = try container.decodeIfPresent(String.self, forKey: .taxBehavior)
tiers = try container.decodeIfPresent([PriceCurrencyOptionsTier].self, forKey: .tiers) ?? []
unitAmount = try container.decodeIfPresent(Int.self, forKey: .unitAmount)
unitAmountDecimal = try container.decodeIfPresent(Double.self, forKey: .unitAmountDecimal)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if customUnitAmount != nil { try container.encode(customUnitAmount, forKey: .customUnitAmount) }
if taxBehavior != nil { try container.encode(taxBehavior, forKey: .taxBehavior) }
if tiers != nil { try container.encode(tiers, forKey: .tiers) }
if unitAmount != nil { try container.encode(unitAmount, forKey: .unitAmount) }
if unitAmountDecimal != nil { try container.encode(unitAmountDecimal, forKey: .unitAmountDecimal) }
}
}
public class PriceCurrencyOptionsCustomUnitAmount : StripeEntity_1<PriceCurrencyOptionsCustomUnitAmount>
{
public var maximum:Int?
public var minimum:Int?
public var preset:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case maximum
case minimum
case preset
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
maximum = try container.decodeIfPresent(Int.self, forKey: .maximum)
minimum = try container.decodeIfPresent(Int.self, forKey: .minimum)
preset = try container.decodeIfPresent(Int.self, forKey: .preset)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if maximum != nil { try container.encode(maximum, forKey: .maximum) }
if minimum != nil { try container.encode(minimum, forKey: .minimum) }
if preset != nil { try container.encode(preset, forKey: .preset) }
}
}
public class PriceCurrencyOptionsTier : StripeEntity_1<PriceCurrencyOptionsTier>
{
public var flatAmount:Int?
public var flatAmountDecimal:Double?
public var unitAmount:Int?
public var unitAmountDecimal:Double?
public var upTo:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case flatAmount
case flatAmountDecimal
case unitAmount
case unitAmountDecimal
case upTo
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
flatAmount = try container.decodeIfPresent(Int.self, forKey: .flatAmount)
flatAmountDecimal = try container.decodeIfPresent(Double.self, forKey: .flatAmountDecimal)
unitAmount = try container.decodeIfPresent(Int.self, forKey: .unitAmount)
unitAmountDecimal = try container.decodeIfPresent(Double.self, forKey: .unitAmountDecimal)
upTo = try container.decodeIfPresent(Int.self, forKey: .upTo)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if flatAmount != nil { try container.encode(flatAmount, forKey: .flatAmount) }
if flatAmountDecimal != nil { try container.encode(flatAmountDecimal, forKey: .flatAmountDecimal) }
if unitAmount != nil { try container.encode(unitAmount, forKey: .unitAmount) }
if unitAmountDecimal != nil { try container.encode(unitAmountDecimal, forKey: .unitAmountDecimal) }
if upTo != nil { try container.encode(upTo, forKey: .upTo) }
}
}
public class PriceCustomUnitAmount : StripeEntity_1<PriceCustomUnitAmount>
{
public var maximum:Int?
public var minimum:Int?
public var preset:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case maximum
case minimum
case preset
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
maximum = try container.decodeIfPresent(Int.self, forKey: .maximum)
minimum = try container.decodeIfPresent(Int.self, forKey: .minimum)
preset = try container.decodeIfPresent(Int.self, forKey: .preset)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if maximum != nil { try container.encode(maximum, forKey: .maximum) }
if minimum != nil { try container.encode(minimum, forKey: .minimum) }
if preset != nil { try container.encode(preset, forKey: .preset) }
}
}
public class PriceRecurring : StripeEntity_1<PriceRecurring>
{
public var aggregateUsage:String
public var interval:String
public var intervalCount:Int
public var trialPeriodDays:Int?
public var usageType:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case aggregateUsage
case interval
case intervalCount
case trialPeriodDays
case usageType
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
aggregateUsage = try container.decodeIfPresent(String.self, forKey: .aggregateUsage)
interval = try container.decodeIfPresent(String.self, forKey: .interval)
intervalCount = try container.decodeIfPresent(Int.self, forKey: .intervalCount)
trialPeriodDays = try container.decodeIfPresent(Int.self, forKey: .trialPeriodDays)
usageType = try container.decodeIfPresent(String.self, forKey: .usageType)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if aggregateUsage != nil { try container.encode(aggregateUsage, forKey: .aggregateUsage) }
if interval != nil { try container.encode(interval, forKey: .interval) }
if intervalCount != nil { try container.encode(intervalCount, forKey: .intervalCount) }
if trialPeriodDays != nil { try container.encode(trialPeriodDays, forKey: .trialPeriodDays) }
if usageType != nil { try container.encode(usageType, forKey: .usageType) }
}
}
public class PriceTier : StripeEntity_1<PriceTier>
{
public var flatAmount:Int?
public var flatAmountDecimal:Double?
public var unitAmount:Int?
public var unitAmountDecimal:Double?
public var upTo:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case flatAmount
case flatAmountDecimal
case unitAmount
case unitAmountDecimal
case upTo
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
flatAmount = try container.decodeIfPresent(Int.self, forKey: .flatAmount)
flatAmountDecimal = try container.decodeIfPresent(Double.self, forKey: .flatAmountDecimal)
unitAmount = try container.decodeIfPresent(Int.self, forKey: .unitAmount)
unitAmountDecimal = try container.decodeIfPresent(Double.self, forKey: .unitAmountDecimal)
upTo = try container.decodeIfPresent(Int.self, forKey: .upTo)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if flatAmount != nil { try container.encode(flatAmount, forKey: .flatAmount) }
if flatAmountDecimal != nil { try container.encode(flatAmountDecimal, forKey: .flatAmountDecimal) }
if unitAmount != nil { try container.encode(unitAmount, forKey: .unitAmount) }
if unitAmountDecimal != nil { try container.encode(unitAmountDecimal, forKey: .unitAmountDecimal) }
if upTo != nil { try container.encode(upTo, forKey: .upTo) }
}
}
public class PriceTransformQuantity : StripeEntity_1<PriceTransformQuantity>
{
public var divideBy:Int
public var round:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case divideBy
case round
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
divideBy = try container.decodeIfPresent(Int.self, forKey: .divideBy)
round = try container.decodeIfPresent(String.self, forKey: .round)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if divideBy != nil { try container.encode(divideBy, forKey: .divideBy) }
if round != nil { try container.encode(round, forKey: .round) }
}
}
public class LineItemTax : StripeEntity_1<LineItemTax>
{
public var amount:Int
public var rate:TaxRate
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case amount
case rate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
amount = try container.decodeIfPresent(Int.self, forKey: .amount)
rate = try container.decodeIfPresent(TaxRate.self, forKey: .rate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if amount != nil { try container.encode(amount, forKey: .amount) }
if rate != nil { try container.encode(rate, forKey: .rate) }
}
}
public class TaxRate : StripeEntity_1<TaxRate>, IHasId, IHasMetadata, IHasObject
{
public var id:String
public var object:String
public var active:Bool
public var country:String
public var created:Date
public var Description:String
public var displayName:String
public var inclusive:Bool
public var jurisdiction:String
public var livemode:Bool
public var metadata:[String:String]
public var percentage:Double
public var state:String
public var taxType:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case id
case object
case active
case country
case created
case Description
case displayName
case inclusive
case jurisdiction
case livemode
case metadata
case percentage
case state
case taxType
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decodeIfPresent(String.self, forKey: .id)
object = try container.decodeIfPresent(String.self, forKey: .object)
active = try container.decodeIfPresent(Bool.self, forKey: .active)
country = try container.decodeIfPresent(String.self, forKey: .country)
created = try container.decodeIfPresent(Date.self, forKey: .created)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
displayName = try container.decodeIfPresent(String.self, forKey: .displayName)
inclusive = try container.decodeIfPresent(Bool.self, forKey: .inclusive)
jurisdiction = try container.decodeIfPresent(String.self, forKey: .jurisdiction)
livemode = try container.decodeIfPresent(Bool.self, forKey: .livemode)
metadata = try container.decodeIfPresent([String:String].self, forKey: .metadata) ?? [:]
percentage = try container.decodeIfPresent(Double.self, forKey: .percentage)
state = try container.decodeIfPresent(String.self, forKey: .state)
taxType = try container.decodeIfPresent(String.self, forKey: .taxType)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if id != nil { try container.encode(id, forKey: .id) }
if object != nil { try container.encode(object, forKey: .object) }
if active != nil { try container.encode(active, forKey: .active) }
if country != nil { try container.encode(country, forKey: .country) }
if created != nil { try container.encode(created, forKey: .created) }
if Description != nil { try container.encode(Description, forKey: .Description) }
if displayName != nil { try container.encode(displayName, forKey: .displayName) }
if inclusive != nil { try container.encode(inclusive, forKey: .inclusive) }
if jurisdiction != nil { try container.encode(jurisdiction, forKey: .jurisdiction) }
if livemode != nil { try container.encode(livemode, forKey: .livemode) }
if metadata != nil { try container.encode(metadata, forKey: .metadata) }
if percentage != nil { try container.encode(percentage, forKey: .percentage) }
if state != nil { try container.encode(state, forKey: .state) }
if taxType != nil { try container.encode(taxType, forKey: .taxType) }
}
}
public class SessionPaymentMethodOptions : StripeEntity_1<SessionPaymentMethodOptions>
{
public var acssDebit:SessionPaymentMethodOptionsAcssDebit
public var affirm:SessionPaymentMethodOptionsAffirm
public var afterpayClearpay:SessionPaymentMethodOptionsAfterpayClearpay
public var alipay:SessionPaymentMethodOptionsAlipay
public var auBecsDebit:SessionPaymentMethodOptionsAuBecsDebit
public var bacsDebit:SessionPaymentMethodOptionsBacsDebit
public var bancontact:SessionPaymentMethodOptionsBancontact
public var boleto:SessionPaymentMethodOptionsBoleto
public var card:SessionPaymentMethodOptionsCard
public var customerBalance:SessionPaymentMethodOptionsCustomerBalance
public var eps:SessionPaymentMethodOptionsEps
public var fpx:SessionPaymentMethodOptionsFpx
public var giropay:SessionPaymentMethodOptionsGiropay
public var grabpay:SessionPaymentMethodOptionsGrabpay
public var ideal:SessionPaymentMethodOptionsIdeal
public var klarna:SessionPaymentMethodOptionsKlarna
public var konbini:SessionPaymentMethodOptionsKonbini
public var oxxo:SessionPaymentMethodOptionsOxxo
public var p24:SessionPaymentMethodOptionsP24
public var paynow:SessionPaymentMethodOptionsPaynow
public var pix:SessionPaymentMethodOptionsPix
public var sepaDebit:SessionPaymentMethodOptionsSepaDebit
public var sofort:SessionPaymentMethodOptionsSofort
public var usBankAccount:SessionPaymentMethodOptionsUsBankAccount
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case acssDebit
case affirm
case afterpayClearpay
case alipay
case auBecsDebit
case bacsDebit
case bancontact
case boleto
case card
case customerBalance
case eps
case fpx
case giropay
case grabpay
case ideal
case klarna
case konbini
case oxxo
case p24
case paynow
case pix
case sepaDebit
case sofort
case usBankAccount
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
acssDebit = try container.decodeIfPresent(SessionPaymentMethodOptionsAcssDebit.self, forKey: .acssDebit)
affirm = try container.decodeIfPresent(SessionPaymentMethodOptionsAffirm.self, forKey: .affirm)
afterpayClearpay = try container.decodeIfPresent(SessionPaymentMethodOptionsAfterpayClearpay.self, forKey: .afterpayClearpay)
alipay = try container.decodeIfPresent(SessionPaymentMethodOptionsAlipay.self, forKey: .alipay)
auBecsDebit = try container.decodeIfPresent(SessionPaymentMethodOptionsAuBecsDebit.self, forKey: .auBecsDebit)
bacsDebit = try container.decodeIfPresent(SessionPaymentMethodOptionsBacsDebit.self, forKey: .bacsDebit)
bancontact = try container.decodeIfPresent(SessionPaymentMethodOptionsBancontact.self, forKey: .bancontact)
boleto = try container.decodeIfPresent(SessionPaymentMethodOptionsBoleto.self, forKey: .boleto)
card = try container.decodeIfPresent(SessionPaymentMethodOptionsCard.self, forKey: .card)
customerBalance = try container.decodeIfPresent(SessionPaymentMethodOptionsCustomerBalance.self, forKey: .customerBalance)
eps = try container.decodeIfPresent(SessionPaymentMethodOptionsEps.self, forKey: .eps)
fpx = try container.decodeIfPresent(SessionPaymentMethodOptionsFpx.self, forKey: .fpx)
giropay = try container.decodeIfPresent(SessionPaymentMethodOptionsGiropay.self, forKey: .giropay)
grabpay = try container.decodeIfPresent(SessionPaymentMethodOptionsGrabpay.self, forKey: .grabpay)
ideal = try container.decodeIfPresent(SessionPaymentMethodOptionsIdeal.self, forKey: .ideal)
klarna = try container.decodeIfPresent(SessionPaymentMethodOptionsKlarna.self, forKey: .klarna)
konbini = try container.decodeIfPresent(SessionPaymentMethodOptionsKonbini.self, forKey: .konbini)
oxxo = try container.decodeIfPresent(SessionPaymentMethodOptionsOxxo.self, forKey: .oxxo)
p24 = try container.decodeIfPresent(SessionPaymentMethodOptionsP24.self, forKey: .p24)
paynow = try container.decodeIfPresent(SessionPaymentMethodOptionsPaynow.self, forKey: .paynow)
pix = try container.decodeIfPresent(SessionPaymentMethodOptionsPix.self, forKey: .pix)
sepaDebit = try container.decodeIfPresent(SessionPaymentMethodOptionsSepaDebit.self, forKey: .sepaDebit)
sofort = try container.decodeIfPresent(SessionPaymentMethodOptionsSofort.self, forKey: .sofort)
usBankAccount = try container.decodeIfPresent(SessionPaymentMethodOptionsUsBankAccount.self, forKey: .usBankAccount)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if acssDebit != nil { try container.encode(acssDebit, forKey: .acssDebit) }
if affirm != nil { try container.encode(affirm, forKey: .affirm) }
if afterpayClearpay != nil { try container.encode(afterpayClearpay, forKey: .afterpayClearpay) }
if alipay != nil { try container.encode(alipay, forKey: .alipay) }
if auBecsDebit != nil { try container.encode(auBecsDebit, forKey: .auBecsDebit) }
if bacsDebit != nil { try container.encode(bacsDebit, forKey: .bacsDebit) }
if bancontact != nil { try container.encode(bancontact, forKey: .bancontact) }
if boleto != nil { try container.encode(boleto, forKey: .boleto) }
if card != nil { try container.encode(card, forKey: .card) }
if customerBalance != nil { try container.encode(customerBalance, forKey: .customerBalance) }
if eps != nil { try container.encode(eps, forKey: .eps) }
if fpx != nil { try container.encode(fpx, forKey: .fpx) }
if giropay != nil { try container.encode(giropay, forKey: .giropay) }
if grabpay != nil { try container.encode(grabpay, forKey: .grabpay) }
if ideal != nil { try container.encode(ideal, forKey: .ideal) }
if klarna != nil { try container.encode(klarna, forKey: .klarna) }
if konbini != nil { try container.encode(konbini, forKey: .konbini) }
if oxxo != nil { try container.encode(oxxo, forKey: .oxxo) }
if p24 != nil { try container.encode(p24, forKey: .p24) }
if paynow != nil { try container.encode(paynow, forKey: .paynow) }
if pix != nil { try container.encode(pix, forKey: .pix) }
if sepaDebit != nil { try container.encode(sepaDebit, forKey: .sepaDebit) }
if sofort != nil { try container.encode(sofort, forKey: .sofort) }
if usBankAccount != nil { try container.encode(usBankAccount, forKey: .usBankAccount) }
}
}
public class SessionPaymentMethodOptionsAcssDebit : StripeEntity_1<SessionPaymentMethodOptionsAcssDebit>
{
public var currency:String
public var mandateOptions:SessionPaymentMethodOptionsAcssDebitMandateOptions
public var setupFutureUsage:String
public var verificationMethod:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case currency
case mandateOptions
case setupFutureUsage
case verificationMethod
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
currency = try container.decodeIfPresent(String.self, forKey: .currency)
mandateOptions = try container.decodeIfPresent(SessionPaymentMethodOptionsAcssDebitMandateOptions.self, forKey: .mandateOptions)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
verificationMethod = try container.decodeIfPresent(String.self, forKey: .verificationMethod)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if currency != nil { try container.encode(currency, forKey: .currency) }
if mandateOptions != nil { try container.encode(mandateOptions, forKey: .mandateOptions) }
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
if verificationMethod != nil { try container.encode(verificationMethod, forKey: .verificationMethod) }
}
}
public class SessionPaymentMethodOptionsAcssDebitMandateOptions : StripeEntity_1<SessionPaymentMethodOptionsAcssDebitMandateOptions>
{
public var customMandateUrl:String
public var defaultFor:[String]
public var intervalDescription:String
public var paymentSchedule:String
public var transactionType:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case customMandateUrl
case defaultFor
case intervalDescription
case paymentSchedule
case transactionType
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
customMandateUrl = try container.decodeIfPresent(String.self, forKey: .customMandateUrl)
defaultFor = try container.decodeIfPresent([String].self, forKey: .defaultFor) ?? []
intervalDescription = try container.decodeIfPresent(String.self, forKey: .intervalDescription)
paymentSchedule = try container.decodeIfPresent(String.self, forKey: .paymentSchedule)
transactionType = try container.decodeIfPresent(String.self, forKey: .transactionType)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if customMandateUrl != nil { try container.encode(customMandateUrl, forKey: .customMandateUrl) }
if defaultFor != nil { try container.encode(defaultFor, forKey: .defaultFor) }
if intervalDescription != nil { try container.encode(intervalDescription, forKey: .intervalDescription) }
if paymentSchedule != nil { try container.encode(paymentSchedule, forKey: .paymentSchedule) }
if transactionType != nil { try container.encode(transactionType, forKey: .transactionType) }
}
}
public class SessionPaymentMethodOptionsAffirm : StripeEntity_1<SessionPaymentMethodOptionsAffirm>
{
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsAfterpayClearpay : StripeEntity_1<SessionPaymentMethodOptionsAfterpayClearpay>
{
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsAlipay : StripeEntity_1<SessionPaymentMethodOptionsAlipay>
{
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsAuBecsDebit : StripeEntity_1<SessionPaymentMethodOptionsAuBecsDebit>
{
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsBacsDebit : StripeEntity_1<SessionPaymentMethodOptionsBacsDebit>
{
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsBancontact : StripeEntity_1<SessionPaymentMethodOptionsBancontact>
{
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsBoleto : StripeEntity_1<SessionPaymentMethodOptionsBoleto>
{
public var expiresAfterDays:Int
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case expiresAfterDays
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
expiresAfterDays = try container.decodeIfPresent(Int.self, forKey: .expiresAfterDays)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if expiresAfterDays != nil { try container.encode(expiresAfterDays, forKey: .expiresAfterDays) }
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsCard : StripeEntity_1<SessionPaymentMethodOptionsCard>
{
public var installments:SessionPaymentMethodOptionsCardInstallments
public var setupFutureUsage:String
public var statementDescriptorSuffixKana:String
public var statementDescriptorSuffixKanji:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case installments
case setupFutureUsage
case statementDescriptorSuffixKana
case statementDescriptorSuffixKanji
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
installments = try container.decodeIfPresent(SessionPaymentMethodOptionsCardInstallments.self, forKey: .installments)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
statementDescriptorSuffixKana = try container.decodeIfPresent(String.self, forKey: .statementDescriptorSuffixKana)
statementDescriptorSuffixKanji = try container.decodeIfPresent(String.self, forKey: .statementDescriptorSuffixKanji)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if installments != nil { try container.encode(installments, forKey: .installments) }
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
if statementDescriptorSuffixKana != nil { try container.encode(statementDescriptorSuffixKana, forKey: .statementDescriptorSuffixKana) }
if statementDescriptorSuffixKanji != nil { try container.encode(statementDescriptorSuffixKanji, forKey: .statementDescriptorSuffixKanji) }
}
}
public class SessionPaymentMethodOptionsCardInstallments : StripeEntity_1<SessionPaymentMethodOptionsCardInstallments>
{
public var enabled:Bool
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case enabled
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
enabled = try container.decodeIfPresent(Bool.self, forKey: .enabled)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if enabled != nil { try container.encode(enabled, forKey: .enabled) }
}
}
public class SessionPaymentMethodOptionsCustomerBalance : StripeEntity_1<SessionPaymentMethodOptionsCustomerBalance>
{
public var bankTransfer:SessionPaymentMethodOptionsCustomerBalanceBankTransfer
public var fundingType:String
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case bankTransfer
case fundingType
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
bankTransfer = try container.decodeIfPresent(SessionPaymentMethodOptionsCustomerBalanceBankTransfer.self, forKey: .bankTransfer)
fundingType = try container.decodeIfPresent(String.self, forKey: .fundingType)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if bankTransfer != nil { try container.encode(bankTransfer, forKey: .bankTransfer) }
if fundingType != nil { try container.encode(fundingType, forKey: .fundingType) }
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsCustomerBalanceBankTransfer : StripeEntity_1<SessionPaymentMethodOptionsCustomerBalanceBankTransfer>
{
public var euBankTransfer:SessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer
public var requestedAddressTypes:[String]
public var type:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case euBankTransfer
case requestedAddressTypes
case type
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
euBankTransfer = try container.decodeIfPresent(SessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer.self, forKey: .euBankTransfer)
requestedAddressTypes = try container.decodeIfPresent([String].self, forKey: .requestedAddressTypes) ?? []
type = try container.decodeIfPresent(String.self, forKey: .type)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if euBankTransfer != nil { try container.encode(euBankTransfer, forKey: .euBankTransfer) }
if requestedAddressTypes != nil { try container.encode(requestedAddressTypes, forKey: .requestedAddressTypes) }
if type != nil { try container.encode(type, forKey: .type) }
}
}
public class SessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer : StripeEntity_1<SessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer>
{
public var country:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case country
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
country = try container.decodeIfPresent(String.self, forKey: .country)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if country != nil { try container.encode(country, forKey: .country) }
}
}
public class SessionPaymentMethodOptionsEps : StripeEntity_1<SessionPaymentMethodOptionsEps>
{
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsFpx : StripeEntity_1<SessionPaymentMethodOptionsFpx>
{
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsGiropay : StripeEntity_1<SessionPaymentMethodOptionsGiropay>
{
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsGrabpay : StripeEntity_1<SessionPaymentMethodOptionsGrabpay>
{
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsIdeal : StripeEntity_1<SessionPaymentMethodOptionsIdeal>
{
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsKlarna : StripeEntity_1<SessionPaymentMethodOptionsKlarna>
{
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsKonbini : StripeEntity_1<SessionPaymentMethodOptionsKonbini>
{
public var expiresAfterDays:Int?
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case expiresAfterDays
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
expiresAfterDays = try container.decodeIfPresent(Int.self, forKey: .expiresAfterDays)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if expiresAfterDays != nil { try container.encode(expiresAfterDays, forKey: .expiresAfterDays) }
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsOxxo : StripeEntity_1<SessionPaymentMethodOptionsOxxo>
{
public var expiresAfterDays:Int
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case expiresAfterDays
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
expiresAfterDays = try container.decodeIfPresent(Int.self, forKey: .expiresAfterDays)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if expiresAfterDays != nil { try container.encode(expiresAfterDays, forKey: .expiresAfterDays) }
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsP24 : StripeEntity_1<SessionPaymentMethodOptionsP24>
{
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsPaynow : StripeEntity_1<SessionPaymentMethodOptionsPaynow>
{
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsPix : StripeEntity_1<SessionPaymentMethodOptionsPix>
{
public var expiresAfterSeconds:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case expiresAfterSeconds
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
expiresAfterSeconds = try container.decodeIfPresent(Int.self, forKey: .expiresAfterSeconds)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if expiresAfterSeconds != nil { try container.encode(expiresAfterSeconds, forKey: .expiresAfterSeconds) }
}
}
public class SessionPaymentMethodOptionsSepaDebit : StripeEntity_1<SessionPaymentMethodOptionsSepaDebit>
{
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsSofort : StripeEntity_1<SessionPaymentMethodOptionsSofort>
{
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
}
}
public class SessionPaymentMethodOptionsUsBankAccount : StripeEntity_1<SessionPaymentMethodOptionsUsBankAccount>
{
public var financialConnections:SessionPaymentMethodOptionsUsBankAccountFinancialConnections
public var setupFutureUsage:String
public var verificationMethod:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case financialConnections
case setupFutureUsage
case verificationMethod
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
financialConnections = try container.decodeIfPresent(SessionPaymentMethodOptionsUsBankAccountFinancialConnections.self, forKey: .financialConnections)
setupFutureUsage = try container.decodeIfPresent(String.self, forKey: .setupFutureUsage)
verificationMethod = try container.decodeIfPresent(String.self, forKey: .verificationMethod)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if financialConnections != nil { try container.encode(financialConnections, forKey: .financialConnections) }
if setupFutureUsage != nil { try container.encode(setupFutureUsage, forKey: .setupFutureUsage) }
if verificationMethod != nil { try container.encode(verificationMethod, forKey: .verificationMethod) }
}
}
public class SessionPaymentMethodOptionsUsBankAccountFinancialConnections : StripeEntity_1<SessionPaymentMethodOptionsUsBankAccountFinancialConnections>
{
public var permissions:[String]
public var returnUrl:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case permissions
case returnUrl
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
permissions = try container.decodeIfPresent([String].self, forKey: .permissions) ?? []
returnUrl = try container.decodeIfPresent(String.self, forKey: .returnUrl)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if permissions != nil { try container.encode(permissions, forKey: .permissions) }
if returnUrl != nil { try container.encode(returnUrl, forKey: .returnUrl) }
}
}
public class SessionPhoneNumberCollection : StripeEntity_1<SessionPhoneNumberCollection>
{
public var enabled:Bool
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case enabled
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
enabled = try container.decodeIfPresent(Bool.self, forKey: .enabled)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if enabled != nil { try container.encode(enabled, forKey: .enabled) }
}
}
public class SessionShippingAddressCollection : StripeEntity_1<SessionShippingAddressCollection>
{
public var allowedCountries:[String]
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case allowedCountries
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
allowedCountries = try container.decodeIfPresent([String].self, forKey: .allowedCountries) ?? []
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if allowedCountries != nil { try container.encode(allowedCountries, forKey: .allowedCountries) }
}
}
public class SessionShippingCost : StripeEntity_1<SessionShippingCost>
{
public var amountSubtotal:Int
public var amountTax:Int
public var amountTotal:Int
public var taxes:[SessionShippingCostTax]
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case amountSubtotal
case amountTax
case amountTotal
case taxes
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
amountSubtotal = try container.decodeIfPresent(Int.self, forKey: .amountSubtotal)
amountTax = try container.decodeIfPresent(Int.self, forKey: .amountTax)
amountTotal = try container.decodeIfPresent(Int.self, forKey: .amountTotal)
taxes = try container.decodeIfPresent([SessionShippingCostTax].self, forKey: .taxes) ?? []
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if amountSubtotal != nil { try container.encode(amountSubtotal, forKey: .amountSubtotal) }
if amountTax != nil { try container.encode(amountTax, forKey: .amountTax) }
if amountTotal != nil { try container.encode(amountTotal, forKey: .amountTotal) }
if taxes != nil { try container.encode(taxes, forKey: .taxes) }
}
}
public class SessionShippingCostTax : StripeEntity_1<SessionShippingCostTax>
{
public var amount:Int
public var rate:TaxRate
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case amount
case rate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
amount = try container.decodeIfPresent(Int.self, forKey: .amount)
rate = try container.decodeIfPresent(TaxRate.self, forKey: .rate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if amount != nil { try container.encode(amount, forKey: .amount) }
if rate != nil { try container.encode(rate, forKey: .rate) }
}
}
public class SessionShippingDetails : StripeEntity_1<SessionShippingDetails>
{
public var address:Address
public var carrier:String
public var name:String
public var phone:String
public var trackingNumber:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case address
case carrier
case name
case phone
case trackingNumber
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
address = try container.decodeIfPresent(Address.self, forKey: .address)
carrier = try container.decodeIfPresent(String.self, forKey: .carrier)
name = try container.decodeIfPresent(String.self, forKey: .name)
phone = try container.decodeIfPresent(String.self, forKey: .phone)
trackingNumber = try container.decodeIfPresent(String.self, forKey: .trackingNumber)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if address != nil { try container.encode(address, forKey: .address) }
if carrier != nil { try container.encode(carrier, forKey: .carrier) }
if name != nil { try container.encode(name, forKey: .name) }
if phone != nil { try container.encode(phone, forKey: .phone) }
if trackingNumber != nil { try container.encode(trackingNumber, forKey: .trackingNumber) }
}
}
public class SessionShippingOption : StripeEntity_1<SessionShippingOption>
{
public var shippingAmount:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case shippingAmount
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
shippingAmount = try container.decodeIfPresent(Int.self, forKey: .shippingAmount)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if shippingAmount != nil { try container.encode(shippingAmount, forKey: .shippingAmount) }
}
}
public class SessionTaxIdCollection : StripeEntity_1<SessionTaxIdCollection>
{
public var enabled:Bool
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case enabled
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
enabled = try container.decodeIfPresent(Bool.self, forKey: .enabled)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if enabled != nil { try container.encode(enabled, forKey: .enabled) }
}
}
public class SessionTotalDetails : StripeEntity_1<SessionTotalDetails>
{
public var amountDiscount:Int
public var amountShipping:Int?
public var amountTax:Int
public var breakdown:SessionTotalDetailsBreakdown
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case amountDiscount
case amountShipping
case amountTax
case breakdown
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
amountDiscount = try container.decodeIfPresent(Int.self, forKey: .amountDiscount)
amountShipping = try container.decodeIfPresent(Int.self, forKey: .amountShipping)
amountTax = try container.decodeIfPresent(Int.self, forKey: .amountTax)
breakdown = try container.decodeIfPresent(SessionTotalDetailsBreakdown.self, forKey: .breakdown)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if amountDiscount != nil { try container.encode(amountDiscount, forKey: .amountDiscount) }
if amountShipping != nil { try container.encode(amountShipping, forKey: .amountShipping) }
if amountTax != nil { try container.encode(amountTax, forKey: .amountTax) }
if breakdown != nil { try container.encode(breakdown, forKey: .breakdown) }
}
}
public class SessionTotalDetailsBreakdown : StripeEntity_1<SessionTotalDetailsBreakdown>
{
public var discounts:[SessionTotalDetailsBreakdownDiscount]
public var taxes:[SessionTotalDetailsBreakdownTax]
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case discounts
case taxes
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
discounts = try container.decodeIfPresent([SessionTotalDetailsBreakdownDiscount].self, forKey: .discounts) ?? []
taxes = try container.decodeIfPresent([SessionTotalDetailsBreakdownTax].self, forKey: .taxes) ?? []
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if discounts != nil { try container.encode(discounts, forKey: .discounts) }
if taxes != nil { try container.encode(taxes, forKey: .taxes) }
}
}
public class SessionTotalDetailsBreakdownDiscount : StripeEntity_1<SessionTotalDetailsBreakdownDiscount>
{
public var amount:Int
public var discount:Discount
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case amount
case discount
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
amount = try container.decodeIfPresent(Int.self, forKey: .amount)
discount = try container.decodeIfPresent(Discount.self, forKey: .discount)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if amount != nil { try container.encode(amount, forKey: .amount) }
if discount != nil { try container.encode(discount, forKey: .discount) }
}
}
public class SessionTotalDetailsBreakdownTax : StripeEntity_1<SessionTotalDetailsBreakdownTax>
{
public var amount:Int
public var rate:TaxRate
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case amount
case rate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
amount = try container.decodeIfPresent(Int.self, forKey: .amount)
rate = try container.decodeIfPresent(TaxRate.self, forKey: .rate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if amount != nil { try container.encode(amount, forKey: .amount) }
if rate != nil { try container.encode(rate, forKey: .rate) }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /stripe-session/{Id} HTTP/1.1
Host: duengageapi.uat.scadsoftware.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"Id":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{Unable to show example output for type 'Session' using the custom 'other' filter}Exception has been thrown by the target of an invocation.