tangocard-raas 1.1.2 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +28 -175
  3. data/README.md +38 -525
  4. data/lib/raas.rb +32 -19
  5. data/lib/raas/api_helper.rb +146 -54
  6. data/lib/raas/configuration.rb +22 -30
  7. data/lib/raas/controllers/accounts_controller.rb +146 -92
  8. data/lib/raas/controllers/base_controller.rb +32 -29
  9. data/lib/raas/controllers/catalog_controller.rb +31 -14
  10. data/lib/raas/controllers/customers_controller.rb +113 -72
  11. data/lib/raas/controllers/exchange_rates_controller.rb +40 -12
  12. data/lib/raas/controllers/fund_controller.rb +345 -0
  13. data/lib/raas/controllers/orders_controller.rb +166 -105
  14. data/lib/raas/controllers/status_controller.rb +31 -14
  15. data/lib/raas/exceptions/api_exception.rb +4 -2
  16. data/lib/raas/exceptions/raas_client_exception.rb +14 -12
  17. data/lib/raas/exceptions/raas_generic_exception.rb +9 -9
  18. data/lib/raas/exceptions/raas_server_exception.rb +14 -12
  19. data/lib/raas/http/auth/basic_auth.rb +7 -4
  20. data/lib/raas/http/faraday_client.rb +19 -7
  21. data/lib/raas/http/http_call_back.rb +11 -6
  22. data/lib/raas/http/http_client.rb +50 -32
  23. data/lib/raas/http/http_context.rb +5 -2
  24. data/lib/raas/http/http_method_enum.rb +6 -2
  25. data/lib/raas/http/http_request.rb +7 -3
  26. data/lib/raas/http/http_response.rb +3 -1
  27. data/lib/raas/models/account_model.rb +32 -23
  28. data/lib/raas/models/account_summary_model.rb +26 -17
  29. data/lib/raas/models/base_model.rb +11 -9
  30. data/lib/raas/models/billing_address_model.rb +105 -0
  31. data/lib/raas/models/brand_model.rb +39 -35
  32. data/lib/raas/models/catalog_model.rb +15 -13
  33. data/lib/raas/models/create_account_request_model.rb +14 -14
  34. data/lib/raas/models/create_credit_card_request_model.rb +96 -0
  35. data/lib/raas/models/create_customer_request_model.rb +12 -12
  36. data/lib/raas/models/create_order_request_model.rb +45 -35
  37. data/lib/raas/models/credit_card_model.rb +124 -0
  38. data/lib/raas/models/currency_breakdown_model.rb +18 -18
  39. data/lib/raas/models/customer_model.rb +24 -22
  40. data/lib/raas/models/deposit_request_model.rb +60 -0
  41. data/lib/raas/models/deposit_response_model.rb +80 -0
  42. data/lib/raas/models/exchange_rate_model.rb +18 -17
  43. data/lib/raas/models/exchange_rate_response_model.rb +17 -15
  44. data/lib/raas/models/full_name_email_model.rb +42 -0
  45. data/lib/raas/models/get_deposit_response_model.rb +80 -0
  46. data/lib/raas/models/get_orders_response_model.rb +16 -14
  47. data/lib/raas/models/item_model.rb +36 -34
  48. data/lib/raas/models/name_email_model.rb +14 -14
  49. data/lib/raas/models/new_credit_card_model.rb +51 -0
  50. data/lib/raas/models/order_model.rb +124 -92
  51. data/lib/raas/models/order_summary_model.rb +155 -0
  52. data/lib/raas/models/page_model.rb +16 -16
  53. data/lib/raas/models/raas_client_error_model.rb +16 -16
  54. data/lib/raas/models/raas_server_error_model.rb +12 -12
  55. data/lib/raas/models/resend_order_response_model.rb +11 -11
  56. data/lib/raas/models/reward_credential_model.rb +14 -14
  57. data/lib/raas/models/reward_model.rb +16 -14
  58. data/lib/raas/models/system_status_response_model.rb +10 -10
  59. data/lib/raas/models/unregister_credit_card_request_model.rb +51 -0
  60. data/lib/raas/models/unregister_credit_card_response_model.rb +53 -0
  61. data/lib/raas/raas_client.rb +36 -25
  62. data/test/controllers/controller_test_base.rb +31 -0
  63. data/test/controllers/test_accounts_controller.rb +79 -0
  64. data/test/controllers/test_catalog_controller.rb +65 -0
  65. data/test/controllers/test_customers_controller.rb +61 -0
  66. data/test/controllers/test_exchange_rates_controller.rb +35 -0
  67. data/test/controllers/test_fund_controller.rb +108 -0
  68. data/test/controllers/test_orders_controller.rb +86 -0
  69. data/test/controllers/test_status_controller.rb +27 -0
  70. data/test/http_response_catcher.rb +16 -0
  71. data/test/test_helper.rb +91 -0
  72. metadata +32 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ae496c795949b521cc2579a540bc6232e6b3980
