killbill 1.0.19 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
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,110 @@
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 SubscriptionBundle
10
32
 
11
33
  include com.ning.billing.entitlement.api.user.SubscriptionBundle
12
34
 
13
- attr_reader :id, :created_date, :updated_date, :blocking_state, :account_id, :external_key, :overdue_state
35
+ attr_accessor :id, :created_date, :updated_date, :blocking_state, :account_id, :external_key, :overdue_state
36
+
37
+ def initialize()
38
+ end
39
+
40
+ def to_java()
41
+ # conversion for id [type = java.util.UUID]
42
+ @id = java.util.UUID.fromString(@id.to_s) unless @id.nil?
43
+
44
+ # conversion for created_date [type = org.joda.time.DateTime]
45
+ if !@created_date.nil?
46
+ @created_date = (@created_date.kind_of? Time) ? DateTime.parse(@created_date.to_s) : @created_date
47
+ @created_date = Java::org.joda.time.DateTime.new(@created_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
48
+ end
49
+
50
+ # conversion for updated_date [type = org.joda.time.DateTime]
51
+ if !@updated_date.nil?
52
+ @updated_date = (@updated_date.kind_of? Time) ? DateTime.parse(@updated_date.to_s) : @updated_date
53
+ @updated_date = Java::org.joda.time.DateTime.new(@updated_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
54
+ end
55
+
56
+ # conversion for blocking_state [type = com.ning.billing.junction.api.BlockingState]
57
+ @blocking_state = @blocking_state.to_java unless @blocking_state.nil?
58
+
59
+ # conversion for account_id [type = java.util.UUID]
60
+ @account_id = java.util.UUID.fromString(@account_id.to_s) unless @account_id.nil?
14
61
 
15
- def initialize(id, created_date, updated_date, blocking_state, account_id, external_key, overdue_state)
16
- @id = id
17
- @created_date = created_date
18
- @updated_date = updated_date
19
- @blocking_state = blocking_state
20
- @account_id = account_id
21
- @external_key = external_key
22
- @overdue_state = overdue_state
62
+ # conversion for external_key [type = java.lang.String]
63
+ @external_key = @external_key.to_s unless @external_key.nil?
64
+
65
+ # conversion for overdue_state [type = com.ning.billing.overdue.OverdueState]
66
+ @overdue_state = @overdue_state.to_java unless @overdue_state.nil?
67
+ self
68
+ end
69
+
70
+ def to_ruby(j_obj)
71
+ # conversion for id [type = java.util.UUID]
72
+ @id = j_obj.id
73
+ @id = @id.nil? ? nil : @id.to_s
74
+
75
+ # conversion for created_date [type = org.joda.time.DateTime]
76
+ @created_date = j_obj.created_date
77
+ if !@created_date.nil?
78
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
79
+ str = fmt.print(@created_date)
80
+ @created_date = DateTime.iso8601(str)
81
+ end
82
+
83
+ # conversion for updated_date [type = org.joda.time.DateTime]
84
+ @updated_date = j_obj.updated_date
85
+ if !@updated_date.nil?
86
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
87
+ str = fmt.print(@updated_date)
88
+ @updated_date = DateTime.iso8601(str)
89
+ end
90
+
91
+ # conversion for blocking_state [type = com.ning.billing.junction.api.BlockingState]
92
+ @blocking_state = j_obj.blocking_state
93
+ @blocking_state = Killbill::Plugin::Model::BlockingState.new.to_ruby(@blocking_state) unless @blocking_state.nil?
94
+
95
+ # conversion for account_id [type = java.util.UUID]
96
+ @account_id = j_obj.account_id
97
+ @account_id = @account_id.nil? ? nil : @account_id.to_s
98
+
99
+ # conversion for external_key [type = java.lang.String]
100
+ @external_key = j_obj.external_key
101
+
102
+ # conversion for overdue_state [type = com.ning.billing.overdue.OverdueState]
103
+ @overdue_state = j_obj.overdue_state
104
+ @overdue_state = Killbill::Plugin::Model::OverdueState.new.to_ruby(@overdue_state) unless @overdue_state.nil?
105
+ self
23
106
  end
107
+
24
108
  end
25
109
  end
26
110
  end
@@ -0,0 +1,89 @@
1
+ ###################################################################################
2
+ # #
3
+ # Copyright 2010-2013 Ning, Inc. #
4
+ # #
5
+ # Ning licenses this file to you under the Apache License, version 2.0 #
6
+ # (the "License"); you may not use this file except in compliance with the #
7
+ # License. You may obtain a copy of the License at: #
8
+ # #
9
+ # http://www.apache.org/licenses/LICENSE-2.0 #
10
+ # #
11
+ # Unless required by applicable law or agreed to in writing, software #
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
14
+ # License for the specific language governing permissions and limitations #
15
+ # under the License. #
16
+ # #
17
+ ###################################################################################
18
+
19
+
20
+ #
21
+ # DO NOT EDIT!!!
22
+ # File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
23
+ #
24
+
25
+
26
+ module Killbill
27
+ module Plugin
28
+ module Model
29
+
30
+ java_package 'com.ning.billing.entitlement.api.user'
31
+ class SubscriptionStatusDryRun
32
+
33
+ include com.ning.billing.entitlement.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.entitlement.api.user.DryRunChangeReason]
57
+ @reason = Java::com.ning.billing.entitlement.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.entitlement.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
@@ -0,0 +1,196 @@
1
+ ###################################################################################
2
+ # #
3
+ # Copyright 2010-2013 Ning, Inc. #
4
+ # #
5
+ # Ning licenses this file to you under the Apache License, version 2.0 #
6
+ # (the "License"); you may not use this file except in compliance with the #
7
+ # License. You may obtain a copy of the License at: #
8
+ # #
9
+ # http://www.apache.org/licenses/LICENSE-2.0 #
10
+ # #
11
+ # Unless required by applicable law or agreed to in writing, software #
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
14
+ # License for the specific language governing permissions and limitations #
15
+ # under the License. #
16
+ # #
17
+ ###################################################################################
18
+
19
+
20
+ #
21
+ # DO NOT EDIT!!!
22
+ # File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
23
+ #
24
+
25
+
26
+ module Killbill
27
+ module Plugin
28
+ module Model
29
+
30
+ java_package 'com.ning.billing.entitlement.api.user'
31
+ class SubscriptionTransition
32
+
33
+ include com.ning.billing.entitlement.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.entitlement.api.user.SubscriptionState]
48
+ @previous_state = Java::com.ning.billing.entitlement.api.user.SubscriptionState.value_of("#{@previous_state.to_s}") unless @previous_state.nil?
49
+
50
+ # conversion for next_state [type = com.ning.billing.entitlement.api.user.SubscriptionState]
51
+ @next_state = Java::com.ning.billing.entitlement.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.entitlement.api.SubscriptionTransitionType]
102
+ @transition_type = Java::com.ning.billing.entitlement.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.entitlement.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.entitlement.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.entitlement.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,25 +1,104 @@
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.util.tag'
9
31
  class Tag
