ynab 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +2 -2
  4. data/Rakefile +9 -0
  5. data/config.json +2 -2
  6. data/docs/Account.md +1 -1
  7. data/docs/AccountResponse.md +1 -1
  8. data/docs/AccountWrapper.md +1 -1
  9. data/docs/AccountsApi.md +1 -1
  10. data/docs/AccountsResponse.md +1 -1
  11. data/docs/AccountsWrapper.md +1 -1
  12. data/docs/BudgetDetail.md +1 -1
  13. data/docs/BudgetDetailResponse.md +1 -1
  14. data/docs/BudgetDetailWrapper.md +1 -1
  15. data/docs/BudgetSettings.md +9 -0
  16. data/docs/BudgetSettingsResponse.md +8 -0
  17. data/docs/BudgetSettingsWrapper.md +8 -0
  18. data/docs/BudgetSummary.md +1 -1
  19. data/docs/BudgetSummaryResponse.md +1 -1
  20. data/docs/BudgetSummaryWrapper.md +1 -1
  21. data/docs/BudgetsApi.md +19 -1
  22. data/docs/BulkIdWrapper.md +1 -1
  23. data/docs/BulkIds.md +1 -1
  24. data/docs/BulkResponse.md +1 -1
  25. data/docs/BulkTransactionCreateResponse.md +2 -2
  26. data/docs/BulkTransactionIds.md +2 -2
  27. data/docs/BulkTransactions.md +1 -1
  28. data/docs/CategoriesApi.md +1 -1
  29. data/docs/CategoriesResponse.md +1 -1
  30. data/docs/Category.md +2 -1
  31. data/docs/CategoryGroup.md +1 -1
  32. data/docs/CategoryGroupWithCategories.md +1 -1
  33. data/docs/CategoryGroupsWrapper.md +1 -1
  34. data/docs/CategoryResponse.md +1 -1
  35. data/docs/CategoryWrapper.md +1 -1
  36. data/docs/CurrencyFormat.md +1 -1
  37. data/docs/DateFormat.md +1 -1
  38. data/docs/ErrorDetail.md +1 -1
  39. data/docs/ErrorResponse.md +1 -1
  40. data/docs/HybridTransaction.md +1 -1
  41. data/docs/HybridTransactionsResponse.md +1 -1
  42. data/docs/HybridTransactionsWrapper.md +1 -1
  43. data/docs/MonthDetail.md +1 -1
  44. data/docs/MonthDetailResponse.md +1 -1
  45. data/docs/MonthDetailWrapper.md +1 -1
  46. data/docs/MonthSummariesResponse.md +1 -1
  47. data/docs/MonthSummariesWrapper.md +1 -1
  48. data/docs/MonthSummary.md +1 -1
  49. data/docs/MonthsApi.md +1 -1
  50. data/docs/Payee.md +1 -1
  51. data/docs/PayeeLocation.md +1 -1
  52. data/docs/PayeeLocationResponse.md +1 -1
  53. data/docs/PayeeLocationWrapper.md +1 -1
  54. data/docs/PayeeLocationsApi.md +1 -1
  55. data/docs/PayeeLocationsResponse.md +1 -1
  56. data/docs/PayeeLocationsWrapper.md +1 -1
  57. data/docs/PayeeResponse.md +1 -1
  58. data/docs/PayeeWrapper.md +1 -1
  59. data/docs/PayeesApi.md +1 -1
  60. data/docs/PayeesResponse.md +1 -1
  61. data/docs/PayeesWrapper.md +1 -1
  62. data/docs/SaveTransaction.md +2 -2
  63. data/docs/SaveTransactionWrapper.md +1 -1
  64. data/docs/ScheduledSubTransaction.md +1 -1
  65. data/docs/ScheduledTransactionDetail.md +1 -1
  66. data/docs/ScheduledTransactionResponse.md +1 -1
  67. data/docs/ScheduledTransactionSummary.md +1 -1
  68. data/docs/ScheduledTransactionWrapper.md +1 -1
  69. data/docs/ScheduledTransactionsApi.md +1 -1
  70. data/docs/ScheduledTransactionsResponse.md +1 -1
  71. data/docs/ScheduledTransactionsWrapper.md +1 -1
  72. data/docs/SubTransaction.md +1 -1
  73. data/docs/TransactionDetail.md +1 -1
  74. data/docs/TransactionResponse.md +1 -1
  75. data/docs/TransactionSummary.md +1 -1
  76. data/docs/TransactionWrapper.md +1 -1
  77. data/docs/TransactionsApi.md +5 -2
  78. data/docs/TransactionsResponse.md +1 -1
  79. data/docs/TransactionsWrapper.md +1 -1
  80. data/docs/User.md +1 -1
  81. data/docs/UserApi.md +1 -1
  82. data/docs/UserResponse.md +1 -1
  83. data/docs/UserWrapper.md +1 -1
  84. data/examples/budget-list.rb +1 -1
  85. data/examples/budget-month.rb +1 -1
  86. data/examples/category-balance.rb +1 -1
  87. data/lib/ynab.rb +27 -15
  88. data/lib/ynab/api/accounts_api.rb +1 -1
  89. data/lib/ynab/api/budgets_api.rb +53 -1
  90. data/lib/ynab/api/categories_api.rb +1 -1
  91. data/lib/ynab/api/months_api.rb +1 -1
  92. data/lib/ynab/api/payee_locations_api.rb +1 -1
  93. data/lib/ynab/api/payees_api.rb +1 -1
  94. data/lib/ynab/api/scheduled_transactions_api.rb +1 -1
  95. data/lib/ynab/api/transactions_api.rb +21 -3
  96. data/lib/ynab/api/user_api.rb +1 -1
  97. data/lib/ynab/api_client.rb +2 -2
  98. data/lib/ynab/api_error.rb +1 -1
  99. data/lib/ynab/configuration.rb +1 -1
  100. data/lib/ynab/models/account.rb +2 -2
  101. data/lib/ynab/models/account_response.rb +2 -2
  102. data/lib/ynab/models/account_wrapper.rb +2 -2
  103. data/lib/ynab/models/accounts_response.rb +2 -2
  104. data/lib/ynab/models/accounts_wrapper.rb +2 -2
  105. data/lib/ynab/models/budget_detail.rb +2 -2
  106. data/lib/ynab/models/budget_detail_response.rb +2 -2
  107. data/lib/ynab/models/budget_detail_wrapper.rb +2 -2
  108. data/lib/ynab/models/budget_settings.rb +202 -0
  109. data/lib/ynab/models/budget_settings_response.rb +188 -0
  110. data/lib/ynab/models/budget_settings_wrapper.rb +188 -0
  111. data/lib/ynab/models/budget_summary.rb +2 -2
  112. data/lib/ynab/models/budget_summary_response.rb +2 -2
  113. data/lib/ynab/models/budget_summary_wrapper.rb +2 -2
  114. data/lib/ynab/models/bulk_id_wrapper.rb +2 -2
  115. data/lib/ynab/models/bulk_ids.rb +2 -2
  116. data/lib/ynab/models/bulk_response.rb +2 -2
  117. data/lib/ynab/models/bulk_transaction_create_response.rb +2 -2
  118. data/lib/ynab/models/bulk_transaction_ids.rb +2 -2
  119. data/lib/ynab/models/bulk_transactions.rb +2 -2
  120. data/lib/ynab/models/categories_response.rb +2 -2
  121. data/lib/ynab/models/category.rb +13 -3
  122. data/lib/ynab/models/category_group.rb +2 -2
  123. data/lib/ynab/models/category_group_with_categories.rb +2 -2
  124. data/lib/ynab/models/category_groups_wrapper.rb +2 -2
  125. data/lib/ynab/models/category_response.rb +2 -2
  126. data/lib/ynab/models/category_wrapper.rb +2 -2
  127. data/lib/ynab/models/currency_format.rb +2 -2
  128. data/lib/ynab/models/date_format.rb +2 -2
  129. data/lib/ynab/models/error_detail.rb +2 -2
  130. data/lib/ynab/models/error_response.rb +2 -2
  131. data/lib/ynab/models/hybrid_transaction.rb +2 -2
  132. data/lib/ynab/models/hybrid_transactions_response.rb +2 -2
  133. data/lib/ynab/models/hybrid_transactions_wrapper.rb +2 -2
  134. data/lib/ynab/models/month_detail.rb +2 -2
  135. data/lib/ynab/models/month_detail_response.rb +2 -2
  136. data/lib/ynab/models/month_detail_wrapper.rb +2 -2
  137. data/lib/ynab/models/month_summaries_response.rb +2 -2
  138. data/lib/ynab/models/month_summaries_wrapper.rb +2 -2
  139. data/lib/ynab/models/month_summary.rb +2 -2
  140. data/lib/ynab/models/payee.rb +2 -2
  141. data/lib/ynab/models/payee_location.rb +2 -2
  142. data/lib/ynab/models/payee_location_response.rb +2 -2
  143. data/lib/ynab/models/payee_location_wrapper.rb +2 -2
  144. data/lib/ynab/models/payee_locations_response.rb +2 -2
  145. data/lib/ynab/models/payee_locations_wrapper.rb +2 -2
  146. data/lib/ynab/models/payee_response.rb +2 -2
  147. data/lib/ynab/models/payee_wrapper.rb +2 -2
  148. data/lib/ynab/models/payees_response.rb +2 -2
  149. data/lib/ynab/models/payees_wrapper.rb +2 -2
  150. data/lib/ynab/models/save_transaction.rb +3 -3
  151. data/lib/ynab/models/save_transaction_wrapper.rb +2 -2
  152. data/lib/ynab/models/scheduled_sub_transaction.rb +2 -2
  153. data/lib/ynab/models/scheduled_transaction_detail.rb +2 -2
  154. data/lib/ynab/models/scheduled_transaction_response.rb +2 -2
  155. data/lib/ynab/models/scheduled_transaction_summary.rb +2 -2
  156. data/lib/ynab/models/scheduled_transaction_wrapper.rb +2 -2
  157. data/lib/ynab/models/scheduled_transactions_response.rb +2 -2
  158. data/lib/ynab/models/scheduled_transactions_wrapper.rb +2 -2
  159. data/lib/ynab/models/sub_transaction.rb +2 -2
  160. data/lib/ynab/models/transaction_detail.rb +2 -2
  161. data/lib/ynab/models/transaction_response.rb +2 -2
  162. data/lib/ynab/models/transaction_summary.rb +2 -2
  163. data/lib/ynab/models/transaction_wrapper.rb +2 -2
  164. data/lib/ynab/models/transactions_response.rb +2 -2
  165. data/lib/ynab/models/transactions_wrapper.rb +2 -2
  166. data/lib/ynab/models/user.rb +2 -2
  167. data/lib/ynab/models/user_response.rb +2 -2
  168. data/lib/ynab/models/user_wrapper.rb +2 -2
  169. data/lib/ynab/version.rb +2 -2
  170. data/pkg/ynab-1.0.0.gem +0 -0
  171. data/pkg/ynab-1.1.0.gem +0 -0
  172. data/spec-v1-swagger.json +105 -3
  173. data/spec/api/accounts_spec.rb +13 -4
  174. data/spec/api/budgets_spec.rb +4 -4
  175. data/spec/api/categories_spec.rb +4 -4
  176. data/spec/api/months_spec.rb +4 -4
  177. data/spec/api/payee_locations_spec.rb +4 -4
  178. data/spec/api/payees_spec.rb +4 -4
  179. data/spec/api/scheduled_transactions_spec.rb +4 -4
  180. data/spec/api/transactions_spec.rb +4 -4
  181. data/swagger-templates/gem.mustache +83 -0
  182. data/ynab.gemspec +1 -1
  183. metadata +11 -2
