killbill 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,89 +0,0 @@
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.subscription.api.user'
31
- class SubscriptionStatusDryRun
32
-
33
- include com.ning.billing.subscription.api.user.SubscriptionStatusDryRun
34
-
35
- attr_accessor :id, :product_name, :billing_period, :price_list, :phase_type, :reason
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 product_name [type = java.lang.String]
45
- @product_name = @product_name.to_s unless @product_name.nil?
46
-
47
- # conversion for billing_period [type = com.ning.billing.catalog.api.BillingPeriod]
48
- @billing_period = Java::com.ning.billing.catalog.api.BillingPeriod.value_of("#{@billing_period.to_s}") unless @billing_period.nil?
49
-
50
- # conversion for price_list [type = java.lang.String]
51
- @price_list = @price_list.to_s unless @price_list.nil?
52
-
53
- # conversion for phase_type [type = com.ning.billing.catalog.api.PhaseType]
54
- @phase_type = Java::com.ning.billing.catalog.api.PhaseType.value_of("#{@phase_type.to_s}") unless @phase_type.nil?
55
-
56
- # conversion for reason [type = com.ning.billing.subscription.api.user.DryRunChangeReason]
57
- @reason = Java::com.ning.billing.subscription.api.user.DryRunChangeReason.value_of("#{@reason.to_s}") unless @reason.nil?
58
- self
59
- end
60
-
61
- def to_ruby(j_obj)
62
- # conversion for id [type = java.util.UUID]
63
- @id = j_obj.id
64
- @id = @id.nil? ? nil : @id.to_s
65
-
66
- # conversion for product_name [type = java.lang.String]
67
- @product_name = j_obj.product_name
68
-
69
- # conversion for billing_period [type = com.ning.billing.catalog.api.BillingPeriod]
70
- @billing_period = j_obj.billing_period
71
- @billing_period = @billing_period.to_s.to_sym unless @billing_period.nil?
72
-
73
- # conversion for price_list [type = java.lang.String]
74
- @price_list = j_obj.price_list
75
-
76
- # conversion for phase_type [type = com.ning.billing.catalog.api.PhaseType]
77
- @phase_type = j_obj.phase_type
78
- @phase_type = @phase_type.to_s.to_sym unless @phase_type.nil?
79
-
80
- # conversion for reason [type = com.ning.billing.subscription.api.user.DryRunChangeReason]
81
- @reason = j_obj.reason
82
- @reason = @reason.to_s.to_sym unless @reason.nil?
83
- self
84
- end
85
-
86
- end
87
- end
88
- end
89
- end
@@ -1,196 +0,0 @@
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.subscription.api.user'
31
- class SubscriptionTransition
32
-
33
- include com.ning.billing.subscription.api.user.SubscriptionTransition
34
-
35
- attr_accessor :subscription_id, :bundle_id, :previous_state, :next_state, :previous_event_id, :previous_event_created_date, :previous_plan, :next_plan, :previous_phase, :next_event_id, :next_event_created_date, :next_phase, :previous_price_list, :next_price_list, :requested_transition_time, :effective_transition_time, :transition_type
36
-
37
- def initialize()
38
- end
39
-
40
- def to_java()
41
- # conversion for subscription_id [type = java.util.UUID]
42
- @subscription_id = java.util.UUID.fromString(@subscription_id.to_s) unless @subscription_id.nil?
43
-
44
- # conversion for bundle_id [type = java.util.UUID]
45
- @bundle_id = java.util.UUID.fromString(@bundle_id.to_s) unless @bundle_id.nil?
46
-
47
- # conversion for previous_state [type = com.ning.billing.subscription.api.user.SubscriptionState]
48
- @previous_state = Java::com.ning.billing.subscription.api.user.SubscriptionState.value_of("#{@previous_state.to_s}") unless @previous_state.nil?
49
-
50
- # conversion for next_state [type = com.ning.billing.subscription.api.user.SubscriptionState]
51
- @next_state = Java::com.ning.billing.subscription.api.user.SubscriptionState.value_of("#{@next_state.to_s}") unless @next_state.nil?
52
-
53
- # conversion for previous_event_id [type = java.util.UUID]
54
- @previous_event_id = java.util.UUID.fromString(@previous_event_id.to_s) unless @previous_event_id.nil?
55
-
56
- # conversion for previous_event_created_date [type = org.joda.time.DateTime]
57
- if !@previous_event_created_date.nil?
58
- @previous_event_created_date = (@previous_event_created_date.kind_of? Time) ? DateTime.parse(@previous_event_created_date.to_s) : @previous_event_created_date
59
- @previous_event_created_date = Java::org.joda.time.DateTime.new(@previous_event_created_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
60
- end
61
-
62
- # conversion for previous_plan [type = com.ning.billing.catalog.api.Plan]
63
- @previous_plan = @previous_plan.to_java unless @previous_plan.nil?
64
-
65
- # conversion for next_plan [type = com.ning.billing.catalog.api.Plan]
66
- @next_plan = @next_plan.to_java unless @next_plan.nil?
67
-
68
- # conversion for previous_phase [type = com.ning.billing.catalog.api.PlanPhase]
69
- @previous_phase = @previous_phase.to_java unless @previous_phase.nil?
70
-
71
- # conversion for next_event_id [type = java.util.UUID]
72
- @next_event_id = java.util.UUID.fromString(@next_event_id.to_s) unless @next_event_id.nil?
73
-
74
- # conversion for next_event_created_date [type = org.joda.time.DateTime]
75
- if !@next_event_created_date.nil?
76
- @next_event_created_date = (@next_event_created_date.kind_of? Time) ? DateTime.parse(@next_event_created_date.to_s) : @next_event_created_date
77
- @next_event_created_date = Java::org.joda.time.DateTime.new(@next_event_created_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
78
- end
79
-
80
- # conversion for next_phase [type = com.ning.billing.catalog.api.PlanPhase]
81
- @next_phase = @next_phase.to_java unless @next_phase.nil?
82
-
83
- # conversion for previous_price_list [type = com.ning.billing.catalog.api.PriceList]
84
- @previous_price_list = @previous_price_list.to_java unless @previous_price_list.nil?
85
-
86
- # conversion for next_price_list [type = com.ning.billing.catalog.api.PriceList]
87
- @next_price_list = @next_price_list.to_java unless @next_price_list.nil?
88
-
89
- # conversion for requested_transition_time [type = org.joda.time.DateTime]
90
- if !@requested_transition_time.nil?
91
- @requested_transition_time = (@requested_transition_time.kind_of? Time) ? DateTime.parse(@requested_transition_time.to_s) : @requested_transition_time
92
- @requested_transition_time = Java::org.joda.time.DateTime.new(@requested_transition_time.to_s, Java::org.joda.time.DateTimeZone::UTC)
93
- end
94
-
95
- # conversion for effective_transition_time [type = org.joda.time.DateTime]
96
- if !@effective_transition_time.nil?
97
- @effective_transition_time = (@effective_transition_time.kind_of? Time) ? DateTime.parse(@effective_transition_time.to_s) : @effective_transition_time
98
- @effective_transition_time = Java::org.joda.time.DateTime.new(@effective_transition_time.to_s, Java::org.joda.time.DateTimeZone::UTC)
99
- end
100
-
101
- # conversion for transition_type [type = com.ning.billing.subscription.api.SubscriptionTransitionType]
102
- @transition_type = Java::com.ning.billing.subscription.api.SubscriptionTransitionType.value_of("#{@transition_type.to_s}") unless @transition_type.nil?
103
- self
104
- end
105
-
106
- def to_ruby(j_obj)
107
- # conversion for subscription_id [type = java.util.UUID]
108
- @subscription_id = j_obj.subscription_id
109
- @subscription_id = @subscription_id.nil? ? nil : @subscription_id.to_s
110
-
111
- # conversion for bundle_id [type = java.util.UUID]
112
- @bundle_id = j_obj.bundle_id
113
- @bundle_id = @bundle_id.nil? ? nil : @bundle_id.to_s
114
-
115
- # conversion for previous_state [type = com.ning.billing.subscription.api.user.SubscriptionState]
116
- @previous_state = j_obj.previous_state
117
- @previous_state = @previous_state.to_s.to_sym unless @previous_state.nil?
118
-
119
- # conversion for next_state [type = com.ning.billing.subscription.api.user.SubscriptionState]
120
- @next_state = j_obj.next_state
121
- @next_state = @next_state.to_s.to_sym unless @next_state.nil?
122
-
123
- # conversion for previous_event_id [type = java.util.UUID]
124
- @previous_event_id = j_obj.previous_event_id
125
- @previous_event_id = @previous_event_id.nil? ? nil : @previous_event_id.to_s
126
-
127
- # conversion for previous_event_created_date [type = org.joda.time.DateTime]
128
- @previous_event_created_date = j_obj.previous_event_created_date
129
- if !@previous_event_created_date.nil?
130
- fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
131
- str = fmt.print(@previous_event_created_date)
132
- @previous_event_created_date = DateTime.iso8601(str)
133
- end
134
-
135
- # conversion for previous_plan [type = com.ning.billing.catalog.api.Plan]
136
- @previous_plan = j_obj.previous_plan
137
- @previous_plan = Killbill::Plugin::Model::Plan.new.to_ruby(@previous_plan) unless @previous_plan.nil?
138
-
139
- # conversion for next_plan [type = com.ning.billing.catalog.api.Plan]
140
- @next_plan = j_obj.next_plan
141
- @next_plan = Killbill::Plugin::Model::Plan.new.to_ruby(@next_plan) unless @next_plan.nil?
142
-
143
- # conversion for previous_phase [type = com.ning.billing.catalog.api.PlanPhase]
144
- @previous_phase = j_obj.previous_phase
145
- @previous_phase = Killbill::Plugin::Model::PlanPhase.new.to_ruby(@previous_phase) unless @previous_phase.nil?
146
-
147
- # conversion for next_event_id [type = java.util.UUID]
148
- @next_event_id = j_obj.next_event_id
149
- @next_event_id = @next_event_id.nil? ? nil : @next_event_id.to_s
150
-
151
- # conversion for next_event_created_date [type = org.joda.time.DateTime]
152
- @next_event_created_date = j_obj.next_event_created_date
153
- if !@next_event_created_date.nil?
154
- fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
155
- str = fmt.print(@next_event_created_date)
156
- @next_event_created_date = DateTime.iso8601(str)
157
- end
158
-
159
- # conversion for next_phase [type = com.ning.billing.catalog.api.PlanPhase]
160
- @next_phase = j_obj.next_phase
161
- @next_phase = Killbill::Plugin::Model::PlanPhase.new.to_ruby(@next_phase) unless @next_phase.nil?
162
-
163
- # conversion for previous_price_list [type = com.ning.billing.catalog.api.PriceList]
164
- @previous_price_list = j_obj.previous_price_list
165
- @previous_price_list = Killbill::Plugin::Model::PriceList.new.to_ruby(@previous_price_list) unless @previous_price_list.nil?
166
-
167
- # conversion for next_price_list [type = com.ning.billing.catalog.api.PriceList]
168
- @next_price_list = j_obj.next_price_list
169
- @next_price_list = Killbill::Plugin::Model::PriceList.new.to_ruby(@next_price_list) unless @next_price_list.nil?
170
-
171
- # conversion for requested_transition_time [type = org.joda.time.DateTime]
172
- @requested_transition_time = j_obj.requested_transition_time
173
- if !@requested_transition_time.nil?
174
- fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
175
- str = fmt.print(@requested_transition_time)
176
- @requested_transition_time = DateTime.iso8601(str)
177
- end
178
-
179
- # conversion for effective_transition_time [type = org.joda.time.DateTime]
180
- @effective_transition_time = j_obj.effective_transition_time
181
- if !@effective_transition_time.nil?
182
- fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
183
- str = fmt.print(@effective_transition_time)
184
- @effective_transition_time = DateTime.iso8601(str)
185
- end
186
-
187
- # conversion for transition_type [type = com.ning.billing.subscription.api.SubscriptionTransitionType]
188
- @transition_type = j_obj.transition_type
189
- @transition_type = @transition_type.to_s.to_sym unless @transition_type.nil?
190
- self
191
- end
192
-
193
- end
194
- end
195
- end
196
- end
@@ -1,303 +0,0 @@
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.subscription.api.user'
31
- class SubscriptionUserApi
32
-
33
- include com.ning.billing.subscription.api.user.SubscriptionUserApi
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.subscription.api.user.SubscriptionBundle getBundleFromId(Java::java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
41
- def get_bundle_from_id(id, context)
42
-
43
- # conversion for id [type = java.util.UUID]
44
- id = java.util.UUID.fromString(id.to_s) unless id.nil?
45
-
46
- # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
47
- context = context.to_java unless context.nil?
48
- begin
49
- res = @real_java_api.get_bundle_from_id(id, context)
50
- # conversion for res [type = com.ning.billing.subscription.api.user.SubscriptionBundle]
51
- res = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(res) unless res.nil?
52
- return res
53
- rescue Java::com.ning.billing.subscription.api.user.SubscriptionUserApiException => e
54
- raise Killbill::Plugin::Model::SubscriptionUserApiException.new.to_ruby(e)
55
- end
56
- end
57
-
58
- java_signature 'Java::com.ning.billing.subscription.api.user.Subscription getSubscriptionFromId(Java::java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
59
- def get_subscription_from_id(id, context)
60
-
61
- # conversion for id [type = java.util.UUID]
62
- id = java.util.UUID.fromString(id.to_s) unless id.nil?
63
-
64
- # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
65
- context = context.to_java unless context.nil?
66
- begin
67
- res = @real_java_api.get_subscription_from_id(id, context)
68
- # conversion for res [type = com.ning.billing.subscription.api.user.Subscription]
69
- res = Killbill::Plugin::Model::Subscription.new.to_ruby(res) unless res.nil?
70
- return res
71
- rescue Java::com.ning.billing.subscription.api.user.SubscriptionUserApiException => e
72
- raise Killbill::Plugin::Model::SubscriptionUserApiException.new.to_ruby(e)
73
- end
74
- end
75
-
76
- java_signature 'Java::java.util.List getBundlesForKey(Java::java.lang.String, Java::com.ning.billing.util.callcontext.TenantContext)'
77
- def get_bundles_for_key(bundleKey, context)
78
-
79
- # conversion for bundleKey [type = java.lang.String]
80
- bundleKey = bundleKey.to_s unless bundleKey.nil?
81
-
82
- # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
83
- context = context.to_java unless context.nil?
84
- begin
85
- res = @real_java_api.get_bundles_for_key(bundleKey, context)
86
- # conversion for res [type = java.util.List]
87
- tmp = []
88
- (res || []).each do |m|
89
- # conversion for m [type = com.ning.billing.subscription.api.user.SubscriptionBundle]
90
- m = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(m) unless m.nil?
91
- tmp << m
92
- end
93
- res = tmp
94
- return res
95
- rescue Java::com.ning.billing.subscription.api.user.SubscriptionUserApiException => e
96
- raise Killbill::Plugin::Model::SubscriptionUserApiException.new.to_ruby(e)
97
- end
98
- end
99
-
100
- java_signature 'Java::com.ning.billing.subscription.api.user.SubscriptionBundle getBundleForAccountAndKey(Java::java.util.UUID, Java::java.lang.String, Java::com.ning.billing.util.callcontext.TenantContext)'
101
- def get_bundle_for_account_and_key(accountId, bundleKey, context)
102
-
103
- # conversion for accountId [type = java.util.UUID]
104
- accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
105
-
106
- # conversion for bundleKey [type = java.lang.String]
107
- bundleKey = bundleKey.to_s unless bundleKey.nil?
108
-
109
- # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
110
- context = context.to_java unless context.nil?
111
- begin
112
- res = @real_java_api.get_bundle_for_account_and_key(accountId, bundleKey, context)
113
- # conversion for res [type = com.ning.billing.subscription.api.user.SubscriptionBundle]
114
- res = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(res) unless res.nil?
115
- return res
116
- rescue Java::com.ning.billing.subscription.api.user.SubscriptionUserApiException => e
117
- raise Killbill::Plugin::Model::SubscriptionUserApiException.new.to_ruby(e)
118
- end
119
- end
120
-
121
- java_signature 'Java::java.util.List getBundlesForAccount(Java::java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
122
- def get_bundles_for_account(accountId, context)
123
-
124
- # conversion for accountId [type = java.util.UUID]
125
- accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
126
-
127
- # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
128
- context = context.to_java unless context.nil?
129
- res = @real_java_api.get_bundles_for_account(accountId, context)
130
- # conversion for res [type = java.util.List]
131
- tmp = []
132
- (res || []).each do |m|
133
- # conversion for m [type = com.ning.billing.subscription.api.user.SubscriptionBundle]
134
- m = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(m) unless m.nil?
135
- tmp << m
136
- end
137
- res = tmp
138
- return res
139
- end
140
-
141
- java_signature 'Java::java.util.List getSubscriptionsForBundle(Java::java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
142
- def get_subscriptions_for_bundle(bundleId, context)
143
-
144
- # conversion for bundleId [type = java.util.UUID]
145
- bundleId = java.util.UUID.fromString(bundleId.to_s) unless bundleId.nil?
146
-
147
- # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
148
- context = context.to_java unless context.nil?
149
- res = @real_java_api.get_subscriptions_for_bundle(bundleId, context)
150
- # conversion for res [type = java.util.List]
151
- tmp = []
152
- (res || []).each do |m|
153
- # conversion for m [type = com.ning.billing.subscription.api.user.Subscription]
154
- m = Killbill::Plugin::Model::Subscription.new.to_ruby(m) unless m.nil?
155
- tmp << m
156
- end
157
- res = tmp
158
- return res
159
- end
160
-
161
- java_signature 'Java::java.util.List getSubscriptionsForAccountAndKey(Java::java.util.UUID, Java::java.lang.String, Java::com.ning.billing.util.callcontext.TenantContext)'
162
- def get_subscriptions_for_account_and_key(accountId, bundleKey, 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 bundleKey [type = java.lang.String]
168
- bundleKey = bundleKey.to_s unless bundleKey.nil?
169
-
170
- # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
171
- context = context.to_java unless context.nil?
172
- res = @real_java_api.get_subscriptions_for_account_and_key(accountId, bundleKey, context)
173
- # conversion for res [type = java.util.List]
174
- tmp = []
175
- (res || []).each do |m|
176
- # conversion for m [type = com.ning.billing.subscription.api.user.Subscription]
177
- m = Killbill::Plugin::Model::Subscription.new.to_ruby(m) unless m.nil?
178
- tmp << m
179
- end
180
- res = tmp
181
- return res
182
- end
183
-
184
- java_signature 'Java::com.ning.billing.subscription.api.user.Subscription getBaseSubscription(Java::java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
185
- def get_base_subscription(bundleId, context)
186
-
187
- # conversion for bundleId [type = java.util.UUID]
188
- bundleId = java.util.UUID.fromString(bundleId.to_s) unless bundleId.nil?
189
-
190
- # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
191
- context = context.to_java unless context.nil?
192
- begin
193
- res = @real_java_api.get_base_subscription(bundleId, context)
194
- # conversion for res [type = com.ning.billing.subscription.api.user.Subscription]
195
- res = Killbill::Plugin::Model::Subscription.new.to_ruby(res) unless res.nil?
196
- return res
197
- rescue Java::com.ning.billing.subscription.api.user.SubscriptionUserApiException => e
198
- raise Killbill::Plugin::Model::SubscriptionUserApiException.new.to_ruby(e)
199
- end
200
- end
201
-
202
- java_signature 'Java::com.ning.billing.subscription.api.user.SubscriptionBundle createBundleForAccount(Java::java.util.UUID, Java::java.lang.String, Java::com.ning.billing.util.callcontext.CallContext)'
203
- def create_bundle_for_account(accountId, bundleKey, context)
204
-
205
- # conversion for accountId [type = java.util.UUID]
206
- accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
207
-
208
- # conversion for bundleKey [type = java.lang.String]
209
- bundleKey = bundleKey.to_s unless bundleKey.nil?
210
-
211
- # conversion for context [type = com.ning.billing.util.callcontext.CallContext]
212
- context = context.to_java unless context.nil?
213
- begin
214
- res = @real_java_api.create_bundle_for_account(accountId, bundleKey, context)
215
- # conversion for res [type = com.ning.billing.subscription.api.user.SubscriptionBundle]
216
- res = Killbill::Plugin::Model::SubscriptionBundle.new.to_ruby(res) unless res.nil?
217
- return res
218
- rescue Java::com.ning.billing.subscription.api.user.SubscriptionUserApiException => e
219
- raise Killbill::Plugin::Model::SubscriptionUserApiException.new.to_ruby(e)
220
- end
221
- end
222
-
223
- java_signature 'Java::com.ning.billing.subscription.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)'
224
- def create_subscription(bundleId, spec, requestedDate, context)
225
-
226
- # conversion for bundleId [type = java.util.UUID]
227
- bundleId = java.util.UUID.fromString(bundleId.to_s) unless bundleId.nil?
228
-
229
- # conversion for spec [type = com.ning.billing.catalog.api.PlanPhaseSpecifier]
230
- spec = spec.to_java unless spec.nil?
231
-
232
- # conversion for requestedDate [type = org.joda.time.DateTime]
233
- if !requestedDate.nil?
234
- requestedDate = (requestedDate.kind_of? Time) ? DateTime.parse(requestedDate.to_s) : requestedDate
235
- requestedDate = Java::org.joda.time.DateTime.new(requestedDate.to_s, Java::org.joda.time.DateTimeZone::UTC)
236
- end
237
-
238
- # conversion for context [type = com.ning.billing.util.callcontext.CallContext]
239
- context = context.to_java unless context.nil?
240
- begin
241
- res = @real_java_api.create_subscription(bundleId, spec, requestedDate, context)
242
- # conversion for res [type = com.ning.billing.subscription.api.user.Subscription]
243
- res = Killbill::Plugin::Model::Subscription.new.to_ruby(res) unless res.nil?
244
- return res
245
- rescue Java::com.ning.billing.subscription.api.user.SubscriptionUserApiException => e
246
- raise Killbill::Plugin::Model::SubscriptionUserApiException.new.to_ruby(e)
247
- end
248
- end
249
-
250
- 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)'
251
- def get_dry_run_change_plan_status(subscriptionId, productName, requestedDate, context)
252
-
253
- # conversion for subscriptionId [type = java.util.UUID]
254
- subscriptionId = java.util.UUID.fromString(subscriptionId.to_s) unless subscriptionId.nil?
255
-
256
- # conversion for productName [type = java.lang.String]
257
- productName = productName.to_s unless productName.nil?
258
-
259
- # conversion for requestedDate [type = org.joda.time.DateTime]
260
- if !requestedDate.nil?
261
- requestedDate = (requestedDate.kind_of? Time) ? DateTime.parse(requestedDate.to_s) : requestedDate
262
- requestedDate = Java::org.joda.time.DateTime.new(requestedDate.to_s, Java::org.joda.time.DateTimeZone::UTC)
263
- end
264
-
265
- # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
266
- context = context.to_java unless context.nil?
267
- begin
268
- res = @real_java_api.get_dry_run_change_plan_status(subscriptionId, productName, requestedDate, context)
269
- # conversion for res [type = java.util.List]
270
- tmp = []
271
- (res || []).each do |m|
272
- # conversion for m [type = com.ning.billing.subscription.api.user.SubscriptionStatusDryRun]
273
- m = Killbill::Plugin::Model::SubscriptionStatusDryRun.new.to_ruby(m) unless m.nil?
274
- tmp << m
275
- end
276
- res = tmp
277
- return res
278
- rescue Java::com.ning.billing.subscription.api.user.SubscriptionUserApiException => e
279
- raise Killbill::Plugin::Model::SubscriptionUserApiException.new.to_ruby(e)
280
- end
281
- end
282
-
283
- java_signature 'Java::org.joda.time.DateTime getNextBillingDate(Java::java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
284
- def get_next_billing_date(account, context)
285
-
286
- # conversion for account [type = java.util.UUID]
287
- account = java.util.UUID.fromString(account.to_s) unless account.nil?
288
-
289
- # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
290
- context = context.to_java unless context.nil?
291
- res = @real_java_api.get_next_billing_date(account, context)
292
- # conversion for res [type = org.joda.time.DateTime]
293
- if !res.nil?
294
- fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
295
- str = fmt.print(res)
296
- res = DateTime.iso8601(str)
297
- end
298
- return res
299
- end
300
- end
301
- end
302
- end
303
- end