killbill 7.0.6 → 8.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +0 -6
  3. data/Gemfile.lock +13 -15
  4. data/Jarfile +10 -9
  5. data/Jarfile.lock +53 -50
  6. data/NEWS +0 -4
  7. data/README.md +13 -1
  8. data/generators/active_merchant/templates/spec/spec_helper.rb +5 -9
  9. data/killbill.gemspec +0 -1
  10. data/lib/killbill/gen/api/account.rb +26 -1
  11. data/lib/killbill/gen/api/dry_run_arguments.rb +4 -7
  12. data/lib/killbill/gen/api/entitlement.rb +7 -1
  13. data/lib/killbill/gen/api/entitlement_api.rb +42 -84
  14. data/lib/killbill/gen/api/immutable_account_data.rb +26 -1
  15. data/lib/killbill/gen/api/invoice_user_api.rb +52 -12
  16. data/lib/killbill/gen/api/killbill_nodes_api.rb +30 -13
  17. data/lib/killbill/gen/api/migration_plan.rb +19 -12
  18. data/lib/killbill/gen/api/osgi_killbill.rb +8 -1
  19. data/lib/killbill/gen/api/payment_api.rb +51 -0
  20. data/lib/killbill/gen/api/plan.rb +19 -12
  21. data/lib/killbill/gen/api/require_gen.rb +1 -0
  22. data/lib/killbill/gen/api/subscription.rb +7 -1
  23. data/lib/killbill/gen/api/subscription_api.rb +279 -164
  24. data/lib/killbill/gen/api/subscription_event.rb +1 -12
  25. data/lib/killbill/gen/api/subscription_usage_record.rb +8 -2
  26. data/lib/killbill/gen/api/usage_api_exception.rb +68 -0
  27. data/lib/killbill/gen/plugin-api/blocking_state_metadata.rb +137 -0
  28. data/lib/killbill/gen/plugin-api/entitlement_context.rb +26 -8
  29. data/lib/killbill/gen/plugin-api/prior_entitlement_result.rb +26 -8
  30. data/lib/killbill/gen/plugin-api/require_gen.rb +1 -0
  31. data/lib/killbill/helpers/active_merchant/active_record/models/response.rb +1 -0
  32. data/lib/killbill/helpers/active_merchant/payment_plugin.rb +1 -6
  33. data/lib/killbill/migration.rb +2 -13
  34. data/lib/killbill/version.rb +1 -1
  35. data/spec/killbill/helpers/payment_method_spec.rb +8 -8
  36. data/spec/killbill/helpers/response_spec.rb +4 -4
  37. data/spec/spec_helper.rb +1 -1
  38. metadata +102 -82
@@ -130,6 +130,7 @@ require 'killbill/gen/api/rolled_up_unit'
130
130
  require 'killbill/gen/api/rolled_up_usage'
131
131
  require 'killbill/gen/api/subscription_usage_record'
132
132
  require 'killbill/gen/api/unit_usage_record'
133
+ require 'killbill/gen/api/usage_api_exception'
133
134
  require 'killbill/gen/api/usage_record'
134
135
  require 'killbill/gen/api/usage_user_api'
135
136
  require 'killbill/gen/api/audit_user_api'
@@ -34,7 +34,7 @@ module Killbill
34
34
 
35
35
  include org.killbill.billing.entitlement.api.Subscription
36
36
 
37
- attr_accessor :base_entitlement_id, :bundle_id, :account_id, :external_key, :state, :source_type, :effective_start_date, :effective_end_date, :last_active_product, :last_active_plan, :last_active_phase, :last_active_price_list, :last_active_product_category, :id, :created_date, :updated_date, :billing_start_date, :billing_end_date, :charged_through_date, :subscription_events
37
+ attr_accessor :base_entitlement_id, :bundle_id, :account_id, :external_key, :state, :source_type, :effective_start_date, :effective_end_date, :last_active_product, :last_active_plan, :last_active_phase, :last_active_price_list, :last_active_product_category, :bill_cycle_day_local, :id, :created_date, :updated_date, :billing_start_date, :billing_end_date, :charged_through_date, :subscription_events
38
38
 
