killbill-client 2.2.3 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +12 -12
  3. data/lib/killbill_client/models/account.rb +44 -42
  4. data/lib/killbill_client/models/bulk_subscription.rb +1 -1
  5. data/lib/killbill_client/models/bundle.rb +18 -6
  6. data/lib/killbill_client/models/catalog.rb +77 -8
  7. data/lib/killbill_client/models/export.rb +1 -1
  8. data/lib/killbill_client/models/gen/blocking_state_attributes.rb +3 -3
  9. data/lib/killbill_client/models/gen/credit_attributes.rb +1 -0
  10. data/lib/killbill_client/models/gen/invoice_item_attributes.rb +2 -0
  11. data/lib/killbill_client/models/gen/node_command_attributes.rb +1 -1
  12. data/lib/killbill_client/models/gen/overdue_state_attributes.rb +3 -3
  13. data/lib/killbill_client/models/gen/overdue_state_config_attributes.rb +2 -2
  14. data/lib/killbill_client/models/gen/require_gen.rb +53 -54
  15. data/lib/killbill_client/models/gen/stack_trace_element_attributes.rb +1 -1
  16. data/lib/killbill_client/models/gen/{tenant_key_attributes.rb → tenant_key_value_attributes.rb} +1 -1
  17. data/lib/killbill_client/models/helpers/custom_field_helper.rb +21 -0
  18. data/lib/killbill_client/models/helpers/tag_helper.rb +2 -4
  19. data/lib/killbill_client/models/invoice.rb +63 -61
  20. data/lib/killbill_client/models/invoice_item.rb +1 -3
  21. data/lib/killbill_client/models/invoice_payment.rb +18 -3
  22. data/lib/killbill_client/models/nodes_info.rb +1 -1
  23. data/lib/killbill_client/models/overdue.rb +33 -13
  24. data/lib/killbill_client/models/payment_method.rb +1 -1
  25. data/lib/killbill_client/models/resource.rb +3 -1
  26. data/lib/killbill_client/models/subscription.rb +19 -17
  27. data/lib/killbill_client/models/tenant.rb +2 -2
  28. data/lib/killbill_client/models/transaction.rb +2 -0
  29. data/lib/killbill_client/version.rb +2 -2
  30. data/spec/killbill_client/remote/api_spec.rb +1 -1
  31. data/spec/killbill_client/remote/model_spec.rb +6 -6
  32. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '090e46016d6dc90be768bc6a3cbfea49b915371b'
4
- data.tar.gz: c46832276e369c9e98a178998ba293805c7734bc
3
+ metadata.gz: 83130edfd69e4755b2870008a499dffbf8018514
4
+ data.tar.gz: adc1f2acc20d39b5b360209ffc71141fe0863af9
5
5
  SHA512:
6
- metadata.gz: ac458f17fa4d8a794aa63ea8cbfc0e462c4d897b18d013dc2dbbfc871f2c427ef05fb1dd15fce976dfa481fe404418cff27cdcd0d878f7a1bc7c945266b16e0f
7
- data.tar.gz: a88991d5d604182320d92f5440728cfa2690094785c8759e5fbf0fd6fd182f9fe1d9e94493a0467cef1f37d94f76a7f042c4c6eb10021c922fd669ac8ca15eed
6
+ metadata.gz: c90240811ecbbc19b9ef1e390e2005d7fb2826d035490107d9f2d84335df929ed1d8451704169149dd1a21eccad2afb7c307294ed0b2ec6d76f980c833b59eb8
7
+ data.tar.gz: d71174faf6cb5493963550de3dd2dde1542e74a6bc53b85282242a02d14c5cdf61f546c52d163d72ec831fb31049a43dfea586e844c2f3050b13b191b3b0df3a
@@ -8,7 +8,7 @@ jobs:
8
8
  build-jruby-1.7.26:
9
9
  <<: *defaults
10
10
  docker:
11
- - image: killbill/kbbuild:0.4.0
11
+ - image: killbill/kbbuild:0.5.0
12
12
  steps:
13
13
  - checkout
14
14
  - restore_cache:
@@ -27,8 +27,8 @@ jobs:
27
27
  test-mysql-jruby-1.7.26:
28
28
  <<: *defaults
29
29
  docker:
