Class: YNAB::TransactionsApi
- Inherits:
-
Object
- Object
- YNAB::TransactionsApi
- Defined in:
- lib/ynab/api/transactions_api.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_transaction(plan_id, data, opts = {}) ⇒ SaveTransactionsResponse
Create a single transaction or multiple transactions Creates a single transaction or multiple transactions.
-
#create_transaction_with_http_info(plan_id, data, opts = {}) ⇒ Array<(SaveTransactionsResponse, Integer, Hash)>
Create a single transaction or multiple transactions Creates a single transaction or multiple transactions.
-
#delete_transaction(plan_id, transaction_id, opts = {}) ⇒ TransactionResponse
Delete a transaction Deletes a transaction.
-
#delete_transaction_with_http_info(plan_id, transaction_id, opts = {}) ⇒ Array<(TransactionResponse, Integer, Hash)>
Delete a transaction Deletes a transaction.
-
#get_transaction_by_id(plan_id, transaction_id, opts = {}) ⇒ TransactionResponse
Get a transaction Returns a single transaction.
-
#get_transaction_by_id_with_http_info(plan_id, transaction_id, opts = {}) ⇒ Array<(TransactionResponse, Integer, Hash)>
Get a transaction Returns a single transaction.
-
#get_transactions(plan_id, opts = {}) ⇒ TransactionsResponse
Get transactions Returns plan transactions, excluding any pending transactions.
-
#get_transactions_by_account(plan_id, account_id, opts = {}) ⇒ TransactionsResponse
Get account transactions Returns all transactions for a specified account, excluding any pending transactions.
-
#get_transactions_by_account_with_http_info(plan_id, account_id, opts = {}) ⇒ Array<(TransactionsResponse, Integer, Hash)>
Get account transactions Returns all transactions for a specified account, excluding any pending transactions.
-
#get_transactions_by_category(plan_id, category_id, opts = {}) ⇒ HybridTransactionsResponse
Get category transactions Returns all transactions for a specified category, excluding any pending transactions.
-
#get_transactions_by_category_with_http_info(plan_id, category_id, opts = {}) ⇒ Array<(HybridTransactionsResponse, Integer, Hash)>
Get category transactions Returns all transactions for a specified category, excluding any pending transactions.
-
#get_transactions_by_month(plan_id, month, opts = {}) ⇒ TransactionsResponse
Get plan month transactions Returns all transactions for a specified month, excluding any pending transactions.
-
#get_transactions_by_month_with_http_info(plan_id, month, opts = {}) ⇒ Array<(TransactionsResponse, Integer, Hash)>
Get plan month transactions Returns all transactions for a specified month, excluding any pending transactions.
-
#get_transactions_by_payee(plan_id, payee_id, opts = {}) ⇒ HybridTransactionsResponse
Get payee transactions Returns all transactions for a specified payee, excluding any pending transactions.
-
#get_transactions_by_payee_with_http_info(plan_id, payee_id, opts = {}) ⇒ Array<(HybridTransactionsResponse, Integer, Hash)>
Get payee transactions Returns all transactions for a specified payee, excluding any pending transactions.
-
#get_transactions_with_http_info(plan_id, opts = {}) ⇒ Array<(TransactionsResponse, Integer, Hash)>
Get transactions Returns plan transactions, excluding any pending transactions.
-
#import_transactions(plan_id, opts = {}) ⇒ TransactionsImportResponse
Import transactions Imports available transactions on all linked accounts for the given plan.
-
#import_transactions_with_http_info(plan_id, opts = {}) ⇒ Array<(TransactionsImportResponse, Integer, Hash)>
Import transactions Imports available transactions on all linked accounts for the given plan.
-
#initialize(api_client = ApiClient.default) ⇒ TransactionsApi
constructor
A new instance of TransactionsApi.
-
#update_transaction(plan_id, transaction_id, data, opts = {}) ⇒ TransactionResponse
Update a transaction Updates a single transaction.
-
#update_transaction_with_http_info(plan_id, transaction_id, data, opts = {}) ⇒ Array<(TransactionResponse, Integer, Hash)>
Update a transaction Updates a single transaction.
-
#update_transactions(plan_id, data, opts = {}) ⇒ SaveTransactionsResponse
Update multiple transactions Updates multiple transactions, by
idorimport_id. -
#update_transactions_with_http_info(plan_id, data, opts = {}) ⇒ Array<(SaveTransactionsResponse, Integer, Hash)>
Update multiple transactions Updates multiple transactions, by `id` or `import_id`.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ TransactionsApi
Returns a new instance of TransactionsApi.
15 16 17 |
# File 'lib/ynab/api/transactions_api.rb', line 15 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
13 14 15 |
# File 'lib/ynab/api/transactions_api.rb', line 13 def api_client @api_client end |
Instance Method Details
#create_transaction(plan_id, data, opts = {}) ⇒ SaveTransactionsResponse
Create a single transaction or multiple transactions
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. Scheduled transactions (transactions with a future date) cannot be created on this endpoint.
24 25 26 27 |
# File 'lib/ynab/api/transactions_api.rb', line 24 def create_transaction(plan_id, data, opts = {}) data, _status_code, _headers = create_transaction_with_http_info(plan_id, data, opts) data end |
#create_transaction_with_http_info(plan_id, data, opts = {}) ⇒ Array<(SaveTransactionsResponse, Integer, Hash)>
Create a single transaction or multiple transactions 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. Scheduled transactions (transactions with a future date) cannot be created on this endpoint.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/ynab/api/transactions_api.rb', line 35 def create_transaction_with_http_info(plan_id, data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.create_transaction ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling TransactionsApi.create_transaction" end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling TransactionsApi.create_transaction" end # resource path local_var_path = '/plans/{plan_id}/transactions'.sub('{' + 'plan_id' + '}', CGI.escape(plan_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(data) # return_type return_type = opts[:debug_return_type] || 'SaveTransactionsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearer'] = opts.merge( :operation => :"TransactionsApi.create_transaction", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#create_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_transaction(plan_id, transaction_id, opts = {}) ⇒ TransactionResponse
Delete a transaction Deletes a transaction
98 99 100 101 |
# File 'lib/ynab/api/transactions_api.rb', line 98 def delete_transaction(plan_id, transaction_id, opts = {}) data, _status_code, _headers = delete_transaction_with_http_info(plan_id, transaction_id, opts) data end |
#delete_transaction_with_http_info(plan_id, transaction_id, opts = {}) ⇒ Array<(TransactionResponse, Integer, Hash)>
Delete a transaction Deletes a transaction
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/ynab/api/transactions_api.rb', line 109 def delete_transaction_with_http_info(plan_id, transaction_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.delete_transaction ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling TransactionsApi.delete_transaction" end # verify the required parameter 'transaction_id' is set if @api_client.config.client_side_validation && transaction_id.nil? fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionsApi.delete_transaction" end # resource path local_var_path = '/plans/{plan_id}/transactions/{transaction_id}'.sub('{' + 'plan_id' + '}', CGI.escape(plan_id.to_s)).sub('{' + 'transaction_id' + '}', CGI.escape(transaction_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'TransactionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearer'] = opts.merge( :operation => :"TransactionsApi.delete_transaction", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#delete_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_transaction_by_id(plan_id, transaction_id, opts = {}) ⇒ TransactionResponse
Get a transaction Returns a single transaction
167 168 169 170 |
# File 'lib/ynab/api/transactions_api.rb', line 167 def get_transaction_by_id(plan_id, transaction_id, opts = {}) data, _status_code, _headers = get_transaction_by_id_with_http_info(plan_id, transaction_id, opts) data end |
#get_transaction_by_id_with_http_info(plan_id, transaction_id, opts = {}) ⇒ Array<(TransactionResponse, Integer, Hash)>
Get a transaction Returns a single transaction
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/ynab/api/transactions_api.rb', line 178 def get_transaction_by_id_with_http_info(plan_id, transaction_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transaction_by_id ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling TransactionsApi.get_transaction_by_id" end # verify the required parameter 'transaction_id' is set if @api_client.config.client_side_validation && transaction_id.nil? fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionsApi.get_transaction_by_id" end # resource path local_var_path = '/plans/{plan_id}/transactions/{transaction_id}'.sub('{' + 'plan_id' + '}', CGI.escape(plan_id.to_s)).sub('{' + 'transaction_id' + '}', CGI.escape(transaction_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'TransactionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearer'] = opts.merge( :operation => :"TransactionsApi.get_transaction_by_id", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#get_transaction_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_transactions(plan_id, opts = {}) ⇒ TransactionsResponse
Get transactions Returns plan transactions, excluding any pending transactions
239 240 241 242 |
# File 'lib/ynab/api/transactions_api.rb', line 239 def get_transactions(plan_id, opts = {}) data, _status_code, _headers = get_transactions_with_http_info(plan_id, opts) data end |
#get_transactions_by_account(plan_id, account_id, opts = {}) ⇒ TransactionsResponse
Get account transactions Returns all transactions for a specified account, excluding any pending transactions
315 316 317 318 |
# File 'lib/ynab/api/transactions_api.rb', line 315 def get_transactions_by_account(plan_id, account_id, opts = {}) data, _status_code, _headers = get_transactions_by_account_with_http_info(plan_id, account_id, opts) data end |
#get_transactions_by_account_with_http_info(plan_id, account_id, opts = {}) ⇒ Array<(TransactionsResponse, Integer, Hash)>
Get account transactions Returns all transactions for a specified account, excluding any pending transactions
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 |
# File 'lib/ynab/api/transactions_api.rb', line 330 def get_transactions_by_account_with_http_info(plan_id, account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transactions_by_account ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling TransactionsApi.get_transactions_by_account" end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling TransactionsApi.get_transactions_by_account" end # resource path local_var_path = '/plans/{plan_id}/accounts/{account_id}/transactions'.sub('{' + 'plan_id' + '}', CGI.escape(plan_id.to_s)).sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'since_date'] = opts[:'since_date'] if !opts[:'since_date'].nil? query_params[:'until_date'] = opts[:'until_date'] if !opts[:'until_date'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'last_knowledge_of_server'] = opts[:'last_knowledge_of_server'] if !opts[:'last_knowledge_of_server'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'TransactionsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearer'] = opts.merge( :operation => :"TransactionsApi.get_transactions_by_account", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#get_transactions_by_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_transactions_by_category(plan_id, category_id, opts = {}) ⇒ HybridTransactionsResponse
Get category transactions Returns all transactions for a specified category, excluding any pending transactions
396 397 398 399 |
# File 'lib/ynab/api/transactions_api.rb', line 396 def get_transactions_by_category(plan_id, category_id, opts = {}) data, _status_code, _headers = get_transactions_by_category_with_http_info(plan_id, category_id, opts) data end |
#get_transactions_by_category_with_http_info(plan_id, category_id, opts = {}) ⇒ Array<(HybridTransactionsResponse, Integer, Hash)>
Get category transactions Returns all transactions for a specified category, excluding any pending transactions
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 |
# File 'lib/ynab/api/transactions_api.rb', line 411 def get_transactions_by_category_with_http_info(plan_id, category_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transactions_by_category ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling TransactionsApi.get_transactions_by_category" end # verify the required parameter 'category_id' is set if @api_client.config.client_side_validation && category_id.nil? fail ArgumentError, "Missing the required parameter 'category_id' when calling TransactionsApi.get_transactions_by_category" end # resource path local_var_path = '/plans/{plan_id}/categories/{category_id}/transactions'.sub('{' + 'plan_id' + '}', CGI.escape(plan_id.to_s)).sub('{' + 'category_id' + '}', CGI.escape(category_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'since_date'] = opts[:'since_date'] if !opts[:'since_date'].nil? query_params[:'until_date'] = opts[:'until_date'] if !opts[:'until_date'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'last_knowledge_of_server'] = opts[:'last_knowledge_of_server'] if !opts[:'last_knowledge_of_server'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'HybridTransactionsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearer'] = opts.merge( :operation => :"TransactionsApi.get_transactions_by_category", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#get_transactions_by_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_transactions_by_month(plan_id, month, opts = {}) ⇒ TransactionsResponse
Get plan month transactions Returns all transactions for a specified month, excluding any pending transactions
477 478 479 480 |
# File 'lib/ynab/api/transactions_api.rb', line 477 def get_transactions_by_month(plan_id, month, opts = {}) data, _status_code, _headers = get_transactions_by_month_with_http_info(plan_id, month, opts) data end |
#get_transactions_by_month_with_http_info(plan_id, month, opts = {}) ⇒ Array<(TransactionsResponse, Integer, Hash)>
Get plan month transactions Returns all transactions for a specified month, excluding any pending transactions
492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 |
# File 'lib/ynab/api/transactions_api.rb', line 492 def get_transactions_by_month_with_http_info(plan_id, month, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transactions_by_month ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling TransactionsApi.get_transactions_by_month" end # verify the required parameter 'month' is set if @api_client.config.client_side_validation && month.nil? fail ArgumentError, "Missing the required parameter 'month' when calling TransactionsApi.get_transactions_by_month" end # resource path local_var_path = '/plans/{plan_id}/months/{month}/transactions'.sub('{' + 'plan_id' + '}', CGI.escape(plan_id.to_s)).sub('{' + 'month' + '}', CGI.escape(month.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'since_date'] = opts[:'since_date'] if !opts[:'since_date'].nil? query_params[:'until_date'] = opts[:'until_date'] if !opts[:'until_date'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'last_knowledge_of_server'] = opts[:'last_knowledge_of_server'] if !opts[:'last_knowledge_of_server'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'TransactionsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearer'] = opts.merge( :operation => :"TransactionsApi.get_transactions_by_month", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#get_transactions_by_month\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_transactions_by_payee(plan_id, payee_id, opts = {}) ⇒ HybridTransactionsResponse
Get payee transactions Returns all transactions for a specified payee, excluding any pending transactions
558 559 560 561 |
# File 'lib/ynab/api/transactions_api.rb', line 558 def get_transactions_by_payee(plan_id, payee_id, opts = {}) data, _status_code, _headers = get_transactions_by_payee_with_http_info(plan_id, payee_id, opts) data end |
#get_transactions_by_payee_with_http_info(plan_id, payee_id, opts = {}) ⇒ Array<(HybridTransactionsResponse, Integer, Hash)>
Get payee transactions Returns all transactions for a specified payee, excluding any pending transactions
573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 |
# File 'lib/ynab/api/transactions_api.rb', line 573 def get_transactions_by_payee_with_http_info(plan_id, payee_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transactions_by_payee ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling TransactionsApi.get_transactions_by_payee" end # verify the required parameter 'payee_id' is set if @api_client.config.client_side_validation && payee_id.nil? fail ArgumentError, "Missing the required parameter 'payee_id' when calling TransactionsApi.get_transactions_by_payee" end # resource path local_var_path = '/plans/{plan_id}/payees/{payee_id}/transactions'.sub('{' + 'plan_id' + '}', CGI.escape(plan_id.to_s)).sub('{' + 'payee_id' + '}', CGI.escape(payee_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'since_date'] = opts[:'since_date'] if !opts[:'since_date'].nil? query_params[:'until_date'] = opts[:'until_date'] if !opts[:'until_date'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'last_knowledge_of_server'] = opts[:'last_knowledge_of_server'] if !opts[:'last_knowledge_of_server'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'HybridTransactionsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearer'] = opts.merge( :operation => :"TransactionsApi.get_transactions_by_payee", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#get_transactions_by_payee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_transactions_with_http_info(plan_id, opts = {}) ⇒ Array<(TransactionsResponse, Integer, Hash)>
Get transactions Returns plan transactions, excluding any pending transactions
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/ynab/api/transactions_api.rb', line 253 def get_transactions_with_http_info(plan_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transactions ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling TransactionsApi.get_transactions" end # resource path local_var_path = '/plans/{plan_id}/transactions'.sub('{' + 'plan_id' + '}', CGI.escape(plan_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'since_date'] = opts[:'since_date'] if !opts[:'since_date'].nil? query_params[:'until_date'] = opts[:'until_date'] if !opts[:'until_date'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'last_knowledge_of_server'] = opts[:'last_knowledge_of_server'] if !opts[:'last_knowledge_of_server'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'TransactionsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearer'] = opts.merge( :operation => :"TransactionsApi.get_transactions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#get_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#import_transactions(plan_id, opts = {}) ⇒ TransactionsImportResponse
Import transactions Imports available transactions on all linked accounts for the given plan. Linked accounts allow transactions to be imported directly from a specified financial institution and this endpoint initiates that import. Sending a request to this endpoint is the equivalent of clicking "Import" on each account in the web application or tapping the "New Transactions" banner in the mobile applications. The response for this endpoint contains the transaction ids that have been imported.
634 635 636 637 |
# File 'lib/ynab/api/transactions_api.rb', line 634 def import_transactions(plan_id, opts = {}) data, _status_code, _headers = import_transactions_with_http_info(plan_id, opts) data end |
#import_transactions_with_http_info(plan_id, opts = {}) ⇒ Array<(TransactionsImportResponse, Integer, Hash)>
Import transactions Imports available transactions on all linked accounts for the given plan. Linked accounts allow transactions to be imported directly from a specified financial institution and this endpoint initiates that import. Sending a request to this endpoint is the equivalent of clicking "Import" on each account in the web application or tapping the "New Transactions" banner in the mobile applications. The response for this endpoint contains the transaction ids that have been imported.
644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 |
# File 'lib/ynab/api/transactions_api.rb', line 644 def import_transactions_with_http_info(plan_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.import_transactions ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling TransactionsApi.import_transactions" end # resource path local_var_path = '/plans/{plan_id}/transactions/import'.sub('{' + 'plan_id' + '}', CGI.escape(plan_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'TransactionsImportResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearer'] = opts.merge( :operation => :"TransactionsApi.import_transactions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#import_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_transaction(plan_id, transaction_id, data, opts = {}) ⇒ TransactionResponse
Update a transaction Updates a single transaction
699 700 701 702 |
# File 'lib/ynab/api/transactions_api.rb', line 699 def update_transaction(plan_id, transaction_id, data, opts = {}) data, _status_code, _headers = update_transaction_with_http_info(plan_id, transaction_id, data, opts) data end |
#update_transaction_with_http_info(plan_id, transaction_id, data, opts = {}) ⇒ Array<(TransactionResponse, Integer, Hash)>
Update a transaction Updates a single transaction
711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 |
# File 'lib/ynab/api/transactions_api.rb', line 711 def update_transaction_with_http_info(plan_id, transaction_id, data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.update_transaction ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling TransactionsApi.update_transaction" end # verify the required parameter 'transaction_id' is set if @api_client.config.client_side_validation && transaction_id.nil? fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionsApi.update_transaction" end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling TransactionsApi.update_transaction" end # resource path local_var_path = '/plans/{plan_id}/transactions/{transaction_id}'.sub('{' + 'plan_id' + '}', CGI.escape(plan_id.to_s)).sub('{' + 'transaction_id' + '}', CGI.escape(transaction_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(data) # return_type return_type = opts[:debug_return_type] || 'TransactionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearer'] = opts.merge( :operation => :"TransactionsApi.update_transaction", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#update_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_transactions(plan_id, data, opts = {}) ⇒ SaveTransactionsResponse
Update multiple transactions
Updates multiple transactions, by id or import_id.
778 779 780 781 |
# File 'lib/ynab/api/transactions_api.rb', line 778 def update_transactions(plan_id, data, opts = {}) data, _status_code, _headers = update_transactions_with_http_info(plan_id, data, opts) data end |
#update_transactions_with_http_info(plan_id, data, opts = {}) ⇒ Array<(SaveTransactionsResponse, Integer, Hash)>
Update multiple transactions Updates multiple transactions, by `id` or `import_id`.
789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 |
# File 'lib/ynab/api/transactions_api.rb', line 789 def update_transactions_with_http_info(plan_id, data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.update_transactions ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling TransactionsApi.update_transactions" end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling TransactionsApi.update_transactions" end # resource path local_var_path = '/plans/{plan_id}/transactions'.sub('{' + 'plan_id' + '}', CGI.escape(plan_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(data) # return_type return_type = opts[:debug_return_type] || 'SaveTransactionsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearer'] = opts.merge( :operation => :"TransactionsApi.update_transactions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionsApi#update_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |