beanie 0.1.4 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +4 -0
  3. data/README.md +79 -16
  4. data/Rakefile +8 -1
  5. data/beanie.gemspec +44 -25
  6. data/docs/BankAccount.md +24 -0
  7. data/docs/BankAccountApi.md +154 -0
  8. data/docs/BankAccountInput.md +24 -0
  9. data/docs/ErrorModel.md +9 -0
  10. data/git_push.sh +55 -0
  11. data/lib/beanie/api/bank_account_api.rb +183 -0
  12. data/lib/beanie/api_client.rb +388 -0
  13. data/lib/beanie/api_error.rb +38 -0
  14. data/lib/beanie/configuration.rb +202 -0
  15. data/lib/beanie/models/bank_account.rb +358 -0
  16. data/lib/beanie/models/bank_account_input.rb +357 -0
  17. data/lib/beanie/models/error_model.rb +202 -0
  18. data/lib/beanie/version.rb +13 -30
  19. data/lib/beanie.rb +32 -115
  20. data/spec/api/bank_account_api_spec.rb +71 -0
  21. data/spec/api_client_spec.rb +226 -0
  22. data/spec/configuration_spec.rb +42 -0
  23. data/spec/models/bank_account_input_spec.rb +137 -0
  24. data/spec/models/bank_account_spec.rb +137 -0
  25. data/spec/models/error_model_spec.rb +47 -0
  26. data/spec/spec_helper.rb +111 -0
  27. metadata +174 -71
  28. data/.gitignore +0 -17
  29. data/VERSION +0 -1
  30. data/lib/beanie/api.rb +0 -182
  31. data/lib/beanie/bank_account.rb +0 -44
  32. data/lib/beanie/bank_statement.rb +0 -45
  33. data/lib/beanie/bank_statement_data.rb +0 -51
  34. data/lib/beanie/beanie_alert.rb +0 -66
  35. data/lib/beanie/bill_of_material.rb +0 -44
  36. data/lib/beanie/billable.rb +0 -46
  37. data/lib/beanie/bom_item.rb +0 -44
  38. data/lib/beanie/company.rb +0 -66
  39. data/lib/beanie/company_member.rb +0 -43
  40. data/lib/beanie/config_type.rb +0 -62
  41. data/lib/beanie/config_value.rb +0 -42
  42. data/lib/beanie/customer.rb +0 -51
  43. data/lib/beanie/customer_address.rb +0 -63
  44. data/lib/beanie/customer_note.rb +0 -42
  45. data/lib/beanie/document.rb +0 -71
  46. data/lib/beanie/fixed_asset.rb +0 -45
  47. data/lib/beanie/journal.rb +0 -44
  48. data/lib/beanie/journal_item.rb +0 -44
  49. data/lib/beanie/nominal_account.rb +0 -73
  50. data/lib/beanie/nominal_account_category.rb +0 -49
  51. data/lib/beanie/product.rb +0 -52
  52. data/lib/beanie/product_category.rb +0 -43
  53. data/lib/beanie/product_price.rb +0 -44
  54. data/lib/beanie/production_order.rb +0 -76
  55. data/lib/beanie/purchase_invoice.rb +0 -55
  56. data/lib/beanie/purchase_order.rb +0 -46
  57. data/lib/beanie/purchase_order_item.rb +0 -60
  58. data/lib/beanie/sales_invoice.rb +0 -83
  59. data/lib/beanie/sales_invoice_item.rb +0 -50
  60. data/lib/beanie/sales_order.rb +0 -74
  61. data/lib/beanie/sales_order_item.rb +0 -126
  62. data/lib/beanie/stock_adjustment.rb +0 -70
  63. data/lib/beanie/stock_category.rb +0 -44
  64. data/lib/beanie/stock_item.rb +0 -58
  65. data/lib/beanie/stock_location.rb +0 -42
  66. data/lib/beanie/stock_supplier.rb +0 -48
  67. data/lib/beanie/supplier.rb +0 -48
  68. data/lib/beanie/supplier_address.rb +0 -53
  69. data/lib/beanie/supplier_note.rb +0 -42
  70. data/lib/beanie/tax_registration.rb +0 -59
  71. data/lib/beanie/vat_record.rb +0 -66
  72. data/lib/beanie/vat_return.rb +0 -60
  73. data/lib/beanie/work_centre.rb +0 -99
  74. data/lib/beanie/work_centre_group.rb +0 -50
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 9d7c840623b52dd7d260c2615d6babc9430a5131
4
- data.tar.gz: 96a50d8e6b87df0f975f8402f52066681fdc63d8
2
+ SHA256:
3
+ metadata.gz: a07e34c438286e63a9e4491ba6a9aed8aed2505f72fe8e20547aa789798e74b1
4
+ data.tar.gz: 0d17a5663f2766aee6b254539cf208e024fc14b8b2e272164280db3d0645d2d5
5
5
  SHA512:
6
- metadata.gz: 175c1fa9545cc1207d9fe7b40ff691a834265407780d0b99118b697b262667b922f96cd123c2709c5cadf7b1438268eac53435b9daae3c4037a86ee4c61e07cc
7
- data.tar.gz: cb9056698787ee4df3710b07fa9eff507168e9a1667a81840657ae43be7c114f2eeed38624ff1c4762378bd018d7437cc9606f89c07e5eb1a9ce8cd2db8dc0ba
6
+ metadata.gz: 1d340473109a96b5035f13254b658ce928237d64fed5b23e7200a8455c840330ec98216d3284c543c0566f787d86adac252a037bf32e3c1b770784aa39c8489f
7
+ data.tar.gz: 0a990bc0f501b277d298e366dc7c7adc11fcf927e8579f4ac6aa48d05aaeee534df4376e6c193432afe286eb8932c3998eceefffcceb19b40522711128b76d0a
data/Gemfile CHANGED
@@ -1,3 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rake', '~> 12.0.0'
7
+ end
data/README.md CHANGED
@@ -1,29 +1,92 @@
1
- # Beanie API Bindings
1
+ # beanie
2
2
 
3
- This gem provides an API interface into the Beanie cloud-based ERP system.
3
+ Beanie - the Ruby gem for the Beanie ERP API
4
+
5
+ An API specification for interacting with the Beanie ERP system
6
+
7
+ This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
+
9
+ - API version: 0.1
10
+ - Package version: 0.2.0
11
+ - Build package: io.swagger.codegen.languages.RubyClientCodegen
4
12
 
5
13
  ## Installation
6
14
 