30
- - image: killbill/kbbuild:0.4.0
31
- - image: killbill/killbill:0.19.6
30
+ - image: killbill/kbbuild:0.5.0
31
+ - image: killbill/killbill:0.19.16
32
32
  - image: killbill/mariadb:0.19
33
33
  environment:
34
34
  - MYSQL_ROOT_PASSWORD=root
@@ -88,7 +88,7 @@ jobs:
88
88
  build-ruby-2.2.2:
89
89
  <<: *defaults
90
90
  docker:
91
- - image: killbill/kbbuild:0.4.0
91
+ - image: killbill/kbbuild:0.5.0
92
92
  steps:
93
93
  - checkout
94
94
  - restore_cache:
@@ -109,8 +109,8 @@ jobs:
109
109
  test-mysql-ruby-2.2.2:
110
110
  <<: *defaults
111
111
  docker:
112
- - image: killbill/kbbuild:0.4.0
113
- - image: killbill/killbill:0.19.6
112
+ - image: killbill/kbbuild:0.5.0
113
+ - image: killbill/killbill:0.19.16
114
114
  - image: killbill/mariadb:0.19
115
115
  environment:
116
116
  - MYSQL_ROOT_PASSWORD=root
@@ -172,7 +172,7 @@ jobs:
172
172
  build-ruby-2.4.2:
173
173
  <<: *defaults
174
174
  docker:
175
- - image: killbill/kbbuild:0.4.0
175
+ - image: killbill/kbbuild:0.5.0
176
176
  steps:
177
177
  - checkout
178
178
  - restore_cache:
@@ -193,8 +193,8 @@ jobs:
193
193
  test-mysql-ruby-2.4.2:
194
194
  <<: *defaults
195
195
  docker:
196
- - image: killbill/kbbuild:0.4.0
197
- - image: killbill/killbill:0.19.6
196
+ - image: killbill/kbbuild:0.5.0
197
+ - image: killbill/killbill:0.19.16
198
198
  - image: killbill/mariadb:0.19
199
199
  environment:
200
200
  - MYSQL_ROOT_PASSWORD=root
@@ -256,7 +256,7 @@ jobs:
256
256
  build-jruby-9.1.14.0:
257
257
  <<: *defaults
258
258
  docker:
259
- - image: killbill/kbbuild:0.4.0
259
+ - image: killbill/kbbuild:0.5.0
260
260
  steps:
261
261
  - checkout
262
262
  - restore_cache:
@@ -277,8 +277,8 @@ jobs:
277
277
  test-mysql-jruby-9.1.14.0:
278
278
  <<: *defaults
279
279
  docker:
280
- - image: killbill/kbbuild:0.4.0
281
- - image: killbill/killbill:0.19.6
280
+ - image: killbill/kbbuild:0.5.0
281
+ - image: killbill/killbill:0.19.16
282
282
  - image: killbill/mariadb:0.19
283
283
  environment:
284
284
  - MYSQL_ROOT_PASSWORD=root
@@ -63,7 +63,7 @@ module KillBillClient
63
63
  :accountWithBalance => with_balance,
64
64
  :accountWithBalanceAndCBA => with_balance_and_cba
65
65
  },
66
- options
66
+ options
67
67
  end
68
68
  end
69
69
 
@@ -84,45 +84,47 @@ module KillBillClient
84
84
  params = {}
85
85
  params[:treatNullAsReset] = treat_null_as_reset
86
86
 
87
- updated_account = self.class.put "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}",
88
- to_json,
89
- params,
90
- {
91
- :user => user,
92
- :reason => reason,
93
- :comment => comment,
94
- }.merge(options)
95
- updated_account.refresh(options)
87
+ self.class.put "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}",
88
+ to_json,
89
+ params,
90
+ {
91
+ :user => user,
92
+ :reason => reason,
93
+ :comment => comment,
94
+ }.merge(options)
95
+
96
+ self.class.find_by_id(account_id, nil, nil, options)
97
+
96
98
  end
97
99
 
98
100
 
99
101
  def close(cancel_subscriptions, writeoff_unpaid_invoices, item_adjust_unpaid_invoices, user = nil, reason = nil, comment = nil, options = {})
100
102
  created_account = self.class.delete "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}",
