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,60 @@
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.junction.api'
31
+ class JunctionApi
32
+
33
+ include com.ning.billing.junction.api.JunctionApi
34
+
35
+ def initialize(real_java_api)
36
+ @real_java_api = real_java_api
37
+ end
38
+
39
+
40
+ java_signature 'Java::java.util.List getBlockingHistory(Java::java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
41
+ def get_blocking_history(overdueableId, context)
42
+ # conversion for overdueableId [type = java.util.UUID]
43
+ overdueableId = java.util.UUID.fromString(overdueableId.to_s) unless overdueableId.nil?
44
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
45
+ context = context.to_java unless context.nil?
46
+ res = @real_java_api.get_blocking_history(overdueableId, context)
47
+ # conversion for res [type = java.util.List]
48
+ tmp = []
49
+ (res || []).each do |m|
50
+ # conversion for m [type = com.ning.billing.junction.api.BlockingState]
51
+ m = Killbill::Plugin::Model::BlockingState.new.to_ruby(m) unless m.nil?
52
+ tmp << m
53
+ end
54
+ res = tmp
55
+ return res
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,68 @@
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.catalog.api'
31
+ class Limit
32
+
33
+ include com.ning.billing.catalog.api.Limit
34
+
35
+ attr_accessor :unit, :max, :min
36
+
37
+ def initialize()
38
+ end
39
+
40
+ def to_java()
41
+ # conversion for unit [type = com.ning.billing.catalog.api.Unit]
42
+ @unit = @unit.to_java unless @unit.nil?
43
+
44
+ # conversion for max [type = java.lang.Double]
45
+ @max = @max
46
+
47
+ # conversion for min [type = java.lang.Double]
48
+ @min = @min
49
+ self
50
+ end
51
+
52
+ def to_ruby(j_obj)
53
+ # conversion for unit [type = com.ning.billing.catalog.api.Unit]
54
+ @unit = j_obj.unit
55
+ @unit = Killbill::Plugin::Model::Unit.new.to_ruby(@unit) unless @unit.nil?
56
+
57
+ # conversion for max [type = java.lang.Double]
58
+ @max = j_obj.max
59
+
60
+ # conversion for min [type = java.lang.Double]
61
+ @min = j_obj.min
62
+ self
63
+ end
64
+
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,63 @@
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.catalog.api'
31
+ class Listing
32
+
33
+ include com.ning.billing.catalog.api.Listing
34
+
35
+ attr_accessor :plan, :price_list
36
+
37
+ def initialize()
38
+ end
39
+
40
+ def to_java()
41
+ # conversion for plan [type = com.ning.billing.catalog.api.Plan]
42
+ @plan = @plan.to_java unless @plan.nil?
43
+
44
+ # conversion for price_list [type = com.ning.billing.catalog.api.PriceList]
45
+ @price_list = @price_list.to_java unless @price_list.nil?
46
+ self
47
+ end
48
+
49
+ def to_ruby(j_obj)
50
+ # conversion for plan [type = com.ning.billing.catalog.api.Plan]
51
+ @plan = j_obj.plan
52
+ @plan = Killbill::Plugin::Model::Plan.new.to_ruby(@plan) unless @plan.nil?
53
+
54
+ # conversion for price_list [type = com.ning.billing.catalog.api.PriceList]
55
+ @price_list = j_obj.price_list
56
+ @price_list = Killbill::Plugin::Model::PriceList.new.to_ruby(@price_list) unless @price_list.nil?
57
+ self
58
+ end
59
+
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,228 @@
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.account.api'
31
+ class MigrationAccountData
32
+
33
+ include com.ning.billing.account.api.MigrationAccountData
34
+
35
+ attr_accessor :external_key, :name, :first_name_length, :email, :bill_cycle_day_local, :currency, :payment_method_id, :time_zone, :locale, :address1, :address2, :company_name, :city, :state_or_province, :postal_code, :country, :phone, :is_migrated, :is_notified_for_invoices, :created_date, :updated_date, :additional_contact_emails
36
+
37
+ def initialize()
38
+ end
39
+
40
+ def to_java()
41
+ # conversion for external_key [type = java.lang.String]
42
+ @external_key = @external_key.to_s unless @external_key.nil?
43
+
44
+ # conversion for name [type = java.lang.String]
45
+ @name = @name.to_s unless @name.nil?
46
+
47
+ # conversion for first_name_length [type = java.lang.Integer]
48
+ @first_name_length = @first_name_length
49
+
50
+ # conversion for email [type = java.lang.String]
51
+ @email = @email.to_s unless @email.nil?
52
+
53
+ # conversion for bill_cycle_day_local [type = java.lang.Integer]
54
+ @bill_cycle_day_local = @bill_cycle_day_local
55
+
56
+ # conversion for currency [type = com.ning.billing.catalog.api.Currency]
57
+ @currency = Java::com.ning.billing.catalog.api.Currency.value_of("#{@currency.to_s}") unless @currency.nil?
58
+
59
+ # conversion for payment_method_id [type = java.util.UUID]
60
+ @payment_method_id = java.util.UUID.fromString(@payment_method_id.to_s) unless @payment_method_id.nil?
61
+
62
+ # conversion for time_zone [type = org.joda.time.DateTimeZone]
63
+ if !@time_zone.nil?
64
+ @time_zone = Java::org.joda.time.DateTimeZone.forID((@time_zone.respond_to?(:identifier) ? @time_zone.identifier : @time_zone.to_s))
65
+ end
66
+
67
+ # conversion for locale [type = java.lang.String]
68
+ @locale = @locale.to_s unless @locale.nil?
69
+
70
+ # conversion for address1 [type = java.lang.String]
71
+ @address1 = @address1.to_s unless @address1.nil?
72
+
73
+ # conversion for address2 [type = java.lang.String]
74
+ @address2 = @address2.to_s unless @address2.nil?
75
+
76
+ # conversion for company_name [type = java.lang.String]
77
+ @company_name = @company_name.to_s unless @company_name.nil?
78
+
79
+ # conversion for city [type = java.lang.String]
80
+ @city = @city.to_s unless @city.nil?
81
+
82
+ # conversion for state_or_province [type = java.lang.String]
83
+ @state_or_province = @state_or_province.to_s unless @state_or_province.nil?
84
+
85
+ # conversion for postal_code [type = java.lang.String]
86
+ @postal_code = @postal_code.to_s unless @postal_code.nil?
87
+
88
+ # conversion for country [type = java.lang.String]
89
+ @country = @country.to_s unless @country.nil?
90
+
91
+ # conversion for phone [type = java.lang.String]
92
+ @phone = @phone.to_s unless @phone.nil?
93
+
94
+ # conversion for is_migrated [type = java.lang.Boolean]
95
+ @is_migrated = @is_migrated.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(@is_migrated)
96
+
97
+ # conversion for is_notified_for_invoices [type = java.lang.Boolean]
98
+ @is_notified_for_invoices = @is_notified_for_invoices.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(@is_notified_for_invoices)
99
+
100
+ # conversion for created_date [type = org.joda.time.DateTime]
101
+ if !@created_date.nil?
102
+ @created_date = (@created_date.kind_of? Time) ? DateTime.parse(@created_date.to_s) : @created_date
103
+ @created_date = Java::org.joda.time.DateTime.new(@created_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
104
+ end
105
+
106
+ # conversion for updated_date [type = org.joda.time.DateTime]
107
+ if !@updated_date.nil?
108
+ @updated_date = (@updated_date.kind_of? Time) ? DateTime.parse(@updated_date.to_s) : @updated_date
109
+ @updated_date = Java::org.joda.time.DateTime.new(@updated_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
110
+ end
111
+
112
+ # conversion for additional_contact_emails [type = java.util.List]
113
+ tmp = java.util.ArrayList.new
114
+ (@additional_contact_emails || []).each do |m|
115
+ # conversion for m [type = java.lang.String]
116
+ m = m.to_s unless m.nil?
117
+ tmp.add(m)
118
+ end
119
+ @additional_contact_emails = tmp
120
+ self
121
+ end
122
+
123
+ def to_ruby(j_obj)
124
+ # conversion for external_key [type = java.lang.String]
125
+ @external_key = j_obj.external_key
126
+
127
+ # conversion for name [type = java.lang.String]
128
+ @name = j_obj.name
129
+
130
+ # conversion for first_name_length [type = java.lang.Integer]
131
+ @first_name_length = j_obj.first_name_length
132
+
133
+ # conversion for email [type = java.lang.String]
134
+ @email = j_obj.email
135
+
136
+ # conversion for bill_cycle_day_local [type = java.lang.Integer]
137
+ @bill_cycle_day_local = j_obj.bill_cycle_day_local
138
+
139
+ # conversion for currency [type = com.ning.billing.catalog.api.Currency]
140
+ @currency = j_obj.currency
141
+ @currency = @currency.to_s.to_sym unless @currency.nil?
142
+
143
+ # conversion for payment_method_id [type = java.util.UUID]
144
+ @payment_method_id = j_obj.payment_method_id
145
+ @payment_method_id = @payment_method_id.nil? ? nil : @payment_method_id.to_s
146
+
147
+ # conversion for time_zone [type = org.joda.time.DateTimeZone]
148
+ @time_zone = j_obj.time_zone
149
+ if !@time_zone.nil?
150
+ @time_zone = TZInfo::Timezone.get(@time_zone.get_id)
151
+ end
152
+
153
+ # conversion for locale [type = java.lang.String]
154
+ @locale = j_obj.locale
155
+
156
+ # conversion for address1 [type = java.lang.String]
157
+ @address1 = j_obj.address1
158
+
159
+ # conversion for address2 [type = java.lang.String]
160
+ @address2 = j_obj.address2
161
+
162
+ # conversion for company_name [type = java.lang.String]
163
+ @company_name = j_obj.company_name
164
+
165
+ # conversion for city [type = java.lang.String]
166
+ @city = j_obj.city
167
+
168
+ # conversion for state_or_province [type = java.lang.String]
169
+ @state_or_province = j_obj.state_or_province
170
+
171
+ # conversion for postal_code [type = java.lang.String]
172
+ @postal_code = j_obj.postal_code
173
+
174
+ # conversion for country [type = java.lang.String]
175
+ @country = j_obj.country
176
+
177
+ # conversion for phone [type = java.lang.String]
178
+ @phone = j_obj.phone
179
+
180
+ # conversion for is_migrated [type = java.lang.Boolean]
181
+ @is_migrated = j_obj.is_migrated
182
+ if @is_migrated.nil?
183
+ @is_migrated = false
184
+ else
185
+ tmp_bool = (@is_migrated.java_kind_of? java.lang.Boolean) ? @is_migrated.boolean_value : @is_migrated
186
+ @is_migrated = tmp_bool ? true : false
187
+ end
188
+
189
+ # conversion for is_notified_for_invoices [type = java.lang.Boolean]
190
+ @is_notified_for_invoices = j_obj.is_notified_for_invoices
191
+ if @is_notified_for_invoices.nil?
192
+ @is_notified_for_invoices = false
193
+ else
194
+ tmp_bool = (@is_notified_for_invoices.java_kind_of? java.lang.Boolean) ? @is_notified_for_invoices.boolean_value : @is_notified_for_invoices
195
+ @is_notified_for_invoices = tmp_bool ? true : false
196
+ end
197
+
198
+ # conversion for created_date [type = org.joda.time.DateTime]
199
+ @created_date = j_obj.created_date
200
+ if !@created_date.nil?
201
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
202
+ str = fmt.print(@created_date)
203
+ @created_date = DateTime.iso8601(str)
204
+ end
205
+
206
+ # conversion for updated_date [type = org.joda.time.DateTime]
207
+ @updated_date = j_obj.updated_date
208
+ if !@updated_date.nil?
209
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
210
+ str = fmt.print(@updated_date)
211
+ @updated_date = DateTime.iso8601(str)
212
+ end
213
+
214
+ # conversion for additional_contact_emails [type = java.util.List]
215
+ @additional_contact_emails = j_obj.additional_contact_emails
216
+ tmp = []
217
+ (@additional_contact_emails || []).each do |m|
218
+ # conversion for m [type = java.lang.String]
219
+ tmp << m
220
+ end
221
+ @additional_contact_emails = tmp
222
+ self
223
+ end
224
+
225
+ end
226
+ end
227
+ end
228
+ end
@@ -0,0 +1,143 @@
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.catalog.api'
31
+ class MigrationPlan
32
+
33
+ include com.ning.billing.catalog.api.MigrationPlan
34
+
35
+ attr_accessor :initial_phases, :product, :name, :is_retired, :initial_phase_iterator, :final_phase, :billing_period, :plans_allowed_in_bundle, :all_phases, :effective_date_for_existing_subscriptons
36
+
37
+ def initialize()
38
+ end
39
+
40
+ def to_java()
41
+ # conversion for initial_phases [type = com.ning.billing.catalog.api.PlanPhase]
42
+ @initial_phases = @initial_phases.to_java unless @initial_phases.nil?
43
+
44
+ # conversion for product [type = com.ning.billing.catalog.api.Product]
45
+ @product = @product.to_java unless @product.nil?
46
+
47
+ # conversion for name [type = java.lang.String]
48
+ @name = @name.to_s unless @name.nil?
49
+
50
+ # conversion for is_retired [type = boolean]
51
+ @is_retired = @is_retired.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(@is_retired)
52
+
53
+ # conversion for initial_phase_iterator [type = java.util.Iterator]
54
+ tmp = java.util.ArrayList.new
55
+ (@initial_phase_iterator || []).each do |m|
56
+ # conversion for m [type = com.ning.billing.catalog.api.PlanPhase]
57
+ m = m.to_java unless m.nil?
58
+ tmp.add(m)
59
+ end
60
+ @initial_phase_iterator = tmp
61
+
62
+ # conversion for final_phase [type = com.ning.billing.catalog.api.PlanPhase]
63
+ @final_phase = @final_phase.to_java unless @final_phase.nil?
64
+
65
+ # conversion for billing_period [type = com.ning.billing.catalog.api.BillingPeriod]
66
+ @billing_period = Java::com.ning.billing.catalog.api.BillingPeriod.value_of("#{@billing_period.to_s}") unless @billing_period.nil?
67
+
68
+ # conversion for plans_allowed_in_bundle [type = int]
69
+ @plans_allowed_in_bundle = @plans_allowed_in_bundle
70
+
71
+ # conversion for all_phases [type = com.ning.billing.catalog.api.PlanPhase]
72
+ @all_phases = @all_phases.to_java unless @all_phases.nil?
73
+
74
+ # conversion for effective_date_for_existing_subscriptons [type = java.util.Date]
75
+ if !@effective_date_for_existing_subscriptons.nil?
76
+ @effective_date_for_existing_subscriptons = (@effective_date_for_existing_subscriptons.kind_of? Time) ? DateTime.parse(@effective_date_for_existing_subscriptons.to_s) : @effective_date_for_existing_subscriptons
77
+ @effective_date_for_existing_subscriptons = Java::org.joda.time.DateTime.new(@effective_date_for_existing_subscriptons.to_s, Java::org.joda.time.DateTimeZone::UTC)
78
+ @effective_date_for_existing_subscriptons = @effective_date_for_existing_subscriptons.to_date
79
+ end
80
+ self
81
+ end
82
+
83
+ def to_ruby(j_obj)
84
+ # conversion for initial_phases [type = com.ning.billing.catalog.api.PlanPhase]
85
+ @initial_phases = j_obj.initial_phases
86
+ @initial_phases = Killbill::Plugin::Model::PlanPhase.new.to_ruby(@initial_phases) unless @initial_phases.nil?
87
+
88
+ # conversion for product [type = com.ning.billing.catalog.api.Product]
89
+ @product = j_obj.product
90
+ @product = Killbill::Plugin::Model::Product.new.to_ruby(@product) unless @product.nil?
91
+
92
+ # conversion for name [type = java.lang.String]
93
+ @name = j_obj.name
94
+
95
+ # conversion for is_retired [type = boolean]
96
+ @is_retired = j_obj.is_retired
97
+ if @is_retired.nil?
98
+ @is_retired = false
99
+ else
100
+ tmp_bool = (@is_retired.java_kind_of? java.lang.Boolean) ? @is_retired.boolean_value : @is_retired
101
+ @is_retired = tmp_bool ? true : false
102
+ end
103
+
104
+ # conversion for initial_phase_iterator [type = java.util.Iterator]
105
+ @initial_phase_iterator = j_obj.initial_phase_iterator
106
+ tmp = []
107
+ (@initial_phase_iterator || []).each do |m|
108
+ # conversion for m [type = com.ning.billing.catalog.api.PlanPhase]
109
+ m = Killbill::Plugin::Model::PlanPhase.new.to_ruby(m) unless m.nil?
110
+ tmp << m
111
+ end
112
+ @initial_phase_iterator = tmp
113
+
114
+ # conversion for final_phase [type = com.ning.billing.catalog.api.PlanPhase]
115
+ @final_phase = j_obj.final_phase
116
+ @final_phase = Killbill::Plugin::Model::PlanPhase.new.to_ruby(@final_phase) unless @final_phase.nil?
117
+
118
+ # conversion for billing_period [type = com.ning.billing.catalog.api.BillingPeriod]
119
+ @billing_period = j_obj.billing_period
120
+ @billing_period = @billing_period.to_s.to_sym unless @billing_period.nil?
121
+
122
+ # conversion for plans_allowed_in_bundle [type = int]
123
+ @plans_allowed_in_bundle = j_obj.plans_allowed_in_bundle
124
+
125
+ # conversion for all_phases [type = com.ning.billing.catalog.api.PlanPhase]
126
+ @all_phases = j_obj.all_phases
127
+ @all_phases = Killbill::Plugin::Model::PlanPhase.new.to_ruby(@all_phases) unless @all_phases.nil?
128
+
129
+ # conversion for effective_date_for_existing_subscriptons [type = java.util.Date]
130
+ @effective_date_for_existing_subscriptons = j_obj.effective_date_for_existing_subscriptons
131
+ if !@effective_date_for_existing_subscriptons.nil?
132
+ @effective_date_for_existing_subscriptons = Java::org.joda.time.DateTime.new(@effective_date_for_existing_subscriptons)
133
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
134
+ str = fmt.print(@effective_date_for_existing_subscriptons)
135
+ @effective_date_for_existing_subscriptons = DateTime.iso8601(str)
136
+ end
137
+ self
138
+ end
139
+
140
+ end
141
+ end
142
+ end
143
+ end