7
- Add this line to your application's Gemfile:
15
+ ### Build a gem
16
+
17
+ To build the Ruby code into a gem:
18
+
19
+ ```shell
20
+ gem build beanie.gemspec
21
+ ```
22
+
23
+ Then either install the gem locally:
24
+
25
+ ```shell
26
+ gem install ./beanie-0.2.0.gem
27
+ ```
28
+ (for development, run `gem install --dev ./beanie-0.2.0.gem` to install the development dependencies)
29
+
30
+ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
+
32
+ Finally add this to the Gemfile:
33
+
34
+ gem 'beanie', '~> 0.2.0'
35
+
36
+ ### Install from Git
37
+
38
+ If the Ruby gem is hosted at a git repository: https://github.com/altoyield/ruby-beanieclient, then add the following in the Gemfile:
39
+
40
+ gem 'beanie', :git => 'https://github.com/altoyield/ruby-beanieclient.git'
41
+
42
+ ### Include the Ruby code directly
43
+
44
+ Include the Ruby code directly using `-I` as follows:
45
+
46
+ ```shell
47
+ ruby -Ilib script.rb
48
+ ```
49
+
50
+ ## Getting Started
51
+
52
+ Please follow the [installation](#installation) procedure and then run the following code:
53
+ ```ruby
54
+ # Load the gem
55
+ require 'beanie'
56
+
57
+ api_instance = Beanie::BankAccountApi.new
58
+
59
+ bank_account = Beanie::BankAccountInput.new # BankAccountInput | Bank account to add to the system
60
+
61
+
62
+ begin
63
+ result = api_instance.add_bank_account(bank_account)
64
+ p result
65
+ rescue Beanie::ApiError => e
66
+ puts "Exception when calling BankAccountApi->add_bank_account: #{e}"
67
+ end
68
+
69
+ ```
70
+
71
+ ## Documentation for API Endpoints
8
72
 
9
- gem 'beanie'
73
+ All URIs are relative to *https://bean.ie*
10
74
 
11
- And then execute:
75
+ Class | Method | HTTP request | Description
76
+ ------------ | ------------- | ------------- | -------------
77
+ *Beanie::BankAccountApi* | [**add_bank_account**](docs/BankAccountApi.md#add_bank_account) | **POST** /bank_accounts |
78
+ *Beanie::BankAccountApi* | [**find_bank_account_by_id**](docs/BankAccountApi.md#find_bank_account_by_id) | **GET** /bank_accounts/{id} | Find Bank Account by ID
79
+ *Beanie::BankAccountApi* | [**find_bank_accounts**](docs/BankAccountApi.md#find_bank_accounts) | **GET** /bank_accounts | All bank accounts
12
80
 
13
- $ bundle
14
81
 
15
- Or install it yourself as:
82
+ ## Documentation for Models
16
83
 
17
- $ gem install beanie
84
+ - [Beanie::BankAccount](docs/BankAccount.md)
85
+ - [Beanie::ErrorModel](docs/ErrorModel.md)
86
+ - [Beanie::BankAccountInput](docs/BankAccountInput.md)
18
87
 
19
- ## Usage
20
88
 
21
- TODO: Write usage instructions here
89
+ ## Documentation for Authorization
22
90
 
23
- ## Contributing
91
+ All endpoints do not require authorization.
24
92
 
25
- 1. Fork it
26
- 2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Add some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
29
- 5. Create new Pull Request
data/Rakefile CHANGED
@@ -1 +1,8 @@
1
- require "bundler/gem_tasks"
1
+ begin
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+ task default: :spec
6
+ rescue LoadError
7
+ # no rspec available
8
+ end
data/beanie.gemspec CHANGED
@@ -1,26 +1,45 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'beanie/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "beanie"
8
- spec.version = Beanie::VERSION
9
- spec.authors = ["Dermot Tynan"]
10
- spec.email = ["dtynan@kalopa.com"]
11
- spec.summary = %q{Ruby bindings for the Beanie API}
12
- spec.description = %q{Beanie - Your Cloud-Based ERP System. See https://bean.ie for more details.}
13
- spec.homepage = "https://bean.ie/help/api/ruby"
14
- spec.license = "MIT"
15
-
16
- spec.files = `git ls-files`.split($/)
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_development_dependency "bundler", "~> 1.3"
22
- spec.add_development_dependency "rake", "~> 10.0"
23
-
24
- spec.add_dependency 'rest-client', "~> 2.0"
25
- spec.add_dependency 'json'
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ =begin
4
+ #Beanie ERP API
5
+
6
+ #An API specification for interacting with the Beanie ERP system
7
+
8
+ OpenAPI spec version: 0.1
9
+ Contact: dev@bean.ie
10
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
11
+ Swagger Codegen version: 2.4.0-SNAPSHOT
12
+
13
+ =end
14
+
15
+ $:.push File.expand_path("../lib", __FILE__)
16
+ require "beanie/version"
17
+
18
+ Gem::Specification.new do |s|
19
+ s.name = "beanie"
20
+ s.version = Beanie::VERSION
21
+ s.platform = Gem::Platform::RUBY
22
+ s.authors = ["Beanie Development Team"]
23
+ s.email = ["dev@bean.ie"]
24
+ s.homepage = "https://rubygems.org/gems/beanie"
25
+ s.summary = "Beanie ERP API Ruby Gem"
26
+ s.description = "An API specification for interacting with the Beanie ERP system"
27
+ s.license = 'MIT'
28
+ s.required_ruby_version = ">= 1.9"
29
+
30
+ s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
31
+ s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
32
+
33
+ s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
34
+ s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
35
+ s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3'
36
+ s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
37
+ s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
38
+ s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
39
+ s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'
40
+
41
+ s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
42
+ s.test_files = `find spec/*`.split("\n")
43
+ s.executables = []
44
+ s.require_paths = ["lib"]
26
45
  end
@@ -0,0 +1,24 @@
1
+ # Beanie::BankAccount
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **Integer** | |
7
+ **name** | **String** | |
8
+ **bank_name** | **String** | |
9
+ **currency** | **String** | |
10
+ **swift** | **String** | |
11
+ **iban** | **String** | |
12
+ **address1** | **String** | | [optional]
13
+ **address2** | **String** | | [optional]
14
+ **address3** | **String** | | [optional]
15
+ **city** | **String** | | [optional]
16
+ **state_county** | **String** | | [optional]
17
+ **zip_postcode** | **String** | | [optional]
18
+ **country** | **String** | | [optional]
19
+ **contact_name** | **String** | | [optional]
20
+ **phone** | **String** | | [optional]
21
+ **email** | **String** | | [optional]
22
+ **website** | **String** | | [optional]
23
+
24
+
@@ -0,0 +1,154 @@
1
+ # Beanie::BankAccountApi
2
+
3
+ All URIs are relative to *https://bean.ie*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**add_bank_account**](BankAccountApi.md#add_bank_account) | **POST** /bank_accounts |
8
+ [**find_bank_account_by_id**](BankAccountApi.md#find_bank_account_by_id) | **GET** /bank_accounts/{id} | Find Bank Account by ID
9
+ [**find_bank_accounts**](BankAccountApi.md#find_bank_accounts) | **GET** /bank_accounts | All bank accounts
10
+
11
+
12
+ # **add_bank_account**
13
+ > BankAccount add_bank_account(bank_account)
14
+
15
+
16
+
17
+ Creates a new bank account in the system
18
+
19
+ ### Example
20
+ ```ruby
21
+ # load the gem
22
+ require 'beanie'
23
+
24
+ api_instance = Beanie::BankAccountApi.new
25
+
26
+ bank_account = Beanie::BankAccountInput.new # BankAccountInput | Bank account to add to the system
27
+
28
+
29
+ begin
30
+ result = api_instance.add_bank_account(bank_account)
31
+ p result
32
+ rescue Beanie::ApiError => e
33
+ puts "Exception when calling BankAccountApi->add_bank_account: #{e}"
34
+ end
35
+ ```
36
+
37
+ ### Parameters
38
+
39
+ Name | Type | Description | Notes
40
+ ------------- | ------------- | ------------- | -------------
41
+ **bank_account** | [**BankAccountInput**](BankAccountInput.md)| Bank account to add to the system |
42
+
43
+ ### Return type
44
+
45
+ [**BankAccount**](BankAccount.md)
46
+
47
+ ### Authorization
48
+
49
+ No authorization required
50
+
51
+ ### HTTP request headers
52
+
53
+ - **Content-Type**: application/json
54
+ - **Accept**: application/json
55
+
56
+
57
+
58
+ # **find_bank_account_by_id**
59
+ > BankAccount find_bank_account_by_id(id)
60
+
61
+ Find Bank Account by ID
62
+
63
+ Returns a single bank account if the user has access
64
+
65
+ ### Example
66
+ ```ruby
67
+ # load the gem
68
+ require 'beanie'
69
+
70
+ api_instance = Beanie::BankAccountApi.new
71
+
72
+ id = 789 # Integer | ID of bank account to fetch
73
+
74
+
75
+ begin
76
+ #Find Bank Account by ID
77
+ result = api_instance.find_bank_account_by_id(id)
78
+ p result
79
+ rescue Beanie::ApiError => e
80
+ puts "Exception when calling BankAccountApi->find_bank_account_by_id: #{e}"
81
+ end
82
+ ```
83
+
84
+ ### Parameters
85
+
86
+ Name | Type | Description | Notes
87
+ ------------- | ------------- | ------------- | -------------
88
+ **id** | **Integer**| ID of bank account to fetch |
89
+
90
+ ### Return type
91
+
92
+ [**BankAccount**](BankAccount.md)
93
+
94
+ ### Authorization
95
+
96
+ No authorization required
97
+
98
+ ### HTTP request headers
99
+
100
+ - **Content-Type**: application/json
101
+ - **Accept**: application/json
102
+
103
+
104
+
105
+ # **find_bank_accounts**
106
+ > Array<BankAccount> find_bank_accounts(opts)
107
+
108
+ All bank accounts
109
+
110
+ Returns all bank accounts from the system that the user has access to
111
+
112
+ ### Example
113
+ ```ruby
114
+ # load the gem
115
+ require 'beanie'
116
+
117
+ api_instance = Beanie::BankAccountApi.new
118
+
119
+ opts = {
120
+ tags: ['tags_example'], # Array<String> | tags to filter by
121
+ limit: 56 # Integer | maximum number of results to return
122
+ }
123
+
124
+ begin
125
+ #All bank accounts
126
+ result = api_instance.find_bank_accounts(opts)
127
+ p result
128
+ rescue Beanie::ApiError => e
129
+ puts "Exception when calling BankAccountApi->find_bank_accounts: #{e}"
130
+ end
131
+ ```
132
+
133
+ ### Parameters
134
+
135
+ Name | Type | Description | Notes
136
+ ------------- | ------------- | ------------- | -------------
137
+ **tags** | [**Array&lt;String&gt;**](String.md)| tags to filter by | [optional]
138
+ **limit** | **Integer**| maximum number of results to return | [optional]
139
+
140
+ ### Return type
141
+
142
+ [**Array&lt;BankAccount&gt;**](BankAccount.md)
143
+
144
+ ### Authorization
145
+
146
+ No authorization required
147
+
148
+ ### HTTP request headers
149
+
150
+ - **Content-Type**: application/json
151
+ - **Accept**: application/json
152
+
153
+
154
+
@@ -0,0 +1,24 @@
1
+ # Beanie::BankAccountInput
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **Integer** | |
7
+ **name** | **String** | |
8
+ **bank_name** | **String** | |
9
+ **currency** | **String** | |
10
+ **swift** | **String** | |
11
+ **iban** | **String** | |
12
+ **address1** | **String** | | [optional]
13
+ **address2** | **String** | | [optional]
14
+ **address3** | **String** | | [optional]
15
+ **city** | **String** | | [optional]
16
+ **state_county** | **String** | | [optional]
17
+ **zip_postcode** | **String** | | [optional]
18
+ **country** | **String** | | [optional]
19
+ **contact_name** | **String** | | [optional]
20
+ **phone** | **String** | | [optional]
21
+ **email** | **String** | | [optional]
22
+ **website** | **String** | | [optional]
23
+
24
+
@@ -0,0 +1,9 @@
1
+ # Beanie::ErrorModel
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **code** | **Integer** | |
7
+ **message** | **String** | |
8
+
9
+
data/git_push.sh ADDED
@@ -0,0 +1,55 @@
1
+ #!/bin/sh
2
+ #
3
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
4
+ #
5
+ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
6
+ #
7
+ # Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
8
+
9
+ git_user_id=$1
10
+ git_repo_id=$2
11
+ release_note=$3
12
+
13
+ if [ "$git_user_id" = "" ]; then
14
+ git_user_id="altoyield"
15
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
16
+ fi
17
+
18
+ if [ "$git_repo_id" = "" ]; then
19
+ git_repo_id="ruby-beanieclient"
20
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
21
+ fi
22
+
23
+ if [ "$release_note" = "" ]; then
24
+ release_note="Minor update"
25
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
26
+ fi
27
+
28
+ # Initialize the local directory as a Git repository
29
+ git init
30
+
31
+ # Adds the files in the local repository and stages them for commit.
32
+ git add .
33
+
34
+ # Commits the tracked changes and prepares them to be pushed to a remote repository.
35
+ git commit -m "$release_note"
36
+
37
+ # Sets the new remote
38
+ git_remote=`git remote`
39
+ if [ "$git_remote" = "" ]; then # git remote not defined
40
+
41
+ if [ "$GIT_TOKEN" = "" ]; then
42
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
43
+ git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
44
+ else
45
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
46
+ fi
47
+
48
+ fi
49
+
50
+ git pull origin master
51
+
52
+ # Pushes (Forces) the changes in the local repository up to the remote repository
53
+ echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
54
+ git push origin master 2>&1 | grep -v 'To https'
55
+
@@ -0,0 +1,183 @@
1
+ =begin
2
+ #Beanie ERP API
3
+
4
+ #An API specification for interacting with the Beanie ERP system
5
+
6
+ OpenAPI spec version: 0.1
7
+ Contact: dev@bean.ie
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module Beanie
16
+ class BankAccountApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Creates a new bank account in the system
23
+ # @param bank_account Bank account to add to the system
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [BankAccount]
26
+ def add_bank_account(bank_account, opts = {})
27
+ data, _status_code, _headers = add_bank_account_with_http_info(bank_account, opts)
28
+ data
29
+ end
30
+
31
+ # Creates a new bank account in the system
32
+ # @param bank_account Bank account to add to the system
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(BankAccount, Fixnum, Hash)>] BankAccount data, response status code and response headers
35
+ def add_bank_account_with_http_info(bank_account, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: BankAccountApi.add_bank_account ...'
38
+ end
39
+ # verify the required parameter 'bank_account' is set
40
+ if @api_client.config.client_side_validation && bank_account.nil?
41
+ fail ArgumentError, "Missing the required parameter 'bank_account' when calling BankAccountApi.add_bank_account"
42
+ end
43
+ # resource path
44
+ local_var_path = '/bank_accounts'
45
+
46
+ # query parameters
47
+ query_params = {}
48
+
49
+ # header parameters
50
+ header_params = {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
53
+ # HTTP header 'Content-Type'
54
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
55
+
56
+ # form parameters
57
+ form_params = {}
58
+
59
+ # http body (model)
60
+ post_body = @api_client.object_to_http_body(bank_account)
61
+ auth_names = []
62
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
63
+ :header_params => header_params,
64
+ :query_params => query_params,
65
+ :form_params => form_params,
66
+ :body => post_body,
67
+ :auth_names => auth_names,
68
+ :return_type => 'BankAccount')
69
+ if @api_client.config.debugging
70
+ @api_client.config.logger.debug "API called: BankAccountApi#add_bank_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
71
+ end
72
+ return data, status_code, headers
73
+ end
74
+ # Find Bank Account by ID
75
+ # Returns a single bank account if the user has access
76
+ # @param id ID of bank account to fetch
77
+ # @param [Hash] opts the optional parameters
78
+ # @return [BankAccount]
79
+ def find_bank_account_by_id(id, opts = {})
80
+ data, _status_code, _headers = find_bank_account_by_id_with_http_info(id, opts)
81
+ data
82
+ end
83
+
84
+ # Find Bank Account by ID
85
+ # Returns a single bank account if the user has access
86
+ # @param id ID of bank account to fetch
87
+ # @param [Hash] opts the optional parameters
88
+ # @return [Array<(BankAccount, Fixnum, Hash)>] BankAccount data, response status code and response headers
89
+ def find_bank_account_by_id_with_http_info(id, opts = {})
90
+ if @api_client.config.debugging
91
+ @api_client.config.logger.debug 'Calling API: BankAccountApi.find_bank_account_by_id ...'
92
+ end
93
+ # verify the required parameter 'id' is set
94
+ if @api_client.config.client_side_validation && id.nil?
95
+ fail ArgumentError, "Missing the required parameter 'id' when calling BankAccountApi.find_bank_account_by_id"
96
+ end
97
+ # resource path
98
+ local_var_path = '/bank_accounts/{id}'.sub('{' + 'id' + '}', id.to_s)
99
+
100
+ # query parameters
101
+ query_params = {}
102
+
103
+ # header parameters
104
+ header_params = {}
105
+ # HTTP header 'Accept' (if needed)
106
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
107
+ # HTTP header 'Content-Type'
108
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
109
+
110
+ # form parameters
111
+ form_params = {}
112
+
113
+ # http body (model)
114
+ post_body = nil
115
+ auth_names = []
116
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
117
+ :header_params => header_params,
118
+ :query_params => query_params,
119
+ :form_params => form_params,
120
+ :body => post_body,
121
+ :auth_names => auth_names,
122
+ :return_type => 'BankAccount')
123
+ if @api_client.config.debugging
124
+ @api_client.config.logger.debug "API called: BankAccountApi#find_bank_account_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
125
+ end
126
+ return data, status_code, headers
127
+ end
128
+ # All bank accounts
129
+ # Returns all bank accounts from the system that the user has access to
130
+ # @param [Hash] opts the optional parameters
131
+ # @option opts [Array<String>] :tags tags to filter by
132
+ # @option opts [Integer] :limit maximum number of results to return
133
+ # @return [Array<BankAccount>]
134
+ def find_bank_accounts(opts = {})
135
+ data, _status_code, _headers = find_bank_accounts_with_http_info(opts)
136
+ data
137
+ end
138
+
139
+ # All bank accounts
140
+ # Returns all bank accounts from the system that the user has access to
141
+ # @param [Hash] opts the optional parameters
142
+ # @option opts [Array<String>] :tags tags to filter by
143
+ # @option opts [Integer] :limit maximum number of results to return
144
+ # @return [Array<(Array<BankAccount>, Fixnum, Hash)>] Array<BankAccount> data, response status code and response headers
145
+ def find_bank_accounts_with_http_info(opts = {})
146
+ if @api_client.config.debugging
147
+ @api_client.config.logger.debug 'Calling API: BankAccountApi.find_bank_accounts ...'
148
+ end
149
+ # resource path
150
+ local_var_path = '/bank_accounts'
151
+
152
+ # query parameters
153
+ query_params = {}
154
+ query_params[:'tags'] = @api_client.build_collection_param(opts[:'tags'], :csv) if !opts[:'tags'].nil?
155
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
156
+
157
+ # header parameters
158
+ header_params = {}
159
+ # HTTP header 'Accept' (if needed)
160
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
161
+ # HTTP header 'Content-Type'
162
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
163
+
164
+ # form parameters
165
+ form_params = {}
166
+
167
+ # http body (model)
168
+ post_body = nil
169
+ auth_names = []
170
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
171
+ :header_params => header_params,
172
+ :query_params => query_params,
173
+ :form_params => form_params,
174
+ :body => post_body,
175
+ :auth_names => auth_names,
176
+ :return_type => 'Array<BankAccount>')
177
+ if @api_client.config.debugging
178
+ @api_client.config.logger.debug "API called: BankAccountApi#find_bank_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
179
+ end
180
+ return data, status_code, headers
181
+ end
182
+ end
183
+ end