@@ -3,12 +3,12 @@ require 'spec_helper'
3
3
  describe 'payee locations' do
4
4
  let(:access_token) { '9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045' }
5
5
  let(:budget_id) { 'f419ac25-6217-4175-88dc-c3136ff5f6fd' }
6
- let(:client) { YnabApi::Client.new(access_token, 'api.localhost:3000', false) }
6
+ let(:client) { YNAB::API.new(access_token, 'api.localhost:3000', false) }
7
7
  let (:instance) { client.payee_locations }
8
8
 
9
9
  describe 'test an instance of PayeeLocationsApi' do
10
10
  it 'should create an instance of PayeeLocationsApi' do
11
- expect(instance).to be_instance_of(YnabApi::PayeeLocationsApi)
11
+ expect(instance).to be_instance_of(YNAB::PayeeLocationsApi)
12
12
  end
13
13
  end
14
14
 
@@ -23,10 +23,10 @@ describe 'payee locations' do
23
23
 
24
24
  it "throws when unauthorized" do
25
25
  VCR.use_cassette("payee_locations_unauthorized") do
26
- client = YnabApi::Client.new('not_valid_access_token', 'api.localhost:3000', false)
26
+ client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false)
27
27
  begin
28
28
  response = client.payee_locations.get_payee_locations(budget_id)
