ynab 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/Rakefile +9 -0
- data/config.json +2 -2
- data/docs/Account.md +1 -1
- data/docs/AccountResponse.md +1 -1
- data/docs/AccountWrapper.md +1 -1
- data/docs/AccountsApi.md +1 -1
- data/docs/AccountsResponse.md +1 -1
- data/docs/AccountsWrapper.md +1 -1
- data/docs/BudgetDetail.md +1 -1
- data/docs/BudgetDetailResponse.md +1 -1
- data/docs/BudgetDetailWrapper.md +1 -1
- data/docs/BudgetSettings.md +9 -0
- data/docs/BudgetSettingsResponse.md +8 -0
- data/docs/BudgetSettingsWrapper.md +8 -0
- data/docs/BudgetSummary.md +1 -1
- data/docs/BudgetSummaryResponse.md +1 -1
- data/docs/BudgetSummaryWrapper.md +1 -1
- data/docs/BudgetsApi.md +19 -1
- data/docs/BulkIdWrapper.md +1 -1
- data/docs/BulkIds.md +1 -1
- data/docs/BulkResponse.md +1 -1
- data/docs/BulkTransactionCreateResponse.md +2 -2
- data/docs/BulkTransactionIds.md +2 -2
- data/docs/BulkTransactions.md +1 -1
- data/docs/CategoriesApi.md +1 -1
- data/docs/CategoriesResponse.md +1 -1
- data/docs/Category.md +2 -1
- data/docs/CategoryGroup.md +1 -1
- data/docs/CategoryGroupWithCategories.md +1 -1
- data/docs/CategoryGroupsWrapper.md +1 -1
- data/docs/CategoryResponse.md +1 -1
- data/docs/CategoryWrapper.md +1 -1
- data/docs/CurrencyFormat.md +1 -1
- data/docs/DateFormat.md +1 -1
- data/docs/ErrorDetail.md +1 -1
- data/docs/ErrorResponse.md +1 -1
- data/docs/HybridTransaction.md +1 -1
- data/docs/HybridTransactionsResponse.md +1 -1
- data/docs/HybridTransactionsWrapper.md +1 -1
- data/docs/MonthDetail.md +1 -1
- data/docs/MonthDetailResponse.md +1 -1
- data/docs/MonthDetailWrapper.md +1 -1
- data/docs/MonthSummariesResponse.md +1 -1
- data/docs/MonthSummariesWrapper.md +1 -1
- data/docs/MonthSummary.md +1 -1
- data/docs/MonthsApi.md +1 -1
- data/docs/Payee.md +1 -1
- data/docs/PayeeLocation.md +1 -1
- data/docs/PayeeLocationResponse.md +1 -1
- data/docs/PayeeLocationWrapper.md +1 -1
- data/docs/PayeeLocationsApi.md +1 -1
- data/docs/PayeeLocationsResponse.md +1 -1
- data/docs/PayeeLocationsWrapper.md +1 -1
- data/docs/PayeeResponse.md +1 -1
- data/docs/PayeeWrapper.md +1 -1
- data/docs/PayeesApi.md +1 -1
- data/docs/PayeesResponse.md +1 -1
- data/docs/PayeesWrapper.md +1 -1
- data/docs/SaveTransaction.md +2 -2
- data/docs/SaveTransactionWrapper.md +1 -1
- data/docs/ScheduledSubTransaction.md +1 -1
- data/docs/ScheduledTransactionDetail.md +1 -1
- data/docs/ScheduledTransactionResponse.md +1 -1
- data/docs/ScheduledTransactionSummary.md +1 -1
- data/docs/ScheduledTransactionWrapper.md +1 -1
- data/docs/ScheduledTransactionsApi.md +1 -1
- data/docs/ScheduledTransactionsResponse.md +1 -1
- data/docs/ScheduledTransactionsWrapper.md +1 -1
- data/docs/SubTransaction.md +1 -1
- data/docs/TransactionDetail.md +1 -1
- data/docs/TransactionResponse.md +1 -1
- data/docs/TransactionSummary.md +1 -1
- data/docs/TransactionWrapper.md +1 -1
- data/docs/TransactionsApi.md +5 -2
- data/docs/TransactionsResponse.md +1 -1
- data/docs/TransactionsWrapper.md +1 -1
- data/docs/User.md +1 -1
- data/docs/UserApi.md +1 -1
- data/docs/UserResponse.md +1 -1
- data/docs/UserWrapper.md +1 -1
- data/examples/budget-list.rb +1 -1
- data/examples/budget-month.rb +1 -1
- data/examples/category-balance.rb +1 -1
- data/lib/ynab.rb +27 -15
- data/lib/ynab/api/accounts_api.rb +1 -1
- data/lib/ynab/api/budgets_api.rb +53 -1
- data/lib/ynab/api/categories_api.rb +1 -1
- data/lib/ynab/api/months_api.rb +1 -1
- data/lib/ynab/api/payee_locations_api.rb +1 -1
- data/lib/ynab/api/payees_api.rb +1 -1
- data/lib/ynab/api/scheduled_transactions_api.rb +1 -1
- data/lib/ynab/api/transactions_api.rb +21 -3
- data/lib/ynab/api/user_api.rb +1 -1
- data/lib/ynab/api_client.rb +2 -2
- data/lib/ynab/api_error.rb +1 -1
- data/lib/ynab/configuration.rb +1 -1
- data/lib/ynab/models/account.rb +2 -2
- data/lib/ynab/models/account_response.rb +2 -2
- data/lib/ynab/models/account_wrapper.rb +2 -2
- data/lib/ynab/models/accounts_response.rb +2 -2
- data/lib/ynab/models/accounts_wrapper.rb +2 -2
- data/lib/ynab/models/budget_detail.rb +2 -2
- data/lib/ynab/models/budget_detail_response.rb +2 -2
- data/lib/ynab/models/budget_detail_wrapper.rb +2 -2
- data/lib/ynab/models/budget_settings.rb +202 -0
- data/lib/ynab/models/budget_settings_response.rb +188 -0
- data/lib/ynab/models/budget_settings_wrapper.rb +188 -0
- data/lib/ynab/models/budget_summary.rb +2 -2
- data/lib/ynab/models/budget_summary_response.rb +2 -2
- data/lib/ynab/models/budget_summary_wrapper.rb +2 -2
- data/lib/ynab/models/bulk_id_wrapper.rb +2 -2
- data/lib/ynab/models/bulk_ids.rb +2 -2
- data/lib/ynab/models/bulk_response.rb +2 -2
- data/lib/ynab/models/bulk_transaction_create_response.rb +2 -2
- data/lib/ynab/models/bulk_transaction_ids.rb +2 -2
- data/lib/ynab/models/bulk_transactions.rb +2 -2
- data/lib/ynab/models/categories_response.rb +2 -2
- data/lib/ynab/models/category.rb +13 -3
- data/lib/ynab/models/category_group.rb +2 -2
- data/lib/ynab/models/category_group_with_categories.rb +2 -2
- data/lib/ynab/models/category_groups_wrapper.rb +2 -2
- data/lib/ynab/models/category_response.rb +2 -2
- data/lib/ynab/models/category_wrapper.rb +2 -2
- data/lib/ynab/models/currency_format.rb +2 -2
- data/lib/ynab/models/date_format.rb +2 -2
- data/lib/ynab/models/error_detail.rb +2 -2
- data/lib/ynab/models/error_response.rb +2 -2
- data/lib/ynab/models/hybrid_transaction.rb +2 -2
- data/lib/ynab/models/hybrid_transactions_response.rb +2 -2
- data/lib/ynab/models/hybrid_transactions_wrapper.rb +2 -2
- data/lib/ynab/models/month_detail.rb +2 -2
- data/lib/ynab/models/month_detail_response.rb +2 -2
- data/lib/ynab/models/month_detail_wrapper.rb +2 -2
- data/lib/ynab/models/month_summaries_response.rb +2 -2
- data/lib/ynab/models/month_summaries_wrapper.rb +2 -2
- data/lib/ynab/models/month_summary.rb +2 -2
- data/lib/ynab/models/payee.rb +2 -2
- data/lib/ynab/models/payee_location.rb +2 -2
- data/lib/ynab/models/payee_location_response.rb +2 -2
- data/lib/ynab/models/payee_location_wrapper.rb +2 -2
- data/lib/ynab/models/payee_locations_response.rb +2 -2
- data/lib/ynab/models/payee_locations_wrapper.rb +2 -2
- data/lib/ynab/models/payee_response.rb +2 -2
- data/lib/ynab/models/payee_wrapper.rb +2 -2
- data/lib/ynab/models/payees_response.rb +2 -2
- data/lib/ynab/models/payees_wrapper.rb +2 -2
- data/lib/ynab/models/save_transaction.rb +3 -3
- data/lib/ynab/models/save_transaction_wrapper.rb +2 -2
- data/lib/ynab/models/scheduled_sub_transaction.rb +2 -2
- data/lib/ynab/models/scheduled_transaction_detail.rb +2 -2
- data/lib/ynab/models/scheduled_transaction_response.rb +2 -2
- data/lib/ynab/models/scheduled_transaction_summary.rb +2 -2
- data/lib/ynab/models/scheduled_transaction_wrapper.rb +2 -2
- data/lib/ynab/models/scheduled_transactions_response.rb +2 -2
- data/lib/ynab/models/scheduled_transactions_wrapper.rb +2 -2
- data/lib/ynab/models/sub_transaction.rb +2 -2
- data/lib/ynab/models/transaction_detail.rb +2 -2
- data/lib/ynab/models/transaction_response.rb +2 -2
- data/lib/ynab/models/transaction_summary.rb +2 -2
- data/lib/ynab/models/transaction_wrapper.rb +2 -2
- data/lib/ynab/models/transactions_response.rb +2 -2
- data/lib/ynab/models/transactions_wrapper.rb +2 -2
- data/lib/ynab/models/user.rb +2 -2
- data/lib/ynab/models/user_response.rb +2 -2
- data/lib/ynab/models/user_wrapper.rb +2 -2
- data/lib/ynab/version.rb +2 -2
- data/pkg/ynab-1.0.0.gem +0 -0
- data/pkg/ynab-1.1.0.gem +0 -0
- data/spec-v1-swagger.json +105 -3
- data/spec/api/accounts_spec.rb +13 -4
- data/spec/api/budgets_spec.rb +4 -4
- data/spec/api/categories_spec.rb +4 -4
- data/spec/api/months_spec.rb +4 -4
- data/spec/api/payee_locations_spec.rb +4 -4
- data/spec/api/payees_spec.rb +4 -4
- data/spec/api/scheduled_transactions_spec.rb +4 -4
- data/spec/api/transactions_spec.rb +4 -4
- data/swagger-templates/gem.mustache +83 -0
- data/ynab.gemspec +1 -1
- 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) {
|
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(
|
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 =
|
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
|
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
|
data/spec/api/payees_spec.rb
CHANGED
@@ -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) {
|
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(
|
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 =
|
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
|
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) {
|
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(
|
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 =
|
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
|
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) {
|
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(
|
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 =
|
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
|
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
|
data/ynab.gemspec
CHANGED
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.
|
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-
|
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
|