Class: Killbill::Plugin::Api::SubscriptionApi

Inherits:
Object
  • Object
show all
Defined in:
lib/killbill/gen/api/subscription_api.rb

Instance Method Summary collapse

Constructor Details

#initialize(real_java_api) ⇒ SubscriptionApi

Returns a new instance of SubscriptionApi.



37
38
39
# File 'lib/killbill/gen/api/subscription_api.rb', line 37

def initialize(real_java_api)
  @real_java_api = real_java_api
end

Instance Method Details

#add_blocking_state(blockingState, effectiveDate, properties, context) ⇒ Object



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/killbill/gen/api/subscription_api.rb', line 265

def add_blocking_state(blockingState, effectiveDate, properties, context)

# conversion for blockingState [type = org.killbill.billing.entitlement.api.BlockingState]
blockingState = blockingState.to_java unless blockingState.nil?

# conversion for effectiveDate [type = org.joda.time.LocalDate]
if !effectiveDate.nil?
effectiveDate = Java::org.joda.time.LocalDate.parse(effectiveDate.to_s)
end

# conversion for properties [type = java.lang.Iterable]
tmp = java.util.ArrayList.new
(properties || []).each do |m|
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
m = m.to_java unless m.nil?
tmp.add(m)
end
properties = tmp

# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
context = context.to_java unless context.nil?
@real_java_api.add_blocking_state(blockingState, effectiveDate, properties, context)
end

#all_eventsObject



78
79
80
81
82
# File 'lib/killbill/gen/api/subscription_api.rb', line 78

def all_events()
res = @real_java_api.all_events()
# conversion for res [type = int]
return res
end

#future_eventsObject



57
58
59
60
61
# File 'lib/killbill/gen/api/subscription_api.rb', line 57

def future_events()
  res = @real_java_api.future_events()
  # conversion for res [type = int]
  return res
end

#future_or_present_eventsObject



71
72
73
74
75
# File 'lib/killbill/gen/api/subscription_api.rb', line 71

def future_or_present_events()
res = @real_java_api.future_or_present_events()
# conversion for res [type = int]
return res
end

#get_active_subscription_bundle_for_external_key(externalKey, context) ⇒ Object



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/killbill/gen/api/subscription_api.rb', line 162

def get_active_subscription_bundle_for_external_key(externalKey, context)

# conversion for externalKey [type = java.lang.String]
externalKey = externalKey.to_s unless externalKey.nil?

# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
context = context.to_java unless context.nil?
begin
res = @real_java_api.get_active_subscription_bundle_for_external_key(externalKey, context)
# conversion for res [type = org.killbill.billing.entitlement.api.SubscriptionBundle]
res = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(res) unless res.nil?
return res
rescue Java::org.killbill.billing.entitlement.api.SubscriptionApiException => e
raise Killbill::Plugin::Model::SubscriptionApiException.new.to_ruby(e)
end
end

#get_blocking_states(accountId, typeFilter, svcsFilter, orderingType, timeFilter, context) ⇒ Object



290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
# File 'lib/killbill/gen/api/subscription_api.rb', line 290

def get_blocking_states(accountId, typeFilter, svcsFilter, orderingType, timeFilter, context)

# conversion for accountId [type = java.util.UUID]
accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?

# conversion for typeFilter [type = java.util.List]
tmp = java.util.ArrayList.new
(typeFilter || []).each do |m|
# conversion for m [type = org.killbill.billing.entitlement.api.BlockingStateType]
m = Java::org.killbill.billing.entitlement.api.BlockingStateType.value_of( m.to_s ) unless m.nil?
tmp.add(m)
end
typeFilter = tmp

# conversion for svcsFilter [type = java.util.List]
tmp = java.util.ArrayList.new
(svcsFilter || []).each do |m|
# conversion for m [type = java.lang.String]
m = m.to_s unless m.nil?
tmp.add(m)
end
svcsFilter = tmp

# conversion for orderingType [type = org.killbill.billing.OrderingType]
orderingType = Java::org.killbill.billing.OrderingType.value_of( orderingType.to_s ) unless orderingType.nil?

# conversion for timeFilter [type = int]
timeFilter = timeFilter

# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
context = context.to_java unless context.nil?
begin
res = @real_java_api.get_blocking_states(accountId, typeFilter, svcsFilter, orderingType, timeFilter, context)
# conversion for res [type = java.lang.Iterable]
tmp = []
(res.nil? ? [] : res.iterator).each do |m|
  # conversion for m [type = org.killbill.billing.entitlement.api.BlockingState]
  m = Killbill::Plugin::Model::BlockingState.new.to_ruby(m) unless m.nil?
  tmp << m
end
res = tmp
return res
rescue Java::org.killbill.billing.entitlement.api.EntitlementApiException => e
raise Killbill::Plugin::Model::EntitlementApiException.new.to_ruby(e)
end
end

#get_subscription_bundle(bundleId, context) ⇒ Object



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/killbill/gen/api/subscription_api.rb', line 103

def get_subscription_bundle(bundleId, context)

# conversion for bundleId [type = java.util.UUID]
bundleId = java.util.UUID.fromString(bundleId.to_s) unless bundleId.nil?

# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
context = context.to_java unless context.nil?
begin
res = @real_java_api.get_subscription_bundle(bundleId, context)
# conversion for res [type = org.killbill.billing.entitlement.api.SubscriptionBundle]
res = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(res) unless res.nil?
return res
rescue Java::org.killbill.billing.entitlement.api.SubscriptionApiException => e
raise Killbill::Plugin::Model::SubscriptionApiException.new.to_ruby(e)
end
end

#get_subscription_bundles(offset, limit, context) ⇒ Object



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/killbill/gen/api/subscription_api.rb', line 228