39
39
  def initialize()
40
40
  end
@@ -83,6 +83,9 @@ module Killbill
83
83
  # conversion for last_active_product_category [type = org.killbill.billing.catalog.api.ProductCategory]
84
84
  @last_active_product_category = Java::org.killbill.billing.catalog.api.ProductCategory.value_of( @last_active_product_category.to_s ) unless @last_active_product_category.nil?
85
85
 
86
+ # conversion for bill_cycle_day_local [type = java.lang.Integer]
87
+ @bill_cycle_day_local = @bill_cycle_day_local
88
+
86
89
  # conversion for id [type = java.util.UUID]
87
90
  @id = java.util.UUID.fromString(@id.to_s) unless @id.nil?
88
91
 
@@ -180,6 +183,9 @@ module Killbill
180
183
  @last_active_product_category = j_obj.last_active_product_category
181
184
  @last_active_product_category = @last_active_product_category.to_s.to_sym unless @last_active_product_category.nil?
182
185
 
186
+ # conversion for bill_cycle_day_local [type = java.lang.Integer]
187
+ @bill_cycle_day_local = j_obj.bill_cycle_day_local
188
+
183
189
  # conversion for id [type = java.util.UUID]
184
190
  @id = j_obj.id
185
191
  @id = @id.nil? ? nil : @id.to_s
@@ -39,186 +39,301 @@ module Killbill
39
39
  end
40
40
 
41
41
 
42
- java_signature 'Java::org.killbill.billing.entitlement.api.Subscription getSubscriptionForEntitlementId(Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
43
- def get_subscription_for_entitlement_id(entitlementId, context)
44
-
45
- # conversion for entitlementId [type = java.util.UUID]
46
- entitlementId = java.util.UUID.fromString(entitlementId.to_s) unless entitlementId.nil?
47
-
48
- # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
49
- context = context.to_java unless context.nil?
50
- begin
51
- res = @real_java_api.get_subscription_for_entitlement_id(entitlementId, context)
52
- # conversion for res [type = org.killbill.billing.entitlement.api.Subscription]
53
- res = Killbill::Plugin::Model::Subscription.new.to_ruby(res) unless res.nil?
54
- return res
55
- rescue Java::org.killbill.billing.entitlement.api.SubscriptionApiException => e
56
- raise Killbill::Plugin::Model::SubscriptionApiException.new.to_ruby(e)
57
- end
58
- end
42
+ java_signature 'Java::int PAST_EVENTS()'
43
+ def past_events()
44
+ res = @real_java_api.past_events()
45
+ # conversion for res [type = int]
46
+ return res
47
+ end
59
48
 
60
- java_signature 'Java::org.killbill.billing.entitlement.api.SubscriptionBundle getSubscriptionBundle(Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
61
- def get_subscription_bundle(bundleId, context)
62
-
63
- # conversion for bundleId [type = java.util.UUID]
64
- bundleId = java.util.UUID.fromString(bundleId.to_s) unless bundleId.nil?
65
-
66
- # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
67
- context = context.to_java unless context.nil?
68
- begin
69
- res = @real_java_api.get_subscription_bundle(bundleId, context)
70
- # conversion for res [type = org.killbill.billing.entitlement.api.SubscriptionBundle]
71
- res = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(res) unless res.nil?
72
- return res
73
- rescue Java::org.killbill.billing.entitlement.api.SubscriptionApiException => e
74
- raise Killbill::Plugin::Model::SubscriptionApiException.new.to_ruby(e)
75
- end
76
- end
49
+ java_signature 'Java::int PRESENT_EVENTS()'
50
+ def present_events()
51
+ res = @real_java_api.present_events()
52
+ # conversion for res [type = int]
53
+ return res
54
+ end
77
55
 
78
- java_signature 'Java::void updateExternalKey(Java::java.util.UUID, Java::java.lang.String, Java::org.killbill.billing.util.callcontext.CallContext)'
79
- def update_external_key(bundleId, newExternalKey, context)
56
+ java_signature 'Java::int FUTURE_EVENTS()'
57
+ def future_events()
58
+ res = @real_java_api.future_events()
59
+ # conversion for res [type = int]
60
+ return res
61
+ end
80
62
 
