ynab 5.2.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/DEVELOPMENT.md +6 -3
- data/Gemfile.lock +21 -19
- data/Rakefile +9 -8
- data/docs/ExistingCategory.md +4 -3
- data/docs/ExistingTransaction.md +1 -1
- data/docs/NewCategory.md +4 -3
- data/docs/NewTransaction.md +1 -1
- data/docs/SaveCategory.md +4 -3
- data/docs/SaveTransactionWithIdOrImportId.md +1 -1
- data/docs/SaveTransactionWithOptionalFields.md +1 -1
- data/docs/TransactionsApi.md +1 -1
- data/lib/ynab/api/accounts_api.rb +1 -1
- data/lib/ynab/api/categories_api.rb +1 -1
- data/lib/ynab/api/money_movements_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/plans_api.rb +1 -1
- data/lib/ynab/api/scheduled_transactions_api.rb +1 -1
- data/lib/ynab/api/transactions_api.rb +3 -3
- data/lib/ynab/api/user_api.rb +1 -1
- data/lib/ynab/api_client.rb +1 -1
- data/lib/ynab/api_model_base.rb +1 -1
- data/lib/ynab/configuration.rb +1 -1
- data/lib/ynab/models/account.rb +38 -13
- data/lib/ynab/models/account_base.rb +34 -12
- data/lib/ynab/models/account_response.rb +31 -12
- data/lib/ynab/models/account_response_data.rb +31 -12
- data/lib/ynab/models/account_type.rb +1 -1
- data/lib/ynab/models/accounts_response.rb +31 -12
- data/lib/ynab/models/accounts_response_data.rb +31 -12
- data/lib/ynab/models/bulk_response.rb +31 -12
- data/lib/ynab/models/bulk_response_data.rb +31 -12
- data/lib/ynab/models/bulk_response_data_bulk.rb +31 -12
- data/lib/ynab/models/bulk_transactions.rb +31 -12
- data/lib/ynab/models/categories_response.rb +31 -12
- data/lib/ynab/models/categories_response_data.rb +31 -12
- data/lib/ynab/models/category.rb +47 -12
- data/lib/ynab/models/category_base.rb +31 -12
- data/lib/ynab/models/category_group.rb +31 -12
- data/lib/ynab/models/category_group_with_categories.rb +31 -12
- data/lib/ynab/models/category_response.rb +31 -12
- data/lib/ynab/models/category_response_data.rb +31 -12
- data/lib/ynab/models/currency_format.rb +31 -12
- data/lib/ynab/models/date_format.rb +31 -12
- data/lib/ynab/models/error_detail.rb +31 -12
- data/lib/ynab/models/error_response.rb +31 -12
- data/lib/ynab/models/existing_category.rb +83 -19
- data/lib/ynab/models/existing_transaction.rb +36 -13
- data/lib/ynab/models/hybrid_transaction.rb +41 -12
- data/lib/ynab/models/hybrid_transactions_response.rb +31 -12
- data/lib/ynab/models/hybrid_transactions_response_data.rb +31 -12
- data/lib/ynab/models/money_movement.rb +38 -12
- data/lib/ynab/models/money_movement_base.rb +31 -12
- data/lib/ynab/models/money_movement_group.rb +31 -12
- data/lib/ynab/models/money_movement_groups_response.rb +31 -12
- data/lib/ynab/models/money_movement_groups_response_data.rb +31 -12
- data/lib/ynab/models/money_movements_response.rb +31 -12
- data/lib/ynab/models/money_movements_response_data.rb +31 -12
- data/lib/ynab/models/month_detail.rb +33 -12
- data/lib/ynab/models/month_detail_base.rb +33 -12
- data/lib/ynab/models/month_detail_response.rb +31 -12
- data/lib/ynab/models/month_detail_response_data.rb +31 -12
- data/lib/ynab/models/month_summaries_response.rb +31 -12
- data/lib/ynab/models/month_summaries_response_data.rb +31 -12
- data/lib/ynab/models/month_summary.rb +33 -12
- data/lib/ynab/models/month_summary_base.rb +31 -12
- data/lib/ynab/models/new_category.rb +83 -19
- data/lib/ynab/models/new_transaction.rb +36 -13
- data/lib/ynab/models/patch_category_group_wrapper.rb +31 -12
- data/lib/ynab/models/patch_category_wrapper.rb +31 -12
- data/lib/ynab/models/patch_month_category_wrapper.rb +31 -12
- data/lib/ynab/models/patch_payee_wrapper.rb +31 -12
- data/lib/ynab/models/patch_transactions_wrapper.rb +31 -12
- data/lib/ynab/models/payee.rb +31 -12
- data/lib/ynab/models/payee_location.rb +31 -12
- data/lib/ynab/models/payee_location_response.rb +31 -12
- data/lib/ynab/models/payee_location_response_data.rb +31 -12
- data/lib/ynab/models/payee_locations_response.rb +31 -12
- data/lib/ynab/models/payee_locations_response_data.rb +31 -12
- data/lib/ynab/models/payee_response.rb +31 -12
- data/lib/ynab/models/payee_response_data.rb +31 -12
- data/lib/ynab/models/payees_response.rb +31 -12
- data/lib/ynab/models/payees_response_data.rb +31 -12
- data/lib/ynab/models/plan_detail.rb +33 -12
- data/lib/ynab/models/plan_detail_response.rb +31 -12
- data/lib/ynab/models/plan_detail_response_data.rb +31 -12
- data/lib/ynab/models/plan_settings.rb +33 -14
- data/lib/ynab/models/plan_settings_response.rb +31 -12
- data/lib/ynab/models/plan_settings_response_data.rb +31 -12
- data/lib/ynab/models/plan_summary.rb +33 -12
- data/lib/ynab/models/plan_summary_response.rb +31 -12
- data/lib/ynab/models/plan_summary_response_data.rb +31 -12
- data/lib/ynab/models/post_account_wrapper.rb +31 -12
- data/lib/ynab/models/post_category_group_wrapper.rb +31 -12
- data/lib/ynab/models/post_category_wrapper.rb +31 -12
- data/lib/ynab/models/post_payee.rb +31 -12
- data/lib/ynab/models/post_payee_wrapper.rb +31 -12
- data/lib/ynab/models/post_scheduled_transaction_wrapper.rb +31 -12
- data/lib/ynab/models/post_transactions_wrapper.rb +31 -12
- data/lib/ynab/models/put_scheduled_transaction_wrapper.rb +31 -12
- data/lib/ynab/models/put_transaction_wrapper.rb +31 -12
- data/lib/ynab/models/save_account.rb +31 -12
- data/lib/ynab/models/save_account_type.rb +1 -1
- data/lib/ynab/models/save_category.rb +79 -20
- data/lib/ynab/models/save_category_group.rb +31 -12
- data/lib/ynab/models/save_category_group_response.rb +31 -12
- data/lib/ynab/models/save_category_group_response_data.rb +31 -12
- data/lib/ynab/models/save_category_response.rb +31 -12
- data/lib/ynab/models/save_category_response_data.rb +31 -12
- data/lib/ynab/models/save_month_category.rb +31 -12
- data/lib/ynab/models/save_payee.rb +31 -12
- data/lib/ynab/models/save_payee_response.rb +31 -12
- data/lib/ynab/models/save_payee_response_data.rb +31 -12
- data/lib/ynab/models/save_scheduled_transaction.rb +31 -12
- data/lib/ynab/models/save_sub_transaction.rb +31 -12
- data/lib/ynab/models/save_transaction_with_id_or_import_id.rb +36 -13
- data/lib/ynab/models/save_transaction_with_optional_fields.rb +32 -13
- data/lib/ynab/models/save_transactions_response.rb +31 -12
- data/lib/ynab/models/save_transactions_response_data.rb +31 -12
- data/lib/ynab/models/scheduled_sub_transaction.rb +37 -12
- data/lib/ynab/models/scheduled_sub_transaction_base.rb +31 -12
- data/lib/ynab/models/scheduled_transaction_detail.rb +36 -12
- data/lib/ynab/models/scheduled_transaction_frequency.rb +1 -1
- data/lib/ynab/models/scheduled_transaction_response.rb +31 -12
- data/lib/ynab/models/scheduled_transaction_response_data.rb +31 -12
- data/lib/ynab/models/scheduled_transaction_summary.rb +36 -12
- data/lib/ynab/models/scheduled_transaction_summary_base.rb +31 -12
- data/lib/ynab/models/scheduled_transactions_response.rb +31 -12
- data/lib/ynab/models/scheduled_transactions_response_data.rb +31 -12
- data/lib/ynab/models/sub_transaction.rb +38 -12
- data/lib/ynab/models/sub_transaction_base.rb +31 -12
- data/lib/ynab/models/transaction_cleared_status.rb +1 -1
- data/lib/ynab/models/transaction_detail.rb +41 -12
- data/lib/ynab/models/transaction_flag_color.rb +1 -1
- data/lib/ynab/models/transaction_response.rb +31 -12
- data/lib/ynab/models/transaction_response_data.rb +31 -12
- data/lib/ynab/models/transaction_summary.rb +41 -12
- data/lib/ynab/models/transaction_summary_base.rb +31 -12
- data/lib/ynab/models/transactions_import_response.rb +31 -12
- data/lib/ynab/models/transactions_import_response_data.rb +31 -12
- data/lib/ynab/models/transactions_response.rb +31 -12
- data/lib/ynab/models/transactions_response_data.rb +31 -12
- data/lib/ynab/models/user.rb +31 -12
- data/lib/ynab/models/user_response.rb +31 -12
- data/lib/ynab/models/user_response_data.rb +31 -12
- data/lib/ynab/version.rb +1 -1
- data/lib/ynab.rb +1 -1
- data/open_api_spec.yaml +61 -30
- data/templates/partial_model_generic.mustache +37 -11
- data/ynab.gemspec +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9c519478ec4054d5871fc144b246fc1c7307de1c61d2b2220c0dce9a9ff0879e
|
|
4
|
+
data.tar.gz: 959cf4ba89fdbccc05488eef03f0f16c6892bce297a65addb26955940c212404
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 18f35e85a46e13c5ecc8e3d852523faa17a29f1629a8c3bee087fb2876bfbe504bde3325e68fedd2131291e0d0688f32e7d77a24bad503a33f0828628e12ed33
|
|
7
|
+
data.tar.gz: 55295030f22d58f95383d178b268416d8ee5232900279c835d3c7fae38a602bba6a5f9e1de74ee21681cffcb0e30feae261d5e85c4fcba2a8c15602d46b88008
|
data/DEVELOPMENT.md
CHANGED
|
@@ -8,10 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
## Generating
|
|
10
10
|
|
|
11
|
-
Run `bundle exec rake generate`. This will generate the API client from the latest OpenAPI spec. Once generated, you should open a PR and merge the changes.
|
|
11
|
+
Run `bundle exec rake generate`. This will generate the API client from the latest OpenAPI spec and bump the version. The bump defaults to `minor`; pass `major` or `patch` to change it (`bundle exec rake "generate[patch]"`). Once generated, you should open a PR and merge the changes.
|
|
12
12
|
|
|
13
13
|
## Publishing
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
The version that gets published is whatever `lib/ynab/version.rb` on the `main` branch says, so publishing is two steps.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
1. Merge a PR that sets the new version. `bundle exec rake generate` does this for you. For a release that does not involve re-generating the client, run `bundle exec rake "bump_version_number[minor]"` (or `major` / `patch`), which updates `lib/ynab/version.rb` and `Gemfile.lock` without creating a commit or tag.
|
|
18
|
+
2. Run the "Publish" GitHub Actions workflow. This runs the specs and publishes that version to RubyGems, then tags the commit and creates a GitHub release.
|
|
19
|
+
|
|
20
|
+
The workflow never changes the version itself. If the version in `lib/ynab/version.rb` has already been released, the workflow fails before publishing anything.
|
data/Gemfile.lock
CHANGED
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
ynab (5.
|
|
4
|
+
ynab (5.3.0)
|
|
5
5
|
typhoeus (~> 1.0, >= 1.0.1)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
10
|
base64 (0.3.0)
|
|
11
|
-
diff-lcs (1.
|
|
12
|
-
ethon (0.
|
|
11
|
+
diff-lcs (1.6.2)
|
|
12
|
+
ethon (0.18.0)
|
|
13
13
|
ffi (>= 1.15.0)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
rspec-
|
|
20
|
-
|
|
21
|
-
rspec-
|
|
22
|
-
rspec-
|
|
14
|
+
logger
|
|
15
|
+
ffi (1.17.4)
|
|
16
|
+
logger (1.7.0)
|
|
17
|
+
rake (13.4.2)
|
|
18
|
+
rspec (3.13.2)
|
|
19
|
+
rspec-core (~> 3.13.0)
|
|
20
|
+
rspec-expectations (~> 3.13.0)
|
|
21
|
+
rspec-mocks (~> 3.13.0)
|
|
22
|
+
rspec-core (3.13.6)
|
|
23
|
+
rspec-support (~> 3.13.0)
|
|
24
|
+
rspec-expectations (3.13.5)
|
|
23
25
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
24
|
-
rspec-support (~> 3.
|
|
25
|
-
rspec-mocks (3.8
|
|
26
|
+
rspec-support (~> 3.13.0)
|
|
27
|
+
rspec-mocks (3.13.8)
|
|
26
28
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
27
|
-
rspec-support (~> 3.
|
|
28
|
-
rspec-support (3.
|
|
29
|
-
typhoeus (1.
|
|
30
|
-
ethon (>= 0.
|
|
31
|
-
vcr (6.
|
|
29
|
+
rspec-support (~> 3.13.0)
|
|
30
|
+
rspec-support (3.13.7)
|
|
31
|
+
typhoeus (1.6.0)
|
|
32
|
+
ethon (>= 0.18.0)
|
|
33
|
+
vcr (6.4.0)
|
|
32
34
|
|
|
33
35
|
PLATFORMS
|
|
34
36
|
ruby
|
data/Rakefile
CHANGED
|
@@ -12,8 +12,8 @@ end
|
|
|
12
12
|
|
|
13
13
|
task :default => [:spec]
|
|
14
14
|
|
|
15
|
-
desc "Run OpenAPI Generator to update the client from the spec"
|
|
16
|
-
task :generate do
|
|
15
|
+
desc "Run OpenAPI Generator to update the client from the spec and bump the version"
|
|
16
|
+
task :generate, [:version_type] do |t, args|
|
|
17
17
|
spec_filename = 'open_api_spec.yaml'
|
|
18
18
|
# Download latest spec
|
|
19
19
|
sh "wget https://api.ynab.com/papi/#{spec_filename} -O ./#{spec_filename}"
|
|
@@ -21,6 +21,8 @@ task :generate do
|
|
|
21
21
|
sh "rm -r docs/ lib/ynab/models/"
|
|
22
22
|
# Generate the client
|
|
23
23
|
sh "openapi-generator generate -i ./#{spec_filename} -g ruby -c openapi-generator-config.yaml -o ./"
|
|
24
|
+
|
|
25
|
+
Rake::Task[:bump_version_number].invoke(args[:version_type] || 'minor')
|
|
24
26
|
end
|
|
25
27
|
|
|
26
28
|
task :get_current_version do
|
|
@@ -49,13 +51,12 @@ task :bump_version_number, [:version_type] do |t, args|
|
|
|
49
51
|
new_version_file_text = current_version_file_text.gsub(current_version, new_version)
|
|
50
52
|
File.open(version_file_path, "w") {|file| file.puts new_version_file_text }
|
|
51
53
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
# Gemfile.lock pins this gem's own version, so it has to be re-resolved
|
|
55
|
+
sh "bundle lock"
|
|
54
56
|
|
|
55
|
-
|
|
56
|
-
sh "git add lib/ynab/version.rb Gemfile.lock && git diff-index --quiet HEAD || git commit -m 'Bumping version for release'"
|
|
57
|
+
puts new_version
|
|
57
58
|
end
|
|
58
59
|
|
|
59
|
-
desc "
|
|
60
|
-
task :publish => ['spec', '
|
|
60
|
+
desc "Run specs, build a gem and release it on RubyGems"
|
|
61
|
+
task :publish => ['spec', 'clobber', 'release:rubygem_push']
|
|
61
62
|
|
data/docs/ExistingCategory.md
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
| **name** | **String** | | [optional] |
|
|
8
8
|
| **note** | **String** | | [optional] |
|
|
9
9
|
| **category_group_id** | **String** | The id of the category group to which this category belongs. An internal category group may not be specified. | [optional] |
|
|
10
|
-
| **goal_target** | **Integer** | The goal target amount in milliunits format. If value is specified and goal has not already been configured for category, a monthly goal will be created for the category with this target amount. If goal_type is not specified, it will default to 'NEED'
|
|
11
|
-
| **goal_target_date** | **Date** | The goal target date in ISO format (e.g. 2016-12-01). | [optional] |
|
|
12
|
-
| **goal_needs_whole_amount** | **Boolean** | Whether the goal requires the full target amount each period. Only supported for 'NEED' goals. When true, the goal is configured as 'Set aside another...'. When false, the goal is configured as 'Refill up to...'. | [optional] |
|
|
10
|
+
| **goal_target** | **Integer** | The goal target amount in milliunits format. If value is specified and goal has not already been configured for category, a monthly goal will be created for the category with this target amount. If goal_type is not specified, it will default to 'NEED', or to 'MF' for Credit Card Payment categories and 'DEBT' for categories paired to a loan account. When updating a category, passing null removes any existing target. | [optional] |
|
|
11
|
+
| **goal_target_date** | **Date** | The goal target date in ISO format (e.g. 2016-12-01). Not supported for categories paired to a loan account. | [optional] |
|
|
12
|
+
| **goal_needs_whole_amount** | **Boolean** | Whether the goal requires the full target amount each period. Only supported for 'NEED' goals, and not supported for Credit Card Payment categories or categories paired to a loan account. When true, the goal is configured as 'Set aside another...'. When false, the goal is configured as 'Refill up to...'. | [optional] |
|
|
13
|
+
| **goal_frequency** | **String** | When specified, configures a recurring 'NEED' target of goal_target that repeats at this frequency, replacing any existing target. Requires goal_target. Cannot be combined with goal_target_date and is not supported for Credit Card Payment categories or categories paired to a loan account. Omit to leave an existing target's cadence unchanged. | [optional] |
|
|
13
14
|
|
data/docs/ExistingTransaction.md
CHANGED
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
| **cleared** | [**TransactionClearedStatus**](TransactionClearedStatus.md) | | [optional] |
|
|
15
15
|
| **approved** | **Boolean** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional] |
|
|
16
16
|
| **flag_color** | [**TransactionFlagColor**](TransactionFlagColor.md) | | [optional] |
|
|
17
|
-
| **subtransactions** | [**Array<SaveSubTransaction>**](SaveSubTransaction.md) | An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported. | [optional] |
|
|
17
|
+
| **subtransactions** | [**Array<SaveSubTransaction>**](SaveSubTransaction.md) | An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported and will return an error. Splits are not allowed on tracking accounts or on transfers between on-budget accounts; a transfer to a tracking account can be a split. | [optional] |
|
|
18
18
|
|
data/docs/NewCategory.md
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
| **name** | **String** | | [optional] |
|
|
8
8
|
| **note** | **String** | | [optional] |
|
|
9
9
|
| **category_group_id** | **String** | The id of the category group to which this category belongs. An internal category group may not be specified. | [optional] |
|
|
10
|
-
| **goal_target** | **Integer** | The goal target amount in milliunits format. If value is specified and goal has not already been configured for category, a monthly goal will be created for the category with this target amount. If goal_type is not specified, it will default to 'NEED'
|
|
11
|
-
| **goal_target_date** | **Date** | The goal target date in ISO format (e.g. 2016-12-01). | [optional] |
|
|
12
|
-
| **goal_needs_whole_amount** | **Boolean** | Whether the goal requires the full target amount each period. Only supported for 'NEED' goals. When true, the goal is configured as 'Set aside another...'. When false, the goal is configured as 'Refill up to...'. | [optional] |
|
|
10
|
+
| **goal_target** | **Integer** | The goal target amount in milliunits format. If value is specified and goal has not already been configured for category, a monthly goal will be created for the category with this target amount. If goal_type is not specified, it will default to 'NEED', or to 'MF' for Credit Card Payment categories and 'DEBT' for categories paired to a loan account. When updating a category, passing null removes any existing target. | [optional] |
|
|
11
|
+
| **goal_target_date** | **Date** | The goal target date in ISO format (e.g. 2016-12-01). Not supported for categories paired to a loan account. | [optional] |
|
|
12
|
+
| **goal_needs_whole_amount** | **Boolean** | Whether the goal requires the full target amount each period. Only supported for 'NEED' goals, and not supported for Credit Card Payment categories or categories paired to a loan account. When true, the goal is configured as 'Set aside another...'. When false, the goal is configured as 'Refill up to...'. | [optional] |
|
|
13
|
+
| **goal_frequency** | **String** | When specified, configures a recurring 'NEED' target of goal_target that repeats at this frequency, replacing any existing target. Requires goal_target. Cannot be combined with goal_target_date and is not supported for Credit Card Payment categories or categories paired to a loan account. Omit to leave an existing target's cadence unchanged. | [optional] |
|
|
13
14
|
|
data/docs/NewTransaction.md
CHANGED
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
| **cleared** | [**TransactionClearedStatus**](TransactionClearedStatus.md) | | [optional] |
|
|
15
15
|
| **approved** | **Boolean** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional] |
|
|
16
16
|
| **flag_color** | [**TransactionFlagColor**](TransactionFlagColor.md) | | [optional] |
|
|
17
|
-
| **subtransactions** | [**Array<SaveSubTransaction>**](SaveSubTransaction.md) | An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported. | [optional] |
|
|
17
|
+
| **subtransactions** | [**Array<SaveSubTransaction>**](SaveSubTransaction.md) | An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported and will return an error. Splits are not allowed on tracking accounts or on transfers between on-budget accounts; a transfer to a tracking account can be a split. | [optional] |
|
|
18
18
|
| **import_id** | **String** | If specified, a new transaction will be assigned this `import_id` and considered \"imported\". We will also attempt to match this imported transaction to an existing \"user-entered\" transaction on the same account, with the same amount, and with a date +/-10 days from the imported transaction date.<br><br>Transactions imported through File Based Import or Direct Import (not through the API) are assigned an import_id in the format: 'YNAB:[milliunit_amount]:[iso_date]:[occurrence]'. For example, a transaction dated 2015-12-30 in the amount of -$294.23 USD would have an import_id of 'YNAB:-294230:2015-12-30:1'. If a second transaction on the same account was imported and had the same date and same amount, its import_id would be 'YNAB:-294230:2015-12-30:2'. Using a consistent format will prevent duplicates through Direct Import and File Based Import.<br><br>If import_id is omitted or specified as null, the transaction will be treated as a \"user-entered\" transaction. As such, it will be eligible to be matched against transactions later being imported (via DI, FBI, or API). | [optional] |
|
|
19
19
|
|
data/docs/SaveCategory.md
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
| **name** | **String** | | [optional] |
|
|
8
8
|
| **note** | **String** | | [optional] |
|
|
9
9
|
| **category_group_id** | **String** | The id of the category group to which this category belongs. An internal category group may not be specified. | [optional] |
|
|
10
|
-
| **goal_target** | **Integer** | The goal target amount in milliunits format. If value is specified and goal has not already been configured for category, a monthly goal will be created for the category with this target amount. If goal_type is not specified, it will default to 'NEED'
|
|
11
|
-
| **goal_target_date** | **Date** | The goal target date in ISO format (e.g. 2016-12-01). | [optional] |
|
|
12
|
-
| **goal_needs_whole_amount** | **Boolean** | Whether the goal requires the full target amount each period. Only supported for 'NEED' goals. When true, the goal is configured as 'Set aside another...'. When false, the goal is configured as 'Refill up to...'. | [optional] |
|
|
10
|
+
| **goal_target** | **Integer** | The goal target amount in milliunits format. If value is specified and goal has not already been configured for category, a monthly goal will be created for the category with this target amount. If goal_type is not specified, it will default to 'NEED', or to 'MF' for Credit Card Payment categories and 'DEBT' for categories paired to a loan account. When updating a category, passing null removes any existing target. | [optional] |
|
|
11
|
+
| **goal_target_date** | **Date** | The goal target date in ISO format (e.g. 2016-12-01). Not supported for categories paired to a loan account. | [optional] |
|
|
12
|
+
| **goal_needs_whole_amount** | **Boolean** | Whether the goal requires the full target amount each period. Only supported for 'NEED' goals, and not supported for Credit Card Payment categories or categories paired to a loan account. When true, the goal is configured as 'Set aside another...'. When false, the goal is configured as 'Refill up to...'. | [optional] |
|
|
13
|
+
| **goal_frequency** | **String** | When specified, configures a recurring 'NEED' target of goal_target that repeats at this frequency, replacing any existing target. Requires goal_target. Cannot be combined with goal_target_date and is not supported for Credit Card Payment categories or categories paired to a loan account. Omit to leave an existing target's cadence unchanged. | [optional] |
|
|
13
14
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
| **cleared** | [**TransactionClearedStatus**](TransactionClearedStatus.md) | | [optional] |
|
|
15
15
|
| **approved** | **Boolean** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional] |
|
|
16
16
|
| **flag_color** | [**TransactionFlagColor**](TransactionFlagColor.md) | | [optional] |
|
|
17
|
-
| **subtransactions** | [**Array<SaveSubTransaction>**](SaveSubTransaction.md) | An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported. | [optional] |
|
|
17
|
+
| **subtransactions** | [**Array<SaveSubTransaction>**](SaveSubTransaction.md) | An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported and will return an error. Splits are not allowed on tracking accounts or on transfers between on-budget accounts; a transfer to a tracking account can be a split. | [optional] |
|
|
18
18
|
| **id** | **String** | If specified, this id will be used to lookup a transaction by its `id` for the purpose of updating the transaction itself. If not specified, an `import_id` should be supplied. | [optional] |
|
|
19
19
|
| **import_id** | **String** | If specified, this id will be used to lookup a transaction by its `import_id` for the purpose of updating the transaction itself. If not specified, an `id` should be supplied. You may not provide both an `id` and an `import_id` and updating an `import_id` on an existing transaction is not allowed. | [optional] |
|
|
20
20
|
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
| **cleared** | [**TransactionClearedStatus**](TransactionClearedStatus.md) | | [optional] |
|
|
15
15
|
| **approved** | **Boolean** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional] |
|
|
16
16
|
| **flag_color** | [**TransactionFlagColor**](TransactionFlagColor.md) | | [optional] |
|
|
17
|
-
| **subtransactions** | [**Array<SaveSubTransaction>**](SaveSubTransaction.md) | An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported. | [optional] |
|
|
17
|
+
| **subtransactions** | [**Array<SaveSubTransaction>**](SaveSubTransaction.md) | An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported and will return an error. Splits are not allowed on tracking accounts or on transfers between on-budget accounts; a transfer to a tracking account can be a split. | [optional] |
|
|
18
18
|
|
data/docs/TransactionsApi.md
CHANGED
|
@@ -202,7 +202,7 @@ Returns all transactions for a specified payee, excluding any pending transactio
|
|
|
202
202
|
|
|
203
203
|
Import transactions
|
|
204
204
|
|
|
205
|
-
|
|
205
|
+
DEPRECATED: This endpoint is no longer needed because YNAB now automatically imports transactions on linked accounts. Requests are still accepted for backwards compatibility but no import is performed and the response will always contain an empty list of transaction ids.
|
|
206
206
|
|
|
207
207
|
### Parameters
|
|
208
208
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
4
|
-
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation
|
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
=end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
4
|
-
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation
|
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
=end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
4
|
-
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation
|
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
=end
|
data/lib/ynab/api/months_api.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
4
|
-
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation
|
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
=end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
4
|
-
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation
|
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
=end
|
data/lib/ynab/api/payees_api.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
4
|
-
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation
|
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
=end
|
data/lib/ynab/api/plans_api.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
4
|
-
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation
|
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
=end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
4
|
-
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation
|
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
=end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
4
|
-
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation
|
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
=end
|
|
@@ -627,7 +627,7 @@ module YNAB
|
|
|
627
627
|
end
|
|
628
628
|
|
|
629
629
|
# Import transactions
|
|
630
|
-
#
|
|
630
|
+
# DEPRECATED: This endpoint is no longer needed because YNAB now automatically imports transactions on linked accounts. Requests are still accepted for backwards compatibility but no import is performed and the response will always contain an empty list of transaction ids.
|
|
631
631
|
# @param plan_id [String] The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).
|
|
632
632
|
# @param [Hash] opts the optional parameters
|
|
633
633
|
# @return [TransactionsImportResponse]
|
|
@@ -637,7 +637,7 @@ module YNAB
|
|
|
637
637
|
end
|
|
638
638
|
|
|
639
639
|
# Import transactions
|
|
640
|
-
#
|
|
640
|
+
# DEPRECATED: This endpoint is no longer needed because YNAB now automatically imports transactions on linked accounts. Requests are still accepted for backwards compatibility but no import is performed and the response will always contain an empty list of transaction ids.
|
|
641
641
|
# @param plan_id [String] The id of the plan. \"last-used\" can be used to specify the last used plan and \"default\" can be used if default plan selection is enabled (see: https://api.ynab.com/#oauth-default-plan).
|
|
642
642
|
# @param [Hash] opts the optional parameters
|
|
643
643
|
# @return [Array<(TransactionsImportResponse, Integer, Hash)>] TransactionsImportResponse data, response status code and response headers
|
data/lib/ynab/api/user_api.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
4
|
-
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation
|
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
=end
|
data/lib/ynab/api_client.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
4
|
-
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation
|
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
=end
|
data/lib/ynab/api_model_base.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
4
|
-
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation
|
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
|
data/lib/ynab/configuration.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
4
|
-
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation
|
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
|
data/lib/ynab/models/account.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
4
|
-
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation
|
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
|
|
@@ -129,9 +129,14 @@ module YNAB
|
|
|
129
129
|
}
|
|
130
130
|
end
|
|
131
131
|
|
|
132
|
+
# Returns attribute mapping this model knows about
|
|
133
|
+
def self.acceptable_attribute_map
|
|
134
|
+
attribute_map
|
|
135
|
+
end
|
|
136
|
+
|
|
132
137
|
# Returns all the JSON keys this model knows about
|
|
133
138
|
def self.acceptable_attributes
|
|
134
|
-
|
|
139
|
+
acceptable_attribute_map.values
|
|
135
140
|
end
|
|
136
141
|
|
|
137
142
|
# Attribute type mapping.
|
|
@@ -167,9 +172,26 @@ module YNAB
|
|
|
167
172
|
# List of attributes with nullable: true
|
|
168
173
|
def self.openapi_nullable
|
|
169
174
|
Set.new([
|
|
175
|
+
:'note',
|
|
176
|
+
:'transfer_payee_id',
|
|
177
|
+
:'last_reconciled_at',
|
|
178
|
+
:'debt_original_balance',
|
|
179
|
+
:'debt_interest_rates',
|
|
180
|
+
:'debt_minimum_payments',
|
|
181
|
+
:'debt_escrow_amounts',
|
|
170
182
|
])
|
|
171
183
|
end
|
|
172
184
|
|
|
185
|
+
# Returns attribute type mapping
|
|
186
|
+
def self.acceptable_openapi_types
|
|
187
|
+
openapi_types
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Returns the nullable attributes
|
|
191
|
+
def self.acceptable_openapi_nullable
|
|
192
|
+
openapi_nullable
|
|
193
|
+
end
|
|
194
|
+
|
|
173
195
|
# List of class defined in allOf (OpenAPI v3)
|
|
174
196
|
def self.openapi_all_of
|
|
175
197
|
[
|
|
@@ -185,9 +207,10 @@ module YNAB
|
|
|
185
207
|
end
|
|
186
208
|
|
|
187
209
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
210
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
188
211
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
189
|
-
if (!
|
|
190
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::Account`. Please check the name to make sure it's valid. List of attributes: " +
|
|
212
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
213
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::Account`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
191
214
|
end
|
|
192
215
|
h[k.to_sym] = v
|
|
193
216
|
}
|
|
@@ -313,7 +336,6 @@ module YNAB
|
|
|
313
336
|
return false if @balance.nil?
|
|
314
337
|
return false if @cleared_balance.nil?
|
|
315
338
|
return false if @uncleared_balance.nil?
|
|
316
|
-
return false if @transfer_payee_id.nil?
|
|
317
339
|
return false if @deleted.nil?
|
|
318
340
|
true
|
|
319
341
|
end
|
|
@@ -367,18 +389,20 @@ module YNAB
|
|
|
367
389
|
def self.build_from_hash(attributes)
|
|
368
390
|
return nil unless attributes.is_a?(Hash)
|
|
369
391
|
attributes = attributes.transform_keys(&:to_sym)
|
|
392
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
393
|
+
map = acceptable_attribute_map
|
|
370
394
|
transformed_hash = {}
|
|
371
|
-
|
|
372
|
-
if attributes.key?(
|
|
395
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
396
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
373
397
|
transformed_hash["#{key}"] = nil
|
|
374
398
|
elsif type =~ /\AArray<(.*)>/i
|
|
375
399
|
# check to ensure the input is an array given that the attribute
|
|
376
400
|
# is documented as an array but the input is not
|
|
377
|
-
if attributes[
|
|
378
|
-
transformed_hash["#{key}"] = attributes[
|
|
401
|
+
if attributes[map[key]].is_a?(Array)
|
|
402
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
379
403
|
end
|
|
380
|
-
elsif !attributes[
|
|
381
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[
|
|
404
|
+
elsif !attributes[map[key]].nil?
|
|
405
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
382
406
|
end
|
|
383
407
|
end
|
|
384
408
|
new(transformed_hash)
|
|
@@ -388,10 +412,11 @@ module YNAB
|
|
|
388
412
|
# @return [Hash] Returns the object in the form of hash
|
|
389
413
|
def to_hash
|
|
390
414
|
hash = {}
|
|
391
|
-
|
|
415
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
416
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
392
417
|
value = self.send(attr)
|
|
393
418
|
if value.nil?
|
|
394
|
-
is_nullable = self.class.
|
|
419
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
395
420
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
396
421
|
end
|
|
397
422
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#YNAB API Endpoints
|
|
3
3
|
|
|
4
|
-
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation
|
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. Read the [API Documentation](https://api.ynab.com) for more information about the API, including how to obtain an access token and how to use it to make requests.
|
|
5
5
|
|
|
6
6
|
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
7
|
|
|
@@ -105,9 +105,14 @@ module YNAB
|
|
|
105
105
|
}
|
|
106
106
|
end
|
|
107
107
|
|
|
108
|
+
# Returns attribute mapping this model knows about
|
|
109
|
+
def self.acceptable_attribute_map
|
|
110
|
+
attribute_map
|
|
111
|
+
end
|
|
112
|
+
|
|
108
113
|
# Returns all the JSON keys this model knows about
|
|
109
114
|
def self.acceptable_attributes
|
|
110
|
-
|
|
115
|
+
acceptable_attribute_map.values
|
|
111
116
|
end
|
|
112
117
|
|
|
113
118
|
# Attribute type mapping.
|
|
@@ -141,9 +146,22 @@ module YNAB
|
|
|
141
146
|
:'transfer_payee_id',
|
|
142
147
|
:'last_reconciled_at',
|
|
143
148
|
:'debt_original_balance',
|
|
149
|
+
:'debt_interest_rates',
|
|
150
|
+
:'debt_minimum_payments',
|
|
151
|
+
:'debt_escrow_amounts',
|
|
144
152
|
])
|
|
145
153
|
end
|
|
146
154
|
|
|
155
|
+
# Returns attribute type mapping
|
|
156
|
+
def self.acceptable_openapi_types
|
|
157
|
+
openapi_types
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Returns the nullable attributes
|
|
161
|
+
def self.acceptable_openapi_nullable
|
|
162
|
+
openapi_nullable
|
|
163
|
+
end
|
|
164
|
+
|
|
147
165
|
# Initializes the object
|
|
148
166
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
149
167
|
def initialize(attributes = {})
|
|
@@ -152,9 +170,10 @@ module YNAB
|
|
|
152
170
|
end
|
|
153
171
|
|
|
154
172
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
173
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
155
174
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
156
|
-
if (!
|
|
157
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::AccountBase`. Please check the name to make sure it's valid. List of attributes: " +
|
|
175
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
176
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::AccountBase`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
158
177
|
end
|
|
159
178
|
h[k.to_sym] = v
|
|
160
179
|
}
|
|
@@ -303,18 +322,20 @@ module YNAB
|
|
|
303
322
|
def self.build_from_hash(attributes)
|
|
304
323
|
return nil unless attributes.is_a?(Hash)
|
|
305
324
|
attributes = attributes.transform_keys(&:to_sym)
|
|
325
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
326
|
+
map = acceptable_attribute_map
|
|
306
327
|
transformed_hash = {}
|
|
307
|
-
|
|
308
|
-
if attributes.key?(
|
|
328
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
329
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
309
330
|
transformed_hash["#{key}"] = nil
|
|
310
331
|
elsif type =~ /\AArray<(.*)>/i
|
|
311
332
|
# check to ensure the input is an array given that the attribute
|
|
312
333
|
# is documented as an array but the input is not
|
|
313
|
-
if attributes[
|
|
314
|
-
transformed_hash["#{key}"] = attributes[
|
|
334
|
+
if attributes[map[key]].is_a?(Array)
|
|
335
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
315
336
|
end
|
|
316
|
-
elsif !attributes[
|
|
317
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[
|
|
337
|
+
elsif !attributes[map[key]].nil?
|
|
338
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
318
339
|
end
|
|
319
340
|
end
|
|
320
341
|
new(transformed_hash)
|
|
@@ -324,10 +345,11 @@ module YNAB
|
|
|
324
345
|
# @return [Hash] Returns the object in the form of hash
|
|
325
346
|
def to_hash
|
|
326
347
|
hash = {}
|
|
327
|
-
|
|
348
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
349
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
328
350
|
value = self.send(attr)
|
|
329
351
|
if value.nil?
|
|
330
|
-
is_nullable = self.class.
|
|
352
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
331
353
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
332
354
|
end
|
|
333
355
|
|