active_zuora 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +22 -1
- data/Rakefile +0 -9
- data/VERSION +1 -1
- data/active_zuora.gemspec +43 -13
- data/lib/active_zuora.rb +5 -10
- data/lib/active_zuora/account.rb +27 -0
- data/lib/active_zuora/amendment.rb +7 -0
- data/lib/active_zuora/bill_run.rb +4 -0
- data/lib/active_zuora/contact.rb +7 -0
- data/lib/active_zuora/invoice.rb +46 -0
- data/lib/active_zuora/invoice_item.rb +26 -0
- data/lib/active_zuora/invoice_item_adjustment.rb +4 -0
- data/lib/active_zuora/invoice_payment.rb +11 -0
- data/lib/active_zuora/payment.rb +18 -0
- data/lib/active_zuora/payment_method.rb +10 -0
- data/lib/active_zuora/product.rb +4 -0
- data/lib/active_zuora/product_rate_plan.rb +9 -0
- data/lib/active_zuora/product_rate_plan_charge.rb +11 -0
- data/lib/active_zuora/product_rate_plan_charge_tier.rb +7 -0
- data/lib/active_zuora/product_rate_plan_charge_tier_data.rb +4 -0
- data/lib/active_zuora/rate_plan.rb +16 -0
- data/lib/active_zuora/rate_plan_charge.rb +44 -0
- data/lib/active_zuora/rate_plan_charge_data.rb +4 -0
- data/lib/active_zuora/rate_plan_charge_tier.rb +4 -0
- data/lib/{zuora → active_zuora}/rate_plan_data.rb +0 -0
- data/lib/active_zuora/refund.rb +4 -0
- data/lib/{zuora → active_zuora}/subscribe_options.rb +0 -0
- data/lib/active_zuora/subscribe_request.rb +13 -0
- data/lib/{zuora → active_zuora}/subscribe_with_existing_account_request.rb +0 -0
- data/lib/active_zuora/subscription.rb +17 -0
- data/lib/{zuora → active_zuora}/subscription_data.rb +0 -0
- data/lib/active_zuora/usage.rb +4 -0
- data/lib/active_zuora/zobject.rb +156 -0
- data/lib/zuora/ZUORA.rb +180 -27
- data/lib/zuora/ZUORADriver.rb +17 -0
- data/lib/zuora/ZUORAMappingRegistry.rb +236 -23
- data/lib/zuora_client.rb +28 -24
- data/lib/zuora_interface.rb +21 -5
- metadata +112 -17
- data/lib/zuora/account.rb +0 -4
- data/lib/zuora/contact.rb +0 -4
- data/lib/zuora/rate_plan.rb +0 -4
- data/lib/zuora/subscribe_request.rb +0 -4
- data/lib/zuora/subscription.rb +0 -4
- data/lib/zuora/zobject.rb +0 -52
File without changes
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Zuora
|
2
|
+
class SubscribeRequest < ZObject
|
3
|
+
def self.create(args={})
|
4
|
+
self.client.subscribe([self.new(args).to_zobject])
|
5
|
+
end
|
6
|
+
|
7
|
+
def save
|
8
|
+
result = self.class.client.subscribe([self.to_zobject])
|
9
|
+
self.account.id = result.accountId
|
10
|
+
result.success
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
File without changes
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Zuora
|
2
|
+
class Subscription < ZObject
|
3
|
+
|
4
|
+
def account
|
5
|
+
@account ||= Account.find(self.accountId)
|
6
|
+
end
|
7
|
+
|
8
|
+
def rate_plans
|
9
|
+
@rate_plans ||= RatePlan.where(:subscriptionId => self.id)
|
10
|
+
end
|
11
|
+
|
12
|
+
def unload_rate_plans
|
13
|
+
@rate_plans = nil
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
File without changes
|
@@ -0,0 +1,156 @@
|
|
1
|
+
module Zuora
|
2
|
+
class ZObject < SimpleDelegator
|
3
|
+
def initialize(attributes={})
|
4
|
+
super(self.class.zobject_class.new).tap do |zobject|
|
5
|
+
attributes.each do |attr, value|
|
6
|
+
zobject.send("#{attr}=", self.class.convert_date(value))
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.new_from_zobject(zobject)
|
12
|
+
self.new.tap do |active_zobject|
|
13
|
+
active_zobject.__setobj__(zobject)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def to_zobject
|
18
|
+
__getobj__
|
19
|
+
end
|
20
|
+
|
21
|
+
def id
|
22
|
+
__getobj__.id
|
23
|
+
end
|
24
|
+
|
25
|
+
def type
|
26
|
+
__getobj__.type
|
27
|
+
end
|
28
|
+
|
29
|
+
def ==(another)
|
30
|
+
id == another.id && another.respond_to?(:zobject_class) && zobject_class == another.zobject_class
|
31
|
+
end
|
32
|
+
|
33
|
+
def attributes
|
34
|
+
Hash.new.tap do |hash|
|
35
|
+
self.class.attribute_names.each do |attr|
|
36
|
+
hash[attr] = __getobj__.send(attr)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# Any attributes that are Dates should be created as a
|
42
|
+
# DateTime in the PST timezone.
|
43
|
+
# Zuora doesn't actually use the time portion of any Datetime field.
|
44
|
+
# All that matters is the date.
|
45
|
+
def self.convert_date(value)
|
46
|
+
if value.is_a?(Date) || value.is_a?(DateTime) || value.is_a?(Time)
|
47
|
+
DateTime.new(value.year, value.month, value.day, 0, 0, 0, "-0800")
|
48
|
+
else
|
49
|
+
value
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def destroy
|
54
|
+
self.class.destroy(id)
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.destroy(ids)
|
58
|
+
self.client.delete(self.klass_name, [ids].flatten)
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.create(attributes={})
|
62
|
+
self.client.create([self.new(attributes).to_zobject])
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.update_attributes(attributes={})
|
66
|
+
self.client.update([self.new(attributes).to_zobject])
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.zobject_class
|
70
|
+
return @zobject_class if @zobject_class
|
71
|
+
|
72
|
+
if ZUORA.const_defined?(self.klass_name)
|
73
|
+
@zobject_class = ZUORA.const_get(self.klass_name)
|
74
|
+
else
|
75
|
+
@zobject_class = self.superclass.respond_to?(:zobject_class) ? self.superclass.zobject_class : ZUORA.const_missing(self.klass_name)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def zobject_class
|
80
|
+
self.class.zobject_class
|
81
|
+
end
|
82
|
+
|
83
|
+
def self.klass_name
|
84
|
+
@klass_name ||= name.split("::").last
|
85
|
+
end
|
86
|
+
|
87
|
+
#TODO: This sucks attributes need to be clearly defined
|
88
|
+
def self.attribute_names
|
89
|
+
@attribute_names ||= zobject_class.instance_variable_get("@attributes")
|
90
|
+
end
|
91
|
+
|
92
|
+
def self.query_attribute_names(options={})
|
93
|
+
excluded_attributes = []
|
94
|
+
excluded_attributes.concat excluded_query_attributes unless options[:include_excluded]
|
95
|
+
excluded_attributes.concat extra_attributes unless options[:include_extras]
|
96
|
+
attribute_names - excluded_attributes
|
97
|
+
end
|
98
|
+
|
99
|
+
def self.exclude_query_attributes(*attributes)
|
100
|
+
excluded_query_attributes.concat attributes
|
101
|
+
end
|
102
|
+
|
103
|
+
def self.excluded_query_attributes
|
104
|
+
@excluded_query_attributes ||= [:fieldsToNull]
|
105
|
+
end
|
106
|
+
|
107
|
+
def self.extra_attributes(attributes=[])
|
108
|
+
attributes
|
109
|
+
end
|
110
|
+
|
111
|
+
def self.where(conditions={}, options={})
|
112
|
+
# You can give a hash or a string for the conditions
|
113
|
+
conditions = build_filter_statments(conditions) if conditions.is_a? Hash
|
114
|
+
query = "select #{self.query_attribute_names(options).join(", ")} from #{self.name.gsub(/Zuora::/,"")} where #{conditions}"
|
115
|
+
puts query if $DEBUG
|
116
|
+
zobjects = self.client.query(query)
|
117
|
+
zobjects.map{|zobject| self.new_from_zobject zobject }
|
118
|
+
end
|
119
|
+
|
120
|
+
def self.build_filter_statments(filter_statments)
|
121
|
+
filter_statments.map{|key, value|
|
122
|
+
value = "'#{value}'" if value.kind_of?(String)
|
123
|
+
value = "null" if value.nil?
|
124
|
+
"#{key} = #{value}"
|
125
|
+
}.join(" and ")
|
126
|
+
end
|
127
|
+
|
128
|
+
def self.find(id)
|
129
|
+
nil unless valid_id(id)
|
130
|
+
query = "select #{query_attribute_names(:include_extras => true).join(", ")} from #{self.name.gsub(/Zuora::/,"")} where Id = '#{id}'"
|
131
|
+
puts query if $DEBUG
|
132
|
+
zobject = client.query(query).first
|
133
|
+
new_from_zobject zobject if zobject
|
134
|
+
end
|
135
|
+
|
136
|
+
def self.valid_id(id)
|
137
|
+
id.to_s.size == 32 && id.hex.to_s(16) == id
|
138
|
+
end
|
139
|
+
|
140
|
+
def self.all(options={})
|
141
|
+
zobjects = client.query("select #{query_attribute_names(options).join(", ")} from #{self.name.gsub(/Zuora::/,"")}")
|
142
|
+
zobjects.map{|zobject| self.new_from_zobject zobject }
|
143
|
+
end
|
144
|
+
|
145
|
+
def self.client
|
146
|
+
return @client if @client && self.valid_session?
|
147
|
+
@session_start_time = Time.now
|
148
|
+
@client = Zuora::Client.new
|
149
|
+
end
|
150
|
+
|
151
|
+
def self.valid_session?
|
152
|
+
#session is valid if it has been running for less than 8 hours
|
153
|
+
@session_start_time + 28800 > Time.now
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
data/lib/zuora/ZUORA.rb
CHANGED
@@ -29,6 +29,7 @@ end
|
|
29
29
|
# fieldsToNull - SOAP::SOAPString
|
30
30
|
# id - (any)
|
31
31
|
# accountNumber - SOAP::SOAPString
|
32
|
+
# additionalEmailAddresses - SOAP::SOAPString
|
32
33
|
# allowInvoiceEdit - SOAP::SOAPBoolean
|
33
34
|
# autoPay - SOAP::SOAPBoolean
|
34
35
|
# batch - SOAP::SOAPString
|
@@ -51,6 +52,7 @@ class Account < ZObject
|
|
51
52
|
attr_accessor :fieldsToNull
|
52
53
|
attr_accessor :id
|
53
54
|
attr_accessor :accountNumber
|
55
|
+
attr_accessor :additionalEmailAddresses
|
54
56
|
attr_accessor :allowInvoiceEdit
|
55
57
|
attr_accessor :autoPay
|
56
58
|
attr_accessor :batch
|
@@ -72,10 +74,11 @@ class Account < ZObject
|
|
72
74
|
attr_accessor :updatedDate
|
73
75
|
attr_accessor :invoiceDeliveryPrefsEmail
|
74
76
|
|
75
|
-
def initialize(fieldsToNull = [], id = nil, accountNumber = nil, allowInvoiceEdit = nil, autoPay = nil, batch = nil, billCycleDay = nil, billToId = nil, createdDate = nil, crmId = nil, currency = nil, customerServiceRepName = nil, defaultPaymentMethodId = nil, paymentGateway = nil, name = nil, notes = nil, paymentTerm = nil, purchaseOrderNumber = nil, salesRepName = nil, soldToId = nil, status = nil, updatedDate = nil)
|
77
|
+
def initialize(fieldsToNull = [], id = nil, accountNumber = nil, additionalEmailAddresses = nil, allowInvoiceEdit = nil, autoPay = nil, batch = nil, billCycleDay = nil, billToId = nil, createdDate = nil, crmId = nil, currency = nil, customerServiceRepName = nil, defaultPaymentMethodId = nil, paymentGateway = nil, name = nil, notes = nil, paymentTerm = nil, purchaseOrderNumber = nil, salesRepName = nil, soldToId = nil, status = nil, updatedDate = nil)
|
76
78
|
@fieldsToNull = fieldsToNull
|
77
79
|
@id = id
|
78
80
|
@accountNumber = accountNumber
|
81
|
+
@additionalEmailAddresses = additionalEmailAddresses
|
79
82
|
@allowInvoiceEdit = allowInvoiceEdit
|
80
83
|
@autoPay = autoPay
|
81
84
|
@batch = batch
|
@@ -144,6 +147,7 @@ end
|
|
144
147
|
# {http://object.api.zuora.com/}Amendment
|
145
148
|
# fieldsToNull - SOAP::SOAPString
|
146
149
|
# id - (any)
|
150
|
+
# autoRenew - SOAP::SOAPBoolean
|
147
151
|
# contractEffectiveDate - SOAP::SOAPDateTime
|
148
152
|
# customerAcceptanceDate - SOAP::SOAPDateTime
|
149
153
|
# description - SOAP::SOAPString
|
@@ -154,12 +158,12 @@ end
|
|
154
158
|
# serviceActivationDate - SOAP::SOAPDateTime
|
155
159
|
# status - SOAP::SOAPString
|
156
160
|
# subscriptionId - (any)
|
157
|
-
# termCommitment - SOAP::SOAPString
|
158
161
|
# termStartDate - SOAP::SOAPDateTime
|
159
162
|
# type - SOAP::SOAPString
|
160
163
|
class Amendment < ZObject
|
161
164
|
attr_accessor :fieldsToNull
|
162
165
|
attr_accessor :id
|
166
|
+
attr_accessor :autoRenew
|
163
167
|
attr_accessor :contractEffectiveDate
|
164
168
|
attr_accessor :customerAcceptanceDate
|
165
169
|
attr_accessor :description
|
@@ -167,17 +171,18 @@ class Amendment < ZObject
|
|
167
171
|
attr_accessor :initialTerm
|
168
172
|
attr_accessor :name
|
169
173
|
attr_accessor :renewalTerm
|
174
|
+
attr_accessor :termType
|
170
175
|
attr_accessor :serviceActivationDate
|
171
176
|
attr_accessor :status
|
172
177
|
attr_accessor :subscriptionId
|
173
|
-
attr_accessor :termCommitment
|
174
178
|
attr_accessor :termStartDate
|
175
179
|
attr_accessor :type
|
176
180
|
attr_accessor :ratePlanData
|
177
181
|
|
178
|
-
def initialize(fieldsToNull = [], id = nil, contractEffectiveDate = nil, customerAcceptanceDate = nil, description = nil, effectiveDate = nil, initialTerm = nil, name = nil, renewalTerm = nil,
|
182
|
+
def initialize(fieldsToNull = [], id = nil, autoRenew = nil, contractEffectiveDate = nil, customerAcceptanceDate = nil, description = nil, effectiveDate = nil, initialTerm = nil, name = nil, renewalTerm = nil, termType = nil, serviceActivationDate = nil, status = nil, subscriptionId = nil, termStartDate = nil, type = nil, ratePlanData =[])
|
179
183
|
@fieldsToNull = fieldsToNull
|
180
184
|
@id = id
|
185
|
+
@autoRenew = autoRenew
|
181
186
|
@contractEffectiveDate = contractEffectiveDate
|
182
187
|
@customerAcceptanceDate = customerAcceptanceDate
|
183
188
|
@description = description
|
@@ -185,10 +190,10 @@ class Amendment < ZObject
|
|
185
190
|
@initialTerm = initialTerm
|
186
191
|
@name = name
|
187
192
|
@renewalTerm = renewalTerm
|
193
|
+
@termType = termType
|
188
194
|
@serviceActivationDate = serviceActivationDate
|
189
195
|
@status = status
|
190
196
|
@subscriptionId = subscriptionId
|
191
|
-
@termCommitment = termCommitment
|
192
197
|
@termStartDate = termStartDate
|
193
198
|
@type = type
|
194
199
|
@ratePlanData = ratePlanData
|
@@ -308,6 +313,54 @@ class Invoice < ZObject
|
|
308
313
|
end
|
309
314
|
end
|
310
315
|
|
316
|
+
class InvoiceItem < ZObject
|
317
|
+
attr_accessor :fieldsToNull
|
318
|
+
attr_accessor :id
|
319
|
+
attr_accessor :chargeAmount
|
320
|
+
attr_accessor :chargeDate
|
321
|
+
attr_accessor :chargeDescription
|
322
|
+
attr_accessor :chargeName
|
323
|
+
attr_accessor :chargeNumber
|
324
|
+
attr_accessor :invoiceId
|
325
|
+
attr_accessor :processingType
|
326
|
+
attr_accessor :productId
|
327
|
+
attr_accessor :productDescription
|
328
|
+
attr_accessor :productName
|
329
|
+
attr_accessor :quantity
|
330
|
+
attr_accessor :ratePlanChargeId
|
331
|
+
attr_accessor :serviceEndDate
|
332
|
+
attr_accessor :serviceStartDate
|
333
|
+
attr_accessor :subscriptionId
|
334
|
+
attr_accessor :subscriptionNumber
|
335
|
+
attr_accessor :taxAmount
|
336
|
+
attr_accessor :taxExemptAmount
|
337
|
+
attr_accessor :unitPrice
|
338
|
+
|
339
|
+
def initialize(fieldsToNull=[], id=nil, chargeAmount=nil, chargeDate=nil, chargeDescription=nil, chargeName=nil, chargeNumber=nil, invoiceId=nil, processingType=nil, productId=nil, productDescription=nil, productName=nil, quantity=nil, ratePlanChargeId=nil, serviceEndDate=nil, serviceStartDate=nil, subscriptionId=nil, subscriptionNumber=nil, taxAmount=nil, taxExemptAmount=nil, unitPrice=nil)
|
340
|
+
@fieldsToNull = fieldsToNull
|
341
|
+
@id = id
|
342
|
+
@chargeAmount = chargeAmount
|
343
|
+
@chargeDate = chargeDate
|
344
|
+
@chargeDescription = chargeDescription
|
345
|
+
@chargeName = chargeName
|
346
|
+
@chargeNumber = chargeNumber
|
347
|
+
@invoiceId = invoiceId
|
348
|
+
@processingType = processingType
|
349
|
+
@productId = productId
|
350
|
+
@productDescription = productDescription
|
351
|
+
@productName = productName
|
352
|
+
@quantity = quantity
|
353
|
+
@ratePlanChargeId = ratePlanChargeId
|
354
|
+
@serviceEndDate = serviceEndDate
|
355
|
+
@serviceStartDate = serviceStartDate
|
356
|
+
@subscriptionId = subscriptionId
|
357
|
+
@subscriptionNumber = subscriptionNumber
|
358
|
+
@taxAmount = taxAmount
|
359
|
+
@taxExemptAmount = taxExemptAmount
|
360
|
+
@unitPrice = unitPrice
|
361
|
+
end
|
362
|
+
end
|
363
|
+
|
311
364
|
class InvoiceItemAdjustment < ZObject
|
312
365
|
attr_accessor :fieldsToNull
|
313
366
|
attr_accessor :id
|
@@ -360,6 +413,8 @@ end
|
|
360
413
|
# id - (any)
|
361
414
|
# accountId - (any)
|
362
415
|
# amount - SOAP::SOAPDouble
|
416
|
+
# appliedInvoiceAmount - SOAP::SOAPDouble
|
417
|
+
# invoiceId - (any)
|
363
418
|
# comment - SOAP::SOAPString
|
364
419
|
# effectiveDate - SOAP::SOAPDateTime
|
365
420
|
# paymentMethodId - (any)
|
@@ -371,24 +426,44 @@ class Payment < ZObject
|
|
371
426
|
attr_accessor :id
|
372
427
|
attr_accessor :accountId
|
373
428
|
attr_accessor :amount
|
429
|
+
attr_accessor :appliedInvoiceAmount
|
430
|
+
attr_accessor :cancelledOn
|
431
|
+
attr_accessor :createdDate
|
432
|
+
attr_accessor :gatewayResponse
|
433
|
+
attr_accessor :gatewayResponseCode
|
434
|
+
attr_accessor :gatewayState
|
435
|
+
attr_accessor :invoiceId
|
374
436
|
attr_accessor :comment
|
375
437
|
attr_accessor :effectiveDate
|
376
438
|
attr_accessor :paymentMethodId
|
377
439
|
attr_accessor :referenceId
|
440
|
+
attr_accessor :refundAmount
|
378
441
|
attr_accessor :status
|
442
|
+
attr_accessor :settledOn
|
379
443
|
attr_accessor :type
|
444
|
+
attr_accessor :updatedDate
|
380
445
|
|
381
|
-
def initialize(fieldsToNull = [], id = nil, accountId = nil, amount = nil, comment = nil, effectiveDate = nil, paymentMethodId = nil, referenceId = nil, status = nil, type = nil)
|
446
|
+
def initialize(fieldsToNull = [], id = nil, accountId = nil, amount = nil, appliedInvoiceAmount = nil, cancelledOn = nil, createdDate = nil, gatewayResponse = nil, gatewayResponseCode = nil, gatewayState = nil, invoiceId = nil, comment = nil, effectiveDate = nil, paymentMethodId = nil, referenceId = nil, refundAmount = nil, status = nil, settledOn = nil, type = nil, updatedDate = nil)
|
382
447
|
@fieldsToNull = fieldsToNull
|
383
448
|
@id = id
|
384
449
|
@accountId = accountId
|
385
450
|
@amount = amount
|
451
|
+
@appliedInvoiceAmount = appliedInvoiceAmount
|
452
|
+
@cancelledOn = cancelledOn
|
453
|
+
@createdDate = createdDate
|
454
|
+
@gatewayResponse = gatewayResponse
|
455
|
+
@gatewayResponseCode = gatewayResponseCode
|
456
|
+
@gatewayState = gatewayState
|
457
|
+
@invoiceId = invoiceId
|
386
458
|
@comment = comment
|
387
459
|
@effectiveDate = effectiveDate
|
388
460
|
@paymentMethodId = paymentMethodId
|
389
461
|
@referenceId = referenceId
|
462
|
+
@refundAmount = refundAmount
|
390
463
|
@status = status
|
464
|
+
@settledOn = settledOn
|
391
465
|
@type = type
|
466
|
+
@updatedDate = updatedDate
|
392
467
|
end
|
393
468
|
end
|
394
469
|
|
@@ -589,10 +664,8 @@ class ProductRatePlanCharge < ZObject
|
|
589
664
|
attr_accessor :description
|
590
665
|
attr_accessor :maxQuantity
|
591
666
|
attr_accessor :minQuantity
|
592
|
-
attr_accessor :model
|
593
667
|
attr_accessor :name
|
594
668
|
attr_accessor :productRatePlanId
|
595
|
-
attr_accessor :type
|
596
669
|
attr_accessor :uOM
|
597
670
|
attr_accessor :chargeModel
|
598
671
|
attr_accessor :revRecCode
|
@@ -600,11 +673,9 @@ class ProductRatePlanCharge < ZObject
|
|
600
673
|
attr_accessor :chargeType
|
601
674
|
attr_accessor :billingPeriod
|
602
675
|
attr_accessor :billCycleType
|
603
|
-
attr_accessor :billingPeriodAlignement
|
604
676
|
attr_accessor :revRecTriggerCondition
|
605
|
-
attr_accessor :productRatePlanChargeTierData
|
606
677
|
|
607
|
-
def initialize(fieldsToNull = [], id = nil, accountingCode = nil, defaultQuantity = nil, description = nil, maxQuantity = nil, minQuantity = nil,
|
678
|
+
def initialize(fieldsToNull = [], id = nil, accountingCode = nil, defaultQuantity = nil, description = nil, maxQuantity = nil, minQuantity = nil, name = nil, productRatePlanId = nil, uOM = nil, chargeModel = nil, revRecCode=nil, triggerEvent=nil, chargeType=nil, billingPeriod=nil, billCycleType=nil, revRecTriggerCondition=nil)
|
608
679
|
@fieldsToNull = fieldsToNull
|
609
680
|
@id = id
|
610
681
|
@accountingCode = accountingCode
|
@@ -612,10 +683,8 @@ class ProductRatePlanCharge < ZObject
|
|
612
683
|
@description = description
|
613
684
|
@maxQuantity = maxQuantity
|
614
685
|
@minQuantity = minQuantity
|
615
|
-
@model = model
|
616
686
|
@name = name
|
617
687
|
@productRatePlanId = productRatePlanId
|
618
|
-
@type = type
|
619
688
|
@uOM = uOM
|
620
689
|
@chargeModel = chargeModel
|
621
690
|
@revRecCode=revRecCode,
|
@@ -623,9 +692,7 @@ class ProductRatePlanCharge < ZObject
|
|
623
692
|
@chargeType=chargeType,
|
624
693
|
@billingPeriod=billingPeriod,
|
625
694
|
@billCycleType=billCycleType,
|
626
|
-
@billingPeriodAlignement=billingPeriodAlignement
|
627
695
|
@revRecTriggerCondition=revRecTriggerCondition
|
628
|
-
@productRatePlanChargeTierData=productRatePlanChargeTierData
|
629
696
|
end
|
630
697
|
end
|
631
698
|
|
@@ -727,6 +794,8 @@ class RatePlanCharge < ZObject
|
|
727
794
|
attr_accessor :fieldsToNull
|
728
795
|
attr_accessor :id
|
729
796
|
attr_accessor :accountingCode
|
797
|
+
attr_accessor :billCycleDay
|
798
|
+
attr_accessor :billCycleType
|
730
799
|
attr_accessor :chargeModel
|
731
800
|
attr_accessor :chargeNumber
|
732
801
|
attr_accessor :chargeType
|
@@ -734,6 +803,7 @@ class RatePlanCharge < ZObject
|
|
734
803
|
attr_accessor :dMRC
|
735
804
|
attr_accessor :dTCV
|
736
805
|
attr_accessor :includedUnits
|
806
|
+
attr_accessor :isLastSegment
|
737
807
|
attr_accessor :mRR
|
738
808
|
attr_accessor :name
|
739
809
|
attr_accessor :numberOfPeriods
|
@@ -743,14 +813,17 @@ class RatePlanCharge < ZObject
|
|
743
813
|
attr_accessor :quantity
|
744
814
|
attr_accessor :ratePlanId
|
745
815
|
attr_accessor :tCV
|
816
|
+
attr_accessor :triggerDate
|
746
817
|
attr_accessor :triggerEvent
|
747
818
|
attr_accessor :uOM
|
748
819
|
attr_accessor :chargedThroughDate
|
749
820
|
|
750
|
-
def initialize(fieldsToNull = [], id = nil, accountingCode = nil, chargeModel = nil, chargeNumber = nil, chargeType = nil, description = nil, dMRC = nil, dTCV = nil, includedUnits = nil, mRR = nil, name = nil, numberOfPeriods = nil, overagePrice = nil, price = nil, productRatePlanChargeId = nil, quantity = nil, ratePlanId = nil, tCV = nil, triggerEvent = nil, uOM = nil, chargedThroughDate = nil)
|
821
|
+
def initialize(fieldsToNull = [], id = nil, accountingCode = nil, billCycleDay = nil, billCycleType = nil, chargeModel = nil, chargeNumber = nil, chargeType = nil, description = nil, dMRC = nil, dTCV = nil, includedUnits = nil, isLastSegment = nil, mRR = nil, name = nil, numberOfPeriods = nil, overagePrice = nil, price = nil, productRatePlanChargeId = nil, quantity = nil, ratePlanId = nil, tCV = nil, triggerDate = nil, triggerEvent = nil, uOM = nil, chargedThroughDate = nil)
|
751
822
|
@fieldsToNull = fieldsToNull
|
752
823
|
@id = id
|
753
824
|
@accountingCode = accountingCode
|
825
|
+
@billCycleDay = billCycleDay
|
826
|
+
@billCycleType = billCycleType
|
754
827
|
@chargeModel = chargeModel
|
755
828
|
@chargeNumber = chargeNumber
|
756
829
|
@chargeType = chargeType
|
@@ -758,6 +831,7 @@ class RatePlanCharge < ZObject
|
|
758
831
|
@dMRC = dMRC
|
759
832
|
@dTCV = dTCV
|
760
833
|
@includedUnits = includedUnits
|
834
|
+
@isLastSegment = isLastSegment
|
761
835
|
@mRR = mRR
|
762
836
|
@name = name
|
763
837
|
@numberOfPeriods = numberOfPeriods
|
@@ -767,6 +841,7 @@ class RatePlanCharge < ZObject
|
|
767
841
|
@quantity = quantity
|
768
842
|
@ratePlanId = ratePlanId
|
769
843
|
@tCV = tCV
|
844
|
+
@triggerDate = triggerDate
|
770
845
|
@triggerEvent = triggerEvent
|
771
846
|
@uOM = uOM
|
772
847
|
@chargedThroughDate = chargedThroughDate
|
@@ -816,12 +891,13 @@ end
|
|
816
891
|
# initialTerm - SOAP::SOAPInt
|
817
892
|
# name - SOAP::SOAPString
|
818
893
|
# notes - SOAP::SOAPString
|
819
|
-
#
|
820
|
-
# previousSubscriptionId -
|
894
|
+
# originalId - (any)
|
895
|
+
# previousSubscriptionId - (any)
|
821
896
|
# renewalTerm - SOAP::SOAPInt
|
822
897
|
# serviceActivationDate - SOAP::SOAPDateTime
|
823
898
|
# status - SOAP::SOAPString
|
824
899
|
# termStartDate - SOAP::SOAPDateTime
|
900
|
+
# termEndDate - SOAP::SOAPDateTime
|
825
901
|
# version - SOAP::SOAPInt
|
826
902
|
class Subscription < ZObject
|
827
903
|
attr_accessor :fieldsToNull
|
@@ -829,40 +905,44 @@ class Subscription < ZObject
|
|
829
905
|
attr_accessor :accountId
|
830
906
|
attr_accessor :autoRenew
|
831
907
|
attr_accessor :cancelledDate
|
908
|
+
attr_accessor :createdDate
|
832
909
|
attr_accessor :contractAcceptanceDate
|
833
910
|
attr_accessor :contractEffectiveDate
|
834
|
-
attr_accessor :currency
|
835
911
|
attr_accessor :initialTerm
|
836
912
|
attr_accessor :name
|
837
913
|
attr_accessor :notes
|
838
|
-
attr_accessor :
|
914
|
+
attr_accessor :originalId
|
839
915
|
attr_accessor :previousSubscriptionId
|
840
916
|
attr_accessor :renewalTerm
|
841
917
|
attr_accessor :serviceActivationDate
|
842
918
|
attr_accessor :subscriptionEndDate
|
843
919
|
attr_accessor :status
|
844
920
|
attr_accessor :termStartDate
|
921
|
+
attr_accessor :termEndDate
|
922
|
+
attr_accessor :termType
|
845
923
|
attr_accessor :version
|
846
924
|
|
847
|
-
def initialize(fieldsToNull = [], id = nil, accountId = nil, autoRenew = nil, cancelledDate = nil,
|
925
|
+
def initialize(fieldsToNull = [], id = nil, accountId = nil, autoRenew = nil, cancelledDate = nil, createdDate = nil, contractAcceptanceDate = nil, contractEffectiveDate = nil, initialTerm = nil, name = nil, notes = nil, originalId = nil, previousSubscriptionId = nil, renewalTerm = nil, serviceActivationDate = nil, subscriptionEndDate = nil, status = nil, termStartDate = nil, termEndDate = nil, termType = nil, version = nil)
|
848
926
|
@fieldsToNull = fieldsToNull
|
849
927
|
@id = id
|
850
928
|
@accountId = accountId
|
851
929
|
@autoRenew = autoRenew
|
852
930
|
@cancelledDate = cancelledDate
|
931
|
+
@createdDate = createdDate
|
853
932
|
@contractAcceptanceDate = contractAcceptanceDate
|
854
933
|
@contractEffectiveDate = contractEffectiveDate
|
855
|
-
@currency = currency
|
856
934
|
@initialTerm = initialTerm
|
857
935
|
@name = name
|
858
936
|
@notes = notes
|
859
|
-
@
|
937
|
+
@originalId = originalId
|
860
938
|
@previousSubscriptionId = previousSubscriptionId
|
861
939
|
@renewalTerm = renewalTerm
|
862
940
|
@serviceActivationDate = serviceActivationDate
|
863
941
|
@subscriptionEndDate= subscriptionEndDate
|
864
942
|
@status = status
|
865
943
|
@termStartDate = termStartDate
|
944
|
+
@termEndDate = termEndDate
|
945
|
+
@termType = termType
|
866
946
|
@version = version
|
867
947
|
end
|
868
948
|
end
|
@@ -885,7 +965,9 @@ class Usage < ZObject
|
|
885
965
|
attr_accessor :fieldsToNull
|
886
966
|
attr_accessor :id
|
887
967
|
attr_accessor :accountId
|
968
|
+
attr_accessor :chargeId
|
888
969
|
attr_accessor :chargeNumber
|
970
|
+
attr_accessor :description
|
889
971
|
attr_accessor :endDateTime
|
890
972
|
attr_accessor :quantity
|
891
973
|
attr_accessor :rbeStatus
|
@@ -896,11 +978,13 @@ class Usage < ZObject
|
|
896
978
|
attr_accessor :subscriptionNumber
|
897
979
|
attr_accessor :uOM
|
898
980
|
|
899
|
-
def initialize(fieldsToNull = [], id = nil, accountId = nil, chargeNumber = nil, endDateTime = nil, quantity = nil, rbeStatus = nil, sourceName = nil, sourceType = nil, startDateTime = nil, submissionDateTime = nil, subscriptionNumber = nil, uOM = nil)
|
981
|
+
def initialize(fieldsToNull = [], id = nil, accountId = nil, chargeId = nil, chargeNumber = nil, description = nil, endDateTime = nil, quantity = nil, rbeStatus = nil, sourceName = nil, sourceType = nil, startDateTime = nil, submissionDateTime = nil, subscriptionNumber = nil, uOM = nil)
|
900
982
|
@fieldsToNull = fieldsToNull
|
901
983
|
@id = id
|
902
984
|
@accountId = accountId
|
985
|
+
@chargeId = chargeId
|
903
986
|
@chargeNumber = chargeNumber
|
987
|
+
@description = description
|
904
988
|
@endDateTime = endDateTime
|
905
989
|
@quantity = quantity
|
906
990
|
@rbeStatus = rbeStatus
|
@@ -998,12 +1082,10 @@ end
|
|
998
1082
|
# ratePlanCharge - ZUORA::RatePlanCharge
|
999
1083
|
class RatePlanData
|
1000
1084
|
attr_accessor :ratePlan
|
1001
|
-
attr_accessor :ratePlanCharge
|
1002
1085
|
attr_accessor :ratePlanChargeData
|
1003
1086
|
|
1004
|
-
def initialize(ratePlan = nil,
|
1087
|
+
def initialize(ratePlan = nil, ratePlanChargeData = [])
|
1005
1088
|
@ratePlan = ratePlan
|
1006
|
-
@ratePlanCharge = ratePlanCharge
|
1007
1089
|
@ratePlanChargeData = ratePlanChargeData
|
1008
1090
|
end
|
1009
1091
|
end
|
@@ -1052,6 +1134,51 @@ class SubscribeResult
|
|
1052
1134
|
end
|
1053
1135
|
end
|
1054
1136
|
|
1137
|
+
class AmendRequest
|
1138
|
+
attr_accessor :amendment, :amendOptions, :previewOptions
|
1139
|
+
|
1140
|
+
def initialize(amendment = nil, amendOptions = nil, previewOptions = nil)
|
1141
|
+
@amendment, @amendOptions, @previewOptions = amendment, amendOptions, previewOptions
|
1142
|
+
end
|
1143
|
+
end
|
1144
|
+
|
1145
|
+
class AmendOptions
|
1146
|
+
attr_accessor :generateInvoice, :invoiceProcessingOptions, :processPayments
|
1147
|
+
|
1148
|
+
def initialize(generateInvoice = nil, invoiceProcessingOptions = nil, processPayments = nil)
|
1149
|
+
@generateInvoice, @invoiceProcessingOptions, @processPayments =
|
1150
|
+
generateInvoice, invoiceProcessingOptions, processPayments
|
1151
|
+
end
|
1152
|
+
end
|
1153
|
+
|
1154
|
+
class InvoiceProcessingOptions
|
1155
|
+
attr_accessor :invoiceTargetDate
|
1156
|
+
|
1157
|
+
def initialize(invoiceTargetDate = nil)
|
1158
|
+
@invoiceTargetDate = invoiceTargetDate
|
1159
|
+
end
|
1160
|
+
end
|
1161
|
+
|
1162
|
+
class PreviewOptions
|
1163
|
+
attr_accessor :enablePreviewMode, :numberOfPeriods
|
1164
|
+
|
1165
|
+
def initialize(enablePreviewMode = nil, numberOfPeriods = nil)
|
1166
|
+
@enablePreviewMode, @numberOfPeriods = enablePreviewMode, numberOfPeriods
|
1167
|
+
end
|
1168
|
+
end
|
1169
|
+
|
1170
|
+
class AmendResult
|
1171
|
+
attr_accessor :amendmentIds
|
1172
|
+
attr_accessor :errors
|
1173
|
+
attr_accessor :success
|
1174
|
+
|
1175
|
+
def initialize(amendmentIds = [], errors = [], success = nil)
|
1176
|
+
@amendmentIds = amendmentIds
|
1177
|
+
@errors = errors
|
1178
|
+
@success = success
|
1179
|
+
end
|
1180
|
+
end
|
1181
|
+
|
1055
1182
|
# {http://api.zuora.com/}SaveResult
|
1056
1183
|
# errors - ZUORA::Error
|
1057
1184
|
# id - (any)
|
@@ -1265,6 +1392,12 @@ end
|
|
1265
1392
|
class SubscribeResponse < ::Array
|
1266
1393
|
end
|
1267
1394
|
|
1395
|
+
class Amend < ::Array
|
1396
|
+
end
|
1397
|
+
|
1398
|
+
class AmendResponse < ::Array
|
1399
|
+
end
|
1400
|
+
|
1268
1401
|
# {http://api.zuora.com/}create
|
1269
1402
|
class Create < ::Array
|
1270
1403
|
end
|
@@ -1326,6 +1459,26 @@ class QueryResponse
|
|
1326
1459
|
end
|
1327
1460
|
end
|
1328
1461
|
|
1462
|
+
# {http://api.zuora.com/}queryMore
|
1463
|
+
# queryLocator - SOAP::SOAPString
|
1464
|
+
class QueryMore
|
1465
|
+
attr_accessor :queryLocator
|
1466
|
+
|
1467
|
+
def initialize(queryLocator = nil)
|
1468
|
+
@queryLocator = queryLocator
|
1469
|
+
end
|
1470
|
+
end
|
1471
|
+
|
1472
|
+
# {http://api.zuora.com/}queryMoreResponse
|
1473
|
+
# result - ZUORA::QueryResult
|
1474
|
+
class QueryMoreResponse
|
1475
|
+
attr_accessor :result
|
1476
|
+
|
1477
|
+
def initialize(result = nil)
|
1478
|
+
@result = result
|
1479
|
+
end
|
1480
|
+
end
|
1481
|
+
|
1329
1482
|
# {http://api.zuora.com/}SessionHeader
|
1330
1483
|
# session - SOAP::SOAPString
|
1331
1484
|
class SessionHeader
|