81
- # conversion for bundleId [type = java.util.UUID]
82
- bundleId = java.util.UUID.fromString(bundleId.to_s) unless bundleId.nil?
63
+ java_signature 'Java::int PAST_OR_PRESENT_EVENTS()'
64
+ def past_or_present_events()
65
+ res = @real_java_api.past_or_present_events()
66
+ # conversion for res [type = int]
67
+ return res
68
+ end
83
69
 
84
- # conversion for newExternalKey [type = java.lang.String]
85
- newExternalKey = newExternalKey.to_s unless newExternalKey.nil?
70
+ java_signature 'Java::int FUTURE_OR_PRESENT_EVENTS()'
71
+ def future_or_present_events()
72
+ res = @real_java_api.future_or_present_events()
73
+ # conversion for res [type = int]
74
+ return res
75
+ end
86
76
 
87
- # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
88
- context = context.to_java unless context.nil?
89
- @real_java_api.update_external_key(bundleId, newExternalKey, context)
90
- end
77
+ java_signature 'Java::int ALL_EVENTS()'
78
+ def all_events()
79
+ res = @real_java_api.all_events()
80
+ # conversion for res [type = int]
81
+ return res
82
+ end
91
83
 
92
- java_signature 'Java::java.util.List getSubscriptionBundlesForAccountIdAndExternalKey(Java::java.util.UUID, Java::java.lang.String, Java::org.killbill.billing.util.callcontext.TenantContext)'
93
- def get_subscription_bundles_for_account_id_and_external_key(accountId, externalKey, context)
94
-
95
- # conversion for accountId [type = java.util.UUID]
96
- accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
97
-
98
- # conversion for externalKey [type = java.lang.String]
99
- externalKey = externalKey.to_s unless externalKey.nil?
100
-
101
- # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
102
- context = context.to_java unless context.nil?
103
- begin
104
- res = @real_java_api.get_subscription_bundles_for_account_id_and_external_key(accountId, externalKey, context)
105
- # conversion for res [type = java.util.List]
106
- tmp = []
107
- (res || []).each do |m|
108
- # conversion for m [type = org.killbill.billing.entitlement.api.SubscriptionBundle]
109
- m = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(m) unless m.nil?
110
- tmp << m
111
- end
112
- res = tmp
113
- return res
114
- rescue Java::org.killbill.billing.entitlement.api.SubscriptionApiException => e
115
- raise Killbill::Plugin::Model::SubscriptionApiException.new.to_ruby(e)
116
- end
117
- end
84
+ java_signature 'Java::org.killbill.billing.entitlement.api.Subscription getSubscriptionForEntitlementId(Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
85
+ def get_subscription_for_entitlement_id(entitlementId, context)
86
+
87
+ # conversion for entitlementId [type = java.util.UUID]
88
+ entitlementId = java.util.UUID.fromString(entitlementId.to_s) unless entitlementId.nil?
89
+
90
+ # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
91
+ context = context.to_java unless context.nil?
92
+ begin
93
+ res = @real_java_api.get_subscription_for_entitlement_id(entitlementId, context)
94
+ # conversion for res [type = org.killbill.billing.entitlement.api.Subscription]
95
+ res = Killbill::Plugin::Model::Subscription.new.to_ruby(res) unless res.nil?
96
+ return res
97
+ rescue Java::org.killbill.billing.entitlement.api.SubscriptionApiException => e
98
+ raise Killbill::Plugin::Model::SubscriptionApiException.new.to_ruby(e)
99
+ end
100
+ end
118
101
 
