GET | /services/grouped |
---|
import Foundation
import ServiceStack
public class GroupedServiceQuery : QueryDb2<Service, GroupedServiceQueryResponse>
{
/**
* Company to show services for
*/
// @ApiMember(Description="Company to show services for", ParameterType="query")
public var companyId:String?
/**
* Service status
*/
// @ApiMember(DataType="boolean", Description="Service status", ParameterType="query")
public var active:Bool?
/**
* If you want to include the connected resource types and resources
*/
// @ApiMember(Description="If you want to include the connected resource types and resources", ParameterType="query")
public var includeResources:Bool
/**
* If you want to include the connected schedules
*/
// @ApiMember(DataType="boolean", Description="If you want to include the connected schedules", ParameterType="query")
public var includeSchedules:Bool
/**
* If you want to include the connected custom fields
*/
// @ApiMember(DataType="boolean", Description="If you want to include the connected custom fields", ParameterType="query")
public var includeCustomFields:Bool
/**
* If you want to include the connected resource types and resources
*/
// @ApiMember(DataType="boolean", Description="If you want to include the connected resource types and resources", ParameterType="query")
public var includeCustomFieldValues:Bool
/**
* If you want to include the connected custom fields needs to be entered when booking a new time on the service
*/
// @ApiMember(DataType="boolean", Description="If you want to include the connected custom fields needs to be entered when booking a new time on the service", ParameterType="query")
public var includeBookingCustomFields:Bool
/**
* If you want to include the connected custom fields for the customers
*/
// @ApiMember(DataType="boolean", Description="If you want to include the connected custom fields for the customers", ParameterType="query")
public var includeCustomerCustomFields:Bool
/**
* If you want to include the service prices
*/
// @ApiMember(DataType="boolean", Description="If you want to include the service prices", ParameterType="query")
public var includePrices:Bool
/**
* If you have selected to include the prices, here you can set the date to show the prices for
*/
// @ApiMember(DataType="dateTime", Description="If you have selected to include the prices, here you can set the date to show the prices for", ParameterType="query")
public var priceDate:Date?
/**
* If you have selected to include the prices, here you can set the datetime to show the exact price
*/
// @ApiMember(DataType="timeSpan", Description="If you have selected to include the prices, here you can set the datetime to show the exact price", ParameterType="query")
@TimeSpan public var priceTime:TimeInterval?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case companyId
case active
case includeResources
case includeSchedules
case includeCustomFields
case includeCustomFieldValues
case includeBookingCustomFields
case includeCustomerCustomFields
case includePrices
case priceDate
case priceTime
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
active = try container.decodeIfPresent(Bool.self, forKey: .active)
includeResources = try container.decodeIfPresent(Bool.self, forKey: .includeResources)
includeSchedules = try container.decodeIfPresent(Bool.self, forKey: .includeSchedules)
includeCustomFields = try container.decodeIfPresent(Bool.self, forKey: .includeCustomFields)
includeCustomFieldValues = try container.decodeIfPresent(Bool.self, forKey: .includeCustomFieldValues)
includeBookingCustomFields = try container.decodeIfPresent(Bool.self, forKey: .includeBookingCustomFields)
includeCustomerCustomFields = try container.decodeIfPresent(Bool.self, forKey: .includeCustomerCustomFields)
includePrices = try container.decodeIfPresent(Bool.self, forKey: .includePrices)
priceDate = try container.decodeIfPresent(Date.self, forKey: .priceDate)
priceTime = try container.convertIfPresent(TimeInterval.self, forKey: .priceTime)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if active != nil { try container.encode(active, forKey: .active) }
if includeResources != nil { try container.encode(includeResources, forKey: .includeResources) }
if includeSchedules != nil { try container.encode(includeSchedules, forKey: .includeSchedules) }
if includeCustomFields != nil { try container.encode(includeCustomFields, forKey: .includeCustomFields) }
if includeCustomFieldValues != nil { try container.encode(includeCustomFieldValues, forKey: .includeCustomFieldValues) }
if includeBookingCustomFields != nil { try container.encode(includeBookingCustomFields, forKey: .includeBookingCustomFields) }
if includeCustomerCustomFields != nil { try container.encode(includeCustomerCustomFields, forKey: .includeCustomerCustomFields) }
if includePrices != nil { try container.encode(includePrices, forKey: .includePrices) }
if priceDate != nil { try container.encode(priceDate, forKey: .priceDate) }
if priceTime != nil { try container.encode(priceTime, forKey: .priceTime) }
}
}
public class BaseModel : Codable
{
required public init(){}
}
public class ResourceType : BaseModel, IBaseModelCreated, IBaseModelUpdated
{
// @Ignore()
public var selectableByUser:Bool
// @Ignore()
public var resources:[Resource] = []
// @Required()
public var companyId:String?
public var id:Int
// @Required()
public var name:String?
public var Description:String
// @Required()
public var active:Bool?
// @Required()
public var updatedDate:Date?
// @Required()
public var createdDate:Date?
public var modifiedDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case selectableByUser
case resources
case companyId
case id
case name
case Description
case active
case updatedDate
case createdDate
case modifiedDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
selectableByUser = try container.decodeIfPresent(Bool.self, forKey: .selectableByUser)
resources = try container.decodeIfPresent([Resource].self, forKey: .resources) ?? []
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
id = try container.decodeIfPresent(Int.self, forKey: .id)
name = try container.decodeIfPresent(String.self, forKey: .name)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
active = try container.decodeIfPresent(Bool.self, forKey: .active)
updatedDate = try container.decodeIfPresent(Date.self, forKey: .updatedDate)
createdDate = try container.decodeIfPresent(Date.self, forKey: .createdDate)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if selectableByUser != nil { try container.encode(selectableByUser, forKey: .selectableByUser) }
if resources.count > 0 { try container.encode(resources, forKey: .resources) }
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if id != nil { try container.encode(id, forKey: .id) }
if name != nil { try container.encode(name, forKey: .name) }
if Description != nil { try container.encode(Description, forKey: .Description) }
if active != nil { try container.encode(active, forKey: .active) }
if updatedDate != nil { try container.encode(updatedDate, forKey: .updatedDate) }
if createdDate != nil { try container.encode(createdDate, forKey: .createdDate) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
}
}
public class Resource : BaseModel, ICustomFieldTable, IBaseModelCreated, IBaseModelUpdated
{
// @Ignore()
public var priority:Int
// @Ignore()
public var schedules:IList<ISchedule>
// @Ignore()
public var exceptions:IList<ITimeException>
// @Ignore()
public var bookings:IList<IBookedTime>
// @Ignore()
public var customFieldsConfig:IList<CustomFieldConfig>
// @Ignore()
public var customFieldsData:IList<CustomFieldDataResponse>
// @Required()
public var companyId:String?
public var id:Int
// @Required()
public var name:String?
// @Required()
public var active:Bool?
public var Description:String
public var imageUrl:String
// @Required()
public var updatedDate:Date?
// @Required()
public var createdDate:Date?
// @Required()
public var color:String?
public var email:String
public var mobilePhone:String
public var emailNotification:Bool?
public var smsNotification:Bool?
// @Required()
public var sendSMSReminder:Bool?
// @Required()
public var sendEmailReminder:Bool?
public var modifiedDate:Date?
public var accessGroup:String
public var textField1:String
public var textField2:String
public var textField3:String
public var textField4:String
public var textField5:String
public var textField6:String
public var textField7:String
public var textField8:String
public var textField9:String
public var textField10:String
public var textField11:String
public var textField12:String
public var textField13:String
public var textField14:String
public var textField15:String
public var textField16:String
public var textField17:String
public var textField18:String
public var textField19:String
public var textField20:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case priority
case schedules
case exceptions
case bookings
case customFieldsConfig
case customFieldsData
case companyId
case id
case name
case active
case Description
case imageUrl
case updatedDate
case createdDate
case color
case email
case mobilePhone
case emailNotification
case smsNotification
case sendSMSReminder
case sendEmailReminder
case modifiedDate
case accessGroup
case textField1
case textField2
case textField3
case textField4
case textField5
case textField6
case textField7
case textField8
case textField9
case textField10
case textField11
case textField12
case textField13
case textField14
case textField15
case textField16
case textField17
case textField18
case textField19
case textField20
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
priority = try container.decodeIfPresent(Int.self, forKey: .priority)
schedules = try container.decodeIfPresent(IList<ISchedule>.self, forKey: .schedules)
exceptions = try container.decodeIfPresent(IList<ITimeException>.self, forKey: .exceptions)
bookings = try container.decodeIfPresent(IList<IBookedTime>.self, forKey: .bookings)
customFieldsConfig = try container.decodeIfPresent(IList<CustomFieldConfig>.self, forKey: .customFieldsConfig)
customFieldsData = try container.decodeIfPresent(IList<CustomFieldDataResponse>.self, forKey: .customFieldsData)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
id = try container.decodeIfPresent(Int.self, forKey: .id)
name = try container.decodeIfPresent(String.self, forKey: .name)
active = try container.decodeIfPresent(Bool.self, forKey: .active)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
imageUrl = try container.decodeIfPresent(String.self, forKey: .imageUrl)
updatedDate = try container.decodeIfPresent(Date.self, forKey: .updatedDate)
createdDate = try container.decodeIfPresent(Date.self, forKey: .createdDate)
color = try container.decodeIfPresent(String.self, forKey: .color)
email = try container.decodeIfPresent(String.self, forKey: .email)
mobilePhone = try container.decodeIfPresent(String.self, forKey: .mobilePhone)
emailNotification = try container.decodeIfPresent(Bool.self, forKey: .emailNotification)
smsNotification = try container.decodeIfPresent(Bool.self, forKey: .smsNotification)
sendSMSReminder = try container.decodeIfPresent(Bool.self, forKey: .sendSMSReminder)
sendEmailReminder = try container.decodeIfPresent(Bool.self, forKey: .sendEmailReminder)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
accessGroup = try container.decodeIfPresent(String.self, forKey: .accessGroup)
textField1 = try container.decodeIfPresent(String.self, forKey: .textField1)
textField2 = try container.decodeIfPresent(String.self, forKey: .textField2)
textField3 = try container.decodeIfPresent(String.self, forKey: .textField3)
textField4 = try container.decodeIfPresent(String.self, forKey: .textField4)
textField5 = try container.decodeIfPresent(String.self, forKey: .textField5)
textField6 = try container.decodeIfPresent(String.self, forKey: .textField6)
textField7 = try container.decodeIfPresent(String.self, forKey: .textField7)
textField8 = try container.decodeIfPresent(String.self, forKey: .textField8)
textField9 = try container.decodeIfPresent(String.self, forKey: .textField9)
textField10 = try container.decodeIfPresent(String.self, forKey: .textField10)
textField11 = try container.decodeIfPresent(String.self, forKey: .textField11)
textField12 = try container.decodeIfPresent(String.self, forKey: .textField12)
textField13 = try container.decodeIfPresent(String.self, forKey: .textField13)
textField14 = try container.decodeIfPresent(String.self, forKey: .textField14)
textField15 = try container.decodeIfPresent(String.self, forKey: .textField15)
textField16 = try container.decodeIfPresent(String.self, forKey: .textField16)
textField17 = try container.decodeIfPresent(String.self, forKey: .textField17)
textField18 = try container.decodeIfPresent(String.self, forKey: .textField18)
textField19 = try container.decodeIfPresent(String.self, forKey: .textField19)
textField20 = try container.decodeIfPresent(String.self, forKey: .textField20)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if priority != nil { try container.encode(priority, forKey: .priority) }
if schedules != nil { try container.encode(schedules, forKey: .schedules) }
if exceptions != nil { try container.encode(exceptions, forKey: .exceptions) }
if bookings != nil { try container.encode(bookings, forKey: .bookings) }
if customFieldsConfig != nil { try container.encode(customFieldsConfig, forKey: .customFieldsConfig) }
if customFieldsData != nil { try container.encode(customFieldsData, forKey: .customFieldsData) }
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if id != nil { try container.encode(id, forKey: .id) }
if name != nil { try container.encode(name, forKey: .name) }
if active != nil { try container.encode(active, forKey: .active) }
if Description != nil { try container.encode(Description, forKey: .Description) }
if imageUrl != nil { try container.encode(imageUrl, forKey: .imageUrl) }
if updatedDate != nil { try container.encode(updatedDate, forKey: .updatedDate) }
if createdDate != nil { try container.encode(createdDate, forKey: .createdDate) }
if color != nil { try container.encode(color, forKey: .color) }
if email != nil { try container.encode(email, forKey: .email) }
if mobilePhone != nil { try container.encode(mobilePhone, forKey: .mobilePhone) }
if emailNotification != nil { try container.encode(emailNotification, forKey: .emailNotification) }
if smsNotification != nil { try container.encode(smsNotification, forKey: .smsNotification) }
if sendSMSReminder != nil { try container.encode(sendSMSReminder, forKey: .sendSMSReminder) }
if sendEmailReminder != nil { try container.encode(sendEmailReminder, forKey: .sendEmailReminder) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if accessGroup != nil { try container.encode(accessGroup, forKey: .accessGroup) }
if textField1 != nil { try container.encode(textField1, forKey: .textField1) }
if textField2 != nil { try container.encode(textField2, forKey: .textField2) }
if textField3 != nil { try container.encode(textField3, forKey: .textField3) }
if textField4 != nil { try container.encode(textField4, forKey: .textField4) }
if textField5 != nil { try container.encode(textField5, forKey: .textField5) }
if textField6 != nil { try container.encode(textField6, forKey: .textField6) }
if textField7 != nil { try container.encode(textField7, forKey: .textField7) }
if textField8 != nil { try container.encode(textField8, forKey: .textField8) }
if textField9 != nil { try container.encode(textField9, forKey: .textField9) }
if textField10 != nil { try container.encode(textField10, forKey: .textField10) }
if textField11 != nil { try container.encode(textField11, forKey: .textField11) }
if textField12 != nil { try container.encode(textField12, forKey: .textField12) }
if textField13 != nil { try container.encode(textField13, forKey: .textField13) }
if textField14 != nil { try container.encode(textField14, forKey: .textField14) }
if textField15 != nil { try container.encode(textField15, forKey: .textField15) }
if textField16 != nil { try container.encode(textField16, forKey: .textField16) }
if textField17 != nil { try container.encode(textField17, forKey: .textField17) }
if textField18 != nil { try container.encode(textField18, forKey: .textField18) }
if textField19 != nil { try container.encode(textField19, forKey: .textField19) }
if textField20 != nil { try container.encode(textField20, forKey: .textField20) }
}
}
public protocol ISchedule
{
var resources:IList<Resource> { get set }
var type:ScheduleType { get set }
var active:Bool { get set }
var isResourceSpecific:Bool { get set }
}
public enum ScheduleType : String, Codable
{
case NotDefined
case RecurringSchedule
case DateSchedule
}
public protocol ITimeException : IInterval
{
var id:Int { get set }
var reasonText:String { get set }
var isBlock:Bool { get set }
var reasonTextPublic:String { get set }
var isRecurring:Bool { get set }
var resourceIds:[Int] { get set }
}
public protocol IBookedTime : IInterval
{
var id:Int { get set }
var serviceId:Int { get set }
var bookedSpots:Int { get set }
var totalSpots:Int { get set }
var pauseAfterInMinutes:Int { get set }
var status:BookingStatusEnum { get set }
var statusId:Int { get set }
var customer:BookedCustomer { get set }
}
public enum BookingStatusEnum : Int, Codable
{
case Booked = 1
case Unbooked = 2
case Reserved = 3
case Canceled = 4
case AwaitingPayment = 5
case AwaitingPaymentNoTimeLimit = 6
case Payed = 7
case AwaitingPaymentRequestFromAdmin = 8
case AwaitingPaymentFromProvider = 9
case Invoiced = 10
}
public class BookedCustomer : Codable
{
public var id:String
public var firstname:String
public var lastname:String
public var email:String
public var phone:String
public var facebookUserName:String
public var imageUrl:String
public var corporateIdentityNumber:String
public var invoiceAddress1:String
public var invoiceAddress2:String
public var invoiceCity:String
public var invoicePostalCode:String
public var invoiceCountryCode:String
required public init(){}
}
public class CustomFieldConfig : BaseModel
{
// @Ignore()
public var values:[CustomFieldValue] = []
public var customField:CustomField
// @Ignore()
public var regEx:RegEx
// @Ignore()
public var services:[Service] = []
public var customFieldServiceRelation:[CustomFieldServiceRelation] = []
// @Required()
public var companyId:String?
public var id:Int
public var groupId:Int?
// @Required()
public var fieldId:Int?
// @Required()
public var iconId:Int?
public var regExId:Int?
// @Required()
public var name:String?
// @Required()
public var Description:String?
// @Required()
public var datatype:String?
// @Required()
public var maxLength:Int?
// @Required()
public var isPublic:Bool?
// @Required()
public var isHidden:Bool?
// @Required()
public var isMandatory:Bool?
public var defaultValue:String
public var regExErrorMessage:String
public var mandatoryErrorMessage:String
public var width:Int?
// @Required()
public var multipleLineText:Bool?
public var modifiedDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case values
case customField
case regEx
case services
case customFieldServiceRelation
case companyId
case id
case groupId
case fieldId
case iconId
case regExId
case name
case Description
case datatype
case maxLength
case isPublic
case isHidden
case isMandatory
case defaultValue
case regExErrorMessage
case mandatoryErrorMessage
case width
case multipleLineText
case modifiedDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
values = try container.decodeIfPresent([CustomFieldValue].self, forKey: .values) ?? []
customField = try container.decodeIfPresent(CustomField.self, forKey: .customField)
regEx = try container.decodeIfPresent(RegEx.self, forKey: .regEx)
services = try container.decodeIfPresent([Service].self, forKey: .services) ?? []
customFieldServiceRelation = try container.decodeIfPresent([CustomFieldServiceRelation].self, forKey: .customFieldServiceRelation) ?? []
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
id = try container.decodeIfPresent(Int.self, forKey: .id)
groupId = try container.decodeIfPresent(Int.self, forKey: .groupId)
fieldId = try container.decodeIfPresent(Int.self, forKey: .fieldId)
iconId = try container.decodeIfPresent(Int.self, forKey: .iconId)
regExId = try container.decodeIfPresent(Int.self, forKey: .regExId)
name = try container.decodeIfPresent(String.self, forKey: .name)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
datatype = try container.decodeIfPresent(String.self, forKey: .datatype)
maxLength = try container.decodeIfPresent(Int.self, forKey: .maxLength)
isPublic = try container.decodeIfPresent(Bool.self, forKey: .isPublic)
isHidden = try container.decodeIfPresent(Bool.self, forKey: .isHidden)
isMandatory = try container.decodeIfPresent(Bool.self, forKey: .isMandatory)
defaultValue = try container.decodeIfPresent(String.self, forKey: .defaultValue)
regExErrorMessage = try container.decodeIfPresent(String.self, forKey: .regExErrorMessage)
mandatoryErrorMessage = try container.decodeIfPresent(String.self, forKey: .mandatoryErrorMessage)
width = try container.decodeIfPresent(Int.self, forKey: .width)
multipleLineText = try container.decodeIfPresent(Bool.self, forKey: .multipleLineText)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if values.count > 0 { try container.encode(values, forKey: .values) }
if customField != nil { try container.encode(customField, forKey: .customField) }
if regEx != nil { try container.encode(regEx, forKey: .regEx) }
if services.count > 0 { try container.encode(services, forKey: .services) }
if customFieldServiceRelation.count > 0 { try container.encode(customFieldServiceRelation, forKey: .customFieldServiceRelation) }
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if id != nil { try container.encode(id, forKey: .id) }
if groupId != nil { try container.encode(groupId, forKey: .groupId) }
if fieldId != nil { try container.encode(fieldId, forKey: .fieldId) }
if iconId != nil { try container.encode(iconId, forKey: .iconId) }
if regExId != nil { try container.encode(regExId, forKey: .regExId) }
if name != nil { try container.encode(name, forKey: .name) }
if Description != nil { try container.encode(Description, forKey: .Description) }
if datatype != nil { try container.encode(datatype, forKey: .datatype) }
if maxLength != nil { try container.encode(maxLength, forKey: .maxLength) }
if isPublic != nil { try container.encode(isPublic, forKey: .isPublic) }
if isHidden != nil { try container.encode(isHidden, forKey: .isHidden) }
if isMandatory != nil { try container.encode(isMandatory, forKey: .isMandatory) }
if defaultValue != nil { try container.encode(defaultValue, forKey: .defaultValue) }
if regExErrorMessage != nil { try container.encode(regExErrorMessage, forKey: .regExErrorMessage) }
if mandatoryErrorMessage != nil { try container.encode(mandatoryErrorMessage, forKey: .mandatoryErrorMessage) }
if width != nil { try container.encode(width, forKey: .width) }
if multipleLineText != nil { try container.encode(multipleLineText, forKey: .multipleLineText) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
}
}
public class CustomFieldValue : BaseModel
{
// @Required()
public var companyId:String?
public var id:Int
// @Required()
public var value:String?
// @Required()
public var active:Bool?
public var sortOrder:Int16?
public var modifiedDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case companyId
case id
case value
case active
case sortOrder
case modifiedDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
id = try container.decodeIfPresent(Int.self, forKey: .id)
value = try container.decodeIfPresent(String.self, forKey: .value)
active = try container.decodeIfPresent(Bool.self, forKey: .active)
sortOrder = try container.decodeIfPresent(Int16.self, forKey: .sortOrder)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if id != nil { try container.encode(id, forKey: .id) }
if value != nil { try container.encode(value, forKey: .value) }
if active != nil { try container.encode(active, forKey: .active) }
if sortOrder != nil { try container.encode(sortOrder, forKey: .sortOrder) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
}
}
public class CustomField : BaseModel
{
// @Required()
public var table:String?
// @Required()
public var column:String?
// @Required()
public var dataType:String?
// @Required()
public var Description:String?
// @Required()
public var active:Bool?
public var modifiedDate:Date?
public var id:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case table
case column
case dataType
case Description
case active
case modifiedDate
case id
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
table = try container.decodeIfPresent(String.self, forKey: .table)
column = try container.decodeIfPresent(String.self, forKey: .column)
dataType = try container.decodeIfPresent(String.self, forKey: .dataType)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
active = try container.decodeIfPresent(Bool.self, forKey: .active)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if table != nil { try container.encode(table, forKey: .table) }
if column != nil { try container.encode(column, forKey: .column) }
if dataType != nil { try container.encode(dataType, forKey: .dataType) }
if Description != nil { try container.encode(Description, forKey: .Description) }
if active != nil { try container.encode(active, forKey: .active) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class RegEx : BaseModel
{
// @Required()
public var name:String?
// @Required()
public var Description:String?
// @Required()
public var regExCode:String?
public var errorMessage:String
public var modifiedDate:Date?
public var id:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case Description
case regExCode
case errorMessage
case modifiedDate
case id
}
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)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
regExCode = try container.decodeIfPresent(String.self, forKey: .regExCode)
errorMessage = try container.decodeIfPresent(String.self, forKey: .errorMessage)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 Description != nil { try container.encode(Description, forKey: .Description) }
if regExCode != nil { try container.encode(regExCode, forKey: .regExCode) }
if errorMessage != nil { try container.encode(errorMessage, forKey: .errorMessage) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class CustomFieldServiceRelation : BaseModel
{
// @Required()
public var companyId:String?
public var id:Int
// @Required()
public var customFieldConfigId:Int?
// @Required()
public var serviceId:Int?
public var modifiedDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case companyId
case id
case customFieldConfigId
case serviceId
case modifiedDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
id = try container.decodeIfPresent(Int.self, forKey: .id)
customFieldConfigId = try container.decodeIfPresent(Int.self, forKey: .customFieldConfigId)
serviceId = try container.decodeIfPresent(Int.self, forKey: .serviceId)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if id != nil { try container.encode(id, forKey: .id) }
if customFieldConfigId != nil { try container.encode(customFieldConfigId, forKey: .customFieldConfigId) }
if serviceId != nil { try container.encode(serviceId, forKey: .serviceId) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
}
}
public class CustomFieldDataResponse : Codable
{
public var id:Int
public var column:String
public var name:String
public var Description:String
public var value:String
/**
* Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'
*/
// @ApiMember(Description="Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'")
public var dataType:String
required public init(){}
}
public class TotalPriceInformation : Codable
{
public var totalPrice:Double
public var totalVATAmount:Double
public var totalRebate:Double
public var totalPriceBeforeRebate:Double
public var appliedCodes:[AppliedRebateCodes] = []
public var priceSign:String
public var currencyId:String
public var vat:Double
required public init(){}
}
public class AppliedRebateCodes : Codable
{
public var rebateCodeId:Int
public var rebateCodeSign:String
public var rebateCodeValue:Int
public var rebateAmount:Double
public var rebateCodeType:RebateCodeType
required public init(){}
}
public class RebateCodeType : BaseModel
{
// @Required()
public var name:String?
public var Description:String
public var modifiedDate:Date?
public var id:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case Description
case modifiedDate
case id
}
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)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 Description != nil { try container.encode(Description, forKey: .Description) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class ServicePrice : BaseModel, IInterval
{
// @References(typeof(Currency))
public var currencyId:String
public var currencyInfo:Currency
// @Ignore()
public var service:Service
// @Ignore()
public var priceMappings:[PriceMapping] = []
// @Ignore()
public var isTimeSpecific:Bool
// @Ignore()
public var isDaysOfWeekSpecific:Bool
public var dayOfWeeks:[ServicePriceDayOfWeekRelation] = []
// @Ignore()
public var priceBeforeRebate:Double?
// @Ignore()
public var rebateCodesApplied:[RebateCode] = []
// @Ignore()
public var priceText:String
// @Ignore()
public var overlappingPrices:[ServicePrice] = []
// @Required()
public var companyId:String?
public var id:Int
// @Required()
public var serviceId:Int?
public var price:Double?
// @Required()
public var updated:Date?
// @Required()
public var created:Date?
// @Required()
@TimeSpan public var fromTime:TimeInterval?
// @Required()
@TimeSpan public var toTime:TimeInterval?
// @Required()
public var vat:Double?
public var category:String
public var modifiedDate:Date?
// @Required()
public var from:Date?
// @Required()
public var to:Date?
// @Required()
public var calculationTypeId:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case currencyId
case currencyInfo
case service
case priceMappings
case isTimeSpecific
case isDaysOfWeekSpecific
case dayOfWeeks
case priceBeforeRebate
case rebateCodesApplied
case priceText
case overlappingPrices
case companyId
case id
case serviceId
case price
case updated
case created
case fromTime
case toTime
case vat
case category
case modifiedDate
case from
case to
case calculationTypeId
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
currencyId = try container.decodeIfPresent(String.self, forKey: .currencyId)
currencyInfo = try container.decodeIfPresent(Currency.self, forKey: .currencyInfo)
service = try container.decodeIfPresent(Service.self, forKey: .service)
priceMappings = try container.decodeIfPresent([PriceMapping].self, forKey: .priceMappings) ?? []
isTimeSpecific = try container.decodeIfPresent(Bool.self, forKey: .isTimeSpecific)
isDaysOfWeekSpecific = try container.decodeIfPresent(Bool.self, forKey: .isDaysOfWeekSpecific)
dayOfWeeks = try container.decodeIfPresent([ServicePriceDayOfWeekRelation].self, forKey: .dayOfWeeks) ?? []
priceBeforeRebate = try container.decodeIfPresent(Double.self, forKey: .priceBeforeRebate)
rebateCodesApplied = try container.decodeIfPresent([RebateCode].self, forKey: .rebateCodesApplied) ?? []
priceText = try container.decodeIfPresent(String.self, forKey: .priceText)
overlappingPrices = try container.decodeIfPresent([ServicePrice].self, forKey: .overlappingPrices) ?? []
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
id = try container.decodeIfPresent(Int.self, forKey: .id)
serviceId = try container.decodeIfPresent(Int.self, forKey: .serviceId)
price = try container.decodeIfPresent(Double.self, forKey: .price)
updated = try container.decodeIfPresent(Date.self, forKey: .updated)
created = try container.decodeIfPresent(Date.self, forKey: .created)
fromTime = try container.convertIfPresent(TimeInterval.self, forKey: .fromTime)
toTime = try container.convertIfPresent(TimeInterval.self, forKey: .toTime)
vat = try container.decodeIfPresent(Double.self, forKey: .vat)
category = try container.decodeIfPresent(String.self, forKey: .category)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
from = try container.decodeIfPresent(Date.self, forKey: .from)
to = try container.decodeIfPresent(Date.self, forKey: .to)
calculationTypeId = try container.decodeIfPresent(Int.self, forKey: .calculationTypeId)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if currencyId != nil { try container.encode(currencyId, forKey: .currencyId) }
if currencyInfo != nil { try container.encode(currencyInfo, forKey: .currencyInfo) }
if service != nil { try container.encode(service, forKey: .service) }
if priceMappings.count > 0 { try container.encode(priceMappings, forKey: .priceMappings) }
if isTimeSpecific != nil { try container.encode(isTimeSpecific, forKey: .isTimeSpecific) }
if isDaysOfWeekSpecific != nil { try container.encode(isDaysOfWeekSpecific, forKey: .isDaysOfWeekSpecific) }
if dayOfWeeks.count > 0 { try container.encode(dayOfWeeks, forKey: .dayOfWeeks) }
if priceBeforeRebate != nil { try container.encode(priceBeforeRebate, forKey: .priceBeforeRebate) }
if rebateCodesApplied.count > 0 { try container.encode(rebateCodesApplied, forKey: .rebateCodesApplied) }
if priceText != nil { try container.encode(priceText, forKey: .priceText) }
if overlappingPrices.count > 0 { try container.encode(overlappingPrices, forKey: .overlappingPrices) }
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if id != nil { try container.encode(id, forKey: .id) }
if serviceId != nil { try container.encode(serviceId, forKey: .serviceId) }
if price != nil { try container.encode(price, forKey: .price) }
if updated != nil { try container.encode(updated, forKey: .updated) }
if created != nil { try container.encode(created, forKey: .created) }
if fromTime != nil { try container.encode(fromTime, forKey: .fromTime) }
if toTime != nil { try container.encode(toTime, forKey: .toTime) }
if vat != nil { try container.encode(vat, forKey: .vat) }
if category != nil { try container.encode(category, forKey: .category) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if from != nil { try container.encode(from, forKey: .from) }
if to != nil { try container.encode(to, forKey: .to) }
if calculationTypeId != nil { try container.encode(calculationTypeId, forKey: .calculationTypeId) }
}
}
public class Currency : BaseModel
{
// @Required()
public var name:String?
// @Required()
public var currencySign:String?
// @Required()
public var active:Bool?
public var modifiedDate:Date?
// @Required()
public var id:String?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case currencySign
case active
case modifiedDate
case id
}
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)
currencySign = try container.decodeIfPresent(String.self, forKey: .currencySign)
active = try container.decodeIfPresent(Bool.self, forKey: .active)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(String.self, forKey: .id)
}
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 currencySign != nil { try container.encode(currencySign, forKey: .currencySign) }
if active != nil { try container.encode(active, forKey: .active) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class PriceMapping : BaseModel
{
// @Required()
public var companyId:String?
// @Required()
public var id:String?
// @Required()
public var priceId:Int?
public var referenceType:String
public var externalReference:String
// @Required()
public var updatedDate:Date?
// @Required()
public var createdDate:Date?
public var modifiedDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case companyId
case id
case priceId
case referenceType
case externalReference
case updatedDate
case createdDate
case modifiedDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
id = try container.decodeIfPresent(String.self, forKey: .id)
priceId = try container.decodeIfPresent(Int.self, forKey: .priceId)
referenceType = try container.decodeIfPresent(String.self, forKey: .referenceType)
externalReference = try container.decodeIfPresent(String.self, forKey: .externalReference)
updatedDate = try container.decodeIfPresent(Date.self, forKey: .updatedDate)
createdDate = try container.decodeIfPresent(Date.self, forKey: .createdDate)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if id != nil { try container.encode(id, forKey: .id) }
if priceId != nil { try container.encode(priceId, forKey: .priceId) }
if referenceType != nil { try container.encode(referenceType, forKey: .referenceType) }
if externalReference != nil { try container.encode(externalReference, forKey: .externalReference) }
if updatedDate != nil { try container.encode(updatedDate, forKey: .updatedDate) }
if createdDate != nil { try container.encode(createdDate, forKey: .createdDate) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
}
}
public class ServicePriceDayOfWeekRelation : BaseModel
{
// @Ignore()
public var dayOfWeek:BokaMeraDayOfWeek
// @Required()
public var companyId:String?
// @Required()
public var servicePriceId:Int?
// @Required()
public var dayOfWeekId:Int?
public var modifiedDate:Date?
public var id:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case dayOfWeek
case companyId
case servicePriceId
case dayOfWeekId
case modifiedDate
case id
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
dayOfWeek = try container.decodeIfPresent(BokaMeraDayOfWeek.self, forKey: .dayOfWeek)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
servicePriceId = try container.decodeIfPresent(Int.self, forKey: .servicePriceId)
dayOfWeekId = try container.decodeIfPresent(Int.self, forKey: .dayOfWeekId)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if dayOfWeek != nil { try container.encode(dayOfWeek, forKey: .dayOfWeek) }
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if servicePriceId != nil { try container.encode(servicePriceId, forKey: .servicePriceId) }
if dayOfWeekId != nil { try container.encode(dayOfWeekId, forKey: .dayOfWeekId) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public enum BokaMeraDayOfWeek : Int, Codable
{
case Monday = 1
case Tuesday = 2
case Wednesday = 3
case Thursday = 4
case Friday = 5
case Saturday = 6
case Sunday = 7
}
public class RebateCode : PayableEntity
{
// @References(typeof(RebateCodeType))
public var rebateCodeTypeId:Int
public var rebateCodeTypeInfo:RebateCodeType
// @References(typeof(RebateCodeStatus))
public var rebateCodeStatusId:Int
public var rebateCodeStatusInfo:RebateCodeStatus
// @Ignore()
public var article:Article
// @Ignore()
public var services:[Service] = []
public var rebateCodeDayOfWeekRelation:[RebateCodeDayOfWeekRelation] = []
public var rebateCodeServiceRelation:[RebateCodeServiceRelation] = []
public var rebateCodeBookingPriceRelation:[RebateCodeBookingPriceRelation] = []
public var rebateCodeCustomerRelation:[RebateCodeCustomerRelation] = []
// @Ignore()
public var servicesNames:String
// @Ignore()
public var daysOfWeek:[DaysOfWeek] = []
// @Ignore()
public var rebateCodeStatus:RebateCodeStatus
// @Ignore()
public var rebateCodeType:RebateCodeType
// @Ignore()
public var transactions:[RebateCodeTransaction] = []
// @Ignore()
public var remainingAmount:Double?
// @Ignore()
public var remainingUsage:Int?
// @Ignore()
public var currentNumberOfUsesPerCustomer:Int
// @Ignore()
public var isSpecificByDayOfWeek:Bool
// @Ignore()
public var active:Bool
// @Ignore()
public var activeByStatus:Bool
// @Ignore()
public var rebateCodeCurrencySign:String
public var currencyInfo:Currency
// @Ignore()
public var paymentReceived:Bool
// @Ignore()
public var internalReferenceId:String
// @Required()
public var validFrom:Date?
// @Required()
public var validTo:Date?
// @Required()
public var rebateCodeSign:String?
// @Required()
public var rebateCodeValue:Int?
// @Required()
public var maxNumberOfUses:Int?
// @Required()
public var maxNumberOfUsesPerCustomer:Int?
// @Required()
public var numberOfUsesUsed:Int?
public var personalNote:String
// @Required()
public var createdBy:String?
// @Required()
public var created:Date?
// @Required()
public var updatedBy:String?
// @Required()
public var updatedDate:Date?
// @Required()
@TimeSpan public var fromTime:TimeInterval?
// @Required()
@TimeSpan public var toTime:TimeInterval?
public var modifiedDate:Date?
public var id:Int
public var articleId:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case rebateCodeTypeId
case rebateCodeTypeInfo
case rebateCodeStatusId
case rebateCodeStatusInfo
case article
case services
case rebateCodeDayOfWeekRelation
case rebateCodeServiceRelation
case rebateCodeBookingPriceRelation
case rebateCodeCustomerRelation
case servicesNames
case daysOfWeek
case rebateCodeStatus
case rebateCodeType
case transactions
case remainingAmount
case remainingUsage
case currentNumberOfUsesPerCustomer
case isSpecificByDayOfWeek
case active
case activeByStatus
case rebateCodeCurrencySign
case currencyInfo
case paymentReceived
case internalReferenceId
case validFrom
case validTo
case rebateCodeSign
case rebateCodeValue
case maxNumberOfUses
case maxNumberOfUsesPerCustomer
case numberOfUsesUsed
case personalNote
case createdBy
case created
case updatedBy
case updatedDate
case fromTime
case toTime
case modifiedDate
case id
case articleId
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
rebateCodeTypeId = try container.decodeIfPresent(Int.self, forKey: .rebateCodeTypeId)
rebateCodeTypeInfo = try container.decodeIfPresent(RebateCodeType.self, forKey: .rebateCodeTypeInfo)
rebateCodeStatusId = try container.decodeIfPresent(Int.self, forKey: .rebateCodeStatusId)
rebateCodeStatusInfo = try container.decodeIfPresent(RebateCodeStatus.self, forKey: .rebateCodeStatusInfo)
article = try container.decodeIfPresent(Article.self, forKey: .article)
services = try container.decodeIfPresent([Service].self, forKey: .services) ?? []
rebateCodeDayOfWeekRelation = try container.decodeIfPresent([RebateCodeDayOfWeekRelation].self, forKey: .rebateCodeDayOfWeekRelation) ?? []
rebateCodeServiceRelation = try container.decodeIfPresent([RebateCodeServiceRelation].self, forKey: .rebateCodeServiceRelation) ?? []
rebateCodeBookingPriceRelation = try container.decodeIfPresent([RebateCodeBookingPriceRelation].self, forKey: .rebateCodeBookingPriceRelation) ?? []
rebateCodeCustomerRelation = try container.decodeIfPresent([RebateCodeCustomerRelation].self, forKey: .rebateCodeCustomerRelation) ?? []
servicesNames = try container.decodeIfPresent(String.self, forKey: .servicesNames)
daysOfWeek = try container.decodeIfPresent([DaysOfWeek].self, forKey: .daysOfWeek) ?? []
rebateCodeStatus = try container.decodeIfPresent(RebateCodeStatus.self, forKey: .rebateCodeStatus)
rebateCodeType = try container.decodeIfPresent(RebateCodeType.self, forKey: .rebateCodeType)
transactions = try container.decodeIfPresent([RebateCodeTransaction].self, forKey: .transactions) ?? []
remainingAmount = try container.decodeIfPresent(Double.self, forKey: .remainingAmount)
remainingUsage = try container.decodeIfPresent(Int.self, forKey: .remainingUsage)
currentNumberOfUsesPerCustomer = try container.decodeIfPresent(Int.self, forKey: .currentNumberOfUsesPerCustomer)
isSpecificByDayOfWeek = try container.decodeIfPresent(Bool.self, forKey: .isSpecificByDayOfWeek)
active = try container.decodeIfPresent(Bool.self, forKey: .active)
activeByStatus = try container.decodeIfPresent(Bool.self, forKey: .activeByStatus)
rebateCodeCurrencySign = try container.decodeIfPresent(String.self, forKey: .rebateCodeCurrencySign)
currencyInfo = try container.decodeIfPresent(Currency.self, forKey: .currencyInfo)
paymentReceived = try container.decodeIfPresent(Bool.self, forKey: .paymentReceived)
internalReferenceId = try container.decodeIfPresent(String.self, forKey: .internalReferenceId)
validFrom = try container.decodeIfPresent(Date.self, forKey: .validFrom)
validTo = try container.decodeIfPresent(Date.self, forKey: .validTo)
rebateCodeSign = try container.decodeIfPresent(String.self, forKey: .rebateCodeSign)
rebateCodeValue = try container.decodeIfPresent(Int.self, forKey: .rebateCodeValue)
maxNumberOfUses = try container.decodeIfPresent(Int.self, forKey: .maxNumberOfUses)
maxNumberOfUsesPerCustomer = try container.decodeIfPresent(Int.self, forKey: .maxNumberOfUsesPerCustomer)
numberOfUsesUsed = try container.decodeIfPresent(Int.self, forKey: .numberOfUsesUsed)
personalNote = try container.decodeIfPresent(String.self, forKey: .personalNote)
createdBy = try container.decodeIfPresent(String.self, forKey: .createdBy)
created = try container.decodeIfPresent(Date.self, forKey: .created)
updatedBy = try container.decodeIfPresent(String.self, forKey: .updatedBy)
updatedDate = try container.decodeIfPresent(Date.self, forKey: .updatedDate)
fromTime = try container.convertIfPresent(TimeInterval.self, forKey: .fromTime)
toTime = try container.convertIfPresent(TimeInterval.self, forKey: .toTime)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
articleId = try container.decodeIfPresent(Int.self, forKey: .articleId)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if rebateCodeTypeId != nil { try container.encode(rebateCodeTypeId, forKey: .rebateCodeTypeId) }
if rebateCodeTypeInfo != nil { try container.encode(rebateCodeTypeInfo, forKey: .rebateCodeTypeInfo) }
if rebateCodeStatusId != nil { try container.encode(rebateCodeStatusId, forKey: .rebateCodeStatusId) }
if rebateCodeStatusInfo != nil { try container.encode(rebateCodeStatusInfo, forKey: .rebateCodeStatusInfo) }
if article != nil { try container.encode(article, forKey: .article) }
if services.count > 0 { try container.encode(services, forKey: .services) }
if rebateCodeDayOfWeekRelation.count > 0 { try container.encode(rebateCodeDayOfWeekRelation, forKey: .rebateCodeDayOfWeekRelation) }
if rebateCodeServiceRelation.count > 0 { try container.encode(rebateCodeServiceRelation, forKey: .rebateCodeServiceRelation) }
if rebateCodeBookingPriceRelation.count > 0 { try container.encode(rebateCodeBookingPriceRelation, forKey: .rebateCodeBookingPriceRelation) }
if rebateCodeCustomerRelation.count > 0 { try container.encode(rebateCodeCustomerRelation, forKey: .rebateCodeCustomerRelation) }
if servicesNames != nil { try container.encode(servicesNames, forKey: .servicesNames) }
if daysOfWeek.count > 0 { try container.encode(daysOfWeek, forKey: .daysOfWeek) }
if rebateCodeStatus != nil { try container.encode(rebateCodeStatus, forKey: .rebateCodeStatus) }
if rebateCodeType != nil { try container.encode(rebateCodeType, forKey: .rebateCodeType) }
if transactions.count > 0 { try container.encode(transactions, forKey: .transactions) }
if remainingAmount != nil { try container.encode(remainingAmount, forKey: .remainingAmount) }
if remainingUsage != nil { try container.encode(remainingUsage, forKey: .remainingUsage) }
if currentNumberOfUsesPerCustomer != nil { try container.encode(currentNumberOfUsesPerCustomer, forKey: .currentNumberOfUsesPerCustomer) }
if isSpecificByDayOfWeek != nil { try container.encode(isSpecificByDayOfWeek, forKey: .isSpecificByDayOfWeek) }
if active != nil { try container.encode(active, forKey: .active) }
if activeByStatus != nil { try container.encode(activeByStatus, forKey: .activeByStatus) }
if rebateCodeCurrencySign != nil { try container.encode(rebateCodeCurrencySign, forKey: .rebateCodeCurrencySign) }
if currencyInfo != nil { try container.encode(currencyInfo, forKey: .currencyInfo) }
if paymentReceived != nil { try container.encode(paymentReceived, forKey: .paymentReceived) }
if internalReferenceId != nil { try container.encode(internalReferenceId, forKey: .internalReferenceId) }
if validFrom != nil { try container.encode(validFrom, forKey: .validFrom) }
if validTo != nil { try container.encode(validTo, forKey: .validTo) }
if rebateCodeSign != nil { try container.encode(rebateCodeSign, forKey: .rebateCodeSign) }
if rebateCodeValue != nil { try container.encode(rebateCodeValue, forKey: .rebateCodeValue) }
if maxNumberOfUses != nil { try container.encode(maxNumberOfUses, forKey: .maxNumberOfUses) }
if maxNumberOfUsesPerCustomer != nil { try container.encode(maxNumberOfUsesPerCustomer, forKey: .maxNumberOfUsesPerCustomer) }
if numberOfUsesUsed != nil { try container.encode(numberOfUsesUsed, forKey: .numberOfUsesUsed) }
if personalNote != nil { try container.encode(personalNote, forKey: .personalNote) }
if createdBy != nil { try container.encode(createdBy, forKey: .createdBy) }
if created != nil { try container.encode(created, forKey: .created) }
if updatedBy != nil { try container.encode(updatedBy, forKey: .updatedBy) }
if updatedDate != nil { try container.encode(updatedDate, forKey: .updatedDate) }
if fromTime != nil { try container.encode(fromTime, forKey: .fromTime) }
if toTime != nil { try container.encode(toTime, forKey: .toTime) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
if articleId != nil { try container.encode(articleId, forKey: .articleId) }
}
}
public class PayableEntity : BaseModel
{
//dbFactory:IDbConnectionFactory ignored. Swift doesn't support interface properties
//qvicklyPaymentManager:IBokameraPaymentManager<InitCheckoutRequestBody, QvicklyCheckoutResponse, QvicklyPaymentResponse> ignored. Swift doesn't support interface properties
//payson2PaymentManager:IBokameraPaymentManager<Payson2CheckoutResponse, Payson2CheckoutResponse, Payson2CheckoutResponse> ignored. Swift doesn't support interface properties
//stripePaymentManager:IBokameraPaymentManager<SessionCreateOptions, CustomSessionData, CustomSessionData> ignored. Swift doesn't support interface properties
//paysonPaymentCheckout1:IPaysonPaymentCheckout1 ignored. Swift doesn't support interface properties
//logger:ILogger<PayableEntity> ignored. Swift doesn't support interface properties
// @Ignore()
public var internalReferenceId:String
// @Ignore()
public var paymentLog:[PaymentLog] = []
public var companyId:String
public var priceVat:Double?
// @References(typeof(Currency))
public var currencyId:String
// @Ignore()
public var customer:Customer
// @Ignore()
public var customers:[Customer] = []
// @Ignore()
public var company:Company
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case dbFactory
case qvicklyPaymentManager
case payson2PaymentManager
case stripePaymentManager
case paysonPaymentCheckout1
case logger
case internalReferenceId
case paymentLog
case companyId
case priceVat
case currencyId
case customer
case customers
case company
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
dbFactory = try container.decodeIfPresent(IDbConnectionFactory.self, forKey: .dbFactory)
qvicklyPaymentManager = try container.decodeIfPresent(IBokameraPaymentManager<InitCheckoutRequestBody, QvicklyCheckoutResponse, QvicklyPaymentResponse>.self, forKey: .qvicklyPaymentManager)
payson2PaymentManager = try container.decodeIfPresent(IBokameraPaymentManager<Payson2CheckoutResponse, Payson2CheckoutResponse, Payson2CheckoutResponse>.self, forKey: .payson2PaymentManager)
stripePaymentManager = try container.decodeIfPresent(IBokameraPaymentManager<SessionCreateOptions, CustomSessionData, CustomSessionData>.self, forKey: .stripePaymentManager)
paysonPaymentCheckout1 = try container.decodeIfPresent(IPaysonPaymentCheckout1.self, forKey: .paysonPaymentCheckout1)
logger = try container.decodeIfPresent(ILogger<PayableEntity>.self, forKey: .logger)
internalReferenceId = try container.decodeIfPresent(String.self, forKey: .internalReferenceId)
paymentLog = try container.decodeIfPresent([PaymentLog].self, forKey: .paymentLog) ?? []
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
priceVat = try container.decodeIfPresent(Double.self, forKey: .priceVat)
currencyId = try container.decodeIfPresent(String.self, forKey: .currencyId)
customer = try container.decodeIfPresent(Customer.self, forKey: .customer)
customers = try container.decodeIfPresent([Customer].self, forKey: .customers) ?? []
company = try container.decodeIfPresent(Company.self, forKey: .company)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if dbFactory != nil { try container.encode(dbFactory, forKey: .dbFactory) }
if qvicklyPaymentManager != nil { try container.encode(qvicklyPaymentManager, forKey: .qvicklyPaymentManager) }
if payson2PaymentManager != nil { try container.encode(payson2PaymentManager, forKey: .payson2PaymentManager) }
if stripePaymentManager != nil { try container.encode(stripePaymentManager, forKey: .stripePaymentManager) }
if paysonPaymentCheckout1 != nil { try container.encode(paysonPaymentCheckout1, forKey: .paysonPaymentCheckout1) }
if logger != nil { try container.encode(logger, forKey: .logger) }
if internalReferenceId != nil { try container.encode(internalReferenceId, forKey: .internalReferenceId) }
if paymentLog.count > 0 { try container.encode(paymentLog, forKey: .paymentLog) }
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if priceVat != nil { try container.encode(priceVat, forKey: .priceVat) }
if currencyId != nil { try container.encode(currencyId, forKey: .currencyId) }
if customer != nil { try container.encode(customer, forKey: .customer) }
if customers.count > 0 { try container.encode(customers, forKey: .customers) }
if company != nil { try container.encode(company, forKey: .company) }
}
}
public protocol IDbConnectionFactory
{
}
public protocol IBokameraPaymentManager
{
associatedtype TCreatedCheckoutResponse
associatedtype TCheckoutResponse
associatedtype TPaymentResponse
}
public class InitCheckoutRequestBody : Codable
{
public var credentials:Credentials
public var data:InitCheckoutData
public var function:String
required public init(){}
}
public class Credentials : Codable
{
public var hash:String
public var id:String
public var version:String
public var client:String
public var serverdata:ServerData
public var time:String
public var test:String
public var language:String
required public init(){}
}
public class ServerData : Codable
{
public var httP_HOST:String
public var httP_CONNECTION:String
public var httP_CACHE_CONTROL:String
public var httP_ACCEPT:String
public var httP_USER_AGENT:String
public var httP_ACCEPT_ENCODING:String
public var httP_ACCEPT_LANGUAGE:String
public var path:String
public var serveR_SOFTWARE:String
public var serveR_NAME:String
public var serveR_ADDR:String
public var serveR_PORT:String
public var remotE_ADDR:String
public var remotE_PORT:String
public var gatewaY_INTERFACE:String
public var serveR_PROTOCOL:String
public var requesT_METHOD:String
public var querY_STRING:String
public var requesT_TIME:String
required public init(){}
}
public class InitCheckoutData : Codable
{
public var checkoutData:CheckoutData
public var paymentData:CheckoutPaymentData
public var paymentInfo:PaymentInfo
public var articles:[QvicklyArticle] = []
public var cart:Cart
public var qvicklyCustomer:QvicklyCustomer
required public init(){}
}
public class CheckoutData : Codable
{
public var terms:Uri
public var privacyPolicy:Uri
public var redirectOnSuccess:String
required public init(){}
}
public class CheckoutPaymentData : Codable
{
public var currency:String
public var language:String
public var country:String
public var autoactivate:String
public var orderid:String
public var returnmethod:String
public var accepturl:Uri
public var cancelurl:Uri
public var callbackurl:Uri
required public init(){}
}
public class PaymentInfo : Codable
{
public var paymentdate:String
public var paymentterms:String
public var yourreference:String
public var ourreference:String
public var projectname:String
public var deliverymethod:String
public var deliveryterms:String
required public init(){}
}
public class QvicklyArticle : Codable
{
public var artnr:String
public var title:String
public var quantity:Int
public var aprice:Int
public var tax:Int
public var discount:Int
public var withouttax:Int
public var taxrate:Int
required public init(){}
}
public class Cart : Codable
{
public var handling:CartHandling
public var total:CartTotal
public var shipping:Shipping
required public init(){}
}
public class CartHandling : Codable
{
public var withouttax:String
public var taxrate:String
required public init(){}
}
public class CartTotal : Codable
{
public var rounding:String
public var withouttax:String
public var tax:String
public var withtax:String
required public init(){}
}
public class Shipping : Codable
{
public var firstname:String
public var lastname:String
public var company:String
public var street:String
public var street2:String
public var zip:String
public var city:String
public var country:String
public var phone:String
public var withouttax:String
public var taxrate:String
required public init(){}
}
public class QvicklyCustomer : Codable
{
public var nr:String
public var pno:String
public var billing:CustomerBilling
required public init(){}
}
public class CustomerBilling : Codable
{
public var firstname:String
public var lastname:String
public var company:String
public var street:String
public var street2:String
public var zip:String
public var city:String
public var country:String
public var phone:String
public var email:String
required public init(){}
}
public class QvicklyCheckoutResponse : Codable
{
public var number:Int
public var status:String
public var orderId:String
public var url:String
required public init(){}
}
public class QvicklyPaymentResponse : Codable
{
public var paymentData:QvikclyPaymentData
public var paymentInfo:PaymentInfo
public var card:Card
public var settlement:Settlement
public var qvicklyCustomer:QvicklyCustomer
public var articles:[QvicklyArticle] = []
public var cart:Cart
required public init(){}
}
public class QvikclyPaymentData : Codable
{
public var method:String
public var paymentplanid:String
public var currency:String
public var country:String
public var language:String
public var autoactivate:String
public var orderid:String
public var status:String
public var paymentid_related:String
public var url:String
required public init(){}
}
public class Card : Codable
{
public var promptname:String
public var recurring:String
public var recurringnr:String
public var accepturl:String
public var cancelurl:String
public var callbackurl:String
public var returnmethod:String
required public init(){}
}
public class Settlement : Codable
{
public var number:String
public var date:String
required public init(){}
}
public class Payson2CheckoutResponse : Codable
{
public var id:String
public var expirationTime:Date?
public var snippet:String
public var status:Payson2CheckoutStatus
public var customer:Customer
public var order:Order
public var merchant:Merchant
public var gui:Gui
public var history:History
public var purchaseId:Int?
required public init(){}
}
public enum Payson2CheckoutStatus : String, Codable
{
case None
case Created
case FormsFilled
case ReadyToPay
case ProcessingPayment
case ReadyToShip
case Shipped
case PaidToAccount
case Canceled
case Credited
case Expired
case Denied
}
public class Customer : Codable
{
public var city:String
public var countryCode:String
public var identityNumber:String
public var email:String
public var firstName:String
public var lastName:String
public var phone:String
public var postalCode:String
public var street:String
public var reference:String
public var type:CustomerType
required public init(){}
}
public enum CustomerType : String, Codable
{
case Person
case Business
}
public class Order : Codable
{
public var currency:Currency
public var totalFeeExcludingTax:Double
public var totalFeeIncludingTax:Double
public var totalPriceExcludingTax:Double
public var totalPriceIncludingTax:Double
public var totalTaxAmount:Double
public var totalCreditedAmount:Double
public var items:IList<Item>
required public init(){}
}
public enum Currency : Int, Codable
{
case SEK = 1
case EUR = 2
}
public class Item : Codable
{
public var itemId:String
public var discountRate:Double
public var ean:String
public var imageUri:Uri
public var name:String
public var quantity:Double
public var reference:String
public var taxRate:Double
public var totalPriceExcludingTax:Double
public var totalPriceIncludingTax:Double
public var totalTaxAmount:Double
public var creditedAmount:Double
public var type:ItemType
public var unitPrice:Double
public var uri:Uri
required public init(){}
}
public enum ItemType : String, Codable
{
case Physical
case Service
case Fee
case Discount
}
public class Merchant : Codable
{
public var checkoutUri:Uri
public var confirmationUri:Uri
public var notificationUri:Uri
public var validationUri:Uri
public var termsUri:Uri
public var reference:String
public var partnerId:String
required public init(){}
}
public class Gui : Codable
{
public var colorScheme:ColorScheme
public var locale:String
public var requestPhone:Bool
public var phoneOptional:Bool
required public init(){}
}
public enum ColorScheme : String, Codable
{
case White
case Blue
case Gray
case GrayTextLogos
case BlueTextLogos
case WhiteTextLogos
case WhiteNoFooter
case GrayNoFooter
case BlueNoFooter
}
public class History : Codable
{
public var created:Date?
public var readyToPay:Date?
public var readyToShip:Date?
public var shipped:Date?
public var paidToAccount:Date?
public var canceled:Date?
public var expired:Date?
public var denied:Date?
required public init(){}
}
public class SessionCreateOptions : BaseOptions, IHasMetadata
{
public var afterExpiration:SessionAfterExpirationOptions
public var allowPromotionCodes:Bool?
public var automaticTax:SessionAutomaticTaxOptions
public var billingAddressCollection:String
public var cancelUrl:String
public var clientReferenceId:String
public var consentCollection:SessionConsentCollectionOptions
public var currency:String
public var customFields:[SessionCustomFieldOptions] = []
public var customText:SessionCustomTextOptions
public var customer:String
public var customerCreation:String
public var customerEmail:String
public var customerUpdate:SessionCustomerUpdateOptions
public var discounts:[SessionDiscountOptions] = []
public var expiresAt:Date?
public var invoiceCreation:SessionInvoiceCreationOptions
public var lineItems:[SessionLineItemOptions] = []
public var locale:String
public var metadata:[String:String] = [:]
public var mode:String
public var paymentIntentData:SessionPaymentIntentDataOptions
public var paymentMethodCollection:String
public var paymentMethodConfiguration:String
public var paymentMethodData:SessionPaymentMethodDataOptions
public var paymentMethodOptions:SessionPaymentMethodOptionsOptions
public var paymentMethodTypes:[String] = []
public var phoneNumberCollection:SessionPhoneNumberCollectionOptions
public var redirectOnCompletion:String
public var returnUrl:String
public var savedPaymentMethodOptions:SessionSavedPaymentMethodOptionsOptions
public var setupIntentData:SessionSetupIntentDataOptions
public var shippingAddressCollection:SessionShippingAddressCollectionOptions
public var shippingOptions:[SessionShippingOptionOptions] = []
public var submitType:String
public var subscriptionData:SessionSubscriptionDataOptions
public var successUrl:String
public var taxIdCollection:SessionTaxIdCollectionOptions
public var uiMode:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case afterExpiration
case allowPromotionCodes
case automaticTax
case billingAddressCollection
case cancelUrl
case clientReferenceId
case consentCollection
case currency
case customFields
case customText
case customer
case customerCreation
case customerEmail
case customerUpdate
case discounts
case expiresAt
case invoiceCreation
case lineItems
case locale
case metadata
case mode
case paymentIntentData
case paymentMethodCollection
case paymentMethodConfiguration
case paymentMethodData
case paymentMethodOptions
case paymentMethodTypes
case phoneNumberCollection
case redirectOnCompletion
case returnUrl
case savedPaymentMethodOptions
case setupIntentData
case shippingAddressCollection
case shippingOptions
case submitType
case subscriptionData
case successUrl
case taxIdCollection
case uiMode
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
afterExpiration = try container.decodeIfPresent(SessionAfterExpirationOptions.self, forKey: .afterExpiration)
allowPromotionCodes = try container.decodeIfPresent(Bool.self, forKey: .allowPromotionCodes)
automaticTax = try container.decodeIfPresent(SessionAutomaticTaxOptions.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)
consentCollection = try container.decodeIfPresent(SessionConsentCollectionOptions.self, forKey: .consentCollection)
currency = try container.decodeIfPresent(String.self, forKey: .currency)
customFields = try container.decodeIfPresent([SessionCustomFieldOptions].self, forKey: .customFields) ?? []
customText = try container.decodeIfPresent(SessionCustomTextOptions.self, forKey: .customText)
customer = try container.decodeIfPresent(String.self, forKey: .customer)
customerCreation = try container.decodeIfPresent(String.self, forKey: .customerCreation)
customerEmail = try container.decodeIfPresent(String.self, forKey: .customerEmail)
customerUpdate = try container.decodeIfPresent(SessionCustomerUpdateOptions.self, forKey: .customerUpdate)
discounts = try container.decodeIfPresent([SessionDiscountOptions].self, forKey: .discounts) ?? []
expiresAt = try container.decodeIfPresent(Date.self, forKey: .expiresAt)
invoiceCreation = try container.decodeIfPresent(SessionInvoiceCreationOptions.self, forKey: .invoiceCreation)
lineItems = try container.decodeIfPresent([SessionLineItemOptions].self, forKey: .lineItems) ?? []
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)
paymentIntentData = try container.decodeIfPresent(SessionPaymentIntentDataOptions.self, forKey: .paymentIntentData)
paymentMethodCollection = try container.decodeIfPresent(String.self, forKey: .paymentMethodCollection)
paymentMethodConfiguration = try container.decodeIfPresent(String.self, forKey: .paymentMethodConfiguration)
paymentMethodData = try container.decodeIfPresent(SessionPaymentMethodDataOptions.self, forKey: .paymentMethodData)
paymentMethodOptions = try container.decodeIfPresent(SessionPaymentMethodOptionsOptions.self, forKey: .paymentMethodOptions)
paymentMethodTypes = try container.decodeIfPresent([String].self, forKey: .paymentMethodTypes) ?? []
phoneNumberCollection = try container.decodeIfPresent(SessionPhoneNumberCollectionOptions.self, forKey: .phoneNumberCollection)
redirectOnCompletion = try container.decodeIfPresent(String.self, forKey: .redirectOnCompletion)
returnUrl = try container.decodeIfPresent(String.self, forKey: .returnUrl)
savedPaymentMethodOptions = try container.decodeIfPresent(SessionSavedPaymentMethodOptionsOptions.self, forKey: .savedPaymentMethodOptions)
setupIntentData = try container.decodeIfPresent(SessionSetupIntentDataOptions.self, forKey: .setupIntentData)
shippingAddressCollection = try container.decodeIfPresent(SessionShippingAddressCollectionOptions.self, forKey: .shippingAddressCollection)
shippingOptions = try container.decodeIfPresent([SessionShippingOptionOptions].self, forKey: .shippingOptions) ?? []
submitType = try container.decodeIfPresent(String.self, forKey: .submitType)
subscriptionData = try container.decodeIfPresent(SessionSubscriptionDataOptions.self, forKey: .subscriptionData)
successUrl = try container.decodeIfPresent(String.self, forKey: .successUrl)
taxIdCollection = try container.decodeIfPresent(SessionTaxIdCollectionOptions.self, forKey: .taxIdCollection)
uiMode = try container.decodeIfPresent(String.self, forKey: .uiMode)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if afterExpiration != nil { try container.encode(afterExpiration, forKey: .afterExpiration) }
if allowPromotionCodes != nil { try container.encode(allowPromotionCodes, forKey: .allowPromotionCodes) }
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 consentCollection != nil { try container.encode(consentCollection, forKey: .consentCollection) }
if currency != nil { try container.encode(currency, forKey: .currency) }
if customFields.count > 0 { try container.encode(customFields, forKey: .customFields) }
if customText != nil { try container.encode(customText, forKey: .customText) }
if customer != nil { try container.encode(customer, forKey: .customer) }
if customerCreation != nil { try container.encode(customerCreation, forKey: .customerCreation) }
if customerEmail != nil { try container.encode(customerEmail, forKey: .customerEmail) }
if customerUpdate != nil { try container.encode(customerUpdate, forKey: .customerUpdate) }
if discounts.count > 0 { try container.encode(discounts, forKey: .discounts) }
if expiresAt != nil { try container.encode(expiresAt, forKey: .expiresAt) }
if invoiceCreation != nil { try container.encode(invoiceCreation, forKey: .invoiceCreation) }
if lineItems.count > 0 { try container.encode(lineItems, forKey: .lineItems) }
if locale != nil { try container.encode(locale, forKey: .locale) }
if metadata.count > 0 { try container.encode(metadata, forKey: .metadata) }
if mode != nil { try container.encode(mode, forKey: .mode) }
if paymentIntentData != nil { try container.encode(paymentIntentData, forKey: .paymentIntentData) }
if paymentMethodCollection != nil { try container.encode(paymentMethodCollection, forKey: .paymentMethodCollection) }
if paymentMethodConfiguration != nil { try container.encode(paymentMethodConfiguration, forKey: .paymentMethodConfiguration) }
if paymentMethodData != nil { try container.encode(paymentMethodData, forKey: .paymentMethodData) }
if paymentMethodOptions != nil { try container.encode(paymentMethodOptions, forKey: .paymentMethodOptions) }
if paymentMethodTypes.count > 0 { try container.encode(paymentMethodTypes, forKey: .paymentMethodTypes) }
if phoneNumberCollection != nil { try container.encode(phoneNumberCollection, forKey: .phoneNumberCollection) }
if redirectOnCompletion != nil { try container.encode(redirectOnCompletion, forKey: .redirectOnCompletion) }
if returnUrl != nil { try container.encode(returnUrl, forKey: .returnUrl) }
if savedPaymentMethodOptions != nil { try container.encode(savedPaymentMethodOptions, forKey: .savedPaymentMethodOptions) }
if setupIntentData != nil { try container.encode(setupIntentData, forKey: .setupIntentData) }
if shippingAddressCollection != nil { try container.encode(shippingAddressCollection, forKey: .shippingAddressCollection) }
if shippingOptions.count > 0 { try container.encode(shippingOptions, forKey: .shippingOptions) }
if submitType != nil { try container.encode(submitType, forKey: .submitType) }
if subscriptionData != nil { try container.encode(subscriptionData, forKey: .subscriptionData) }
if successUrl != nil { try container.encode(successUrl, forKey: .successUrl) }
if taxIdCollection != nil { try container.encode(taxIdCollection, forKey: .taxIdCollection) }
if uiMode != nil { try container.encode(uiMode, forKey: .uiMode) }
}
}
public class BaseOptions : INestedOptions, Codable
{
public var expand:[String] = []
public var extraParams:[String:Object] = [:]
required public init(){}
}
public class SessionAfterExpirationOptions : INestedOptions, Codable
{
public var recovery:SessionAfterExpirationRecoveryOptions
required public init(){}
}
public class SessionAfterExpirationRecoveryOptions : INestedOptions, Codable
{
public var allowPromotionCodes:Bool?
public var enabled:Bool?
required public init(){}
}
public class SessionAutomaticTaxOptions : INestedOptions, Codable
{
public var enabled:Bool?
public var liability:SessionAutomaticTaxLiabilityOptions
required public init(){}
}
public class SessionAutomaticTaxLiabilityOptions : INestedOptions, Codable
{
public var account:String
public var type:String
required public init(){}
}
public class SessionConsentCollectionOptions : INestedOptions, Codable
{
public var paymentMethodReuseAgreement:SessionConsentCollectionPaymentMethodReuseAgreementOptions
public var promotions:String
public var termsOfService:String
required public init(){}
}
public class SessionConsentCollectionPaymentMethodReuseAgreementOptions : INestedOptions, Codable
{
public var position:String
required public init(){}
}
public class SessionCustomFieldOptions : INestedOptions, Codable
{
public var dropdown:SessionCustomFieldDropdownOptions
public var key:String
public var label:SessionCustomFieldLabelOptions
public var numeric:SessionCustomFieldNumericOptions
public var optional:Bool?
public var text:SessionCustomFieldTextOptions
public var type:String
required public init(){}
}
public class SessionCustomFieldDropdownOptions : INestedOptions, Codable
{
public var defaultValue:String
public var options:[SessionCustomFieldDropdownOptionOptions] = []
required public init(){}
}
public class SessionCustomFieldDropdownOptionOptions : INestedOptions, Codable
{
public var label:String
public var value:String
required public init(){}
}
public class SessionCustomFieldLabelOptions : INestedOptions, Codable
{
public var custom:String
public var type:String
required public init(){}
}
public class SessionCustomFieldNumericOptions : INestedOptions, Codable
{
public var defaultValue:String
public var maximumLength:Int?
public var minimumLength:Int?
required public init(){}
}
public class SessionCustomFieldTextOptions : INestedOptions, Codable
{
public var defaultValue:String
public var maximumLength:Int?
public var minimumLength:Int?
required public init(){}
}
public class SessionCustomTextOptions : INestedOptions, Codable
{
public var afterSubmit:SessionCustomTextAfterSubmitOptions
public var shippingAddress:SessionCustomTextShippingAddressOptions
public var submit:SessionCustomTextSubmitOptions
public var termsOfServiceAcceptance:SessionCustomTextTermsOfServiceAcceptanceOptions
required public init(){}
}
public class SessionCustomTextAfterSubmitOptions : INestedOptions, Codable
{
public var message:String
required public init(){}
}
public class SessionCustomTextShippingAddressOptions : INestedOptions, Codable
{
public var message:String
required public init(){}
}
public class SessionCustomTextSubmitOptions : INestedOptions, Codable
{
public var message:String
required public init(){}
}
public class SessionCustomTextTermsOfServiceAcceptanceOptions : INestedOptions, Codable
{
public var message:String
required public init(){}
}
public class SessionCustomerUpdateOptions : INestedOptions, Codable
{
public var address:String
public var name:String
public var shipping:String
required public init(){}
}
public class SessionDiscountOptions : INestedOptions, Codable
{
public var coupon:String
public var promotionCode:String
required public init(){}
}
public class SessionInvoiceCreationOptions : INestedOptions, Codable
{
public var enabled:Bool?
public var invoiceData:SessionInvoiceCreationInvoiceDataOptions
required public init(){}
}
public class SessionInvoiceCreationInvoiceDataOptions : INestedOptions, IHasMetadata, Codable
{
public var accountTaxIds:[String] = []
public var customFields:[SessionInvoiceCreationInvoiceDataCustomFieldOptions] = []
public var Description:String
public var footer:String
public var issuer:SessionInvoiceCreationInvoiceDataIssuerOptions
public var metadata:[String:String] = [:]
public var renderingOptions:SessionInvoiceCreationInvoiceDataRenderingOptionsOptions
required public init(){}
}
public class SessionInvoiceCreationInvoiceDataCustomFieldOptions : INestedOptions, Codable
{
public var name:String
public var value:String
required public init(){}
}
public class SessionInvoiceCreationInvoiceDataIssuerOptions : INestedOptions, Codable
{
public var account:String
public var type:String
required public init(){}
}
public class SessionInvoiceCreationInvoiceDataRenderingOptionsOptions : INestedOptions, Codable
{
public var amountTaxDisplay:String
required public init(){}
}
public class SessionLineItemOptions : INestedOptions, Codable
{
public var adjustableQuantity:SessionLineItemAdjustableQuantityOptions
public var dynamicTaxRates:[String] = []
public var price:String
public var priceData:SessionLineItemPriceDataOptions
public var quantity:Int?
public var taxRates:[String] = []
required public init(){}
}
public class SessionLineItemAdjustableQuantityOptions : INestedOptions, Codable
{
public var enabled:Bool?
public var maximum:Int?
public var minimum:Int?
required public init(){}
}
public class SessionLineItemPriceDataOptions : INestedOptions, Codable
{
public var currency:String
public var product:String
public var productData:SessionLineItemPriceDataProductDataOptions
public var recurring:SessionLineItemPriceDataRecurringOptions
public var taxBehavior:String
public var unitAmount:Int?
public var unitAmountDecimal:Double?
required public init(){}
}
public class SessionLineItemPriceDataProductDataOptions : INestedOptions, IHasMetadata, Codable
{
public var Description:String
public var images:[String] = []
public var metadata:[String:String] = [:]
public var name:String
public var taxCode:String
required public init(){}
}
public class SessionLineItemPriceDataRecurringOptions : INestedOptions, Codable
{
public var interval:String
public var intervalCount:Int?
required public init(){}
}
public class SessionPaymentIntentDataOptions : INestedOptions, IHasMetadata, Codable
{
public var applicationFeeAmount:Int?
public var captureMethod:String
public var Description:String
public var metadata:[String:String] = [:]
public var onBehalfOf:String
public var receiptEmail:String
public var setupFutureUsage:String
public var shipping:ChargeShippingOptions
public var statementDescriptor:String
public var statementDescriptorSuffix:String
public var transferData:SessionPaymentIntentDataTransferDataOptions
public var transferGroup:String
required public init(){}
}
public class ChargeShippingOptions : INestedOptions, Codable
{
public var address:AddressOptions
public var carrier:String
public var name:String
public var phone:String
public var trackingNumber:String
required public init(){}
}
public class AddressOptions : INestedOptions, Codable
{
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(){}
}
public class SessionPaymentIntentDataTransferDataOptions : INestedOptions, Codable
{
public var amount:Int?
public var destination:String
required public init(){}
}
public class SessionPaymentMethodDataOptions : INestedOptions, Codable
{
public var allowRedisplay:String
required public init(){}
}
public class SessionPaymentMethodOptionsOptions : INestedOptions, Codable
{
public var acssDebit:SessionPaymentMethodOptionsAcssDebitOptions
public var affirm:SessionPaymentMethodOptionsAffirmOptions
public var afterpayClearpay:SessionPaymentMethodOptionsAfterpayClearpayOptions
public var alipay:SessionPaymentMethodOptionsAlipayOptions
public var amazonPay:SessionPaymentMethodOptionsAmazonPayOptions
public var auBecsDebit:SessionPaymentMethodOptionsAuBecsDebitOptions
public var bacsDebit:SessionPaymentMethodOptionsBacsDebitOptions
public var bancontact:SessionPaymentMethodOptionsBancontactOptions
public var boleto:SessionPaymentMethodOptionsBoletoOptions
public var card:SessionPaymentMethodOptionsCardOptions
public var cashapp:SessionPaymentMethodOptionsCashappOptions
public var customerBalance:SessionPaymentMethodOptionsCustomerBalanceOptions
public var eps:SessionPaymentMethodOptionsEpsOptions
public var fpx:SessionPaymentMethodOptionsFpxOptions
public var giropay:SessionPaymentMethodOptionsGiropayOptions
public var grabpay:SessionPaymentMethodOptionsGrabpayOptions
public var ideal:SessionPaymentMethodOptionsIdealOptions
public var klarna:SessionPaymentMethodOptionsKlarnaOptions
public var konbini:SessionPaymentMethodOptionsKonbiniOptions
public var link:SessionPaymentMethodOptionsLinkOptions
public var mobilepay:SessionPaymentMethodOptionsMobilepayOptions
public var multibanco:SessionPaymentMethodOptionsMultibancoOptions
public var oxxo:SessionPaymentMethodOptionsOxxoOptions
public var p24:SessionPaymentMethodOptionsP24Options
public var paynow:SessionPaymentMethodOptionsPaynowOptions
public var paypal:SessionPaymentMethodOptionsPaypalOptions
public var pix:SessionPaymentMethodOptionsPixOptions
public var revolutPay:SessionPaymentMethodOptionsRevolutPayOptions
public var sepaDebit:SessionPaymentMethodOptionsSepaDebitOptions
public var sofort:SessionPaymentMethodOptionsSofortOptions
public var swish:SessionPaymentMethodOptionsSwishOptions
public var usBankAccount:SessionPaymentMethodOptionsUsBankAccountOptions
public var wechatPay:SessionPaymentMethodOptionsWechatPayOptions
required public init(){}
}
public class SessionPaymentMethodOptionsAcssDebitOptions : INestedOptions, Codable
{
public var currency:String
public var mandateOptions:SessionPaymentMethodOptionsAcssDebitMandateOptionsOptions
public var setupFutureUsage:String
public var verificationMethod:String
required public init(){}
}
public class SessionPaymentMethodOptionsAcssDebitMandateOptionsOptions : INestedOptions, Codable
{
public var customMandateUrl:String
public var defaultFor:[String] = []
public var intervalDescription:String
public var paymentSchedule:String
public var transactionType:String
required public init(){}
}
public class SessionPaymentMethodOptionsAffirmOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsAfterpayClearpayOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsAlipayOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsAmazonPayOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsAuBecsDebitOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsBacsDebitOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsBancontactOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsBoletoOptions : INestedOptions, Codable
{
public var expiresAfterDays:Int?
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsCardOptions : INestedOptions, Codable
{
public var installments:SessionPaymentMethodOptionsCardInstallmentsOptions
public var requestThreeDSecure:String
public var setupFutureUsage:String
public var statementDescriptorSuffixKana:String
public var statementDescriptorSuffixKanji:String
required public init(){}
}
public class SessionPaymentMethodOptionsCardInstallmentsOptions : INestedOptions, Codable
{
public var enabled:Bool?
required public init(){}
}
public class SessionPaymentMethodOptionsCashappOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsCustomerBalanceOptions : INestedOptions, Codable
{
public var bankTransfer:SessionPaymentMethodOptionsCustomerBalanceBankTransferOptions
public var fundingType:String
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsCustomerBalanceBankTransferOptions : INestedOptions, Codable
{
public var euBankTransfer:SessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferOptions
public var requestedAddressTypes:[String] = []
public var type:String
required public init(){}
}
public class SessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferOptions : INestedOptions, Codable
{
public var country:String
required public init(){}
}
public class SessionPaymentMethodOptionsEpsOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsFpxOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsGiropayOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsGrabpayOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsIdealOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsKlarnaOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsKonbiniOptions : INestedOptions, Codable
{
public var expiresAfterDays:Int?
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsLinkOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsMobilepayOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsMultibancoOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsOxxoOptions : INestedOptions, Codable
{
public var expiresAfterDays:Int?
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsP24Options : INestedOptions, Codable
{
public var setupFutureUsage:String
public var tosShownAndAccepted:Bool?
required public init(){}
}
public class SessionPaymentMethodOptionsPaynowOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsPaypalOptions : INestedOptions, Codable
{
public var captureMethod:String
public var preferredLocale:String
public var reference:String
public var riskCorrelationId:String
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsPixOptions : INestedOptions, Codable
{
public var expiresAfterSeconds:Int?
required public init(){}
}
public class SessionPaymentMethodOptionsRevolutPayOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsSepaDebitOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsSofortOptions : INestedOptions, Codable
{
public var setupFutureUsage:String
required public init(){}
}
public class SessionPaymentMethodOptionsSwishOptions : INestedOptions, Codable
{
public var reference:String
required public init(){}
}
public class SessionPaymentMethodOptionsUsBankAccountOptions : INestedOptions, Codable
{
public var financialConnections:SessionPaymentMethodOptionsUsBankAccountFinancialConnectionsOptions
public var setupFutureUsage:String
public var verificationMethod:String
required public init(){}
}
public class SessionPaymentMethodOptionsUsBankAccountFinancialConnectionsOptions : INestedOptions, Codable
{
public var permissions:[String] = []
public var prefetch:[String] = []
required public init(){}
}
public class SessionPaymentMethodOptionsWechatPayOptions : INestedOptions, Codable
{
public var appId:String
public var client:String
public var setupFutureUsage:String
required public init(){}
}
public class SessionPhoneNumberCollectionOptions : INestedOptions, Codable
{
public var enabled:Bool?
required public init(){}
}
public class SessionSavedPaymentMethodOptionsOptions : INestedOptions, Codable
{
public var allowRedisplayFilters:[String] = []
public var paymentMethodSave:String
required public init(){}
}
public class SessionSetupIntentDataOptions : INestedOptions, IHasMetadata, Codable
{
public var Description:String
public var metadata:[String:String] = [:]
public var onBehalfOf:String
required public init(){}
}
public class SessionShippingAddressCollectionOptions : INestedOptions, Codable
{
public var allowedCountries:[String] = []
required public init(){}
}
public class SessionShippingOptionOptions : INestedOptions, Codable
{
public var shippingRate:String
public var shippingRateData:SessionShippingOptionShippingRateDataOptions
required public init(){}
}
public class SessionShippingOptionShippingRateDataOptions : INestedOptions, IHasMetadata, Codable
{
public var deliveryEstimate:SessionShippingOptionShippingRateDataDeliveryEstimateOptions
public var displayName:String
public var fixedAmount:SessionShippingOptionShippingRateDataFixedAmountOptions
public var metadata:[String:String] = [:]
public var taxBehavior:String
public var taxCode:String
public var type:String
required public init(){}
}
public class SessionShippingOptionShippingRateDataDeliveryEstimateOptions : INestedOptions, Codable
{
public var maximum:SessionShippingOptionShippingRateDataDeliveryEstimateMaximumOptions
public var minimum:SessionShippingOptionShippingRateDataDeliveryEstimateMinimumOptions
required public init(){}
}
public class SessionShippingOptionShippingRateDataDeliveryEstimateMaximumOptions : INestedOptions, Codable
{
public var unit:String
public var value:Int?
required public init(){}
}
public class SessionShippingOptionShippingRateDataDeliveryEstimateMinimumOptions : INestedOptions, Codable
{
public var unit:String
public var value:Int?
required public init(){}
}
public class SessionShippingOptionShippingRateDataFixedAmountOptions : INestedOptions, Codable
{
public var amount:Int?
public var currency:String
public var currencyOptions:[String:SessionShippingOptionShippingRateDataFixedAmountCurrencyOptionsOptions] = [:]
required public init(){}
}
public class SessionShippingOptionShippingRateDataFixedAmountCurrencyOptionsOptions : INestedOptions, Codable
{
public var amount:Int?
public var taxBehavior:String
required public init(){}
}
public class SessionSubscriptionDataOptions : INestedOptions, IHasMetadata, Codable
{
public var applicationFeePercent:Double?
public var billingCycleAnchor:Date?
public var defaultTaxRates:[String] = []
public var Description:String
public var invoiceSettings:SessionSubscriptionDataInvoiceSettingsOptions
public var metadata:[String:String] = [:]
public var onBehalfOf:String
public var prorationBehavior:String
public var transferData:SessionSubscriptionDataTransferDataOptions
public var trialEnd:Date?
public var trialPeriodDays:Int?
public var trialSettings:SessionSubscriptionDataTrialSettingsOptions
required public init(){}
}
public class SessionSubscriptionDataInvoiceSettingsOptions : INestedOptions, Codable
{
public var issuer:SessionSubscriptionDataInvoiceSettingsIssuerOptions
required public init(){}
}
public class SessionSubscriptionDataInvoiceSettingsIssuerOptions : INestedOptions, Codable
{
public var account:String
public var type:String
required public init(){}
}
public class SessionSubscriptionDataTransferDataOptions : INestedOptions, Codable
{
public var amountPercent:Double?
public var destination:String
required public init(){}
}
public class SessionSubscriptionDataTrialSettingsOptions : INestedOptions, Codable
{
public var endBehavior:SessionSubscriptionDataTrialSettingsEndBehaviorOptions
required public init(){}
}
public class SessionSubscriptionDataTrialSettingsEndBehaviorOptions : INestedOptions, Codable
{
public var missingPaymentMethod:String
required public init(){}
}
public class SessionTaxIdCollectionOptions : INestedOptions, Codable
{
public var enabled:Bool?
public var required:String
required public init(){}
}
public class CustomSessionData : Codable
{
public var session:Session
public var lineItems:[LineItem] = []
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 clientSecret:String
public var consent:SessionConsent
public var consentCollection:SessionConsentCollection
public var created:Date
public var currency:String
public var currencyConversion:SessionCurrencyConversion
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 paymentMethodConfigurationDetails:SessionPaymentMethodConfigurationDetails
public var paymentMethodOptions:SessionPaymentMethodOptions
public var paymentMethodTypes:[String] = []
public var paymentStatus:String
public var phoneNumberCollection:SessionPhoneNumberCollection
public var recoveredFrom:String
public var redirectOnCompletion:String
public var returnUrl:String
public var savedPaymentMethodOptions:SessionSavedPaymentMethodOptions
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 uiMode:String
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 clientSecret
case consent
case consentCollection
case created
case currency
case currencyConversion
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 paymentMethodConfigurationDetails
case paymentMethodOptions
case paymentMethodTypes
case paymentStatus
case phoneNumberCollection
case recoveredFrom
case redirectOnCompletion
case returnUrl
case savedPaymentMethodOptions
case shippingAddressCollection
case shippingCost
case shippingDetails
case shippingOptions
case status
case submitType
case successUrl
case taxIdCollection
case totalDetails
case uiMode
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)
clientSecret = try container.decodeIfPresent(String.self, forKey: .clientSecret)
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)
currencyConversion = try container.decodeIfPresent(SessionCurrencyConversion.self, forKey: .currencyConversion)
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)
paymentMethodConfigurationDetails = try container.decodeIfPresent(SessionPaymentMethodConfigurationDetails.self, forKey: .paymentMethodConfigurationDetails)
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)
redirectOnCompletion = try container.decodeIfPresent(String.self, forKey: .redirectOnCompletion)
returnUrl = try container.decodeIfPresent(String.self, forKey: .returnUrl)
savedPaymentMethodOptions = try container.decodeIfPresent(SessionSavedPaymentMethodOptions.self, forKey: .savedPaymentMethodOptions)
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)
uiMode = try container.decodeIfPresent(String.self, forKey: .uiMode)
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 clientSecret != nil { try container.encode(clientSecret, forKey: .clientSecret) }
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 currencyConversion != nil { try container.encode(currencyConversion, forKey: .currencyConversion) }
if customFields.count > 0 { 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.count > 0 { 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 paymentMethodConfigurationDetails != nil { try container.encode(paymentMethodConfigurationDetails, forKey: .paymentMethodConfigurationDetails) }
if paymentMethodOptions != nil { try container.encode(paymentMethodOptions, forKey: .paymentMethodOptions) }
if paymentMethodTypes.count > 0 { 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 redirectOnCompletion != nil { try container.encode(redirectOnCompletion, forKey: .redirectOnCompletion) }
if returnUrl != nil { try container.encode(returnUrl, forKey: .returnUrl) }
if savedPaymentMethodOptions != nil { try container.encode(savedPaymentMethodOptions, forKey: .savedPaymentMethodOptions) }
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.count > 0 { 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 uiMode != nil { try container.encode(uiMode, forKey: .uiMode) }
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 liability:SessionAutomaticTaxLiability
public var status:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case enabled
case liability
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)
liability = try container.decodeIfPresent(SessionAutomaticTaxLiability.self, forKey: .liability)
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 liability != nil { try container.encode(liability, forKey: .liability) }
if status != nil { try container.encode(status, forKey: .status) }
}
}
public class SessionAutomaticTaxLiability : StripeEntity_1<SessionAutomaticTaxLiability>
{
public var type:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case type
}
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)
}
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) }
}
}
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 paymentMethodReuseAgreement:SessionConsentCollectionPaymentMethodReuseAgreement
public var promotions:String
public var termsOfService:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case paymentMethodReuseAgreement
case promotions
case termsOfService
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
paymentMethodReuseAgreement = try container.decodeIfPresent(SessionConsentCollectionPaymentMethodReuseAgreement.self, forKey: .paymentMethodReuseAgreement)
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 paymentMethodReuseAgreement != nil { try container.encode(paymentMethodReuseAgreement, forKey: .paymentMethodReuseAgreement) }
if promotions != nil { try container.encode(promotions, forKey: .promotions) }
if termsOfService != nil { try container.encode(termsOfService, forKey: .termsOfService) }
}
}
public class SessionConsentCollectionPaymentMethodReuseAgreement : StripeEntity_1<SessionConsentCollectionPaymentMethodReuseAgreement>
{
public var position:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case position
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
position = try container.decodeIfPresent(String.self, forKey: .position)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if position != nil { try container.encode(position, forKey: .position) }
}
}
public class SessionCurrencyConversion : StripeEntity_1<SessionCurrencyConversion>
{
public var amountSubtotal:Int
public var amountTotal:Int
public var fxRate:Double
public var sourceCurrency:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case amountSubtotal
case amountTotal
case fxRate
case sourceCurrency
}
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)
amountTotal = try container.decodeIfPresent(Int.self, forKey: .amountTotal)
fxRate = try container.decodeIfPresent(Double.self, forKey: .fxRate)
sourceCurrency = try container.decodeIfPresent(String.self, forKey: .sourceCurrency)
}
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 amountTotal != nil { try container.encode(amountTotal, forKey: .amountTotal) }
if fxRate != nil { try container.encode(fxRate, forKey: .fxRate) }
if sourceCurrency != nil { try container.encode(sourceCurrency, forKey: .sourceCurrency) }
}
}
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 defaultValue:String
public var options:[SessionCustomFieldDropdownOption] = []
public var value:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case defaultValue
case options
case value
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
defaultValue = try container.decodeIfPresent(String.self, forKey: .defaultValue)
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 defaultValue != nil { try container.encode(defaultValue, forKey: .defaultValue) }
if options.count > 0 { 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 defaultValue:String
public var maximumLength:Int?
public var minimumLength:Int?
public var value:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case defaultValue
case maximumLength
case minimumLength
case value
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
defaultValue = try container.decodeIfPresent(String.self, forKey: .defaultValue)
maximumLength = try container.decodeIfPresent(Int.self, forKey: .maximumLength)
minimumLength = try container.decodeIfPresent(Int.self, forKey: .minimumLength)
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 defaultValue != nil { try container.encode(defaultValue, forKey: .defaultValue) }
if maximumLength != nil { try container.encode(maximumLength, forKey: .maximumLength) }
if minimumLength != nil { try container.encode(minimumLength, forKey: .minimumLength) }
if value != nil { try container.encode(value, forKey: .value) }
}
}
public class SessionCustomFieldText : StripeEntity_1<SessionCustomFieldText>
{
public var defaultValue:String
public var maximumLength:Int?
public var minimumLength:Int?
public var value:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case defaultValue
case maximumLength
case minimumLength
case value
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
defaultValue = try container.decodeIfPresent(String.self, forKey: .defaultValue)
maximumLength = try container.decodeIfPresent(Int.self, forKey: .maximumLength)
minimumLength = try container.decodeIfPresent(Int.self, forKey: .minimumLength)
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 defaultValue != nil { try container.encode(defaultValue, forKey: .defaultValue) }
if maximumLength != nil { try container.encode(maximumLength, forKey: .maximumLength) }
if minimumLength != nil { try container.encode(minimumLength, forKey: .minimumLength) }
if value != nil { try container.encode(value, forKey: .value) }
}
}
public class SessionCustomText : StripeEntity_1<SessionCustomText>
{
public var afterSubmit:SessionCustomTextAfterSubmit
public var shippingAddress:SessionCustomTextShippingAddress
public var submit:SessionCustomTextSubmit
public var termsOfServiceAcceptance:SessionCustomTextTermsOfServiceAcceptance
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case afterSubmit
case shippingAddress
case submit
case termsOfServiceAcceptance
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
afterSubmit = try container.decodeIfPresent(SessionCustomTextAfterSubmit.self, forKey: .afterSubmit)
shippingAddress = try container.decodeIfPresent(SessionCustomTextShippingAddress.self, forKey: .shippingAddress)
submit = try container.decodeIfPresent(SessionCustomTextSubmit.self, forKey: .submit)
termsOfServiceAcceptance = try container.decodeIfPresent(SessionCustomTextTermsOfServiceAcceptance.self, forKey: .termsOfServiceAcceptance)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if afterSubmit != nil { try container.encode(afterSubmit, forKey: .afterSubmit) }
if shippingAddress != nil { try container.encode(shippingAddress, forKey: .shippingAddress) }
if submit != nil { try container.encode(submit, forKey: .submit) }
if termsOfServiceAcceptance != nil { try container.encode(termsOfServiceAcceptance, forKey: .termsOfServiceAcceptance) }
}
}
public class SessionCustomTextAfterSubmit : StripeEntity_1<SessionCustomTextAfterSubmit>
{
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 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 SessionCustomTextTermsOfServiceAcceptance : StripeEntity_1<SessionCustomTextTermsOfServiceAcceptance>
{
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.count > 0 { 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 issuer:SessionInvoiceCreationInvoiceDataIssuer
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 issuer
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)
issuer = try container.decodeIfPresent(SessionInvoiceCreationInvoiceDataIssuer.self, forKey: .issuer)
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.count > 0 { 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 issuer != nil { try container.encode(issuer, forKey: .issuer) }
if metadata.count > 0 { 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 SessionInvoiceCreationInvoiceDataIssuer : StripeEntity_1<SessionInvoiceCreationInvoiceDataIssuer>
{
public var type:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case type
}
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)
}
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) }
}
}
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.count > 0 { 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.count > 0 { 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
public var subscription:String
public var subscriptionItem:String
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
case subscription
case subscriptionItem
}
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)
subscription = try container.decodeIfPresent(String.self, forKey: .subscription)
subscriptionItem = try container.decodeIfPresent(String.self, forKey: .subscriptionItem)
}
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) }
if subscription != nil { try container.encode(subscription, forKey: .subscription) }
if subscriptionItem != nil { try container.encode(subscriptionItem, forKey: .subscriptionItem) }
}
}
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.count > 0 { 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.count > 0 { 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.count > 0 { 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.count > 0 { 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.count > 0 { 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.count > 0 { 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.count > 0 { 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 meter:String
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 meter
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)
meter = try container.decodeIfPresent(String.self, forKey: .meter)
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 meter != nil { try container.encode(meter, forKey: .meter) }
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
public var taxabilityReason:String
public var taxableAmount:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case amount
case rate
case taxabilityReason
case taxableAmount
}
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)
taxabilityReason = try container.decodeIfPresent(String.self, forKey: .taxabilityReason)
taxableAmount = try container.decodeIfPresent(Int.self, forKey: .taxableAmount)
}
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) }
if taxabilityReason != nil { try container.encode(taxabilityReason, forKey: .taxabilityReason) }
if taxableAmount != nil { try container.encode(taxableAmount, forKey: .taxableAmount) }
}
}
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 effectivePercentage:Double?
public var inclusive:Bool
public var jurisdiction:String
public var jurisdictionLevel: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 effectivePercentage
case inclusive
case jurisdiction
case jurisdictionLevel
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)
effectivePercentage = try container.decodeIfPresent(Double.self, forKey: .effectivePercentage)
inclusive = try container.decodeIfPresent(Bool.self, forKey: .inclusive)
jurisdiction = try container.decodeIfPresent(String.self, forKey: .jurisdiction)
jurisdictionLevel = try container.decodeIfPresent(String.self, forKey: .jurisdictionLevel)
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 effectivePercentage != nil { try container.encode(effectivePercentage, forKey: .effectivePercentage) }
if inclusive != nil { try container.encode(inclusive, forKey: .inclusive) }
if jurisdiction != nil { try container.encode(jurisdiction, forKey: .jurisdiction) }
if jurisdictionLevel != nil { try container.encode(jurisdictionLevel, forKey: .jurisdictionLevel) }
if livemode != nil { try container.encode(livemode, forKey: .livemode) }
if metadata.count > 0 { 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 SessionPaymentMethodConfigurationDetails : StripeEntity_1<SessionPaymentMethodConfigurationDetails>, IHasId
{
public var id:String
public var parent:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case id
case parent
}
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)
parent = try container.decodeIfPresent(String.self, forKey: .parent)
}
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 parent != nil { try container.encode(parent, forKey: .parent) }
}
}
public class SessionPaymentMethodOptions : StripeEntity_1<SessionPaymentMethodOptions>
{
public var acssDebit:SessionPaymentMethodOptionsAcssDebit
public var affirm:SessionPaymentMethodOptionsAffirm
public var afterpayClearpay:SessionPaymentMethodOptionsAfterpayClearpay
public var alipay:SessionPaymentMethodOptionsAlipay
public var amazonPay:SessionPaymentMethodOptionsAmazonPay
public var auBecsDebit:SessionPaymentMethodOptionsAuBecsDebit
public var bacsDebit:SessionPaymentMethodOptionsBacsDebit
public var bancontact:SessionPaymentMethodOptionsBancontact
public var boleto:SessionPaymentMethodOptionsBoleto
public var card:SessionPaymentMethodOptionsCard
public var cashapp:SessionPaymentMethodOptionsCashapp
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 link:SessionPaymentMethodOptionsLink
public var mobilepay:SessionPaymentMethodOptionsMobilepay
public var multibanco:SessionPaymentMethodOptionsMultibanco
public var oxxo:SessionPaymentMethodOptionsOxxo
public var p24:SessionPaymentMethodOptionsP24
public var paynow:SessionPaymentMethodOptionsPaynow
public var paypal:SessionPaymentMethodOptionsPaypal
public var pix:SessionPaymentMethodOptionsPix
public var revolutPay:SessionPaymentMethodOptionsRevolutPay
public var sepaDebit:SessionPaymentMethodOptionsSepaDebit
public var sofort:SessionPaymentMethodOptionsSofort
public var swish:SessionPaymentMethodOptionsSwish
public var usBankAccount:SessionPaymentMethodOptionsUsBankAccount
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case acssDebit
case affirm
case afterpayClearpay
case alipay
case amazonPay
case auBecsDebit
case bacsDebit
case bancontact
case boleto
case card
case cashapp
case customerBalance
case eps
case fpx
case giropay
case grabpay
case ideal
case klarna
case konbini
case link
case mobilepay
case multibanco
case oxxo
case p24
case paynow
case paypal
case pix
case revolutPay
case sepaDebit
case sofort
case swish
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)
amazonPay = try container.decodeIfPresent(SessionPaymentMethodOptionsAmazonPay.self, forKey: .amazonPay)
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)
cashapp = try container.decodeIfPresent(SessionPaymentMethodOptionsCashapp.self, forKey: .cashapp)
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)
link = try container.decodeIfPresent(SessionPaymentMethodOptionsLink.self, forKey: .link)
mobilepay = try container.decodeIfPresent(SessionPaymentMethodOptionsMobilepay.self, forKey: .mobilepay)
multibanco = try container.decodeIfPresent(SessionPaymentMethodOptionsMultibanco.self, forKey: .multibanco)
oxxo = try container.decodeIfPresent(SessionPaymentMethodOptionsOxxo.self, forKey: .oxxo)
p24 = try container.decodeIfPresent(SessionPaymentMethodOptionsP24.self, forKey: .p24)
paynow = try container.decodeIfPresent(SessionPaymentMethodOptionsPaynow.self, forKey: .paynow)
paypal = try container.decodeIfPresent(SessionPaymentMethodOptionsPaypal.self, forKey: .paypal)
pix = try container.decodeIfPresent(SessionPaymentMethodOptionsPix.self, forKey: .pix)
revolutPay = try container.decodeIfPresent(SessionPaymentMethodOptionsRevolutPay.self, forKey: .revolutPay)
sepaDebit = try container.decodeIfPresent(SessionPaymentMethodOptionsSepaDebit.self, forKey: .sepaDebit)
sofort = try container.decodeIfPresent(SessionPaymentMethodOptionsSofort.self, forKey: .sofort)
swish = try container.decodeIfPresent(SessionPaymentMethodOptionsSwish.self, forKey: .swish)
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 amazonPay != nil { try container.encode(amazonPay, forKey: .amazonPay) }
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 cashapp != nil { try container.encode(cashapp, forKey: .cashapp) }
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 link != nil { try container.encode(link, forKey: .link) }
if mobilepay != nil { try container.encode(mobilepay, forKey: .mobilepay) }
if multibanco != nil { try container.encode(multibanco, forKey: .multibanco) }
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 paypal != nil { try container.encode(paypal, forKey: .paypal) }
if pix != nil { try container.encode(pix, forKey: .pix) }
if revolutPay != nil { try container.encode(revolutPay, forKey: .revolutPay) }
if sepaDebit != nil { try container.encode(sepaDebit, forKey: .sepaDebit) }
if sofort != nil { try container.encode(sofort, forKey: .sofort) }
if swish != nil { try container.encode(swish, forKey: .swish) }
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.count > 0 { 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 SessionPaymentMethodOptionsAmazonPay : StripeEntity_1<SessionPaymentMethodOptionsAmazonPay>
{
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 requestThreeDSecure:String
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 requestThreeDSecure
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)
requestThreeDSecure = try container.decodeIfPresent(String.self, forKey: .requestThreeDSecure)
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 requestThreeDSecure != nil { try container.encode(requestThreeDSecure, forKey: .requestThreeDSecure) }
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 SessionPaymentMethodOptionsCashapp : StripeEntity_1<SessionPaymentMethodOptionsCashapp>
{
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 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.count > 0 { 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 SessionPaymentMethodOptionsLink : StripeEntity_1<SessionPaymentMethodOptionsLink>
{
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 SessionPaymentMethodOptionsMobilepay : StripeEntity_1<SessionPaymentMethodOptionsMobilepay>
{
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 SessionPaymentMethodOptionsMultibanco : StripeEntity_1<SessionPaymentMethodOptionsMultibanco>
{
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 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 SessionPaymentMethodOptionsPaypal : StripeEntity_1<SessionPaymentMethodOptionsPaypal>
{
public var captureMethod:String
public var preferredLocale:String
public var reference:String
public var setupFutureUsage:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case captureMethod
case preferredLocale
case reference
case setupFutureUsage
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
captureMethod = try container.decodeIfPresent(String.self, forKey: .captureMethod)
preferredLocale = try container.decodeIfPresent(String.self, forKey: .preferredLocale)
reference = try container.decodeIfPresent(String.self, forKey: .reference)
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 captureMethod != nil { try container.encode(captureMethod, forKey: .captureMethod) }
if preferredLocale != nil { try container.encode(preferredLocale, forKey: .preferredLocale) }
if reference != nil { try container.encode(reference, forKey: .reference) }
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 SessionPaymentMethodOptionsRevolutPay : StripeEntity_1<SessionPaymentMethodOptionsRevolutPay>
{
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 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 SessionPaymentMethodOptionsSwish : StripeEntity_1<SessionPaymentMethodOptionsSwish>
{
public var reference:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case reference
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
reference = try container.decodeIfPresent(String.self, forKey: .reference)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if reference != nil { try container.encode(reference, forKey: .reference) }
}
}
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 filters:SessionPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters
public var permissions:[String] = []
public var prefetch:[String] = []
public var returnUrl:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case filters
case permissions
case prefetch
case returnUrl
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
filters = try container.decodeIfPresent(SessionPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters.self, forKey: .filters)
permissions = try container.decodeIfPresent([String].self, forKey: .permissions) ?? []
prefetch = try container.decodeIfPresent([String].self, forKey: .prefetch) ?? []
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 filters != nil { try container.encode(filters, forKey: .filters) }
if permissions.count > 0 { try container.encode(permissions, forKey: .permissions) }
if prefetch.count > 0 { try container.encode(prefetch, forKey: .prefetch) }
if returnUrl != nil { try container.encode(returnUrl, forKey: .returnUrl) }
}
}
public class SessionPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters : StripeEntity_1<SessionPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>
{
public var accountSubcategories:[String] = []
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case accountSubcategories
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
accountSubcategories = try container.decodeIfPresent([String].self, forKey: .accountSubcategories) ?? []
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if accountSubcategories.count > 0 { try container.encode(accountSubcategories, forKey: .accountSubcategories) }
}
}
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 SessionSavedPaymentMethodOptions : StripeEntity_1<SessionSavedPaymentMethodOptions>
{
public var allowRedisplayFilters:[String] = []
public var paymentMethodRemove:String
public var paymentMethodSave:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case allowRedisplayFilters
case paymentMethodRemove
case paymentMethodSave
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
allowRedisplayFilters = try container.decodeIfPresent([String].self, forKey: .allowRedisplayFilters) ?? []
paymentMethodRemove = try container.decodeIfPresent(String.self, forKey: .paymentMethodRemove)
paymentMethodSave = try container.decodeIfPresent(String.self, forKey: .paymentMethodSave)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if allowRedisplayFilters.count > 0 { try container.encode(allowRedisplayFilters, forKey: .allowRedisplayFilters) }
if paymentMethodRemove != nil { try container.encode(paymentMethodRemove, forKey: .paymentMethodRemove) }
if paymentMethodSave != nil { try container.encode(paymentMethodSave, forKey: .paymentMethodSave) }
}
}
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.count > 0 { 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.count > 0 { try container.encode(taxes, forKey: .taxes) }
}
}
public class SessionShippingCostTax : StripeEntity_1<SessionShippingCostTax>
{
public var amount:Int
public var rate:TaxRate
public var taxabilityReason:String
public var taxableAmount:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case amount
case rate
case taxabilityReason
case taxableAmount
}
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)
taxabilityReason = try container.decodeIfPresent(String.self, forKey: .taxabilityReason)
taxableAmount = try container.decodeIfPresent(Int.self, forKey: .taxableAmount)
}
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) }
if taxabilityReason != nil { try container.encode(taxabilityReason, forKey: .taxabilityReason) }
if taxableAmount != nil { try container.encode(taxableAmount, forKey: .taxableAmount) }
}
}
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
public var required:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case enabled
case required
}
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)
required = try container.decodeIfPresent(String.self, forKey: .required)
}
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 required != nil { try container.encode(required, forKey: .required) }
}
}
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.count > 0 { try container.encode(discounts, forKey: .discounts) }
if taxes.count > 0 { 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
public var taxabilityReason:String
public var taxableAmount:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case amount
case rate
case taxabilityReason
case taxableAmount
}
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)
taxabilityReason = try container.decodeIfPresent(String.self, forKey: .taxabilityReason)
taxableAmount = try container.decodeIfPresent(Int.self, forKey: .taxableAmount)
}
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) }
if taxabilityReason != nil { try container.encode(taxabilityReason, forKey: .taxabilityReason) }
if taxableAmount != nil { try container.encode(taxableAmount, forKey: .taxableAmount) }
}
}
public protocol IPaysonPaymentCheckout1
{
}
public protocol ILogger : ILogger
{
associatedtype TCategoryName
}
public class PaymentLog : BaseModel
{
// @References(typeof(Currency))
public var currencyId:String
public var currencyInfo:Currency
// @Required()
public var companyId:String?
public var id:Int
// @Required()
public var internalReferenceId:String?
// @Required()
public var articleTypeId:Int?
public var paymentReferenceId:String
public var paymentProviderId:Int?
public var orderItemReferenceId:String
public var amount:Double?
public var vat:Double?
public var amountCredited:Double?
public var comments:String
// @Required()
public var created:Date?
// @Required()
public var updated:Date?
public var modifiedDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case currencyId
case currencyInfo
case companyId
case id
case internalReferenceId
case articleTypeId
case paymentReferenceId
case paymentProviderId
case orderItemReferenceId
case amount
case vat
case amountCredited
case comments
case created
case updated
case modifiedDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
currencyId = try container.decodeIfPresent(String.self, forKey: .currencyId)
currencyInfo = try container.decodeIfPresent(Currency.self, forKey: .currencyInfo)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
id = try container.decodeIfPresent(Int.self, forKey: .id)
internalReferenceId = try container.decodeIfPresent(String.self, forKey: .internalReferenceId)
articleTypeId = try container.decodeIfPresent(Int.self, forKey: .articleTypeId)
paymentReferenceId = try container.decodeIfPresent(String.self, forKey: .paymentReferenceId)
paymentProviderId = try container.decodeIfPresent(Int.self, forKey: .paymentProviderId)
orderItemReferenceId = try container.decodeIfPresent(String.self, forKey: .orderItemReferenceId)
amount = try container.decodeIfPresent(Double.self, forKey: .amount)
vat = try container.decodeIfPresent(Double.self, forKey: .vat)
amountCredited = try container.decodeIfPresent(Double.self, forKey: .amountCredited)
comments = try container.decodeIfPresent(String.self, forKey: .comments)
created = try container.decodeIfPresent(Date.self, forKey: .created)
updated = try container.decodeIfPresent(Date.self, forKey: .updated)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if currencyId != nil { try container.encode(currencyId, forKey: .currencyId) }
if currencyInfo != nil { try container.encode(currencyInfo, forKey: .currencyInfo) }
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if id != nil { try container.encode(id, forKey: .id) }
if internalReferenceId != nil { try container.encode(internalReferenceId, forKey: .internalReferenceId) }
if articleTypeId != nil { try container.encode(articleTypeId, forKey: .articleTypeId) }
if paymentReferenceId != nil { try container.encode(paymentReferenceId, forKey: .paymentReferenceId) }
if paymentProviderId != nil { try container.encode(paymentProviderId, forKey: .paymentProviderId) }
if orderItemReferenceId != nil { try container.encode(orderItemReferenceId, forKey: .orderItemReferenceId) }
if amount != nil { try container.encode(amount, forKey: .amount) }
if vat != nil { try container.encode(vat, forKey: .vat) }
if amountCredited != nil { try container.encode(amountCredited, forKey: .amountCredited) }
if comments != nil { try container.encode(comments, forKey: .comments) }
if created != nil { try container.encode(created, forKey: .created) }
if updated != nil { try container.encode(updated, forKey: .updated) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
}
}
public class Customer : BaseModel, IUser, ICustomFieldTable
{
public var identityId:Int
public var id:String
// @Ignore()
public var customerId:String
// @Ignore()
public var accessKeys:IList<UserAccessKeys>
public var email:String
// @Ignore()
public var externalReferences:IList<ExternalReference>
// @Ignore()
public var company:Company
// @Ignore()
public var customFieldsConfig:IList<CustomFieldConfig>
// @Ignore()
public var customFieldsData:IList<CustomFieldDataResponse>
// @Ignore()
public var comments:IList<CustomerComment>
// @Ignore()
public var rebateCodes:IList<RebateCode>
public var firstname:String
// @Ignore()
public var fullName:String
// @Ignore()
public var imageUrl:String
// @Required()
public var active:Bool?
public var facebookUsername:String
// @Required()
public var updated:Date?
// @Required()
public var created:Date?
public var ipAddress:String
public var modifiedDate:Date?
public var textField1:String
public var textField2:String
public var textField3:String
public var textField4:String
public var textField5:String
public var textField6:String
public var textField7:String
public var textField8:String
public var textField9:String
public var textField10:String
public var textField11:String
public var textField12:String
public var textField13:String
public var textField14:String
public var textField15:String
public var textField16:String
public var textField17:String
public var textField18:String
public var textField19:String
public var textField20:String
public var userId:String
public var lastname:String
public var phone:String
public var corporateIdentityNumber:String
public var invoiceAddress1:String
public var invoiceAddress2:String
public var invoiceCity:String
public var invoicePostalCode:String
public var invoiceCountryCode:String
// @Required()
public var companyId:String?
public var subscribedToNewsletter:Bool
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case identityId
case id
case customerId
case accessKeys
case email
case externalReferences
case company
case customFieldsConfig
case customFieldsData
case comments
case rebateCodes
case firstname
case fullName
case imageUrl
case active
case facebookUsername
case updated
case created
case ipAddress
case modifiedDate
case textField1
case textField2
case textField3
case textField4
case textField5
case textField6
case textField7
case textField8
case textField9
case textField10
case textField11
case textField12
case textField13
case textField14
case textField15
case textField16
case textField17
case textField18
case textField19
case textField20
case userId
case lastname
case phone
case corporateIdentityNumber
case invoiceAddress1
case invoiceAddress2
case invoiceCity
case invoicePostalCode
case invoiceCountryCode
case companyId
case subscribedToNewsletter
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
identityId = try container.decodeIfPresent(Int.self, forKey: .identityId)
id = try container.decodeIfPresent(String.self, forKey: .id)
customerId = try container.decodeIfPresent(String.self, forKey: .customerId)
accessKeys = try container.decodeIfPresent(IList<UserAccessKeys>.self, forKey: .accessKeys)
email = try container.decodeIfPresent(String.self, forKey: .email)
externalReferences = try container.decodeIfPresent(IList<ExternalReference>.self, forKey: .externalReferences)
company = try container.decodeIfPresent(Company.self, forKey: .company)
customFieldsConfig = try container.decodeIfPresent(IList<CustomFieldConfig>.self, forKey: .customFieldsConfig)
customFieldsData = try container.decodeIfPresent(IList<CustomFieldDataResponse>.self, forKey: .customFieldsData)
comments = try container.decodeIfPresent(IList<CustomerComment>.self, forKey: .comments)
rebateCodes = try container.decodeIfPresent(IList<RebateCode>.self, forKey: .rebateCodes)
firstname = try container.decodeIfPresent(String.self, forKey: .firstname)
fullName = try container.decodeIfPresent(String.self, forKey: .fullName)
imageUrl = try container.decodeIfPresent(String.self, forKey: .imageUrl)
active = try container.decodeIfPresent(Bool.self, forKey: .active)
facebookUsername = try container.decodeIfPresent(String.self, forKey: .facebookUsername)
updated = try container.decodeIfPresent(Date.self, forKey: .updated)
created = try container.decodeIfPresent(Date.self, forKey: .created)
ipAddress = try container.decodeIfPresent(String.self, forKey: .ipAddress)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
textField1 = try container.decodeIfPresent(String.self, forKey: .textField1)
textField2 = try container.decodeIfPresent(String.self, forKey: .textField2)
textField3 = try container.decodeIfPresent(String.self, forKey: .textField3)
textField4 = try container.decodeIfPresent(String.self, forKey: .textField4)
textField5 = try container.decodeIfPresent(String.self, forKey: .textField5)
textField6 = try container.decodeIfPresent(String.self, forKey: .textField6)
textField7 = try container.decodeIfPresent(String.self, forKey: .textField7)
textField8 = try container.decodeIfPresent(String.self, forKey: .textField8)
textField9 = try container.decodeIfPresent(String.self, forKey: .textField9)
textField10 = try container.decodeIfPresent(String.self, forKey: .textField10)
textField11 = try container.decodeIfPresent(String.self, forKey: .textField11)
textField12 = try container.decodeIfPresent(String.self, forKey: .textField12)
textField13 = try container.decodeIfPresent(String.self, forKey: .textField13)
textField14 = try container.decodeIfPresent(String.self, forKey: .textField14)
textField15 = try container.decodeIfPresent(String.self, forKey: .textField15)
textField16 = try container.decodeIfPresent(String.self, forKey: .textField16)
textField17 = try container.decodeIfPresent(String.self, forKey: .textField17)
textField18 = try container.decodeIfPresent(String.self, forKey: .textField18)
textField19 = try container.decodeIfPresent(String.self, forKey: .textField19)
textField20 = try container.decodeIfPresent(String.self, forKey: .textField20)
userId = try container.decodeIfPresent(String.self, forKey: .userId)
lastname = try container.decodeIfPresent(String.self, forKey: .lastname)
phone = try container.decodeIfPresent(String.self, forKey: .phone)
corporateIdentityNumber = try container.decodeIfPresent(String.self, forKey: .corporateIdentityNumber)
invoiceAddress1 = try container.decodeIfPresent(String.self, forKey: .invoiceAddress1)
invoiceAddress2 = try container.decodeIfPresent(String.self, forKey: .invoiceAddress2)
invoiceCity = try container.decodeIfPresent(String.self, forKey: .invoiceCity)
invoicePostalCode = try container.decodeIfPresent(String.self, forKey: .invoicePostalCode)
invoiceCountryCode = try container.decodeIfPresent(String.self, forKey: .invoiceCountryCode)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
subscribedToNewsletter = try container.decodeIfPresent(Bool.self, forKey: .subscribedToNewsletter)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if identityId != nil { try container.encode(identityId, forKey: .identityId) }
if id != nil { try container.encode(id, forKey: .id) }
if customerId != nil { try container.encode(customerId, forKey: .customerId) }
if accessKeys != nil { try container.encode(accessKeys, forKey: .accessKeys) }
if email != nil { try container.encode(email, forKey: .email) }
if externalReferences != nil { try container.encode(externalReferences, forKey: .externalReferences) }
if company != nil { try container.encode(company, forKey: .company) }
if customFieldsConfig != nil { try container.encode(customFieldsConfig, forKey: .customFieldsConfig) }
if customFieldsData != nil { try container.encode(customFieldsData, forKey: .customFieldsData) }
if comments != nil { try container.encode(comments, forKey: .comments) }
if rebateCodes != nil { try container.encode(rebateCodes, forKey: .rebateCodes) }
if firstname != nil { try container.encode(firstname, forKey: .firstname) }
if fullName != nil { try container.encode(fullName, forKey: .fullName) }
if imageUrl != nil { try container.encode(imageUrl, forKey: .imageUrl) }
if active != nil { try container.encode(active, forKey: .active) }
if facebookUsername != nil { try container.encode(facebookUsername, forKey: .facebookUsername) }
if updated != nil { try container.encode(updated, forKey: .updated) }
if created != nil { try container.encode(created, forKey: .created) }
if ipAddress != nil { try container.encode(ipAddress, forKey: .ipAddress) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if textField1 != nil { try container.encode(textField1, forKey: .textField1) }
if textField2 != nil { try container.encode(textField2, forKey: .textField2) }
if textField3 != nil { try container.encode(textField3, forKey: .textField3) }
if textField4 != nil { try container.encode(textField4, forKey: .textField4) }
if textField5 != nil { try container.encode(textField5, forKey: .textField5) }
if textField6 != nil { try container.encode(textField6, forKey: .textField6) }
if textField7 != nil { try container.encode(textField7, forKey: .textField7) }
if textField8 != nil { try container.encode(textField8, forKey: .textField8) }
if textField9 != nil { try container.encode(textField9, forKey: .textField9) }
if textField10 != nil { try container.encode(textField10, forKey: .textField10) }
if textField11 != nil { try container.encode(textField11, forKey: .textField11) }
if textField12 != nil { try container.encode(textField12, forKey: .textField12) }
if textField13 != nil { try container.encode(textField13, forKey: .textField13) }
if textField14 != nil { try container.encode(textField14, forKey: .textField14) }
if textField15 != nil { try container.encode(textField15, forKey: .textField15) }
if textField16 != nil { try container.encode(textField16, forKey: .textField16) }
if textField17 != nil { try container.encode(textField17, forKey: .textField17) }
if textField18 != nil { try container.encode(textField18, forKey: .textField18) }
if textField19 != nil { try container.encode(textField19, forKey: .textField19) }
if textField20 != nil { try container.encode(textField20, forKey: .textField20) }
if userId != nil { try container.encode(userId, forKey: .userId) }
if lastname != nil { try container.encode(lastname, forKey: .lastname) }
if phone != nil { try container.encode(phone, forKey: .phone) }
if corporateIdentityNumber != nil { try container.encode(corporateIdentityNumber, forKey: .corporateIdentityNumber) }
if invoiceAddress1 != nil { try container.encode(invoiceAddress1, forKey: .invoiceAddress1) }
if invoiceAddress2 != nil { try container.encode(invoiceAddress2, forKey: .invoiceAddress2) }
if invoiceCity != nil { try container.encode(invoiceCity, forKey: .invoiceCity) }
if invoicePostalCode != nil { try container.encode(invoicePostalCode, forKey: .invoicePostalCode) }
if invoiceCountryCode != nil { try container.encode(invoiceCountryCode, forKey: .invoiceCountryCode) }
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if subscribedToNewsletter != nil { try container.encode(subscribedToNewsletter, forKey: .subscribedToNewsletter) }
}
}
public class UserAccessKeys : BaseModel
{
// @Required()
public var companyId:String?
// @Required()
public var accessKeyTypeId:Int?
// @Required()
public var value:String?
// @Required()
public var customerId:String?
public var Description:String
// @Required()
public var id:String?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case companyId
case accessKeyTypeId
case value
case customerId
case Description
case id
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
accessKeyTypeId = try container.decodeIfPresent(Int.self, forKey: .accessKeyTypeId)
value = try container.decodeIfPresent(String.self, forKey: .value)
customerId = try container.decodeIfPresent(String.self, forKey: .customerId)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
id = try container.decodeIfPresent(String.self, forKey: .id)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if accessKeyTypeId != nil { try container.encode(accessKeyTypeId, forKey: .accessKeyTypeId) }
if value != nil { try container.encode(value, forKey: .value) }
if customerId != nil { try container.encode(customerId, forKey: .customerId) }
if Description != nil { try container.encode(Description, forKey: .Description) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class ExternalReference : BaseModel
{
// @Required()
public var companyId:String?
// @Required()
public var id:String?
// @Required()
public var ownerId:String?
// @Required()
public var referenceType:String?
public var externalData:String
public var createdBy:String
// @Required()
public var updated:Date?
// @Required()
public var created:Date?
public var modifiedDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case companyId
case id
case ownerId
case referenceType
case externalData
case createdBy
case updated
case created
case modifiedDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
id = try container.decodeIfPresent(String.self, forKey: .id)
ownerId = try container.decodeIfPresent(String.self, forKey: .ownerId)
referenceType = try container.decodeIfPresent(String.self, forKey: .referenceType)
externalData = try container.decodeIfPresent(String.self, forKey: .externalData)
createdBy = try container.decodeIfPresent(String.self, forKey: .createdBy)
updated = try container.decodeIfPresent(Date.self, forKey: .updated)
created = try container.decodeIfPresent(Date.self, forKey: .created)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if id != nil { try container.encode(id, forKey: .id) }
if ownerId != nil { try container.encode(ownerId, forKey: .ownerId) }
if referenceType != nil { try container.encode(referenceType, forKey: .referenceType) }
if externalData != nil { try container.encode(externalData, forKey: .externalData) }
if createdBy != nil { try container.encode(createdBy, forKey: .createdBy) }
if updated != nil { try container.encode(updated, forKey: .updated) }
if created != nil { try container.encode(created, forKey: .created) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
}
}
public class Company : BaseModel
{
// @Ignore()
public var status:CompanyStatus
// @Ignore()
public var active:Bool
// @Ignore()
public var customerCustomFieldsConfig:IList<CustomFieldConfig>
// @Ignore()
public var bookingAgreements:String
// @Ignore()
public var bookingSettings:BookingSettings
// @Ignore()
public var companyType:CompanyType
// @Ignore()
public var codeLockSettings:CodeLockSetting
// @Ignore()
public var paymentSettings:PaymentSetting
// @Ignore()
public var settings:CompanySetting
// @Ignore()
public var widgetSettings:HomepageWidgetSetting
// @Ignore()
public var homepageSettings:HomepageSetting
// @Ignore()
public var ratingScore:AverageRatingScore
// @Ignore()
public var ratings:[Rating] = []
// @Ignore()
public var distance:Double?
// @Ignore()
public var licenses:[License] = []
// @Ignore()
public var activeLicenses:[License] = []
// @Ignore()
public var currentLicense:License
// @Ignore()
public var isFreeAccount:Bool
// @Ignore()
public var defaultLanguage:CultureInfo
public var category:CompanyCategory
// @Ignore()
public var lat:Double
// @Ignore()
public var lon:Double
// @Ignore()
public var isFavorite:Bool
// @Ignore()
public var externalReferences:IList<ExternalReference>
// @Required()
public var organisationNumber:String?
// @Required()
public var statusId:Int?
// @Required()
public var categoryId:Int?
// @Required()
public var sitePath:String?
// @Required()
public var name:String?
public var street1:String
public var street2:String
public var zipCode:String
public var city:String
public var openingHours:String
public var faxNumber:String
// @Required()
public var email:String?
public var phone:String
public var details:String
public var logoType:String
// @Required()
public var approvedByAdmin:Bool?
// @Required()
public var updated:Date?
// @Required()
public var created:Date?
public var ipAddress:String
public var homepage:String
public var domainName:String
// @Required()
public var countryId:String?
// @Required()
public var companyOwnerId:Int?
public var typeId:Int?
public var modifiedDate:Date?
// @Required()
public var id:String?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case status
case active
case customerCustomFieldsConfig
case bookingAgreements
case bookingSettings
case companyType
case codeLockSettings
case paymentSettings
case settings
case widgetSettings
case homepageSettings
case ratingScore
case ratings
case distance
case licenses
case activeLicenses
case currentLicense
case isFreeAccount
case defaultLanguage
case category
case lat
case lon
case isFavorite
case externalReferences
case organisationNumber
case statusId
case categoryId
case sitePath
case name
case street1
case street2
case zipCode
case city
case openingHours
case faxNumber
case email
case phone
case details
case logoType
case approvedByAdmin
case updated
case created
case ipAddress
case homepage
case domainName
case countryId
case companyOwnerId
case typeId
case modifiedDate
case id
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
status = try container.decodeIfPresent(CompanyStatus.self, forKey: .status)
active = try container.decodeIfPresent(Bool.self, forKey: .active)
customerCustomFieldsConfig = try container.decodeIfPresent(IList<CustomFieldConfig>.self, forKey: .customerCustomFieldsConfig)
bookingAgreements = try container.decodeIfPresent(String.self, forKey: .bookingAgreements)
bookingSettings = try container.decodeIfPresent(BookingSettings.self, forKey: .bookingSettings)
companyType = try container.decodeIfPresent(CompanyType.self, forKey: .companyType)
codeLockSettings = try container.decodeIfPresent(CodeLockSetting.self, forKey: .codeLockSettings)
paymentSettings = try container.decodeIfPresent(PaymentSetting.self, forKey: .paymentSettings)
settings = try container.decodeIfPresent(CompanySetting.self, forKey: .settings)
widgetSettings = try container.decodeIfPresent(HomepageWidgetSetting.self, forKey: .widgetSettings)
homepageSettings = try container.decodeIfPresent(HomepageSetting.self, forKey: .homepageSettings)
ratingScore = try container.decodeIfPresent(AverageRatingScore.self, forKey: .ratingScore)
ratings = try container.decodeIfPresent([Rating].self, forKey: .ratings) ?? []
distance = try container.decodeIfPresent(Double.self, forKey: .distance)
licenses = try container.decodeIfPresent([License].self, forKey: .licenses) ?? []
activeLicenses = try container.decodeIfPresent([License].self, forKey: .activeLicenses) ?? []
currentLicense = try container.decodeIfPresent(License.self, forKey: .currentLicense)
isFreeAccount = try container.decodeIfPresent(Bool.self, forKey: .isFreeAccount)
defaultLanguage = try container.decodeIfPresent(CultureInfo.self, forKey: .defaultLanguage)
category = try container.decodeIfPresent(CompanyCategory.self, forKey: .category)
lat = try container.decodeIfPresent(Double.self, forKey: .lat)
lon = try container.decodeIfPresent(Double.self, forKey: .lon)
isFavorite = try container.decodeIfPresent(Bool.self, forKey: .isFavorite)
externalReferences = try container.decodeIfPresent(IList<ExternalReference>.self, forKey: .externalReferences)
organisationNumber = try container.decodeIfPresent(String.self, forKey: .organisationNumber)
statusId = try container.decodeIfPresent(Int.self, forKey: .statusId)
categoryId = try container.decodeIfPresent(Int.self, forKey: .categoryId)
sitePath = try container.decodeIfPresent(String.self, forKey: .sitePath)
name = try container.decodeIfPresent(String.self, forKey: .name)
street1 = try container.decodeIfPresent(String.self, forKey: .street1)
street2 = try container.decodeIfPresent(String.self, forKey: .street2)
zipCode = try container.decodeIfPresent(String.self, forKey: .zipCode)
city = try container.decodeIfPresent(String.self, forKey: .city)
openingHours = try container.decodeIfPresent(String.self, forKey: .openingHours)
faxNumber = try container.decodeIfPresent(String.self, forKey: .faxNumber)
email = try container.decodeIfPresent(String.self, forKey: .email)
phone = try container.decodeIfPresent(String.self, forKey: .phone)
details = try container.decodeIfPresent(String.self, forKey: .details)
logoType = try container.decodeIfPresent(String.self, forKey: .logoType)
approvedByAdmin = try container.decodeIfPresent(Bool.self, forKey: .approvedByAdmin)
updated = try container.decodeIfPresent(Date.self, forKey: .updated)
created = try container.decodeIfPresent(Date.self, forKey: .created)
ipAddress = try container.decodeIfPresent(String.self, forKey: .ipAddress)
homepage = try container.decodeIfPresent(String.self, forKey: .homepage)
domainName = try container.decodeIfPresent(String.self, forKey: .domainName)
countryId = try container.decodeIfPresent(String.self, forKey: .countryId)
companyOwnerId = try container.decodeIfPresent(Int.self, forKey: .companyOwnerId)
typeId = try container.decodeIfPresent(Int.self, forKey: .typeId)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(String.self, forKey: .id)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if status != nil { try container.encode(status, forKey: .status) }
if active != nil { try container.encode(active, forKey: .active) }
if customerCustomFieldsConfig != nil { try container.encode(customerCustomFieldsConfig, forKey: .customerCustomFieldsConfig) }
if bookingAgreements != nil { try container.encode(bookingAgreements, forKey: .bookingAgreements) }
if bookingSettings != nil { try container.encode(bookingSettings, forKey: .bookingSettings) }
if companyType != nil { try container.encode(companyType, forKey: .companyType) }
if codeLockSettings != nil { try container.encode(codeLockSettings, forKey: .codeLockSettings) }
if paymentSettings != nil { try container.encode(paymentSettings, forKey: .paymentSettings) }
if settings != nil { try container.encode(settings, forKey: .settings) }
if widgetSettings != nil { try container.encode(widgetSettings, forKey: .widgetSettings) }
if homepageSettings != nil { try container.encode(homepageSettings, forKey: .homepageSettings) }
if ratingScore != nil { try container.encode(ratingScore, forKey: .ratingScore) }
if ratings.count > 0 { try container.encode(ratings, forKey: .ratings) }
if distance != nil { try container.encode(distance, forKey: .distance) }
if licenses.count > 0 { try container.encode(licenses, forKey: .licenses) }
if activeLicenses.count > 0 { try container.encode(activeLicenses, forKey: .activeLicenses) }
if currentLicense != nil { try container.encode(currentLicense, forKey: .currentLicense) }
if isFreeAccount != nil { try container.encode(isFreeAccount, forKey: .isFreeAccount) }
if defaultLanguage != nil { try container.encode(defaultLanguage, forKey: .defaultLanguage) }
if category != nil { try container.encode(category, forKey: .category) }
if lat != nil { try container.encode(lat, forKey: .lat) }
if lon != nil { try container.encode(lon, forKey: .lon) }
if isFavorite != nil { try container.encode(isFavorite, forKey: .isFavorite) }
if externalReferences != nil { try container.encode(externalReferences, forKey: .externalReferences) }
if organisationNumber != nil { try container.encode(organisationNumber, forKey: .organisationNumber) }
if statusId != nil { try container.encode(statusId, forKey: .statusId) }
if categoryId != nil { try container.encode(categoryId, forKey: .categoryId) }
if sitePath != nil { try container.encode(sitePath, forKey: .sitePath) }
if name != nil { try container.encode(name, forKey: .name) }
if street1 != nil { try container.encode(street1, forKey: .street1) }
if street2 != nil { try container.encode(street2, forKey: .street2) }
if zipCode != nil { try container.encode(zipCode, forKey: .zipCode) }
if city != nil { try container.encode(city, forKey: .city) }
if openingHours != nil { try container.encode(openingHours, forKey: .openingHours) }
if faxNumber != nil { try container.encode(faxNumber, forKey: .faxNumber) }
if email != nil { try container.encode(email, forKey: .email) }
if phone != nil { try container.encode(phone, forKey: .phone) }
if details != nil { try container.encode(details, forKey: .details) }
if logoType != nil { try container.encode(logoType, forKey: .logoType) }
if approvedByAdmin != nil { try container.encode(approvedByAdmin, forKey: .approvedByAdmin) }
if updated != nil { try container.encode(updated, forKey: .updated) }
if created != nil { try container.encode(created, forKey: .created) }
if ipAddress != nil { try container.encode(ipAddress, forKey: .ipAddress) }
if homepage != nil { try container.encode(homepage, forKey: .homepage) }
if domainName != nil { try container.encode(domainName, forKey: .domainName) }
if countryId != nil { try container.encode(countryId, forKey: .countryId) }
if companyOwnerId != nil { try container.encode(companyOwnerId, forKey: .companyOwnerId) }
if typeId != nil { try container.encode(typeId, forKey: .typeId) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public enum CompanyStatus : Int, Codable
{
case Registered = 1
case AwaitingApproval = 2
case Approved = 3
case Inactive = 4
case ClosedDown = 5
case NotApproved = 6
}
public class BookingSettings : BaseModel
{
// @References(typeof(FreeSpotTexts))
public var freeSpotTextsId:Int
// @Ignore()
public var sendEmailConfirmation:Bool
// @Ignore()
public var scheduleViewOptions:[ScheduleView] = []
// @Ignore()
public var weekNumberSettingOptions:[WeekNumberSetting] = []
// @Ignore()
public var bookingTemplateOptions:[BookingTemplate] = []
// @Ignore()
public var calendarTypeOptions:[CalendarType] = []
// @Ignore()
public var freeSpotTextOptions:[FreeSpotTexts] = []
// @Ignore()
public var bookingStatusOptions:[BookingStatusOptions] = []
public var freeSpotTextsInfo:FreeSpotTexts
// @Ignore()
public var freeSpotsTextSingular:String
// @Ignore()
public var freeSpotsTextPlural:String
// @Required()
public var bookingStatusId:Int?
// @Required()
public var scheduleViewId:Int?
// @Required()
public var bookingTemplateId:Int?
// @Required()
public var calendarTypeId:Int?
// @Required()
public var allowBookingOnUnbookedTimes:Bool?
// @Required()
public var sendEmailReminder:Bool?
// @Required()
public var sendSmsReminder:Bool?
// @Required()
public var sendSmsConfirmation:Bool?
// @Required()
public var emailReminderTime:Int?
// @Required()
public var smsReminderTime:Int?
// @Required()
public var maxActiveBookings:Int?
// @Required()
public var sendNotifications:Bool?
public var sendNotificationsEmail:String
// @Required()
public var enableMobileApp:Bool?
@TimeSpan public var scheduleStartTime:TimeInterval?
@TimeSpan public var scheduleEndTime:TimeInterval?
public var receiptTemplate:String
// @Required()
public var scheduleTimeSlotMinutes:Int?
// @Required()
public var showFreeTimesLeft:Bool?
// @Required()
public var enableICalGroupBookings:Bool?
public var agreementTemplate:String
// @Required()
public var scheduleShowTimeExeptions:Bool?
// @Required()
public var enableBookingsOnSameTime:Bool?
// @Required()
public var showWeekNumberSettingId:Int?
// @Required()
public var enableShowBookedTimes:Bool?
// @Required()
public var enableSendFollowUpMessage:Bool?
// @Required()
public var followUpMessageTime:Int?
public var messageText:String
// @Required()
public var scheduleGroupResources:Bool?
// @Required()
public var bookSpotUserResponseMinutes:Int?
// @Required()
public var isBookSpotDirectly:Bool?
// @Required()
public var bookSpotDirectlyTimeLeftMinutes:Int?
// @Required()
public var sendEmailNotificationQueue:Bool?
// @Required()
public var sendSMSNotificationQueue:Bool?
// @Required()
public var schedulerDisableHorizontalScrolling:Bool?
// @Required()
public var bookOnlyOnExistingCustomers:Bool?
// @Required()
public var autoGenerateUniquePinCode:Bool?
// @Required()
public var weightedPrices:Bool?
public var modifiedDate:Date?
// @Required()
public var autoCreateUserProfile:Bool?
public var showMultipleResourcesAsOne:Bool
public var showMultiDayAsTime:Bool
// @Required()
public var id:String?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case freeSpotTextsId
case sendEmailConfirmation
case scheduleViewOptions
case weekNumberSettingOptions
case bookingTemplateOptions
case calendarTypeOptions
case freeSpotTextOptions
case bookingStatusOptions
case freeSpotTextsInfo
case freeSpotsTextSingular
case freeSpotsTextPlural
case bookingStatusId
case scheduleViewId
case bookingTemplateId
case calendarTypeId
case allowBookingOnUnbookedTimes
case sendEmailReminder
case sendSmsReminder
case sendSmsConfirmation
case emailReminderTime
case smsReminderTime
case maxActiveBookings
case sendNotifications
case sendNotificationsEmail
case enableMobileApp
case scheduleStartTime
case scheduleEndTime
case receiptTemplate
case scheduleTimeSlotMinutes
case showFreeTimesLeft
case enableICalGroupBookings
case agreementTemplate
case scheduleShowTimeExeptions
case enableBookingsOnSameTime
case showWeekNumberSettingId
case enableShowBookedTimes
case enableSendFollowUpMessage
case followUpMessageTime
case messageText
case scheduleGroupResources
case bookSpotUserResponseMinutes
case isBookSpotDirectly
case bookSpotDirectlyTimeLeftMinutes
case sendEmailNotificationQueue
case sendSMSNotificationQueue
case schedulerDisableHorizontalScrolling
case bookOnlyOnExistingCustomers
case autoGenerateUniquePinCode
case weightedPrices
case modifiedDate
case autoCreateUserProfile
case showMultipleResourcesAsOne
case showMultiDayAsTime
case id
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
freeSpotTextsId = try container.decodeIfPresent(Int.self, forKey: .freeSpotTextsId)
sendEmailConfirmation = try container.decodeIfPresent(Bool.self, forKey: .sendEmailConfirmation)
scheduleViewOptions = try container.decodeIfPresent([ScheduleView].self, forKey: .scheduleViewOptions) ?? []
weekNumberSettingOptions = try container.decodeIfPresent([WeekNumberSetting].self, forKey: .weekNumberSettingOptions) ?? []
bookingTemplateOptions = try container.decodeIfPresent([BookingTemplate].self, forKey: .bookingTemplateOptions) ?? []
calendarTypeOptions = try container.decodeIfPresent([CalendarType].self, forKey: .calendarTypeOptions) ?? []
freeSpotTextOptions = try container.decodeIfPresent([FreeSpotTexts].self, forKey: .freeSpotTextOptions) ?? []
bookingStatusOptions = try container.decodeIfPresent([BookingStatusOptions].self, forKey: .bookingStatusOptions) ?? []
freeSpotTextsInfo = try container.decodeIfPresent(FreeSpotTexts.self, forKey: .freeSpotTextsInfo)
freeSpotsTextSingular = try container.decodeIfPresent(String.self, forKey: .freeSpotsTextSingular)
freeSpotsTextPlural = try container.decodeIfPresent(String.self, forKey: .freeSpotsTextPlural)
bookingStatusId = try container.decodeIfPresent(Int.self, forKey: .bookingStatusId)
scheduleViewId = try container.decodeIfPresent(Int.self, forKey: .scheduleViewId)
bookingTemplateId = try container.decodeIfPresent(Int.self, forKey: .bookingTemplateId)
calendarTypeId = try container.decodeIfPresent(Int.self, forKey: .calendarTypeId)
allowBookingOnUnbookedTimes = try container.decodeIfPresent(Bool.self, forKey: .allowBookingOnUnbookedTimes)
sendEmailReminder = try container.decodeIfPresent(Bool.self, forKey: .sendEmailReminder)
sendSmsReminder = try container.decodeIfPresent(Bool.self, forKey: .sendSmsReminder)
sendSmsConfirmation = try container.decodeIfPresent(Bool.self, forKey: .sendSmsConfirmation)
emailReminderTime = try container.decodeIfPresent(Int.self, forKey: .emailReminderTime)
smsReminderTime = try container.decodeIfPresent(Int.self, forKey: .smsReminderTime)
maxActiveBookings = try container.decodeIfPresent(Int.self, forKey: .maxActiveBookings)
sendNotifications = try container.decodeIfPresent(Bool.self, forKey: .sendNotifications)
sendNotificationsEmail = try container.decodeIfPresent(String.self, forKey: .sendNotificationsEmail)
enableMobileApp = try container.decodeIfPresent(Bool.self, forKey: .enableMobileApp)
scheduleStartTime = try container.convertIfPresent(TimeInterval.self, forKey: .scheduleStartTime)
scheduleEndTime = try container.convertIfPresent(TimeInterval.self, forKey: .scheduleEndTime)
receiptTemplate = try container.decodeIfPresent(String.self, forKey: .receiptTemplate)
scheduleTimeSlotMinutes = try container.decodeIfPresent(Int.self, forKey: .scheduleTimeSlotMinutes)
showFreeTimesLeft = try container.decodeIfPresent(Bool.self, forKey: .showFreeTimesLeft)
enableICalGroupBookings = try container.decodeIfPresent(Bool.self, forKey: .enableICalGroupBookings)
agreementTemplate = try container.decodeIfPresent(String.self, forKey: .agreementTemplate)
scheduleShowTimeExeptions = try container.decodeIfPresent(Bool.self, forKey: .scheduleShowTimeExeptions)
enableBookingsOnSameTime = try container.decodeIfPresent(Bool.self, forKey: .enableBookingsOnSameTime)
showWeekNumberSettingId = try container.decodeIfPresent(Int.self, forKey: .showWeekNumberSettingId)
enableShowBookedTimes = try container.decodeIfPresent(Bool.self, forKey: .enableShowBookedTimes)
enableSendFollowUpMessage = try container.decodeIfPresent(Bool.self, forKey: .enableSendFollowUpMessage)
followUpMessageTime = try container.decodeIfPresent(Int.self, forKey: .followUpMessageTime)
messageText = try container.decodeIfPresent(String.self, forKey: .messageText)
scheduleGroupResources = try container.decodeIfPresent(Bool.self, forKey: .scheduleGroupResources)
bookSpotUserResponseMinutes = try container.decodeIfPresent(Int.self, forKey: .bookSpotUserResponseMinutes)
isBookSpotDirectly = try container.decodeIfPresent(Bool.self, forKey: .isBookSpotDirectly)
bookSpotDirectlyTimeLeftMinutes = try container.decodeIfPresent(Int.self, forKey: .bookSpotDirectlyTimeLeftMinutes)
sendEmailNotificationQueue = try container.decodeIfPresent(Bool.self, forKey: .sendEmailNotificationQueue)
sendSMSNotificationQueue = try container.decodeIfPresent(Bool.self, forKey: .sendSMSNotificationQueue)
schedulerDisableHorizontalScrolling = try container.decodeIfPresent(Bool.self, forKey: .schedulerDisableHorizontalScrolling)
bookOnlyOnExistingCustomers = try container.decodeIfPresent(Bool.self, forKey: .bookOnlyOnExistingCustomers)
autoGenerateUniquePinCode = try container.decodeIfPresent(Bool.self, forKey: .autoGenerateUniquePinCode)
weightedPrices = try container.decodeIfPresent(Bool.self, forKey: .weightedPrices)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
autoCreateUserProfile = try container.decodeIfPresent(Bool.self, forKey: .autoCreateUserProfile)
showMultipleResourcesAsOne = try container.decodeIfPresent(Bool.self, forKey: .showMultipleResourcesAsOne)
showMultiDayAsTime = try container.decodeIfPresent(Bool.self, forKey: .showMultiDayAsTime)
id = try container.decodeIfPresent(String.self, forKey: .id)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if freeSpotTextsId != nil { try container.encode(freeSpotTextsId, forKey: .freeSpotTextsId) }
if sendEmailConfirmation != nil { try container.encode(sendEmailConfirmation, forKey: .sendEmailConfirmation) }
if scheduleViewOptions.count > 0 { try container.encode(scheduleViewOptions, forKey: .scheduleViewOptions) }
if weekNumberSettingOptions.count > 0 { try container.encode(weekNumberSettingOptions, forKey: .weekNumberSettingOptions) }
if bookingTemplateOptions.count > 0 { try container.encode(bookingTemplateOptions, forKey: .bookingTemplateOptions) }
if calendarTypeOptions.count > 0 { try container.encode(calendarTypeOptions, forKey: .calendarTypeOptions) }
if freeSpotTextOptions.count > 0 { try container.encode(freeSpotTextOptions, forKey: .freeSpotTextOptions) }
if bookingStatusOptions.count > 0 { try container.encode(bookingStatusOptions, forKey: .bookingStatusOptions) }
if freeSpotTextsInfo != nil { try container.encode(freeSpotTextsInfo, forKey: .freeSpotTextsInfo) }
if freeSpotsTextSingular != nil { try container.encode(freeSpotsTextSingular, forKey: .freeSpotsTextSingular) }
if freeSpotsTextPlural != nil { try container.encode(freeSpotsTextPlural, forKey: .freeSpotsTextPlural) }
if bookingStatusId != nil { try container.encode(bookingStatusId, forKey: .bookingStatusId) }
if scheduleViewId != nil { try container.encode(scheduleViewId, forKey: .scheduleViewId) }
if bookingTemplateId != nil { try container.encode(bookingTemplateId, forKey: .bookingTemplateId) }
if calendarTypeId != nil { try container.encode(calendarTypeId, forKey: .calendarTypeId) }
if allowBookingOnUnbookedTimes != nil { try container.encode(allowBookingOnUnbookedTimes, forKey: .allowBookingOnUnbookedTimes) }
if sendEmailReminder != nil { try container.encode(sendEmailReminder, forKey: .sendEmailReminder) }
if sendSmsReminder != nil { try container.encode(sendSmsReminder, forKey: .sendSmsReminder) }
if sendSmsConfirmation != nil { try container.encode(sendSmsConfirmation, forKey: .sendSmsConfirmation) }
if emailReminderTime != nil { try container.encode(emailReminderTime, forKey: .emailReminderTime) }
if smsReminderTime != nil { try container.encode(smsReminderTime, forKey: .smsReminderTime) }
if maxActiveBookings != nil { try container.encode(maxActiveBookings, forKey: .maxActiveBookings) }
if sendNotifications != nil { try container.encode(sendNotifications, forKey: .sendNotifications) }
if sendNotificationsEmail != nil { try container.encode(sendNotificationsEmail, forKey: .sendNotificationsEmail) }
if enableMobileApp != nil { try container.encode(enableMobileApp, forKey: .enableMobileApp) }
if scheduleStartTime != nil { try container.encode(scheduleStartTime, forKey: .scheduleStartTime) }
if scheduleEndTime != nil { try container.encode(scheduleEndTime, forKey: .scheduleEndTime) }
if receiptTemplate != nil { try container.encode(receiptTemplate, forKey: .receiptTemplate) }
if scheduleTimeSlotMinutes != nil { try container.encode(scheduleTimeSlotMinutes, forKey: .scheduleTimeSlotMinutes) }
if showFreeTimesLeft != nil { try container.encode(showFreeTimesLeft, forKey: .showFreeTimesLeft) }
if enableICalGroupBookings != nil { try container.encode(enableICalGroupBookings, forKey: .enableICalGroupBookings) }
if agreementTemplate != nil { try container.encode(agreementTemplate, forKey: .agreementTemplate) }
if scheduleShowTimeExeptions != nil { try container.encode(scheduleShowTimeExeptions, forKey: .scheduleShowTimeExeptions) }
if enableBookingsOnSameTime != nil { try container.encode(enableBookingsOnSameTime, forKey: .enableBookingsOnSameTime) }
if showWeekNumberSettingId != nil { try container.encode(showWeekNumberSettingId, forKey: .showWeekNumberSettingId) }
if enableShowBookedTimes != nil { try container.encode(enableShowBookedTimes, forKey: .enableShowBookedTimes) }
if enableSendFollowUpMessage != nil { try container.encode(enableSendFollowUpMessage, forKey: .enableSendFollowUpMessage) }
if followUpMessageTime != nil { try container.encode(followUpMessageTime, forKey: .followUpMessageTime) }
if messageText != nil { try container.encode(messageText, forKey: .messageText) }
if scheduleGroupResources != nil { try container.encode(scheduleGroupResources, forKey: .scheduleGroupResources) }
if bookSpotUserResponseMinutes != nil { try container.encode(bookSpotUserResponseMinutes, forKey: .bookSpotUserResponseMinutes) }
if isBookSpotDirectly != nil { try container.encode(isBookSpotDirectly, forKey: .isBookSpotDirectly) }
if bookSpotDirectlyTimeLeftMinutes != nil { try container.encode(bookSpotDirectlyTimeLeftMinutes, forKey: .bookSpotDirectlyTimeLeftMinutes) }
if sendEmailNotificationQueue != nil { try container.encode(sendEmailNotificationQueue, forKey: .sendEmailNotificationQueue) }
if sendSMSNotificationQueue != nil { try container.encode(sendSMSNotificationQueue, forKey: .sendSMSNotificationQueue) }
if schedulerDisableHorizontalScrolling != nil { try container.encode(schedulerDisableHorizontalScrolling, forKey: .schedulerDisableHorizontalScrolling) }
if bookOnlyOnExistingCustomers != nil { try container.encode(bookOnlyOnExistingCustomers, forKey: .bookOnlyOnExistingCustomers) }
if autoGenerateUniquePinCode != nil { try container.encode(autoGenerateUniquePinCode, forKey: .autoGenerateUniquePinCode) }
if weightedPrices != nil { try container.encode(weightedPrices, forKey: .weightedPrices) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if autoCreateUserProfile != nil { try container.encode(autoCreateUserProfile, forKey: .autoCreateUserProfile) }
if showMultipleResourcesAsOne != nil { try container.encode(showMultipleResourcesAsOne, forKey: .showMultipleResourcesAsOne) }
if showMultiDayAsTime != nil { try container.encode(showMultiDayAsTime, forKey: .showMultiDayAsTime) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class ScheduleView : BaseModel
{
// @Required()
public var name:String?
public var modifiedDate:Date?
public var id:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case modifiedDate
case id
}
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)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class WeekNumberSetting : BaseModel
{
// @Required()
public var name:String?
// @Required()
public var Description:String?
public var modifiedDate:Date?
// @Required()
public var id:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case Description
case modifiedDate
case id
}
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)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 Description != nil { try container.encode(Description, forKey: .Description) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class BookingTemplate : BaseModel
{
// @Required()
public var name:String?
// @Required()
public var Description:String?
// @Required()
public var usedByApplication:String?
public var modifiedDate:Date?
public var id:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case Description
case usedByApplication
case modifiedDate
case id
}
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)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
usedByApplication = try container.decodeIfPresent(String.self, forKey: .usedByApplication)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 Description != nil { try container.encode(Description, forKey: .Description) }
if usedByApplication != nil { try container.encode(usedByApplication, forKey: .usedByApplication) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class CalendarType : BaseModel
{
// @Required()
public var name:String?
// @Required()
public var Description:String?
// @Required()
public var active:Bool?
public var modifiedDate:Date?
public var id:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case Description
case active
case modifiedDate
case id
}
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)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
active = try container.decodeIfPresent(Bool.self, forKey: .active)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 Description != nil { try container.encode(Description, forKey: .Description) }
if active != nil { try container.encode(active, forKey: .active) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class FreeSpotTexts : BaseModel
{
// @Required()
public var textSingular:String?
// @Required()
public var textPlural:String?
public var modifiedDate:Date?
// @Required()
public var id:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case textSingular
case textPlural
case modifiedDate
case id
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
textSingular = try container.decodeIfPresent(String.self, forKey: .textSingular)
textPlural = try container.decodeIfPresent(String.self, forKey: .textPlural)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if textSingular != nil { try container.encode(textSingular, forKey: .textSingular) }
if textPlural != nil { try container.encode(textPlural, forKey: .textPlural) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class BookingStatusOptions : Codable
{
public var id:Int
public var name:String
public var Description:String
required public init(){}
}
public class CompanyType : BaseModel
{
// @Required()
public var name:String?
// @Required()
public var Description:String?
public var modifiedDate:Date?
// @Required()
public var id:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case Description
case modifiedDate
case id
}
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)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 Description != nil { try container.encode(Description, forKey: .Description) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class CodeLockSetting : BaseModel
{
// @Ignore()
public var codeLockSystemOptions:[CodeLockSystem] = []
// @Required()
public var active:Bool?
// @Required()
public var codeLockSystemsId:Int?
// @Required()
public var validBeforeMinutes:Int?
// @Required()
public var validAfterMinutes:Int?
// @Required()
public var deleteOldBySchedule:Bool?
// @Required()
public var created:Date?
// @Required()
public var updated:Date?
public var modifiedDate:Date?
// @Required()
public var sendEmailNotification:Bool?
// @Required()
public var sendSMSNotification:Bool?
// @Required()
public var emailNotificationTime:Int16?
// @Required()
public var smsNotificationTime:Int16?
// @Required()
public var id:String?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case codeLockSystemOptions
case active
case codeLockSystemsId
case validBeforeMinutes
case validAfterMinutes
case deleteOldBySchedule
case created
case updated
case modifiedDate
case sendEmailNotification
case sendSMSNotification
case emailNotificationTime
case smsNotificationTime
case id
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
codeLockSystemOptions = try container.decodeIfPresent([CodeLockSystem].self, forKey: .codeLockSystemOptions) ?? []
active = try container.decodeIfPresent(Bool.self, forKey: .active)
codeLockSystemsId = try container.decodeIfPresent(Int.self, forKey: .codeLockSystemsId)
validBeforeMinutes = try container.decodeIfPresent(Int.self, forKey: .validBeforeMinutes)
validAfterMinutes = try container.decodeIfPresent(Int.self, forKey: .validAfterMinutes)
deleteOldBySchedule = try container.decodeIfPresent(Bool.self, forKey: .deleteOldBySchedule)
created = try container.decodeIfPresent(Date.self, forKey: .created)
updated = try container.decodeIfPresent(Date.self, forKey: .updated)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
sendEmailNotification = try container.decodeIfPresent(Bool.self, forKey: .sendEmailNotification)
sendSMSNotification = try container.decodeIfPresent(Bool.self, forKey: .sendSMSNotification)
emailNotificationTime = try container.decodeIfPresent(Int16.self, forKey: .emailNotificationTime)
smsNotificationTime = try container.decodeIfPresent(Int16.self, forKey: .smsNotificationTime)
id = try container.decodeIfPresent(String.self, forKey: .id)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if codeLockSystemOptions.count > 0 { try container.encode(codeLockSystemOptions, forKey: .codeLockSystemOptions) }
if active != nil { try container.encode(active, forKey: .active) }
if codeLockSystemsId != nil { try container.encode(codeLockSystemsId, forKey: .codeLockSystemsId) }
if validBeforeMinutes != nil { try container.encode(validBeforeMinutes, forKey: .validBeforeMinutes) }
if validAfterMinutes != nil { try container.encode(validAfterMinutes, forKey: .validAfterMinutes) }
if deleteOldBySchedule != nil { try container.encode(deleteOldBySchedule, forKey: .deleteOldBySchedule) }
if created != nil { try container.encode(created, forKey: .created) }
if updated != nil { try container.encode(updated, forKey: .updated) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if sendEmailNotification != nil { try container.encode(sendEmailNotification, forKey: .sendEmailNotification) }
if sendSMSNotification != nil { try container.encode(sendSMSNotification, forKey: .sendSMSNotification) }
if emailNotificationTime != nil { try container.encode(emailNotificationTime, forKey: .emailNotificationTime) }
if smsNotificationTime != nil { try container.encode(smsNotificationTime, forKey: .smsNotificationTime) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class CodeLockSystem : BaseModel
{
// @Required()
public var name:String?
// @Required()
public var supplier:String?
public var logoType:String
// @Required()
public var Description:String?
public var modifiedDate:Date?
// @Required()
public var id:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case supplier
case logoType
case Description
case modifiedDate
case id
}
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)
supplier = try container.decodeIfPresent(String.self, forKey: .supplier)
logoType = try container.decodeIfPresent(String.self, forKey: .logoType)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 supplier != nil { try container.encode(supplier, forKey: .supplier) }
if logoType != nil { try container.encode(logoType, forKey: .logoType) }
if Description != nil { try container.encode(Description, forKey: .Description) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class PaymentSetting : BaseModel
{
public var adminPaymentOption:AdminPaymentOptions
// @Ignore()
public var adminPaymentOptions:[AdminPaymentOptions] = []
// @Ignore()
public var paymentProviderOptions:[PaymentProviders] = []
// @Required()
public var enabled:Bool?
// @Required()
public var invoiceFee:Int?
// @Required()
public var allowCreditCardPayment:Bool?
// @Required()
public var allowInvoicePayment:Bool?
// @Required()
public var allowBankPayment:Bool?
// @Required()
public var guaranteeOffered:Bool?
// @Required()
public var refundOnCancelBooking:Bool?
public var defaultPaymentOptionId:Int?
// @Required()
public var paymentProviderId:Int?
// @Required()
public var sendPaymentRequestDirectly:Bool?
public var modifiedDate:Date?
// @Required()
public var id:String?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case adminPaymentOption
case adminPaymentOptions
case paymentProviderOptions
case enabled
case invoiceFee
case allowCreditCardPayment
case allowInvoicePayment
case allowBankPayment
case guaranteeOffered
case refundOnCancelBooking
case defaultPaymentOptionId
case paymentProviderId
case sendPaymentRequestDirectly
case modifiedDate
case id
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
adminPaymentOption = try container.decodeIfPresent(AdminPaymentOptions.self, forKey: .adminPaymentOption)
adminPaymentOptions = try container.decodeIfPresent([AdminPaymentOptions].self, forKey: .adminPaymentOptions) ?? []
paymentProviderOptions = try container.decodeIfPresent([PaymentProviders].self, forKey: .paymentProviderOptions) ?? []
enabled = try container.decodeIfPresent(Bool.self, forKey: .enabled)
invoiceFee = try container.decodeIfPresent(Int.self, forKey: .invoiceFee)
allowCreditCardPayment = try container.decodeIfPresent(Bool.self, forKey: .allowCreditCardPayment)
allowInvoicePayment = try container.decodeIfPresent(Bool.self, forKey: .allowInvoicePayment)
allowBankPayment = try container.decodeIfPresent(Bool.self, forKey: .allowBankPayment)
guaranteeOffered = try container.decodeIfPresent(Bool.self, forKey: .guaranteeOffered)
refundOnCancelBooking = try container.decodeIfPresent(Bool.self, forKey: .refundOnCancelBooking)
defaultPaymentOptionId = try container.decodeIfPresent(Int.self, forKey: .defaultPaymentOptionId)
paymentProviderId = try container.decodeIfPresent(Int.self, forKey: .paymentProviderId)
sendPaymentRequestDirectly = try container.decodeIfPresent(Bool.self, forKey: .sendPaymentRequestDirectly)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(String.self, forKey: .id)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if adminPaymentOption != nil { try container.encode(adminPaymentOption, forKey: .adminPaymentOption) }
if adminPaymentOptions.count > 0 { try container.encode(adminPaymentOptions, forKey: .adminPaymentOptions) }
if paymentProviderOptions.count > 0 { try container.encode(paymentProviderOptions, forKey: .paymentProviderOptions) }
if enabled != nil { try container.encode(enabled, forKey: .enabled) }
if invoiceFee != nil { try container.encode(invoiceFee, forKey: .invoiceFee) }
if allowCreditCardPayment != nil { try container.encode(allowCreditCardPayment, forKey: .allowCreditCardPayment) }
if allowInvoicePayment != nil { try container.encode(allowInvoicePayment, forKey: .allowInvoicePayment) }
if allowBankPayment != nil { try container.encode(allowBankPayment, forKey: .allowBankPayment) }
if guaranteeOffered != nil { try container.encode(guaranteeOffered, forKey: .guaranteeOffered) }
if refundOnCancelBooking != nil { try container.encode(refundOnCancelBooking, forKey: .refundOnCancelBooking) }
if defaultPaymentOptionId != nil { try container.encode(defaultPaymentOptionId, forKey: .defaultPaymentOptionId) }
if paymentProviderId != nil { try container.encode(paymentProviderId, forKey: .paymentProviderId) }
if sendPaymentRequestDirectly != nil { try container.encode(sendPaymentRequestDirectly, forKey: .sendPaymentRequestDirectly) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class AdminPaymentOptions : BaseModel
{
// @Required()
public var name:String?
// @Required()
public var Description:String?
public var modifiedDate:Date?
// @Required()
public var id:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case Description
case modifiedDate
case id
}
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)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 Description != nil { try container.encode(Description, forKey: .Description) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class PaymentProviders : BaseModel
{
// @Required()
public var name:String?
// @Required()
public var Description:String?
// @Required()
public var category:String?
public var url:String
// @Required()
public var active:Bool?
public var modifiedDate:Date?
// @Required()
public var id:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case Description
case category
case url
case active
case modifiedDate
case id
}
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)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
category = try container.decodeIfPresent(String.self, forKey: .category)
url = try container.decodeIfPresent(String.self, forKey: .url)
active = try container.decodeIfPresent(Bool.self, forKey: .active)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 Description != nil { try container.encode(Description, forKey: .Description) }
if category != nil { try container.encode(category, forKey: .category) }
if url != nil { try container.encode(url, forKey: .url) }
if active != nil { try container.encode(active, forKey: .active) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class CompanySetting : BaseModel
{
// @Ignore()
public var languages:[LanguageResponse] = []
// @Required()
public var active:Bool?
public var inactiveMessage:String
// @Required()
public var searchable:Bool?
public var gaTrackingId:String
public var facebookPixelId:String
// @Required()
public var multiLanguage:Bool?
// @Required()
public var enableAPITranslation:Bool?
// @Required()
public var defaultLanguage:String?
public var modifiedDate:Date?
public var gtmTrackingId:String
// @Required()
public var showOnMarketPlace:Bool?
public var googleAdsConversionId:String
public var linkedinTagId:String
public var googleAdsConversionLabel:String
public var sendCustomerInformationToExternalProviders:Bool
// @Required()
public var id:String?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case languages
case active
case inactiveMessage
case searchable
case gaTrackingId
case facebookPixelId
case multiLanguage
case enableAPITranslation
case defaultLanguage
case modifiedDate
case gtmTrackingId
case showOnMarketPlace
case googleAdsConversionId
case linkedinTagId
case googleAdsConversionLabel
case sendCustomerInformationToExternalProviders
case id
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
languages = try container.decodeIfPresent([LanguageResponse].self, forKey: .languages) ?? []
active = try container.decodeIfPresent(Bool.self, forKey: .active)
inactiveMessage = try container.decodeIfPresent(String.self, forKey: .inactiveMessage)
searchable = try container.decodeIfPresent(Bool.self, forKey: .searchable)
gaTrackingId = try container.decodeIfPresent(String.self, forKey: .gaTrackingId)
facebookPixelId = try container.decodeIfPresent(String.self, forKey: .facebookPixelId)
multiLanguage = try container.decodeIfPresent(Bool.self, forKey: .multiLanguage)
enableAPITranslation = try container.decodeIfPresent(Bool.self, forKey: .enableAPITranslation)
defaultLanguage = try container.decodeIfPresent(String.self, forKey: .defaultLanguage)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
gtmTrackingId = try container.decodeIfPresent(String.self, forKey: .gtmTrackingId)
showOnMarketPlace = try container.decodeIfPresent(Bool.self, forKey: .showOnMarketPlace)
googleAdsConversionId = try container.decodeIfPresent(String.self, forKey: .googleAdsConversionId)
linkedinTagId = try container.decodeIfPresent(String.self, forKey: .linkedinTagId)
googleAdsConversionLabel = try container.decodeIfPresent(String.self, forKey: .googleAdsConversionLabel)
sendCustomerInformationToExternalProviders = try container.decodeIfPresent(Bool.self, forKey: .sendCustomerInformationToExternalProviders)
id = try container.decodeIfPresent(String.self, forKey: .id)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if languages.count > 0 { try container.encode(languages, forKey: .languages) }
if active != nil { try container.encode(active, forKey: .active) }
if inactiveMessage != nil { try container.encode(inactiveMessage, forKey: .inactiveMessage) }
if searchable != nil { try container.encode(searchable, forKey: .searchable) }
if gaTrackingId != nil { try container.encode(gaTrackingId, forKey: .gaTrackingId) }
if facebookPixelId != nil { try container.encode(facebookPixelId, forKey: .facebookPixelId) }
if multiLanguage != nil { try container.encode(multiLanguage, forKey: .multiLanguage) }
if enableAPITranslation != nil { try container.encode(enableAPITranslation, forKey: .enableAPITranslation) }
if defaultLanguage != nil { try container.encode(defaultLanguage, forKey: .defaultLanguage) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if gtmTrackingId != nil { try container.encode(gtmTrackingId, forKey: .gtmTrackingId) }
if showOnMarketPlace != nil { try container.encode(showOnMarketPlace, forKey: .showOnMarketPlace) }
if googleAdsConversionId != nil { try container.encode(googleAdsConversionId, forKey: .googleAdsConversionId) }
if linkedinTagId != nil { try container.encode(linkedinTagId, forKey: .linkedinTagId) }
if googleAdsConversionLabel != nil { try container.encode(googleAdsConversionLabel, forKey: .googleAdsConversionLabel) }
if sendCustomerInformationToExternalProviders != nil { try container.encode(sendCustomerInformationToExternalProviders, forKey: .sendCustomerInformationToExternalProviders) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class LanguageResponse : Codable
{
public var id:String
public var name:String
required public init(){}
}
public class HomepageWidgetSetting : BaseModel
{
// @Ignore()
public var widgetServiceLayoutOptions:[WidgetServiceLayouts] = []
// @Ignore()
public var widgetTimeLayoutOptions:[WidgetTimeLayouts] = []
// @Ignore()
public var widgetBookingLayoutOptions:[WidgetBookingLayouts] = []
// @Ignore()
public var widgetBookingMethodOptions:[WidgetBookingMethods] = []
// @Required()
public var serviceLayoutId:Int?
// @Required()
public var timeLayoutId:Int?
// @Required()
public var bookingLayoutId:Int?
// @Required()
public var primaryColor:String?
// @Required()
public var showServiceImage:Bool?
// @Required()
public var showNextAvailableTime:Bool?
// @Required()
public var showEndTime:Bool?
public var bookedTimeSlotText:String
// @Required()
public var darkTheme:Bool?
// @Required()
public var showRebateCodeField:Bool?
public var modifiedDate:Date?
// @Required()
public var enableCreateAccount:Bool?
// @Required()
public var enableLogin:Bool?
// @Required()
public var enableDirectBooking:Bool?
// @Required()
public var enableFacebookLogin:Bool?
// @Required()
public var showSubscribeToNewsletter:Bool?
// @Required()
public var id:String?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case widgetServiceLayoutOptions
case widgetTimeLayoutOptions
case widgetBookingLayoutOptions
case widgetBookingMethodOptions
case serviceLayoutId
case timeLayoutId
case bookingLayoutId
case primaryColor
case showServiceImage
case showNextAvailableTime
case showEndTime
case bookedTimeSlotText
case darkTheme
case showRebateCodeField
case modifiedDate
case enableCreateAccount
case enableLogin
case enableDirectBooking
case enableFacebookLogin
case showSubscribeToNewsletter
case id
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
widgetServiceLayoutOptions = try container.decodeIfPresent([WidgetServiceLayouts].self, forKey: .widgetServiceLayoutOptions) ?? []
widgetTimeLayoutOptions = try container.decodeIfPresent([WidgetTimeLayouts].self, forKey: .widgetTimeLayoutOptions) ?? []
widgetBookingLayoutOptions = try container.decodeIfPresent([WidgetBookingLayouts].self, forKey: .widgetBookingLayoutOptions) ?? []
widgetBookingMethodOptions = try container.decodeIfPresent([WidgetBookingMethods].self, forKey: .widgetBookingMethodOptions) ?? []
serviceLayoutId = try container.decodeIfPresent(Int.self, forKey: .serviceLayoutId)
timeLayoutId = try container.decodeIfPresent(Int.self, forKey: .timeLayoutId)
bookingLayoutId = try container.decodeIfPresent(Int.self, forKey: .bookingLayoutId)
primaryColor = try container.decodeIfPresent(String.self, forKey: .primaryColor)
showServiceImage = try container.decodeIfPresent(Bool.self, forKey: .showServiceImage)
showNextAvailableTime = try container.decodeIfPresent(Bool.self, forKey: .showNextAvailableTime)
showEndTime = try container.decodeIfPresent(Bool.self, forKey: .showEndTime)
bookedTimeSlotText = try container.decodeIfPresent(String.self, forKey: .bookedTimeSlotText)
darkTheme = try container.decodeIfPresent(Bool.self, forKey: .darkTheme)
showRebateCodeField = try container.decodeIfPresent(Bool.self, forKey: .showRebateCodeField)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
enableCreateAccount = try container.decodeIfPresent(Bool.self, forKey: .enableCreateAccount)
enableLogin = try container.decodeIfPresent(Bool.self, forKey: .enableLogin)
enableDirectBooking = try container.decodeIfPresent(Bool.self, forKey: .enableDirectBooking)
enableFacebookLogin = try container.decodeIfPresent(Bool.self, forKey: .enableFacebookLogin)
showSubscribeToNewsletter = try container.decodeIfPresent(Bool.self, forKey: .showSubscribeToNewsletter)
id = try container.decodeIfPresent(String.self, forKey: .id)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if widgetServiceLayoutOptions.count > 0 { try container.encode(widgetServiceLayoutOptions, forKey: .widgetServiceLayoutOptions) }
if widgetTimeLayoutOptions.count > 0 { try container.encode(widgetTimeLayoutOptions, forKey: .widgetTimeLayoutOptions) }
if widgetBookingLayoutOptions.count > 0 { try container.encode(widgetBookingLayoutOptions, forKey: .widgetBookingLayoutOptions) }
if widgetBookingMethodOptions.count > 0 { try container.encode(widgetBookingMethodOptions, forKey: .widgetBookingMethodOptions) }
if serviceLayoutId != nil { try container.encode(serviceLayoutId, forKey: .serviceLayoutId) }
if timeLayoutId != nil { try container.encode(timeLayoutId, forKey: .timeLayoutId) }
if bookingLayoutId != nil { try container.encode(bookingLayoutId, forKey: .bookingLayoutId) }
if primaryColor != nil { try container.encode(primaryColor, forKey: .primaryColor) }
if showServiceImage != nil { try container.encode(showServiceImage, forKey: .showServiceImage) }
if showNextAvailableTime != nil { try container.encode(showNextAvailableTime, forKey: .showNextAvailableTime) }
if showEndTime != nil { try container.encode(showEndTime, forKey: .showEndTime) }
if bookedTimeSlotText != nil { try container.encode(bookedTimeSlotText, forKey: .bookedTimeSlotText) }
if darkTheme != nil { try container.encode(darkTheme, forKey: .darkTheme) }
if showRebateCodeField != nil { try container.encode(showRebateCodeField, forKey: .showRebateCodeField) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if enableCreateAccount != nil { try container.encode(enableCreateAccount, forKey: .enableCreateAccount) }
if enableLogin != nil { try container.encode(enableLogin, forKey: .enableLogin) }
if enableDirectBooking != nil { try container.encode(enableDirectBooking, forKey: .enableDirectBooking) }
if enableFacebookLogin != nil { try container.encode(enableFacebookLogin, forKey: .enableFacebookLogin) }
if showSubscribeToNewsletter != nil { try container.encode(showSubscribeToNewsletter, forKey: .showSubscribeToNewsletter) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class WidgetServiceLayouts : BaseModel
{
// @Required()
public var name:String?
// @Required()
public var Description:String?
// @Required()
public var code:String?
public var modifiedDate:Date?
// @Required()
public var id:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case Description
case code
case modifiedDate
case id
}
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)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
code = try container.decodeIfPresent(String.self, forKey: .code)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 Description != nil { try container.encode(Description, forKey: .Description) }
if code != nil { try container.encode(code, forKey: .code) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class WidgetTimeLayouts : BaseModel
{
// @Required()
public var name:String?
// @Required()
public var Description:String?
// @Required()
public var code:String?
public var modifiedDate:Date?
// @Required()
public var id:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case Description
case code
case modifiedDate
case id
}
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)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
code = try container.decodeIfPresent(String.self, forKey: .code)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 Description != nil { try container.encode(Description, forKey: .Description) }
if code != nil { try container.encode(code, forKey: .code) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class WidgetBookingLayouts : BaseModel
{
// @Required()
public var name:String?
// @Required()
public var Description:String?
// @Required()
public var code:String?
public var modifiedDate:Date?
// @Required()
public var id:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case Description
case code
case modifiedDate
case id
}
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)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
code = try container.decodeIfPresent(String.self, forKey: .code)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 Description != nil { try container.encode(Description, forKey: .Description) }
if code != nil { try container.encode(code, forKey: .code) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class WidgetBookingMethods : BaseModel
{
// @Required()
public var name:String?
// @Required()
public var Description:String?
// @Required()
public var code:String?
public var modifiedDate:Date?
// @Required()
public var id:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case Description
case code
case modifiedDate
case id
}
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)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
code = try container.decodeIfPresent(String.self, forKey: .code)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 Description != nil { try container.encode(Description, forKey: .Description) }
if code != nil { try container.encode(code, forKey: .code) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class HomepageSetting : BaseModel, ICompany
{
// @Ignore()
public var homepageTemplateOptions:[HomepageTemplate] = []
// @Ignore()
public var homepageHeroSectionStyleOptions:[HeroSectionStyle] = []
// @Ignore()
public var companyId:String?
public var welcomePageHeading:String
public var welcomePageBody:String
public var aboutUsPageHeading:String
public var aboutUsPageBody:String
// @Required()
public var homePageTemplateId:Int?
public var imageUrl:String
// @Required()
public var updated:Date?
// @Required()
public var created:Date?
public var homepageHeading:String
// @Required()
public var heroSectionStyleId:Int?
public var modifiedDate:Date?
// @Required()
public var showRating:Bool?
// @Required()
public var enableHomepage:Bool?
// @Required()
public var id:String?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case homepageTemplateOptions
case homepageHeroSectionStyleOptions
case companyId
case welcomePageHeading
case welcomePageBody
case aboutUsPageHeading
case aboutUsPageBody
case homePageTemplateId
case imageUrl
case updated
case created
case homepageHeading
case heroSectionStyleId
case modifiedDate
case showRating
case enableHomepage
case id
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
homepageTemplateOptions = try container.decodeIfPresent([HomepageTemplate].self, forKey: .homepageTemplateOptions) ?? []
homepageHeroSectionStyleOptions = try container.decodeIfPresent([HeroSectionStyle].self, forKey: .homepageHeroSectionStyleOptions) ?? []
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
welcomePageHeading = try container.decodeIfPresent(String.self, forKey: .welcomePageHeading)
welcomePageBody = try container.decodeIfPresent(String.self, forKey: .welcomePageBody)
aboutUsPageHeading = try container.decodeIfPresent(String.self, forKey: .aboutUsPageHeading)
aboutUsPageBody = try container.decodeIfPresent(String.self, forKey: .aboutUsPageBody)
homePageTemplateId = try container.decodeIfPresent(Int.self, forKey: .homePageTemplateId)
imageUrl = try container.decodeIfPresent(String.self, forKey: .imageUrl)
updated = try container.decodeIfPresent(Date.self, forKey: .updated)
created = try container.decodeIfPresent(Date.self, forKey: .created)
homepageHeading = try container.decodeIfPresent(String.self, forKey: .homepageHeading)
heroSectionStyleId = try container.decodeIfPresent(Int.self, forKey: .heroSectionStyleId)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
showRating = try container.decodeIfPresent(Bool.self, forKey: .showRating)
enableHomepage = try container.decodeIfPresent(Bool.self, forKey: .enableHomepage)
id = try container.decodeIfPresent(String.self, forKey: .id)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if homepageTemplateOptions.count > 0 { try container.encode(homepageTemplateOptions, forKey: .homepageTemplateOptions) }
if homepageHeroSectionStyleOptions.count > 0 { try container.encode(homepageHeroSectionStyleOptions, forKey: .homepageHeroSectionStyleOptions) }
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if welcomePageHeading != nil { try container.encode(welcomePageHeading, forKey: .welcomePageHeading) }
if welcomePageBody != nil { try container.encode(welcomePageBody, forKey: .welcomePageBody) }
if aboutUsPageHeading != nil { try container.encode(aboutUsPageHeading, forKey: .aboutUsPageHeading) }
if aboutUsPageBody != nil { try container.encode(aboutUsPageBody, forKey: .aboutUsPageBody) }
if homePageTemplateId != nil { try container.encode(homePageTemplateId, forKey: .homePageTemplateId) }
if imageUrl != nil { try container.encode(imageUrl, forKey: .imageUrl) }
if updated != nil { try container.encode(updated, forKey: .updated) }
if created != nil { try container.encode(created, forKey: .created) }
if homepageHeading != nil { try container.encode(homepageHeading, forKey: .homepageHeading) }
if heroSectionStyleId != nil { try container.encode(heroSectionStyleId, forKey: .heroSectionStyleId) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if showRating != nil { try container.encode(showRating, forKey: .showRating) }
if enableHomepage != nil { try container.encode(enableHomepage, forKey: .enableHomepage) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class HomepageTemplate : BaseModel
{
// @Required()
public var name:String?
// @Required()
public var Description:String?
public var imageUrl:Uri
// @Required()
public var premium:Bool?
public var modifiedDate:Date?
public var id:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case Description
case imageUrl
case premium
case modifiedDate
case id
}
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)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
imageUrl = try container.decodeIfPresent(Uri.self, forKey: .imageUrl)
premium = try container.decodeIfPresent(Bool.self, forKey: .premium)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 Description != nil { try container.encode(Description, forKey: .Description) }
if imageUrl != nil { try container.encode(imageUrl, forKey: .imageUrl) }
if premium != nil { try container.encode(premium, forKey: .premium) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class HeroSectionStyle : BaseModel
{
// @Required()
public var name:String?
public var Description:String
public var modifiedDate:Date?
// @Required()
public var id:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case Description
case modifiedDate
case id
}
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)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 Description != nil { try container.encode(Description, forKey: .Description) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class AverageRatingScore : Codable
{
public var averageScore:Double
public var score1Count:Int
public var score2Count:Int
public var score3Count:Int
public var score4Count:Int
public var score5Count:Int
public var count:Int
required public init(){}
}
public class Rating : BaseModel
{
public var reviewId:String?
public var review:Review
// @Required()
public var companyId:String?
// @Required()
public var bookingId:Int?
// @Required()
public var ratingScore:Int?
// @Required()
public var status:Int?
// @Required()
public var created:Date?
// @Required()
public var updated:Date?
public var modifiedDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case reviewId
case review
case companyId
case bookingId
case ratingScore
case status
case created
case updated
case modifiedDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
reviewId = try container.decodeIfPresent(String.self, forKey: .reviewId)
review = try container.decodeIfPresent(Review.self, forKey: .review)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
bookingId = try container.decodeIfPresent(Int.self, forKey: .bookingId)
ratingScore = try container.decodeIfPresent(Int.self, forKey: .ratingScore)
status = try container.decodeIfPresent(Int.self, forKey: .status)
created = try container.decodeIfPresent(Date.self, forKey: .created)
updated = try container.decodeIfPresent(Date.self, forKey: .updated)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if reviewId != nil { try container.encode(reviewId, forKey: .reviewId) }
if review != nil { try container.encode(review, forKey: .review) }
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if bookingId != nil { try container.encode(bookingId, forKey: .bookingId) }
if ratingScore != nil { try container.encode(ratingScore, forKey: .ratingScore) }
if status != nil { try container.encode(status, forKey: .status) }
if created != nil { try container.encode(created, forKey: .created) }
if updated != nil { try container.encode(updated, forKey: .updated) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
}
}
public class Review : BaseModel
{
public var reviewId:String
// @Required()
public var companyId:String?
// @Required()
public var title:String?
// @Required()
public var Description:String?
// @Required()
public var author:String?
// @Required()
public var status:Int?
// @Required()
public var created:Date?
// @Required()
public var updated:Date?
public var modifiedDate:Date?
public var reviewAnswer:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case reviewId
case companyId
case title
case Description
case author
case status
case created
case updated
case modifiedDate
case reviewAnswer
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
reviewId = try container.decodeIfPresent(String.self, forKey: .reviewId)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
title = try container.decodeIfPresent(String.self, forKey: .title)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
author = try container.decodeIfPresent(String.self, forKey: .author)
status = try container.decodeIfPresent(Int.self, forKey: .status)
created = try container.decodeIfPresent(Date.self, forKey: .created)
updated = try container.decodeIfPresent(Date.self, forKey: .updated)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
reviewAnswer = try container.decodeIfPresent(String.self, forKey: .reviewAnswer)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if reviewId != nil { try container.encode(reviewId, forKey: .reviewId) }
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if title != nil { try container.encode(title, forKey: .title) }
if Description != nil { try container.encode(Description, forKey: .Description) }
if author != nil { try container.encode(author, forKey: .author) }
if status != nil { try container.encode(status, forKey: .status) }
if created != nil { try container.encode(created, forKey: .created) }
if updated != nil { try container.encode(updated, forKey: .updated) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if reviewAnswer != nil { try container.encode(reviewAnswer, forKey: .reviewAnswer) }
}
}
public class License : BaseModel
{
public var type:LicenseType
// @Required()
public var companyId:String?
public var id:Int
// @Required()
public var typeId:Int?
// @Required()
public var validFrom:Date?
// @Required()
public var validTo:Date?
// @Required()
public var active:Bool?
// @Required()
public var updated:Date?
// @Required()
public var created:Date?
public var modifiedDate:Date?
public var metaData:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case type
case companyId
case id
case typeId
case validFrom
case validTo
case active
case updated
case created
case modifiedDate
case metaData
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
type = try container.decodeIfPresent(LicenseType.self, forKey: .type)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
id = try container.decodeIfPresent(Int.self, forKey: .id)
typeId = try container.decodeIfPresent(Int.self, forKey: .typeId)
validFrom = try container.decodeIfPresent(Date.self, forKey: .validFrom)
validTo = try container.decodeIfPresent(Date.self, forKey: .validTo)
active = try container.decodeIfPresent(Bool.self, forKey: .active)
updated = try container.decodeIfPresent(Date.self, forKey: .updated)
created = try container.decodeIfPresent(Date.self, forKey: .created)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
metaData = try container.decodeIfPresent(String.self, forKey: .metaData)
}
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 companyId != nil { try container.encode(companyId, forKey: .companyId) }
if id != nil { try container.encode(id, forKey: .id) }
if typeId != nil { try container.encode(typeId, forKey: .typeId) }
if validFrom != nil { try container.encode(validFrom, forKey: .validFrom) }
if validTo != nil { try container.encode(validTo, forKey: .validTo) }
if active != nil { try container.encode(active, forKey: .active) }
if updated != nil { try container.encode(updated, forKey: .updated) }
if created != nil { try container.encode(created, forKey: .created) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if metaData != nil { try container.encode(metaData, forKey: .metaData) }
}
}
public class LicenseType : BaseModel
{
// @Ignore()
public var licenseItems:IList<LicenseTypeItem>
// @Ignore()
public var prices:IList<LicensePrice>
// @Ignore()
public var periodOfNoticeDays:Int
// @Ignore()
public var nextLicenseOption:LicenseType
// @Required()
public var name:String?
// @Required()
public var Description:String?
// @Required()
public var extraLicenseOption:Bool?
public var modifiedDate:Date?
public var active:Bool
public var id:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case licenseItems
case prices
case periodOfNoticeDays
case nextLicenseOption
case name
case Description
case extraLicenseOption
case modifiedDate
case active
case id
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
licenseItems = try container.decodeIfPresent(IList<LicenseTypeItem>.self, forKey: .licenseItems)
prices = try container.decodeIfPresent(IList<LicensePrice>.self, forKey: .prices)
periodOfNoticeDays = try container.decodeIfPresent(Int.self, forKey: .periodOfNoticeDays)
nextLicenseOption = try container.decodeIfPresent(LicenseType.self, forKey: .nextLicenseOption)
name = try container.decodeIfPresent(String.self, forKey: .name)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
extraLicenseOption = try container.decodeIfPresent(Bool.self, forKey: .extraLicenseOption)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
active = try container.decodeIfPresent(Bool.self, forKey: .active)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if licenseItems != nil { try container.encode(licenseItems, forKey: .licenseItems) }
if prices != nil { try container.encode(prices, forKey: .prices) }
if periodOfNoticeDays != nil { try container.encode(periodOfNoticeDays, forKey: .periodOfNoticeDays) }
if nextLicenseOption != nil { try container.encode(nextLicenseOption, forKey: .nextLicenseOption) }
if name != nil { try container.encode(name, forKey: .name) }
if Description != nil { try container.encode(Description, forKey: .Description) }
if extraLicenseOption != nil { try container.encode(extraLicenseOption, forKey: .extraLicenseOption) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if active != nil { try container.encode(active, forKey: .active) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class LicenseTypeItem : BaseModel
{
// @Ignore()
public var name:String
// @Ignore()
public var licenseType:LicenseType
// @Required()
public var licenseTypesId:Int?
// @Required()
public var licenseItemsId:Int?
// @Required()
public var numberOfItems:Int?
public var id:Int
public var modifiedDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case licenseType
case licenseTypesId
case licenseItemsId
case numberOfItems
case id
case modifiedDate
}
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)
licenseType = try container.decodeIfPresent(LicenseType.self, forKey: .licenseType)
licenseTypesId = try container.decodeIfPresent(Int.self, forKey: .licenseTypesId)
licenseItemsId = try container.decodeIfPresent(Int.self, forKey: .licenseItemsId)
numberOfItems = try container.decodeIfPresent(Int.self, forKey: .numberOfItems)
id = try container.decodeIfPresent(Int.self, forKey: .id)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
}
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 licenseType != nil { try container.encode(licenseType, forKey: .licenseType) }
if licenseTypesId != nil { try container.encode(licenseTypesId, forKey: .licenseTypesId) }
if licenseItemsId != nil { try container.encode(licenseItemsId, forKey: .licenseItemsId) }
if numberOfItems != nil { try container.encode(numberOfItems, forKey: .numberOfItems) }
if id != nil { try container.encode(id, forKey: .id) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
}
}
public class LicensePrice : BaseModel
{
// @Ignore()
public var country:Country
// @Ignore()
public var monthlyPayment:Bool
// @Required()
public var licenseTypeId:Int?
// @Required()
public var countryId:String?
// @Required()
public var price:Int?
public var modifiedDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case country
case monthlyPayment
case licenseTypeId
case countryId
case price
case modifiedDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
country = try container.decodeIfPresent(Country.self, forKey: .country)
monthlyPayment = try container.decodeIfPresent(Bool.self, forKey: .monthlyPayment)
licenseTypeId = try container.decodeIfPresent(Int.self, forKey: .licenseTypeId)
countryId = try container.decodeIfPresent(String.self, forKey: .countryId)
price = try container.decodeIfPresent(Int.self, forKey: .price)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
}
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) }
if monthlyPayment != nil { try container.encode(monthlyPayment, forKey: .monthlyPayment) }
if licenseTypeId != nil { try container.encode(licenseTypeId, forKey: .licenseTypeId) }
if countryId != nil { try container.encode(countryId, forKey: .countryId) }
if price != nil { try container.encode(price, forKey: .price) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
}
}
public class Country : BaseModel
{
// @References(typeof(Currency))
public var currencyId:String
public var currencyInfo:Currency
// @Required()
public var name:String?
public var culture:String
public var timeZone:String
public var modifiedDate:Date?
// @Required()
public var id:String?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case currencyId
case currencyInfo
case name
case culture
case timeZone
case modifiedDate
case id
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
currencyId = try container.decodeIfPresent(String.self, forKey: .currencyId)
currencyInfo = try container.decodeIfPresent(Currency.self, forKey: .currencyInfo)
name = try container.decodeIfPresent(String.self, forKey: .name)
culture = try container.decodeIfPresent(String.self, forKey: .culture)
timeZone = try container.decodeIfPresent(String.self, forKey: .timeZone)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(String.self, forKey: .id)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if currencyId != nil { try container.encode(currencyId, forKey: .currencyId) }
if currencyInfo != nil { try container.encode(currencyInfo, forKey: .currencyInfo) }
if name != nil { try container.encode(name, forKey: .name) }
if culture != nil { try container.encode(culture, forKey: .culture) }
if timeZone != nil { try container.encode(timeZone, forKey: .timeZone) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class CompanyCategory : BaseModel
{
// @Required()
public var name:String?
// @Required()
public var header:String?
// @Required()
public var Description:String?
public var imageUrl:Uri
// @Required()
public var active:Bool?
public var sortOrder:Int?
public var modifiedDate:Date?
public var id:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case header
case Description
case imageUrl
case active
case sortOrder
case modifiedDate
case id
}
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)
header = try container.decodeIfPresent(String.self, forKey: .header)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
imageUrl = try container.decodeIfPresent(Uri.self, forKey: .imageUrl)
active = try container.decodeIfPresent(Bool.self, forKey: .active)
sortOrder = try container.decodeIfPresent(Int.self, forKey: .sortOrder)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 header != nil { try container.encode(header, forKey: .header) }
if Description != nil { try container.encode(Description, forKey: .Description) }
if imageUrl != nil { try container.encode(imageUrl, forKey: .imageUrl) }
if active != nil { try container.encode(active, forKey: .active) }
if sortOrder != nil { try container.encode(sortOrder, forKey: .sortOrder) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class CustomerComment : BaseModel
{
// @Required()
public var companyId:String?
public var id:Int
// @Required()
public var customerId:String?
// @Required()
public var comments:String?
// @Required()
public var updated:Date?
// @Required()
public var created:Date?
public var imageUrl:String
public var modifiedDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case companyId
case id
case customerId
case comments
case updated
case created
case imageUrl
case modifiedDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
id = try container.decodeIfPresent(Int.self, forKey: .id)
customerId = try container.decodeIfPresent(String.self, forKey: .customerId)
comments = try container.decodeIfPresent(String.self, forKey: .comments)
updated = try container.decodeIfPresent(Date.self, forKey: .updated)
created = try container.decodeIfPresent(Date.self, forKey: .created)
imageUrl = try container.decodeIfPresent(String.self, forKey: .imageUrl)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if id != nil { try container.encode(id, forKey: .id) }
if customerId != nil { try container.encode(customerId, forKey: .customerId) }
if comments != nil { try container.encode(comments, forKey: .comments) }
if updated != nil { try container.encode(updated, forKey: .updated) }
if created != nil { try container.encode(created, forKey: .created) }
if imageUrl != nil { try container.encode(imageUrl, forKey: .imageUrl) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
}
}
public class RebateCodeStatus : BaseModel
{
// @Required()
public var name:String?
public var Description:String
public var modifiedDate:Date?
public var id:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case Description
case modifiedDate
case id
}
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)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 Description != nil { try container.encode(Description, forKey: .Description) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class Article : BaseModel, IBaseModelCreated, IBaseModelUpdated
{
public var company:Company
public var currencyInfo:Currency
public var articleServiceRelations:[ArticleServiceRelation] = []
// @Ignore()
public var serviceIds:[Int] = []
// @Ignore()
public var articleType:ArticleTypeEnum
// @Ignore()
public var articleTypeName:String
// @Required()
public var companyId:String?
public var id:Int
// @Required()
public var name:String?
// @Required()
public var articleTypeId:Int?
public var Description:String
public var imageUrl:String
// @Required()
public var active:Bool?
// @Required()
public var amount:Int?
// @Required()
public var price:Double?
// @Required()
// @StringLength(50)
public var currencyId:String?
// @Required()
public var updatedDate:Date?
// @Required()
public var createdDate:Date?
public var modifiedDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case company
case currencyInfo
case articleServiceRelations
case serviceIds
case articleType
case articleTypeName
case companyId
case id
case name
case articleTypeId
case Description
case imageUrl
case active
case amount
case price
case currencyId
case updatedDate
case createdDate
case modifiedDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
company = try container.decodeIfPresent(Company.self, forKey: .company)
currencyInfo = try container.decodeIfPresent(Currency.self, forKey: .currencyInfo)
articleServiceRelations = try container.decodeIfPresent([ArticleServiceRelation].self, forKey: .articleServiceRelations) ?? []
serviceIds = try container.decodeIfPresent([Int].self, forKey: .serviceIds) ?? []
articleType = try container.decodeIfPresent(ArticleTypeEnum.self, forKey: .articleType)
articleTypeName = try container.decodeIfPresent(String.self, forKey: .articleTypeName)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
id = try container.decodeIfPresent(Int.self, forKey: .id)
name = try container.decodeIfPresent(String.self, forKey: .name)
articleTypeId = try container.decodeIfPresent(Int.self, forKey: .articleTypeId)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
imageUrl = try container.decodeIfPresent(String.self, forKey: .imageUrl)
active = try container.decodeIfPresent(Bool.self, forKey: .active)
amount = try container.decodeIfPresent(Int.self, forKey: .amount)
price = try container.decodeIfPresent(Double.self, forKey: .price)
currencyId = try container.decodeIfPresent(String.self, forKey: .currencyId)
updatedDate = try container.decodeIfPresent(Date.self, forKey: .updatedDate)
createdDate = try container.decodeIfPresent(Date.self, forKey: .createdDate)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if company != nil { try container.encode(company, forKey: .company) }
if currencyInfo != nil { try container.encode(currencyInfo, forKey: .currencyInfo) }
if articleServiceRelations.count > 0 { try container.encode(articleServiceRelations, forKey: .articleServiceRelations) }
if serviceIds.count > 0 { try container.encode(serviceIds, forKey: .serviceIds) }
if articleType != nil { try container.encode(articleType, forKey: .articleType) }
if articleTypeName != nil { try container.encode(articleTypeName, forKey: .articleTypeName) }
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if id != nil { try container.encode(id, forKey: .id) }
if name != nil { try container.encode(name, forKey: .name) }
if articleTypeId != nil { try container.encode(articleTypeId, forKey: .articleTypeId) }
if Description != nil { try container.encode(Description, forKey: .Description) }
if imageUrl != nil { try container.encode(imageUrl, forKey: .imageUrl) }
if active != nil { try container.encode(active, forKey: .active) }
if amount != nil { try container.encode(amount, forKey: .amount) }
if price != nil { try container.encode(price, forKey: .price) }
if currencyId != nil { try container.encode(currencyId, forKey: .currencyId) }
if updatedDate != nil { try container.encode(updatedDate, forKey: .updatedDate) }
if createdDate != nil { try container.encode(createdDate, forKey: .createdDate) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
}
}
public class ArticleServiceRelation : BaseModel
{
// @Required()
public var companyId:String?
public var id:Int
// @Required()
public var serviceId:Int?
// @Required()
public var articleId:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case companyId
case id
case serviceId
case articleId
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
id = try container.decodeIfPresent(Int.self, forKey: .id)
serviceId = try container.decodeIfPresent(Int.self, forKey: .serviceId)
articleId = try container.decodeIfPresent(Int.self, forKey: .articleId)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if id != nil { try container.encode(id, forKey: .id) }
if serviceId != nil { try container.encode(serviceId, forKey: .serviceId) }
if articleId != nil { try container.encode(articleId, forKey: .articleId) }
}
}
public enum ArticleTypeEnum : Int, Codable
{
case ServiceArticle = 1
case StandAloneArticle = 2
case RebateCodePunchTicketArticle = 3
case RebateCodeGiftCardArticle = 4
case RebateCodeValueCardArticle = 5
}
public class RebateCodeDayOfWeekRelation : BaseModel
{
// @Ignore()
public var dayOfWeek:BokaMeraDayOfWeek
// @Required()
public var dayOfWeekId:Int?
// @Required()
public var rebateCodeId:Int?
// @Required()
public var companyId:String?
public var id:Int
public var modifiedDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case dayOfWeek
case dayOfWeekId
case rebateCodeId
case companyId
case id
case modifiedDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
dayOfWeek = try container.decodeIfPresent(BokaMeraDayOfWeek.self, forKey: .dayOfWeek)
dayOfWeekId = try container.decodeIfPresent(Int.self, forKey: .dayOfWeekId)
rebateCodeId = try container.decodeIfPresent(Int.self, forKey: .rebateCodeId)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
id = try container.decodeIfPresent(Int.self, forKey: .id)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if dayOfWeek != nil { try container.encode(dayOfWeek, forKey: .dayOfWeek) }
if dayOfWeekId != nil { try container.encode(dayOfWeekId, forKey: .dayOfWeekId) }
if rebateCodeId != nil { try container.encode(rebateCodeId, forKey: .rebateCodeId) }
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if id != nil { try container.encode(id, forKey: .id) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
}
}
public class RebateCodeServiceRelation : BaseModel
{
// @Required()
public var companyId:String?
// @Required()
public var serviceId:Int?
// @Required()
public var rebateCodeId:Int?
public var id:Int
public var modifiedDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case companyId
case serviceId
case rebateCodeId
case id
case modifiedDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
serviceId = try container.decodeIfPresent(Int.self, forKey: .serviceId)
rebateCodeId = try container.decodeIfPresent(Int.self, forKey: .rebateCodeId)
id = try container.decodeIfPresent(Int.self, forKey: .id)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if serviceId != nil { try container.encode(serviceId, forKey: .serviceId) }
if rebateCodeId != nil { try container.encode(rebateCodeId, forKey: .rebateCodeId) }
if id != nil { try container.encode(id, forKey: .id) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
}
}
public class RebateCodeBookingPriceRelation : BaseModel
{
// @Required()
public var companyId:String?
// @Required()
public var priceId:Int?
// @Required()
public var rebateCodeId:Int?
public var id:Int
public var modifiedDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case companyId
case priceId
case rebateCodeId
case id
case modifiedDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
priceId = try container.decodeIfPresent(Int.self, forKey: .priceId)
rebateCodeId = try container.decodeIfPresent(Int.self, forKey: .rebateCodeId)
id = try container.decodeIfPresent(Int.self, forKey: .id)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if priceId != nil { try container.encode(priceId, forKey: .priceId) }
if rebateCodeId != nil { try container.encode(rebateCodeId, forKey: .rebateCodeId) }
if id != nil { try container.encode(id, forKey: .id) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
}
}
public class RebateCodeCustomerRelation : BaseModel
{
// @Required()
public var companyId:String?
// @Required()
public var customerId:String?
// @Required()
public var rebateCodeId:Int?
public var id:Int
public var modifiedDate:Date?
public var rebateCodeEmailSentToCustomer:Bool
public var messageToReceiver:String
public var buyer:Bool
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case companyId
case customerId
case rebateCodeId
case id
case modifiedDate
case rebateCodeEmailSentToCustomer
case messageToReceiver
case buyer
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
customerId = try container.decodeIfPresent(String.self, forKey: .customerId)
rebateCodeId = try container.decodeIfPresent(Int.self, forKey: .rebateCodeId)
id = try container.decodeIfPresent(Int.self, forKey: .id)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
rebateCodeEmailSentToCustomer = try container.decodeIfPresent(Bool.self, forKey: .rebateCodeEmailSentToCustomer)
messageToReceiver = try container.decodeIfPresent(String.self, forKey: .messageToReceiver)
buyer = try container.decodeIfPresent(Bool.self, forKey: .buyer)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if customerId != nil { try container.encode(customerId, forKey: .customerId) }
if rebateCodeId != nil { try container.encode(rebateCodeId, forKey: .rebateCodeId) }
if id != nil { try container.encode(id, forKey: .id) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if rebateCodeEmailSentToCustomer != nil { try container.encode(rebateCodeEmailSentToCustomer, forKey: .rebateCodeEmailSentToCustomer) }
if messageToReceiver != nil { try container.encode(messageToReceiver, forKey: .messageToReceiver) }
if buyer != nil { try container.encode(buyer, forKey: .buyer) }
}
}
public class DaysOfWeek : BaseModel
{
// @Required()
public var dayOfWeek:String?
// @Required()
public var dayOfWeekTranslation:String?
public var dayOfWeekActive:Bool?
public var dayOfWeekSortOrder:Int16?
public var modifiedDate:Date?
public var id:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case dayOfWeek
case dayOfWeekTranslation
case dayOfWeekActive
case dayOfWeekSortOrder
case modifiedDate
case id
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
dayOfWeek = try container.decodeIfPresent(String.self, forKey: .dayOfWeek)
dayOfWeekTranslation = try container.decodeIfPresent(String.self, forKey: .dayOfWeekTranslation)
dayOfWeekActive = try container.decodeIfPresent(Bool.self, forKey: .dayOfWeekActive)
dayOfWeekSortOrder = try container.decodeIfPresent(Int16.self, forKey: .dayOfWeekSortOrder)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if dayOfWeek != nil { try container.encode(dayOfWeek, forKey: .dayOfWeek) }
if dayOfWeekTranslation != nil { try container.encode(dayOfWeekTranslation, forKey: .dayOfWeekTranslation) }
if dayOfWeekActive != nil { try container.encode(dayOfWeekActive, forKey: .dayOfWeekActive) }
if dayOfWeekSortOrder != nil { try container.encode(dayOfWeekSortOrder, forKey: .dayOfWeekSortOrder) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class RebateCodeTransaction : BaseModel, IBaseModelCreated, IBaseModelUpdated
{
// @Ignore()
public var booking:Booking
// @Ignore()
public var rebateCode:RebateCode
// @Ignore()
public var customer:Customer
public var id:Int
public var companyId:String
public var note:String
// @Required()
public var rebateCodeId:Int?
// @Required()
public var amount:Double?
// @Required()
public var usage:Int?
public var bookingId:Int?
// @Required()
public var updatedDate:Date?
// @Required()
public var createdDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case booking
case rebateCode
case customer
case id
case companyId
case note
case rebateCodeId
case amount
case usage
case bookingId
case updatedDate
case createdDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
booking = try container.decodeIfPresent(Booking.self, forKey: .booking)
rebateCode = try container.decodeIfPresent(RebateCode.self, forKey: .rebateCode)
customer = try container.decodeIfPresent(Customer.self, forKey: .customer)
id = try container.decodeIfPresent(Int.self, forKey: .id)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
note = try container.decodeIfPresent(String.self, forKey: .note)
rebateCodeId = try container.decodeIfPresent(Int.self, forKey: .rebateCodeId)
amount = try container.decodeIfPresent(Double.self, forKey: .amount)
usage = try container.decodeIfPresent(Int.self, forKey: .usage)
bookingId = try container.decodeIfPresent(Int.self, forKey: .bookingId)
updatedDate = try container.decodeIfPresent(Date.self, forKey: .updatedDate)
createdDate = try container.decodeIfPresent(Date.self, forKey: .createdDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if booking != nil { try container.encode(booking, forKey: .booking) }
if rebateCode != nil { try container.encode(rebateCode, forKey: .rebateCode) }
if customer != nil { try container.encode(customer, forKey: .customer) }
if id != nil { try container.encode(id, forKey: .id) }
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if note != nil { try container.encode(note, forKey: .note) }
if rebateCodeId != nil { try container.encode(rebateCodeId, forKey: .rebateCodeId) }
if amount != nil { try container.encode(amount, forKey: .amount) }
if usage != nil { try container.encode(usage, forKey: .usage) }
if bookingId != nil { try container.encode(bookingId, forKey: .bookingId) }
if updatedDate != nil { try container.encode(updatedDate, forKey: .updatedDate) }
if createdDate != nil { try container.encode(createdDate, forKey: .createdDate) }
}
}
public class Booking : PayableEntity, IInterval, ICustomFieldTable, IBaseModelUpdated, IBaseModelCreated
{
// @Ignore()
public var service:Service
// @Ignore()
public var calendarExport:CalendarExport
// @Ignore()
public var log:[BookingLog] = []
// @Ignore()
public var checkoutLogs:[PaymentDetails] = []
// @Ignore()
public var prices:[BookingPrice] = []
// @Ignore()
public var status:BookingStatusEnum
// @Ignore()
public var isReserved:Bool
// @Ignore()
public var statusName:String
public var currencyInfo:Currency
public var bookingStatus:BookingStatus
// @Ignore()
public var totalPrice:Double?
// @Ignore()
public var totalSpots:Int?
// @Ignore()
public var resources:IList<Resource>
// @Ignore()
public var externalReferences:IList<ExternalReference>
// @Ignore()
public var bookedResources:IList<BookedResourceType>
// @Ignore()
public var customFieldsConfig:IList<CustomFieldConfig>
// @Ignore()
public var customFieldsData:IList<CustomFieldDataResponse>
// @Ignore()
public var deterministicId:String
// @Ignore()
public var active:Bool
// @Ignore()
public var lastTimeToUnBook:Date?
// @Ignore()
public var priceMappings:[PriceMapping] = []
// @Ignore()
public var internalReferenceId:String
// @Required()
public var updatedDate:Date?
// @Required()
public var createdDate:Date?
public var id:Int
// @Required()
public var customerId:String?
// @Required()
public var serviceId:Int?
// @Required()
public var statusId:Int?
public var unbookedOn:Date?
public var unbookedComments:String
public var bookedComments:String
// @Required()
public var bookedBy:String?
public var unBookedBy:String
// @Required()
public var sendSmsReminder:Bool?
// @Required()
public var sendEmailReminder:Bool?
// @Required()
public var sendSmsConfirmation:Bool?
public var rebateCode:String
public var comments:String
public var ipAddress:String
// @Required()
public var numberOfBookedSpots:Int?
public var commentsToCustomer:String
public var paymentExpiration:Date?
// @Required()
public var sendEmailConfirmation:Bool?
public var cancellationCode:String
public var modifiedDate:Date?
public var ratingCode:String
public var textField1:String
public var textField2:String
public var textField3:String
public var textField4:String
public var textField5:String
public var textField6:String
public var textField7:String
public var textField8:String
public var textField9:String
public var textField10:String
public var textField11:String
public var textField12:String
public var textField13:String
public var textField14:String
public var textField15:String
public var textField16:String
public var textField17:String
public var textField18:String
public var textField19:String
public var textField20:String
// @Required()
public var from:Date?
// @Required()
public var to:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case service
case calendarExport
case log
case checkoutLogs
case prices
case status
case isReserved
case statusName
case currencyInfo
case bookingStatus
case totalPrice
case totalSpots
case resources
case externalReferences
case bookedResources
case customFieldsConfig
case customFieldsData
case deterministicId
case active
case lastTimeToUnBook
case priceMappings
case internalReferenceId
case updatedDate
case createdDate
case id
case customerId
case serviceId
case statusId
case unbookedOn
case unbookedComments
case bookedComments
case bookedBy
case unBookedBy
case sendSmsReminder
case sendEmailReminder
case sendSmsConfirmation
case rebateCode
case comments
case ipAddress
case numberOfBookedSpots
case commentsToCustomer
case paymentExpiration
case sendEmailConfirmation
case cancellationCode
case modifiedDate
case ratingCode
case textField1
case textField2
case textField3
case textField4
case textField5
case textField6
case textField7
case textField8
case textField9
case textField10
case textField11
case textField12
case textField13
case textField14
case textField15
case textField16
case textField17
case textField18
case textField19
case textField20
case from
case to
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
service = try container.decodeIfPresent(Service.self, forKey: .service)
calendarExport = try container.decodeIfPresent(CalendarExport.self, forKey: .calendarExport)
log = try container.decodeIfPresent([BookingLog].self, forKey: .log) ?? []
checkoutLogs = try container.decodeIfPresent([PaymentDetails].self, forKey: .checkoutLogs) ?? []
prices = try container.decodeIfPresent([BookingPrice].self, forKey: .prices) ?? []
status = try container.decodeIfPresent(BookingStatusEnum.self, forKey: .status)
isReserved = try container.decodeIfPresent(Bool.self, forKey: .isReserved)
statusName = try container.decodeIfPresent(String.self, forKey: .statusName)
currencyInfo = try container.decodeIfPresent(Currency.self, forKey: .currencyInfo)
bookingStatus = try container.decodeIfPresent(BookingStatus.self, forKey: .bookingStatus)
totalPrice = try container.decodeIfPresent(Double.self, forKey: .totalPrice)
totalSpots = try container.decodeIfPresent(Int.self, forKey: .totalSpots)
resources = try container.decodeIfPresent(IList<Resource>.self, forKey: .resources)
externalReferences = try container.decodeIfPresent(IList<ExternalReference>.self, forKey: .externalReferences)
bookedResources = try container.decodeIfPresent(IList<BookedResourceType>.self, forKey: .bookedResources)
customFieldsConfig = try container.decodeIfPresent(IList<CustomFieldConfig>.self, forKey: .customFieldsConfig)
customFieldsData = try container.decodeIfPresent(IList<CustomFieldDataResponse>.self, forKey: .customFieldsData)
deterministicId = try container.decodeIfPresent(String.self, forKey: .deterministicId)
active = try container.decodeIfPresent(Bool.self, forKey: .active)
lastTimeToUnBook = try container.decodeIfPresent(Date.self, forKey: .lastTimeToUnBook)
priceMappings = try container.decodeIfPresent([PriceMapping].self, forKey: .priceMappings) ?? []
internalReferenceId = try container.decodeIfPresent(String.self, forKey: .internalReferenceId)
updatedDate = try container.decodeIfPresent(Date.self, forKey: .updatedDate)
createdDate = try container.decodeIfPresent(Date.self, forKey: .createdDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
customerId = try container.decodeIfPresent(String.self, forKey: .customerId)
serviceId = try container.decodeIfPresent(Int.self, forKey: .serviceId)
statusId = try container.decodeIfPresent(Int.self, forKey: .statusId)
unbookedOn = try container.decodeIfPresent(Date.self, forKey: .unbookedOn)
unbookedComments = try container.decodeIfPresent(String.self, forKey: .unbookedComments)
bookedComments = try container.decodeIfPresent(String.self, forKey: .bookedComments)
bookedBy = try container.decodeIfPresent(String.self, forKey: .bookedBy)
unBookedBy = try container.decodeIfPresent(String.self, forKey: .unBookedBy)
sendSmsReminder = try container.decodeIfPresent(Bool.self, forKey: .sendSmsReminder)
sendEmailReminder = try container.decodeIfPresent(Bool.self, forKey: .sendEmailReminder)
sendSmsConfirmation = try container.decodeIfPresent(Bool.self, forKey: .sendSmsConfirmation)
rebateCode = try container.decodeIfPresent(String.self, forKey: .rebateCode)
comments = try container.decodeIfPresent(String.self, forKey: .comments)
ipAddress = try container.decodeIfPresent(String.self, forKey: .ipAddress)
numberOfBookedSpots = try container.decodeIfPresent(Int.self, forKey: .numberOfBookedSpots)
commentsToCustomer = try container.decodeIfPresent(String.self, forKey: .commentsToCustomer)
paymentExpiration = try container.decodeIfPresent(Date.self, forKey: .paymentExpiration)
sendEmailConfirmation = try container.decodeIfPresent(Bool.self, forKey: .sendEmailConfirmation)
cancellationCode = try container.decodeIfPresent(String.self, forKey: .cancellationCode)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
ratingCode = try container.decodeIfPresent(String.self, forKey: .ratingCode)
textField1 = try container.decodeIfPresent(String.self, forKey: .textField1)
textField2 = try container.decodeIfPresent(String.self, forKey: .textField2)
textField3 = try container.decodeIfPresent(String.self, forKey: .textField3)
textField4 = try container.decodeIfPresent(String.self, forKey: .textField4)
textField5 = try container.decodeIfPresent(String.self, forKey: .textField5)
textField6 = try container.decodeIfPresent(String.self, forKey: .textField6)
textField7 = try container.decodeIfPresent(String.self, forKey: .textField7)
textField8 = try container.decodeIfPresent(String.self, forKey: .textField8)
textField9 = try container.decodeIfPresent(String.self, forKey: .textField9)
textField10 = try container.decodeIfPresent(String.self, forKey: .textField10)
textField11 = try container.decodeIfPresent(String.self, forKey: .textField11)
textField12 = try container.decodeIfPresent(String.self, forKey: .textField12)
textField13 = try container.decodeIfPresent(String.self, forKey: .textField13)
textField14 = try container.decodeIfPresent(String.self, forKey: .textField14)
textField15 = try container.decodeIfPresent(String.self, forKey: .textField15)
textField16 = try container.decodeIfPresent(String.self, forKey: .textField16)
textField17 = try container.decodeIfPresent(String.self, forKey: .textField17)
textField18 = try container.decodeIfPresent(String.self, forKey: .textField18)
textField19 = try container.decodeIfPresent(String.self, forKey: .textField19)
textField20 = try container.decodeIfPresent(String.self, forKey: .textField20)
from = try container.decodeIfPresent(Date.self, forKey: .from)
to = try container.decodeIfPresent(Date.self, forKey: .to)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if service != nil { try container.encode(service, forKey: .service) }
if calendarExport != nil { try container.encode(calendarExport, forKey: .calendarExport) }
if log.count > 0 { try container.encode(log, forKey: .log) }
if checkoutLogs.count > 0 { try container.encode(checkoutLogs, forKey: .checkoutLogs) }
if prices.count > 0 { try container.encode(prices, forKey: .prices) }
if status != nil { try container.encode(status, forKey: .status) }
if isReserved != nil { try container.encode(isReserved, forKey: .isReserved) }
if statusName != nil { try container.encode(statusName, forKey: .statusName) }
if currencyInfo != nil { try container.encode(currencyInfo, forKey: .currencyInfo) }
if bookingStatus != nil { try container.encode(bookingStatus, forKey: .bookingStatus) }
if totalPrice != nil { try container.encode(totalPrice, forKey: .totalPrice) }
if totalSpots != nil { try container.encode(totalSpots, forKey: .totalSpots) }
if resources != nil { try container.encode(resources, forKey: .resources) }
if externalReferences != nil { try container.encode(externalReferences, forKey: .externalReferences) }
if bookedResources != nil { try container.encode(bookedResources, forKey: .bookedResources) }
if customFieldsConfig != nil { try container.encode(customFieldsConfig, forKey: .customFieldsConfig) }
if customFieldsData != nil { try container.encode(customFieldsData, forKey: .customFieldsData) }
if deterministicId != nil { try container.encode(deterministicId, forKey: .deterministicId) }
if active != nil { try container.encode(active, forKey: .active) }
if lastTimeToUnBook != nil { try container.encode(lastTimeToUnBook, forKey: .lastTimeToUnBook) }
if priceMappings.count > 0 { try container.encode(priceMappings, forKey: .priceMappings) }
if internalReferenceId != nil { try container.encode(internalReferenceId, forKey: .internalReferenceId) }
if updatedDate != nil { try container.encode(updatedDate, forKey: .updatedDate) }
if createdDate != nil { try container.encode(createdDate, forKey: .createdDate) }
if id != nil { try container.encode(id, forKey: .id) }
if customerId != nil { try container.encode(customerId, forKey: .customerId) }
if serviceId != nil { try container.encode(serviceId, forKey: .serviceId) }
if statusId != nil { try container.encode(statusId, forKey: .statusId) }
if unbookedOn != nil { try container.encode(unbookedOn, forKey: .unbookedOn) }
if unbookedComments != nil { try container.encode(unbookedComments, forKey: .unbookedComments) }
if bookedComments != nil { try container.encode(bookedComments, forKey: .bookedComments) }
if bookedBy != nil { try container.encode(bookedBy, forKey: .bookedBy) }
if unBookedBy != nil { try container.encode(unBookedBy, forKey: .unBookedBy) }
if sendSmsReminder != nil { try container.encode(sendSmsReminder, forKey: .sendSmsReminder) }
if sendEmailReminder != nil { try container.encode(sendEmailReminder, forKey: .sendEmailReminder) }
if sendSmsConfirmation != nil { try container.encode(sendSmsConfirmation, forKey: .sendSmsConfirmation) }
if rebateCode != nil { try container.encode(rebateCode, forKey: .rebateCode) }
if comments != nil { try container.encode(comments, forKey: .comments) }
if ipAddress != nil { try container.encode(ipAddress, forKey: .ipAddress) }
if numberOfBookedSpots != nil { try container.encode(numberOfBookedSpots, forKey: .numberOfBookedSpots) }
if commentsToCustomer != nil { try container.encode(commentsToCustomer, forKey: .commentsToCustomer) }
if paymentExpiration != nil { try container.encode(paymentExpiration, forKey: .paymentExpiration) }
if sendEmailConfirmation != nil { try container.encode(sendEmailConfirmation, forKey: .sendEmailConfirmation) }
if cancellationCode != nil { try container.encode(cancellationCode, forKey: .cancellationCode) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if ratingCode != nil { try container.encode(ratingCode, forKey: .ratingCode) }
if textField1 != nil { try container.encode(textField1, forKey: .textField1) }
if textField2 != nil { try container.encode(textField2, forKey: .textField2) }
if textField3 != nil { try container.encode(textField3, forKey: .textField3) }
if textField4 != nil { try container.encode(textField4, forKey: .textField4) }
if textField5 != nil { try container.encode(textField5, forKey: .textField5) }
if textField6 != nil { try container.encode(textField6, forKey: .textField6) }
if textField7 != nil { try container.encode(textField7, forKey: .textField7) }
if textField8 != nil { try container.encode(textField8, forKey: .textField8) }
if textField9 != nil { try container.encode(textField9, forKey: .textField9) }
if textField10 != nil { try container.encode(textField10, forKey: .textField10) }
if textField11 != nil { try container.encode(textField11, forKey: .textField11) }
if textField12 != nil { try container.encode(textField12, forKey: .textField12) }
if textField13 != nil { try container.encode(textField13, forKey: .textField13) }
if textField14 != nil { try container.encode(textField14, forKey: .textField14) }
if textField15 != nil { try container.encode(textField15, forKey: .textField15) }
if textField16 != nil { try container.encode(textField16, forKey: .textField16) }
if textField17 != nil { try container.encode(textField17, forKey: .textField17) }
if textField18 != nil { try container.encode(textField18, forKey: .textField18) }
if textField19 != nil { try container.encode(textField19, forKey: .textField19) }
if textField20 != nil { try container.encode(textField20, forKey: .textField20) }
if from != nil { try container.encode(from, forKey: .from) }
if to != nil { try container.encode(to, forKey: .to) }
}
}
public class CalendarExport : BaseModel
{
// @Required()
public var companyId:String?
// @Required()
public var bookingId:Int?
// @Required()
public var exceptionId:Int?
public var calendarSync:Bool?
public var calendarId:String
public var isExceptionDeleted:Bool?
public var modifiedDate:Date?
public var id:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case companyId
case bookingId
case exceptionId
case calendarSync
case calendarId
case isExceptionDeleted
case modifiedDate
case id
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
bookingId = try container.decodeIfPresent(Int.self, forKey: .bookingId)
exceptionId = try container.decodeIfPresent(Int.self, forKey: .exceptionId)
calendarSync = try container.decodeIfPresent(Bool.self, forKey: .calendarSync)
calendarId = try container.decodeIfPresent(String.self, forKey: .calendarId)
isExceptionDeleted = try container.decodeIfPresent(Bool.self, forKey: .isExceptionDeleted)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if bookingId != nil { try container.encode(bookingId, forKey: .bookingId) }
if exceptionId != nil { try container.encode(exceptionId, forKey: .exceptionId) }
if calendarSync != nil { try container.encode(calendarSync, forKey: .calendarSync) }
if calendarId != nil { try container.encode(calendarId, forKey: .calendarId) }
if isExceptionDeleted != nil { try container.encode(isExceptionDeleted, forKey: .isExceptionDeleted) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class BookingLog : BaseModel
{
// @References(typeof(BookingLogEventType))
public var eventTypeId:Int
public var eventType:BookingLogEventType
// @Required()
public var companyId:String?
// @Required()
public var bookingId:Int?
public var id:Int
public var comments:String
public var userId:String
// @Required()
public var created:Date?
public var modifiedDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case eventTypeId
case eventType
case companyId
case bookingId
case id
case comments
case userId
case created
case modifiedDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
eventTypeId = try container.decodeIfPresent(Int.self, forKey: .eventTypeId)
eventType = try container.decodeIfPresent(BookingLogEventType.self, forKey: .eventType)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
bookingId = try container.decodeIfPresent(Int.self, forKey: .bookingId)
id = try container.decodeIfPresent(Int.self, forKey: .id)
comments = try container.decodeIfPresent(String.self, forKey: .comments)
userId = try container.decodeIfPresent(String.self, forKey: .userId)
created = try container.decodeIfPresent(Date.self, forKey: .created)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if eventTypeId != nil { try container.encode(eventTypeId, forKey: .eventTypeId) }
if eventType != nil { try container.encode(eventType, forKey: .eventType) }
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if bookingId != nil { try container.encode(bookingId, forKey: .bookingId) }
if id != nil { try container.encode(id, forKey: .id) }
if comments != nil { try container.encode(comments, forKey: .comments) }
if userId != nil { try container.encode(userId, forKey: .userId) }
if created != nil { try container.encode(created, forKey: .created) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
}
}
public class BookingLogEventType : BaseModel
{
// @Required()
public var name:String?
// @Required()
public var Description:String?
public var modifiedDate:Date?
// @Required()
public var id:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case Description
case modifiedDate
case id
}
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)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 Description != nil { try container.encode(Description, forKey: .Description) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class PaymentDetails : BaseModel, IBaseModelCreated, IBaseModelUpdated
{
// @Ignore()
public var qvicklyCheckoutSerialized:QvicklyCheckoutResponse
// @Ignore()
public var payson2CheckoutSerialized:Payson2CheckoutResponse
// @Required()
public var companyId:String?
// @Required()
public var internalReferenceId:String?
// @Required()
public var articleTypeId:Int?
// @Required()
public var externalResponseData:String?
// @Required()
public var externalResponseReference:String?
// @Required()
public var paymentProviderId:Int?
// @Required()
public var createdDate:Date?
// @Required()
public var updatedDate:Date?
public var modifiedDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case qvicklyCheckoutSerialized
case payson2CheckoutSerialized
case companyId
case internalReferenceId
case articleTypeId
case externalResponseData
case externalResponseReference
case paymentProviderId
case createdDate
case updatedDate
case modifiedDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
qvicklyCheckoutSerialized = try container.decodeIfPresent(QvicklyCheckoutResponse.self, forKey: .qvicklyCheckoutSerialized)
payson2CheckoutSerialized = try container.decodeIfPresent(Payson2CheckoutResponse.self, forKey: .payson2CheckoutSerialized)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
internalReferenceId = try container.decodeIfPresent(String.self, forKey: .internalReferenceId)
articleTypeId = try container.decodeIfPresent(Int.self, forKey: .articleTypeId)
externalResponseData = try container.decodeIfPresent(String.self, forKey: .externalResponseData)
externalResponseReference = try container.decodeIfPresent(String.self, forKey: .externalResponseReference)
paymentProviderId = try container.decodeIfPresent(Int.self, forKey: .paymentProviderId)
createdDate = try container.decodeIfPresent(Date.self, forKey: .createdDate)
updatedDate = try container.decodeIfPresent(Date.self, forKey: .updatedDate)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if qvicklyCheckoutSerialized != nil { try container.encode(qvicklyCheckoutSerialized, forKey: .qvicklyCheckoutSerialized) }
if payson2CheckoutSerialized != nil { try container.encode(payson2CheckoutSerialized, forKey: .payson2CheckoutSerialized) }
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if internalReferenceId != nil { try container.encode(internalReferenceId, forKey: .internalReferenceId) }
if articleTypeId != nil { try container.encode(articleTypeId, forKey: .articleTypeId) }
if externalResponseData != nil { try container.encode(externalResponseData, forKey: .externalResponseData) }
if externalResponseReference != nil { try container.encode(externalResponseReference, forKey: .externalResponseReference) }
if paymentProviderId != nil { try container.encode(paymentProviderId, forKey: .paymentProviderId) }
if createdDate != nil { try container.encode(createdDate, forKey: .createdDate) }
if updatedDate != nil { try container.encode(updatedDate, forKey: .updatedDate) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
}
}
public class BookingPrice : BaseModel
{
// @References(typeof(Currency))
public var currencyId:String
public var priceId:Int?
public var currencyInfo:Currency
// @Ignore()
public var priceText:String
// @Ignore()
public var appliedCodes:[AppliedRebateCodes] = []
// @Ignore()
public var isRebate:Bool
// @Required()
public var companyId:String?
// @Required()
public var bookingId:Int?
// @Required()
public var quantity:Int?
public var price:Double?
public var vat:Double?
public var category:String
// @Required()
public var updated:Date?
// @Required()
public var created:Date?
// @Required()
public var invoiced:Bool?
// @Required()
public var occupiesSpot:Bool?
public var modifiedDate:Date?
public var id:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case currencyId
case priceId
case currencyInfo
case priceText
case appliedCodes
case isRebate
case companyId
case bookingId
case quantity
case price
case vat
case category
case updated
case created
case invoiced
case occupiesSpot
case modifiedDate
case id
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
currencyId = try container.decodeIfPresent(String.self, forKey: .currencyId)
priceId = try container.decodeIfPresent(Int.self, forKey: .priceId)
currencyInfo = try container.decodeIfPresent(Currency.self, forKey: .currencyInfo)
priceText = try container.decodeIfPresent(String.self, forKey: .priceText)
appliedCodes = try container.decodeIfPresent([AppliedRebateCodes].self, forKey: .appliedCodes) ?? []
isRebate = try container.decodeIfPresent(Bool.self, forKey: .isRebate)
companyId = try container.decodeIfPresent(String.self, forKey: .companyId)
bookingId = try container.decodeIfPresent(Int.self, forKey: .bookingId)
quantity = try container.decodeIfPresent(Int.self, forKey: .quantity)
price = try container.decodeIfPresent(Double.self, forKey: .price)
vat = try container.decodeIfPresent(Double.self, forKey: .vat)
category = try container.decodeIfPresent(String.self, forKey: .category)
updated = try container.decodeIfPresent(Date.self, forKey: .updated)
created = try container.decodeIfPresent(Date.self, forKey: .created)
invoiced = try container.decodeIfPresent(Bool.self, forKey: .invoiced)
occupiesSpot = try container.decodeIfPresent(Bool.self, forKey: .occupiesSpot)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if currencyId != nil { try container.encode(currencyId, forKey: .currencyId) }
if priceId != nil { try container.encode(priceId, forKey: .priceId) }
if currencyInfo != nil { try container.encode(currencyInfo, forKey: .currencyInfo) }
if priceText != nil { try container.encode(priceText, forKey: .priceText) }
if appliedCodes.count > 0 { try container.encode(appliedCodes, forKey: .appliedCodes) }
if isRebate != nil { try container.encode(isRebate, forKey: .isRebate) }
if companyId != nil { try container.encode(companyId, forKey: .companyId) }
if bookingId != nil { try container.encode(bookingId, forKey: .bookingId) }
if quantity != nil { try container.encode(quantity, forKey: .quantity) }
if price != nil { try container.encode(price, forKey: .price) }
if vat != nil { try container.encode(vat, forKey: .vat) }
if category != nil { try container.encode(category, forKey: .category) }
if updated != nil { try container.encode(updated, forKey: .updated) }
if created != nil { try container.encode(created, forKey: .created) }
if invoiced != nil { try container.encode(invoiced, forKey: .invoiced) }
if occupiesSpot != nil { try container.encode(occupiesSpot, forKey: .occupiesSpot) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class BookingStatus : BaseModel
{
// @Required()
public var name:String?
// @Required()
public var Description:String?
// @Required()
public var color:String?
// @Required()
public var icon:String?
public var modifiedDate:Date?
public var id:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case Description
case color
case icon
case modifiedDate
case id
}
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)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
color = try container.decodeIfPresent(String.self, forKey: .color)
icon = try container.decodeIfPresent(String.self, forKey: .icon)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
id = try container.decodeIfPresent(Int.self, forKey: .id)
}
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 Description != nil { try container.encode(Description, forKey: .Description) }
if color != nil { try container.encode(color, forKey: .color) }
if icon != nil { try container.encode(icon, forKey: .icon) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
if id != nil { try container.encode(id, forKey: .id) }
}
}
public class BookedResourceType : Codable
{
/**
* The resource type id
*/
// @ApiMember(Description="The resource type id")
public var id:Int
/**
* The resource type name
*/
// @ApiMember(Description="The resource type name")
public var name:String
/**
* The resources inside resource type
*/
// @ApiMember(Description="The resources inside resource type")
public var resources:[BookedResource] = []
required public init(){}
}
public class BookedResource : Codable
{
public var id:Int
public var name:String
public var color:String
public var imageUrl:Uri
public var email:String
public var mobilePhone:String
public var accessGroup:String
public var emailNotification:Bool
public var smsNotification:Bool
public var emailReminder:Bool
public var smsReminder:Bool
required public init(){}
}
public class GroupedServiceQueryResponse : Codable
{
public var group:String
public var sortOrder:Int
public var items:[ServiceQueryResponse] = []
public var responseStatus:ResponseStatus
required public init(){}
}
public class ServiceQueryResponse : Codable
{
public var id:Int
public var name:String
public var Description:String
public var imageUrl:Uri
public var totalSpots:Int
/**
* If this setting is turned on the remaining spots (if Totalspots > 1) is locked from be booked by another customer.
*/
// @ApiMember(Description="If this setting is turned on the remaining spots (if Totalspots > 1) is locked from be booked by another customer.")
public var lockSpotsToBooking:Bool?
public var minNumberOfSpotsPerBooking:Int
public var maxNumberOfSpotsPerBooking:Int
public var minNumberOfResourcesToBook:Int
public var maxNumberOfResourcesToBook:Int
public var unbookBeforeDays:Int
public var unbookBeforeHours:Int
public var unbookBeforeMinutes:Int
/**
* What type of schedule is connected to the service. RecurringSchedule = 1, DateSchedule = 2
*/
// @ApiMember(Description="What type of schedule is connected to the service. RecurringSchedule = 1, DateSchedule = 2")
public var scheduleType:ScheduleType
/**
* What type of schedule is connected to the service. RecurringSchedule = 1, DateSchedule = 2
*/
// @ApiMember(Description="What type of schedule is connected to the service. RecurringSchedule = 1, DateSchedule = 2")
public var scheduleTypeId:Int
public var bookBeforeDays:Int
public var bookBeforeHours:Int
public var bookBeforeMinutes:Int
public var group:String
public var enableBookingQueue:Bool
public var enableCodeLockSync:Bool
public var enableCustomerManualPayment:Bool
public var sortOrder:Int
public var active:Bool
public var isGroupBooking:Bool
public var groupBooking:GroupBookingSettings
public var multipleResource:MultipleResourceSettings
public var isPaymentEnabled:Bool
/**
* Maximum numbers of minutes the booking payment must be completed before automatically unbooked
*/
// @ApiMember(Description="Maximum numbers of minutes the booking payment must be completed before automatically unbooked")
public var maxPaymentTime:Int
/**
* If the booking should be either 1 = Booked) or 3 = Reserved. Default is 1 = Booked.
*/
// @ApiMember(Description="If the booking should be either 1 = Booked) or 3 = Reserved. Default is 1 = Booked.")
public var bookingStatusId:Int
public var onlyVisibleByAdmin:Bool
public var lengthInMinutes:Int?
public var durationTypeId:Int
public var duration:Int?
public var minDuration:Int?
public var maxDuration:Int?
public var durationInterval:Int?
public var pauseAfterBooking:Int
public var customFields:[CustomFieldConfigData] = []
public var customFieldValues:[CustomFieldDataResponse] = []
public var bookingCustomFields:[CustomFieldConfigData] = []
public var customerCustomFields:[CustomFieldConfigData] = []
/**
* The booking status options to choose from
*/
// @ApiMember(Description="The booking status options to choose from")
public var bookingStatusOptions:[BookingStatusOptionsResponse] = []
public var prices:[ServicePriceResponse] = []
public var schedules:ServiceSchedules
public var ratingSummary:CompanyRatingSummary
public var reviews:[RatingReviewResponse] = []
public var resourceTypes:[ServiceResourceTypeResponse] = []
public var responseStatus:ResponseStatus
public var priceViewTypeId:Int?
required public init(){}
}
public class GroupBookingSettings : Codable
{
public var active:Bool
public var min:Int
public var max:Int
required public init(){}
}
public class MultipleResourceSettings : Codable
{
public var active:Bool
public var min:Int
public var max:Int
required public init(){}
}
public class CustomFieldConfigData : Codable
{
/**
* Custom field id
*/
// @ApiMember(Description="Custom field id")
public var id:Int
/**
* Configuration name. Example: 'Number of persons'.
*/
// @ApiMember(Description="Configuration name. Example: 'Number of persons'.")
public var name:String
/**
* Custom field description. Example: 'For how many persons is this booking?'
*/
// @ApiMember(Description="Custom field description. Example: 'For how many persons is this booking?'")
public var Description:String
/**
* Field width. Example: 20 for 20px
*/
// @ApiMember(Description="Field width. Example: 20 for 20px")
public var width:Int?
/**
* Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'
*/
// @ApiMember(Description="Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'")
public var dataType:String
/**
* Default value of the field. Example: '3'
*/
// @ApiMember(Description="Default value of the field. Example: '3'")
public var defaultValue:String
/**
* Determines if the field is required to have a value or not
*/
// @ApiMember(Description="Determines if the field is required to have a value or not")
public var isMandatory:Bool
/**
* Error message shown to the user if the field data is required but not entered
*/
// @ApiMember(Description="Error message shown to the user if the field data is required but not entered")
public var mandatoryErrorMessage:String
/**
* Max lenght of the field
*/
// @ApiMember(Description="Max lenght of the field")
public var maxLength:Int
/**
* If the field should have multiple lines
*/
// @ApiMember(Description="If the field should have multiple lines")
public var multipleLineText:Bool
/**
* Regular expression used for validation of the field
*/
// @ApiMember(Description="Regular expression used for validation of the field")
public var regEx:String
/**
* Error message shown if the regular expression validation failed
*/
// @ApiMember(Description="Error message shown if the regular expression validation failed")
public var regExErrorMessage:String
/**
* The values to select from if Datatype is DropDown for this custom field
*/
// @ApiMember(Description="The values to select from if Datatype is DropDown for this custom field")
public var values:[CustomFieldValueResponse] = []
required public init(){}
}
public class CustomFieldValueResponse : Codable
{
public var value:String
required public init(){}
}
public class BookingStatusOptionsResponse : Codable
{
public var id:Int
public var name:String
public var Description:String
required public init(){}
}
public class ServicePriceResponse : Codable
{
/**
* The company id
*/
// @ApiMember(Description="The company id")
public var companyId:String
/**
* The price id
*/
// @ApiMember(Description="The price id")
public var id:Int
/**
* The service id
*/
// @ApiMember(Description="The service id")
public var serviceId:Int
/**
* The price
*/
// @ApiMember(Description="The price")
public var price:Double
/**
* The price calculation type id, 1 = Normal, price is for the service total duration, 2 = Price is per minute, 3 = Price is per hour, 4= Price is per day
*/
// @ApiMember(Description="The price calculation type id, 1 = Normal, price is for the service total duration, 2 = Price is per minute, 3 = Price is per hour, 4= Price is per day")
public var calculationTypeId:Int
/**
* The price currency
*/
// @ApiMember(Description="The price currency")
public var currencyId:String
/**
* The price sign
*/
// @ApiMember(Description="The price sign")
public var priceSign:String
/**
* The price VAT in percent
*/
// @ApiMember(Description="The price VAT in percent")
public var vat:Double
/**
* The price category if price has a category
*/
// @ApiMember(Description="The price category if price has a category")
public var category:String
/**
* The price text to display
*/
// @ApiMember(Description="The price text to display")
public var priceText:String
/**
* The valid from date for the price.
*/
// @ApiMember(Description="The valid from date for the price.")
public var from:Date
/**
* The valid to date for the price.
*/
// @ApiMember(Description="The valid to date for the price.")
public var to:Date
/**
* If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.
*/
// @ApiMember(Description="If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.")
public var daysOfWeek:[DayOfWeekDto] = []
/**
* If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.
*/
// @ApiMember(Description="If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.")
@TimeSpan public var fromTime:TimeInterval?
/**
* If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.
*/
// @ApiMember(Description="If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.")
@TimeSpan public var toTime:TimeInterval?
public var service:ServiceInfoResponse
/**
* If the price is only valid for a specific time span
*/
// @ApiMember(Description="If the price is only valid for a specific time span")
public var isTimeSpecific:Bool
/**
* If the price is only valid for specific days of week
*/
// @ApiMember(Description="If the price is only valid for specific days of week")
public var isDaysOfWeekSpecific:Bool
required public init(){}
}
public class DayOfWeekDto : Codable
{
public var dayOfWeekId:Int
public var dotNetDayOfWeekId:Int
public var dayOfWeek:String
required public init(){}
}
public class ServiceInfoResponse : Codable
{
public var id:Int
public var name:String
public var Description:String
public var imageUrl:Uri
public var lengthInMinutes:Int?
public var maxNumberOfSpotsPerBooking:Int
public var minNumberOfSpotsPerBooking:Int
public var groupBooking:GroupBookingSettings
public var multipleResource:MultipleResourceSettings
public var isGroupBooking:Bool
public var isPaymentEnabled:Bool
required public init(){}
}
public class ServiceSchedules : Codable
{
public var scheduleType:ScheduleType
public var recurringSchedules:[ISchedule] = []
public var dateSchedules:[ISchedule] = []
required public init(){}
}
public class CompanyRatingSummary : Codable
{
/**
* The average rating score
*/
// @ApiMember(Description="The average rating score")
public var averageScore:Double
/**
* The number of ratings of score 1
*/
// @ApiMember(Description="The number of ratings of score 1")
public var ratingScore1Count:Int
/**
* The number of ratings of score 2
*/
// @ApiMember(Description="The number of ratings of score 2")
public var ratingScore2Count:Int
/**
* The number of ratings of score 3
*/
// @ApiMember(Description="The number of ratings of score 3")
public var ratingScore3Count:Int
/**
* The number of ratings of score 4
*/
// @ApiMember(Description="The number of ratings of score 4")
public var raingScore4Count:Int
/**
* The number of ratings of score 5
*/
// @ApiMember(Description="The number of ratings of score 5")
public var ratingScore5Count:Int
/**
* The number of ratings
*/
// @ApiMember(Description="The number of ratings")
public var count:Int
required public init(){}
}
public class RatingReviewResponse : Codable
{
/**
* The title for the review
*/
// @ApiMember(Description="The title for the review")
public var title:String
/**
* The description for the review
*/
// @ApiMember(Description="The description for the review")
public var Description:String
/**
* The rating score
*/
// @ApiMember(Description="The rating score")
public var ratingScore:Int
/**
* The review author
*/
// @ApiMember(Description="The review author")
public var author:String
/**
* The created date
*/
// @ApiMember(Description="The created date")
public var created:Date
/**
* The review answer from the company
*/
// @ApiMember(Description="The review answer from the company")
public var reviewAnswer:String
required public init(){}
}
public class ServiceResourceTypeResponse : Codable
{
/**
* The resourcetype id
*/
// @ApiMember(Description="The resourcetype id")
public var id:Int
/**
* The resourcetype is selectable by customer
*/
// @ApiMember(Description="The resourcetype is selectable by customer")
public var selectableByUser:Bool
/**
* The resourcetype name
*/
// @ApiMember(Description="The resourcetype name")
public var name:String
/**
* The resourcetype description
*/
// @ApiMember(Description="The resourcetype description")
public var Description:String
/**
* The resources in the resourcetype. Only shows active resources if not admin.
*/
// @ApiMember(Description="The resources in the resourcetype. Only shows active resources if not admin.")
public var resources:[ServiceResourceTypeResource] = []
required public init(){}
}
public class ServiceResourceTypeResource : Codable
{
/**
* The resource id
*/
// @ApiMember(Description="The resource id")
public var id:Int
/**
* The resource name
*/
// @ApiMember(Description="The resource name")
public var name:String
/**
* The resource description
*/
// @ApiMember(Description="The resource description")
public var Description:String
/**
* The resource email
*/
// @ApiMember(Description="The resource email")
public var email:String
/**
* The resource phone
*/
// @ApiMember(Description="The resource phone")
public var phone:String
/**
* The resource color
*/
// @ApiMember(Description="The resource color")
public var color:String
/**
* The resource image
*/
// @ApiMember(Description="The resource image")
public var imageUrl:Uri
/**
* The priority of the resource
*/
// @ApiMember(Description="The priority of the resource")
public var priority:Int
/**
* If the resource want to receive email notifications
*/
// @ApiMember(Description="If the resource want to receive email notifications")
public var emailNotification:Bool
/**
* If the resource want to receive sms notifications
*/
// @ApiMember(Description="If the resource want to receive sms notifications")
public var smsNotification:Bool
/**
* If the resource want to receive email reminders
*/
// @ApiMember(Description="If the resource want to receive email reminders")
public var emailReminder:Bool
/**
* If the resource want to receive sms reminders
*/
// @ApiMember(Description="If the resource want to receive sms reminders")
public var smsReminder:Bool
required public init(){}
}
public class AccessKeyTypeResponse : Codable
{
public var id:Int
public var keyType:String
public var Description:String
required public init(){}
}
Swift GroupedServiceQuery DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /services/grouped HTTP/1.1 Host: testapi.bokamera.se Accept: text/csv
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"Offset":0,"Total":0,"Results":[{"Group":"String","SortOrder":0,"Items":[{"Id":0,"Name":"String","Description":"String","TotalSpots":0,"LockSpotsToBooking":false,"MinNumberOfSpotsPerBooking":0,"MaxNumberOfSpotsPerBooking":0,"MinNumberOfResourcesToBook":0,"MaxNumberOfResourcesToBook":0,"UnbookBeforeDays":0,"UnbookBeforeHours":0,"UnbookBeforeMinutes":0,"ScheduleType":"NotDefined","ScheduleTypeId":0,"BookBeforeDays":0,"BookBeforeHours":0,"BookBeforeMinutes":0,"Group":"String","EnableBookingQueue":false,"EnableCodeLockSync":false,"EnableCustomerManualPayment":false,"SortOrder":0,"Active":false,"IsGroupBooking":false,"GroupBooking":{"Active":false,"Min":0,"Max":0},"MultipleResource":{"Active":false,"Min":0,"Max":0},"IsPaymentEnabled":false,"MaxPaymentTime":0,"BookingStatusId":0,"OnlyVisibleByAdmin":false,"LengthInMinutes":0,"DurationTypeId":0,"Duration":0,"MinDuration":0,"MaxDuration":0,"DurationInterval":0,"PauseAfterBooking":0,"CustomFields":[{"Id":0,"Name":"String","Description":"String","Width":0,"DataType":"String","DefaultValue":"String","IsMandatory":false,"MandatoryErrorMessage":"String","MaxLength":0,"MultipleLineText":false,"RegEx":"String","RegExErrorMessage":"String","Values":[{"Value":"String"}]}],"CustomFieldValues":[{"Id":0,"Column":"String","Name":"String","Description":"String","Value":"String","DataType":"String"}],"BookingCustomFields":[{"Id":0,"Name":"String","Description":"String","Width":0,"DataType":"String","DefaultValue":"String","IsMandatory":false,"MandatoryErrorMessage":"String","MaxLength":0,"MultipleLineText":false,"RegEx":"String","RegExErrorMessage":"String","Values":[{"Value":"String"}]}],"CustomerCustomFields":[{"Id":0,"Name":"String","Description":"String","Width":0,"DataType":"String","DefaultValue":"String","IsMandatory":false,"MandatoryErrorMessage":"String","MaxLength":0,"MultipleLineText":false,"RegEx":"String","RegExErrorMessage":"String","Values":[{"Value":"String"}]}],"BookingStatusOptions":[{"Id":0,"Name":"String","Description":"String"}],"Prices":[{"Id":0,"ServiceId":0,"Price":0,"CalculationTypeId":0,"CurrencyId":"String","PriceSign":"String","VAT":0,"Category":"String","PriceText":"String","DaysOfWeek":[{"DayOfWeekId":0,"DotNetDayOfWeekId":0,"DayOfWeek":"String"}],"FromTime":"00:00:00","ToTime":"00:00:00","Service":{"Id":0,"Name":"String","Description":"String","LengthInMinutes":0,"MaxNumberOfSpotsPerBooking":0,"MinNumberOfSpotsPerBooking":0,"GroupBooking":{"Active":false,"Min":0,"Max":0},"MultipleResource":{"Active":false,"Min":0,"Max":0},"IsGroupBooking":false,"IsPaymentEnabled":false},"IsTimeSpecific":false,"IsDaysOfWeekSpecific":false}],"Schedules":{"ScheduleType":"NotDefined","RecurringSchedules":[{}],"DateSchedules":[{}]},"RatingSummary":{"AverageScore":0,"RatingScore1Count":0,"RatingScore2Count":0,"RatingScore3Count":0,"RaingScore4Count":0,"RatingScore5Count":0,"Count":0},"Reviews":[{"Title":"String","Description":"String","RatingScore":0,"Author":"String","ReviewAnswer":"String"}],"ResourceTypes":[{"Id":0,"SelectableByUser":false,"Name":"String","Description":"String","Resources":[{"Id":0,"Name":"String","Description":"String","Email":"String","Phone":"String","Color":"String","Priority":0,"EmailNotification":false,"SMSNotification":false,"EmailReminder":false,"SMSReminder":false}]}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"PriceViewTypeId":0}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}