def get_subscription_bundles(offset, limit, context)

# conversion for offset [type = java.lang.Long]
offset = offset

# conversion for limit [type = java.lang.Long]
limit = limit

# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
context = context.to_java unless context.nil?
res = @real_java_api.get_subscription_bundles(offset, limit, context)
# conversion for res [type = org.killbill.billing.util.entity.Pagination]
res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
return res
end

#get_subscription_bundles_for_account_id(accountId, context) ⇒ Object



204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/killbill/gen/api/subscription_api.rb', line 204

def (accountId, context)

# conversion for accountId [type = java.util.UUID]
accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?

# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
context = context.to_java unless context.nil?
begin
res = @real_java_api.(accountId, context)
# conversion for res [type = java.util.List]
tmp = []
(res || []).each do |m|
  # conversion for m [type = org.killbill.billing.entitlement.api.SubscriptionBundle]
  m = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(m) unless m.nil?
  tmp << m
end
res = tmp
return res
rescue Java::org.killbill.billing.entitlement.api.SubscriptionApiException => e
raise Killbill::Plugin::Model::SubscriptionApiException.new.to_ruby(e)
end
end

#get_subscription_bundles_for_account_id_and_external_key(accountId, externalKey, context) ⇒ Object



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/killbill/gen/api/subscription_api.rb', line 135

def (accountId, externalKey, context)

# conversion for accountId [type = java.util.UUID]
accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?

# conversion for externalKey [type = java.lang.String]
externalKey = externalKey.to_s unless externalKey.nil?

# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
context = context.to_java unless context.nil?
begin
res = @real_java_api.(accountId, externalKey, context)
# conversion for res [type = java.util.List]
tmp = []
(res || []).each do |m|
  # conversion for m [type = org.killbill.billing.entitlement.api.SubscriptionBundle]
  m = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(m) unless m.nil?
  tmp << m
end
res = tmp
return res
rescue Java::org.killbill.billing.entitlement.api.SubscriptionApiException => e
raise Killbill::Plugin::Model::SubscriptionApiException.new.to_ruby(e)
end
end

#get_subscription_bundles_for_external_key(externalKey, context) ⇒ Object



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/killbill/gen/api/subscription_api.rb', line 180

def get_subscription_bundles_for_external_key(externalKey, context)

# conversion for externalKey [type = java.lang.String]
externalKey = externalKey.to_s unless externalKey.nil?

# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
context = context.to_java unless context.nil?
begin
res = @real_java_api.get_subscription_bundles_for_external_key(externalKey, context)
# conversion for res [type = java.util.List]
tmp = []
(res || []).each do |m|
  # conversion for m [type = org.killbill.billing.entitlement.api.SubscriptionBundle]
  m = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(m) unless m.nil?
  tmp << m
end
res = tmp
return res
rescue Java::org.killbill.billing.entitlement.api.SubscriptionApiException => e
raise Killbill::Plugin::Model::SubscriptionApiException.new.to_ruby(e)
end
end

#get_subscription_for_entitlement_id(entitlementId, context) ⇒ Object



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/killbill/gen/api/subscription_api.rb', line 85

def get_subscription_for_entitlement_id(entitlementId, context)

# conversion for entitlementId [type = java.util.UUID]
entitlementId = java.util.UUID.fromString(entitlementId.to_s) unless entitlementId.nil?

# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
context = context.to_java unless context.nil?
begin
res = @real_java_api.get_subscription_for_entitlement_id(entitlementId, context)
# conversion for res [type = org.killbill.billing.entitlement.api.Subscription]
res = Killbill::Plugin::Model::Subscription.new.to_ruby(res) unless res.nil?
return res
rescue Java::org.killbill.billing.entitlement.api.SubscriptionApiException => e
raise Killbill::Plugin::Model::SubscriptionApiException.new.to_ruby(e)
end
end

#past_eventsObject



43
44
45
46
47
# File 'lib/killbill/gen/api/subscription_api.rb', line 43

def past_events()
  res = @real_java_api.past_events()
  # conversion for res [type = int]
  return res
end

#past_or_present_eventsObject



64
65
66
67
68
# File 'lib/killbill/gen/api/subscription_api.rb', line 64

def past_or_present_events()
  res = @real_java_api.past_or_present_events()
  # conversion for res [type = int]
  return res
end

#present_eventsObject



50
51
52
53
54
# File 'lib/killbill/gen/api/subscription_api.rb', line 50

def present_events()
  res = @real_java_api.present_events()
  # conversion for res [type = int]
  return res
end

#search_subscription_bundles(searchKey, offset, limit, context) ⇒ Object



245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# File 'lib/killbill/gen/api/subscription_api.rb', line 245

def search_subscription_bundles(searchKey, offset, limit, context)

# conversion for searchKey [type = java.lang.String]
searchKey = searchKey.to_s unless searchKey.nil?

# conversion for offset [type = java.lang.Long]
offset = offset

# conversion for limit [type = java.lang.Long]
limit = limit

# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
context = context.to_java unless context.nil?
res = @real_java_api.search_subscription_bundles(searchKey, offset, limit, context)
# conversion for res [type = org.killbill.billing.util.entity.Pagination]
res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
return res
end

#update_external_key(bundleId, newExternalKey, context) ⇒ Object



121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/killbill/gen/api/subscription_api.rb', line 121

def update_external_key(bundleId, newExternalKey, context)

# conversion for bundleId [type = java.util.UUID]
bundleId = java.util.UUID.fromString(bundleId.to_s) unless bundleId.nil?

# conversion for newExternalKey [type = java.lang.String]
newExternalKey = newExternalKey.to_s unless newExternalKey.nil?

# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
context = context.to_java unless context.nil?
@real_java_api.update_external_key(bundleId, newExternalKey, context)
end