29
- rescue YnabApi::ApiError => e
29
+ rescue YNAB::ApiError => e
30
30
  expect(e.code).to be 401
31
31
  expect(client.last_request.response.options[:code]).to be 401
32
32
  end
@@ -3,12 +3,12 @@ require 'spec_helper'
3
3
  describe 'payees' do
4
4
  let(:access_token) { '9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045' }
5
5
  let(:budget_id) { 'f419ac25-6217-4175-88dc-c3136ff5f6fd' }
6
- let(:client) { YnabApi::Client.new(access_token, 'api.localhost:3000', false) }
6
+ let(:client) { YNAB::API.new(access_token, 'api.localhost:3000', false) }
7
7
  let (:instance) { client.payees }
8
8
 
9
9
  describe 'test an instance of PayeesApi' do
10
10
  it 'should create an instance of PayeesApi' do
11
- expect(instance).to be_instance_of(YnabApi::PayeesApi)
11
+ expect(instance).to be_instance_of(YNAB::PayeesApi)
12
12
  end
13
13
  end
14
14
 
@@ -23,10 +23,10 @@ describe 'payees' do
23
23
 
24
24
  it "throws when unauthorized" do
25
25
  VCR.use_cassette("payees_unauthorized") do
26
- client = YnabApi::Client.new('not_valid_access_token', 'api.localhost:3000', false)
26
+ client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false)
27
27
  begin