119
- java_signature 'Java::org.killbill.billing.entitlement.api.SubscriptionBundle getActiveSubscriptionBundleForExternalKey(Java::java.lang.String, Java::org.killbill.billing.util.callcontext.TenantContext)'
120
- def get_active_subscription_bundle_for_external_key(externalKey, context)
121
-
122
- # conversion for externalKey [type = java.lang.String]
123
- externalKey = externalKey.to_s unless externalKey.nil?
124
-
125
- # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
126
- context = context.to_java unless context.nil?
127
- begin
128
- res = @real_java_api.get_active_subscription_bundle_for_external_key(externalKey, context)
129
- # conversion for res [type = org.killbill.billing.entitlement.api.SubscriptionBundle]
130
- res = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(res) unless res.nil?
131
- return res
132
- rescue Java::org.killbill.billing.entitlement.api.SubscriptionApiException => e
133
- raise Killbill::Plugin::Model::SubscriptionApiException.new.to_ruby(e)
134
- end
135
- end
102
+ java_signature 'Java::org.killbill.billing.entitlement.api.SubscriptionBundle getSubscriptionBundle(Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
103
+ def get_subscription_bundle(bundleId, context)
104
+
105
+ # conversion for bundleId [type = java.util.UUID]
106
+ bundleId = java.util.UUID.fromString(bundleId.to_s) unless bundleId.nil?
107
+
108
+ # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
109
+ context = context.to_java unless context.nil?
110
+ begin
111
+ res = @real_java_api.get_subscription_bundle(bundleId, context)
112
+ # conversion for res [type = org.killbill.billing.entitlement.api.SubscriptionBundle]
113
+ res = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(res) unless res.nil?
114
+ return res
115
+ rescue Java::org.killbill.billing.entitlement.api.SubscriptionApiException => e
116
+ raise Killbill::Plugin::Model::SubscriptionApiException.new.to_ruby(e)
117
+ end
118
+ end
136
119
 
137
- java_signature 'Java::java.util.List getSubscriptionBundlesForExternalKey(Java::java.lang.String, Java::org.killbill.billing.util.callcontext.TenantContext)'
138
- def get_subscription_bundles_for_external_key(externalKey, context)
139
-
140
- # conversion for externalKey [type = java.lang.String]
141
- externalKey = externalKey.to_s unless externalKey.nil?
142
-
143
- # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
144
- context = context.to_java unless context.nil?
145
- begin
146
- res = @real_java_api.get_subscription_bundles_for_external_key(externalKey, context)
147
- # conversion for res [type = java.util.List]
148
- tmp = []
149
- (res || []).each do |m|
150
- # conversion for m [type = org.killbill.billing.entitlement.api.SubscriptionBundle]
151
- m = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(m) unless m.nil?
152
- tmp << m
153
- end
154
- res = tmp
155
- return res
156
- rescue Java::org.killbill.billing.entitlement.api.SubscriptionApiException => e
157
- raise Killbill::Plugin::Model::SubscriptionApiException.new.to_ruby(e)
158
- end
159
- end
120
+ java_signature 'Java::void updateExternalKey(Java::java.util.UUID, Java::java.lang.String, Java::org.killbill.billing.util.callcontext.CallContext)'
121
+ def update_external_key(bundleId, newExternalKey, context)
160
122
 
161
- java_signature 'Java::java.util.List getSubscriptionBundlesForAccountId(Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
162
- def get_subscription_bundles_for_account_id(accountId, context)
163
-
164
- # conversion for accountId [type = java.util.UUID]
165
- accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
166
-
167
- # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
168
- context = context.to_java unless context.nil?
169
- begin
170
- res = @real_java_api.get_subscription_bundles_for_account_id(accountId, context)
171
- # conversion for res [type = java.util.List]
172
- tmp = []
173
- (res || []).each do |m|
174
- # conversion for m [type = org.killbill.billing.entitlement.api.SubscriptionBundle]
175
- m = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(m) unless m.nil?
176
- tmp << m
177
- end
178
- res = tmp
179
- return res
180
- rescue Java::org.killbill.billing.entitlement.api.SubscriptionApiException => e
181
- raise Killbill::Plugin::Model::SubscriptionApiException.new.to_ruby(e)
182
- end
183
- end
123
+ # conversion for bundleId [type = java.util.UUID]
124
+ bundleId = java.util.UUID.fromString(bundleId.to_s) unless bundleId.nil?
184
125
 
