killbill 1.0.19 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. data/Jarfile +4 -2
  2. data/VERSION +1 -1
  3. data/killbill.gemspec +4 -3
  4. data/lib/killbill.rb +7 -51
  5. data/lib/killbill/creator.rb +10 -18
  6. data/lib/killbill/gen/account.rb +208 -27
  7. data/lib/killbill/gen/account_api_exception.rb +66 -0
  8. data/lib/killbill/gen/account_data.rb +166 -23
  9. data/lib/killbill/gen/account_email.rb +80 -8
  10. data/lib/killbill/gen/account_service.rb +55 -0
  11. data/lib/killbill/gen/account_user_api.rb +187 -0
  12. data/lib/killbill/gen/audit_user_api.rb +196 -0
  13. data/lib/killbill/gen/beatrix_service.rb +55 -0
  14. data/lib/killbill/gen/billing_exception_base.rb +66 -0
  15. data/lib/killbill/gen/blockable.rb +91 -0
  16. data/lib/killbill/gen/blocking_api_exception.rb +66 -0
  17. data/lib/killbill/gen/blocking_state.rb +150 -16
  18. data/lib/killbill/gen/call_context.rb +107 -13
  19. data/lib/killbill/gen/catalog.rb +76 -0
  20. data/lib/killbill/gen/catalog_api_exception.rb +66 -0
  21. data/lib/killbill/gen/catalog_service.rb +69 -0
  22. data/lib/killbill/gen/catalog_user_api.rb +54 -0
  23. data/lib/killbill/gen/column_info.rb +67 -0
  24. data/lib/killbill/gen/control_tag.rb +112 -0
  25. data/lib/killbill/gen/currency_value_null.rb +66 -0
  26. data/lib/killbill/gen/custom_field.rb +93 -10
  27. data/lib/killbill/gen/custom_field_api_exception.rb +66 -0
  28. data/lib/killbill/gen/custom_field_user_api.rb +115 -0
  29. data/lib/killbill/gen/database_export_output_stream.rb +51 -0
  30. data/lib/killbill/gen/default_mutable_account_data.rb +180 -0
  31. data/lib/killbill/gen/duration.rb +62 -0
  32. data/lib/killbill/gen/entitlement_service.rb +55 -0
  33. data/lib/killbill/gen/entitlement_user_api.rb +272 -0
  34. data/lib/killbill/gen/entitlement_user_api_exception.rb +66 -0
  35. data/lib/killbill/gen/entity.rb +84 -0
  36. data/lib/killbill/gen/entity_persistence_exception.rb +66 -0
  37. data/lib/killbill/gen/export_user_api.rb +17 -0
  38. data/lib/killbill/gen/ext_bus_event.rb +68 -9
  39. data/lib/killbill/gen/external_bus.rb +51 -0
  40. data/lib/killbill/gen/illegal_plan_change.rb +66 -0
  41. data/lib/killbill/gen/international_price.rb +79 -0
  42. data/lib/killbill/gen/invalid_config_exception.rb +49 -0
  43. data/lib/killbill/gen/invoice.rb +238 -23
  44. data/lib/killbill/gen/invoice_api_exception.rb +66 -0
  45. data/lib/killbill/gen/invoice_creation_event.rb +51 -0
  46. data/lib/killbill/gen/invoice_item.rb +179 -21
  47. data/lib/killbill/gen/invoice_migration_api.rb +66 -0
  48. data/lib/killbill/gen/invoice_notifier.rb +51 -0
  49. data/lib/killbill/gen/invoice_payment.rb +135 -15
  50. data/lib/killbill/gen/invoice_payment_api.rb +208 -0
  51. data/lib/killbill/gen/invoice_service.rb +55 -0
  52. data/lib/killbill/gen/invoice_user_api.rb +461 -0
  53. data/lib/killbill/gen/junction_api.rb +60 -0
  54. data/lib/killbill/gen/limit.rb +68 -0
  55. data/lib/killbill/gen/listing.rb +63 -0
  56. data/lib/killbill/gen/migration_account_data.rb +228 -0
  57. data/lib/killbill/gen/migration_plan.rb +143 -0
  58. data/lib/killbill/gen/mutable_account_data.rb +182 -0
  59. data/lib/killbill/gen/no_op_payment_plugin_api.rb +254 -0
  60. data/lib/killbill/gen/payment.rb +183 -20
  61. data/lib/killbill/gen/payment_api.rb +433 -0
  62. data/lib/killbill/gen/payment_api_exception.rb +66 -0
  63. data/lib/killbill/gen/payment_attempt.rb +100 -10
  64. data/lib/killbill/gen/payment_info_plugin.rb +103 -12
  65. data/lib/killbill/gen/payment_method.rb +116 -0
  66. data/lib/killbill/gen/payment_method_info_plugin.rb +64 -7
  67. data/lib/killbill/gen/payment_method_kv_info.rb +56 -6
  68. data/lib/killbill/gen/payment_method_plugin.rb +142 -20
  69. data/lib/killbill/gen/payment_plugin_api.rb +232 -0
  70. data/lib/killbill/gen/payment_plugin_api_exception.rb +59 -0
  71. data/lib/killbill/gen/payment_service.rb +62 -0
  72. data/lib/killbill/gen/plan.rb +143 -0
  73. data/lib/killbill/gen/plan_change_result.rb +68 -0
  74. data/lib/killbill/gen/plan_phase.rb +104 -0
  75. data/lib/killbill/gen/plan_phase_specifier.rb +80 -0
  76. data/lib/killbill/gen/plan_specifier.rb +73 -0
  77. data/lib/killbill/gen/price.rb +67 -0
  78. data/lib/killbill/gen/price_list.rb +74 -0
  79. data/lib/killbill/gen/price_list_set.rb +56 -0
  80. data/lib/killbill/gen/product.rb +101 -0
  81. data/lib/killbill/gen/record_id_api.rb +55 -0
  82. data/lib/killbill/gen/refund.rb +126 -13
  83. data/lib/killbill/gen/refund_info_plugin.rb +96 -10
  84. data/lib/killbill/gen/require_gen.rb +97 -15
  85. data/lib/killbill/gen/static_catalog.rb +137 -0
  86. data/lib/killbill/gen/subscription.rb +258 -28
  87. data/lib/killbill/gen/subscription_bundle.rb +94 -10
  88. data/lib/killbill/gen/subscription_status_dry_run.rb +89 -0
  89. data/lib/killbill/gen/subscription_transition.rb +196 -0
  90. data/lib/killbill/gen/tag.rb +88 -9
  91. data/lib/killbill/gen/tag_api_exception.rb +66 -0
  92. data/lib/killbill/gen/tag_definition.rb +110 -10
  93. data/lib/killbill/gen/tag_definition_api_exception.rb +66 -0
  94. data/lib/killbill/gen/tag_user_api.rb +239 -0
  95. data/lib/killbill/gen/tenant.rb +102 -0
  96. data/lib/killbill/gen/tenant_api_exception.rb +66 -0
  97. data/lib/killbill/gen/tenant_context.rb +39 -4
  98. data/lib/killbill/gen/tenant_data.rb +67 -0
  99. data/lib/killbill/gen/tenant_kv.rb +96 -0
  100. data/lib/killbill/gen/tenant_service.rb +55 -0
  101. data/lib/killbill/gen/tenant_user_api.rb +127 -0
  102. data/lib/killbill/gen/unit.rb +55 -0
  103. data/lib/killbill/jnotification.rb +1 -1
  104. data/lib/killbill/jpayment.rb +10 -7
  105. data/lib/killbill/jplugin.rb +63 -61
  106. data/lib/killbill/killbill_api.rb +42 -9
  107. data/spec/killbill/jnotification_spec.rb +15 -1
  108. data/spec/killbill/jpayment_spec.rb +12 -8
  109. data/spec/killbill/killbillapi_spec.rb +23 -21
  110. data/spec/killbill/payment_plugin_spec.rb +1 -9
  111. data/spec/killbill/payment_test.rb +21 -5
  112. metadata +96 -22
  113. data/lib/killbill/gen/audit_log.rb +0 -28
  114. data/lib/killbill/gen/call_origin.rb +0 -34
  115. data/lib/killbill/gen/currency.rb +0 -34
  116. data/lib/killbill/gen/date_time_zone.rb +0 -35
  117. data/lib/killbill/gen/ext_bus_event_type.rb +0 -34
  118. data/lib/killbill/gen/invoice_payment_type.rb +0 -34
  119. data/lib/killbill/gen/object_type.rb +0 -34
  120. data/lib/killbill/gen/payment_plugin_status.rb +0 -34
  121. data/lib/killbill/gen/refund_plugin_status.rb +0 -34
  122. data/lib/killbill/gen/subscription_source_type.rb +0 -34
  123. data/lib/killbill/gen/subscription_state.rb +0 -34
  124. data/lib/killbill/gen/user_type.rb +0 -34
  125. data/lib/killbill/gen/uuid.rb +0 -22
  126. data/lib/killbill/jconverter.rb +0 -537
  127. data/lib/killbill/jkillbill_api.rb +0 -137
  128. data/spec/killbill/jconverter_spec.rb +0 -193