101
- {},
102
- {
103
- :cancelAllSubscriptions => cancel_subscriptions,
104
- :writeOffUnpaidInvoices => writeoff_unpaid_invoices,
105
- :itemAdjustUnpaidInvoices => item_adjust_unpaid_invoices
106
- },
107
- {
108
- :user => user,
109
- :reason => reason,
110
- :comment => comment,
111
- }.merge(options)
103
+ {},
104
+ {
105
+ :cancelAllSubscriptions => cancel_subscriptions,
106
+ :writeOffUnpaidInvoices => writeoff_unpaid_invoices,
107
+ :itemAdjustUnpaidInvoices => item_adjust_unpaid_invoices
108
+ },
109
+ {
110
+ :user => user,
111
+ :reason => reason,
112
+ :comment => comment,
113
+ }.merge(options)
112
114
  created_account.refresh(options)
113
115
  end
114
116
 
115
117
 
116
118
 
117
119
  def transfer_child_credit(user = nil, reason = nil, comment = nil, options = {})
118
- self.class.post "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/transferCredit",
119
- {},
120
- {},
121
- {
122
- :user => user,
123
- :reason => reason,
124
- :comment => comment,
125
- }.merge(options)
120
+ self.class.put "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/transferCredit",
121
+ {},
122
+ {},
123
+ {
124
+ :user => user,
125
+ :reason => reason,
126
+ :comment => comment,
127
+ }.merge(options)
126
128
  end
127
129
 
128
130
 
@@ -336,7 +338,7 @@ module KillBillClient
336
338
 
337
339
  end
338
340
 
339
- def set_blocking_state(state_name, service, block_change, block_entitlement, block_billing, requested_date = nil, user = nil, reason = nil, comment = nil, options = {})
341
+ def set_blocking_state(state_name, service, is_block_change, is_block_entitlement, is_block_billing, requested_date = nil, user = nil, reason = nil, comment = nil, options = {})
340
342
 
341
343
  params = {}
342
344
  params[:requestedDate] = requested_date if requested_date
@@ -344,23 +346,23 @@ module KillBillClient
344
346
  body = KillBillClient::Model::BlockingStateAttributes.new
345
347
  body.state_name = state_name
346
348
  body.service = service
347
- body.block_change = block_change
348
- body.block_entitlement = block_entitlement
349
- body.block_billing = block_billing
349
+ body.is_block_change = is_block_change
350
+ body.is_block_entitlement = is_block_entitlement
351
+ body.is_block_billing = is_block_billing
350
352
 
351
- self.class.put "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/block",
352
- body.to_json,
353
- params,
354
- {
355
- :user => user,
356
- :reason => reason,
357
- :comment => comment,
358
- }.merge(options)
353
+ self.class.post "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/block",
354
+ body.to_json,
355
+ params,
356
+ {
357
+ :user => user,
358
+ :reason => reason,
359
+ :comment => comment,
360
+ }.merge(options)
359
361
  blocking_states(nil, nil, 'NONE', options)
360
362
  end
361
363
 
362
364
  def cba_rebalancing(user = nil, reason = nil, comment = nil, options = {})
363
- self.class.post "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/cbaRebalancing",
365
+ self.class.put "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/cbaRebalancing",
364
366
  {},
365
367
  {},