185
- java_signature 'Java::org.killbill.billing.util.entity.Pagination getSubscriptionBundles(Java::java.lang.Long, Java::java.lang.Long, Java::org.killbill.billing.util.callcontext.TenantContext)'
186
- def get_subscription_bundles(offset, limit, context)
126
+ # conversion for newExternalKey [type = java.lang.String]
127
+ newExternalKey = newExternalKey.to_s unless newExternalKey.nil?
187
128
 
188
- # conversion for offset [type = java.lang.Long]
189
- offset = offset
129
+ # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
130
+ context = context.to_java unless context.nil?
131
+ @real_java_api.update_external_key(bundleId, newExternalKey, context)
132
+ end
190
133
 
191
- # conversion for limit [type = java.lang.Long]
192
- limit = limit
134
+ java_signature 'Java::java.util.List getSubscriptionBundlesForAccountIdAndExternalKey(Java::java.util.UUID, Java::java.lang.String, Java::org.killbill.billing.util.callcontext.TenantContext)'
135
+ def get_subscription_bundles_for_account_id_and_external_key(accountId, externalKey, context)
136
+
137
+ # conversion for accountId [type = java.util.UUID]
138
+ accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
139
+
140
+ # conversion for externalKey [type = java.lang.String]
141
+ externalKey = externalKey.to_s unless externalKey.nil?
142
+
143
+ # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
144
+ context = context.to_java unless context.nil?
145
+ begin
146
+ res = @real_java_api.get_subscription_bundles_for_account_id_and_external_key(accountId, externalKey, context)
147
+ # conversion for res [type = java.util.List]
148
+ tmp = []
149
+ (res || []).each do |m|
150
+ # conversion for m [type = org.killbill.billing.entitlement.api.SubscriptionBundle]
151
+ m = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(m) unless m.nil?
152
+ tmp << m
153
+ end
154
+ res = tmp
155
+ return res
156
+ rescue Java::org.killbill.billing.entitlement.api.SubscriptionApiException => e
157
+ raise Killbill::Plugin::Model::SubscriptionApiException.new.to_ruby(e)
158
+ end
159
+ end
193
160
 
194
- # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
195
- context = context.to_java unless context.nil?
196
- res = @real_java_api.get_subscription_bundles(offset, limit, context)
197
- # conversion for res [type = org.killbill.billing.util.entity.Pagination]
198
- res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
199
- return res
200
- end
161
+ java_signature 'Java::org.killbill.billing.entitlement.api.SubscriptionBundle getActiveSubscriptionBundleForExternalKey(Java::java.lang.String, Java::org.killbill.billing.util.callcontext.TenantContext)'
162
+ def get_active_subscription_bundle_for_external_key(externalKey, context)
163
+
164
+ # conversion for externalKey [type = java.lang.String]
165
+ externalKey = externalKey.to_s unless externalKey.nil?
166
+
167
+ # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
168
+ context = context.to_java unless context.nil?
169
+ begin
170
+ res = @real_java_api.get_active_subscription_bundle_for_external_key(externalKey, context)
171
+ # conversion for res [type = org.killbill.billing.entitlement.api.SubscriptionBundle]
172
+ res = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(res) unless res.nil?
173
+ return res
174
+ rescue Java::org.killbill.billing.entitlement.api.SubscriptionApiException => e
175
+ raise Killbill::Plugin::Model::SubscriptionApiException.new.to_ruby(e)
176
+ end
177
+ end
201
178
 
