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
@@ -1,26 +1,112 @@
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
+
1
19
 
2
20
  #
3
- # Ruby classes automatically generated from java classes-- don't edit
21
+ # DO NOT EDIT!!!
22
+ # File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
4
23
  #
24
+
25
+
5
26
  module Killbill
6
27
  module Plugin
7
28
  module Model
8
29
 
30
+ java_package 'com.ning.billing.payment.plugin.api'
9
31
  class RefundInfoPlugin
10
32
 
11
33
  include com.ning.billing.payment.plugin.api.RefundInfoPlugin
12
34
 
13
- attr_reader :amount, :created_date, :effective_date, :status, :gateway_error, :gateway_error_code, :reference_id
35
+ attr_accessor :amount, :created_date, :effective_date, :status, :gateway_error, :gateway_error_code, :reference_id
36
+
37
+ def initialize()
38
+ end
39
+
40
+ def to_java()
41
+ # conversion for amount [type = java.math.BigDecimal]
42
+ if @amount.nil?
43
+ @amount = java.math.BigDecimal::ZERO
44
+ else
45
+ @amount = java.math.BigDecimal.new(@amount.to_i)
46
+ end
47
+
48
+ # conversion for created_date [type = org.joda.time.DateTime]
49
+ if !@created_date.nil?
50
+ @created_date = (@created_date.kind_of? Time) ? DateTime.parse(@created_date.to_s) : @created_date
51
+ @created_date = Java::org.joda.time.DateTime.new(@created_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
52
+ end
53
+
54
+ # conversion for effective_date [type = org.joda.time.DateTime]
55
+ if !@effective_date.nil?
56
+ @effective_date = (@effective_date.kind_of? Time) ? DateTime.parse(@effective_date.to_s) : @effective_date
57
+ @effective_date = Java::org.joda.time.DateTime.new(@effective_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
58
+ end
59
+
60
+ # conversion for status [type = com.ning.billing.payment.plugin.api.RefundPluginStatus]
61
+ @status = Java::com.ning.billing.payment.plugin.api.RefundPluginStatus.value_of("#{@status.to_s}") unless @status.nil?
62
+
63
+ # conversion for gateway_error [type = java.lang.String]
64
+ @gateway_error = @gateway_error.to_s unless @gateway_error.nil?
14
65
 
15
- def initialize(amount, created_date, effective_date, status, gateway_error, gateway_error_code, reference_id)
16
- @amount = amount
17
- @created_date = created_date
18
- @effective_date = effective_date
19
- @status = status
20
- @gateway_error = gateway_error
21
- @gateway_error_code = gateway_error_code
22
- @reference_id = reference_id
66
+ # conversion for gateway_error_code [type = java.lang.String]
67
+ @gateway_error_code = @gateway_error_code.to_s unless @gateway_error_code.nil?
68
+
69
+ # conversion for reference_id [type = java.lang.String]
70
+ @reference_id = @reference_id.to_s unless @reference_id.nil?
71
+ self
72
+ end
73
+
74
+ def to_ruby(j_obj)
75
+ # conversion for amount [type = java.math.BigDecimal]
76
+ @amount = j_obj.amount
77
+ @amount = @amount.nil? ? 0 : @amount.to_s.to_i
78
+
79
+ # conversion for created_date [type = org.joda.time.DateTime]
80
+ @created_date = j_obj.created_date
81
+ if !@created_date.nil?
82
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
83
+ str = fmt.print(@created_date)
84
+ @created_date = DateTime.iso8601(str)
85
+ end
86
+
87
+ # conversion for effective_date [type = org.joda.time.DateTime]
88
+ @effective_date = j_obj.effective_date
89
+ if !@effective_date.nil?
90
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
91
+ str = fmt.print(@effective_date)
92
+ @effective_date = DateTime.iso8601(str)
93
+ end
94
+
95
+ # conversion for status [type = com.ning.billing.payment.plugin.api.RefundPluginStatus]
96
+ @status = j_obj.status
97
+ @status = @status.to_s.to_sym unless @status.nil?
98
+
99
+ # conversion for gateway_error [type = java.lang.String]
100
+ @gateway_error = j_obj.gateway_error
101
+
102
+ # conversion for gateway_error_code [type = java.lang.String]
103
+ @gateway_error_code = j_obj.gateway_error_code
104
+
105
+ # conversion for reference_id [type = java.lang.String]
106
+ @reference_id = j_obj.reference_id
107
+ self
23
108
  end
109
+
24
110
  end
25
111
  end
26
112
  end
@@ -1,38 +1,120 @@
1
- require 'killbill/gen/object_type'
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
+
2
26
  require 'killbill/gen/account'
27
+ require 'killbill/gen/account_api_exception'
3
28
  require 'killbill/gen/account_data'
4
29
  require 'killbill/gen/account_email'
30
+ require 'killbill/gen/account_service'
31
+ require 'killbill/gen/account_user_api'
32
+ require 'killbill/gen/default_mutable_account_data'
33
+ require 'killbill/gen/migration_account_data'
34
+ require 'killbill/gen/mutable_account_data'
35
+ require 'killbill/gen/beatrix_service'
5
36
  require 'killbill/gen/ext_bus_event'
6
- require 'killbill/gen/ext_bus_event_type'
7
- require 'killbill/gen/currency'
37
+ require 'killbill/gen/external_bus'
38
+ require 'killbill/gen/billing_exception_base'
39
+ require 'killbill/gen/catalog'
40
+ require 'killbill/gen/catalog_api_exception'
41
+ require 'killbill/gen/catalog_service'
42
+ require 'killbill/gen/catalog_user_api'
43
+ require 'killbill/gen/currency_value_null'
44
+ require 'killbill/gen/duration'
45
+ require 'killbill/gen/illegal_plan_change'
46
+ require 'killbill/gen/international_price'
47
+ require 'killbill/gen/invalid_config_exception'
48
+ require 'killbill/gen/limit'
49
+ require 'killbill/gen/listing'
50
+ require 'killbill/gen/migration_plan'
51
+ require 'killbill/gen/plan'
52
+ require 'killbill/gen/plan_change_result'
53
+ require 'killbill/gen/plan_phase'
54
+ require 'killbill/gen/plan_phase_specifier'
55
+ require 'killbill/gen/plan_specifier'
56
+ require 'killbill/gen/price'
57
+ require 'killbill/gen/price_list'
58
+ require 'killbill/gen/price_list_set'
59
+ require 'killbill/gen/product'
60
+ require 'killbill/gen/static_catalog'
61
+ require 'killbill/gen/unit'
62
+ require 'killbill/gen/entitlement_service'
63
+ require 'killbill/gen/entitlement_user_api'
64
+ require 'killbill/gen/entitlement_user_api_exception'
8
65
  require 'killbill/gen/subscription'
9
66
  require 'killbill/gen/subscription_bundle'
10
- require 'killbill/gen/subscription_source_type'
11
- require 'killbill/gen/subscription_state'
67
+ require 'killbill/gen/subscription_status_dry_run'
68
+ require 'killbill/gen/subscription_transition'
12
69
  require 'killbill/gen/invoice'
70
+ require 'killbill/gen/invoice_api_exception'
71
+ require 'killbill/gen/invoice_creation_event'
13
72
  require 'killbill/gen/invoice_item'
73
+ require 'killbill/gen/invoice_migration_api'
74
+ require 'killbill/gen/invoice_notifier'
14
75
  require 'killbill/gen/invoice_payment'
15
- require 'killbill/gen/invoice_payment_type'
76
+ require 'killbill/gen/invoice_payment_api'
77
+ require 'killbill/gen/invoice_service'
78
+ require 'killbill/gen/invoice_user_api'
79
+ require 'killbill/gen/blockable'
80
+ require 'killbill/gen/blocking_api_exception'
16
81
  require 'killbill/gen/blocking_state'
82
+ require 'killbill/gen/junction_api'
17
83
  require 'killbill/gen/payment'
84
+ require 'killbill/gen/payment_api'
85
+ require 'killbill/gen/payment_api_exception'
18
86
  require 'killbill/gen/payment_attempt'
87
+ require 'killbill/gen/payment_method'
19
88
  require 'killbill/gen/payment_method_kv_info'
20
89
  require 'killbill/gen/payment_method_plugin'
90
+ require 'killbill/gen/payment_service'
21
91
  require 'killbill/gen/refund'
92
+ require 'killbill/gen/no_op_payment_plugin_api'
22
93
  require 'killbill/gen/payment_info_plugin'
23
94
  require 'killbill/gen/payment_method_info_plugin'
24
- require 'killbill/gen/payment_plugin_status'
95
+ require 'killbill/gen/payment_plugin_api'
96
+ require 'killbill/gen/payment_plugin_api_exception'
25
97
  require 'killbill/gen/refund_info_plugin'
26
- require 'killbill/gen/refund_plugin_status'
27
- require 'killbill/gen/audit_log'
98
+ require 'killbill/gen/tenant'
99
+ require 'killbill/gen/tenant_api_exception'
100
+ require 'killbill/gen/tenant_data'
101
+ require 'killbill/gen/tenant_kv'
102
+ require 'killbill/gen/tenant_service'
103
+ require 'killbill/gen/tenant_user_api'
104
+ require 'killbill/gen/audit_user_api'
105
+ require 'killbill/gen/column_info'
106
+ require 'killbill/gen/custom_field_api_exception'
107
+ require 'killbill/gen/custom_field_user_api'
108
+ require 'killbill/gen/database_export_output_stream'
109
+ require 'killbill/gen/record_id_api'
110
+ require 'killbill/gen/tag_api_exception'
111
+ require 'killbill/gen/tag_definition_api_exception'
112
+ require 'killbill/gen/tag_user_api'
28
113
  require 'killbill/gen/call_context'
29
- require 'killbill/gen/call_origin'
30
- require 'killbill/gen/user_type'
31
114
  require 'killbill/gen/tenant_context'
32
115
  require 'killbill/gen/custom_field'
116
+ require 'killbill/gen/entity'
117
+ require 'killbill/gen/entity_persistence_exception'
118
+ require 'killbill/gen/control_tag'
33
119
  require 'killbill/gen/tag'
34
120
  require 'killbill/gen/tag_definition'
35
- # STEPH TODO added by hand
36
- #
37
- require 'killbill/gen/uuid'
38
- require 'killbill/gen/date_time_zone'
@@ -0,0 +1,137 @@
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 StaticCatalog
32
+
33
+ include com.ning.billing.catalog.api.StaticCatalog
34
+
35
+ attr_accessor :catalog_name, :effective_date, :current_supported_currencies, :current_products, :current_units, :current_plans, :available_base_plan_listings, :available_addon_listings
36
+
37
+ def initialize()
38
+ end
39
+
40
+ def to_java()
41
+ # conversion for catalog_name [type = java.lang.String]
42
+ @catalog_name = @catalog_name.to_s unless @catalog_name.nil?
43
+
44
+ # conversion for effective_date [type = java.util.Date]
45
+ if !@effective_date.nil?
46
+ @effective_date = (@effective_date.kind_of? Time) ? DateTime.parse(@effective_date.to_s) : @effective_date
47
+ @effective_date = Java::org.joda.time.DateTime.new(@effective_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
48
+ @effective_date = @effective_date.to_date
49
+ end
50
+
51
+ # conversion for current_supported_currencies [type = com.ning.billing.catalog.api.Currency]
52
+ @current_supported_currencies = Java::com.ning.billing.catalog.api.Currency.value_of("#{@current_supported_currencies.to_s}") unless @current_supported_currencies.nil?
53
+
54
+ # conversion for current_products [type = com.ning.billing.catalog.api.Product]
55
+ @current_products = @current_products.to_java unless @current_products.nil?
56
+
57
+ # conversion for current_units [type = com.ning.billing.catalog.api.Unit]
58
+ @current_units = @current_units.to_java unless @current_units.nil?
59
+
60
+ # conversion for current_plans [type = com.ning.billing.catalog.api.Plan]
61
+ @current_plans = @current_plans.to_java unless @current_plans.nil?
62
+
63
+ # conversion for available_base_plan_listings [type = java.util.List]
64
+ tmp = java.util.ArrayList.new
65
+ (@available_base_plan_listings || []).each do |m|
66
+ # conversion for m [type = com.ning.billing.catalog.api.Listing]
67
+ m = m.to_java unless m.nil?
68
+ tmp.add(m)
69
+ end
70
+ @available_base_plan_listings = tmp
71
+
72
+ # conversion for available_addon_listings [type = java.util.List]
73
+ tmp = java.util.ArrayList.new
74
+ (@available_addon_listings || []).each do |m|
75
+ # conversion for m [type = com.ning.billing.catalog.api.Listing]
76
+ m = m.to_java unless m.nil?
77
+ tmp.add(m)
78
+ end
79
+ @available_addon_listings = tmp
80
+ self
81
+ end
82
+
83
+ def to_ruby(j_obj)
84
+ # conversion for catalog_name [type = java.lang.String]
85
+ @catalog_name = j_obj.catalog_name
86
+
87
+ # conversion for effective_date [type = java.util.Date]
88
+ @effective_date = j_obj.effective_date
89
+ if !@effective_date.nil?
90
+ @effective_date = Java::org.joda.time.DateTime.new(@effective_date)
91
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
92
+ str = fmt.print(@effective_date)
93
+ @effective_date = DateTime.iso8601(str)
94
+ end
95
+
96
+ # conversion for current_supported_currencies [type = com.ning.billing.catalog.api.Currency]
97
+ @current_supported_currencies = j_obj.current_supported_currencies
98
+ @current_supported_currencies = @current_supported_currencies.to_s.to_sym unless @current_supported_currencies.nil?
99
+
100
+ # conversion for current_products [type = com.ning.billing.catalog.api.Product]
101
+ @current_products = j_obj.current_products
102
+ @current_products = Killbill::Plugin::Model::Product.new.to_ruby(@current_products) unless @current_products.nil?
103
+
104
+ # conversion for current_units [type = com.ning.billing.catalog.api.Unit]
105
+ @current_units = j_obj.current_units
106
+ @current_units = Killbill::Plugin::Model::Unit.new.to_ruby(@current_units) unless @current_units.nil?
107
+
108
+ # conversion for current_plans [type = com.ning.billing.catalog.api.Plan]
109
+ @current_plans = j_obj.current_plans
110
+ @current_plans = Killbill::Plugin::Model::Plan.new.to_ruby(@current_plans) unless @current_plans.nil?
111
+
112
+ # conversion for available_base_plan_listings [type = java.util.List]
113
+ @available_base_plan_listings = j_obj.available_base_plan_listings
114
+ tmp = []
115
+ (@available_base_plan_listings || []).each do |m|
116
+ # conversion for m [type = com.ning.billing.catalog.api.Listing]
117
+ m = Killbill::Plugin::Model::Listing.new.to_ruby(m) unless m.nil?
118
+ tmp << m
119
+ end
120
+ @available_base_plan_listings = tmp
121
+
122
+ # conversion for available_addon_listings [type = java.util.List]
123
+ @available_addon_listings = j_obj.available_addon_listings
124
+ tmp = []
125
+ (@available_addon_listings || []).each do |m|
126
+ # conversion for m [type = com.ning.billing.catalog.api.Listing]
127
+ m = Killbill::Plugin::Model::Listing.new.to_ruby(m) unless m.nil?
128
+ tmp << m
129
+ end
130
+ @available_addon_listings = tmp
131
+ self
132
+ end
133
+
134
+ end
135
+ end
136
+ end
137
+ end
@@ -1,43 +1,273 @@
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
+
1
19
 
2
20
  #
3
- # Ruby classes automatically generated from java classes-- don't edit
21
+ # DO NOT EDIT!!!
22
+ # File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
4
23
  #
24
+
25
+
5
26
  module Killbill
6
27
  module Plugin
7
28
  module Model
8
29
 
30
+ java_package 'com.ning.billing.entitlement.api.user'
9
31
  class Subscription
10
32
 
11
33
  include com.ning.billing.entitlement.api.user.Subscription
12
34
 
13
- attr_reader :id, :blocking_state, :created_date, :updated_date, :bundle_id, :state, :source_type, :start_date, :end_date, :future_end_date, :current_plan, :last_active_plan, :current_price_list, :current_phase, :last_active_product_name, :last_active_price_list_name, :last_active_category_name, :last_active_billing_period, :charged_through_date, :paid_through_date, :category, :pending_transition, :previous_transition, :all_transitions
14
-
15
- def initialize(id, blocking_state, created_date, updated_date, bundle_id, state, source_type, start_date, end_date, future_end_date, current_plan, last_active_plan, current_price_list, current_phase, last_active_product_name, last_active_price_list_name, last_active_category_name, last_active_billing_period, charged_through_date, paid_through_date, category, pending_transition, previous_transition, all_transitions)
16
- @id = id
17
- @blocking_state = blocking_state
18
- @created_date = created_date
19
- @updated_date = updated_date
20
- @bundle_id = bundle_id
21
- @state = state
22
- @source_type = source_type
23
- @start_date = start_date
24
- @end_date = end_date
25
- @future_end_date = future_end_date
26
- @current_plan = current_plan
27
- @last_active_plan = last_active_plan
28
- @current_price_list = current_price_list
29
- @current_phase = current_phase
30
- @last_active_product_name = last_active_product_name
31
- @last_active_price_list_name = last_active_price_list_name
32
- @last_active_category_name = last_active_category_name
33
- @last_active_billing_period = last_active_billing_period
34
- @charged_through_date = charged_through_date
35
- @paid_through_date = paid_through_date
36
- @category = category
37
- @pending_transition = pending_transition
38
- @previous_transition = previous_transition
39
- @all_transitions = all_transitions
35
+ attr_accessor :id, :blocking_state, :created_date, :updated_date, :bundle_id, :state, :source_type, :start_date, :end_date, :future_end_date, :current_plan, :last_active_plan, :current_price_list, :current_phase, :last_active_product_name, :last_active_price_list_name, :last_active_category_name, :last_active_billing_period, :charged_through_date, :paid_through_date, :category, :pending_transition, :previous_transition, :all_transitions
36
+
37
+ def initialize()
40
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 blocking_state [type = com.ning.billing.junction.api.BlockingState]
45
+ @blocking_state = @blocking_state.to_java unless @blocking_state.nil?
46
+
47
+ # conversion for created_date [type = org.joda.time.DateTime]
48
+ if !@created_date.nil?
49
+ @created_date = (@created_date.kind_of? Time) ? DateTime.parse(@created_date.to_s) : @created_date
50
+ @created_date = Java::org.joda.time.DateTime.new(@created_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
51
+ end
52
+
53
+ # conversion for updated_date [type = org.joda.time.DateTime]
54
+ if !@updated_date.nil?
55
+ @updated_date = (@updated_date.kind_of? Time) ? DateTime.parse(@updated_date.to_s) : @updated_date
56
+ @updated_date = Java::org.joda.time.DateTime.new(@updated_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
57
+ end
58
+
59
+ # conversion for bundle_id [type = java.util.UUID]
60
+ @bundle_id = java.util.UUID.fromString(@bundle_id.to_s) unless @bundle_id.nil?
61
+
62
+ # conversion for state [type = com.ning.billing.entitlement.api.user.SubscriptionState]
63
+ @state = Java::com.ning.billing.entitlement.api.user.SubscriptionState.value_of("#{@state.to_s}") unless @state.nil?
64
+
65
+ # conversion for source_type [type = com.ning.billing.entitlement.api.user.SubscriptionSourceType]
66
+ @source_type = Java::com.ning.billing.entitlement.api.user.SubscriptionSourceType.value_of("#{@source_type.to_s}") unless @source_type.nil?
67
+
68
+ # conversion for start_date [type = org.joda.time.DateTime]
69
+ if !@start_date.nil?
70
+ @start_date = (@start_date.kind_of? Time) ? DateTime.parse(@start_date.to_s) : @start_date
71
+ @start_date = Java::org.joda.time.DateTime.new(@start_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
72
+ end
73
+
74
+ # conversion for end_date [type = org.joda.time.DateTime]
75
+ if !@end_date.nil?
76
+ @end_date = (@end_date.kind_of? Time) ? DateTime.parse(@end_date.to_s) : @end_date
77
+ @end_date = Java::org.joda.time.DateTime.new(@end_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
78
+ end
79
+
80
+ # conversion for future_end_date [type = org.joda.time.DateTime]
81
+ if !@future_end_date.nil?
82
+ @future_end_date = (@future_end_date.kind_of? Time) ? DateTime.parse(@future_end_date.to_s) : @future_end_date
83
+ @future_end_date = Java::org.joda.time.DateTime.new(@future_end_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
84
+ end
85
+
86
+ # conversion for current_plan [type = com.ning.billing.catalog.api.Plan]
87
+ @current_plan = @current_plan.to_java unless @current_plan.nil?
88
+
89
+ # conversion for last_active_plan [type = com.ning.billing.catalog.api.Plan]
90
+ @last_active_plan = @last_active_plan.to_java unless @last_active_plan.nil?
91
+
92
+ # conversion for current_price_list [type = com.ning.billing.catalog.api.PriceList]
93
+ @current_price_list = @current_price_list.to_java unless @current_price_list.nil?
94
+
95
+ # conversion for current_phase [type = com.ning.billing.catalog.api.PlanPhase]
96
+ @current_phase = @current_phase.to_java unless @current_phase.nil?
97
+
98
+ # conversion for last_active_product_name [type = java.lang.String]
99
+ @last_active_product_name = @last_active_product_name.to_s unless @last_active_product_name.nil?
100
+
101
+ # conversion for last_active_price_list_name [type = java.lang.String]
102
+ @last_active_price_list_name = @last_active_price_list_name.to_s unless @last_active_price_list_name.nil?
103
+
104
+ # conversion for last_active_category_name [type = java.lang.String]
105
+ @last_active_category_name = @last_active_category_name.to_s unless @last_active_category_name.nil?
106
+
107
+ # conversion for last_active_billing_period [type = java.lang.String]
108
+ @last_active_billing_period = @last_active_billing_period.to_s unless @last_active_billing_period.nil?
109
+
110
+ # conversion for charged_through_date [type = org.joda.time.DateTime]
111
+ if !@charged_through_date.nil?
112
+ @charged_through_date = (@charged_through_date.kind_of? Time) ? DateTime.parse(@charged_through_date.to_s) : @charged_through_date
113
+ @charged_through_date = Java::org.joda.time.DateTime.new(@charged_through_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
114
+ end
115
+
116
+ # conversion for paid_through_date [type = org.joda.time.DateTime]
117
+ if !@paid_through_date.nil?
118
+ @paid_through_date = (@paid_through_date.kind_of? Time) ? DateTime.parse(@paid_through_date.to_s) : @paid_through_date
119
+ @paid_through_date = Java::org.joda.time.DateTime.new(@paid_through_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
120
+ end
121
+
122
+ # conversion for category [type = com.ning.billing.catalog.api.ProductCategory]
123
+ @category = Java::com.ning.billing.catalog.api.ProductCategory.value_of("#{@category.to_s}") unless @category.nil?
124
+
125
+ # conversion for pending_transition [type = com.ning.billing.entitlement.api.user.SubscriptionTransition]
126
+ @pending_transition = @pending_transition.to_java unless @pending_transition.nil?
127
+
128
+ # conversion for previous_transition [type = com.ning.billing.entitlement.api.user.SubscriptionTransition]
129
+ @previous_transition = @previous_transition.to_java unless @previous_transition.nil?
130
+
131
+ # conversion for all_transitions [type = java.util.List]
132
+ tmp = java.util.ArrayList.new
133
+ (@all_transitions || []).each do |m|
134
+ # conversion for m [type = com.ning.billing.entitlement.api.user.SubscriptionTransition]
135
+ m = m.to_java unless m.nil?
136
+ tmp.add(m)
137
+ end
138
+ @all_transitions = tmp
139
+ self
140
+ end
141
+
142
+ def to_ruby(j_obj)
143
+ # conversion for id [type = java.util.UUID]
144
+ @id = j_obj.id
145
+ @id = @id.nil? ? nil : @id.to_s
146
+
147
+ # conversion for blocking_state [type = com.ning.billing.junction.api.BlockingState]
148
+ @blocking_state = j_obj.blocking_state
149
+ @blocking_state = Killbill::Plugin::Model::BlockingState.new.to_ruby(@blocking_state) unless @blocking_state.nil?
150
+
151
+ # conversion for created_date [type = org.joda.time.DateTime]
152
+ @created_date = j_obj.created_date
153
+ if !@created_date.nil?
154
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
155
+ str = fmt.print(@created_date)
156
+ @created_date = DateTime.iso8601(str)
157
+ end
158
+
159
+ # conversion for updated_date [type = org.joda.time.DateTime]
160
+ @updated_date = j_obj.updated_date
161
+ if !@updated_date.nil?
162
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
163
+ str = fmt.print(@updated_date)
164
+ @updated_date = DateTime.iso8601(str)
165
+ end
166
+
167
+ # conversion for bundle_id [type = java.util.UUID]
168
+ @bundle_id = j_obj.bundle_id
169
+ @bundle_id = @bundle_id.nil? ? nil : @bundle_id.to_s
170
+
171
+ # conversion for state [type = com.ning.billing.entitlement.api.user.SubscriptionState]
172
+ @state = j_obj.state
173
+ @state = @state.to_s.to_sym unless @state.nil?
174
+
175
+ # conversion for source_type [type = com.ning.billing.entitlement.api.user.SubscriptionSourceType]
176
+ @source_type = j_obj.source_type
177
+ @source_type = @source_type.to_s.to_sym unless @source_type.nil?
178
+
179
+ # conversion for start_date [type = org.joda.time.DateTime]
180
+ @start_date = j_obj.start_date
181
+ if !@start_date.nil?
182
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
183
+ str = fmt.print(@start_date)
184
+ @start_date = DateTime.iso8601(str)
185
+ end
186
+
187
+ # conversion for end_date [type = org.joda.time.DateTime]
188
+ @end_date = j_obj.end_date
189
+ if !@end_date.nil?
190
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
191
+ str = fmt.print(@end_date)
192
+ @end_date = DateTime.iso8601(str)
193
+ end
194
+
195
+ # conversion for future_end_date [type = org.joda.time.DateTime]
196
+ @future_end_date = j_obj.future_end_date
197
+ if !@future_end_date.nil?
198
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
199
+ str = fmt.print(@future_end_date)
200
+ @future_end_date = DateTime.iso8601(str)
201
+ end
202
+
203
+ # conversion for current_plan [type = com.ning.billing.catalog.api.Plan]
204
+ @current_plan = j_obj.current_plan
205
+ @current_plan = Killbill::Plugin::Model::Plan.new.to_ruby(@current_plan) unless @current_plan.nil?
206
+
207
+ # conversion for last_active_plan [type = com.ning.billing.catalog.api.Plan]
208
+ @last_active_plan = j_obj.last_active_plan
209
+ @last_active_plan = Killbill::Plugin::Model::Plan.new.to_ruby(@last_active_plan) unless @last_active_plan.nil?
210
+
211
+ # conversion for current_price_list [type = com.ning.billing.catalog.api.PriceList]
212
+ @current_price_list = j_obj.current_price_list
213
+ @current_price_list = Killbill::Plugin::Model::PriceList.new.to_ruby(@current_price_list) unless @current_price_list.nil?
214
+
215
+ # conversion for current_phase [type = com.ning.billing.catalog.api.PlanPhase]
216
+ @current_phase = j_obj.current_phase
217
+ @current_phase = Killbill::Plugin::Model::PlanPhase.new.to_ruby(@current_phase) unless @current_phase.nil?
218
+
219
+ # conversion for last_active_product_name [type = java.lang.String]
220
+ @last_active_product_name = j_obj.last_active_product_name
221
+
222
+ # conversion for last_active_price_list_name [type = java.lang.String]
223
+ @last_active_price_list_name = j_obj.last_active_price_list_name
224
+
225
+ # conversion for last_active_category_name [type = java.lang.String]
226
+ @last_active_category_name = j_obj.last_active_category_name
227
+
228
+ # conversion for last_active_billing_period [type = java.lang.String]
229
+ @last_active_billing_period = j_obj.last_active_billing_period
230
+
231
+ # conversion for charged_through_date [type = org.joda.time.DateTime]
232
+ @charged_through_date = j_obj.charged_through_date
233
+ if !@charged_through_date.nil?
234
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
235
+ str = fmt.print(@charged_through_date)
236
+ @charged_through_date = DateTime.iso8601(str)
237
+ end
238
+
239
+ # conversion for paid_through_date [type = org.joda.time.DateTime]
240
+ @paid_through_date = j_obj.paid_through_date
241
+ if !@paid_through_date.nil?
242
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
243
+ str = fmt.print(@paid_through_date)
244
+ @paid_through_date = DateTime.iso8601(str)
245
+ end
246
+
247
+ # conversion for category [type = com.ning.billing.catalog.api.ProductCategory]
248
+ @category = j_obj.category
249
+ @category = @category.to_s.to_sym unless @category.nil?
250
+
251
+ # conversion for pending_transition [type = com.ning.billing.entitlement.api.user.SubscriptionTransition]
252
+ @pending_transition = j_obj.pending_transition
253
+ @pending_transition = Killbill::Plugin::Model::SubscriptionTransition.new.to_ruby(@pending_transition) unless @pending_transition.nil?
254
+
255
+ # conversion for previous_transition [type = com.ning.billing.entitlement.api.user.SubscriptionTransition]
256
+ @previous_transition = j_obj.previous_transition
257
+ @previous_transition = Killbill::Plugin::Model::SubscriptionTransition.new.to_ruby(@previous_transition) unless @previous_transition.nil?
258
+
259
+ # conversion for all_transitions [type = java.util.List]
260
+ @all_transitions = j_obj.all_transitions
261
+ tmp = []
262
+ (@all_transitions || []).each do |m|
263
+ # conversion for m [type = com.ning.billing.entitlement.api.user.SubscriptionTransition]
264
+ m = Killbill::Plugin::Model::SubscriptionTransition.new.to_ruby(m) unless m.nil?
265
+ tmp << m
266
+ end
267
+ @all_transitions = tmp
268
+ self
269
+ end
270
+
41
271
  end
42
272
  end
43
273
  end