28
28
  response = client.payees.get_payees(budget_id)
29
- rescue YnabApi::ApiError => e
29
+ rescue YNAB::ApiError => e
30
30
  expect(e.code).to be 401
31
31
  expect(client.last_request.response.options[:code]).to be 401
32
32
  end
@@ -3,12 +3,12 @@ require 'spec_helper'
3
3
  describe 'scheduled transactions' do
4
4
  let(:access_token) { '9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045' }
5
5
  let(:budget_id) { 'f419ac25-6217-4175-88dc-c3136ff5f6fd' }
6
- let(:client) { YnabApi::Client.new(access_token, 'api.localhost:3000', false) }
6
+ let(:client) { YNAB::API.new(access_token, 'api.localhost:3000', false) }
7
7
  let (:instance) { client.scheduled_transactions }
8
8
 
9
9
  describe 'test an instance of ScheduledTransactionsApi' do
10
10
  it 'should create an instance of ScheduledTransactionApi' do
11
- expect(instance).to be_instance_of(YnabApi::ScheduledTransactionsApi)
11
+ expect(instance).to be_instance_of(YNAB::ScheduledTransactionsApi)
12
12
  end
13
13
  end
14
14
 
@@ -23,10 +23,10 @@ describe 'scheduled transactions' do
23
23
 
24
24
  it "throws when unauthorized" do
25
25
  VCR.use_cassette("scheduled_transactions_unauthorized") do
26
- client = YnabApi::Client.new('not_valid_access_token', 'api.localhost:3000', false)
26
+ client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false)
27
27
  begin
28
28
  response = client.scheduled_transactions.get_scheduled_transactions(budget_id)
29
- rescue YnabApi::ApiError => e
29
+ rescue YNAB::ApiError => e
30
30
  expect(e.code).to be 401
31
31
  expect(client.last_request.response.options[:code]).to be 401
32
32
  end
@@ -6,12 +6,12 @@ describe 'transactions' do
6
6
  let(:budget_id) { 'f419ac25-6217-4175-88dc-c3136ff5f6fd' }
7
7
  let(:category_id) { '84ffe61c-081c-44db-ad23-6ee809206c40' }
8
8
  let(:payee_id) { '2676f959-c5de-4db2-8d3f-2503777b25fb' }
9
- let(:client) { YnabApi::Client.new(access_token, 'api.localhost:3000', false) }
9
+ let(:client) { YNAB::API.new(access_token, 'api.localhost:3000', false) }
10
10
  let (:instance) { client.transactions }
11
11
 
12
12
  describe 'test an instance of TransactionsApi' do
13
13
  it 'should create an instance of TransactionApi' do
14
- expect(instance).to be_instance_of(YnabApi::TransactionsApi)
14
+ expect(instance).to be_instance_of(YNAB::TransactionsApi)
15
15
  end
16
16
  end
17
17
 
@@ -26,10 +26,10 @@ describe 'transactions' do
26
26
 
27
27
  it "throws when unauthorized" do
28
28
  VCR.use_cassette("transactions_unauthorized") do
29
- client = YnabApi::Client.new('not_valid_access_token', 'api.localhost:3000', false)
29
+ client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false)
30
30
  begin
31
31
  response = client.transactions.get_transactions(budget_id)
32
- rescue YnabApi::ApiError => e
32
+ rescue YNAB::ApiError => e
33
33
  expect(e.code).to be 401
34
34
  expect(client.last_request.response.options[:code]).to be 401
35
35
  end