202
- java_signature 'Java::org.killbill.billing.util.entity.Pagination searchSubscriptionBundles(Java::java.lang.String, Java::java.lang.Long, Java::java.lang.Long, Java::org.killbill.billing.util.callcontext.TenantContext)'
203
- def search_subscription_bundles(searchKey, offset, limit, context)
179
+ java_signature 'Java::java.util.List getSubscriptionBundlesForExternalKey(Java::java.lang.String, Java::org.killbill.billing.util.callcontext.TenantContext)'
180
+ def get_subscription_bundles_for_external_key(externalKey, context)
181
+
182
+ # conversion for externalKey [type = java.lang.String]
183
+ externalKey = externalKey.to_s unless externalKey.nil?
184
+
185
+ # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
186
+ context = context.to_java unless context.nil?
187
+ begin
188
+ res = @real_java_api.get_subscription_bundles_for_external_key(externalKey, context)
189
+ # conversion for res [type = java.util.List]
190
+ tmp = []
191
+ (res || []).each do |m|
192
+ # conversion for m [type = org.killbill.billing.entitlement.api.SubscriptionBundle]
193
+ m = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(m) unless m.nil?
194
+ tmp << m
195
+ end
196
+ res = tmp
197
+ return res
198
+ rescue Java::org.killbill.billing.entitlement.api.SubscriptionApiException => e
199
+ raise Killbill::Plugin::Model::SubscriptionApiException.new.to_ruby(e)
200
+ end
201
+ end
204
202
 
205
- # conversion for searchKey [type = java.lang.String]
206
- searchKey = searchKey.to_s unless searchKey.nil?
203
+ java_signature 'Java::java.util.List getSubscriptionBundlesForAccountId(Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
204
+ def get_subscription_bundles_for_account_id(accountId, context)
205
+
206
+ # conversion for accountId [type = java.util.UUID]
207
+ accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
208
+
209
+ # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
210
+ context = context.to_java unless context.nil?
211
+ begin
212
+ res = @real_java_api.get_subscription_bundles_for_account_id(accountId, context)
213
+ # conversion for res [type = java.util.List]
214
+ tmp = []
215
+ (res || []).each do |m|
216
+ # conversion for m [type = org.killbill.billing.entitlement.api.SubscriptionBundle]
217
+ m = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(m) unless m.nil?
218
+ tmp << m
219
+ end
220
+ res = tmp
221
+ return res
222
+ rescue Java::org.killbill.billing.entitlement.api.SubscriptionApiException => e
223
+ raise Killbill::Plugin::Model::SubscriptionApiException.new.to_ruby(e)
224
+ end
225
+ end
207
226
 
208
- # conversion for offset [type = java.lang.Long]
209
- offset = offset
227
+ java_signature 'Java::org.killbill.billing.util.entity.Pagination getSubscriptionBundles(Java::java.lang.Long, Java::java.lang.Long, Java::org.killbill.billing.util.callcontext.TenantContext)'
228
+ def get_subscription_bundles(offset, limit, context)
210
229
 
211
- # conversion for limit [type = java.lang.Long]
212
- limit = limit
230
+ # conversion for offset [type = java.lang.Long]
231
+ offset = offset
213
232
 
