killbill-client 0.7.4 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +13 -5
  2. data/killbill_client.gemspec +1 -1
  3. data/lib/killbill_client/api/net_http_adapter.rb +35 -1
  4. data/lib/killbill_client/models/gen/account_attributes.rb +19 -18
  5. data/lib/killbill_client/models/gen/account_email_attributes.rb +19 -18
  6. data/lib/killbill_client/models/gen/account_timeline_attributes.rb +19 -18
  7. data/lib/killbill_client/models/gen/audit_log_attributes.rb +19 -18
  8. data/lib/killbill_client/models/gen/billing_exception_attributes.rb +19 -18
  9. data/lib/killbill_client/models/gen/bundle_attributes.rb +19 -18
  10. data/lib/killbill_client/models/gen/bundle_timeline_attributes.rb +19 -18
  11. data/lib/killbill_client/models/gen/catalog_attributes_simple.rb +19 -18
  12. data/lib/killbill_client/models/gen/credit_attributes.rb +19 -18
  13. data/lib/killbill_client/models/gen/custom_field_attributes.rb +19 -18
  14. data/lib/killbill_client/models/gen/deleted_event_subscription_attributes.rb +19 -18
  15. data/lib/killbill_client/models/gen/event_subscription_attributes.rb +19 -18
  16. data/lib/killbill_client/models/gen/gateway_notification_attributes.rb +19 -18
  17. data/lib/killbill_client/models/gen/hosted_payment_page_billing_address_attributes.rb +19 -18
  18. data/lib/killbill_client/models/gen/hosted_payment_page_customer_attributes.rb +19 -18
  19. data/lib/killbill_client/models/gen/hosted_payment_page_fields_attributes.rb +19 -18
  20. data/lib/killbill_client/models/gen/hosted_payment_page_form_descriptor_attributes.rb +19 -18
  21. data/lib/killbill_client/models/gen/invoice_attributes.rb +19 -18
  22. data/lib/killbill_client/models/gen/invoice_email_attributes.rb +19 -18
  23. data/lib/killbill_client/models/gen/invoice_item_attributes.rb +19 -18
  24. data/lib/killbill_client/models/gen/invoice_payment_attributes.rb +19 -18
  25. data/lib/killbill_client/models/gen/invoice_payment_transaction_attributes.rb +19 -18
  26. data/lib/killbill_client/models/gen/new_event_subscription_attributes.rb +19 -18
  27. data/lib/killbill_client/models/gen/notification_attributes.rb +19 -18
  28. data/lib/killbill_client/models/gen/overdue_state_attributes.rb +19 -18
  29. data/lib/killbill_client/models/gen/payment_attributes.rb +19 -18
  30. data/lib/killbill_client/models/gen/payment_method_attributes.rb +19 -18
  31. data/lib/killbill_client/models/gen/payment_method_plugin_detail_attributes.rb +19 -18
  32. data/lib/killbill_client/models/gen/payment_transaction_attributes.rb +19 -18
  33. data/lib/killbill_client/models/gen/phase_attributes.rb +19 -18
  34. data/lib/killbill_client/models/gen/plan_attributes.rb +19 -18
  35. data/lib/killbill_client/models/gen/plan_detail_attributes.rb +19 -18
  36. data/lib/killbill_client/models/gen/plugin_property_attributes.rb +19 -18
  37. data/lib/killbill_client/models/gen/price_attributes.rb +19 -18
  38. data/lib/killbill_client/models/gen/product_attributes.rb +19 -18
  39. data/lib/killbill_client/models/gen/{direct_payment_attributes.rb → profiling_data_attributes.rb} +21 -32
  40. data/lib/killbill_client/models/gen/profiling_data_attributes_item.rb +37 -0
  41. data/lib/killbill_client/models/gen/require_gen.rb +26 -19
  42. data/lib/killbill_client/models/gen/{usage_attributes.rb → rolled_up_unit_attributes.rb} +20 -22
  43. data/lib/killbill_client/models/gen/rolled_up_usage_attributes.rb +37 -0
  44. data/lib/killbill_client/models/gen/session_attributes.rb +19 -18
  45. data/lib/killbill_client/models/gen/stack_trace_element_attributes.rb +19 -18
  46. data/lib/killbill_client/models/gen/subject_attributes.rb +19 -18
  47. data/lib/killbill_client/models/gen/subscription_attributes.rb +19 -18
  48. data/lib/killbill_client/models/gen/subscription_usage_record_attributes.rb +35 -0
  49. data/lib/killbill_client/models/gen/tag_attributes.rb +19 -18
  50. data/lib/killbill_client/models/gen/tag_definition_attributes.rb +19 -18
  51. data/lib/killbill_client/models/gen/tenant_attributes.rb +19 -18
  52. data/lib/killbill_client/models/gen/tenant_key_attributes.rb +19 -18
  53. data/lib/killbill_client/models/gen/unit_usage_record_attributes.rb +35 -0
  54. data/lib/killbill_client/models/gen/{direct_transaction_attributes.rb → usage_record_attributes.rb} +21 -33
  55. data/lib/killbill_client/models/models.rb +2 -1
  56. data/lib/killbill_client/models/resource.rb +1 -0
  57. data/lib/killbill_client/models/rolled_up_usage.rb +30 -0
  58. data/lib/killbill_client/models/{usage.rb → usage_record.rb} +9 -5
  59. data/lib/killbill_client/version.rb +2 -2
  60. data/spec/killbill_client/remote/model_spec.rb +1 -1
  61. metadata +25 -20
@@ -0,0 +1,30 @@
1
+ module KillBillClient
2
+ module Model
3
+ class RolledUpUsage < RolledUpUsageAttributes
4
+
5
+ has_many :audit_logs, KillBillClient::Model::AuditLog
6
+ has_many :rolled_up_units, KillBillClient::Model::RolledUpUnitAttributes
7
+
8
+ KILLBILL_API_USAGES_PREFIX = "#{KILLBILL_API_PREFIX}/usages"
9
+
10
+ class << self
11
+ def find_by_subscription_id(subscription_id, start_date, end_date, options = {})
12
+ find_by_subscription_id_and_type(subscription_id, start_date, end_date, nil, options)
13
+ end
14
+
15
+ def find_by_subscription_id_and_type(subscription_id, start_date, end_date, unit_type, options = {})
16
+ params = {}
17
+ params[:startDate] = start_date
18
+ params[:endDate] = end_date
19
+
20
+ path = "#{KILLBILL_API_USAGES_PREFIX}/#{subscription_id}"
21
+ path = "#{path}/#{unit_type}" if unit_type
22
+ get path,
23
+ params,
24
+ options
25
+ end
26
+ end
27
+
28
+ end
29
+ end
30
+ end
@@ -1,6 +1,6 @@
1
1
  module KillBillClient
2
2
  module Model
3
- class Usage < UsageAttributes
3
+ class UsageRecord < SubscriptionUsageRecordAttributes
4
4
 
5
5
  has_many :audit_logs, KillBillClient::Model::AuditLog
6
6
 
@@ -8,11 +8,15 @@ module KillBillClient
8
8
  KILLBILL_API_USAGES_PREFIX = "#{KILLBILL_API_PREFIX}/usages"
9
9
 
10
10
  class << self
11
- def find_by_subscription_id(subscription_id, options = {})
11
+ def find_by_subscription_id(subscription_id, start_date, end_date, options = {})
12
+ params = {}
13
+ params[:startDate] = start_date
14
+ params[:endDate] = end_date
15
+
12
16
  get "#{KILLBILL_API_USAGES_PREFIX}/#{subscription_id}",
13
- {
14
- },
15
- options
17
+ params,
18
+ options,
19
+ KillBillClient::Model::RolledUpUsageAttributes.new.class
16
20
  end
17
21
  end
18
22
 
@@ -1,8 +1,8 @@
1
1
  module KillBillClient
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 7
5
- PATCH = 4
4
+ MINOR = 8
5
+ PATCH = 0
6
6
  PRE = nil
7
7
 
8
8
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join('.').freeze
@@ -98,7 +98,7 @@ describe KillBillClient::Model do
98
98
  pm.plugin_info = {}
99
99
  pm.payment_method_id.should be_nil
100
100
 
101
- pm = pm.create('KillBill Spec test')
101
+ pm = pm.create(true, 'KillBill Spec test')
102
102
  pm.payment_method_id.should_not be_nil
103
103
 
104
104
  # Try to retrieve it
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Killbill core team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-06 00:00:00.000000000 Z
11
+ date: 2014-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.8.0
19
+ version: 1.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ! '>='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.8.0
26
+ version: 1.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: 10.0.0
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: 10.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: 2.12.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.12.0
55
55
  description: An API client library for Kill Bill.
@@ -58,8 +58,8 @@ executables: []
58
58
  extensions: []
59
59
  extra_rdoc_files: []
60
60
  files:
61
- - ".gitignore"
62
- - ".travis.yml"
61
+ - .gitignore
62
+ - .travis.yml
63
63
  - Gemfile
64
64
  - README.md
65
65
  - Rakefile
@@ -88,8 +88,6 @@ files:
88
88
  - lib/killbill_client/models/gen/credit_attributes.rb
89
89
  - lib/killbill_client/models/gen/custom_field_attributes.rb
90
90
  - lib/killbill_client/models/gen/deleted_event_subscription_attributes.rb
91
- - lib/killbill_client/models/gen/direct_payment_attributes.rb
92
- - lib/killbill_client/models/gen/direct_transaction_attributes.rb
93
91
  - lib/killbill_client/models/gen/event_subscription_attributes.rb
94
92
  - lib/killbill_client/models/gen/gateway_notification_attributes.rb
95
93
  - lib/killbill_client/models/gen/hosted_payment_page_billing_address_attributes.rb
@@ -114,16 +112,22 @@ files:
114
112
  - lib/killbill_client/models/gen/plugin_property_attributes.rb
115
113
  - lib/killbill_client/models/gen/price_attributes.rb
116
114
  - lib/killbill_client/models/gen/product_attributes.rb
115
+ - lib/killbill_client/models/gen/profiling_data_attributes.rb
116
+ - lib/killbill_client/models/gen/profiling_data_attributes_item.rb
117
117
  - lib/killbill_client/models/gen/require_gen.rb
118
+ - lib/killbill_client/models/gen/rolled_up_unit_attributes.rb
119
+ - lib/killbill_client/models/gen/rolled_up_usage_attributes.rb
118
120
  - lib/killbill_client/models/gen/session_attributes.rb
119
121
  - lib/killbill_client/models/gen/stack_trace_element_attributes.rb
120
122
  - lib/killbill_client/models/gen/subject_attributes.rb
121
123
  - lib/killbill_client/models/gen/subscription_attributes.rb
124
+ - lib/killbill_client/models/gen/subscription_usage_record_attributes.rb
122
125
  - lib/killbill_client/models/gen/tag_attributes.rb
123
126
  - lib/killbill_client/models/gen/tag_definition_attributes.rb
124
127
  - lib/killbill_client/models/gen/tenant_attributes.rb
125
128
  - lib/killbill_client/models/gen/tenant_key_attributes.rb
126
- - lib/killbill_client/models/gen/usage_attributes.rb
129
+ - lib/killbill_client/models/gen/unit_usage_record_attributes.rb
130
+ - lib/killbill_client/models/gen/usage_record_attributes.rb
127
131
  - lib/killbill_client/models/helpers/custom_field_helper.rb
128
132
  - lib/killbill_client/models/helpers/tag_helper.rb
129
133
  - lib/killbill_client/models/invoice.rb
@@ -138,13 +142,14 @@ files:
138
142
  - lib/killbill_client/models/product.rb
139
143
  - lib/killbill_client/models/resource.rb
140
144
  - lib/killbill_client/models/resources.rb
145
+ - lib/killbill_client/models/rolled_up_usage.rb
141
146
  - lib/killbill_client/models/security.rb
142
147
  - lib/killbill_client/models/subscription.rb
143
148
  - lib/killbill_client/models/tag.rb
144
149
  - lib/killbill_client/models/tag_definition.rb
145
150
  - lib/killbill_client/models/tenant.rb
146
151
  - lib/killbill_client/models/transaction.rb
147
- - lib/killbill_client/models/usage.rb
152
+ - lib/killbill_client/models/usage_record.rb
148
153
  - lib/killbill_client/utils.rb
149
154
  - lib/killbill_client/version.rb
150
155
  - lib/rails/generators/killbill_client/config_generator.rb
@@ -161,18 +166,18 @@ licenses:
161
166
  metadata: {}
162
167
  post_install_message:
163
168
  rdoc_options:
164
- - "--exclude"
165
- - "."
169
+ - --exclude
170
+ - .
166
171
  require_paths:
167
172
  - lib
168
173
  required_ruby_version: !ruby/object:Gem::Requirement
169
174
  requirements:
170
- - - ">="
175
+ - - ! '>='
171
176
  - !ruby/object:Gem::Version
172
177
  version: 1.8.6
173
178
  required_rubygems_version: !ruby/object:Gem::Requirement
174
179
  requirements:
175
- - - ">="
180
+ - - ! '>='
176
181
  - !ruby/object:Gem::Version
177
182
  version: '0'
178
183
  requirements: []