@@ -0,0 +1,83 @@
1
+ =begin
2
+ {{> api_info}}
3
+ =end
4
+
5
+ # Common files
6
+ require '{{gemName}}/api_client'
7
+ require '{{gemName}}/api_error'
8
+ require '{{gemName}}/version'
9
+ require '{{gemName}}/configuration'
10
+
11
+ # Models
12
+ {{#models}}
13
+ {{#model}}
14
+ require '{{gemName}}/{{modelPackage}}/{{classFilename}}'{{/model}}
15
+ {{/models}}
16
+
17
+ # APIs
18
+ {{#apiInfo}}
19
+ {{#apis}}
20
+ require '{{importPath}}'
21
+ {{/apis}}
22
+ {{/apiInfo}}
23
+
24
+ module {{moduleName}}
25
+ class API
26
+ def initialize(access_token, host = 'api.youneedabudget.com', useHttps = true)
27
+ config = Configuration.default
28
+ config.api_key['Authorization'] = access_token
29
+ config.api_key_prefix['Authorization'] = 'Bearer'
30
+ config.scheme = useHttps ? 'https' : 'http'
31
+ config.host = host
32
+ config.base_path = '/v1'
33
+
34
+ @client = ApiClient.new(config)
35
+ end
36
+
37
+ def users
38
+ UserApi.new(@client)
39
+ end
40
+
41
+ def budgets
42
+ BudgetsApi.new(@client)
43
+ end
44
+
45
+ def accounts
46
+ AccountsApi.new(@client)
47
+ end
48
+
49
+ def categories
50
+ CategoriesApi.new(@client)
51
+ end
52
+
53
+ def months
54
+ MonthsApi.new(@client)
55
+ end
56
+
57
+ def payees
58
+ PayeesApi.new(@client)
59
+ end
60
+
61
+ def payee_locations
62
+ PayeeLocationsApi.new(@client)
63
+ end
64
+
65
+ def transactions
66
+ TransactionsApi.new(@client)
67
+ end
68
+
69
+ def scheduled_transactions
70
+ ScheduledTransactionsApi.new(@client)
71
+ end
72
+
73
+ def last_request
74
+ @client.last_request
75
+ end
76
+ end
77
+ end
78
+
79
+ # Support old interface: YnabApi::Client
80
+ module YnabApi
81
+ class Client < {{moduleName}}::API
82
+ end
83
+ end
@@ -17,7 +17,7 @@ require 'ynab/version'
17
17
 
18
18
  Gem::Specification.new do |s|
19
19
  s.name = 'ynab'
20
- s.version = YnabApi::VERSION
20
+ s.version = YNAB::VERSION
21
21
  s.platform = Gem::Platform::RUBY
22
22
  s.authors = ['You Need A Budget, LLC']
23
23
  s.email = ['help@youneedabudget.com']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ynab
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - You Need A Budget, LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-19 00:00:00.000000000 Z
11
+ date: 2018-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -112,6 +112,9 @@ files:
112
112
  - docs/BudgetDetail.md
113
113
  - docs/BudgetDetailResponse.md
114
114
  - docs/BudgetDetailWrapper.md
115
+ - docs/BudgetSettings.md
116
+ - docs/BudgetSettingsResponse.md
117
+ - docs/BudgetSettingsWrapper.md
115
118
  - docs/BudgetSummary.md
116
119
  - docs/BudgetSummaryResponse.md
117
120
  - docs/BudgetSummaryWrapper.md
@@ -202,6 +205,9 @@ files:
202
205
  - lib/ynab/models/budget_detail.rb
203
206
  - lib/ynab/models/budget_detail_response.rb
204
207
  - lib/ynab/models/budget_detail_wrapper.rb
208
+ - lib/ynab/models/budget_settings.rb
209
+ - lib/ynab/models/budget_settings_response.rb
210
+ - lib/ynab/models/budget_settings_wrapper.rb
205
211
  - lib/ynab/models/budget_summary.rb
206
212
  - lib/ynab/models/budget_summary_response.rb
207
213
  - lib/ynab/models/budget_summary_wrapper.rb
@@ -261,6 +267,8 @@ files:
261
267
  - lib/ynab/models/user_response.rb
262
268
  - lib/ynab/models/user_wrapper.rb
263
269
  - lib/ynab/version.rb
270
+ - pkg/ynab-1.0.0.gem
271
+ - pkg/ynab-1.1.0.gem
264
272
  - spec-v1-swagger.json
265
273
  - spec/api/accounts_spec.rb
266
274
  - spec/api/budgets_spec.rb
@@ -303,6 +311,7 @@ files:
303
311
  - spec/spec_helper.rb
304
312
  - swagger-templates/api_client.mustache
305
313
  - swagger-templates/api_doc.mustache
314
+ - swagger-templates/gem.mustache
306
315
  - swagger-templates/gemspec.mustache
307
316
  - ynab.gemspec
308
317
  homepage: https://github.com/ynab/ynab-sdk-ruby