4
- data.tar.gz: e48508da3f993cce362dbaaf655f230e4f7142f0
3
+ metadata.gz: e5d39ff1495f92546c2b68e8029f731c08c665e6
4
+ data.tar.gz: 4ce8922e73942ffff4cc3b8006c994e2496e2342
5
5
  SHA512:
6
- metadata.gz: 5e40fb9d56a89122fda23a93765ce45199ab8d89e34b48c80b6eb149026a3c1b4dc49b75ec0f31d531cc7d9ab97ae2c3c30817957fd8a737bd61bec543d478d5
7
- data.tar.gz: dfcc6e2afa95450d742b3e8169d365518863202f6dcf9fb1f00f4d44dc4bec3378acbdcfe137e36aef452b5004205bef2b787d2b7161889bc460d9867a178f94
6
+ metadata.gz: 2ffbcfddc702b378d80d9de53614492f2485a22e4b0bd7a168949d1fe59427310cdf4e7c3623ab70c7fadebefabfe2d4db0d0f910ba5c01eb1afdf3bd1caf280
7
+ data.tar.gz: 753fc5e31e501a3da63fb9103f9636a88e4dec86ad10646f3738fc2e917c44170659a190ca055d74c4bfb6f9d1b67ed5931471011266fde70b2e7d529d9132c4
data/LICENSE CHANGED
@@ -1,175 +1,28 @@
1
-  Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
1
+ License:
2
+ ========
3
+ The MIT License (MIT)
4
+ http://opensource.org/licenses/MIT
5
+
6
+ Copyright (c) 2014 - 2016 APIMATIC Limited
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in
16
+ all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ THE SOFTWARE.
25
+
26
+ Trade Mark:
27
+ ==========
28
+ APIMATIC is a trade mark for APIMATIC Limited
data/README.md CHANGED
@@ -1,542 +1,55 @@
1
- # Getting started
1
+ Raas
2
+ =================
3
+ This API SDK was automatically generated by APIMATIC v2.0
2
4
 
3
- With this RESTful API you can integrate a global reward or incentive program into your app or platform. If you have any questions or if you'd like to receive your own credentials, please contact us at devsupport@tangocard.com.
5
+ How to configure:
6
+ =================
7
+ The generated code might need to be configured with your API credentials. To do that,
8
+ open the file "configuration.rb" and edit it's contents.
4
9
 
5
- ## How to Use
6
- You can add this SDK to your project via RubyGems, it's called ```tangocard-raas```. Then you can include it where needed by calling ```require 'raas'```
7
-
8
- ## How to Build
9
-
10
- This client library is a Ruby gem which can be compiled and used in your Ruby and Ruby on Rails project. This library requires a few gems from the RubyGems repository.
11
-
12
- 1. Open the command line interface or the terminal and navigate to the folder containing the source code.
13
- 2. Run ``` gem build tangocard-raas.gemspec ``` to build the gem.
14
- 3. Once built, the gem can be installed on the current work environment using ``` gem install tangocard-raas-1.1.2.gem ```
15
-
16
- ![Building Gem](https://apidocs.io/illustration/ruby?step=buildSDK&workspaceFolder=Raas-Ruby&workspaceName=Raas-Ruby&projectName=raas&gemName=raas&gemVer=1.1.2)
17
-
18
- ## How to Use
19
-
20
- The following section explains how to use the Raas Ruby Gem in a new Rails project using RubyMine™. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.
21
-
22
- ### 1. Starting a new project
23
-
24
- Close any existing projects in RubyMine™ by selecting ``` File -> Close Project ```. Next, click on ``` Create New Project ``` to create a new project from scratch.
25
-
26
- ![Create a new project in RubyMine](https://apidocs.io/illustration/ruby?step=createNewProject0&workspaceFolder=Raas-Ruby&workspaceName=Raas&projectName=raas&gemName=raas&gemVer=1.1.2)
27
-
28
- Next, provide ``` TestApp ``` as the project name, choose ``` Rails Application ``` as the project type, and click ``` OK ```.
29
-
30
- ![Create a new Rails Application in RubyMine - step 1](https://apidocs.io/illustration/ruby?step=createNewProject1&workspaceFolder=Raas-Ruby&workspaceName=Raas&projectName=raas&gemName=raas&gemVer=1.1.2)
31
-
32
- In the next dialog make sure that correct *Ruby SDK* is being used (minimum 2.0.0) and click ``` OK ```.
33
-
34
- ![Create a new Rails Application in RubyMine - step 2](https://apidocs.io/illustration/ruby?step=createNewProject2&workspaceFolder=Raas-Ruby&workspaceName=Raas&projectName=raas&gemName=raas&gemVer=1.1.2)
35
-
36
- This will create a new Rails Application project with an existing set of files and folder.
37
-
38
- ### 2. Add reference of the gem
39
-
40
- In order to use the Raas gem in the new project we must add a gem reference. Locate the ```Gemfile``` in the *Project Explorer* window under the ``` TestApp ``` project node. The file contains references to all gems being used in the project. Here, add the reference to the library gem by adding the following line: ``` gem 'tangocard-raas', '~> 1.1.2' ```
41
-
42
- ![Add references of the Gemfile](https://apidocs.io/illustration/ruby?step=addReference&workspaceFolder=Raas-Ruby&workspaceName=Raas&projectName=raas&gemName=raas&gemVer=1.1.2)
43
-
44
- ### 3. Adding a new Rails Controller
45
-
46
- Once the ``` TestApp ``` project is created, a folder named ``` controllers ``` will be visible in the *Project Explorer* under the following path: ``` TestApp > app > controllers ```. Right click on this folder and select ``` New -> Run Rails Generator... ```.
47
-
48
- ![Run Rails Generator on Controllers Folder](https://apidocs.io/illustration/ruby?step=addCode0&workspaceFolder=Raas-Ruby&workspaceName=Raas&projectName=raas&gemName=raas&gemVer=1.1.2)
49
-
50
- Selecting the said option will popup a small window where the generator names are displayed. Here, select the ``` controller ``` template.
51
-
52
- ![Create a new Controller](https://apidocs.io/illustration/ruby?step=addCode1&workspaceFolder=Raas-Ruby&workspaceName=Raas&projectName=raas&gemName=raas&gemVer=1.1.2)
10
+ Alternatively, you can modify the Configuration parameters at run-time through the following:
11
+ ```
12
+ Raas::Configuration.your_paramater = YOUR_VALUE
13
+ ```
53
14
 
54
- Next, a popup window will ask you for a Controller name and included Actions. For controller name provide ``` Hello ``` and include an action named ``` Index ``` and click ``` OK ```.
15
+ How to build and install:
16
+ =============================
17
+ The generated code depends on a few Ruby gems. The references to these gems are
18
+ added in the gemspec file. The easiest way to resolve the dependencies,
19
+ build the gem and install it is through Rake:
55
20
 
56
- ![Add a new Controller](https://apidocs.io/illustration/ruby?step=addCode2&workspaceFolder=Raas-Ruby&workspaceName=Raas&projectName=raas&gemName=raas&gemVer=1.1.2)
21
+ 1. Install Rake if not already installed: `gem install rake`
22
+ 2. Install Bundler if not already installed: `gem install bundler`
23
+ 3. From terminal/cmd navigate to the root directory of the SDK.
24
+ 4. Invoke: `rake install`
57
25
 
58
- A new controller class anmed ``` HelloController ``` will be created in a file named ``` hello_controller.rb ``` containing a method named ``` Index ```. In this method, add code for initialization and a sample for its usage.
26
+ Alternatively, you can build and install the gem manually:
59
27
 
60
- ![Initialize the library](https://apidocs.io/illustration/ruby?step=addCode3&workspaceFolder=Raas-Ruby&workspaceName=Raas&projectName=raas&gemName=raas&gemVer=1.1.2)
28
+ 1. From terminal/cmd navigate to the root directory of the SDK.
29
+ 2. Run the build command: `gem build raas.gemspec`
30
+ 3. Run the install command: `gem install ./raas-2.0.0.gem`
61
31
 
62
- ## How to Test
32
+ Note: You will need to have internet access for this step.
63
33
 
34
+ How to test:
35
+ =============
64
36
  You can test the generated SDK and the server with automatically generated test
65
37
  cases as follows:
66
38
 
67
39
  1. From terminal/cmd navigate to the root directory of the SDK.
68
40
  2. Invoke: `bundle exec rake`
69
41
 
70
- ## Initialization
71
-
72
- ### Authentication
73
- In order to setup authentication and initialization of the API client, you need the following information.
74
-
75
- | Parameter | Description |
76
- |-----------|-------------|
77
- | platform_name | RaaS v2 API Platform Name |
78
- | platform_key | RaaS v2 API Platform Key |
79
-
80
-
81
-
82
- API client can be initialized as following.
83
-
84
- ```ruby
85
- # Configuration parameters and credentials
86
- platform_name = 'QAPlatform2' # RaaS v2 API Platform Name
87
- platform_key = 'apYPfT6HNONpDRUj3CLGWYt7gvIHONpDRUYPfT6Hj' # RaaS v2 API Platform Key
88
-
89
- client = Raas::RaasClient.new(
90
- platform_name: platform_name,
91
- platform_key: platform_key
92
- )
93
- ```
94
-
95
- The added initlization code can be debugged by putting a breakpoint in the ``` Index ``` method and running the project in debug mode by selecting ``` Run -> Debug 'Development: TestApp' ```.
96
-
97
- ![Debug the TestApp](https://apidocs.io/illustration/ruby?step=addCode4&workspaceFolder=Tango%20Card%20RaaS%20v2%20API-Ruby&workspaceName=Raas&projectName=raas&gemName=raas&gemVer=1.1.2&initLine=client%2520%253D%2520RaasClient.new%2528%2527platform_name%2527%252C%2520%2527platform_key%2527%2529)
98
-
99
-
100
-
101
- # Class Reference
102
-
103
- ## <a name="list_of_controllers"></a>List of Controllers
104
-
105
- * [AccountsController](#accounts_controller)
106
- * [OrdersController](#orders_controller)
107
- * [CatalogController](#catalog_controller)
108
- * [ExchangeRatesController](#exchange_rates_controller)
109
- * [StatusController](#status_controller)
110
- * [CustomersController](#customers_controller)
111
-
112
- ## <a name="accounts_controller"></a>![Class: ](https://apidocs.io/img/class.png ".AccountsController") AccountsController
113
-
114
- ### Get singleton instance
115
-
116
- The singleton instance of the ``` AccountsController ``` class can be accessed from the API Client.
117
-
118
- ```ruby
119
- accounts = client.accounts
120
- ```
121
-
122
- ### <a name="get_accounts_by_customer"></a>![Method: ](https://apidocs.io/img/method.png ".AccountsController.get_accounts_by_customer") get_accounts_by_customer
123
-
124
- > Gets a list of accounts for a given customer
125
-
126
-
127
- ```ruby
128
- def get_accounts_by_customer(customer_identifier); end
129
- ```
130
-
131
- #### Parameters
132
-
133
- | Parameter | Tags | Description |
134
- |-----------|------|-------------|
135
- | customer_identifier | ``` Required ``` | Customer Identifier |
136
-
137
-
138
- #### Example Usage
42
+ How to use:
43
+ ===========
44
+ After having installed the gem, you can easily use the SDK following these steps.
139
45
 
46
+ 1. Create a "raas_test.rb" file in the root directory.
47
+ 2. Use any controller as follows:
140
48
  ```ruby
141
- customer_identifier = 'customerIdentifier'
142
-
143
- result = accounts.get_accounts_by_customer(customer_identifier)
144
-
145
- ```
146
-
147
-
148
- ### <a name="get_account"></a>![Method: ](https://apidocs.io/img/method.png ".AccountsController.get_account") get_account
149
-
150
- > Get an account
151
-
152
-
153
- ```ruby
154
- def get_account(account_identifier); end
155
- ```
156
-
157
- #### Parameters
158
-
159
- | Parameter | Tags | Description |
160
- |-----------|------|-------------|
161
- | account_identifier | ``` Required ``` | Account Identifier |
162
-
163
-
164
- #### Example Usage
165
-
166
- ```ruby
167
- account_identifier = 'accountIdentifier'
168
-
169
- result = accounts.get_account(account_identifier)
170
-
171
- ```
172
-
173
-
174
- ### <a name="create_account"></a>![Method: ](https://apidocs.io/img/method.png ".AccountsController.create_account") create_account
175
-
176
- > Create an account under a given customer
177
-
178
-
179
- ```ruby
180
- def create_account(customer_identifier,
181
- body); end
182
- ```
183
-
184
- #### Parameters
185
-
186
- | Parameter | Tags | Description |
187
- |-----------|------|-------------|
188
- | customer_identifier | ``` Required ``` | Customer Identifier |
189
- | body | ``` Required ``` | Request Body |
190
-
191
-
192
- #### Example Usage
193
-
194
- ```ruby
195
- customer_identifier = 'customerIdentifier'
196
- body = CreateAccountRequestModel.new
197
-
198
- result = accounts.create_account(customer_identifier, body)
199
-
200
- ```
201
-
202
-
203
- ### <a name="get_all_accounts"></a>![Method: ](https://apidocs.io/img/method.png ".AccountsController.get_all_accounts") get_all_accounts
204
-
205
- > Gets all accounts under the platform
206
-
207
-
208
- ```ruby
209
- def get_all_accounts; end
210
- ```
211
-
212
- #### Example Usage
213
-
214
- ```ruby
215
-
216
- result = accounts.get_all_accounts()
217
-
218
- ```
219
-
220
-
221
- [Back to List of Controllers](#list_of_controllers)
222
-
223
- ## <a name="orders_controller"></a>![Class: ](https://apidocs.io/img/class.png ".OrdersController") OrdersController
224
-
225
- ### Get singleton instance
226
-
227
- The singleton instance of the ``` OrdersController ``` class can be accessed from the API Client.
228
-
229
- ```ruby
230
- orders = client.orders
231
- ```
232
-
233
- ### <a name="create_order"></a>![Method: ](https://apidocs.io/img/method.png ".OrdersController.create_order") create_order
234
-
235
- > TODO: Add a method description
236
-
237
-
238
- ```ruby
239
- def create_order(body); end
240
- ```
241
-
242
- #### Parameters
243
-
244
- | Parameter | Tags | Description |
245
- |-----------|------|-------------|
246
- | body | ``` Required ``` | TODO: Add a parameter description |
247
-
248
-
249
- #### Example Usage
250
-
251
- ```ruby
252
- body = CreateOrderRequestModel.new
253
-
254
- result = orders.create_order(body)
255
-
256
- ```
257
-
258
-
259
- ### <a name="get_order"></a>![Method: ](https://apidocs.io/img/method.png ".OrdersController.get_order") get_order
260
-
261
- > TODO: Add a method description
262
-
263
-
264
- ```ruby
265
- def get_order(reference_order_id); end
266
- ```
267
-
268
- #### Parameters
269
-
270
- | Parameter | Tags | Description |
271
- |-----------|------|-------------|
272
- | reference_order_id | ``` Required ``` | Reference Order ID |
273
-
274
-
275
- #### Example Usage
276
-
277
- ```ruby
278
- reference_order_id = 'referenceOrderID'
279
-
280
- result = orders.get_order(reference_order_id)
281
-
282
- ```
283
-
284
-
285
- ### <a name="create_resend_order"></a>![Method: ](https://apidocs.io/img/method.png ".OrdersController.create_resend_order") create_resend_order
286
-
287
- > TODO: Add a method description
288
-
289
-
290
- ```ruby
291
- def create_resend_order(reference_order_id); end
292
- ```
293
-
294
- #### Parameters
295
-
296
- | Parameter | Tags | Description |
297
- |-----------|------|-------------|
298
- | reference_order_id | ``` Required ``` | TODO: Add a parameter description |
299
-
300
-
301
- #### Example Usage
302
-
303
- ```ruby
304
- reference_order_id = 'referenceOrderID'
305
-
306
- result = orders.create_resend_order(reference_order_id)
307
-
308
- ```
309
-
310
-
311
- ### <a name="get_orders"></a>![Method: ](https://apidocs.io/img/method.png ".OrdersController.get_orders") get_orders
312
-
313
- > TODO: Add a method description
314
-
315
-
316
- ```ruby
317
- def get_orders(options = Hash.new); end
318
- ```
319
-
320
- #### Parameters
321
-
322
- | Parameter | Tags | Description |
323
- |-----------|------|-------------|
324
- | account_identifier | ``` Optional ``` | TODO: Add a parameter description |
325
- | customer_identifier | ``` Optional ``` | TODO: Add a parameter description |
326
- | external_ref_id | ``` Optional ``` | TODO: Add a parameter description |
327
- | start_date | ``` Optional ``` | TODO: Add a parameter description |
328
- | end_date | ``` Optional ``` | TODO: Add a parameter description |
329
- | elements_per_block | ``` Optional ``` | TODO: Add a parameter description |
330
- | page | ``` Optional ``` | TODO: Add a parameter description |
331
-
332
-
333
- #### Example Usage
334
-
335
- ```ruby
336
- collect = Hash.new
337
-
338
- account_identifier = 'accountIdentifier'
339
- collect['account_identifier'] = account_identifier
340
-
341
- customer_identifier = 'customerIdentifier'
342
- collect['customer_identifier'] = customer_identifier
343
-
344
- external_ref_id = 'externalRefID'
345
- collect['external_ref_id'] = external_ref_id
346
-
347
- start_date = DateTime.now
348
- collect['start_date'] = start_date
349
-
350
- end_date = DateTime.now
351
- collect['end_date'] = end_date
352
-
353
- elements_per_block = 201
354
- collect['elements_per_block'] = elements_per_block
355
-
356
- page = 201
357
- collect['page'] = page
358
-
359
-
360
- result = orders.get_orders(collect)
361
-
362
- ```
363
-
364
-
365
- [Back to List of Controllers](#list_of_controllers)
366
-
367
- ## <a name="catalog_controller"></a>![Class: ](https://apidocs.io/img/class.png ".CatalogController") CatalogController
368
-
369
- ### Get singleton instance
370
-
371
- The singleton instance of the ``` CatalogController ``` class can be accessed from the API Client.
372
-
373
- ```ruby
374
- catalog = client.catalog
375
- ```
376
-
377
- ### <a name="get_catalog"></a>![Method: ](https://apidocs.io/img/method.png ".CatalogController.get_catalog") get_catalog
378
-
379
- > Get Catalog
380
-
381
-
382
- ```ruby
383
- def get_catalog; end
384
- ```
385
-
386
- #### Example Usage
387
-
388
- ```ruby
389
-
390
- result = catalog.get_catalog()
391
-
392
- ```
393
-
394
-
395
- [Back to List of Controllers](#list_of_controllers)
396
-
397
- ## <a name="exchange_rates_controller"></a>![Class: ](https://apidocs.io/img/class.png ".ExchangeRatesController") ExchangeRatesController
398
-
399
- ### Get singleton instance
400
-
401
- The singleton instance of the ``` ExchangeRatesController ``` class can be accessed from the API Client.
402
-
403
- ```ruby
404
- exchangeRates = client.exchange_rates
405
- ```
406
-
407
- ### <a name="get_exchange_rates"></a>![Method: ](https://apidocs.io/img/method.png ".ExchangeRatesController.get_exchange_rates") get_exchange_rates
408
-
409
- > Retrieve current exchange rates
410
-
411
-
412
- ```ruby
413
- def get_exchange_rates; end
414
- ```
415
-
416
- #### Example Usage
417
-
418
- ```ruby
419
-
420
- exchangeRates.get_exchange_rates()
421
-
422
- ```
423
-
424
-
425
- [Back to List of Controllers](#list_of_controllers)
426
-
427
- ## <a name="status_controller"></a>![Class: ](https://apidocs.io/img/class.png ".StatusController") StatusController
428
-
429
- ### Get singleton instance
430
-
431
- The singleton instance of the ``` StatusController ``` class can be accessed from the API Client.
432
-
433
- ```ruby
434
- status = client.status
435
- ```
436
-
437
- ### <a name="get_system_status"></a>![Method: ](https://apidocs.io/img/method.png ".StatusController.get_system_status") get_system_status
438
-
439
- > *Tags:* ``` Skips Authentication ```
440
-
441
- > Retrieve system status
442
-
443
-
444
- ```ruby
445
- def get_system_status; end
446
- ```
447
-
448
- #### Example Usage
449
-
450
- ```ruby
451
-
452
- result = status.get_system_status()
453
-
454
- ```
455
-
456
-
457
- [Back to List of Controllers](#list_of_controllers)
458
-
459
- ## <a name="customers_controller"></a>![Class: ](https://apidocs.io/img/class.png ".CustomersController") CustomersController
460
-
461
- ### Get singleton instance
462
-
463
- The singleton instance of the ``` CustomersController ``` class can be accessed from the API Client.
464
-
465
- ```ruby
466
- customers = client.customers
467
- ```
468
-
469
- ### <a name="get_customer"></a>![Method: ](https://apidocs.io/img/method.png ".CustomersController.get_customer") get_customer
470
-
471
- > Get a customer
472
-
473
-
474
- ```ruby
475
- def get_customer(customer_identifier); end
476
- ```
477
-
478
- #### Parameters
479
-
480
- | Parameter | Tags | Description |
481
- |-----------|------|-------------|
482
- | customer_identifier | ``` Required ``` | Customer Identifier |
483
-
484
-
485
- #### Example Usage
486
-
487
- ```ruby
488
- customer_identifier = 'customerIdentifier'
489
-
490
- result = customers.get_customer(customer_identifier)
491
-
492
- ```
493
-
494
-
495
- ### <a name="create_customer"></a>![Method: ](https://apidocs.io/img/method.png ".CustomersController.create_customer") create_customer
496
-
497
- > Create a new customer
498
-
499
-
500
- ```ruby
501
- def create_customer(body); end
502
- ```
503
-
504
- #### Parameters
505
-
506
- | Parameter | Tags | Description |
507
- |-----------|------|-------------|
508
- | body | ``` Required ``` | Request Body |
509
-
510
-
511
- #### Example Usage
512
-
513
- ```ruby
514
- body = CreateCustomerRequestModel.new
515
-
516
- result = customers.create_customer(body)
517
-
518
- ```
519
-
520
-
521
- ### <a name="get_all_customers"></a>![Method: ](https://apidocs.io/img/method.png ".CustomersController.get_all_customers") get_all_customers
522
-
523
- > Gets all customers under the platform
524
-
525
-
526
- ```ruby
527
- def get_all_customers; end
528
- ```
529
-
530
- #### Example Usage
531
-
532
- ```ruby
533
-
534
- result = customers.get_all_customers()
535
-
536
- ```
537
-
538
-
539
- [Back to List of Controllers](#list_of_controllers)
540
-
541
-
49
+ require 'raas'
542
50
 
51
+ api_client = Raas::RaasClient.new
52
+ controller = api_client.status_controller
53
+ response = controller.get_system_status(<required parameters if any>)
54
+ p response
55
+ ```