@@ -0,0 +1,55 @@
1
+ ###################################################################################
2
+ # #
3
+ # Copyright 2010-2013 Ning, Inc. #
4
+ # #
5
+ # Ning licenses this file to you under the Apache License, version 2.0 #
6
+ # (the "License"); you may not use this file except in compliance with the #
7
+ # License. You may obtain a copy of the License at: #
8
+ # #
9
+ # http://www.apache.org/licenses/LICENSE-2.0 #
10
+ # #
11
+ # Unless required by applicable law or agreed to in writing, software #
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
14
+ # License for the specific language governing permissions and limitations #
15
+ # under the License. #
16
+ # #
17
+ ###################################################################################
18
+
19
+
20
+ #
21
+ # DO NOT EDIT!!!
22
+ # File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
23
+ #
24
+
25
+
26
+ module Killbill
27
+ module Plugin
28
+ module Model
29
+
30
+ java_package 'com.ning.billing.entitlement.api'
31
+ class EntitlementService
32
+
33
+ include com.ning.billing.entitlement.api.EntitlementService
34
+
35
+ attr_accessor :name
36
+
37
+ def initialize()
38
+ end
39
+
40
+ def to_java()
41
+ # conversion for name [type = java.lang.String]
42
+ @name = @name.to_s unless @name.nil?
43
+ self
44
+ end
45
+
46
+ def to_ruby(j_obj)
47
+ # conversion for name [type = java.lang.String]
48
+ @name = j_obj.name
49
+ self
50
+ end
51
+
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,272 @@
1
+ ###################################################################################
2
+ # #
3
+ # Copyright 2010-2013 Ning, Inc. #
4
+ # #
5
+ # Ning licenses this file to you under the Apache License, version 2.0 #
6
+ # (the "License"); you may not use this file except in compliance with the #
7
+ # License. You may obtain a copy of the License at: #
8
+ # #
9
+ # http://www.apache.org/licenses/LICENSE-2.0 #
10
+ # #
11
+ # Unless required by applicable law or agreed to in writing, software #
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
14
+ # License for the specific language governing permissions and limitations #
15
+ # under the License. #
16
+ # #
17
+ ###################################################################################
18
+
19
+
20
+ #
21
+ # DO NOT EDIT!!!
22
+ # File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
23
+ #
24
+
25
+
26
+ module Killbill
27
+ module Plugin
28
+ module Api
29
+
30
+ java_package 'com.ning.billing.entitlement.api.user'
31
+ class EntitlementUserApi
32
+
33
+ include com.ning.billing.entitlement.api.user.EntitlementUserApi
34
+
35
+ def initialize(real_java_api)
36
+ @real_java_api = real_java_api
37
+ end
38
+
39
+
40
+ java_signature 'Java::com.ning.billing.entitlement.api.user.SubscriptionBundle getBundleFromId(Java::java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
41
+ def get_bundle_from_id(id, context)
42
+ # conversion for id [type = java.util.UUID]
43
+ id = java.util.UUID.fromString(id.to_s) unless id.nil?
44
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
45
+ context = context.to_java unless context.nil?
46
+ begin
47
+ res = @real_java_api.get_bundle_from_id(id, context)
48
+ # conversion for res [type = com.ning.billing.entitlement.api.user.SubscriptionBundle]
49
+ res = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(res) unless res.nil?
50
+ return res
51
+ rescue Java::com.ning.billing.entitlement.api.user.EntitlementUserApiException => e
52
+ raise Killbill::Plugin::Model::EntitlementUserApiException.new.to_ruby(e)
53
+ end
54
+ end
55
+
56
+ java_signature 'Java::com.ning.billing.entitlement.api.user.Subscription getSubscriptionFromId(Java::java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
57
+ def get_subscription_from_id(id, context)
58
+ # conversion for id [type = java.util.UUID]
59
+ id = java.util.UUID.fromString(id.to_s) unless id.nil?
60
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
61
+ context = context.to_java unless context.nil?
62
+ begin
63
+ res = @real_java_api.get_subscription_from_id(id, context)
64
+ # conversion for res [type = com.ning.billing.entitlement.api.user.Subscription]
65
+ res = Killbill::Plugin::Model::Subscription.new.to_ruby(res) unless res.nil?
66
+ return res
67
+ rescue Java::com.ning.billing.entitlement.api.user.EntitlementUserApiException => e
68
+ raise Killbill::Plugin::Model::EntitlementUserApiException.new.to_ruby(e)
69
+ end
70
+ end
71
+
72
+ java_signature 'Java::java.util.List getBundlesForKey(Java::java.lang.String, Java::com.ning.billing.util.callcontext.TenantContext)'
73
+ def get_bundles_for_key(bundleKey, context)
74
+ # conversion for bundleKey [type = java.lang.String]
75
+ bundleKey = bundleKey.to_s unless bundleKey.nil?
76
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
77
+ context = context.to_java unless context.nil?
78
+ begin
79
+ res = @real_java_api.get_bundles_for_key(bundleKey, context)
80
+ # conversion for res [type = java.util.List]
81
+ tmp = []
82
+ (res || []).each do |m|
83
+ # conversion for m [type = com.ning.billing.entitlement.api.user.SubscriptionBundle]
84
+ m = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(m) unless m.nil?
85
+ tmp << m
86
+ end
87
+ res = tmp
88
+ return res
89
+ rescue Java::com.ning.billing.entitlement.api.user.EntitlementUserApiException => e
90
+ raise Killbill::Plugin::Model::EntitlementUserApiException.new.to_ruby(e)
91
+ end
92
+ end
93
+
94
+ java_signature 'Java::com.ning.billing.entitlement.api.user.SubscriptionBundle getBundleForAccountAndKey(Java::java.util.UUID, Java::java.lang.String, Java::com.ning.billing.util.callcontext.TenantContext)'
95
+ def get_bundle_for_account_and_key(accountId, bundleKey, context)
96
+ # conversion for accountId [type = java.util.UUID]
97
+ accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
98
+ # conversion for bundleKey [type = java.lang.String]
99
+ bundleKey = bundleKey.to_s unless bundleKey.nil?
100
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
101
+ context = context.to_java unless context.nil?
102
+ begin
103
+ res = @real_java_api.get_bundle_for_account_and_key(accountId, bundleKey, context)
104
+ # conversion for res [type = com.ning.billing.entitlement.api.user.SubscriptionBundle]
105
+ res = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(res) unless res.nil?
106
+ return res
107
+ rescue Java::com.ning.billing.entitlement.api.user.EntitlementUserApiException => e
108
+ raise Killbill::Plugin::Model::EntitlementUserApiException.new.to_ruby(e)
109
+ end
110
+ end
111
+
112
+ java_signature 'Java::java.util.List getBundlesForAccount(Java::java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
113
+ def get_bundles_for_account(accountId, context)
114
+ # conversion for accountId [type = java.util.UUID]
115
+ accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
116
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
117
+ context = context.to_java unless context.nil?
118
+ res = @real_java_api.get_bundles_for_account(accountId, context)
119
+ # conversion for res [type = java.util.List]
120
+ tmp = []
121
+ (res || []).each do |m|
122
+ # conversion for m [type = com.ning.billing.entitlement.api.user.SubscriptionBundle]
123
+ m = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(m) unless m.nil?
124
+ tmp << m
125
+ end
126
+ res = tmp
127
+ return res
128
+ end
129
+
130
+ java_signature 'Java::java.util.List getSubscriptionsForBundle(Java::java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
131
+ def get_subscriptions_for_bundle(bundleId, context)
132
+ # conversion for bundleId [type = java.util.UUID]
133
+ bundleId = java.util.UUID.fromString(bundleId.to_s) unless bundleId.nil?
134
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
135
+ context = context.to_java unless context.nil?
136
+ res = @real_java_api.get_subscriptions_for_bundle(bundleId, context)
137
+ # conversion for res [type = java.util.List]
138
+ tmp = []
139
+ (res || []).each do |m|
140
+ # conversion for m [type = com.ning.billing.entitlement.api.user.Subscription]
141
+ m = Killbill::Plugin::Model::Subscription.new.to_ruby(m) unless m.nil?
142
+ tmp << m
143
+ end
144
+ res = tmp
145
+ return res
146
+ end
147
+
148
+ java_signature 'Java::java.util.List getSubscriptionsForAccountAndKey(Java::java.util.UUID, Java::java.lang.String, Java::com.ning.billing.util.callcontext.TenantContext)'
149
+ def get_subscriptions_for_account_and_key(accountId, bundleKey, context)
150
+ # conversion for accountId [type = java.util.UUID]
151
+ accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
152
+ # conversion for bundleKey [type = java.lang.String]
153
+ bundleKey = bundleKey.to_s unless bundleKey.nil?
154
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
155
+ context = context.to_java unless context.nil?
156
+ res = @real_java_api.get_subscriptions_for_account_and_key(accountId, bundleKey, context)
157
+ # conversion for res [type = java.util.List]
158
+ tmp = []
159
+ (res || []).each do |m|
160
+ # conversion for m [type = com.ning.billing.entitlement.api.user.Subscription]
161
+ m = Killbill::Plugin::Model::Subscription.new.to_ruby(m) unless m.nil?
162
+ tmp << m
163
+ end
164
+ res = tmp
165
+ return res
166
+ end
167
+
168
+ java_signature 'Java::com.ning.billing.entitlement.api.user.Subscription getBaseSubscription(Java::java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
169
+ def get_base_subscription(bundleId, context)
170
+ # conversion for bundleId [type = java.util.UUID]
171
+ bundleId = java.util.UUID.fromString(bundleId.to_s) unless bundleId.nil?
172
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
173
+ context = context.to_java unless context.nil?
174
+ begin
175
+ res = @real_java_api.get_base_subscription(bundleId, context)
176
+ # conversion for res [type = com.ning.billing.entitlement.api.user.Subscription]
177
+ res = Killbill::Plugin::Model::Subscription.new.to_ruby(res) unless res.nil?
178
+ return res
179
+ rescue Java::com.ning.billing.entitlement.api.user.EntitlementUserApiException => e
180
+ raise Killbill::Plugin::Model::EntitlementUserApiException.new.to_ruby(e)
181
+ end
182
+ end
183
+
184
+ java_signature 'Java::com.ning.billing.entitlement.api.user.SubscriptionBundle createBundleForAccount(Java::java.util.UUID, Java::java.lang.String, Java::com.ning.billing.util.callcontext.CallContext)'
185
+ def create_bundle_for_account(accountId, bundleKey, context)
186
+ # conversion for accountId [type = java.util.UUID]
187
+ accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
188
+ # conversion for bundleKey [type = java.lang.String]
189
+ bundleKey = bundleKey.to_s unless bundleKey.nil?
190
+ # conversion for context [type = com.ning.billing.util.callcontext.CallContext]
191
+ context = context.to_java unless context.nil?
192
+ begin
193
+ res = @real_java_api.create_bundle_for_account(accountId, bundleKey, context)
194
+ # conversion for res [type = com.ning.billing.entitlement.api.user.SubscriptionBundle]
195
+ res = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(res) unless res.nil?
196
+ return res
197
+ rescue Java::com.ning.billing.entitlement.api.user.EntitlementUserApiException => e
198
+ raise Killbill::Plugin::Model::EntitlementUserApiException.new.to_ruby(e)
199
+ end
200
+ end
201
+
202
+ java_signature 'Java::com.ning.billing.entitlement.api.user.Subscription createSubscription(Java::java.util.UUID, Java::com.ning.billing.catalog.api.PlanPhaseSpecifier, Java::org.joda.time.DateTime, Java::com.ning.billing.util.callcontext.CallContext)'
203
+ def create_subscription(bundleId, spec, requestedDate, context)
204
+ # conversion for bundleId [type = java.util.UUID]
205
+ bundleId = java.util.UUID.fromString(bundleId.to_s) unless bundleId.nil?
206
+ # conversion for spec [type = com.ning.billing.catalog.api.PlanPhaseSpecifier]
207
+ spec = spec.to_java unless spec.nil?
208
+ # conversion for requestedDate [type = org.joda.time.DateTime]
209
+ if !requestedDate.nil?
210
+ requestedDate = (requestedDate.kind_of? Time) ? DateTime.parse(requestedDate.to_s) : requestedDate
211
+ requestedDate = Java::org.joda.time.DateTime.new(requestedDate.to_s, Java::org.joda.time.DateTimeZone::UTC)
212
+ end
213
+ # conversion for context [type = com.ning.billing.util.callcontext.CallContext]
214
+ context = context.to_java unless context.nil?
215
+ begin
216
+ res = @real_java_api.create_subscription(bundleId, spec, requestedDate, context)
217
+ # conversion for res [type = com.ning.billing.entitlement.api.user.Subscription]
218
+ res = Killbill::Plugin::Model::Subscription.new.to_ruby(res) unless res.nil?
219
+ return res
220
+ rescue Java::com.ning.billing.entitlement.api.user.EntitlementUserApiException => e
221
+ raise Killbill::Plugin::Model::EntitlementUserApiException.new.to_ruby(e)
222
+ end
223
+ end
224
+
225
+ java_signature 'Java::java.util.List getDryRunChangePlanStatus(Java::java.util.UUID, Java::java.lang.String, Java::org.joda.time.DateTime, Java::com.ning.billing.util.callcontext.TenantContext)'
226
+ def get_dry_run_change_plan_status(subscriptionId, productName, requestedDate, context)
227
+ # conversion for subscriptionId [type = java.util.UUID]
228
+ subscriptionId = java.util.UUID.fromString(subscriptionId.to_s) unless subscriptionId.nil?
229
+ # conversion for productName [type = java.lang.String]
230
+ productName = productName.to_s unless productName.nil?
231
+ # conversion for requestedDate [type = org.joda.time.DateTime]
232
+ if !requestedDate.nil?
233
+ requestedDate = (requestedDate.kind_of? Time) ? DateTime.parse(requestedDate.to_s) : requestedDate
234
+ requestedDate = Java::org.joda.time.DateTime.new(requestedDate.to_s, Java::org.joda.time.DateTimeZone::UTC)
235
+ end
236
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
237
+ context = context.to_java unless context.nil?
238
+ begin
239
+ res = @real_java_api.get_dry_run_change_plan_status(subscriptionId, productName, requestedDate, context)
240
+ # conversion for res [type = java.util.List]
241
+ tmp = []
242
+ (res || []).each do |m|
243
+ # conversion for m [type = com.ning.billing.entitlement.api.user.SubscriptionStatusDryRun]
244
+ m = Killbill::Plugin::Model::SubscriptionStatusDryRun.new.to_ruby(m) unless m.nil?
245
+ tmp << m
246
+ end
247
+ res = tmp
248
+ return res
249
+ rescue Java::com.ning.billing.entitlement.api.user.EntitlementUserApiException => e
250
+ raise Killbill::Plugin::Model::EntitlementUserApiException.new.to_ruby(e)
251
+ end
252
+ end
253
+
254
+ java_signature 'Java::org.joda.time.DateTime getNextBillingDate(Java::java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
255
+ def get_next_billing_date(account, context)
256
+ # conversion for account [type = java.util.UUID]
257
+ account = java.util.UUID.fromString(account.to_s) unless account.nil?
258
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
259
+ context = context.to_java unless context.nil?
260
+ res = @real_java_api.get_next_billing_date(account, context)
261
+ # conversion for res [type = org.joda.time.DateTime]
262
+ if !res.nil?
263
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
264
+ str = fmt.print(res)
265
+ res = DateTime.iso8601(str)
266
+ end
267
+ return res
268
+ end
269
+ end
270
+ end
271
+ end
272
+ end
@@ -0,0 +1,66 @@
1
+ ###################################################################################
2
+ # #
3
+ # Copyright 2010-2013 Ning, Inc. #
4
+ # #
5
+ # Ning licenses this file to you under the Apache License, version 2.0 #
6
+ # (the "License"); you may not use this file except in compliance with the #
7
+ # License. You may obtain a copy of the License at: #
8
+ # #
9
+ # http://www.apache.org/licenses/LICENSE-2.0 #
10
+ # #
11
+ # Unless required by applicable law or agreed to in writing, software #
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
14
+ # License for the specific language governing permissions and limitations #
15
+ # under the License. #
16
+ # #
17
+ ###################################################################################
18
+
19
+
20
+ #
21
+ # DO NOT EDIT!!!
22
+ # File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
23
+ #
24
+
25
+
26
+ module Killbill
27
+ module Plugin
28
+ module Model
29
+
30
+ class EntitlementUserApiException
31
+
32
+
33
+ attr_accessor :message, :cause, :code
34
+
35
+ def initialize()
36
+ end
37
+
38
+ def to_java()
39
+ # conversion for message [type = java.lang.String]
40
+ @message = @message.to_s unless @message.nil?
41
+
42
+ # conversion for cause [type = java.lang.Throwable]
43
+ @cause = @cause.to_s unless cause.nil?
44
+
45
+ # conversion for code [type = int]
46
+ @code = @code
47
+ Java::com.ning.billing.entitlement.api.user.EntitlementUserApiException.new(@message, @cause, @code)
48
+ end
49
+
50
+ def to_ruby(j_obj)
51
+ # conversion for message [type = java.lang.String]
52
+ @message = j_obj.message
53
+
54
+ # conversion for cause [type = java.lang.Throwable]
55
+ @cause = j_obj.cause
56
+ @cause = @cause.to_s unless @cause.nil?
57
+
58
+ # conversion for code [type = int]
59
+ @code = j_obj.code
60
+ self
61
+ end
62
+
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,84 @@
1
+ ###################################################################################
2
+ # #
3
+ # Copyright 2010-2013 Ning, Inc. #
4
+ # #
5
+ # Ning licenses this file to you under the Apache License, version 2.0 #
6
+ # (the "License"); you may not use this file except in compliance with the #
7
+ # License. You may obtain a copy of the License at: #
8
+ # #
9
+ # http://www.apache.org/licenses/LICENSE-2.0 #
10
+ # #
11
+ # Unless required by applicable law or agreed to in writing, software #
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
14
+ # License for the specific language governing permissions and limitations #
15
+ # under the License. #
16
+ # #
17
+ ###################################################################################
18
+
19
+
20
+ #
21
+ # DO NOT EDIT!!!
22
+ # File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
23
+ #
24
+
25
+
26
+ module Killbill
27
+ module Plugin
28
+ module Model
29
+
30
+ java_package 'com.ning.billing.util.entity'
31
+ class Entity
32
+
33
+ include com.ning.billing.util.entity.Entity
34
+
35
+ attr_accessor :id, :created_date, :updated_date
36
+
37
+ def initialize()
38
+ end
39
+
40
+ def to_java()
41
+ # conversion for id [type = java.util.UUID]
42
+ @id = java.util.UUID.fromString(@id.to_s) unless @id.nil?
43
+
44
+ # conversion for created_date [type = org.joda.time.DateTime]
45
+ if !@created_date.nil?
46
+ @created_date = (@created_date.kind_of? Time) ? DateTime.parse(@created_date.to_s) : @created_date
47
+ @created_date = Java::org.joda.time.DateTime.new(@created_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
48
+ end
49
+
50
+ # conversion for updated_date [type = org.joda.time.DateTime]
51
+ if !@updated_date.nil?
52
+ @updated_date = (@updated_date.kind_of? Time) ? DateTime.parse(@updated_date.to_s) : @updated_date
53
+ @updated_date = Java::org.joda.time.DateTime.new(@updated_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
54
+ end
55
+ self
56
+ end
57
+
58
+ def to_ruby(j_obj)
59
+ # conversion for id [type = java.util.UUID]
60
+ @id = j_obj.id
61
+ @id = @id.nil? ? nil : @id.to_s
62
+
63
+ # conversion for created_date [type = org.joda.time.DateTime]
64
+ @created_date = j_obj.created_date
65
+ if !@created_date.nil?
66
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
67
+ str = fmt.print(@created_date)
68
+ @created_date = DateTime.iso8601(str)
69
+ end
70
+
71
+ # conversion for updated_date [type = org.joda.time.DateTime]
72
+ @updated_date = j_obj.updated_date
73
+ if !@updated_date.nil?
74
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
75
+ str = fmt.print(@updated_date)
76
+ @updated_date = DateTime.iso8601(str)
77
+ end
78
+ self
79
+ end
80
+
81
+ end
82
+ end
83
+ end
84
+ end