214
- # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
215
- context = context.to_java unless context.nil?
216
- res = @real_java_api.search_subscription_bundles(searchKey, offset, limit, context)
217
- # conversion for res [type = org.killbill.billing.util.entity.Pagination]
218
- res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
219
- return res
220
- end
221
- end
222
- end
223
- end
233
+ # conversion for limit [type = java.lang.Long]
234
+ limit = limit
235
+
236
+ # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
237
+ context = context.to_java unless context.nil?
238
+ res = @real_java_api.get_subscription_bundles(offset, limit, context)
239
+ # conversion for res [type = org.killbill.billing.util.entity.Pagination]
240
+ res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
241
+ return res
242
+ end
243
+
244
+ java_signature 'Java::org.killbill.billing.util.entity.Pagination searchSubscriptionBundles(Java::java.lang.String, Java::java.lang.Long, Java::java.lang.Long, Java::org.killbill.billing.util.callcontext.TenantContext)'
245
+ def search_subscription_bundles(searchKey, offset, limit, context)
246
+
247
+ # conversion for searchKey [type = java.lang.String]
248
+ searchKey = searchKey.to_s unless searchKey.nil?
249
+
250
+ # conversion for offset [type = java.lang.Long]
251
+ offset = offset
252
+
253
+ # conversion for limit [type = java.lang.Long]
254
+ limit = limit
255
+
256
+ # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
257
+ context = context.to_java unless context.nil?
258
+ res = @real_java_api.search_subscription_bundles(searchKey, offset, limit, context)
259
+ # conversion for res [type = org.killbill.billing.util.entity.Pagination]
260
+ res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
261
+ return res
262
+ end
263
+
264
+ java_signature 'Java::void addBlockingState(Java::org.killbill.billing.entitlement.api.BlockingState, Java::org.joda.time.LocalDate, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
265
+ def add_blocking_state(blockingState, effectiveDate, properties, context)
266
+
267
+ # conversion for blockingState [type = org.killbill.billing.entitlement.api.BlockingState]
268
+ blockingState = blockingState.to_java unless blockingState.nil?
269
+
270
+ # conversion for effectiveDate [type = org.joda.time.LocalDate]
271
+ if !effectiveDate.nil?
272
+ effectiveDate = Java::org.joda.time.LocalDate.parse(effectiveDate.to_s)
273
+ end
274
+
275
+ # conversion for properties [type = java.lang.Iterable]
276
+ tmp = java.util.ArrayList.new
277
+ (properties || []).each do |m|
278
+ # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
279
+ m = m.to_java unless m.nil?
280
+ tmp.add(m)
281
+ end
282
+ properties = tmp
283
+
284
+ # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
285
+ context = context.to_java unless context.nil?
286
+ @real_java_api.add_blocking_state(blockingState, effectiveDate, properties, context)
287
+ end
288
+
289
+ java_signature 'Java::java.lang.Iterable getBlockingStates(Java::java.util.UUID, Java::java.util.List, Java::java.util.List, Java::org.killbill.billing.OrderingType, Java::int, Java::org.killbill.billing.util.callcontext.TenantContext)'
290
+ def get_blocking_states(accountId, typeFilter, svcsFilter, orderingType, timeFilter, context)
291
+
292
+ # conversion for accountId [type = java.util.UUID]
293
+ accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
294
+
295
+ # conversion for typeFilter [type = java.util.List]
296
+ tmp = java.util.ArrayList.new
297
+ (typeFilter || []).each do |m|
298
+ # conversion for m [type = org.killbill.billing.entitlement.api.BlockingStateType]
299
+ m = Java::org.killbill.billing.entitlement.api.BlockingStateType.value_of( m.to_s ) unless m.nil?
300
+ tmp.add(m)
301
+ end
302
+ typeFilter = tmp
303
+
304
+ # conversion for svcsFilter [type = java.util.List]
305
+ tmp = java.util.ArrayList.new
306
+ (svcsFilter || []).each do |m|
307
+ # conversion for m [type = java.lang.String]
308
+ m = m.to_s unless m.nil?
309
+ tmp.add(m)
310
+ end
311
+ svcsFilter = tmp
312
+
313
+ # conversion for orderingType [type = org.killbill.billing.OrderingType]
314
+ orderingType = Java::org.killbill.billing.OrderingType.value_of( orderingType.to_s ) unless orderingType.nil?
315
+
316
+ # conversion for timeFilter [type = int]
317
+ timeFilter = timeFilter
318
+
319
+ # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
320
+ context = context.to_java unless context.nil?
321
+ begin
322
+ res = @real_java_api.get_blocking_states(accountId, typeFilter, svcsFilter, orderingType, timeFilter, context)
323
+ # conversion for res [type = java.lang.Iterable]
324
+ tmp = []
325
+ (res.nil? ? [] : res.iterator).each do |m|
326
+ # conversion for m [type = org.killbill.billing.entitlement.api.BlockingState]
327
+ m = Killbill::Plugin::Model::BlockingState.new.to_ruby(m) unless m.nil?
328
+ tmp << m
329
+ end
330
+ res = tmp
331
+ return res
332
+ rescue Java::org.killbill.billing.entitlement.api.EntitlementApiException => e
333
+ raise Killbill::Plugin::Model::EntitlementApiException.new.to_ruby(e)
334
+ end
335
+ end
336
+ end
337
+ end
338
+ end
224
339
  end