├── .editorconfig ├── .github └── workflows │ ├── build-test.yml │ └── publish.yml ├── .gitignore ├── .openapi-generator-ignore ├── .openapi-generator ├── FILES └── VERSION ├── .rspec ├── .tool-versions ├── .vscode └── tasks.json ├── DEVELOPMENT.md ├── Gemfile ├── Gemfile.lock ├── LICENSE.md ├── README.md ├── Rakefile ├── docs ├── Account.md ├── AccountResponse.md ├── AccountResponseData.md ├── AccountType.md ├── AccountsApi.md ├── AccountsResponse.md ├── AccountsResponseData.md ├── BudgetDetail.md ├── BudgetDetailResponse.md ├── BudgetDetailResponseData.md ├── BudgetSettings.md ├── BudgetSettingsResponse.md ├── BudgetSettingsResponseData.md ├── BudgetSummary.md ├── BudgetSummaryResponse.md ├── BudgetSummaryResponseData.md ├── BudgetsApi.md ├── BulkResponse.md ├── BulkResponseData.md ├── BulkResponseDataBulk.md ├── BulkTransactions.md ├── CategoriesApi.md ├── CategoriesResponse.md ├── CategoriesResponseData.md ├── Category.md ├── CategoryGroup.md ├── CategoryGroupWithCategories.md ├── CategoryResponse.md ├── CategoryResponseData.md ├── CurrencyFormat.md ├── DateFormat.md ├── ErrorDetail.md ├── ErrorResponse.md ├── ExistingTransaction.md ├── HybridTransaction.md ├── HybridTransactionsResponse.md ├── HybridTransactionsResponseData.md ├── MonthDetail.md ├── MonthDetailResponse.md ├── MonthDetailResponseData.md ├── MonthSummariesResponse.md ├── MonthSummariesResponseData.md ├── MonthSummary.md ├── MonthsApi.md ├── NewTransaction.md ├── PatchCategoryWrapper.md ├── PatchMonthCategoryWrapper.md ├── PatchPayeeWrapper.md ├── PatchTransactionsWrapper.md ├── Payee.md ├── PayeeLocation.md ├── PayeeLocationResponse.md ├── PayeeLocationResponseData.md ├── PayeeLocationsApi.md ├── PayeeLocationsResponse.md ├── PayeeLocationsResponseData.md ├── PayeeResponse.md ├── PayeeResponseData.md ├── PayeesApi.md ├── PayeesResponse.md ├── PayeesResponseData.md ├── PostAccountWrapper.md ├── PostScheduledTransactionWrapper.md ├── PostTransactionsWrapper.md ├── PutScheduledTransactionWrapper.md ├── PutTransactionWrapper.md ├── SaveAccount.md ├── SaveCategory.md ├── SaveCategoryResponse.md ├── SaveCategoryResponseData.md ├── SaveMonthCategory.md ├── SavePayee.md ├── SavePayeeResponse.md ├── SavePayeeResponseData.md ├── SaveScheduledTransaction.md ├── SaveSubTransaction.md ├── SaveTransactionWithIdOrImportId.md ├── SaveTransactionWithOptionalFields.md ├── SaveTransactionsResponse.md ├── SaveTransactionsResponseData.md ├── ScheduledSubTransaction.md ├── ScheduledTransactionDetail.md ├── ScheduledTransactionFrequency.md ├── ScheduledTransactionResponse.md ├── ScheduledTransactionResponseData.md ├── ScheduledTransactionSummary.md ├── ScheduledTransactionsApi.md ├── ScheduledTransactionsResponse.md ├── ScheduledTransactionsResponseData.md ├── SubTransaction.md ├── TransactionClearedStatus.md ├── TransactionDetail.md ├── TransactionFlagColor.md ├── TransactionResponse.md ├── TransactionResponseData.md ├── TransactionSummary.md ├── TransactionsApi.md ├── TransactionsImportResponse.md ├── TransactionsImportResponseData.md ├── TransactionsResponse.md ├── TransactionsResponseData.md ├── User.md ├── UserApi.md ├── UserResponse.md └── UserResponseData.md ├── examples ├── budget-list.rb ├── budget-month.rb ├── category-balance.rb ├── create-multiple-transactions.rb ├── create-transaction.rb ├── update-category-budgeted.rb └── update-multiple-transactions.rb ├── lib ├── ynab.rb └── ynab │ ├── api │ ├── accounts_api.rb │ ├── budgets_api.rb │ ├── categories_api.rb │ ├── deprecated_api.rb │ ├── months_api.rb │ ├── payee_locations_api.rb │ ├── payees_api.rb │ ├── scheduled_transactions_api.rb │ ├── transactions_api.rb │ └── user_api.rb │ ├── api_client.rb │ ├── api_error.rb │ ├── configuration.rb │ ├── models │ ├── account.rb │ ├── account_response.rb │ ├── account_response_data.rb │ ├── account_type.rb │ ├── accounts_response.rb │ ├── accounts_response_data.rb │ ├── budget_detail.rb │ ├── budget_detail_response.rb │ ├── budget_detail_response_data.rb │ ├── budget_settings.rb │ ├── budget_settings_response.rb │ ├── budget_settings_response_data.rb │ ├── budget_summary.rb │ ├── budget_summary_response.rb │ ├── budget_summary_response_data.rb │ ├── bulk_response.rb │ ├── bulk_response_data.rb │ ├── bulk_response_data_bulk.rb │ ├── bulk_transactions.rb │ ├── categories_response.rb │ ├── categories_response_data.rb │ ├── category.rb │ ├── category_group.rb │ ├── category_group_with_categories.rb │ ├── category_response.rb │ ├── category_response_data.rb │ ├── currency_format.rb │ ├── date_format.rb │ ├── error_detail.rb │ ├── error_response.rb │ ├── existing_transaction.rb │ ├── hybrid_transaction.rb │ ├── hybrid_transactions_response.rb │ ├── hybrid_transactions_response_data.rb │ ├── month_detail.rb │ ├── month_detail_response.rb │ ├── month_detail_response_data.rb │ ├── month_summaries_response.rb │ ├── month_summaries_response_data.rb │ ├── month_summary.rb │ ├── new_transaction.rb │ ├── patch_category_wrapper.rb │ ├── patch_month_category_wrapper.rb │ ├── patch_payee_wrapper.rb │ ├── patch_transactions_wrapper.rb │ ├── payee.rb │ ├── payee_location.rb │ ├── payee_location_response.rb │ ├── payee_location_response_data.rb │ ├── payee_locations_response.rb │ ├── payee_locations_response_data.rb │ ├── payee_response.rb │ ├── payee_response_data.rb │ ├── payees_response.rb │ ├── payees_response_data.rb │ ├── post_account_wrapper.rb │ ├── post_scheduled_transaction_wrapper.rb │ ├── post_transactions_wrapper.rb │ ├── put_scheduled_transaction_wrapper.rb │ ├── put_transaction_wrapper.rb │ ├── save_account.rb │ ├── save_category.rb │ ├── save_category_response.rb │ ├── save_category_response_data.rb │ ├── save_month_category.rb │ ├── save_payee.rb │ ├── save_payee_response.rb │ ├── save_payee_response_data.rb │ ├── save_scheduled_transaction.rb │ ├── save_sub_transaction.rb │ ├── save_transaction_with_id_or_import_id.rb │ ├── save_transaction_with_optional_fields.rb │ ├── save_transactions_response.rb │ ├── save_transactions_response_data.rb │ ├── scheduled_sub_transaction.rb │ ├── scheduled_transaction_detail.rb │ ├── scheduled_transaction_frequency.rb │ ├── scheduled_transaction_response.rb │ ├── scheduled_transaction_response_data.rb │ ├── scheduled_transaction_summary.rb │ ├── scheduled_transactions_response.rb │ ├── scheduled_transactions_response_data.rb │ ├── sub_transaction.rb │ ├── transaction_cleared_status.rb │ ├── transaction_detail.rb │ ├── transaction_flag_color.rb │ ├── transaction_response.rb │ ├── transaction_response_data.rb │ ├── transaction_summary.rb │ ├── transactions_import_response.rb │ ├── transactions_import_response_data.rb │ ├── transactions_response.rb │ ├── transactions_response_data.rb │ ├── user.rb │ ├── user_response.rb │ └── user_response_data.rb │ ├── overrides │ └── transactions_api.rb │ └── version.rb ├── open_api_spec.yaml ├── openapi-generator-config.yaml ├── spec ├── api │ ├── accounts_spec.rb │ ├── budgets_spec.rb │ ├── categories_spec.rb │ ├── months_spec.rb │ ├── payee_locations_spec.rb │ ├── payees_spec.rb │ ├── scheduled_transactions_spec.rb │ └── transactions_spec.rb ├── api_error_spec.rb ├── fixtures │ └── vcr_cassettes │ │ ├── account.yml │ │ ├── accounts.yml │ │ ├── accounts_unauthorized.yml │ │ ├── budget.yml │ │ ├── budgets.yml │ │ ├── budgets_unauthorized.yml │ │ ├── bulk_transactions.yml │ │ ├── categories.yml │ │ ├── categories_unauthorized.yml │ │ ├── category.yml │ │ ├── category_transactions.yml │ │ ├── create_account.yml │ │ ├── create_scheduled_transaction.yml │ │ ├── create_transaction.yml │ │ ├── create_transactions.yml │ │ ├── import_transactions.yml │ │ ├── month.yml │ │ ├── month_transactions.yml │ │ ├── months.yml │ │ ├── months_unauthorized.yml │ │ ├── multiple_transactions.yml │ │ ├── patch_month_category.yml │ │ ├── payee.yml │ │ ├── payee_location.yml │ │ ├── payee_locations.yml │ │ ├── payee_locations_unauthorized.yml │ │ ├── payee_transactions.yml │ │ ├── payees.yml │ │ ├── payees_unauthorized.yml │ │ ├── scheduled_transaction.yml │ │ ├── scheduled_transactions.yml │ │ ├── scheduled_transactions_unauthorized.yml │ │ ├── transaction.yml │ │ ├── transactions.yml │ │ ├── transactions_invalid_flags.yml │ │ ├── transactions_unauthorized.yml │ │ ├── update_transaction.yml │ │ └── update_transactions.yml └── spec_helper.rb ├── templates ├── README.md ├── api.mustache ├── api_client.mustache ├── api_client_typhoeus_partial.mustache ├── api_doc.mustache ├── api_info.mustache ├── gem.mustache ├── gemspec.mustache ├── partial_model_enum_class.mustache ├── partial_model_generic.mustache └── partial_model_generic_doc.mustache └── ynab.gemspec /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | end_of_line = lf 6 | charset = utf-8 7 | indent_style = space 8 | indent_size = 2 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | -------------------------------------------------------------------------------- /.github/workflows/build-test.yml: -------------------------------------------------------------------------------- 1 | name: Build and Test 2 | 3 | on: push 4 | jobs: 5 | test: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v4 9 | - name: Set up Ruby 10 | uses: ruby/setup-ruby@v1 11 | with: 12 | ruby-version: 3.4.1 13 | - name: Install gems 14 | run: | 15 | gem install bundler 16 | bundle install --jobs 4 --retry 3 17 | - name: Run tests 18 | run: rspec 19 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | version_type: 6 | type: choice 7 | description: Version type 8 | default: minor 9 | options: 10 | - major 11 | - minor 12 | - patch 13 | rubygems_api_key: 14 | description: API Key 15 | required: true 16 | rubygems_otp: 17 | description: OTP Code 18 | required: true 19 | jobs: 20 | publish: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Hide the inputs values to keep them private in the logs when running this workflow 24 | uses: levibostian/action-hide-sensitive-inputs@v1 25 | - uses: actions/checkout@v4 26 | - name: Setup git repo 27 | run: | 28 | git config user.name $GITHUB_ACTOR 29 | git config user.email gh-actions-${GITHUB_ACTOR}@github.com 30 | git remote add gh-origin https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git 31 | - name: Set up Ruby 32 | uses: ruby/setup-ruby@v1 33 | with: 34 | ruby-version: 3.4.1 35 | - name: Upgrade RubyGems version 36 | run: gem update --system 37 | - name: Install gems 38 | run: | 39 | gem install bundler 40 | bundle install --jobs 4 --retry 3 41 | - name: Bump Version 42 | id: bump_version 43 | run: | 44 | NEW_VERSION=$(rake "bump_version_number[${{ inputs.version_type }}]") 45 | echo "NEW_VERSION=$NEW_VERSION" 46 | echo "new_version=$(echo $NEW_VERSION)" >> $GITHUB_OUTPUT 47 | - name: Configure authentication to RubyGems 48 | run: | 49 | mkdir -p $HOME/.gem 50 | touch $HOME/.gem/credentials 51 | chmod 0600 $HOME/.gem/credentials 52 | printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials 53 | env: 54 | GEM_HOST_API_KEY: "${{ inputs.rubygems_api_key }}" 55 | - name: Publish to RubyGems 56 | run: rake publish 57 | env: 58 | GEM_HOST_OTP_CODE: ${{ inputs.rubygems_otp }} 59 | - name: Create a Release 60 | id: create-release 61 | uses: softprops/action-gh-release@v1 62 | with: 63 | tag_name: ${{ steps.bump_version.outputs.new_version }} 64 | generate_release_notes: true 65 | - name: Comment on PRs with link to release they are included in 66 | uses: actions/github-script@v6 67 | env: 68 | RELEASE_ID: ${{ steps.create-release.outputs.id }} 69 | with: 70 | script: | 71 | const releaseId = process.env.RELEASE_ID; 72 | console.log(`Fetching release_id: ${releaseId} ...`); 73 | const getReleaseResponse = await github.rest.repos.getRelease({ 74 | release_id: process.env.RELEASE_ID, 75 | owner: context.repo.owner, 76 | repo: context.repo.repo 77 | }); 78 | const release = getReleaseResponse.data; 79 | 80 | const prNumbersInRelease = new Set(Array.from(release.body.matchAll(/\/pull\/(\d+)/g)).map(p=>p[1])); 81 | 82 | for(let prNumber of prNumbersInRelease) { 83 | console.log(`Adding comment on PR #${prNumber} ...`); 84 | await github.rest.issues.createComment({ 85 | issue_number: prNumber, 86 | owner: context.repo.owner, 87 | repo: context.repo.repo, 88 | body: `The changes in this PR were just released in [${release.name}](https://github.com/${context.repo.owner}/${context.repo.repo}/releases/tag/${release.tag_name}) 🎉.` 89 | }) 90 | } 91 | 92 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by: https://openapi-generator.tech 2 | # 3 | 4 | *.gem 5 | *.rbc 6 | /.config 7 | /coverage/ 8 | /InstalledFiles 9 | /pkg/ 10 | /spec/reports/ 11 | /spec/examples.txt 12 | /test/tmp/ 13 | /test/version_tmp/ 14 | /tmp/ 15 | 16 | ## Specific to RubyMotion: 17 | .dat* 18 | .repl_history 19 | build/ 20 | 21 | ## Documentation cache and generated files: 22 | /.yardoc/ 23 | /_yardoc/ 24 | /doc/ 25 | /rdoc/ 26 | 27 | ## Environment normalization: 28 | /.bundle/ 29 | /vendor/bundle 30 | /lib/bundler/man/ 31 | 32 | # for a library or gem, you might want to ignore these files since the code is 33 | # intended to run in multiple environments; otherwise, check them in: 34 | # Gemfile.lock 35 | # .ruby-version 36 | # .ruby-gemset 37 | 38 | # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: 39 | .rvmrc 40 | -------------------------------------------------------------------------------- /.openapi-generator-ignore: -------------------------------------------------------------------------------- 1 | # OpenAPI Generator Ignore 2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator 3 | 4 | # Use this file to prevent files from being overwritten by the generator. 5 | # The patterns follow closely to .gitignore or .dockerignore. 6 | 7 | # As an example, the C# client generator defines ApiClient.cs. 8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: 9 | #ApiClient.cs 10 | 11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*): 12 | #foo/*/qux 13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux 14 | 15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**): 16 | #foo/**/qux 17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux 18 | 19 | # You can also negate patterns with an exclamation (!). 20 | # For example, you can ignore all files in a docs folder with the file extension .md: 21 | #docs/*.md 22 | # Then explicitly reverse the ignore rule for a single file: 23 | #!docs/README.md 24 | 25 | Rakefile 26 | git_push.sh 27 | .rubocop.yml 28 | .gitlab-ci.yml 29 | .travis.yml 30 | Gemfile 31 | Gemfile.lock 32 | README.md 33 | spec/ 34 | spec/**/*.rb 35 | lib/ynab/api_error.rb 36 | lib/ynab/version.rb 37 | -------------------------------------------------------------------------------- /.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | 7.12.0 2 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --require spec_helper 3 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | ruby 3.4.1 2 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "rspec (Current File)", 8 | "group": { 9 | "kind": "test", 10 | "isDefault": true 11 | }, 12 | "command": "rspec", 13 | "options": { 14 | "cwd": "${cwd}" 15 | }, 16 | "args": ["${file}"], 17 | "problemMatcher": { 18 | "owner": "ruby", 19 | "fileLocation": ["relative", "${workspaceRoot}"], 20 | "severity": "error", 21 | "pattern": [ 22 | { 23 | "regexp": "^\\s{7}(.*)$", 24 | "message": 1 25 | }, 26 | { 27 | "regexp": "^\\s+#\\s(\\./.*):(\\d+):(in.*)$", 28 | "file": 1, 29 | "line": 2, 30 | "code": 3 31 | } 32 | ] 33 | } 34 | }, 35 | { 36 | "label": "rspec (Current Line)", 37 | "group": { 38 | "kind": "test", 39 | "isDefault": true 40 | }, 41 | "command": "rspec", 42 | "options": { 43 | "cwd": "${cwd}" 44 | }, 45 | "args": ["${file}:${lineNumber}"], 46 | "problemMatcher": { 47 | "owner": "ruby", 48 | "fileLocation": ["relative", "${workspaceRoot}"], 49 | "severity": "error", 50 | "pattern": [ 51 | { 52 | "regexp": "^\\s{7}(.*)$", 53 | "message": 1 54 | }, 55 | { 56 | "regexp": "^\\s+#\\s(\\./.*):(\\d+):(in.*)$", 57 | "file": 1, 58 | "line": 2, 59 | "code": 3 60 | } 61 | ] 62 | } 63 | } 64 | ] 65 | } 66 | -------------------------------------------------------------------------------- /DEVELOPMENT.md: -------------------------------------------------------------------------------- 1 | # Development 2 | 3 | ## Setup 4 | 5 | - Install dependencies: `bundle` 6 | - Install [OpenAPI Generator](https://openapi-generator.tech/) (on macOS: `brew install openapi-generator`) 7 | - Run tests: `bundle exec rake spec` or `rspec` 8 | 9 | ## Generating 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. 12 | 13 | ## Publishing 14 | 15 | Run the "Publish" GitHub Actions workflow 16 | 17 | Note: Use the Publish workflow to bump the version number in `lib/ynab/version.rb` 18 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec 4 | 5 | group :development, :test do 6 | gem "rake", ">= 12.3.3" 7 | gem "vcr", ">=3.0.3" 8 | end 9 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | ynab (3.7.0) 5 | typhoeus (~> 1.0, >= 1.0.1) 6 | 7 | GEM 8 | remote: https://rubygems.org/ 9 | specs: 10 | diff-lcs (1.3) 11 | ethon (0.16.0) 12 | ffi (>= 1.15.0) 13 | ffi (1.15.5) 14 | rake (13.0.1) 15 | rspec (3.8.0) 16 | rspec-core (~> 3.8.0) 17 | rspec-expectations (~> 3.8.0) 18 | rspec-mocks (~> 3.8.0) 19 | rspec-core (3.8.0) 20 | rspec-support (~> 3.8.0) 21 | rspec-expectations (3.8.2) 22 | diff-lcs (>= 1.2.0, < 2.0) 23 | rspec-support (~> 3.8.0) 24 | rspec-mocks (3.8.0) 25 | diff-lcs (>= 1.2.0, < 2.0) 26 | rspec-support (~> 3.8.0) 27 | rspec-support (3.8.0) 28 | typhoeus (1.4.0) 29 | ethon (>= 0.9.0) 30 | vcr (6.2.0) 31 | 32 | PLATFORMS 33 | ruby 34 | 35 | DEPENDENCIES 36 | rake (>= 12.3.3) 37 | rspec (~> 3.6, >= 3.6.0) 38 | vcr (>= 3.0.3) 39 | ynab! 40 | 41 | BUNDLED WITH 42 | 2.4.19 43 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | begin 2 | require 'rspec/core/rake_task' 3 | require 'bundler/gem_tasks' 4 | require 'lib/ynab/version' 5 | 6 | RSpec::Core::RakeTask.new(:spec) do |t| 7 | t.rspec_opts = "-fd" 8 | end 9 | rescue LoadError 10 | # no rspec available 11 | end 12 | 13 | task :default => [:spec] 14 | 15 | desc "Run OpenAPI Generator to update the client from the spec" 16 | task :generate do 17 | spec_filename = 'open_api_spec.yaml' 18 | # Download latest spec 19 | sh "wget https://api.ynab.com/papi/#{spec_filename} -O ./#{spec_filename}" 20 | # Remove existing generated files to ensure old files are not included in the gem 21 | sh "rm -r docs/ lib/ynab/models/" 22 | # Generate the client 23 | sh "openapi-generator generate -i ./#{spec_filename} -g ruby -c openapi-generator-config.yaml -o ./" 24 | end 25 | 26 | task :get_current_version do 27 | puts YNAB::VERSION 28 | end 29 | 30 | task :bump_version_number, [:version_type] do |t, args| 31 | current_version = YNAB::VERSION 32 | new_version = current_version 33 | 34 | # Increment version number 35 | case args[:version_type] 36 | when 'major' 37 | new_version = current_version.split('.').tap { |v| v[0] = v[0].to_i + 1 }.join('.') 38 | when 'minor' 39 | new_version = current_version.split('.').tap { |v| v[1] = v[1].to_i + 1 }.join('.') 40 | when 'patch' 41 | new_version = current_version.split('.').tap { |v| v[2] = v[2].to_i + 1 }.join('.') 42 | else 43 | puts "Invalid version type: #{args[:version_type]}" 44 | exit 1 45 | end 46 | 47 | version_file_path = 'lib/ynab/version.rb' 48 | current_version_file_text = File.read(version_file_path) 49 | new_version_file_text = current_version_file_text.gsub(current_version, new_version) 50 | File.open(version_file_path, "w") {|file| file.puts new_version_file_text } 51 | 52 | puts new_version 53 | end 54 | 55 | task :commit_version_bump do 56 | sh "git add lib/ynab/version.rb Gemfile.lock && git diff-index --quiet HEAD || git commit -m 'Bumping version for release'" 57 | end 58 | 59 | desc "Bump version, run specs build a gem and release on RubyGems" 60 | task :publish => ['spec', 'commit_version_bump', 'clobber', 'release'] 61 | 62 | -------------------------------------------------------------------------------- /docs/Account.md: -------------------------------------------------------------------------------- 1 | # YNAB::Account 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **id** | **String** | | | 8 | | **name** | **String** | | | 9 | | **type** | [**AccountType**](AccountType.md) | | | 10 | | **on_budget** | **Boolean** | Whether this account is on budget or not | | 11 | | **closed** | **Boolean** | Whether this account is closed or not | | 12 | | **note** | **String** | | [optional] | 13 | | **balance** | **Integer** | The current balance of the account in milliunits format | | 14 | | **cleared_balance** | **Integer** | The current cleared balance of the account in milliunits format | | 15 | | **uncleared_balance** | **Integer** | The current uncleared balance of the account in milliunits format | | 16 | | **transfer_payee_id** | **String** | The payee id which should be used when transferring to this account | | 17 | | **direct_import_linked** | **Boolean** | Whether or not the account is linked to a financial institution for automatic transaction import. | [optional] | 18 | | **direct_import_in_error** | **Boolean** | If an account linked to a financial institution (direct_import_linked=true) and the linked connection is not in a healthy state, this will be true. | [optional] | 19 | | **last_reconciled_at** | **Time** | A date/time specifying when the account was last reconciled. | [optional] | 20 | | **debt_original_balance** | **Integer** | The original debt/loan account balance, specified in milliunits format. | [optional] | 21 | | **debt_interest_rates** | **Hash<String, Integer>** | | [optional] | 22 | | **debt_minimum_payments** | **Hash<String, Integer>** | | [optional] | 23 | | **debt_escrow_amounts** | **Hash<String, Integer>** | | [optional] | 24 | | **deleted** | **Boolean** | Whether or not the account has been deleted. Deleted accounts will only be included in delta requests. | | 25 | 26 | -------------------------------------------------------------------------------- /docs/AccountResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::AccountResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**AccountResponseData**](AccountResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/AccountResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::AccountResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **account** | [**Account**](Account.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/AccountType.md: -------------------------------------------------------------------------------- 1 | # YNAB::AccountType 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | 8 | -------------------------------------------------------------------------------- /docs/AccountsApi.md: -------------------------------------------------------------------------------- 1 | # YNAB::AccountsApi 2 | 3 | All URIs are relative to *https://api.ynab.com/v1* 4 | 5 | | Method | HTTP request | Description | 6 | | ------ | ------------ | ----------- | 7 | | [**create_account**](AccountsApi.md#create_account) | **POST** /budgets/{budget_id}/accounts | Create a new account | 8 | | [**get_account_by_id**](AccountsApi.md#get_account_by_id) | **GET** /budgets/{budget_id}/accounts/{account_id} | Single account | 9 | | [**get_accounts**](AccountsApi.md#get_accounts) | **GET** /budgets/{budget_id}/accounts | Account list | 10 | 11 | 12 | ## create_account 13 | 14 | > create_account(budget_id, data) 15 | 16 | Create a new account 17 | 18 | Creates a new account 19 | 20 | ### Parameters 21 | 22 | | Name | Type | Description | Notes | 23 | | ---- | ---- | ----------- | ----- | 24 | | **budget_id** | **String** | The id of the budget (\"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget) | | 25 | | **data** | [**PostAccountWrapper**](PostAccountWrapper.md) | The account to create. | | 26 | 27 | ### Return type 28 | 29 | [**AccountResponse**](AccountResponse.md) 30 | 31 | 32 | ## get_account_by_id 33 | 34 | > get_account_by_id(budget_id, account_id) 35 | 36 | Single account 37 | 38 | Returns a single account 39 | 40 | ### Parameters 41 | 42 | | Name | Type | Description | Notes | 43 | | ---- | ---- | ----------- | ----- | 44 | | **budget_id** | **String** | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | | 45 | | **account_id** | **String** | The id of the account | | 46 | 47 | ### Return type 48 | 49 | [**AccountResponse**](AccountResponse.md) 50 | 51 | 52 | ## get_accounts 53 | 54 | > get_accounts(budget_id, opts) 55 | 56 | Account list 57 | 58 | Returns all accounts 59 | 60 | ### Parameters 61 | 62 | | Name | Type | Description | Notes | 63 | | ---- | ---- | ----------- | ----- | 64 | | **budget_id** | **String** | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | | 65 | | **last_knowledge_of_server** | **Integer** | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. | [optional] | 66 | 67 | ### Return type 68 | 69 | [**AccountsResponse**](AccountsResponse.md) 70 | 71 | -------------------------------------------------------------------------------- /docs/AccountsResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::AccountsResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**AccountsResponseData**](AccountsResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/AccountsResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::AccountsResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **accounts** | [**Array<Account>**](Account.md) | | | 8 | | **server_knowledge** | **Integer** | The knowledge of the server | | 9 | 10 | -------------------------------------------------------------------------------- /docs/BudgetDetail.md: -------------------------------------------------------------------------------- 1 | # YNAB::BudgetDetail 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **id** | **String** | | | 8 | | **name** | **String** | | | 9 | | **last_modified_on** | **Time** | The last time any changes were made to the budget from either a web or mobile client | [optional] | 10 | | **first_month** | **Date** | The earliest budget month | [optional] | 11 | | **last_month** | **Date** | The latest budget month | [optional] | 12 | | **date_format** | [**DateFormat**](DateFormat.md) | | [optional] | 13 | | **currency_format** | [**CurrencyFormat**](CurrencyFormat.md) | | [optional] | 14 | | **accounts** | [**Array<Account>**](Account.md) | | [optional] | 15 | | **payees** | [**Array<Payee>**](Payee.md) | | [optional] | 16 | | **payee_locations** | [**Array<PayeeLocation>**](PayeeLocation.md) | | [optional] | 17 | | **category_groups** | [**Array<CategoryGroup>**](CategoryGroup.md) | | [optional] | 18 | | **categories** | [**Array<Category>**](Category.md) | | [optional] | 19 | | **months** | [**Array<MonthDetail>**](MonthDetail.md) | | [optional] | 20 | | **transactions** | [**Array<TransactionSummary>**](TransactionSummary.md) | | [optional] | 21 | | **subtransactions** | [**Array<SubTransaction>**](SubTransaction.md) | | [optional] | 22 | | **scheduled_transactions** | [**Array<ScheduledTransactionSummary>**](ScheduledTransactionSummary.md) | | [optional] | 23 | | **scheduled_subtransactions** | [**Array<ScheduledSubTransaction>**](ScheduledSubTransaction.md) | | [optional] | 24 | 25 | -------------------------------------------------------------------------------- /docs/BudgetDetailResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::BudgetDetailResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**BudgetDetailResponseData**](BudgetDetailResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/BudgetDetailResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::BudgetDetailResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **budget** | [**BudgetDetail**](BudgetDetail.md) | | | 8 | | **server_knowledge** | **Integer** | The knowledge of the server | | 9 | 10 | -------------------------------------------------------------------------------- /docs/BudgetSettings.md: -------------------------------------------------------------------------------- 1 | # YNAB::BudgetSettings 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **date_format** | [**DateFormat**](DateFormat.md) | | | 8 | | **currency_format** | [**CurrencyFormat**](CurrencyFormat.md) | | | 9 | 10 | -------------------------------------------------------------------------------- /docs/BudgetSettingsResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::BudgetSettingsResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**BudgetSettingsResponseData**](BudgetSettingsResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/BudgetSettingsResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::BudgetSettingsResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **settings** | [**BudgetSettings**](BudgetSettings.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/BudgetSummary.md: -------------------------------------------------------------------------------- 1 | # YNAB::BudgetSummary 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **id** | **String** | | | 8 | | **name** | **String** | | | 9 | | **last_modified_on** | **Time** | The last time any changes were made to the budget from either a web or mobile client | [optional] | 10 | | **first_month** | **Date** | The earliest budget month | [optional] | 11 | | **last_month** | **Date** | The latest budget month | [optional] | 12 | | **date_format** | [**DateFormat**](DateFormat.md) | | [optional] | 13 | | **currency_format** | [**CurrencyFormat**](CurrencyFormat.md) | | [optional] | 14 | | **accounts** | [**Array<Account>**](Account.md) | The budget accounts (only included if `include_accounts=true` specified as query parameter) | [optional] | 15 | 16 | -------------------------------------------------------------------------------- /docs/BudgetSummaryResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::BudgetSummaryResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**BudgetSummaryResponseData**](BudgetSummaryResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/BudgetSummaryResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::BudgetSummaryResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **budgets** | [**Array<BudgetSummary>**](BudgetSummary.md) | | | 8 | | **default_budget** | [**BudgetSummary**](BudgetSummary.md) | | [optional] | 9 | 10 | -------------------------------------------------------------------------------- /docs/BudgetsApi.md: -------------------------------------------------------------------------------- 1 | # YNAB::BudgetsApi 2 | 3 | All URIs are relative to *https://api.ynab.com/v1* 4 | 5 | | Method | HTTP request | Description | 6 | | ------ | ------------ | ----------- | 7 | | [**get_budget_by_id**](BudgetsApi.md#get_budget_by_id) | **GET** /budgets/{budget_id} | Single budget | 8 | | [**get_budget_settings_by_id**](BudgetsApi.md#get_budget_settings_by_id) | **GET** /budgets/{budget_id}/settings | Budget Settings | 9 | | [**get_budgets**](BudgetsApi.md#get_budgets) | **GET** /budgets | List budgets | 10 | 11 | 12 | ## get_budget_by_id 13 | 14 | > get_budget_by_id(budget_id, opts) 15 | 16 | Single budget 17 | 18 | Returns a single budget with all related entities. This resource is effectively a full budget export. 19 | 20 | ### Parameters 21 | 22 | | Name | Type | Description | Notes | 23 | | ---- | ---- | ----------- | ----- | 24 | | **budget_id** | **String** | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | | 25 | | **last_knowledge_of_server** | **Integer** | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. | [optional] | 26 | 27 | ### Return type 28 | 29 | [**BudgetDetailResponse**](BudgetDetailResponse.md) 30 | 31 | 32 | ## get_budget_settings_by_id 33 | 34 | > get_budget_settings_by_id(budget_id) 35 | 36 | Budget Settings 37 | 38 | Returns settings for a budget 39 | 40 | ### Parameters 41 | 42 | | Name | Type | Description | Notes | 43 | | ---- | ---- | ----------- | ----- | 44 | | **budget_id** | **String** | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | | 45 | 46 | ### Return type 47 | 48 | [**BudgetSettingsResponse**](BudgetSettingsResponse.md) 49 | 50 | 51 | ## get_budgets 52 | 53 | > get_budgets(opts) 54 | 55 | List budgets 56 | 57 | Returns budgets list with summary information 58 | 59 | ### Parameters 60 | 61 | | Name | Type | Description | Notes | 62 | | ---- | ---- | ----------- | ----- | 63 | | **include_accounts** | **Boolean** | Whether to include the list of budget accounts | [optional] | 64 | 65 | ### Return type 66 | 67 | [**BudgetSummaryResponse**](BudgetSummaryResponse.md) 68 | 69 | -------------------------------------------------------------------------------- /docs/BulkResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::BulkResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**BulkResponseData**](BulkResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/BulkResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::BulkResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **bulk** | [**BulkResponseDataBulk**](BulkResponseDataBulk.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/BulkResponseDataBulk.md: -------------------------------------------------------------------------------- 1 | # YNAB::BulkResponseDataBulk 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **transaction_ids** | **Array<String>** | The list of Transaction ids that were created. | | 8 | | **duplicate_import_ids** | **Array<String>** | If any Transactions were not created because they had an `import_id` matching a transaction already on the same account, the specified import_id(s) will be included in this list. | | 9 | 10 | -------------------------------------------------------------------------------- /docs/BulkTransactions.md: -------------------------------------------------------------------------------- 1 | # YNAB::BulkTransactions 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **transactions** | [**Array<SaveTransactionWithOptionalFields>**](SaveTransactionWithOptionalFields.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/CategoriesResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::CategoriesResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**CategoriesResponseData**](CategoriesResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/CategoriesResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::CategoriesResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **category_groups** | [**Array<CategoryGroupWithCategories>**](CategoryGroupWithCategories.md) | | | 8 | | **server_knowledge** | **Integer** | The knowledge of the server | | 9 | 10 | -------------------------------------------------------------------------------- /docs/Category.md: -------------------------------------------------------------------------------- 1 | # YNAB::Category 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **id** | **String** | | | 8 | | **category_group_id** | **String** | | | 9 | | **category_group_name** | **String** | | [optional] | 10 | | **name** | **String** | | | 11 | | **hidden** | **Boolean** | Whether or not the category is hidden | | 12 | | **original_category_group_id** | **String** | DEPRECATED: No longer used. Value will always be null. | [optional] | 13 | | **note** | **String** | | [optional] | 14 | | **budgeted** | **Integer** | Budgeted amount in milliunits format | | 15 | | **activity** | **Integer** | Activity amount in milliunits format | | 16 | | **balance** | **Integer** | Balance in milliunits format | | 17 | | **goal_type** | **String** | The type of goal, if the category has a goal (TB='Target Category Balance', TBD='Target Category Balance by Date', MF='Monthly Funding', NEED='Plan Your Spending') | [optional] | 18 | | **goal_needs_whole_amount** | **Boolean** | Indicates the monthly rollover behavior for \"NEED\"-type goals. When \"true\", the goal will always ask for the target amount in the new month (\"Set Aside\"). When \"false\", previous month category funding is used (\"Refill\"). For other goal types, this field will be null. | [optional] | 19 | | **goal_day** | **Integer** | A day offset modifier for the goal's due date. When goal_cadence is 2 (Weekly), this value specifies which day of the week the goal is due (0 = Sunday, 6 = Saturday). Otherwise, this value specifies which day of the month the goal is due (1 = 1st, 31 = 31st, null = Last day of Month). | [optional] | 20 | | **goal_cadence** | **Integer** | The goal cadence. Value in range 0-14. There are two subsets of these values which behave differently. For values 0, 1, 2, and 13, the goal's due date repeats every goal_cadence * goal_cadence_frequency, where 0 = None, 1 = Monthly, 2 = Weekly, and 13 = Yearly. For example, goal_cadence 1 with goal_cadence_frequency 2 means the goal is due every other month. For values 3-12 and 14, goal_cadence_frequency is ignored and the goal's due date repeats every goal_cadence, where 3 = Every 2 Months, 4 = Every 3 Months, ..., 12 = Every 11 Months, and 14 = Every 2 Years. | [optional] | 21 | | **goal_cadence_frequency** | **Integer** | The goal cadence frequency. When goal_cadence is 0, 1, 2, or 13, a goal's due date repeats every goal_cadence * goal_cadence_frequency. For example, goal_cadence 1 with goal_cadence_frequency 2 means the goal is due every other month. When goal_cadence is 3-12 or 14, goal_cadence_frequency is ignored. | [optional] | 22 | | **goal_creation_month** | **Date** | The month a goal was created | [optional] | 23 | | **goal_target** | **Integer** | The goal target amount in milliunits | [optional] | 24 | | **goal_target_month** | **Date** | The original target month for the goal to be completed. Only some goal types specify this date. | [optional] | 25 | | **goal_percentage_complete** | **Integer** | The percentage completion of the goal | [optional] | 26 | | **goal_months_to_budget** | **Integer** | The number of months, including the current month, left in the current goal period. | [optional] | 27 | | **goal_under_funded** | **Integer** | The amount of funding still needed in the current month to stay on track towards completing the goal within the current goal period. This amount will generally correspond to the 'Underfunded' amount in the web and mobile clients except when viewing a category with a Needed for Spending Goal in a future month. The web and mobile clients will ignore any funding from a prior goal period when viewing category with a Needed for Spending Goal in a future month. | [optional] | 28 | | **goal_overall_funded** | **Integer** | The total amount funded towards the goal within the current goal period. | [optional] | 29 | | **goal_overall_left** | **Integer** | The amount of funding still needed to complete the goal within the current goal period. | [optional] | 30 | | **deleted** | **Boolean** | Whether or not the category has been deleted. Deleted categories will only be included in delta requests. | | 31 | 32 | -------------------------------------------------------------------------------- /docs/CategoryGroup.md: -------------------------------------------------------------------------------- 1 | # YNAB::CategoryGroup 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **id** | **String** | | | 8 | | **name** | **String** | | | 9 | | **hidden** | **Boolean** | Whether or not the category group is hidden | | 10 | | **deleted** | **Boolean** | Whether or not the category group has been deleted. Deleted category groups will only be included in delta requests. | | 11 | 12 | -------------------------------------------------------------------------------- /docs/CategoryGroupWithCategories.md: -------------------------------------------------------------------------------- 1 | # YNAB::CategoryGroupWithCategories 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **id** | **String** | | | 8 | | **name** | **String** | | | 9 | | **hidden** | **Boolean** | Whether or not the category group is hidden | | 10 | | **deleted** | **Boolean** | Whether or not the category group has been deleted. Deleted category groups will only be included in delta requests. | | 11 | | **categories** | [**Array<Category>**](Category.md) | Category group categories. Amounts (budgeted, activity, balance, etc.) are specific to the current budget month (UTC). | | 12 | 13 | -------------------------------------------------------------------------------- /docs/CategoryResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::CategoryResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**CategoryResponseData**](CategoryResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/CategoryResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::CategoryResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **category** | [**Category**](Category.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/CurrencyFormat.md: -------------------------------------------------------------------------------- 1 | # YNAB::CurrencyFormat 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **iso_code** | **String** | | | 8 | | **example_format** | **String** | | | 9 | | **decimal_digits** | **Integer** | | | 10 | | **decimal_separator** | **String** | | | 11 | | **symbol_first** | **Boolean** | | | 12 | | **group_separator** | **String** | | | 13 | | **currency_symbol** | **String** | | | 14 | | **display_symbol** | **Boolean** | | | 15 | 16 | -------------------------------------------------------------------------------- /docs/DateFormat.md: -------------------------------------------------------------------------------- 1 | # YNAB::DateFormat 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **format** | **String** | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/ErrorDetail.md: -------------------------------------------------------------------------------- 1 | # YNAB::ErrorDetail 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **id** | **String** | | | 8 | | **name** | **String** | | | 9 | | **detail** | **String** | | | 10 | 11 | -------------------------------------------------------------------------------- /docs/ErrorResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::ErrorResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **error** | [**ErrorDetail**](ErrorDetail.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/ExistingTransaction.md: -------------------------------------------------------------------------------- 1 | # YNAB::ExistingTransaction 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **account_id** | **String** | | [optional] | 8 | | **date** | **Date** | The transaction date in ISO format (e.g. 2016-12-01). Future dates (scheduled transactions) are not permitted. Split transaction dates cannot be changed and if a different date is supplied it will be ignored. | [optional] | 9 | | **amount** | **Integer** | The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored. | [optional] | 10 | | **payee_id** | **String** | The payee for the transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as `transfer_payee_id` on the account resource. | [optional] | 11 | | **payee_name** | **String** | The payee name. If a `payee_name` value is provided and `payee_id` has a null value, the `payee_name` value will be used to resolve the payee by either (1) a matching payee rename rule (only if `import_id` is also specified) or (2) a payee with the same name or (3) creation of a new payee. | [optional] | 12 | | **category_id** | **String** | The category for the transaction. To configure a split transaction, you can specify null for `category_id` and provide a `subtransactions` array as part of the transaction object. If an existing transaction is a split, the `category_id` cannot be changed. Credit Card Payment categories are not permitted and will be ignored if supplied. | [optional] | 13 | | **memo** | **String** | | [optional] | 14 | | **cleared** | [**TransactionClearedStatus**](TransactionClearedStatus.md) | | [optional] | 15 | | **approved** | **Boolean** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional] | 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] | 18 | 19 | -------------------------------------------------------------------------------- /docs/HybridTransaction.md: -------------------------------------------------------------------------------- 1 | # YNAB::HybridTransaction 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **id** | **String** | | | 8 | | **date** | **Date** | The transaction date in ISO format (e.g. 2016-12-01) | | 9 | | **amount** | **Integer** | The transaction amount in milliunits format | | 10 | | **memo** | **String** | | [optional] | 11 | | **cleared** | [**TransactionClearedStatus**](TransactionClearedStatus.md) | | | 12 | | **approved** | **Boolean** | Whether or not the transaction is approved | | 13 | | **flag_color** | [**TransactionFlagColor**](TransactionFlagColor.md) | | [optional] | 14 | | **flag_name** | **String** | The customized name of a transaction flag | [optional] | 15 | | **account_id** | **String** | | | 16 | | **payee_id** | **String** | | [optional] | 17 | | **category_id** | **String** | | [optional] | 18 | | **transfer_account_id** | **String** | If a transfer transaction, the account to which it transfers | [optional] | 19 | | **transfer_transaction_id** | **String** | If a transfer transaction, the id of transaction on the other side of the transfer | [optional] | 20 | | **matched_transaction_id** | **String** | If transaction is matched, the id of the matched transaction | [optional] | 21 | | **import_id** | **String** | If the transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. | [optional] | 22 | | **import_payee_name** | **String** | If the transaction was imported, the payee name that was used when importing and before applying any payee rename rules | [optional] | 23 | | **import_payee_name_original** | **String** | If the transaction was imported, the original payee name as it appeared on the statement | [optional] | 24 | | **debt_transaction_type** | **String** | If the transaction is a debt/loan account transaction, the type of transaction | [optional] | 25 | | **deleted** | **Boolean** | Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests. | | 26 | | **type** | **String** | Whether the hybrid transaction represents a regular transaction or a subtransaction | | 27 | | **parent_transaction_id** | **String** | For subtransaction types, this is the id of the parent transaction. For transaction types, this id will be always be null. | [optional] | 28 | | **account_name** | **String** | | | 29 | | **payee_name** | **String** | | [optional] | 30 | | **category_name** | **String** | The name of the category. If a split transaction, this will be 'Split'. | [optional] | 31 | 32 | -------------------------------------------------------------------------------- /docs/HybridTransactionsResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::HybridTransactionsResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**HybridTransactionsResponseData**](HybridTransactionsResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/HybridTransactionsResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::HybridTransactionsResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **transactions** | [**Array<HybridTransaction>**](HybridTransaction.md) | | | 8 | | **server_knowledge** | **Integer** | The knowledge of the server | [optional] | 9 | 10 | -------------------------------------------------------------------------------- /docs/MonthDetail.md: -------------------------------------------------------------------------------- 1 | # YNAB::MonthDetail 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **month** | **Date** | | | 8 | | **note** | **String** | | [optional] | 9 | | **income** | **Integer** | The total amount of transactions categorized to 'Inflow: Ready to Assign' in the month | | 10 | | **budgeted** | **Integer** | The total amount budgeted in the month | | 11 | | **activity** | **Integer** | The total amount of transactions in the month, excluding those categorized to 'Inflow: Ready to Assign' | | 12 | | **to_be_budgeted** | **Integer** | The available amount for 'Ready to Assign' | | 13 | | **age_of_money** | **Integer** | The Age of Money as of the month | [optional] | 14 | | **deleted** | **Boolean** | Whether or not the month has been deleted. Deleted months will only be included in delta requests. | | 15 | | **categories** | [**Array<Category>**](Category.md) | The budget month categories. Amounts (budgeted, activity, balance, etc.) are specific to the {month} parameter specified. | | 16 | 17 | -------------------------------------------------------------------------------- /docs/MonthDetailResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::MonthDetailResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**MonthDetailResponseData**](MonthDetailResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/MonthDetailResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::MonthDetailResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **month** | [**MonthDetail**](MonthDetail.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/MonthSummariesResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::MonthSummariesResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**MonthSummariesResponseData**](MonthSummariesResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/MonthSummariesResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::MonthSummariesResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **months** | [**Array<MonthSummary>**](MonthSummary.md) | | | 8 | | **server_knowledge** | **Integer** | The knowledge of the server | | 9 | 10 | -------------------------------------------------------------------------------- /docs/MonthSummary.md: -------------------------------------------------------------------------------- 1 | # YNAB::MonthSummary 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **month** | **Date** | | | 8 | | **note** | **String** | | [optional] | 9 | | **income** | **Integer** | The total amount of transactions categorized to 'Inflow: Ready to Assign' in the month | | 10 | | **budgeted** | **Integer** | The total amount budgeted in the month | | 11 | | **activity** | **Integer** | The total amount of transactions in the month, excluding those categorized to 'Inflow: Ready to Assign' | | 12 | | **to_be_budgeted** | **Integer** | The available amount for 'Ready to Assign' | | 13 | | **age_of_money** | **Integer** | The Age of Money as of the month | [optional] | 14 | | **deleted** | **Boolean** | Whether or not the month has been deleted. Deleted months will only be included in delta requests. | | 15 | 16 | -------------------------------------------------------------------------------- /docs/MonthsApi.md: -------------------------------------------------------------------------------- 1 | # YNAB::MonthsApi 2 | 3 | All URIs are relative to *https://api.ynab.com/v1* 4 | 5 | | Method | HTTP request | Description | 6 | | ------ | ------------ | ----------- | 7 | | [**get_budget_month**](MonthsApi.md#get_budget_month) | **GET** /budgets/{budget_id}/months/{month} | Single budget month | 8 | | [**get_budget_months**](MonthsApi.md#get_budget_months) | **GET** /budgets/{budget_id}/months | List budget months | 9 | 10 | 11 | ## get_budget_month 12 | 13 | > get_budget_month(budget_id, month) 14 | 15 | Single budget month 16 | 17 | Returns a single budget month 18 | 19 | ### Parameters 20 | 21 | | Name | Type | Description | Notes | 22 | | ---- | ---- | ----------- | ----- | 23 | | **budget_id** | **String** | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | | 24 | | **month** | **Date** | The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) | | 25 | 26 | ### Return type 27 | 28 | [**MonthDetailResponse**](MonthDetailResponse.md) 29 | 30 | 31 | ## get_budget_months 32 | 33 | > get_budget_months(budget_id, opts) 34 | 35 | List budget months 36 | 37 | Returns all budget months 38 | 39 | ### Parameters 40 | 41 | | Name | Type | Description | Notes | 42 | | ---- | ---- | ----------- | ----- | 43 | | **budget_id** | **String** | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | | 44 | | **last_knowledge_of_server** | **Integer** | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. | [optional] | 45 | 46 | ### Return type 47 | 48 | [**MonthSummariesResponse**](MonthSummariesResponse.md) 49 | 50 | -------------------------------------------------------------------------------- /docs/NewTransaction.md: -------------------------------------------------------------------------------- 1 | # YNAB::NewTransaction 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **account_id** | **String** | | [optional] | 8 | | **date** | **Date** | The transaction date in ISO format (e.g. 2016-12-01). Future dates (scheduled transactions) are not permitted. Split transaction dates cannot be changed and if a different date is supplied it will be ignored. | [optional] | 9 | | **amount** | **Integer** | The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored. | [optional] | 10 | | **payee_id** | **String** | The payee for the transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as `transfer_payee_id` on the account resource. | [optional] | 11 | | **payee_name** | **String** | The payee name. If a `payee_name` value is provided and `payee_id` has a null value, the `payee_name` value will be used to resolve the payee by either (1) a matching payee rename rule (only if `import_id` is also specified) or (2) a payee with the same name or (3) creation of a new payee. | [optional] | 12 | | **category_id** | **String** | The category for the transaction. To configure a split transaction, you can specify null for `category_id` and provide a `subtransactions` array as part of the transaction object. If an existing transaction is a split, the `category_id` cannot be changed. Credit Card Payment categories are not permitted and will be ignored if supplied. | [optional] | 13 | | **memo** | **String** | | [optional] | 14 | | **cleared** | [**TransactionClearedStatus**](TransactionClearedStatus.md) | | [optional] | 15 | | **approved** | **Boolean** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional] | 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] | 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 | 20 | -------------------------------------------------------------------------------- /docs/PatchCategoryWrapper.md: -------------------------------------------------------------------------------- 1 | # YNAB::PatchCategoryWrapper 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **category** | [**SaveCategory**](SaveCategory.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/PatchMonthCategoryWrapper.md: -------------------------------------------------------------------------------- 1 | # YNAB::PatchMonthCategoryWrapper 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **category** | [**SaveMonthCategory**](SaveMonthCategory.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/PatchPayeeWrapper.md: -------------------------------------------------------------------------------- 1 | # YNAB::PatchPayeeWrapper 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **payee** | [**SavePayee**](SavePayee.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/PatchTransactionsWrapper.md: -------------------------------------------------------------------------------- 1 | # YNAB::PatchTransactionsWrapper 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **transactions** | [**Array<SaveTransactionWithIdOrImportId>**](SaveTransactionWithIdOrImportId.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/Payee.md: -------------------------------------------------------------------------------- 1 | # YNAB::Payee 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **id** | **String** | | | 8 | | **name** | **String** | | | 9 | | **transfer_account_id** | **String** | If a transfer payee, the `account_id` to which this payee transfers to | [optional] | 10 | | **deleted** | **Boolean** | Whether or not the payee has been deleted. Deleted payees will only be included in delta requests. | | 11 | 12 | -------------------------------------------------------------------------------- /docs/PayeeLocation.md: -------------------------------------------------------------------------------- 1 | # YNAB::PayeeLocation 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **id** | **String** | | | 8 | | **payee_id** | **String** | | | 9 | | **latitude** | **String** | | | 10 | | **longitude** | **String** | | | 11 | | **deleted** | **Boolean** | Whether or not the payee location has been deleted. Deleted payee locations will only be included in delta requests. | | 12 | 13 | -------------------------------------------------------------------------------- /docs/PayeeLocationResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::PayeeLocationResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**PayeeLocationResponseData**](PayeeLocationResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/PayeeLocationResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::PayeeLocationResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **payee_location** | [**PayeeLocation**](PayeeLocation.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/PayeeLocationsApi.md: -------------------------------------------------------------------------------- 1 | # YNAB::PayeeLocationsApi 2 | 3 | All URIs are relative to *https://api.ynab.com/v1* 4 | 5 | | Method | HTTP request | Description | 6 | | ------ | ------------ | ----------- | 7 | | [**get_payee_location_by_id**](PayeeLocationsApi.md#get_payee_location_by_id) | **GET** /budgets/{budget_id}/payee_locations/{payee_location_id} | Single payee location | 8 | | [**get_payee_locations**](PayeeLocationsApi.md#get_payee_locations) | **GET** /budgets/{budget_id}/payee_locations | List payee locations | 9 | | [**get_payee_locations_by_payee**](PayeeLocationsApi.md#get_payee_locations_by_payee) | **GET** /budgets/{budget_id}/payees/{payee_id}/payee_locations | List locations for a payee | 10 | 11 | 12 | ## get_payee_location_by_id 13 | 14 | > get_payee_location_by_id(budget_id, payee_location_id) 15 | 16 | Single payee location 17 | 18 | Returns a single payee location 19 | 20 | ### Parameters 21 | 22 | | Name | Type | Description | Notes | 23 | | ---- | ---- | ----------- | ----- | 24 | | **budget_id** | **String** | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | | 25 | | **payee_location_id** | **String** | id of payee location | | 26 | 27 | ### Return type 28 | 29 | [**PayeeLocationResponse**](PayeeLocationResponse.md) 30 | 31 | 32 | ## get_payee_locations 33 | 34 | > get_payee_locations(budget_id) 35 | 36 | List payee locations 37 | 38 | Returns all payee locations 39 | 40 | ### Parameters 41 | 42 | | Name | Type | Description | Notes | 43 | | ---- | ---- | ----------- | ----- | 44 | | **budget_id** | **String** | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | | 45 | 46 | ### Return type 47 | 48 | [**PayeeLocationsResponse**](PayeeLocationsResponse.md) 49 | 50 | 51 | ## get_payee_locations_by_payee 52 | 53 | > get_payee_locations_by_payee(budget_id, payee_id) 54 | 55 | List locations for a payee 56 | 57 | Returns all payee locations for a specified payee 58 | 59 | ### Parameters 60 | 61 | | Name | Type | Description | Notes | 62 | | ---- | ---- | ----------- | ----- | 63 | | **budget_id** | **String** | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | | 64 | | **payee_id** | **String** | id of payee | | 65 | 66 | ### Return type 67 | 68 | [**PayeeLocationsResponse**](PayeeLocationsResponse.md) 69 | 70 | -------------------------------------------------------------------------------- /docs/PayeeLocationsResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::PayeeLocationsResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**PayeeLocationsResponseData**](PayeeLocationsResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/PayeeLocationsResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::PayeeLocationsResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **payee_locations** | [**Array<PayeeLocation>**](PayeeLocation.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/PayeeResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::PayeeResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**PayeeResponseData**](PayeeResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/PayeeResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::PayeeResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **payee** | [**Payee**](Payee.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/PayeesApi.md: -------------------------------------------------------------------------------- 1 | # YNAB::PayeesApi 2 | 3 | All URIs are relative to *https://api.ynab.com/v1* 4 | 5 | | Method | HTTP request | Description | 6 | | ------ | ------------ | ----------- | 7 | | [**get_payee_by_id**](PayeesApi.md#get_payee_by_id) | **GET** /budgets/{budget_id}/payees/{payee_id} | Single payee | 8 | | [**get_payees**](PayeesApi.md#get_payees) | **GET** /budgets/{budget_id}/payees | List payees | 9 | | [**update_payee**](PayeesApi.md#update_payee) | **PATCH** /budgets/{budget_id}/payees/{payee_id} | Update a payee | 10 | 11 | 12 | ## get_payee_by_id 13 | 14 | > get_payee_by_id(budget_id, payee_id) 15 | 16 | Single payee 17 | 18 | Returns a single payee 19 | 20 | ### Parameters 21 | 22 | | Name | Type | Description | Notes | 23 | | ---- | ---- | ----------- | ----- | 24 | | **budget_id** | **String** | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | | 25 | | **payee_id** | **String** | The id of the payee | | 26 | 27 | ### Return type 28 | 29 | [**PayeeResponse**](PayeeResponse.md) 30 | 31 | 32 | ## get_payees 33 | 34 | > get_payees(budget_id, opts) 35 | 36 | List payees 37 | 38 | Returns all payees 39 | 40 | ### Parameters 41 | 42 | | Name | Type | Description | Notes | 43 | | ---- | ---- | ----------- | ----- | 44 | | **budget_id** | **String** | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | | 45 | | **last_knowledge_of_server** | **Integer** | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. | [optional] | 46 | 47 | ### Return type 48 | 49 | [**PayeesResponse**](PayeesResponse.md) 50 | 51 | 52 | ## update_payee 53 | 54 | > update_payee(budget_id, payee_id, data) 55 | 56 | Update a payee 57 | 58 | Update a payee 59 | 60 | ### Parameters 61 | 62 | | Name | Type | Description | Notes | 63 | | ---- | ---- | ----------- | ----- | 64 | | **budget_id** | **String** | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | | 65 | | **payee_id** | **String** | The id of the payee | | 66 | | **data** | [**PatchPayeeWrapper**](PatchPayeeWrapper.md) | The payee to update | | 67 | 68 | ### Return type 69 | 70 | [**SavePayeeResponse**](SavePayeeResponse.md) 71 | 72 | -------------------------------------------------------------------------------- /docs/PayeesResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::PayeesResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**PayeesResponseData**](PayeesResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/PayeesResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::PayeesResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **payees** | [**Array<Payee>**](Payee.md) | | | 8 | | **server_knowledge** | **Integer** | The knowledge of the server | | 9 | 10 | -------------------------------------------------------------------------------- /docs/PostAccountWrapper.md: -------------------------------------------------------------------------------- 1 | # YNAB::PostAccountWrapper 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **account** | [**SaveAccount**](SaveAccount.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/PostScheduledTransactionWrapper.md: -------------------------------------------------------------------------------- 1 | # YNAB::PostScheduledTransactionWrapper 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **scheduled_transaction** | [**SaveScheduledTransaction**](SaveScheduledTransaction.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/PostTransactionsWrapper.md: -------------------------------------------------------------------------------- 1 | # YNAB::PostTransactionsWrapper 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **transaction** | [**NewTransaction**](NewTransaction.md) | | [optional] | 8 | | **transactions** | [**Array<NewTransaction>**](NewTransaction.md) | | [optional] | 9 | 10 | -------------------------------------------------------------------------------- /docs/PutScheduledTransactionWrapper.md: -------------------------------------------------------------------------------- 1 | # YNAB::PutScheduledTransactionWrapper 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **scheduled_transaction** | [**SaveScheduledTransaction**](SaveScheduledTransaction.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/PutTransactionWrapper.md: -------------------------------------------------------------------------------- 1 | # YNAB::PutTransactionWrapper 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **transaction** | [**ExistingTransaction**](ExistingTransaction.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/SaveAccount.md: -------------------------------------------------------------------------------- 1 | # YNAB::SaveAccount 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **name** | **String** | The name of the account | | 8 | | **type** | [**AccountType**](AccountType.md) | | | 9 | | **balance** | **Integer** | The current balance of the account in milliunits format | | 10 | 11 | -------------------------------------------------------------------------------- /docs/SaveCategory.md: -------------------------------------------------------------------------------- 1 | # YNAB::SaveCategory 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **name** | **String** | | [optional] | 8 | | **note** | **String** | | [optional] | 9 | | **category_group_id** | **String** | | [optional] | 10 | | **goal_target** | **Integer** | The goal target amount in milliunits format. This amount can only be changed if the category already has a configured goal (goal_type != null). | [optional] | 11 | 12 | -------------------------------------------------------------------------------- /docs/SaveCategoryResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::SaveCategoryResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**SaveCategoryResponseData**](SaveCategoryResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/SaveCategoryResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::SaveCategoryResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **category** | [**Category**](Category.md) | | | 8 | | **server_knowledge** | **Integer** | The knowledge of the server | | 9 | 10 | -------------------------------------------------------------------------------- /docs/SaveMonthCategory.md: -------------------------------------------------------------------------------- 1 | # YNAB::SaveMonthCategory 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **budgeted** | **Integer** | Budgeted amount in milliunits format | | 8 | 9 | -------------------------------------------------------------------------------- /docs/SavePayee.md: -------------------------------------------------------------------------------- 1 | # YNAB::SavePayee 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **name** | **String** | The name of the payee. The name must be a maximum of 500 characters. | [optional] | 8 | 9 | -------------------------------------------------------------------------------- /docs/SavePayeeResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::SavePayeeResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**SavePayeeResponseData**](SavePayeeResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/SavePayeeResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::SavePayeeResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **payee** | [**Payee**](Payee.md) | | | 8 | | **server_knowledge** | **Integer** | The knowledge of the server | | 9 | 10 | -------------------------------------------------------------------------------- /docs/SaveScheduledTransaction.md: -------------------------------------------------------------------------------- 1 | # YNAB::SaveScheduledTransaction 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **account_id** | **String** | | | 8 | | **date** | **Date** | The scheduled transaction date in ISO format (e.g. 2016-12-01). This should be a future date no more than 5 years into the future. | | 9 | | **amount** | **Integer** | The scheduled transaction amount in milliunits format. | [optional] | 10 | | **payee_id** | **String** | The payee for the scheduled transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as `transfer_payee_id` on the account resource. | [optional] | 11 | | **payee_name** | **String** | The payee name for the the scheduled transaction. If a `payee_name` value is provided and `payee_id` has a null value, the `payee_name` value will be used to resolve the payee by either (1) a payee with the same name or (2) creation of a new payee. | [optional] | 12 | | **category_id** | **String** | The category for the scheduled transaction. Credit Card Payment categories are not permitted. Creating a split scheduled transaction is not currently supported. | [optional] | 13 | | **memo** | **String** | | [optional] | 14 | | **flag_color** | [**TransactionFlagColor**](TransactionFlagColor.md) | | [optional] | 15 | | **frequency** | [**ScheduledTransactionFrequency**](ScheduledTransactionFrequency.md) | | [optional] | 16 | 17 | -------------------------------------------------------------------------------- /docs/SaveSubTransaction.md: -------------------------------------------------------------------------------- 1 | # YNAB::SaveSubTransaction 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **amount** | **Integer** | The subtransaction amount in milliunits format. | | 8 | | **payee_id** | **String** | The payee for the subtransaction. | [optional] | 9 | | **payee_name** | **String** | The payee name. If a `payee_name` value is provided and `payee_id` has a null value, the `payee_name` value will be used to resolve the payee by either (1) a matching payee rename rule (only if import_id is also specified on parent transaction) or (2) a payee with the same name or (3) creation of a new payee. | [optional] | 10 | | **category_id** | **String** | The category for the subtransaction. Credit Card Payment categories are not permitted and will be ignored if supplied. | [optional] | 11 | | **memo** | **String** | | [optional] | 12 | 13 | -------------------------------------------------------------------------------- /docs/SaveTransactionWithIdOrImportId.md: -------------------------------------------------------------------------------- 1 | # YNAB::SaveTransactionWithIdOrImportId 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **account_id** | **String** | | [optional] | 8 | | **date** | **Date** | The transaction date in ISO format (e.g. 2016-12-01). Future dates (scheduled transactions) are not permitted. Split transaction dates cannot be changed and if a different date is supplied it will be ignored. | [optional] | 9 | | **amount** | **Integer** | The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored. | [optional] | 10 | | **payee_id** | **String** | The payee for the transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as `transfer_payee_id` on the account resource. | [optional] | 11 | | **payee_name** | **String** | The payee name. If a `payee_name` value is provided and `payee_id` has a null value, the `payee_name` value will be used to resolve the payee by either (1) a matching payee rename rule (only if `import_id` is also specified) or (2) a payee with the same name or (3) creation of a new payee. | [optional] | 12 | | **category_id** | **String** | The category for the transaction. To configure a split transaction, you can specify null for `category_id` and provide a `subtransactions` array as part of the transaction object. If an existing transaction is a split, the `category_id` cannot be changed. Credit Card Payment categories are not permitted and will be ignored if supplied. | [optional] | 13 | | **memo** | **String** | | [optional] | 14 | | **cleared** | [**TransactionClearedStatus**](TransactionClearedStatus.md) | | [optional] | 15 | | **approved** | **Boolean** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional] | 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] | 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 | | **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 | 21 | -------------------------------------------------------------------------------- /docs/SaveTransactionWithOptionalFields.md: -------------------------------------------------------------------------------- 1 | # YNAB::SaveTransactionWithOptionalFields 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **account_id** | **String** | | [optional] | 8 | | **date** | **Date** | The transaction date in ISO format (e.g. 2016-12-01). Future dates (scheduled transactions) are not permitted. Split transaction dates cannot be changed and if a different date is supplied it will be ignored. | [optional] | 9 | | **amount** | **Integer** | The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored. | [optional] | 10 | | **payee_id** | **String** | The payee for the transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as `transfer_payee_id` on the account resource. | [optional] | 11 | | **payee_name** | **String** | The payee name. If a `payee_name` value is provided and `payee_id` has a null value, the `payee_name` value will be used to resolve the payee by either (1) a matching payee rename rule (only if `import_id` is also specified) or (2) a payee with the same name or (3) creation of a new payee. | [optional] | 12 | | **category_id** | **String** | The category for the transaction. To configure a split transaction, you can specify null for `category_id` and provide a `subtransactions` array as part of the transaction object. If an existing transaction is a split, the `category_id` cannot be changed. Credit Card Payment categories are not permitted and will be ignored if supplied. | [optional] | 13 | | **memo** | **String** | | [optional] | 14 | | **cleared** | [**TransactionClearedStatus**](TransactionClearedStatus.md) | | [optional] | 15 | | **approved** | **Boolean** | Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default. | [optional] | 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] | 18 | 19 | -------------------------------------------------------------------------------- /docs/SaveTransactionsResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::SaveTransactionsResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**SaveTransactionsResponseData**](SaveTransactionsResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/SaveTransactionsResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::SaveTransactionsResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **transaction_ids** | **Array<String>** | The transaction ids that were saved | | 8 | | **transaction** | [**TransactionDetail**](TransactionDetail.md) | | [optional] | 9 | | **transactions** | [**Array<TransactionDetail>**](TransactionDetail.md) | If multiple transactions were specified, the transactions that were saved | [optional] | 10 | | **duplicate_import_ids** | **Array<String>** | If multiple transactions were specified, a list of import_ids that were not created because of an existing `import_id` found on the same account | [optional] | 11 | | **server_knowledge** | **Integer** | The knowledge of the server | | 12 | 13 | -------------------------------------------------------------------------------- /docs/ScheduledSubTransaction.md: -------------------------------------------------------------------------------- 1 | # YNAB::ScheduledSubTransaction 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **id** | **String** | | | 8 | | **scheduled_transaction_id** | **String** | | | 9 | | **amount** | **Integer** | The scheduled subtransaction amount in milliunits format | | 10 | | **memo** | **String** | | [optional] | 11 | | **payee_id** | **String** | | [optional] | 12 | | **payee_name** | **String** | | [optional] | 13 | | **category_id** | **String** | | [optional] | 14 | | **category_name** | **String** | | [optional] | 15 | | **transfer_account_id** | **String** | If a transfer, the account_id which the scheduled subtransaction transfers to | [optional] | 16 | | **deleted** | **Boolean** | Whether or not the scheduled subtransaction has been deleted. Deleted scheduled subtransactions will only be included in delta requests. | | 17 | 18 | -------------------------------------------------------------------------------- /docs/ScheduledTransactionDetail.md: -------------------------------------------------------------------------------- 1 | # YNAB::ScheduledTransactionDetail 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **id** | **String** | | | 8 | | **date_first** | **Date** | The first date for which the Scheduled Transaction was scheduled. | | 9 | | **date_next** | **Date** | The next date for which the Scheduled Transaction is scheduled. | | 10 | | **frequency** | **String** | | | 11 | | **amount** | **Integer** | The scheduled transaction amount in milliunits format | | 12 | | **memo** | **String** | | [optional] | 13 | | **flag_color** | [**TransactionFlagColor**](TransactionFlagColor.md) | | [optional] | 14 | | **flag_name** | **String** | The customized name of a transaction flag | [optional] | 15 | | **account_id** | **String** | | | 16 | | **payee_id** | **String** | | [optional] | 17 | | **category_id** | **String** | | [optional] | 18 | | **transfer_account_id** | **String** | If a transfer, the account_id which the scheduled transaction transfers to | [optional] | 19 | | **deleted** | **Boolean** | Whether or not the scheduled transaction has been deleted. Deleted scheduled transactions will only be included in delta requests. | | 20 | | **account_name** | **String** | | | 21 | | **payee_name** | **String** | | [optional] | 22 | | **category_name** | **String** | The name of the category. If a split scheduled transaction, this will be 'Split'. | [optional] | 23 | | **subtransactions** | [**Array<ScheduledSubTransaction>**](ScheduledSubTransaction.md) | If a split scheduled transaction, the subtransactions. | | 24 | 25 | -------------------------------------------------------------------------------- /docs/ScheduledTransactionFrequency.md: -------------------------------------------------------------------------------- 1 | # YNAB::ScheduledTransactionFrequency 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | 8 | -------------------------------------------------------------------------------- /docs/ScheduledTransactionResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::ScheduledTransactionResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**ScheduledTransactionResponseData**](ScheduledTransactionResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/ScheduledTransactionResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::ScheduledTransactionResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **scheduled_transaction** | [**ScheduledTransactionDetail**](ScheduledTransactionDetail.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/ScheduledTransactionSummary.md: -------------------------------------------------------------------------------- 1 | # YNAB::ScheduledTransactionSummary 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **id** | **String** | | | 8 | | **date_first** | **Date** | The first date for which the Scheduled Transaction was scheduled. | | 9 | | **date_next** | **Date** | The next date for which the Scheduled Transaction is scheduled. | | 10 | | **frequency** | **String** | | | 11 | | **amount** | **Integer** | The scheduled transaction amount in milliunits format | | 12 | | **memo** | **String** | | [optional] | 13 | | **flag_color** | [**TransactionFlagColor**](TransactionFlagColor.md) | | [optional] | 14 | | **flag_name** | **String** | The customized name of a transaction flag | [optional] | 15 | | **account_id** | **String** | | | 16 | | **payee_id** | **String** | | [optional] | 17 | | **category_id** | **String** | | [optional] | 18 | | **transfer_account_id** | **String** | If a transfer, the account_id which the scheduled transaction transfers to | [optional] | 19 | | **deleted** | **Boolean** | Whether or not the scheduled transaction has been deleted. Deleted scheduled transactions will only be included in delta requests. | | 20 | 21 | -------------------------------------------------------------------------------- /docs/ScheduledTransactionsApi.md: -------------------------------------------------------------------------------- 1 | # YNAB::ScheduledTransactionsApi 2 | 3 | All URIs are relative to *https://api.ynab.com/v1* 4 | 5 | | Method | HTTP request | Description | 6 | | ------ | ------------ | ----------- | 7 | | [**create_scheduled_transaction**](ScheduledTransactionsApi.md#create_scheduled_transaction) | **POST** /budgets/{budget_id}/scheduled_transactions | Create a single scheduled transaction | 8 | | [**delete_scheduled_transaction**](ScheduledTransactionsApi.md#delete_scheduled_transaction) | **DELETE** /budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id} | Deletes an existing scheduled transaction | 9 | | [**get_scheduled_transaction_by_id**](ScheduledTransactionsApi.md#get_scheduled_transaction_by_id) | **GET** /budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id} | Single scheduled transaction | 10 | | [**get_scheduled_transactions**](ScheduledTransactionsApi.md#get_scheduled_transactions) | **GET** /budgets/{budget_id}/scheduled_transactions | List scheduled transactions | 11 | | [**update_scheduled_transaction**](ScheduledTransactionsApi.md#update_scheduled_transaction) | **PUT** /budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id} | Updates an existing scheduled transaction | 12 | 13 | 14 | ## create_scheduled_transaction 15 | 16 | > create_scheduled_transaction(budget_id, data) 17 | 18 | Create a single scheduled transaction 19 | 20 | Creates a single scheduled transaction (a transaction with a future date). 21 | 22 | ### Parameters 23 | 24 | | Name | Type | Description | Notes | 25 | | ---- | ---- | ----------- | ----- | 26 | | **budget_id** | **String** | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | | 27 | | **data** | [**PostScheduledTransactionWrapper**](PostScheduledTransactionWrapper.md) | The scheduled transaction to create | | 28 | 29 | ### Return type 30 | 31 | [**ScheduledTransactionResponse**](ScheduledTransactionResponse.md) 32 | 33 | 34 | ## delete_scheduled_transaction 35 | 36 | > delete_scheduled_transaction(budget_id, scheduled_transaction_id) 37 | 38 | Deletes an existing scheduled transaction 39 | 40 | Deletes a scheduled transaction 41 | 42 | ### Parameters 43 | 44 | | Name | Type | Description | Notes | 45 | | ---- | ---- | ----------- | ----- | 46 | | **budget_id** | **String** | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | | 47 | | **scheduled_transaction_id** | **String** | The id of the scheduled transaction | | 48 | 49 | ### Return type 50 | 51 | [**ScheduledTransactionResponse**](ScheduledTransactionResponse.md) 52 | 53 | 54 | ## get_scheduled_transaction_by_id 55 | 56 | > get_scheduled_transaction_by_id(budget_id, scheduled_transaction_id) 57 | 58 | Single scheduled transaction 59 | 60 | Returns a single scheduled transaction 61 | 62 | ### Parameters 63 | 64 | | Name | Type | Description | Notes | 65 | | ---- | ---- | ----------- | ----- | 66 | | **budget_id** | **String** | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | | 67 | | **scheduled_transaction_id** | **String** | The id of the scheduled transaction | | 68 | 69 | ### Return type 70 | 71 | [**ScheduledTransactionResponse**](ScheduledTransactionResponse.md) 72 | 73 | 74 | ## get_scheduled_transactions 75 | 76 | > get_scheduled_transactions(budget_id, opts) 77 | 78 | List scheduled transactions 79 | 80 | Returns all scheduled transactions 81 | 82 | ### Parameters 83 | 84 | | Name | Type | Description | Notes | 85 | | ---- | ---- | ----------- | ----- | 86 | | **budget_id** | **String** | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | | 87 | | **last_knowledge_of_server** | **Integer** | The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. | [optional] | 88 | 89 | ### Return type 90 | 91 | [**ScheduledTransactionsResponse**](ScheduledTransactionsResponse.md) 92 | 93 | 94 | ## update_scheduled_transaction 95 | 96 | > update_scheduled_transaction(budget_id, scheduled_transaction_id, put_scheduled_transaction_wrapper) 97 | 98 | Updates an existing scheduled transaction 99 | 100 | Updates a single scheduled transaction 101 | 102 | ### Parameters 103 | 104 | | Name | Type | Description | Notes | 105 | | ---- | ---- | ----------- | ----- | 106 | | **budget_id** | **String** | The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). | | 107 | | **scheduled_transaction_id** | **String** | The id of the scheduled transaction | | 108 | | **put_scheduled_transaction_wrapper** | [**PutScheduledTransactionWrapper**](PutScheduledTransactionWrapper.md) | The scheduled transaction to update | | 109 | 110 | ### Return type 111 | 112 | [**ScheduledTransactionResponse**](ScheduledTransactionResponse.md) 113 | 114 | -------------------------------------------------------------------------------- /docs/ScheduledTransactionsResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::ScheduledTransactionsResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**ScheduledTransactionsResponseData**](ScheduledTransactionsResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/ScheduledTransactionsResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::ScheduledTransactionsResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **scheduled_transactions** | [**Array<ScheduledTransactionDetail>**](ScheduledTransactionDetail.md) | | | 8 | | **server_knowledge** | **Integer** | The knowledge of the server | | 9 | 10 | -------------------------------------------------------------------------------- /docs/SubTransaction.md: -------------------------------------------------------------------------------- 1 | # YNAB::SubTransaction 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **id** | **String** | | | 8 | | **transaction_id** | **String** | | | 9 | | **amount** | **Integer** | The subtransaction amount in milliunits format | | 10 | | **memo** | **String** | | [optional] | 11 | | **payee_id** | **String** | | [optional] | 12 | | **payee_name** | **String** | | [optional] | 13 | | **category_id** | **String** | | [optional] | 14 | | **category_name** | **String** | | [optional] | 15 | | **transfer_account_id** | **String** | If a transfer, the account_id which the subtransaction transfers to | [optional] | 16 | | **transfer_transaction_id** | **String** | If a transfer, the id of transaction on the other side of the transfer | [optional] | 17 | | **deleted** | **Boolean** | Whether or not the subtransaction has been deleted. Deleted subtransactions will only be included in delta requests. | | 18 | 19 | -------------------------------------------------------------------------------- /docs/TransactionClearedStatus.md: -------------------------------------------------------------------------------- 1 | # YNAB::TransactionClearedStatus 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | 8 | -------------------------------------------------------------------------------- /docs/TransactionDetail.md: -------------------------------------------------------------------------------- 1 | # YNAB::TransactionDetail 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **id** | **String** | | | 8 | | **date** | **Date** | The transaction date in ISO format (e.g. 2016-12-01) | | 9 | | **amount** | **Integer** | The transaction amount in milliunits format | | 10 | | **memo** | **String** | | [optional] | 11 | | **cleared** | [**TransactionClearedStatus**](TransactionClearedStatus.md) | | | 12 | | **approved** | **Boolean** | Whether or not the transaction is approved | | 13 | | **flag_color** | [**TransactionFlagColor**](TransactionFlagColor.md) | | [optional] | 14 | | **flag_name** | **String** | The customized name of a transaction flag | [optional] | 15 | | **account_id** | **String** | | | 16 | | **payee_id** | **String** | | [optional] | 17 | | **category_id** | **String** | | [optional] | 18 | | **transfer_account_id** | **String** | If a transfer transaction, the account to which it transfers | [optional] | 19 | | **transfer_transaction_id** | **String** | If a transfer transaction, the id of transaction on the other side of the transfer | [optional] | 20 | | **matched_transaction_id** | **String** | If transaction is matched, the id of the matched transaction | [optional] | 21 | | **import_id** | **String** | If the transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. | [optional] | 22 | | **import_payee_name** | **String** | If the transaction was imported, the payee name that was used when importing and before applying any payee rename rules | [optional] | 23 | | **import_payee_name_original** | **String** | If the transaction was imported, the original payee name as it appeared on the statement | [optional] | 24 | | **debt_transaction_type** | **String** | If the transaction is a debt/loan account transaction, the type of transaction | [optional] | 25 | | **deleted** | **Boolean** | Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests. | | 26 | | **account_name** | **String** | | | 27 | | **payee_name** | **String** | | [optional] | 28 | | **category_name** | **String** | The name of the category. If a split transaction, this will be 'Split'. | [optional] | 29 | | **subtransactions** | [**Array<SubTransaction>**](SubTransaction.md) | If a split transaction, the subtransactions. | | 30 | 31 | -------------------------------------------------------------------------------- /docs/TransactionFlagColor.md: -------------------------------------------------------------------------------- 1 | # YNAB::TransactionFlagColor 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | 8 | -------------------------------------------------------------------------------- /docs/TransactionResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::TransactionResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**TransactionResponseData**](TransactionResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/TransactionResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::TransactionResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **transaction** | [**TransactionDetail**](TransactionDetail.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/TransactionSummary.md: -------------------------------------------------------------------------------- 1 | # YNAB::TransactionSummary 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **id** | **String** | | | 8 | | **date** | **Date** | The transaction date in ISO format (e.g. 2016-12-01) | | 9 | | **amount** | **Integer** | The transaction amount in milliunits format | | 10 | | **memo** | **String** | | [optional] | 11 | | **cleared** | [**TransactionClearedStatus**](TransactionClearedStatus.md) | | | 12 | | **approved** | **Boolean** | Whether or not the transaction is approved | | 13 | | **flag_color** | [**TransactionFlagColor**](TransactionFlagColor.md) | | [optional] | 14 | | **flag_name** | **String** | The customized name of a transaction flag | [optional] | 15 | | **account_id** | **String** | | | 16 | | **payee_id** | **String** | | [optional] | 17 | | **category_id** | **String** | | [optional] | 18 | | **transfer_account_id** | **String** | If a transfer transaction, the account to which it transfers | [optional] | 19 | | **transfer_transaction_id** | **String** | If a transfer transaction, the id of transaction on the other side of the transfer | [optional] | 20 | | **matched_transaction_id** | **String** | If transaction is matched, the id of the matched transaction | [optional] | 21 | | **import_id** | **String** | If the transaction was imported, this field is a unique (by account) import identifier. If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have 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'. | [optional] | 22 | | **import_payee_name** | **String** | If the transaction was imported, the payee name that was used when importing and before applying any payee rename rules | [optional] | 23 | | **import_payee_name_original** | **String** | If the transaction was imported, the original payee name as it appeared on the statement | [optional] | 24 | | **debt_transaction_type** | **String** | If the transaction is a debt/loan account transaction, the type of transaction | [optional] | 25 | | **deleted** | **Boolean** | Whether or not the transaction has been deleted. Deleted transactions will only be included in delta requests. | | 26 | 27 | -------------------------------------------------------------------------------- /docs/TransactionsImportResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::TransactionsImportResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**TransactionsImportResponseData**](TransactionsImportResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/TransactionsImportResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::TransactionsImportResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **transaction_ids** | **Array<String>** | The list of transaction ids that were imported. | | 8 | 9 | -------------------------------------------------------------------------------- /docs/TransactionsResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::TransactionsResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**TransactionsResponseData**](TransactionsResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/TransactionsResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::TransactionsResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **transactions** | [**Array<TransactionDetail>**](TransactionDetail.md) | | | 8 | | **server_knowledge** | **Integer** | The knowledge of the server | | 9 | 10 | -------------------------------------------------------------------------------- /docs/User.md: -------------------------------------------------------------------------------- 1 | # YNAB::User 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **id** | **String** | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/UserApi.md: -------------------------------------------------------------------------------- 1 | # YNAB::UserApi 2 | 3 | All URIs are relative to *https://api.ynab.com/v1* 4 | 5 | | Method | HTTP request | Description | 6 | | ------ | ------------ | ----------- | 7 | | [**get_user**](UserApi.md#get_user) | **GET** /user | User info | 8 | 9 | 10 | ## get_user 11 | 12 | > get_user 13 | 14 | User info 15 | 16 | Returns authenticated user information 17 | 18 | ### Parameters 19 | 20 | This endpoint does not need any parameter. 21 | 22 | ### Return type 23 | 24 | [**UserResponse**](UserResponse.md) 25 | 26 | -------------------------------------------------------------------------------- /docs/UserResponse.md: -------------------------------------------------------------------------------- 1 | # YNAB::UserResponse 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **data** | [**UserResponseData**](UserResponseData.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /docs/UserResponseData.md: -------------------------------------------------------------------------------- 1 | # YNAB::UserResponseData 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | | **user** | [**User**](User.md) | | | 8 | 9 | -------------------------------------------------------------------------------- /examples/budget-list.rb: -------------------------------------------------------------------------------- 1 | require 'ynab' 2 | 3 | access_token = ENV['YNAB_ACCESS_TOKEN'] 4 | ynab = YNAB::API.new(access_token) 5 | 6 | begin 7 | puts 'Fetching budgets...' 8 | 9 | budget_response = ynab.budgets.get_budgets 10 | budgets = budget_response.data.budgets 11 | 12 | puts '===========' 13 | puts 'BUDGET LIST' 14 | puts '===========' 15 | 16 | budgets.each do |budget| 17 | puts "[id: #{budget.id}, name: #{budget.name}]" 18 | end 19 | rescue YNAB::ApiError => e 20 | puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}" 21 | end 22 | -------------------------------------------------------------------------------- /examples/budget-month.rb: -------------------------------------------------------------------------------- 1 | require 'ynab' 2 | require 'date' 3 | 4 | access_token = ENV['YNAB_ACCESS_TOKEN'] 5 | ynab = YNAB::API.new(access_token) 6 | 7 | budget_id = ENV['YNAB_BUDGET_ID'] 8 | 9 | begin 10 | puts 'Fetching month...' 11 | 12 | first_day_of_month_iso = Date.new(Date.today.year, Date.today.month, 1).iso8601 13 | current_date = Date.today 14 | first_day_of_month = Date.new(current_date.year, current_date.month, 1) 15 | month_response = ynab.months.get_budget_month(budget_id, first_day_of_month_iso) 16 | budget_month = month_response.data.month 17 | 18 | puts "============" 19 | puts "BUDGET MONTH" 20 | puts "============" 21 | puts " Month: #{budget_month.month}" 22 | puts " Note: #{budget_month.note}" 23 | puts "To Be Budgeted: #{budget_month.to_be_budgeted}" 24 | puts " Age of Money: #{budget_month.age_of_money}" 25 | puts " Categories: " 26 | 27 | budget_month.categories.each do |category| 28 | puts " #{category.name} - $#{category.balance}" 29 | end 30 | rescue YNAB::ApiError => e 31 | puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}" 32 | end 33 | 34 | -------------------------------------------------------------------------------- /examples/category-balance.rb: -------------------------------------------------------------------------------- 1 | require 'ynab' 2 | 3 | access_token = ENV['YNAB_ACCESS_TOKEN'] 4 | ynab = YNAB::API.new(access_token) 5 | 6 | budget_id = ENV['YNAB_BUDGET_ID'] 7 | category_id = 'a191ac84-de09-not-real-6c5ed8cfdabe' 8 | 9 | begin 10 | puts 'Fetching category...' 11 | 12 | category_response = ynab.categories.get_category_by_id(budget_id, category_id) 13 | category = category_response.data.category 14 | 15 | puts "===========" 16 | puts "CATEGORY" 17 | puts "===========" 18 | puts " Name: #{category.name}" 19 | puts " Budgeted: #{category.budgeted}" 20 | puts " Balance: #{category.balance}" 21 | rescue YNAB::ApiError => e 22 | puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}" 23 | end 24 | -------------------------------------------------------------------------------- /examples/create-multiple-transactions.rb: -------------------------------------------------------------------------------- 1 | require 'date' 2 | require 'ynab' 3 | 4 | access_token = ENV['YNAB_ACCESS_TOKEN'] 5 | ynab = YNAB::API.new(access_token) 6 | 7 | budget_id = ENV['YNAB_BUDGET_ID'] 8 | account_id = 'f6fe07cb-c895-not-real-acfac0b7f026' 9 | category_id = 'a191ac84-de09-not-real-6c5ed8cfdabe' 10 | 11 | data = { 12 | transactions: [ 13 | { 14 | account_id: account_id, 15 | category_id: category_id, 16 | date: Date.today, 17 | payee_name: 'A Test Payee', 18 | memo: 'I was created through the API', 19 | cleared: 'Cleared', 20 | approved: true, 21 | flag_color: 'Blue', 22 | amount: 20000 23 | }, 24 | { 25 | account_id: account_id, 26 | category_id: category_id, 27 | date: Date.today, 28 | payee_name: 'Another Test Payee', 29 | memo: 'I was also created through the API', 30 | cleared: 'Uncleared', 31 | approved: false, 32 | flag_color: 'Red', 33 | amount: 39453 34 | } 35 | ] 36 | } 37 | 38 | begin 39 | ynab.transactions.create_transaction(budget_id, data) 40 | rescue YNAB::ApiError => e 41 | puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}" 42 | end 43 | -------------------------------------------------------------------------------- /examples/create-transaction.rb: -------------------------------------------------------------------------------- 1 | require 'date' 2 | require 'ynab' 3 | 4 | access_token = ENV['YNAB_ACCESS_TOKEN'] 5 | ynab = YNAB::API.new(access_token) 6 | 7 | budget_id = ENV['YNAB_BUDGET_ID'] 8 | account_id = 'f6fe07cb-c895-not-real-acfac0b7f026' 9 | category_id = 'a191ac84-de09-not-real-6c5ed8cfdabe' 10 | 11 | data = { 12 | transaction: { 13 | account_id: account_id, 14 | category_id: category_id, 15 | date: Date.today, 16 | payee_name: 'A Test Payee', 17 | memo: 'I was created through the API', 18 | cleared: 'Cleared', 19 | approved: true, 20 | flag_color: 'Blue', 21 | amount: 20000 22 | } 23 | } 24 | 25 | begin 26 | ynab.transactions.create_transaction(budget_id, data) 27 | rescue YNAB::ApiError => e 28 | puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}" 29 | end 30 | 31 | -------------------------------------------------------------------------------- /examples/update-category-budgeted.rb: -------------------------------------------------------------------------------- 1 | require 'date' 2 | require 'ynab' 3 | 4 | access_token = ENV['YNAB_ACCESS_TOKEN'] 5 | ynab = YNAB::API.new(access_token) 6 | 7 | budget_id = ENV['YNAB_BUDGET_ID'] 8 | category_id = 'a191ac84-de09-not-real-6c5ed8cfdabe' 9 | month = '2019-01-01' 10 | 11 | data = { 12 | category: { 13 | budgeted: 20382 14 | } 15 | } 16 | 17 | begin 18 | # Update budgeted amount to 203.82 in 2018-09-01 for category_id 19 | response = ynab.categories.update_month_category(budget_id, month, category_id, data) 20 | month_category_response = response.data.category 21 | puts "[budgeted: #{month_category_response.budgeted}, balance: #{month_category_response.balance}]" 22 | rescue YNAB::ApiError => e 23 | puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}" 24 | end 25 | 26 | -------------------------------------------------------------------------------- /examples/update-multiple-transactions.rb: -------------------------------------------------------------------------------- 1 | require 'ynab' 2 | 3 | access_token = ENV['YNAB_ACCESS_TOKEN'] 4 | ynab = YNAB::API.new(access_token) 5 | 6 | budget_id = ENV['YNAB_BUDGET_ID'] 7 | 8 | begin 9 | # Fetch all unapproved transactions and update them all as approved 10 | unapproved_transaction_data = ynab.transactions.get_transactions(budget_id, { type: 'unapproved' }).data 11 | 12 | data = unapproved_transaction_data.clone 13 | data.transactions.each do |t| 14 | t.approved = true 15 | end 16 | 17 | ynab.transactions.update_transactions(budget_id, update_data) 18 | rescue YNAB::ApiError => e 19 | puts "ERROR: id=#{e.id}; name=#{e.name}; detail: #{e.detail}" 20 | end 21 | -------------------------------------------------------------------------------- /lib/ynab/api/deprecated_api.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #YNAB API Endpoints 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 is at https://api.ynab.com 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | 8 | Generated by: https://openapi-generator.tech 9 | OpenAPI Generator version: 6.6.0 10 | 11 | =end 12 | 13 | require 'cgi' 14 | 15 | module YNAB 16 | class DeprecatedApi 17 | attr_accessor :api_client 18 | 19 | def initialize(api_client = ApiClient.default) 20 | @api_client = api_client 21 | end 22 | # Bulk create transactions 23 | # Creates multiple transactions. Although this endpoint is still supported, it is recommended to use 'POST /budgets/{budget_id}/transactions' to create multiple transactions. 24 | # @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). 25 | # @param transactions [BulkTransactions] The list of transactions to create 26 | # @param [Hash] opts the optional parameters 27 | # @return [BulkResponse] 28 | def bulk_create_transactions(budget_id, transactions, opts = {}) 29 | data, _status_code, _headers = bulk_create_transactions_with_http_info(budget_id, transactions, opts) 30 | data 31 | end 32 | 33 | # Bulk create transactions 34 | # Creates multiple transactions. Although this endpoint is still supported, it is recommended to use 'POST /budgets/{budget_id}/transactions' to create multiple transactions. 35 | # @param budget_id [String] The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.ynab.com/#oauth-default-budget). 36 | # @param transactions [BulkTransactions] The list of transactions to create 37 | # @param [Hash] opts the optional parameters 38 | # @return [Array<(BulkResponse, Integer, Hash)>] BulkResponse data, response status code and response headers 39 | def bulk_create_transactions_with_http_info(budget_id, transactions, opts = {}) 40 | if @api_client.config.debugging 41 | @api_client.config.logger.debug 'Calling API: DeprecatedApi.bulk_create_transactions ...' 42 | end 43 | # verify the required parameter 'budget_id' is set 44 | if @api_client.config.client_side_validation && budget_id.nil? 45 | fail ArgumentError, "Missing the required parameter 'budget_id' when calling DeprecatedApi.bulk_create_transactions" 46 | end 47 | # verify the required parameter 'transactions' is set 48 | if @api_client.config.client_side_validation && transactions.nil? 49 | fail ArgumentError, "Missing the required parameter 'transactions' when calling DeprecatedApi.bulk_create_transactions" 50 | end 51 | # resource path 52 | local_var_path = '/budgets/{budget_id}/transactions/bulk'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)) 53 | 54 | # query parameters 55 | query_params = opts[:query_params] || {} 56 | 57 | # header parameters 58 | header_params = opts[:header_params] || {} 59 | # HTTP header 'Accept' (if needed) 60 | header_params['Accept'] = @api_client.select_header_accept(['application/json']) 61 | # HTTP header 'Content-Type' 62 | content_type = @api_client.select_header_content_type(['application/json']) 63 | if !content_type.nil? 64 | header_params['Content-Type'] = content_type 65 | end 66 | 67 | # form parameters 68 | form_params = opts[:form_params] || {} 69 | 70 | # http body (model) 71 | post_body = opts[:debug_body] || @api_client.object_to_http_body(transactions) 72 | 73 | # return_type 74 | return_type = opts[:debug_return_type] || 'BulkResponse' 75 | 76 | # auth_names 77 | auth_names = opts[:debug_auth_names] || ['bearer'] 78 | 79 | new_options = opts.merge( 80 | :operation => :"DeprecatedApi.bulk_create_transactions", 81 | :header_params => header_params, 82 | :query_params => query_params, 83 | :form_params => form_params, 84 | :body => post_body, 85 | :auth_names => auth_names, 86 | :return_type => return_type 87 | ) 88 | 89 | data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) 90 | if @api_client.config.debugging 91 | @api_client.config.logger.debug "API called: DeprecatedApi#bulk_create_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" 92 | end 93 | return data, status_code, headers 94 | end 95 | end 96 | end 97 | -------------------------------------------------------------------------------- /lib/ynab/api/user_api.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #YNAB API Endpoints 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 is at https://api.ynab.com 5 | 6 | Generated by: OpenAPI Generator (https://openapi-generator.tech) 7 | 8 | =end 9 | 10 | require 'cgi' 11 | 12 | module YNAB 13 | class UserApi 14 | attr_accessor :api_client 15 | 16 | def initialize(api_client = ApiClient.default) 17 | @api_client = api_client 18 | end 19 | # User info 20 | # Returns authenticated user information 21 | # @param [Hash] opts the optional parameters 22 | # @return [UserResponse] 23 | def get_user(opts = {}) 24 | data, _status_code, _headers = get_user_with_http_info(opts) 25 | data 26 | end 27 | 28 | # User info 29 | # Returns authenticated user information 30 | # @param [Hash] opts the optional parameters 31 | # @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers 32 | def get_user_with_http_info(opts = {}) 33 | if @api_client.config.debugging 34 | @api_client.config.logger.debug 'Calling API: UserApi.get_user ...' 35 | end 36 | # resource path 37 | local_var_path = '/user' 38 | 39 | # query parameters 40 | query_params = opts[:query_params] || {} 41 | 42 | # header parameters 43 | header_params = opts[:header_params] || {} 44 | # HTTP header 'Accept' (if needed) 45 | header_params['Accept'] = @api_client.select_header_accept(['application/json']) 46 | 47 | # form parameters 48 | form_params = opts[:form_params] || {} 49 | 50 | # http body (model) 51 | post_body = opts[:debug_body] 52 | 53 | # return_type 54 | return_type = opts[:debug_return_type] || 'UserResponse' 55 | 56 | # auth_names 57 | auth_names = opts[:debug_auth_names] || ['bearer'] 58 | 59 | new_options = opts.merge( 60 | :operation => :"UserApi.get_user", 61 | :header_params => header_params, 62 | :query_params => query_params, 63 | :form_params => form_params, 64 | :body => post_body, 65 | :auth_names => auth_names, 66 | :return_type => return_type 67 | ) 68 | 69 | data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) 70 | if @api_client.config.debugging 71 | @api_client.config.logger.debug "API called: UserApi#get_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" 72 | end 73 | return data, status_code, headers 74 | end 75 | end 76 | end 77 | -------------------------------------------------------------------------------- /lib/ynab/api_error.rb: -------------------------------------------------------------------------------- 1 | module YNAB 2 | class ApiError < StandardError 3 | attr_reader :code, :response_headers, :response_body 4 | 5 | # Usage examples: 6 | # ApiError.new 7 | # ApiError.new("message") 8 | # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") 9 | # ApiError.new(:code => 404, :message => "Not Found") 10 | def initialize(arg = nil) 11 | if arg.is_a? Hash 12 | if arg.key?(:message) || arg.key?('message') 13 | super(arg[:message] || arg['message']) 14 | else 15 | super arg 16 | end 17 | 18 | arg.each do |key, value| 19 | if respond_to?("#{key}=") 20 | send "#{key}=", value 21 | else 22 | instance_variable_set "@#{key}", value 23 | end 24 | end 25 | else 26 | super arg 27 | end 28 | end 29 | 30 | def response_body=(value) 31 | @response_body = value 32 | 33 | begin 34 | @error_parsed = JSON.parse(value) 35 | rescue 36 | @error_parsed = nil 37 | end 38 | end 39 | 40 | def id 41 | (@error_parsed || {}).fetch('error', {})['id'] 42 | end 43 | 44 | def name 45 | (@error_parsed || {}).fetch('error', {})['name'] 46 | end 47 | 48 | def detail 49 | (@error_parsed || {}).fetch('error', {})['detail'] 50 | end 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /lib/ynab/models/account_type.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #YNAB API Endpoints 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 is at https://api.ynab.com 5 | 6 | Generated by: OpenAPI Generator (https://openapi-generator.tech) 7 | 8 | =end 9 | 10 | require 'date' 11 | require 'time' 12 | 13 | module YNAB 14 | class AccountType 15 | CHECKING = "checking".freeze 16 | SAVINGS = "savings".freeze 17 | CASH = "cash".freeze 18 | CREDIT_CARD = "creditCard".freeze 19 | LINE_OF_CREDIT = "lineOfCredit".freeze 20 | OTHER_ASSET = "otherAsset".freeze 21 | OTHER_LIABILITY = "otherLiability".freeze 22 | MORTGAGE = "mortgage".freeze 23 | AUTO_LOAN = "autoLoan".freeze 24 | STUDENT_LOAN = "studentLoan".freeze 25 | PERSONAL_LOAN = "personalLoan".freeze 26 | MEDICAL_DEBT = "medicalDebt".freeze 27 | OTHER_DEBT = "otherDebt".freeze 28 | 29 | def self.all_vars 30 | @all_vars ||= [CHECKING, SAVINGS, CASH, CREDIT_CARD, LINE_OF_CREDIT, OTHER_ASSET, OTHER_LIABILITY, MORTGAGE, AUTO_LOAN, STUDENT_LOAN, PERSONAL_LOAN, MEDICAL_DEBT, OTHER_DEBT].freeze 31 | end 32 | 33 | # Builds the enum from string 34 | # @param [String] The enum value in the form of the string 35 | # @return [String] The enum value 36 | def self.build_from_hash(value) 37 | new.build_from_hash(value) 38 | end 39 | 40 | # Builds the enum from string 41 | # @param [String] The enum value in the form of the string 42 | # @return [String] The enum value 43 | def build_from_hash(value) 44 | if AccountType.all_vars.include?(value) 45 | return value 46 | else 47 | return nil 48 | end 49 | end 50 | end 51 | 52 | end 53 | -------------------------------------------------------------------------------- /lib/ynab/models/scheduled_transaction_frequency.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #YNAB API Endpoints 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 is at https://api.ynab.com 5 | 6 | Generated by: OpenAPI Generator (https://openapi-generator.tech) 7 | 8 | =end 9 | 10 | require 'date' 11 | require 'time' 12 | 13 | module YNAB 14 | class ScheduledTransactionFrequency 15 | NEVER = "never".freeze 16 | DAILY = "daily".freeze 17 | WEEKLY = "weekly".freeze 18 | EVERY_OTHER_WEEK = "everyOtherWeek".freeze 19 | TWICE_A_MONTH = "twiceAMonth".freeze 20 | EVERY4_WEEKS = "every4Weeks".freeze 21 | MONTHLY = "monthly".freeze 22 | EVERY_OTHER_MONTH = "everyOtherMonth".freeze 23 | EVERY3_MONTHS = "every3Months".freeze 24 | EVERY4_MONTHS = "every4Months".freeze 25 | TWICE_A_YEAR = "twiceAYear".freeze 26 | YEARLY = "yearly".freeze 27 | EVERY_OTHER_YEAR = "everyOtherYear".freeze 28 | 29 | def self.all_vars 30 | @all_vars ||= [NEVER, DAILY, WEEKLY, EVERY_OTHER_WEEK, TWICE_A_MONTH, EVERY4_WEEKS, MONTHLY, EVERY_OTHER_MONTH, EVERY3_MONTHS, EVERY4_MONTHS, TWICE_A_YEAR, YEARLY, EVERY_OTHER_YEAR].freeze 31 | end 32 | 33 | # Builds the enum from string 34 | # @param [String] The enum value in the form of the string 35 | # @return [String] The enum value 36 | def self.build_from_hash(value) 37 | new.build_from_hash(value) 38 | end 39 | 40 | # Builds the enum from string 41 | # @param [String] The enum value in the form of the string 42 | # @return [String] The enum value 43 | def build_from_hash(value) 44 | if ScheduledTransactionFrequency.all_vars.include?(value) 45 | return value 46 | else 47 | return nil 48 | end 49 | end 50 | end 51 | 52 | end 53 | -------------------------------------------------------------------------------- /lib/ynab/models/transaction_cleared_status.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #YNAB API Endpoints 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 is at https://api.ynab.com 5 | 6 | Generated by: OpenAPI Generator (https://openapi-generator.tech) 7 | 8 | =end 9 | 10 | require 'date' 11 | require 'time' 12 | 13 | module YNAB 14 | class TransactionClearedStatus 15 | CLEARED = "cleared".freeze 16 | UNCLEARED = "uncleared".freeze 17 | RECONCILED = "reconciled".freeze 18 | 19 | def self.all_vars 20 | @all_vars ||= [CLEARED, UNCLEARED, RECONCILED].freeze 21 | end 22 | 23 | # Builds the enum from string 24 | # @param [String] The enum value in the form of the string 25 | # @return [String] The enum value 26 | def self.build_from_hash(value) 27 | new.build_from_hash(value) 28 | end 29 | 30 | # Builds the enum from string 31 | # @param [String] The enum value in the form of the string 32 | # @return [String] The enum value 33 | def build_from_hash(value) 34 | if TransactionClearedStatus.all_vars.include?(value) 35 | return value 36 | else 37 | return nil 38 | end 39 | end 40 | end 41 | 42 | end 43 | -------------------------------------------------------------------------------- /lib/ynab/models/transaction_flag_color.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #YNAB API Endpoints 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 is at https://api.ynab.com 5 | 6 | Generated by: OpenAPI Generator (https://openapi-generator.tech) 7 | 8 | =end 9 | 10 | require 'date' 11 | require 'time' 12 | 13 | module YNAB 14 | class TransactionFlagColor 15 | RED = "red".freeze 16 | ORANGE = "orange".freeze 17 | YELLOW = "yellow".freeze 18 | GREEN = "green".freeze 19 | BLUE = "blue".freeze 20 | PURPLE = "purple".freeze 21 | 22 | def self.all_vars 23 | @all_vars ||= [RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE].freeze 24 | end 25 | 26 | # Builds the enum from string 27 | # @param [String] The enum value in the form of the string 28 | # @return [String] The enum value 29 | def self.build_from_hash(value) 30 | new.build_from_hash(value) 31 | end 32 | 33 | # Builds the enum from string 34 | # @param [String] The enum value in the form of the string 35 | # @return [String] The enum value 36 | def build_from_hash(value) 37 | if TransactionFlagColor.all_vars.include?(value) 38 | return value 39 | else 40 | return nil 41 | end 42 | end 43 | end 44 | 45 | end 46 | -------------------------------------------------------------------------------- /lib/ynab/overrides/transactions_api.rb: -------------------------------------------------------------------------------- 1 | require 'uri' 2 | require 'ynab/api/deprecated_api' 3 | 4 | module YNAB 5 | module Overrides 6 | class TransactionsApi < YNAB::TransactionsApi 7 | def initialize(api_client = ApiClient.default) 8 | super(api_client) 9 | end 10 | # Create a single transaction or multiple transactions 11 | # Creates a single transaction or multiple transactions. If you provide a body containing a 'transaction' object, a single transaction will be created and if you provide a body containing a 'transactions' array, multiple transactions will be created. 12 | # @param budget_id The id of the budget (\"last-used\" can also be used to specify the last used budget) 13 | # @param data The transaction or transactions to create 14 | # @param [Hash] opts the optional parameters 15 | # @return [SaveTransactionsResponse] 16 | def create_transactions(budget_id, data, opts = {}) 17 | data, _status_code, _headers = create_transaction_with_http_info(budget_id, data, opts) 18 | data 19 | end 20 | 21 | # Bulk create transactions 22 | # Creates multiple transactions 23 | # @param budget_id The id of the budget (\"last-used\" can also be used to specify the last used budget) 24 | # @param transactions The list of transactions to create 25 | # @param [Hash] opts the optional parameters 26 | # @return [BulkResponse] 27 | def bulk_create_transactions(budget_id, transactions, opts = {}) 28 | DeprecatedApi.new(@api_client).bulk_create_transactions(budget_id, transactions, opts) 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/ynab/version.rb: -------------------------------------------------------------------------------- 1 | module YNAB 2 | VERSION = '3.8.0' 3 | end 4 | -------------------------------------------------------------------------------- /openapi-generator-config.yaml: -------------------------------------------------------------------------------- 1 | gemName: ynab 2 | moduleName: YNAB 3 | gemSummary: Official Ruby client for the YNAB API 4 | gemDescription: Official Ruby client for the YNAB API. API documentation available at https://api.ynab.com. 5 | gemHomepage: https://github.com/ynab/ynab-sdk-ruby 6 | gemLicense: Apache-2.0 7 | gemAuthor: YNAB 8 | gemAuthorEmail: api@ynab.com 9 | templateDir: ./templates 10 | additionalProperties: 11 | gemRequiredRubyVersion: ">= 3.3" 12 | -------------------------------------------------------------------------------- /spec/api/accounts_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'accounts' do 4 | let(:access_token) { '9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045' } 5 | let(:budget_id) { 'f419ac25-6217-4175-88dc-c3136ff5f6fd' } 6 | let(:client) { YNAB::API.new(access_token, 'api.localhost:3000', false) } 7 | let (:instance) { client.accounts } 8 | 9 | describe 'test an instance of AccountsApi' do 10 | it 'should create an instance of AccountsApi' do 11 | expect(instance).to be_instance_of(YNAB::AccountsApi) 12 | end 13 | end 14 | 15 | describe 'authorization' do 16 | it 'sets the Bearer Auth header correctly' do 17 | VCR.use_cassette("accounts") do 18 | response = instance.get_accounts(budget_id) 19 | expect(client.last_request.options[:headers]["Authorization"]).to eq "Bearer #{access_token}" 20 | 21 | end 22 | end 23 | 24 | it 'throws when unauthorized' do 25 | VCR.use_cassette("accounts_unauthorized") do 26 | client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false) 27 | begin 28 | response = client.accounts.get_accounts(budget_id) 29 | rescue YNAB::ApiError => e 30 | expect(e.code).to be 401 31 | expect(client.last_request.response.options[:code]).to be 401 32 | end 33 | end 34 | end 35 | end 36 | 37 | describe 'GET /budgets/{budget_id}/accounts' do 38 | it 'returns a list of accounts' do 39 | VCR.use_cassette("accounts") do 40 | response = instance.get_accounts(budget_id) 41 | expect(client.last_request.response.options[:code]).to be 200 42 | expect(response.data.accounts.length).to be 1 43 | end 44 | end 45 | end 46 | 47 | describe 'GET /budgets/{budget_id}/accounts/{account_id}' do 48 | it 'returns an account' do 49 | VCR.use_cassette("account") do 50 | response = instance.get_account_by_id(budget_id, '5982e895-98e5-41ca-9681-0b6de1036a1c') 51 | expect(response.data.account).to be 52 | expect(response.data.account.name).to eq "Checking" 53 | end 54 | end 55 | end 56 | 57 | describe 'POST /budgets/{budget_id}/accounts' do 58 | it 'creates an account' do 59 | VCR.use_cassette("create_account") do 60 | response = instance.create_account(budget_id, { 61 | account: { 62 | name: 'New Checking Account', 63 | type: 'checking', 64 | balance: 215000 65 | } 66 | }) 67 | 68 | expect(client.last_request.response.options[:code]).to be 201 69 | expect(response.data.account).to be 70 | expect(response.data.account.balance).to eq 215000 71 | end 72 | end 73 | end 74 | end 75 | -------------------------------------------------------------------------------- /spec/api/budgets_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'budgets' do 4 | let(:access_token) { '9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045' } 5 | let(:client) { YNAB::API.new(access_token, 'api.localhost:3000', false) } 6 | let (:instance) { client.budgets } 7 | 8 | describe 'test an instance of BudgetsApi' do 9 | it 'should create an instance of BudgetsApi' do 10 | expect(instance).to be_instance_of(YNAB::BudgetsApi) 11 | end 12 | end 13 | 14 | describe 'authorization' do 15 | it 'sets the Bearer Auth header correctly' do 16 | VCR.use_cassette("budgets") do 17 | response = instance.get_budgets 18 | expect(client.last_request.options[:headers]["Authorization"]).to eq "Bearer #{access_token}" 19 | 20 | end 21 | end 22 | 23 | it 'throws when unauthorized' do 24 | VCR.use_cassette("budgets_unauthorized") do 25 | client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false) 26 | begin 27 | response = client.budgets.get_budgets 28 | rescue YNAB::ApiError => e 29 | expect(e.code).to be 401 30 | expect(client.last_request.response.options[:code]).to be 401 31 | end 32 | end 33 | end 34 | end 35 | 36 | describe 'GET /budgets' do 37 | it 'returns a list of budgets' do 38 | VCR.use_cassette("budgets") do 39 | response = instance.get_budgets 40 | expect(client.last_request.response.options[:code]).to be 200 41 | expect(response.data.budgets.length).to be 4 42 | end 43 | end 44 | end 45 | 46 | describe 'GET /budgets/{budget_id}' do 47 | it 'returns a budget' do 48 | VCR.use_cassette("budget") do 49 | response = instance.get_budget_by_id('f419ac25-6217-4175-88dc-c3136ff5f6fd') 50 | expect(response.data.budget).to be 51 | expect(response.data.budget.name).to eq "ABC" 52 | end 53 | end 54 | end 55 | end 56 | -------------------------------------------------------------------------------- /spec/api/categories_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'categories' do 4 | let(:access_token) { '9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045' } 5 | let(:budget_id) { 'f419ac25-6217-4175-88dc-c3136ff5f6fd' } 6 | let(:category_id) { 'acd2a771-0a56-4dba-97bd-3952b0879282' } 7 | let(:client) { YNAB::API.new(access_token, 'api.localhost:3000', false) } 8 | let (:instance) { client.categories } 9 | 10 | describe 'test an instance of CategoriesApi' do 11 | it 'should create an instance of CategoriesApi' do 12 | expect(instance).to be_instance_of(YNAB::CategoriesApi) 13 | end 14 | end 15 | 16 | describe 'authorization' do 17 | it 'sets the Bearer Auth header correctly' do 18 | VCR.use_cassette("categories") do 19 | response = instance.get_categories(budget_id) 20 | expect(client.last_request.options[:headers]["Authorization"]).to eq "Bearer #{access_token}" 21 | 22 | end 23 | end 24 | 25 | it 'throws when unauthorized' do 26 | VCR.use_cassette("categories_unauthorized") do 27 | client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false) 28 | begin 29 | response = client.categories.get_categories(budget_id) 30 | rescue YNAB::ApiError => e 31 | expect(e.code).to be 401 32 | expect(client.last_request.response.options[:code]).to be 401 33 | end 34 | end 35 | end 36 | end 37 | 38 | describe 'GET /budgets/{budget_id}/categories' do 39 | it 'returns a list of categories' do 40 | VCR.use_cassette("categories") do 41 | response = instance.get_categories(budget_id) 42 | expect(client.last_request.response.options[:code]).to be 200 43 | expect(response.data.category_groups.length).to be 8 44 | expect(response.data.category_groups[0].categories.length).to be 3 45 | end 46 | end 47 | end 48 | 49 | describe 'GET /budgets/{budget_id}/categories/{category_id}' do 50 | it 'returns a category' do 51 | VCR.use_cassette("category") do 52 | response = instance.get_category_by_id(budget_id, category_id) 53 | expect(response.data.category).to be 54 | expect(response.data.category.name).to eq 'Groceries' 55 | end 56 | end 57 | end 58 | 59 | describe 'PATCH /budgets/{budget_id}/months/{month}/categories/{category_id}' do 60 | it 'returns a category' do 61 | VCR.use_cassette("patch_month_category") do 62 | response = instance.update_month_category(budget_id, '2018-02-01', category_id, month_category: { budgeted: 20382 }) 63 | expect(response.data.category).to be 64 | expect(response.data.category.name).to eq 'Groceries' 65 | expect(response.data.category.budgeted).to eq 20382 66 | end 67 | end 68 | end 69 | end 70 | -------------------------------------------------------------------------------- /spec/api/months_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'months' do 4 | let(:access_token) { '9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045' } 5 | let(:budget_id) { 'f419ac25-6217-4175-88dc-c3136ff5f6fd' } 6 | let(:client) { YNAB::API.new(access_token, 'api.localhost:3000', false) } 7 | let (:instance) { client.months } 8 | 9 | describe 'test an instance of MonthsApi' do 10 | it 'should create an instance of MonthsApi' do 11 | expect(instance).to be_instance_of(YNAB::MonthsApi) 12 | end 13 | end 14 | 15 | describe 'authorization' do 16 | it 'sets the Bearer Auth header correctly' do 17 | VCR.use_cassette("months") do 18 | response = instance.get_budget_months(budget_id) 19 | expect(client.last_request.options[:headers]["Authorization"]).to eq "Bearer #{access_token}" 20 | 21 | end 22 | end 23 | 24 | it 'throws when unauthorized' do 25 | VCR.use_cassette("months_unauthorized") do 26 | client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false) 27 | begin 28 | response = client.months.get_budget_months(budget_id) 29 | rescue YNAB::ApiError => e 30 | expect(e.code).to be 401 31 | expect(client.last_request.response.options[:code]).to be 401 32 | end 33 | end 34 | end 35 | end 36 | 37 | describe 'GET /budgets/{budget_id}/months' do 38 | it 'returns a list of months' do 39 | VCR.use_cassette("months") do 40 | response = instance.get_budget_months(budget_id) 41 | expect(client.last_request.response.options[:code]).to be 200 42 | expect(response.data.months.length).to be 3 43 | end 44 | end 45 | end 46 | 47 | describe 'GET /budgets/{budget_id}/months/{month}' do 48 | it 'returns a month' do 49 | VCR.use_cassette("month") do 50 | response = instance.get_budget_month(budget_id, '2018-02-01') 51 | expect(response.data.month).to be 52 | expect(response.data.month.to_be_budgeted).to eq 1000000 53 | expect(response.data.month.note).to eq "Test Note" 54 | end 55 | end 56 | end 57 | end 58 | -------------------------------------------------------------------------------- /spec/api/payee_locations_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'payee locations' do 4 | let(:access_token) { '9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045' } 5 | let(:budget_id) { 'f419ac25-6217-4175-88dc-c3136ff5f6fd' } 6 | let(:client) { YNAB::API.new(access_token, 'api.localhost:3000', false) } 7 | let (:instance) { client.payee_locations } 8 | 9 | describe 'test an instance of PayeeLocationsApi' do 10 | it 'should create an instance of PayeeLocationsApi' do 11 | expect(instance).to be_instance_of(YNAB::PayeeLocationsApi) 12 | end 13 | end 14 | 15 | describe 'authorization' do 16 | it 'sets the Bearer Auth header correctly' do 17 | VCR.use_cassette("payee_locations") do 18 | response = instance.get_payee_locations(budget_id) 19 | expect(client.last_request.options[:headers]["Authorization"]).to eq "Bearer #{access_token}" 20 | 21 | end 22 | end 23 | 24 | it 'throws when unauthorized' do 25 | VCR.use_cassette("payee_locations_unauthorized") do 26 | client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false) 27 | begin 28 | response = client.payee_locations.get_payee_locations(budget_id) 29 | rescue YNAB::ApiError => e 30 | expect(e.code).to be 401 31 | expect(client.last_request.response.options[:code]).to be 401 32 | end 33 | end 34 | end 35 | end 36 | 37 | describe 'GET /budgets/{budget_id}/payee_location' do 38 | it 'returns a list of payee locations' do 39 | VCR.use_cassette("payee_locations") do 40 | response = instance.get_payee_locations(budget_id) 41 | expect(client.last_request.response.options[:code]).to be 200 42 | expect(response.data.payee_locations.length).to be 1 43 | end 44 | end 45 | end 46 | 47 | describe 'GET /budgets/{budget_id}/payee_locations/{payee_id}' do 48 | it 'returns a payee location' do 49 | VCR.use_cassette("payee_location") do 50 | response = instance.get_payee_location_by_id(budget_id, '052c7814-1797-44ce-9519-020e864e4928') 51 | expect(response.data.payee_location).to be 52 | expect(response.data.payee_location.latitude).to eq "40.7128" 53 | expect(response.data.payee_location.longitude).to eq "74.006" 54 | end 55 | end 56 | end 57 | end 58 | -------------------------------------------------------------------------------- /spec/api/payees_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'payees' do 4 | let(:access_token) { '9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045' } 5 | let(:budget_id) { 'f419ac25-6217-4175-88dc-c3136ff5f6fd' } 6 | let(:client) { YNAB::API.new(access_token, 'api.localhost:3000', false) } 7 | let (:instance) { client.payees } 8 | 9 | describe 'test an instance of PayeesApi' do 10 | it 'should create an instance of PayeesApi' do 11 | expect(instance).to be_instance_of(YNAB::PayeesApi) 12 | end 13 | end 14 | 15 | describe 'authorization' do 16 | it 'sets the Bearer Auth header correctly' do 17 | VCR.use_cassette("payees") do 18 | response = instance.get_payees(budget_id) 19 | expect(client.last_request.options[:headers]["Authorization"]).to eq "Bearer #{access_token}" 20 | 21 | end 22 | end 23 | 24 | it 'throws when unauthorized' do 25 | VCR.use_cassette("payees_unauthorized") do 26 | client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false) 27 | begin 28 | response = client.payees.get_payees(budget_id) 29 | rescue YNAB::ApiError => e 30 | expect(e.code).to be 401 31 | expect(client.last_request.response.options[:code]).to be 401 32 | end 33 | end 34 | end 35 | end 36 | 37 | describe 'GET /budgets/{budget_id}/payees' do 38 | it 'returns a list of payees' do 39 | VCR.use_cassette("payees") do 40 | response = instance.get_payees(budget_id) 41 | expect(client.last_request.response.options[:code]).to be 200 42 | expect(response.data.payees.length).to be 5 43 | end 44 | end 45 | end 46 | 47 | describe 'GET /budgets/{budget_id}/payees/{payee_id}' do 48 | it 'returns a payee' do 49 | VCR.use_cassette("payee") do 50 | response = instance.get_payee_by_id(budget_id, '200e6eb1-02fc-4af6-be26-27c5740bb949') 51 | expect(response.data.payee).to be 52 | expect(response.data.payee.name).to eq 'Test Payee' 53 | end 54 | end 55 | end 56 | end 57 | -------------------------------------------------------------------------------- /spec/api/scheduled_transactions_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'scheduled transactions' do 4 | let(:access_token) { '9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045' } 5 | let(:budget_id) { 'f419ac25-6217-4175-88dc-c3136ff5f6fd' } 6 | let(:client) { YNAB::API.new(access_token, 'api.localhost:3000', false) } 7 | let (:instance) { client.scheduled_transactions } 8 | 9 | describe 'test an instance of ScheduledTransactionsApi' do 10 | it 'should create an instance of ScheduledTransactionApi' do 11 | expect(instance).to be_instance_of(YNAB::ScheduledTransactionsApi) 12 | end 13 | end 14 | 15 | describe 'authorization' do 16 | it 'sets the Bearer Auth header correctly' do 17 | VCR.use_cassette("scheduled_transactions") do 18 | response = instance.get_scheduled_transactions(budget_id) 19 | expect(client.last_request.options[:headers]["Authorization"]).to eq "Bearer #{access_token}" 20 | 21 | end 22 | end 23 | 24 | it 'throws when unauthorized' do 25 | VCR.use_cassette("scheduled_transactions_unauthorized") do 26 | client = YNAB::API.new('not_valid_access_token', 'api.localhost:3000', false) 27 | begin 28 | response = client.scheduled_transactions.get_scheduled_transactions(budget_id) 29 | rescue YNAB::ApiError => e 30 | expect(e.code).to be 401 31 | expect(client.last_request.response.options[:code]).to be 401 32 | end 33 | end 34 | end 35 | end 36 | 37 | describe 'GET /budgets/{budget_id}/scheduled_transactions' do 38 | it 'returns a list of transactions' do 39 | VCR.use_cassette("scheduled_transactions") do 40 | response = instance.get_scheduled_transactions(budget_id) 41 | expect(client.last_request.response.options[:code]).to be 200 42 | expect(response.data.scheduled_transactions.length).to be 1 43 | end 44 | end 45 | end 46 | 47 | describe 'GET /budgets/{budget_id}/scheduled_transactions/{payee_id}' do 48 | it 'returns a payee' do 49 | VCR.use_cassette("scheduled_transaction") do 50 | response = instance.get_scheduled_transaction_by_id(budget_id, '1a8e4929-3ad1-4859-8443-2aeeab0684ab') 51 | expect(response.data.scheduled_transaction).to be 52 | expect(response.data.scheduled_transaction.amount).to eq -10000 53 | end 54 | end 55 | end 56 | 57 | describe 'POST /budgets/{budget_id}/scheduled_transactions' do 58 | it 'creates a scheduled transaction' do 59 | VCR.use_cassette("create_scheduled_transaction") do 60 | response = instance.create_scheduled_transaction(budget_id, { 61 | scheduled_transaction: { 62 | date: "#{Time.now.year + 1}-01-01", 63 | account_id: '49b0c987-7d2b-46ec-ba14-f8a7e79fb830', 64 | amount: 20000, 65 | frequency: 'weekly', 66 | } 67 | }) 68 | expect(client.last_request.response.options[:code]).to be 201 69 | expect(response.data.scheduled_transaction).to be 70 | expect(response.data.scheduled_transaction.amount).to eq 20000 71 | end 72 | end 73 | end 74 | end 75 | -------------------------------------------------------------------------------- /spec/api_error_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'APIError' do 4 | it 'should parse error correctly' do 5 | response_body = '{"error":{"id":"401","name":"unauthorized","detail":"Unauthorized"}}' 6 | error = YNAB::ApiError.new({ code: 400, response_headers: nil, response_body: response_body }) 7 | expect(error.code).to eq 400 8 | expect(error.response_body).to eq response_body 9 | 10 | expect(error.id).to eq '401' 11 | expect(error.name).to eq 'unauthorized' 12 | expect(error.detail).to eq 'Unauthorized' 13 | end 14 | 15 | it 'should gracefully handle an unparsable error' do 16 | response_body = '{"strange_object":{"key":"an_interesting_key"}}' 17 | error = YNAB::ApiError.new({ code: 201, response_headers: nil, response_body: response_body }) 18 | expect(error.code).to eq 201 19 | expect(error.response_body).to eq response_body 20 | 21 | expect(error.id).to_not be 22 | expect(error.name).to_not be 23 | expect(error.detail).to_not be 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/account.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/accounts/5982e895-98e5-41ca-9681-0b6de1036a1c 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"bd6170a2d08462a3c422a119e29e5332" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - 6fe9cc67-7e2c-43c7-b2f6-7ab51c9e949f 35 | X-Runtime: 36 | - '0.180335' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"account":{"id":"5982e895-98e5-41ca-9681-0b6de1036a1c","name":"Checking","type":"checking","on_budget":true,"closed":false,"note":null,"balance":998000,"cleared_balance":1000000,"uncleared_balance":-2000}}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/accounts/5982e895-98e5-41ca-9681-0b6de1036a1c 45 | recorded_at: Thu, 15 Feb 2018 18:59:57 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/accounts.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/accounts 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"cba59f1eb6fcb1979c5e82ff7a05d1b2" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - c2221610-c1f5-4ee2-a4b7-6914ce33a360 35 | X-Runtime: 36 | - '0.192788' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"accounts":[{"id":"5982e895-98e5-41ca-9681-0b6de1036a1c","name":"Checking","type":"checking","on_budget":true,"closed":false,"note":null,"balance":998000,"cleared_balance":1000000,"uncleared_balance":-2000}]}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/accounts 45 | recorded_at: Thu, 15 Feb 2018 18:59:57 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/accounts_unauthorized.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/accounts 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer not_valid_access_token 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 401 23 | message: Unauthorized 24 | headers: 25 | Cache-Control: 26 | - no-store 27 | Pragma: 28 | - no-cache 29 | WWW-Authenticate: 30 | - Bearer realm="Doorkeeper", error="invalid_token", error_description="The access 31 | token is invalid" 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Vary: 35 | - Accept-Encoding, Origin 36 | X-Request-Id: 37 | - 52909d39-84d2-4e19-8199-930d5196fccc 38 | X-Runtime: 39 | - '0.173715' 40 | Transfer-Encoding: 41 | - chunked 42 | body: 43 | encoding: UTF-8 44 | string: '{"error":{"id":"401","name":"unauthorized","detail":"Unauthorized"}}' 45 | http_version: '1.1' 46 | adapter_metadata: 47 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/accounts 48 | recorded_at: Thu, 15 Feb 2018 18:59:57 GMT 49 | recorded_with: VCR 3.0.3 50 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/budgets.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"ab6962c846032f67f346997e36a2d21e" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - cac5447b-f782-466a-9f0e-bf6fc725bf7f 35 | X-Runtime: 36 | - '0.176181' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"budgets":[{"id":"36e85244-5254-47be-a7d1-28be746a7f72","name":"Hammel 42 | Budget","last_modified_on":"2018-02-14T20:28:50+00:00","date_format":{"locale":"en_US"},"currency_format":{"locale":"en_US"},"first_month":"2010-10-01","last_month":"2018-02-01"},{"id":"5b202339-ba6a-4498-bc93-f6909ec38153","name":"Household 43 | Budget","last_modified_on":"2018-02-14T20:28:53+00:00","date_format":{"locale":"en_US"},"currency_format":{"locale":"en_US"},"first_month":"2013-09-01","last_month":"2018-02-01"},{"id":"9db9a05d-c61c-4ce8-95ea-06174910f332","name":"My 44 | Budget","last_modified_on":"2018-02-15T18:24:02+00:00","date_format":{"format":"MM/DD/YYYY"},"currency_format":{"iso_code":"USD","example_format":"123,456.78","decimal_digits":2,"decimal_separator":".","symbol_first":true,"group_separator":",","currency_symbol":"$","display_symbol":true},"first_month":"2018-02-01","last_month":"2018-02-01"},{"id":"f419ac25-6217-4175-88dc-c3136ff5f6fd","name":"ABC","last_modified_on":"2018-02-15T18:53:19+00:00","date_format":{"format":"MM/DD/YYYY"},"currency_format":{"iso_code":"USD","example_format":"123,456.78","decimal_digits":2,"decimal_separator":".","symbol_first":true,"group_separator":",","currency_symbol":"$","display_symbol":true},"first_month":"2018-02-01","last_month":"2018-02-01"}]}}' 45 | http_version: '1.1' 46 | adapter_metadata: 47 | effective_url: http://api.localhost:3000/v1/budgets 48 | recorded_at: Thu, 15 Feb 2018 18:59:58 GMT 49 | recorded_with: VCR 3.0.3 50 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/budgets_unauthorized.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer not_valid_access_token 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 401 23 | message: Unauthorized 24 | headers: 25 | Cache-Control: 26 | - no-store 27 | Pragma: 28 | - no-cache 29 | WWW-Authenticate: 30 | - Bearer realm="Doorkeeper", error="invalid_token", error_description="The access 31 | token is invalid" 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Vary: 35 | - Accept-Encoding, Origin 36 | X-Request-Id: 37 | - 45145cc7-12a5-4f74-bf0a-d25b6c28ff73 38 | X-Runtime: 39 | - '0.168549' 40 | Transfer-Encoding: 41 | - chunked 42 | body: 43 | encoding: UTF-8 44 | string: '{"error":{"id":"401","name":"unauthorized","detail":"Unauthorized"}}' 45 | http_version: '1.1' 46 | adapter_metadata: 47 | effective_url: http://api.localhost:3000/v1/budgets 48 | recorded_at: Thu, 15 Feb 2018 18:59:58 GMT 49 | recorded_with: VCR 3.0.3 50 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/bulk_transactions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions/bulk 6 | body: 7 | encoding: UTF-8 8 | string: '{"transactions":[{"date":"2018-01-01","account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","amount":10000},{"date":"2018-01-02","account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","amount":20000},{"date":"2018-01-03","account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","amount":30000,"import_id":"123456"}]}' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 201 23 | message: Created 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"3e655bb6ce7a97fe7f25d5cb9d1fea8f" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - 1018e016-4962-4a5f-bf49-1eba5493579f 35 | X-Runtime: 36 | - '0.288196' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"bulk":{"transaction_ids":["7c6ff284-517b-419a-a08b-3f24e2869618","a6e357f4-a233-4f3a-9bb3-87e45fadaf62","27d58f81-2200-4fe8-8df8-2ff100de6563"],"duplicate_import_ids":[]}}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions/bulk 45 | recorded_at: Thu, 15 Feb 2018 19:13:50 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/categories_unauthorized.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/categories 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer not_valid_access_token 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 401 23 | message: Unauthorized 24 | headers: 25 | Cache-Control: 26 | - no-store 27 | Pragma: 28 | - no-cache 29 | WWW-Authenticate: 30 | - Bearer realm="Doorkeeper", error="invalid_token", error_description="The access 31 | token is invalid" 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Vary: 35 | - Accept-Encoding, Origin 36 | X-Request-Id: 37 | - 93a08156-ba36-4b4e-9a63-765c2a00560a 38 | X-Runtime: 39 | - '0.170777' 40 | Transfer-Encoding: 41 | - chunked 42 | body: 43 | encoding: UTF-8 44 | string: '{"error":{"id":"401","name":"unauthorized","detail":"Unauthorized"}}' 45 | http_version: '1.1' 46 | adapter_metadata: 47 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/categories 48 | recorded_at: Thu, 15 Feb 2018 18:59:58 GMT 49 | recorded_with: VCR 3.0.3 50 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/category.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/categories/acd2a771-0a56-4dba-97bd-3952b0879282 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"7839befe092f187d604ddad811587a57" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - 1ddc786e-63fe-45ec-acd8-588e917ade51 35 | X-Runtime: 36 | - '0.183579' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"category":{"id":"574fac19-537d-46a8-be2b-d2f875691165","category_group_id":"2318eeca-0504-41b4-86c8-9426130eb27d","name":"Groceries","hidden":false,"note":null,"budgeted":0,"activity":0,"balance":0}}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/categories/574fac19-537d-46a8-be2b-d2f875691165 45 | recorded_at: Thu, 15 Feb 2018 18:59:59 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/category_transactions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/categories/84ffe61c-081c-44db-ad23-6ee809206c40/transactions 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.4.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"34c52d2665519c44aa89bfb862b99e7e" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - 0e4f8e02-620d-4433-8a88-f776fdafc165 35 | X-Runtime: 36 | - '0.376111' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"transactions":[{"type":"subtransaction","id":"4a675c31-f5f1-43ba-8c9a-6cd7d5b0cac4","parent_transaction_id":"56a3ae86-ce55-4e23-923b-6cb59add860b","date":"2018-03-26","amount":-50000,"memo":"","cleared":"uncleared","approved":true,"flag_color":null,"account_id":"16addaa3-cfaf-4e57-933c-7e1645f000f0","payee_id":null,"category_id":"84ffe61c-081c-44db-ad23-6ee809206c40","transfer_account_id":null,"import_id":null},{"type":"subtransaction","id":"4c3f5877-b4b9-4d5a-9177-be7dfcd86c6e","parent_transaction_id":"910a79e1-29f5-4789-a2a0-2a69c2f94a2b","date":"2018-03-26","amount":-25000,"memo":"","cleared":"uncleared","approved":true,"flag_color":null,"account_id":"16addaa3-cfaf-4e57-933c-7e1645f000f0","payee_id":null,"category_id":"84ffe61c-081c-44db-ad23-6ee809206c40","transfer_account_id":null,"import_id":null},{"type":"transaction","id":"d477e91a-1f2b-4df5-8069-6b61dee51259","parent_transaction_id":null,"date":"2018-03-27","amount":-13000,"memo":"","cleared":"uncleared","approved":true,"flag_color":null,"account_id":"16addaa3-cfaf-4e57-933c-7e1645f000f0","payee_id":"2676f959-c5de-4db2-8d3f-2503777b25fb","category_id":"84ffe61c-081c-44db-ad23-6ee809206c40","transfer_account_id":null,"import_id":null}]}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/6e6aa585-8537-4afc-950f-93d55fac17fa/categories/84ffe61c-081c-44db-ad23-6ee809206c40/transactions 45 | recorded_at: Tue, 27 Mar 2018 17:02:30 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/create_account.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/accounts 6 | body: 7 | encoding: UTF-8 8 | string: '{"account":{"name":"New Checking Account","type":"checking","balance":215000}}' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/1.19.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 201 23 | message: Created 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | X-Content-Type-Options: 28 | - nosniff 29 | X-Frame-Options: 30 | - deny 31 | Vary: 32 | - Accept-Encoding, Origin 33 | ETag: 34 | - W/"8b7ba673cfda40fd762ec996f0c8e515" 35 | Cache-Control: 36 | - max-age=0, private, must-revalidate 37 | X-Request-Id: 38 | - b651ff3a-84d3-4f3a-b83d-e5738cfd8507 39 | X-Runtime: 40 | - '0.293182' 41 | Transfer-Encoding: 42 | - chunked 43 | body: 44 | encoding: UTF-8 45 | string: '{"data":{"account":{"id":"77d219fc-51e9-415e-89b4-e0d893529580","name":"New 46 | Checking Account","type":"checking","on_budget":true,"closed":false,"note":null,"balance":215000,"cleared_balance":215000,"uncleared_balance":0,"transfer_payee_id":"50031af4-c7b0-4a97-a202-daeccf8e0b2f","deleted":false},"server_knowledge":45}}' 47 | http_version: '1.1' 48 | adapter_metadata: 49 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/accounts 50 | recorded_at: Wed, 12 Aug 2020 15:04:29 GMT 51 | recorded_with: VCR 3.0.3 52 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/create_scheduled_transaction.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/scheduled_transactions 6 | body: 7 | encoding: UTF-8 8 | string: '{"scheduled_transaction":{"date":"2025-01-01","account_id":"49b0c987-7d2b-46ec-ba14-f8a7e79fb830","amount":20000,"frequency":"weekly"}}' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/3.2.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 201 23 | message: Created 24 | headers: 25 | x-frame-options: 26 | - deny 27 | x-xss-protection: 28 | - '0' 29 | x-content-type-options: 30 | - nosniff 31 | x-download-options: 32 | - noopen 33 | x-permitted-cross-domain-policies: 34 | - none 35 | referrer-policy: 36 | - strict-origin-when-cross-origin 37 | content-type: 38 | - application/json; charset=utf-8 39 | vary: 40 | - Accept-Encoding, Origin 41 | etag: 42 | - W/"a2fe3b102465b2515af0f411970ca861" 43 | cache-control: 44 | - max-age=0, private, must-revalidate 45 | x-request-id: 46 | - 0ccaa271-1563-4ab8-a6ad-db09893e62db 47 | x-runtime: 48 | - '0.104987' 49 | server-timing: 50 | - start_processing.action_controller;dur=0.01, sql.active_record;dur=31.01, 51 | instantiation.active_record;dur=0.56, cache_read.active_support;dur=0.21, 52 | cache_fetch_hit.active_support;dur=0.00, transaction.active_record;dur=26.93, 53 | render.active_model_serializers;dur=15.03, process_action.action_controller;dur=50.91 54 | Content-Length: 55 | - '463' 56 | body: 57 | encoding: ASCII-8BIT 58 | string: '{"data":{"scheduled_transaction":{"id":"5901eada-db36-4d95-b737-c1a5cc43a915","date_first":"2025-01-01","date_next":"2025-01-01","frequency":"weekly","amount":20000,"memo":null,"flag_color":null,"flag_name":null,"account_id":"49b0c987-7d2b-46ec-ba14-f8a7e79fb830","account_name":"Checking","payee_id":null,"payee_name":null,"category_id":null,"category_name":"Uncategorized","transfer_account_id":null,"deleted":false,"subtransactions":[]},"server_knowledge":64}}' 59 | http_version: '1.1' 60 | adapter_metadata: 61 | effective_url: http://localhost:3000/papi/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/scheduled_transactions 62 | recorded_at: Mon, 08 Jul 2024 23:16:33 GMT 63 | recorded_with: VCR 6.2.0 64 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/create_transaction.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions 6 | body: 7 | encoding: UTF-8 8 | string: '{"transaction":{"date":"2018-01-01","account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","amount":20000}}' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 201 23 | message: Created 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"b7035ecde34f8285e495491652ea37ff" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - 57b66218-70d4-467e-9151-7b223c416f3b 35 | X-Runtime: 36 | - '0.265999' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"transaction":{"id":"4cd63d34-3814-4f50-abd0-59ce05b40d91","date":"2018-01-01","amount":20000,"memo":null,"cleared":"uncleared","approved":false,"flag_color":null,"account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","payee_id":null,"category_id":null,"transfer_account_id":null,"import_id":null,"subtransactions":[]}}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions 45 | recorded_at: Thu, 15 Feb 2018 19:06:36 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/create_transactions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions 6 | body: 7 | encoding: UTF-8 8 | string: '{"transactions":[{"date":"2018-01-01","account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","amount":20000},{"date":"2018-01-02","account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","amount":30000}]}' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 201 23 | message: Created 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"b7035ecde34f8285e495491652ea37ff" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - 57b66218-70d4-467e-9151-7b223c416f3b 35 | X-Runtime: 36 | - '0.265999' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"transactions":[{"id":"4cd63d34-3814-4f50-abd0-59ce05b40d91","date":"2018-01-01","amount":20000,"memo":null,"cleared":"uncleared","approved":false,"flag_color":null,"account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","payee_id":null,"category_id":null,"transfer_account_id":null,"import_id":null,"subtransactions":[]},{"id":"4b857bae-5529-44ee-bf8d-ed29d8c151dd","date":"2018-01-02","amount":20000,"memo":null,"cleared":"uncleared","approved":false,"flag_color":null,"account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","payee_id":null,"category_id":null,"transfer_account_id":null,"import_id":null,"subtransactions":[]}]}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions 45 | recorded_at: Thu, 15 Feb 2018 19:06:36 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/import_transactions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions/import 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/1.17.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 201 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | X-Content-Type-Options: 28 | - nosniff 29 | X-Frame-Options: 30 | - deny 31 | Vary: 32 | - Accept-Encoding, Origin 33 | ETag: 34 | - W/"59dad611fef6101f6355d263fe3c332d" 35 | Cache-Control: 36 | - max-age=0, private, must-revalidate 37 | X-Request-Id: 38 | - b9d42c37-15d3-4c4c-98d3-7b33da03a745 39 | X-Runtime: 40 | - '0.518840' 41 | Transfer-Encoding: 42 | - chunked 43 | body: 44 | encoding: UTF-8 45 | string: '{"data":{"transaction_ids":["07b68f11-98bd-4184-8866-83268a654318"]}}' 46 | http_version: '1.1' 47 | adapter_metadata: 48 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions/import 49 | recorded_at: Tue, 28 Apr 2020 19:10:16 GMT 50 | recorded_with: VCR 3.0.3 51 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/month_transactions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/months/2024-07-01/transactions 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.4.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"d2b4b29be1231be9847defe032df6712" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - b79f3971-7666-4b04-8d8b-bd5258dd02bc 35 | X-Runtime: 36 | - '0.186443' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"transactions":[{"type":"subtransaction","id":"008908a3-07c2-4684-b4c1-6f1024814f8d","parent_transaction_id":"910a79e1-29f5-4789-a2a0-2a69c2f94a2b","date":"2018-03-26","amount":-15000,"memo":"","cleared":"uncleared","approved":true,"flag_color":null,"account_id":"16addaa3-cfaf-4e57-933c-7e1645f000f0","payee_id":"2676f959-c5de-4db2-8d3f-2503777b25fb","category_id":"b457e34a-234e-40b2-992e-40055171e644","transfer_account_id":null,"import_id":null},{"type":"transaction","id":"d477e91a-1f2b-4df5-8069-6b61dee51259","parent_transaction_id":null,"date":"2018-03-27","amount":-13000,"memo":"","cleared":"uncleared","approved":true,"flag_color":null,"account_id":"16addaa3-cfaf-4e57-933c-7e1645f000f0","payee_id":"2676f959-c5de-4db2-8d3f-2503777b25fb","category_id":"84ffe61c-081c-44db-ad23-6ee809206c40","transfer_account_id":null,"import_id":null}]}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/6e6aa585-8537-4afc-950f-93d55fac17fa/months/2024-07-01/transactions 45 | recorded_at: Tue, 27 Mar 2018 17:03:22 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/months.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/months 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"35fbac0102918d018b79d75ac9c8e0b9" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - 6f8c270d-199a-48fc-a69f-4cbd414d6679 35 | X-Runtime: 36 | - '0.178872' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"months":[{"month":"2018-01-01","note":null,"to_be_budgeted":null,"age_of_money":null},{"month":"2018-02-01","note":"Test 42 | Note","to_be_budgeted":1000000,"age_of_money":null},{"month":"2018-03-01","note":null,"to_be_budgeted":998000,"age_of_money":null}]}}' 43 | http_version: '1.1' 44 | adapter_metadata: 45 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/months 46 | recorded_at: Thu, 15 Feb 2018 18:59:59 GMT 47 | recorded_with: VCR 3.0.3 48 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/months_unauthorized.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/months 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer not_valid_access_token 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 401 23 | message: Unauthorized 24 | headers: 25 | Cache-Control: 26 | - no-store 27 | Pragma: 28 | - no-cache 29 | WWW-Authenticate: 30 | - Bearer realm="Doorkeeper", error="invalid_token", error_description="The access 31 | token is invalid" 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Vary: 35 | - Accept-Encoding, Origin 36 | X-Request-Id: 37 | - 1b41084b-85fa-44f4-bfd2-157c7d5bf265 38 | X-Runtime: 39 | - '0.193011' 40 | Transfer-Encoding: 41 | - chunked 42 | body: 43 | encoding: UTF-8 44 | string: '{"error":{"id":"401","name":"unauthorized","detail":"Unauthorized"}}' 45 | http_version: '1.1' 46 | adapter_metadata: 47 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/months 48 | recorded_at: Thu, 15 Feb 2018 18:59:59 GMT 49 | recorded_with: VCR 3.0.3 50 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/multiple_transactions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions 6 | body: 7 | encoding: UTF-8 8 | string: '{"transactions":[{"date":"2018-01-01","account_id":"c15e474a-fff6-459f-82de-8e7ea1a3819e","amount":10000},{"date":"2018-01-02","account_id":"c15e474a-fff6-459f-82de-8e7ea1a3819e","amount":20000},{"date":"2018-01-03","account_id":"c15e474a-fff6-459f-82de-8e7ea1a3819e","amount":30000,"import_id":"123456"}]}' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/1.4.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 201 23 | message: Created 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"fd90fca6fa3aed56cada484393903b3f" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - 5e0ae946-ad77-4f25-8475-a2deed9758da 35 | X-Runtime: 36 | - '0.592970' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"transaction_ids":["8006058e-880d-454a-b872-ac1f4e57fa83","f666fa17-f96d-4b53-ada1-0191d6fb4fa2","fb14edc0-5492-4c57-9acd-2f2795f02624"],"duplicate_import_ids":[],"transactions":[{"id":"8006058e-880d-454a-b872-ac1f4e57fa83","date":"2018-01-01","amount":10000,"memo":null,"cleared":"uncleared","approved":false,"flag_color":null,"account_id":"c15e474a-fff6-459f-82de-8e7ea1a3819e","account_name":"Checking","payee_id":null,"payee_name":null,"category_id":null,"category_name":null,"transfer_account_id":null,"transfer_transaction_id":null,"import_id":null,"deleted":false,"subtransactions":[]},{"id":"f666fa17-f96d-4b53-ada1-0191d6fb4fa2","date":"2018-01-02","amount":20000,"memo":null,"cleared":"uncleared","approved":false,"flag_color":null,"account_id":"c15e474a-fff6-459f-82de-8e7ea1a3819e","account_name":"Checking","payee_id":null,"payee_name":null,"category_id":null,"category_name":null,"transfer_account_id":null,"transfer_transaction_id":null,"import_id":null,"deleted":false,"subtransactions":[]},{"id":"fb14edc0-5492-4c57-9acd-2f2795f02624","date":"2018-01-03","amount":30000,"memo":null,"cleared":"uncleared","approved":false,"flag_color":null,"account_id":"c15e474a-fff6-459f-82de-8e7ea1a3819e","account_name":"Checking","payee_id":null,"payee_name":null,"category_id":null,"category_name":null,"transfer_account_id":null,"transfer_transaction_id":null,"import_id":"123456","deleted":false,"subtransactions":[]}]}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/44656099-a8c8-4625-8fef-7c4549e696a7/transactions 45 | recorded_at: Tue, 25 Sep 2018 21:32:45 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/patch_month_category.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: patch 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/months/2018-02-01/categories/acd2a771-0a56-4dba-97bd-3952b0879282 6 | body: 7 | encoding: UTF-8 8 | string: '{"month_category":{"budgeted":20382}}' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/1.4.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"bb47a0ec2db8e9a65487078a80518278" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - e9d2b5ad-bee5-4735-9a43-5f8b8bdca3ac 35 | X-Runtime: 36 | - '0.559140' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"category":{"id":"acd2a771-0a56-4dba-97bd-3952b0879282","category_group_id":"ed6f4c0e-2c5a-45d9-b887-b68a60ea724a","name":"Groceries","hidden":false,"original_category_group_id":null,"note":null,"budgeted":20382,"activity":0,"balance":20382,"goal_type":null,"goal_creation_month":null,"goal_target":0,"goal_target_month":null,"goal_percentage_complete":0,"deleted":false}}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/44656099-a8c8-4625-8fef-7c4549e696a7/months/2018-02-01/categories/acd2a771-0a56-4dba-97bd-3952b0879282 45 | recorded_at: Tue, 25 Sep 2018 22:35:32 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/payee.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/payees/200e6eb1-02fc-4af6-be26-27c5740bb949 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"971e3bf102aa857d47539304bc5a55d3" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - 1bbaa5e9-ff59-4dd1-8c09-9d2a29a9d3f3 35 | X-Runtime: 36 | - '0.192448' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"payee":{"id":"200e6eb1-02fc-4af6-be26-27c5740bb949","name":"Test 42 | Payee","transfer_account_id":null}}}' 43 | http_version: '1.1' 44 | adapter_metadata: 45 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/payees/200e6eb1-02fc-4af6-be26-27c5740bb949 46 | recorded_at: Thu, 15 Feb 2018 19:00:00 GMT 47 | recorded_with: VCR 3.0.3 48 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/payee_location.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/payee_locations/052c7814-1797-44ce-9519-020e864e4928 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"979ae25047881aa45924b3fb32845a27" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - f8770b52-775c-40de-9e17-aa01c258f8fe 35 | X-Runtime: 36 | - '0.190907' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"payee_location":{"id":"052c7814-1797-44ce-9519-020e864e4928","payee_id":"200e6eb1-02fc-4af6-be26-27c5740bb949","latitude":"40.7128","longitude":"74.006"}}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/payee_locations/052c7814-1797-44ce-9519-020e864e4928 45 | recorded_at: Thu, 15 Feb 2018 19:00:00 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/payee_locations.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/payee_locations 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"d7668022580b47335d428374e66e1579" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - 51a95e24-a6f5-4667-a7c8-4bedfb60cf08 35 | X-Runtime: 36 | - '0.187982' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"payee_locations":[{"id":"052c7814-1797-44ce-9519-020e864e4928","payee_id":"200e6eb1-02fc-4af6-be26-27c5740bb949","latitude":"40.7128","longitude":"74.006"}]}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/payee_locations 45 | recorded_at: Thu, 15 Feb 2018 18:59:59 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/payee_locations_unauthorized.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/payee_locations 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer not_valid_access_token 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 401 23 | message: Unauthorized 24 | headers: 25 | Cache-Control: 26 | - no-store 27 | Pragma: 28 | - no-cache 29 | WWW-Authenticate: 30 | - Bearer realm="Doorkeeper", error="invalid_token", error_description="The access 31 | token is invalid" 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Vary: 35 | - Accept-Encoding, Origin 36 | X-Request-Id: 37 | - e8acf6bd-47d0-4fe9-8bb9-6e7bfdd1d14d 38 | X-Runtime: 39 | - '0.176528' 40 | Transfer-Encoding: 41 | - chunked 42 | body: 43 | encoding: UTF-8 44 | string: '{"error":{"id":"401","name":"unauthorized","detail":"Unauthorized"}}' 45 | http_version: '1.1' 46 | adapter_metadata: 47 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/payee_locations 48 | recorded_at: Thu, 15 Feb 2018 19:00:00 GMT 49 | recorded_with: VCR 3.0.3 50 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/payee_transactions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/payees/2676f959-c5de-4db2-8d3f-2503777b25fb/transactions 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.4.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"d2b4b29be1231be9847defe032df6712" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - b79f3971-7666-4b04-8d8b-bd5258dd02bc 35 | X-Runtime: 36 | - '0.186443' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"transactions":[{"type":"subtransaction","id":"008908a3-07c2-4684-b4c1-6f1024814f8d","parent_transaction_id":"910a79e1-29f5-4789-a2a0-2a69c2f94a2b","date":"2018-03-26","amount":-15000,"memo":"","cleared":"uncleared","approved":true,"flag_color":null,"account_id":"16addaa3-cfaf-4e57-933c-7e1645f000f0","payee_id":"2676f959-c5de-4db2-8d3f-2503777b25fb","category_id":"b457e34a-234e-40b2-992e-40055171e644","transfer_account_id":null,"import_id":null},{"type":"transaction","id":"d477e91a-1f2b-4df5-8069-6b61dee51259","parent_transaction_id":null,"date":"2018-03-27","amount":-13000,"memo":"","cleared":"uncleared","approved":true,"flag_color":null,"account_id":"16addaa3-cfaf-4e57-933c-7e1645f000f0","payee_id":"2676f959-c5de-4db2-8d3f-2503777b25fb","category_id":"84ffe61c-081c-44db-ad23-6ee809206c40","transfer_account_id":null,"import_id":null}]}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/6e6aa585-8537-4afc-950f-93d55fac17fa/payees/2676f959-c5de-4db2-8d3f-2503777b25fb/transactions 45 | recorded_at: Tue, 27 Mar 2018 17:03:22 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/payees.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/payees 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"e2f459e462e2bafaaf2ceef3fcd3a7c9" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - 15151992-e17b-4848-a6b5-72f4aa9d2a3e 35 | X-Runtime: 36 | - '0.180255' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"payees":[{"id":"2141b5d8-5b9b-4a17-be45-3f4a9ac397ec","name":"Starting 42 | Balance","transfer_account_id":null},{"id":"7f786732-10c1-4618-aa0b-56199b2cea26","name":"Manual 43 | Balance Adjustment","transfer_account_id":null},{"id":"f0c12109-c27a-4739-adc5-e598e33dd1dd","name":"Reconciliation 44 | Balance Adjustment","transfer_account_id":null},{"id":"8a9a08ae-416d-436c-870a-a25e2d8f24cd","name":"Transfer 45 | : Checking","transfer_account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c"},{"id":"200e6eb1-02fc-4af6-be26-27c5740bb949","name":"Test 46 | Payee","transfer_account_id":null}]}}' 47 | http_version: '1.1' 48 | adapter_metadata: 49 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/payees 50 | recorded_at: Thu, 15 Feb 2018 19:00:00 GMT 51 | recorded_with: VCR 3.0.3 52 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/payees_unauthorized.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/payees 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer not_valid_access_token 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 401 23 | message: Unauthorized 24 | headers: 25 | Cache-Control: 26 | - no-store 27 | Pragma: 28 | - no-cache 29 | WWW-Authenticate: 30 | - Bearer realm="Doorkeeper", error="invalid_token", error_description="The access 31 | token is invalid" 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Vary: 35 | - Accept-Encoding, Origin 36 | X-Request-Id: 37 | - caf059d7-21da-491d-a6da-59c28f12a374 38 | X-Runtime: 39 | - '0.178435' 40 | Transfer-Encoding: 41 | - chunked 42 | body: 43 | encoding: UTF-8 44 | string: '{"error":{"id":"401","name":"unauthorized","detail":"Unauthorized"}}' 45 | http_version: '1.1' 46 | adapter_metadata: 47 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/payees 48 | recorded_at: Thu, 15 Feb 2018 19:00:00 GMT 49 | recorded_with: VCR 3.0.3 50 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/scheduled_transaction.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/scheduled_transactions/1a8e4929-3ad1-4859-8443-2aeeab0684ab 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"a12522073b08168393067bb1afe6f899" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - 0d0d76ee-d37e-4c8d-9caa-eedf60692e61 35 | X-Runtime: 36 | - '0.179118' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"scheduled_transaction":{"id":"1a8e4929-3ad1-4859-8443-2aeeab0684ab","date_first":"2018-02-16","date_next":"2018-02-16","frequency":"never","amount":-10000,"memo":null,"flag_color":null,"account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","payee_id":null,"category_id":null,"transfer_account_id":null,"subtransactions":[]}}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/scheduled_transactions/1a8e4929-3ad1-4859-8443-2aeeab0684ab 45 | recorded_at: Thu, 15 Feb 2018 19:00:01 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/scheduled_transactions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/scheduled_transactions 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"fdf7787d55cba4f4d7531e7cca8d37b0" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - 37014650-d1fe-4fe9-b2cc-c56f08e83e40 35 | X-Runtime: 36 | - '0.192982' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"scheduled_transactions":[{"id":"1a8e4929-3ad1-4859-8443-2aeeab0684ab","date_first":"2018-02-16","date_next":"2018-02-16","frequency":"never","amount":-10000,"memo":null,"flag_color":null,"account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","payee_id":null,"category_id":null,"transfer_account_id":null,"subtransactions":[]}]}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/scheduled_transactions 45 | recorded_at: Thu, 15 Feb 2018 19:00:01 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/scheduled_transactions_unauthorized.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/scheduled_transactions 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer not_valid_access_token 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 401 23 | message: Unauthorized 24 | headers: 25 | Cache-Control: 26 | - no-store 27 | Pragma: 28 | - no-cache 29 | WWW-Authenticate: 30 | - Bearer realm="Doorkeeper", error="invalid_token", error_description="The access 31 | token is invalid" 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Vary: 35 | - Accept-Encoding, Origin 36 | X-Request-Id: 37 | - 5629aa6b-65d4-40d9-ab99-05f4c8e1c533 38 | X-Runtime: 39 | - '0.166653' 40 | Transfer-Encoding: 41 | - chunked 42 | body: 43 | encoding: UTF-8 44 | string: '{"error":{"id":"401","name":"unauthorized","detail":"Unauthorized"}}' 45 | http_version: '1.1' 46 | adapter_metadata: 47 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/scheduled_transactions 48 | recorded_at: Thu, 15 Feb 2018 19:00:01 GMT 49 | recorded_with: VCR 3.0.3 50 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/transaction.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions/81c374ff-74ab-4d6d-8d5a-ba3ad3fa68e4 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"1e46ae4f1882d274e3bc56617bede19d" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - 1754d660-f78f-4aad-a6ec-47d834f47efd 35 | X-Runtime: 36 | - '0.180542' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"transaction":{"id":"81c374ff-74ab-4d6d-8d5a-ba3ad3fa68e4","date":"2018-02-15","amount":-2000,"memo":"","cleared":"uncleared","approved":true,"flag_color":null,"account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","payee_id":"200e6eb1-02fc-4af6-be26-27c5740bb949","category_id":null,"transfer_account_id":null,"import_id":null,"subtransactions":[]}}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions/81c374ff-74ab-4d6d-8d5a-ba3ad3fa68e4 45 | recorded_at: Thu, 15 Feb 2018 19:00:01 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/transactions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"faa32c94f0e94eebee572fe3def08d83" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - d290c58c-2261-4564-a267-5ea1ec878fdf 35 | X-Runtime: 36 | - '0.197369' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"transactions":[{"id":"1f9d45f6-8ba5-476b-8cff-209b3791bd83","date":"2018-02-15","amount":1000000,"memo":null,"cleared":"cleared","approved":true,"flag_color":null,"account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","payee_id":"2141b5d8-5b9b-4a17-be45-3f4a9ac397ec","category_id":"26513650-523e-4e7a-ac0d-f6e78d0a8a03","transfer_account_id":null,"import_id":null,"subtransactions":[]},{"id":"81c374ff-74ab-4d6d-8d5a-ba3ad3fa68e4","date":"2018-02-15","amount":-2000,"memo":"","cleared":"uncleared","approved":true,"flag_color":null,"account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","payee_id":"200e6eb1-02fc-4af6-be26-27c5740bb949","category_id":null,"transfer_account_id":null,"import_id":null,"subtransactions":[]}]}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions 45 | recorded_at: Thu, 15 Feb 2018 19:00:01 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/transactions_invalid_flags.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"faa32c94f0e94eebee572fe3def08d83" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - d290c58c-2261-4564-a267-5ea1ec878fdf 35 | X-Runtime: 36 | - '0.197369' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"transactions":[{"id":"1f9d45f6-8ba5-476b-8cff-209b3791bd83","date":"2018-02-15","amount":1000000,"memo":null,"cleared":"cleared","approved":true,"flag_color":"","account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","payee_id":"2141b5d8-5b9b-4a17-be45-3f4a9ac397ec","category_id":"26513650-523e-4e7a-ac0d-f6e78d0a8a03","transfer_account_id":null,"import_id":null,"subtransactions":[]},{"id":"81c374ff-74ab-4d6d-8d5a-ba3ad3fa68e4","date":"2018-02-15","amount":-2000,"memo":"","cleared":"uncleared","approved":true,"flag_color":"invalid","account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","payee_id":"200e6eb1-02fc-4af6-be26-27c5740bb949","category_id":null,"transfer_account_id":null,"import_id":null,"subtransactions":[]}]}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions 45 | recorded_at: Thu, 15 Feb 2018 19:00:01 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/transactions_unauthorized.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer not_valid_access_token 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 401 23 | message: Unauthorized 24 | headers: 25 | Cache-Control: 26 | - no-store 27 | Pragma: 28 | - no-cache 29 | WWW-Authenticate: 30 | - Bearer realm="Doorkeeper", error="invalid_token", error_description="The access 31 | token is invalid" 32 | Content-Type: 33 | - application/json; charset=utf-8 34 | Vary: 35 | - Accept-Encoding, Origin 36 | X-Request-Id: 37 | - d1ee51ca-8277-44db-bfd4-c2bd375e28ac 38 | X-Runtime: 39 | - '0.183205' 40 | Transfer-Encoding: 41 | - chunked 42 | body: 43 | encoding: UTF-8 44 | string: '{"error":{"id":"401","name":"unauthorized","detail":"Unauthorized"}}' 45 | http_version: '1.1' 46 | adapter_metadata: 47 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions 48 | recorded_at: Thu, 15 Feb 2018 19:00:01 GMT 49 | recorded_with: VCR 3.0.3 50 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/update_transaction.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: put 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions/4cd63d34-3814-4f50-abd0-59ce05b40d91 6 | body: 7 | encoding: UTF-8 8 | string: '{"transaction":{"date":"2018-01-02","account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","amount":30000}}' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"7302aaaf3d3c80e9fadc152a3e84504d" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - 6eedb96f-419a-4c61-8fdb-540c8f5ee47f 35 | X-Runtime: 36 | - '0.192178' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"transaction":{"id":"4cd63d34-3814-4f50-abd0-59ce05b40d91","date":"2018-01-02","amount":30000,"memo":null,"cleared":"uncleared","approved":false,"flag_color":null,"account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","payee_id":null,"category_id":null,"transfer_account_id":null,"import_id":null,"subtransactions":[]}}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions/4cd63d34-3814-4f50-abd0-59ce05b40d91 45 | recorded_at: Thu, 15 Feb 2018 19:11:01 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/update_transactions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: patch 5 | uri: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions 6 | body: 7 | encoding: UTF-8 8 | string: '{"transactions":[{"date":"2018-01-02","account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","amount":30000},{"date":"2018-01-03","account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","amount":40000}]}' 9 | headers: 10 | User-Agent: 11 | - api_client/ruby/0.1.0 12 | Content-Type: 13 | - application/json 14 | Accept: 15 | - application/json 16 | Authorization: 17 | - Bearer 9f1a2c4842b614a771aaae9220fc54ae835e298c4654dc2c9205fc1d7bd1a045 18 | Expect: 19 | - '' 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Vary: 28 | - Accept-Encoding, Origin 29 | ETag: 30 | - W/"7302aaaf3d3c80e9fadc152a3e84504d" 31 | Cache-Control: 32 | - max-age=0, private, must-revalidate 33 | X-Request-Id: 34 | - 6eedb96f-419a-4c61-8fdb-540c8f5ee47f 35 | X-Runtime: 36 | - '0.192178' 37 | Transfer-Encoding: 38 | - chunked 39 | body: 40 | encoding: UTF-8 41 | string: '{"data":{"transactions":[{"id":"4cd63d34-3814-4f50-abd0-59ce05b40d91","date":"2018-01-02","amount":30000,"memo":null,"cleared":"uncleared","approved":false,"flag_color":null,"account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","payee_id":null,"category_id":null,"transfer_account_id":null,"import_id":null,"subtransactions":[]},{"id":"4cd63d34-3814-4f50-abd0-59ce05b40d91","date":"2018-01-03","amount":40000,"memo":null,"cleared":"uncleared","approved":false,"flag_color":null,"account_id":"5982e895-98e5-41ca-9681-0b6de1036a1c","payee_id":null,"category_id":null,"transfer_account_id":null,"import_id":null,"subtransactions":[]}]}}' 42 | http_version: '1.1' 43 | adapter_metadata: 44 | effective_url: http://api.localhost:3000/v1/budgets/f419ac25-6217-4175-88dc-c3136ff5f6fd/transactions/4cd63d34-3814-4f50-abd0-59ce05b40d91 45 | recorded_at: Thu, 15 Feb 2018 19:11:01 GMT 46 | recorded_with: VCR 3.0.3 47 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'ynab' 2 | require 'vcr' 3 | 4 | VCR.configure do |config| 5 | config.allow_http_connections_when_no_cassette = true 6 | config.cassette_library_dir = "spec/fixtures/vcr_cassettes" 7 | config.hook_into :typhoeus 8 | end 9 | 10 | RSpec.configure do |config| 11 | config.expect_with :rspec do |expectations| 12 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true 13 | end 14 | 15 | config.mock_with :rspec do |mocks| 16 | mocks.verify_partial_doubles = true 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /templates/README.md: -------------------------------------------------------------------------------- 1 | This directory contains override templates for generating Ruby code from the OpenAPI spec. They modify the default behavior or the generator. 2 | 3 | The source for these are located at https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/ruby-client. 4 | -------------------------------------------------------------------------------- /templates/api_doc.mustache: -------------------------------------------------------------------------------- 1 | # {{moduleName}}::{{classname}}{{#description}} 2 | 3 | {{.}}{{/description}} 4 | 5 | All URIs are relative to *{{basePath}}* 6 | 7 | | Method | HTTP request | Description | 8 | | ------ | ------------ | ----------- | 9 | {{#operations}} 10 | {{#operation}} 11 | | [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | 12 | {{/operation}} 13 | {{/operations}} 14 | 15 | {{#operations}} 16 | {{#operation}} 17 | 18 | ## {{operationId}} 19 | 20 | > {{#returnType}}{{#returnTypeIsPrimitive}}{{returnType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}<{{{returnType}}}>{{/returnTypeIsPrimitive}} {{/returnType}}{{operationId}}{{#hasParams}}({{^vendorExtensions.x-group-parameters}}{{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}opts{{/vendorExtensions.x-group-parameters}}){{/hasParams}} 21 | 22 | {{{summary}}}{{#notes}} 23 | 24 | {{{.}}}{{/notes}} 25 | 26 | ### Parameters 27 | 28 | {{^allParams}} 29 | This endpoint does not need any parameter. 30 | {{/allParams}} 31 | {{#allParams}} 32 | {{#-first}} 33 | | Name | Type | Description | Notes | 34 | | ---- | ---- | ----------- | ----- | 35 | {{/-first}} 36 | | **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | {{^required}}[optional]{{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} | 37 | {{/allParams}} 38 | 39 | ### Return type 40 | 41 | {{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}nil (empty response body){{/returnType}} 42 | 43 | {{/operation}} 44 | {{/operations}} 45 | -------------------------------------------------------------------------------- /templates/api_info.mustache: -------------------------------------------------------------------------------- 1 | {{#appName}} 2 | #{{{.}}} 3 | 4 | {{/appName}} 5 | {{#appDescription}} 6 | #{{{.}}} 7 | {{/appDescription}} 8 | {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} 9 | Generated by: OpenAPI Generator (https://openapi-generator.tech) 10 | -------------------------------------------------------------------------------- /templates/gem.mustache: -------------------------------------------------------------------------------- 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 | require 'ynab/overrides/transactions_api' 25 | 26 | module {{moduleName}} 27 | class API 28 | def initialize(access_token, host = 'api.ynab.com', useHttps = true) 29 | config = Configuration.default 30 | config.access_token = access_token 31 | config.scheme = useHttps ? 'https' : 'http' 32 | config.host = host 33 | config.base_path = '/v1' 34 | 35 | @client = ApiClient.new(config) 36 | end 37 | 38 | def user 39 | UserApi.new(@client) 40 | end 41 | 42 | def budgets 43 | BudgetsApi.new(@client) 44 | end 45 | 46 | def accounts 47 | AccountsApi.new(@client) 48 | end 49 | 50 | def categories 51 | CategoriesApi.new(@client) 52 | end 53 | 54 | def months 55 | MonthsApi.new(@client) 56 | end 57 | 58 | def payees 59 | PayeesApi.new(@client) 60 | end 61 | 62 | def payee_locations 63 | PayeeLocationsApi.new(@client) 64 | end 65 | 66 | def transactions 67 | YNAB::Overrides::TransactionsApi.new(@client) 68 | end 69 | 70 | def scheduled_transactions 71 | ScheduledTransactionsApi.new(@client) 72 | end 73 | 74 | def last_request 75 | @client.last_request 76 | end 77 | end 78 | end 79 | 80 | # Support old interface: YnabApi::Client 81 | module YnabApi 82 | class Client < {{moduleName}}::API 83 | end 84 | end 85 | -------------------------------------------------------------------------------- /templates/gemspec.mustache: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | 3 | =begin 4 | {{> api_info}} 5 | =end 6 | 7 | $:.push File.expand_path("../lib", __FILE__) 8 | require "{{gemName}}/version" 9 | 10 | Gem::Specification.new do |s| 11 | s.name = "{{gemName}}{{^gemName}}{{{appName}}}{{/gemName}}" 12 | s.version = {{moduleName}}::VERSION 13 | s.platform = Gem::Platform::RUBY 14 | s.authors = ["{{gemAuthor}}{{^gemAuthor}}OpenAPI-Generator{{/gemAuthor}}"] 15 | s.email = ["{{gemAuthorEmail}}{{^gemAuthorEmail}}{{infoEmail}}{{/gemAuthorEmail}}"] 16 | s.homepage = "{{gemHomepage}}{{^gemHomepage}}https://openapi-generator.tech{{/gemHomepage}}" 17 | s.summary = "{{gemSummary}}{{^gemSummary}}{{{appName}}} Ruby Gem{{/gemSummary}}" 18 | s.description = "{{gemDescription}}{{^gemDescription}}{{/gemDescription}} Generated from server specification version {{version}}." 19 | s.license = "{{{gemLicense}}}{{^gemLicense}}Unlicense{{/gemLicense}}" 20 | s.required_ruby_version = "{{{gemRequiredRubyVersion}}}{{^gemRequiredRubyVersion}}>= 2.7{{/gemRequiredRubyVersion}}" 21 | s.metadata = {{{gemMetadata}}}{{^gemMetadata}}{}{{/gemMetadata}} 22 | 23 | {{#isFaraday}} 24 | s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 3.0' 25 | s.add_runtime_dependency 'faraday-multipart' 26 | s.add_runtime_dependency 'marcel' 27 | {{/isFaraday}} 28 | {{#isTyphoeus}} 29 | s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' 30 | {{/isTyphoeus}} 31 | {{#isHttpx}} 32 | s.add_runtime_dependency 'httpx', '~> 1.0', '>= 1.0.0' 33 | {{/isHttpx}} 34 | 35 | s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' 36 | 37 | s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } 38 | s.test_files = `find spec/*`.split("\n") 39 | s.executables = [] 40 | s.require_paths = ["lib"] 41 | end 42 | -------------------------------------------------------------------------------- /templates/partial_model_enum_class.mustache: -------------------------------------------------------------------------------- 1 | class {{classname}}{{#allowableValues}}{{#enumVars}} 2 | {{{name}}} = {{{value}}}.freeze{{/enumVars}} 3 | 4 | {{/allowableValues}} 5 | def self.all_vars 6 | @all_vars ||= [{{#allowableValues}}{{#enumVars}}{{{name}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}].freeze 7 | end 8 | 9 | # Builds the enum from string 10 | # @param [String] The enum value in the form of the string 11 | # @return [String] The enum value 12 | def self.build_from_hash(value) 13 | new.build_from_hash(value) 14 | end 15 | 16 | # Builds the enum from string 17 | # @param [String] The enum value in the form of the string 18 | # @return [String] The enum value 19 | def build_from_hash(value) 20 | if {{classname}}.all_vars.include?(value) 21 | return value 22 | else 23 | return nil 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /templates/partial_model_generic_doc.mustache: -------------------------------------------------------------------------------- 1 | # {{moduleName}}::{{classname}} 2 | 3 | ## Properties 4 | 5 | | Name | Type | Description | Notes | 6 | | ---- | ---- | ----------- | ----- | 7 | {{#vars}} 8 | | **{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional]{{/required}}{{#isReadOnly}}[readonly]{{/isReadOnly}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} | 9 | {{/vars}} 10 | -------------------------------------------------------------------------------- /ynab.gemspec: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | 3 | =begin 4 | #YNAB API Endpoints 5 | 6 | #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 is at https://api.ynab.com 7 | 8 | Generated by: OpenAPI Generator (https://openapi-generator.tech) 9 | 10 | =end 11 | 12 | $:.push File.expand_path("../lib", __FILE__) 13 | require "ynab/version" 14 | 15 | Gem::Specification.new do |s| 16 | s.name = "ynab" 17 | s.version = YNAB::VERSION 18 | s.platform = Gem::Platform::RUBY 19 | s.authors = ["YNAB"] 20 | s.email = ["api@ynab.com"] 21 | s.homepage = "https://github.com/ynab/ynab-sdk-ruby" 22 | s.summary = "Official Ruby client for the YNAB API" 23 | s.description = "Official Ruby client for the YNAB API. API documentation available at https://api.ynab.com. Generated from server specification version 1.74.0." 24 | s.license = "Apache-2.0" 25 | s.required_ruby_version = ">= 3.3" 26 | s.metadata = {} 27 | 28 | s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' 29 | 30 | s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' 31 | 32 | s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } 33 | s.test_files = `find spec/*`.split("\n") 34 | s.executables = [] 35 | s.require_paths = ["lib"] 36 | end 37 | --------------------------------------------------------------------------------