366
368
  {
@@ -4,7 +4,7 @@ module KillBillClient
4
4
 
5
5
  include KillBillClient::Model::CustomFieldHelper
6
6
 
7
- KILLBILL_API_BULK_ENTITLEMENT_PREFIX = "#{KILLBILL_API_PREFIX}/subscriptions/createEntitlementsWithAddOns"
7
+ KILLBILL_API_BULK_ENTITLEMENT_PREFIX = "#{KILLBILL_API_PREFIX}/subscriptions/createSubscriptionsWithAddOns"
8
8
 
9
9
  has_many :base_entitlement_and_add_ons, KillBillClient::Model::SubscriptionAttributes
10
10
 
@@ -65,7 +65,7 @@ module KillBillClient
65
65
  params[:requestedDate] = requested_date unless requested_date.nil?
66
66
  params[:billingPolicy] = billing_policy unless billing_policy.nil?
67
67
 
68
- result = self.class.put "#{KILLBILL_API_BUNDLES_PREFIX}/#{bundle_id}",
68
+ result = self.class.post "#{KILLBILL_API_BUNDLES_PREFIX}/#{bundle_id}",
69
69
  to_json,
70
70
  params,
71
71
  {
@@ -110,7 +110,7 @@ module KillBillClient
110
110
 
111
111
 
112
112
  # Low level api to block/unblock a given subscription/bundle/account
113
- def set_blocking_state(state_name, service, block_change, block_entitlement, block_billing, requested_date = nil, user = nil, reason = nil, comment = nil, options = {})
113
+ def set_blocking_state(state_name, service, is_block_change, is_block_entitlement, is_block_billing, requested_date = nil, user = nil, reason = nil, comment = nil, options = {})
114
114
 
115
115
  params = {}
116
116
  params[:requestedDate] = requested_date unless requested_date.nil?
@@ -118,11 +118,11 @@ module KillBillClient
118
118
  body = KillBillClient::Model::BlockingStateAttributes.new
119
119
  body.state_name = state_name
120
120
  body.service = service
121
- body.block_change = block_change
122
- body.block_entitlement = block_entitlement
123
- body.block_billing = block_billing
121
+ body.is_block_change = is_block_change
122
+ body.is_block_entitlement = is_block_entitlement
123
+ body.is_block_billing = is_block_billing
124
124
 
125
- self.class.put "#{KILLBILL_API_BUNDLES_PREFIX}/#{@bundle_id}/block",
125
+ self.class.post "#{KILLBILL_API_BUNDLES_PREFIX}/#{@bundle_id}/block",
126
126
  body.to_json,
127
127
  params,
128
128
  {
@@ -132,6 +132,18 @@ module KillBillClient
132
132
  }.merge(options)
133
133
  end
134
134
 
135
+ def rename_external_key(user = nil, reason = nil, comment = nil, options = {})
136
+
137
+ self.class.put "#{KILLBILL_API_BUNDLES_PREFIX}/#{@bundle_id}/renameKey",
138
+ to_json,
139
+ {},
140
+ {
141
+ :user => user,
142
+ :reason => reason,
143
+ :comment => comment,
144
+ }.merge(options)
145
+ end
146
+
135
147
  end
136
148
  end
137
149
  end
@@ -38,39 +38,108 @@ module KillBillClient
38
38
  options
39
39
  end
40
40
 
41
- def get_tenant_catalog(format, requested_date=nil, options = {})
41
+ def get_tenant_catalog_xml(requested_date = nil, options = {})
42
42
 
43
43
  require_multi_tenant_options!(options, "Retrieving a catalog is only supported in multi-tenant mode")
44
44
 
45
45
  params = {}
46
46
  params[:requestedDate] = requested_date if requested_date
47
47
 
48
- get KILLBILL_API_CATALOG_PREFIX,
48
+ get "#{KILLBILL_API_CATALOG_PREFIX}/xml",
49
49
  params,
50
50
  {
51
- :head => {'Accept' => "application/#{format}"},
52
- :content_type => "application/#{format}",
51
+ :head => {'Accept' => "text/xml"},
52
+ :content_type => "text/xml",
53
53
 
54
54
  }.merge(options)
55
55
 
56
56
  end
57
57
 
58
+ def get_tenant_catalog_json(requested_date = nil, options = {})
59
+
60
+ require_multi_tenant_options!(options, "Retrieving a catalog is only supported in multi-tenant mode")
61
+
62
+ params = {}
63
+ params[:requestedDate] = requested_date if requested_date
64
+
65
+ get KILLBILL_API_CATALOG_PREFIX,
66
+ params,
67
+ {
68
+ :head => {'Accept' => "application/json"},
69
+ :content_type => "application/json",
70
+
71
+ }.merge(options)
72
+
73
+ end
74
+
75
+ def get_catalog_phase(subscription_id, requested_date, options = {})
76
+
77
+ require_multi_tenant_options!(options, "Retrieving catalog phase is only supported in multi-tenant mode")
78
+
79
+ params = {}
80
+ params[:subscriptionId] = subscription_id if subscription_id
81
+ params[:requestedDate] = requested_date if requested_date
82
+
83
+ get "#{KILLBILL_API_CATALOG_PREFIX}/phase",
84
+ params,
85
+ options
86
+ end
87
+
88
+ def get_catalog_plan(subscription_id, requested_date, options = {})
89
+
90
+ require_multi_tenant_options!(options, "Retrieving catalog plan is only supported in multi-tenant mode")
91
+
92
+ params = {}
93
+ params[:subscriptionId] = subscription_id if subscription_id
94
+ params[:requestedDate] = requested_date if requested_date
95
+
96
+ get "#{KILLBILL_API_CATALOG_PREFIX}/plan",
97
+ params,
98
+ options
99
+ end
100
+
101
+ def get_catalog_price_list(subscription_id, requested_date, options = {})
102
+
103
+ require_multi_tenant_options!(options, "Retrieving catalog price list is only supported in multi-tenant mode")
104
+
105
+ params = {}
106
+ params[:subscriptionId] = subscription_id if subscription_id
107
+ params[:requestedDate] = requested_date if requested_date
108
+
109
+ get "#{KILLBILL_API_CATALOG_PREFIX}/priceList",
110
+ params,
111
+ options
112
+ end
113
+
114
+ def get_catalog_product(subscription_id, requested_date, options = {})
115
+
116
+ require_multi_tenant_options!(options, "Retrieving catalog product list is only supported in multi-tenant mode")
117
+
118
+ params = {}
119
+ params[:subscriptionId] = subscription_id if subscription_id
120
+ params[:requestedDate] = requested_date if requested_date
121
+
122
+ get "#{KILLBILL_API_CATALOG_PREFIX}/product",
123
+ params,
124
+ options
125
+ end
126
+
58
127
  def upload_tenant_catalog(catalog_xml, user = nil, reason = nil, comment = nil, options = {})
59
128
 
60
129
  require_multi_tenant_options!(options, "Uploading a catalog is only supported in multi-tenant mode")
61
130
 
62
- post KILLBILL_API_CATALOG_PREFIX,
131
+ post "#{KILLBILL_API_CATALOG_PREFIX}/xml",
63
132
  catalog_xml,
64
133
  {
65
134
  },
66
135
  {
67
- :head => {'Accept' => 'application/xml'},
68
- :content_type => 'application/xml',
136
+ :head => {'Accept' => 'application/json'},
137
+ :content_type => 'text/xml',
69
138
  :user => user,
70
139
  :reason => reason,
71
140
  :comment => comment,
72
141
  }.merge(options)
73
- get_tenant_catalog('xml', nil, options)
142
+ get_tenant_catalog_json(nil, options)
74
143
  end
75
144
 
76
145
 
@@ -11,7 +11,7 @@ module KillBillClient
11
11
  get "#{KILLBILL_API_EXPORT_PREFIX}/#{account_id}",
12
12
  {},
13
13
  {
14
- :accept => 'text/plain',
14
+ :accept => 'application/octet-stream',
15
15
  :user => user,
16
16
  :reason => reason,
17
17
  :comment => comment
@@ -31,9 +31,9 @@ module KillBillClient
31
31
  attribute :blocked_id
32
32
  attribute :state_name
33
33
  attribute :service
34
- attribute :block_change
35
- attribute :block_entitlement
36
- attribute :block_billing
34
+ attribute :is_block_change
35
+ attribute :is_block_entitlement
36
+ attribute :is_block_billing
37
37
  attribute :effective_date
38
38
  attribute :type
39
39
  attribute :audit_logs
@@ -28,6 +28,7 @@
28
28
  module KillBillClient
29
29
  module Model
30
30
  class CreditAttributes < Resource
31
+ attribute :credit_id
31
32
  attribute :credit_amount
32
33
  attribute :currency
33
34
  attribute :invoice_id
@@ -35,9 +35,11 @@ module KillBillClient
35
35
  attribute :child_account_id
36
36
  attribute :bundle_id
37
37
  attribute :subscription_id
38
+ attribute :product_name
38
39
  attribute :plan_name
39
40
  attribute :phase_name
40
41
  attribute :usage_name
42
+ attribute :pretty_product_name
41
43
  attribute :pretty_plan_name
42
44
  attribute :pretty_phase_name
43
45
  attribute :pretty_usage_name
@@ -28,7 +28,7 @@
28
28
  module KillBillClient
29
29
  module Model
30
30
  class NodeCommandAttributes < Resource
31
- attribute :system_command_type
31
+ attribute :is_system_command_type
32
32
  attribute :node_command_type
33
33
  attribute :node_command_properties
34
34
  end