/* Options: Date: 2025-12-06 09:23:51 Version: 8.0 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://sfgboxapi.dev.scadsoftware.com //GlobalNamespace: //AddServiceStackTypes: True //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True IncludeTypes: CreateSubscribeCustomer.* //ExcludeTypes: //DefaultImports: package:servicestack/servicestack.dart */ import 'package:servicestack/servicestack.dart'; enum StripeType { unknown, account, card, charge, coupon, customer, discount, dispute, event, invoiceitem, invoice, line_item, plan, subscription, token, transfer, list, product, } class StripeObject implements IConvertible { StripeType? object; StripeObject({this.object}); StripeObject.fromJson(Map json) { fromMap(json); } fromMap(Map json) { object = JsonConverters.fromJson(json['object'],'StripeType',context!); return this; } Map toJson() => { 'object': JsonConverters.toJson(object,'StripeType',context!) }; getTypeName() => "StripeObject"; TypeContext? context = _ctx; } class StripeId extends StripeObject implements IConvertible { String? id; StripeId({this.id}); StripeId.fromJson(Map json) { fromMap(json); } fromMap(Map json) { super.fromMap(json); id = json['id']; return this; } Map toJson() => super.toJson()..addAll({ 'id': id }); getTypeName() => "StripeId"; TypeContext? context = _ctx; } enum StripeCouponDuration { forever, once, repeating, } class StripeCoupon extends StripeId implements IConvertible { int? amountOff; DateTime? created; String? currency; StripeCouponDuration? duration; int? durationInMonths; bool? livemode; int? maxRedemptions; Map? metadata; int? percentOff; DateTime? redeemBy; int? timesRedeemed; bool? valid; StripeCoupon({this.amountOff,this.created,this.currency,this.duration,this.durationInMonths,this.livemode,this.maxRedemptions,this.metadata,this.percentOff,this.redeemBy,this.timesRedeemed,this.valid}); StripeCoupon.fromJson(Map json) { fromMap(json); } fromMap(Map json) { super.fromMap(json); amountOff = json['amountOff']; created = JsonConverters.fromJson(json['created'],'DateTime',context!); currency = json['currency']; duration = JsonConverters.fromJson(json['duration'],'StripeCouponDuration',context!); durationInMonths = json['durationInMonths']; livemode = json['livemode']; maxRedemptions = json['maxRedemptions']; metadata = JsonConverters.toStringMap(json['metadata']); percentOff = json['percentOff']; redeemBy = JsonConverters.fromJson(json['redeemBy'],'DateTime',context!); timesRedeemed = json['timesRedeemed']; valid = json['valid']; return this; } Map toJson() => super.toJson()..addAll({ 'amountOff': amountOff, 'created': JsonConverters.toJson(created,'DateTime',context!), 'currency': currency, 'duration': JsonConverters.toJson(duration,'StripeCouponDuration',context!), 'durationInMonths': durationInMonths, 'livemode': livemode, 'maxRedemptions': maxRedemptions, 'metadata': metadata, 'percentOff': percentOff, 'redeemBy': JsonConverters.toJson(redeemBy,'DateTime',context!), 'timesRedeemed': timesRedeemed, 'valid': valid }); getTypeName() => "StripeCoupon"; TypeContext? context = _ctx; } class StripeDiscount extends StripeId implements IConvertible { String? customer; StripeCoupon? coupon; DateTime? start; DateTime? end; StripeDiscount({this.customer,this.coupon,this.start,this.end}); StripeDiscount.fromJson(Map json) { fromMap(json); } fromMap(Map json) { super.fromMap(json); customer = json['customer']; coupon = JsonConverters.fromJson(json['coupon'],'StripeCoupon',context!); start = JsonConverters.fromJson(json['start'],'DateTime',context!); end = JsonConverters.fromJson(json['end'],'DateTime',context!); return this; } Map toJson() => super.toJson()..addAll({ 'customer': customer, 'coupon': JsonConverters.toJson(coupon,'StripeCoupon',context!), 'start': JsonConverters.toJson(start,'DateTime',context!), 'end': JsonConverters.toJson(end,'DateTime',context!) }); getTypeName() => "StripeDiscount"; TypeContext? context = _ctx; } class StripeAddress implements IConvertible { String? city; String? country; String? line1; String? line2; String? postalCode; String? state; StripeAddress({this.city,this.country,this.line1,this.line2,this.postalCode,this.state}); StripeAddress.fromJson(Map json) { fromMap(json); } fromMap(Map json) { city = json['city']; country = json['country']; line1 = json['line1']; line2 = json['line2']; postalCode = json['postalCode']; state = json['state']; return this; } Map toJson() => { 'city': city, 'country': country, 'line1': line1, 'line2': line2, 'postalCode': postalCode, 'state': state }; getTypeName() => "StripeAddress"; TypeContext? context = _ctx; } class StripeShipping implements IConvertible { StripeAddress? address; String? name; String? phone; StripeShipping({this.address,this.name,this.phone}); StripeShipping.fromJson(Map json) { fromMap(json); } fromMap(Map json) { address = JsonConverters.fromJson(json['address'],'StripeAddress',context!); name = json['name']; phone = json['phone']; return this; } Map toJson() => { 'address': JsonConverters.toJson(address,'StripeAddress',context!), 'name': name, 'phone': phone }; getTypeName() => "StripeShipping"; TypeContext? context = _ctx; } class StripeCollection extends StripeId implements IConvertible { String? url; int? totalCount; bool? hasMore; List? data; StripeCollection({this.url,this.totalCount,this.hasMore,this.data}); StripeCollection.fromJson(Map json) { fromMap(json); } fromMap(Map json) { super.fromMap(json); url = json['url']; totalCount = json['totalCount']; hasMore = json['hasMore']; data = JsonConverters.fromJson(json['data'],'List<${runtimeGenericTypeDefs(this,[0]).join(",")}>',context!); return this; } Map toJson() => super.toJson()..addAll({ 'url': url, 'totalCount': totalCount, 'hasMore': hasMore, 'data': JsonConverters.toJson(data,'List',context!) }); getTypeName() => "StripeCollection<$T>"; TypeContext? context = _ctx; } enum StripeCvcCheck { Unknown, Pass, Fail, Unchecked, } class StripeCard extends StripeId implements IConvertible { String? brand; String? number; String? last4; String? dynamicLast4; int? expMonth; int? expYear; String? cvc; String? name; String? addressCity; String? addressCountry; String? addressLine1; String? addressLine2; String? addressState; String? addressZip; StripeCvcCheck? cvcCheck; String? addressLine1Check; String? addressZipCheck; String? funding; String? fingerprint; String? customer; String? country; StripeCard({this.brand,this.number,this.last4,this.dynamicLast4,this.expMonth,this.expYear,this.cvc,this.name,this.addressCity,this.addressCountry,this.addressLine1,this.addressLine2,this.addressState,this.addressZip,this.cvcCheck,this.addressLine1Check,this.addressZipCheck,this.funding,this.fingerprint,this.customer,this.country}); StripeCard.fromJson(Map json) { fromMap(json); } fromMap(Map json) { super.fromMap(json); brand = json['brand']; number = json['number']; last4 = json['last4']; dynamicLast4 = json['dynamicLast4']; expMonth = json['expMonth']; expYear = json['expYear']; cvc = json['cvc']; name = json['name']; addressCity = json['addressCity']; addressCountry = json['addressCountry']; addressLine1 = json['addressLine1']; addressLine2 = json['addressLine2']; addressState = json['addressState']; addressZip = json['addressZip']; cvcCheck = JsonConverters.fromJson(json['cvcCheck'],'StripeCvcCheck',context!); addressLine1Check = json['addressLine1Check']; addressZipCheck = json['addressZipCheck']; funding = json['funding']; fingerprint = json['fingerprint']; customer = json['customer']; country = json['country']; return this; } Map toJson() => super.toJson()..addAll({ 'brand': brand, 'number': number, 'last4': last4, 'dynamicLast4': dynamicLast4, 'expMonth': expMonth, 'expYear': expYear, 'cvc': cvc, 'name': name, 'addressCity': addressCity, 'addressCountry': addressCountry, 'addressLine1': addressLine1, 'addressLine2': addressLine2, 'addressState': addressState, 'addressZip': addressZip, 'cvcCheck': JsonConverters.toJson(cvcCheck,'StripeCvcCheck',context!), 'addressLine1Check': addressLine1Check, 'addressZipCheck': addressZipCheck, 'funding': funding, 'fingerprint': fingerprint, 'customer': customer, 'country': country }); getTypeName() => "StripeCard"; TypeContext? context = _ctx; } enum StripeSubscriptionStatus { Unknown, Trialing, Active, PastDue, Canceled, Unpaid, } enum StripePlanInterval { month, year, } class StripePlan extends StripeId implements IConvertible { int? amount; DateTime? created; String? currency; StripePlanInterval? interval; int? intervalCount; bool? livemode; Map? metadata; String? nickname; String? product; int? trialPeriodDays; StripePlan({this.amount,this.created,this.currency,this.interval,this.intervalCount,this.livemode,this.metadata,this.nickname,this.product,this.trialPeriodDays}); StripePlan.fromJson(Map json) { fromMap(json); } fromMap(Map json) { super.fromMap(json); amount = json['amount']; created = JsonConverters.fromJson(json['created'],'DateTime',context!); currency = json['currency']; interval = JsonConverters.fromJson(json['interval'],'StripePlanInterval',context!); intervalCount = json['intervalCount']; livemode = json['livemode']; metadata = JsonConverters.toStringMap(json['metadata']); nickname = json['nickname']; product = json['product']; trialPeriodDays = json['trialPeriodDays']; return this; } Map toJson() => super.toJson()..addAll({ 'amount': amount, 'created': JsonConverters.toJson(created,'DateTime',context!), 'currency': currency, 'interval': JsonConverters.toJson(interval,'StripePlanInterval',context!), 'intervalCount': intervalCount, 'livemode': livemode, 'metadata': metadata, 'nickname': nickname, 'product': product, 'trialPeriodDays': trialPeriodDays }); getTypeName() => "StripePlan"; TypeContext? context = _ctx; } class StripeSubscription extends StripeId implements IConvertible { DateTime? currentPeriodEnd; StripeSubscriptionStatus? status; StripePlan? plan; DateTime? currentPeriodStart; DateTime? start; DateTime? trialStart; bool? cancelAtPeriodEnd; DateTime? trialEnd; DateTime? canceledAt; DateTime? endedAt; String? customer; int? quantity; StripeSubscription({this.currentPeriodEnd,this.status,this.plan,this.currentPeriodStart,this.start,this.trialStart,this.cancelAtPeriodEnd,this.trialEnd,this.canceledAt,this.endedAt,this.customer,this.quantity}); StripeSubscription.fromJson(Map json) { fromMap(json); } fromMap(Map json) { super.fromMap(json); currentPeriodEnd = JsonConverters.fromJson(json['currentPeriodEnd'],'DateTime',context!); status = JsonConverters.fromJson(json['status'],'StripeSubscriptionStatus',context!); plan = JsonConverters.fromJson(json['plan'],'StripePlan',context!); currentPeriodStart = JsonConverters.fromJson(json['currentPeriodStart'],'DateTime',context!); start = JsonConverters.fromJson(json['start'],'DateTime',context!); trialStart = JsonConverters.fromJson(json['trialStart'],'DateTime',context!); cancelAtPeriodEnd = json['cancelAtPeriodEnd']; trialEnd = JsonConverters.fromJson(json['trialEnd'],'DateTime',context!); canceledAt = JsonConverters.fromJson(json['canceledAt'],'DateTime',context!); endedAt = JsonConverters.fromJson(json['endedAt'],'DateTime',context!); customer = json['customer']; quantity = json['quantity']; return this; } Map toJson() => super.toJson()..addAll({ 'currentPeriodEnd': JsonConverters.toJson(currentPeriodEnd,'DateTime',context!), 'status': JsonConverters.toJson(status,'StripeSubscriptionStatus',context!), 'plan': JsonConverters.toJson(plan,'StripePlan',context!), 'currentPeriodStart': JsonConverters.toJson(currentPeriodStart,'DateTime',context!), 'start': JsonConverters.toJson(start,'DateTime',context!), 'trialStart': JsonConverters.toJson(trialStart,'DateTime',context!), 'cancelAtPeriodEnd': cancelAtPeriodEnd, 'trialEnd': JsonConverters.toJson(trialEnd,'DateTime',context!), 'canceledAt': JsonConverters.toJson(canceledAt,'DateTime',context!), 'endedAt': JsonConverters.toJson(endedAt,'DateTime',context!), 'customer': customer, 'quantity': quantity }); getTypeName() => "StripeSubscription"; TypeContext? context = _ctx; } class StripeCustomer extends StripeId implements IConvertible { int? accountBalance; String? businessVatId; DateTime? created; String? defaultSource; bool? delinquent; String? description; StripeDiscount? discount; String? email; String? invoicePrefix; bool? livemode; Map? metadata; StripeShipping? shipping; StripeCollection? sources; StripeCollection? subscriptions; bool? deleted; String? currency; StripeCustomer({this.accountBalance,this.businessVatId,this.created,this.defaultSource,this.delinquent,this.description,this.discount,this.email,this.invoicePrefix,this.livemode,this.metadata,this.shipping,this.sources,this.subscriptions,this.deleted,this.currency}); StripeCustomer.fromJson(Map json) { fromMap(json); } fromMap(Map json) { super.fromMap(json); accountBalance = json['accountBalance']; businessVatId = json['businessVatId']; created = JsonConverters.fromJson(json['created'],'DateTime',context!); defaultSource = json['defaultSource']; delinquent = json['delinquent']; description = json['description']; discount = JsonConverters.fromJson(json['discount'],'StripeDiscount',context!); email = json['email']; invoicePrefix = json['invoicePrefix']; livemode = json['livemode']; metadata = JsonConverters.toStringMap(json['metadata']); shipping = JsonConverters.fromJson(json['shipping'],'StripeShipping',context!); sources = JsonConverters.fromJson(json['sources'],'StripeCollection',context!); subscriptions = JsonConverters.fromJson(json['subscriptions'],'StripeCollection',context!); deleted = json['deleted']; currency = json['currency']; return this; } Map toJson() => super.toJson()..addAll({ 'accountBalance': accountBalance, 'businessVatId': businessVatId, 'created': JsonConverters.toJson(created,'DateTime',context!), 'defaultSource': defaultSource, 'delinquent': delinquent, 'description': description, 'discount': JsonConverters.toJson(discount,'StripeDiscount',context!), 'email': email, 'invoicePrefix': invoicePrefix, 'livemode': livemode, 'metadata': metadata, 'shipping': JsonConverters.toJson(shipping,'StripeShipping',context!), 'sources': JsonConverters.toJson(sources,'StripeCollection',context!), 'subscriptions': JsonConverters.toJson(subscriptions,'StripeCollection',context!), 'deleted': deleted, 'currency': currency }); getTypeName() => "StripeCustomer"; TypeContext? context = _ctx; } // @Route("/create-customer", "POST") class CreateSubscribeCustomer implements IReturn, IPost, IConvertible { String? email; CreateSubscribeCustomer({this.email}); CreateSubscribeCustomer.fromJson(Map json) { fromMap(json); } fromMap(Map json) { email = json['email']; return this; } Map toJson() => { 'email': email }; createResponse() => StripeCustomer(); getResponseTypeName() => "StripeCustomer"; getTypeName() => "CreateSubscribeCustomer"; TypeContext? context = _ctx; } TypeContext _ctx = TypeContext(library: 'sfgboxapi.dev.scadsoftware.com', types: { 'StripeType': TypeInfo(TypeOf.Enum, enumValues:StripeType.values), 'StripeObject': TypeInfo(TypeOf.Class, create:() => StripeObject()), 'StripeId': TypeInfo(TypeOf.Class, create:() => StripeId()), 'StripeCouponDuration': TypeInfo(TypeOf.Enum, enumValues:StripeCouponDuration.values), 'StripeCoupon': TypeInfo(TypeOf.Class, create:() => StripeCoupon()), 'StripeDiscount': TypeInfo(TypeOf.Class, create:() => StripeDiscount()), 'StripeAddress': TypeInfo(TypeOf.Class, create:() => StripeAddress()), 'StripeShipping': TypeInfo(TypeOf.Class, create:() => StripeShipping()), 'StripeCollection': TypeInfo(TypeOf.Class, create:() => StripeCollection()), 'StripeCvcCheck': TypeInfo(TypeOf.Enum, enumValues:StripeCvcCheck.values), 'StripeCard': TypeInfo(TypeOf.Class, create:() => StripeCard()), 'StripeSubscriptionStatus': TypeInfo(TypeOf.Enum, enumValues:StripeSubscriptionStatus.values), 'StripePlanInterval': TypeInfo(TypeOf.Enum, enumValues:StripePlanInterval.values), 'StripePlan': TypeInfo(TypeOf.Class, create:() => StripePlan()), 'StripeSubscription': TypeInfo(TypeOf.Class, create:() => StripeSubscription()), 'StripeCustomer': TypeInfo(TypeOf.Class, create:() => StripeCustomer()), 'StripeCollection': TypeInfo(TypeOf.Class, create:() => StripeCollection()), 'StripeCollection': TypeInfo(TypeOf.Class, create:() => StripeCollection()), 'CreateSubscribeCustomer': TypeInfo(TypeOf.Class, create:() => CreateSubscribeCustomer()), });