10
32
 
11
33
  include com.ning.billing.util.tag.Tag
12
34
 
13
- attr_reader :id, :created_date, :updated_date, :tag_definition_id, :object_type, :object_id
35
+ attr_accessor :id, :created_date, :updated_date, :tag_definition_id, :object_type, :object_id
36
+
37
+ def initialize()
38
+ end
39
+
40
+ def to_java()
41
+ # conversion for id [type = java.util.UUID]
42
+ @id = java.util.UUID.fromString(@id.to_s) unless @id.nil?
43
+
44
+ # conversion for created_date [type = org.joda.time.DateTime]
45
+ if !@created_date.nil?
46
+ @created_date = (@created_date.kind_of? Time) ? DateTime.parse(@created_date.to_s) : @created_date
47
+ @created_date = Java::org.joda.time.DateTime.new(@created_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
48
+ end
49
+
50
+ # conversion for updated_date [type = org.joda.time.DateTime]
51
+ if !@updated_date.nil?
52
+ @updated_date = (@updated_date.kind_of? Time) ? DateTime.parse(@updated_date.to_s) : @updated_date
53
+ @updated_date = Java::org.joda.time.DateTime.new(@updated_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
54
+ end
55
+
56
+ # conversion for tag_definition_id [type = java.util.UUID]
57
+ @tag_definition_id = java.util.UUID.fromString(@tag_definition_id.to_s) unless @tag_definition_id.nil?
14
58
 
15
- def initialize(id, created_date, updated_date, tag_definition_id, object_type, object_id)
16
- @id = id
17
- @created_date = created_date
18
- @updated_date = updated_date
19
- @tag_definition_id = tag_definition_id
20
- @object_type = object_type
21
- @object_id = object_id
59
+ # conversion for object_type [type = com.ning.billing.ObjectType]
60
+ @object_type = Java::com.ning.billing.ObjectType.value_of("#{@object_type.to_s}") unless @object_type.nil?
61
+
62
+ # conversion for object_id [type = java.util.UUID]
63
+ @object_id = java.util.UUID.fromString(@object_id.to_s) unless @object_id.nil?
64
+ self
22
65
  end
66
+
67
+ def to_ruby(j_obj)
68
+ # conversion for id [type = java.util.UUID]
69
+ @id = j_obj.id
70
+ @id = @id.nil? ? nil : @id.to_s
71
+
72
+ # conversion for created_date [type = org.joda.time.DateTime]
73
+ @created_date = j_obj.created_date
74
+ if !@created_date.nil?
75
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
76
+ str = fmt.print(@created_date)
77
+ @created_date = DateTime.iso8601(str)
78
+ end
79
+
80
+ # conversion for updated_date [type = org.joda.time.DateTime]
81
+ @updated_date = j_obj.updated_date
82
+ if !@updated_date.nil?
83
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
84
+ str = fmt.print(@updated_date)
85
+ @updated_date = DateTime.iso8601(str)
86
+ end
87
+
88
+ # conversion for tag_definition_id [type = java.util.UUID]
89
+ @tag_definition_id = j_obj.tag_definition_id
90
+ @tag_definition_id = @tag_definition_id.nil? ? nil : @tag_definition_id.to_s
91
+
92
+ # conversion for object_type [type = com.ning.billing.ObjectType]
93
+ @object_type = j_obj.object_type
94
+ @object_type = @object_type.to_s.to_sym unless @object_type.nil?
95
+
96
+ # conversion for object_id [type = java.util.UUID]
97
+ @object_id = j_obj.object_id
98
+ @object_id = @object_id.nil? ? nil : @object_id.to_s
99
+ self
100
+ end
101
+
23
102
  end
24
103
  end
25
104
  end