vmsp-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +167 -0
- data/bin/console +15 -0
- data/lib/e_mobility_vmspocpiap_is/api_helper.rb +10 -0
- data/lib/e_mobility_vmspocpiap_is/client.rb +138 -0
- data/lib/e_mobility_vmspocpiap_is/configuration.rb +176 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/account_controller.rb +53 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/base_controller.rb +60 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/cd_rs_pull_controller.rb +103 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/cd_rs_push_controller.rb +51 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/commands_callback_controller.rb +56 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/commands_controller.rb +102 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/locations_pull_controller.rb +125 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/locations_push_controller.rb +68 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/sessions_pull_controller.rb +91 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/sessions_push_controller.rb +74 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/tariffs_pull_controller.rb +117 -0
- data/lib/e_mobility_vmspocpiap_is/controllers/tariffs_push_controller.rb +62 -0
- data/lib/e_mobility_vmspocpiap_is/exceptions/accounts_ocpi_error_response_exception.rb +69 -0
- data/lib/e_mobility_vmspocpiap_is/exceptions/accounts_ocpi_response_exception.rb +67 -0
- data/lib/e_mobility_vmspocpiap_is/exceptions/accounts_ocpi_unauthorized_response_exception.rb +64 -0
- data/lib/e_mobility_vmspocpiap_is/exceptions/api_exception.rb +21 -0
- data/lib/e_mobility_vmspocpiap_is/exceptions/ocpi_error_response_exception.rb +71 -0
- data/lib/e_mobility_vmspocpiap_is/exceptions/ocpi_response_error_exception.rb +67 -0
- data/lib/e_mobility_vmspocpiap_is/exceptions/ocpi_unauthorized_response_exception.rb +64 -0
- data/lib/e_mobility_vmspocpiap_is/exceptions/v3_commands_startsession400_error_exception.rb +67 -0
- data/lib/e_mobility_vmspocpiap_is/http/auth/bearer_authorization.rb +53 -0
- data/lib/e_mobility_vmspocpiap_is/http/auth/ocpi_authorization.rb +52 -0
- data/lib/e_mobility_vmspocpiap_is/http/http_call_back.rb +10 -0
- data/lib/e_mobility_vmspocpiap_is/http/http_method_enum.rb +10 -0
- data/lib/e_mobility_vmspocpiap_is/http/http_request.rb +10 -0
- data/lib/e_mobility_vmspocpiap_is/http/http_response.rb +10 -0
- data/lib/e_mobility_vmspocpiap_is/http/proxy_settings.rb +22 -0
- data/lib/e_mobility_vmspocpiap_is/models/account_details.rb +237 -0
- data/lib/e_mobility_vmspocpiap_is/models/account_details2.rb +237 -0
- data/lib/e_mobility_vmspocpiap_is/models/account_response.rb +98 -0
- data/lib/e_mobility_vmspocpiap_is/models/account_state_enum.rb +46 -0
- data/lib/e_mobility_vmspocpiap_is/models/account_state_reason_enum.rb +67 -0
- data/lib/e_mobility_vmspocpiap_is/models/add_on_fee.rb +101 -0
- data/lib/e_mobility_vmspocpiap_is/models/add_on_fee_type_enum.rb +52 -0
- data/lib/e_mobility_vmspocpiap_is/models/additional_geo_location.rb +82 -0
- data/lib/e_mobility_vmspocpiap_is/models/auth_method_enum.rb +40 -0
- data/lib/e_mobility_vmspocpiap_is/models/base_model.rb +110 -0
- data/lib/e_mobility_vmspocpiap_is/models/benefit.rb +181 -0
- data/lib/e_mobility_vmspocpiap_is/models/booking_restriction_type_enum.rb +44 -0
- data/lib/e_mobility_vmspocpiap_is/models/business_details.rb +84 -0
- data/lib/e_mobility_vmspocpiap_is/models/capability_enum.rb +88 -0
- data/lib/e_mobility_vmspocpiap_is/models/cdr.rb +462 -0
- data/lib/e_mobility_vmspocpiap_is/models/cdr1.rb +457 -0
- data/lib/e_mobility_vmspocpiap_is/models/cdr_dimension.rb +71 -0
- data/lib/e_mobility_vmspocpiap_is/models/cdr_dimension_type_enum.rb +97 -0
- data/lib/e_mobility_vmspocpiap_is/models/cdr_location.rb +206 -0
- data/lib/e_mobility_vmspocpiap_is/models/cdr_token.rb +91 -0
- data/lib/e_mobility_vmspocpiap_is/models/charge_type_enum.rb +52 -0
- data/lib/e_mobility_vmspocpiap_is/models/charging_period.rb +100 -0
- data/lib/e_mobility_vmspocpiap_is/models/command_response.rb +92 -0
- data/lib/e_mobility_vmspocpiap_is/models/command_response1.rb +91 -0
- data/lib/e_mobility_vmspocpiap_is/models/command_response_type_enum.rb +44 -0
- data/lib/e_mobility_vmspocpiap_is/models/command_result.rb +81 -0
- data/lib/e_mobility_vmspocpiap_is/models/command_result_type_enum.rb +64 -0
- data/lib/e_mobility_vmspocpiap_is/models/connector.rb +184 -0
- data/lib/e_mobility_vmspocpiap_is/models/connector_format_enum.rb +36 -0
- data/lib/e_mobility_vmspocpiap_is/models/connector_type_enum.rb +196 -0
- data/lib/e_mobility_vmspocpiap_is/models/day_of_week_enum.rb +56 -0
- data/lib/e_mobility_vmspocpiap_is/models/display_text.rb +68 -0
- data/lib/e_mobility_vmspocpiap_is/models/emaid.rb +137 -0
- data/lib/e_mobility_vmspocpiap_is/models/energy_mix.rb +127 -0
- data/lib/e_mobility_vmspocpiap_is/models/energy_source.rb +69 -0
- data/lib/e_mobility_vmspocpiap_is/models/energy_source_category_enum.rb +60 -0
- data/lib/e_mobility_vmspocpiap_is/models/environmental_impact.rb +68 -0
- data/lib/e_mobility_vmspocpiap_is/models/environmental_impact_category_enum.rb +36 -0
- data/lib/e_mobility_vmspocpiap_is/models/evse.rb +250 -0
- data/lib/e_mobility_vmspocpiap_is/models/exceptional_period.rb +84 -0
- data/lib/e_mobility_vmspocpiap_is/models/facility_enum.rb +108 -0
- data/lib/e_mobility_vmspocpiap_is/models/geo_location.rb +73 -0
- data/lib/e_mobility_vmspocpiap_is/models/hours.rb +127 -0
- data/lib/e_mobility_vmspocpiap_is/models/image.rb +114 -0
- data/lib/e_mobility_vmspocpiap_is/models/image_category_enum.rb +58 -0
- data/lib/e_mobility_vmspocpiap_is/models/location.rb +379 -0
- data/lib/e_mobility_vmspocpiap_is/models/location1.rb +375 -0
- data/lib/e_mobility_vmspocpiap_is/models/ocpi_command_response.rb +62 -0
- data/lib/e_mobility_vmspocpiap_is/models/ocpi_response.rb +98 -0
- data/lib/e_mobility_vmspocpiap_is/models/parking_direction_enum.rb +40 -0
- data/lib/e_mobility_vmspocpiap_is/models/parking_restriction_enum.rb +61 -0
- data/lib/e_mobility_vmspocpiap_is/models/parking_type_enum.rb +53 -0
- data/lib/e_mobility_vmspocpiap_is/models/power_type_enum.rb +48 -0
- data/lib/e_mobility_vmspocpiap_is/models/price.rb +80 -0
- data/lib/e_mobility_vmspocpiap_is/models/price_component.rb +99 -0
- data/lib/e_mobility_vmspocpiap_is/models/price_limit.rb +71 -0
- data/lib/e_mobility_vmspocpiap_is/models/product.rb +186 -0
- data/lib/e_mobility_vmspocpiap_is/models/publish_token_type.rb +106 -0
- data/lib/e_mobility_vmspocpiap_is/models/regular_hours.rb +80 -0
- data/lib/e_mobility_vmspocpiap_is/models/reservation_restriction_type_enum.rb +36 -0
- data/lib/e_mobility_vmspocpiap_is/models/session.rb +298 -0
- data/lib/e_mobility_vmspocpiap_is/models/session_status_enum.rb +60 -0
- data/lib/e_mobility_vmspocpiap_is/models/signed_data.rb +116 -0
- data/lib/e_mobility_vmspocpiap_is/models/signed_value.rb +85 -0
- data/lib/e_mobility_vmspocpiap_is/models/start_session.rb +107 -0
- data/lib/e_mobility_vmspocpiap_is/models/start_session_token.rb +68 -0
- data/lib/e_mobility_vmspocpiap_is/models/status2_enum.rb +44 -0
- data/lib/e_mobility_vmspocpiap_is/models/status_enum.rb +64 -0
- data/lib/e_mobility_vmspocpiap_is/models/status_schedule.rb +97 -0
- data/lib/e_mobility_vmspocpiap_is/models/stop_session.rb +70 -0
- data/lib/e_mobility_vmspocpiap_is/models/subscription_renewal_cadence_enum.rb +44 -0
- data/lib/e_mobility_vmspocpiap_is/models/tariff.rb +347 -0
- data/lib/e_mobility_vmspocpiap_is/models/tariff1.rb +336 -0
- data/lib/e_mobility_vmspocpiap_is/models/tariff_dimension_type_enum.rb +60 -0
- data/lib/e_mobility_vmspocpiap_is/models/tariff_element.rb +91 -0
- data/lib/e_mobility_vmspocpiap_is/models/tariff_restrictions.rb +310 -0
- data/lib/e_mobility_vmspocpiap_is/models/tariff_type_enum.rb +48 -0
- data/lib/e_mobility_vmspocpiap_is/models/tax_amount.rb +95 -0
- data/lib/e_mobility_vmspocpiap_is/models/tax_included_enum.rb +40 -0
- data/lib/e_mobility_vmspocpiap_is/models/token_type_enum.rb +48 -0
- data/lib/e_mobility_vmspocpiap_is/models/type_of_emaid_enum.rb +36 -0
- data/lib/e_mobility_vmspocpiap_is/models/url_enum.rb +36 -0
- data/lib/e_mobility_vmspocpiap_is/models/v3_cdrs_response.rb +107 -0
- data/lib/e_mobility_vmspocpiap_is/models/v3_cdrs_response1.rb +98 -0
- data/lib/e_mobility_vmspocpiap_is/models/v3_commands_startsession_response.rb +98 -0
- data/lib/e_mobility_vmspocpiap_is/models/v3_commands_stopsession_response.rb +98 -0
- data/lib/e_mobility_vmspocpiap_is/models/v3_locations_response.rb +107 -0
- data/lib/e_mobility_vmspocpiap_is/models/v3_locations_response1.rb +98 -0
- data/lib/e_mobility_vmspocpiap_is/models/v3_sessions_response.rb +107 -0
- data/lib/e_mobility_vmspocpiap_is/models/v3_tariffs_response.rb +107 -0
- data/lib/e_mobility_vmspocpiap_is/models/v3_tariffs_response1.rb +98 -0
- data/lib/e_mobility_vmspocpiap_is/models/vehicle_type_enum.rb +64 -0
- data/lib/e_mobility_vmspocpiap_is/utilities/date_time_helper.rb +11 -0
- data/lib/e_mobility_vmspocpiap_is/utilities/file_wrapper.rb +28 -0
- data/lib/e_mobility_vmspocpiap_is.rb +164 -0
- metadata +213 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 1f48b024987ffa69f99a4f89de99f5ac2e40d3b6ec9943f4e54b1563a07cfc32
|
|
4
|
+
data.tar.gz: b8a1fabc6b19e01068e8138c0b270472696f2b22ac4aa0eb399b3b976d7e7e49
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: aa536e8ff91d8a0d7d094e2d65bae1603ebbd7b9fdb2d772c10ca9b0a2418811b2cc71888ae1deb418eceb8e46096140c93017482ad9c4b47e28f9d3b4cd4794
|
|
7
|
+
data.tar.gz: 9295395ff820bcd0dfc75d953d2f64cb01a86cb5dae80362971af447602336a7b0a34ef72635499b2e82a58e79ad1c63148f5066a018a62ba01fb0d3941b10d9
|
data/LICENSE
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
License:
|
|
2
|
+
========
|
|
3
|
+
The MIT License (MIT)
|
|
4
|
+
http://opensource.org/licenses/MIT
|
|
5
|
+
|
|
6
|
+
Copyright (c) 2014 - 2026 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
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
|
|
2
|
+
# Getting Started with eMobility VMSP OCPI APIs
|
|
3
|
+
|
|
4
|
+
## Introduction
|
|
5
|
+
|
|
6
|
+
eMobility VMSP OCPI APIs. This set of APIs are for North Americas Region. These set of APIs lets you manage
|
|
7
|
+
|
|
8
|
+
- Find & get list of all EV locations.
|
|
9
|
+
- Get updates on the status of the charger on updated locations.
|
|
10
|
+
- Manage CDRs (Charge Detail Records).
|
|
11
|
+
- Manage tariffs and pricing information.
|
|
12
|
+
- Manage accounts and their details.
|
|
13
|
+
|
|
14
|
+
## Install the Package
|
|
15
|
+
|
|
16
|
+
Install the gem from the command line:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
gem install vmsp-sdk -v 0.0.1
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Or add the gem to your Gemfile and run `bundle`:
|
|
23
|
+
|
|
24
|
+
```ruby
|
|
25
|
+
gem 'vmsp-sdk', '0.0.1'
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
For additional gem details, see the [RubyGems page for the vmsp-sdk gem](https://rubygems.org/gems/vmsp-sdk/versions/0.0.1).
|
|
29
|
+
|
|
30
|
+
## IRB Console Usage
|
|
31
|
+
|
|
32
|
+
You can explore the SDK interactively using IRB in two ways
|
|
33
|
+
|
|
34
|
+
### 1. Use IRB with Installed Gem
|
|
35
|
+
|
|
36
|
+
Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and type the following command to start the irb console.
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
irb
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Now you can load the SDK in the IRB
|
|
43
|
+
|
|
44
|
+
```ruby
|
|
45
|
+
require 'e_mobility_vmspocpiap_is'
|
|
46
|
+
include EMobilityVmspocpiapIs
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 2. Use IRB within SDK
|
|
50
|
+
|
|
51
|
+
Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and navigate to the root folder of SDK.
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
cd path/to/e_mobility_vmspocpiap_is
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Now you can start the preconfigured irb console by running the following command
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
ruby bin/console
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**_Note:_** This automatically loads the SDK from lib/
|
|
64
|
+
|
|
65
|
+
## Initialize the API Client
|
|
66
|
+
|
|
67
|
+
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/client.md)
|
|
68
|
+
|
|
69
|
+
The following parameters are configurable for the API Client:
|
|
70
|
+
|
|
71
|
+
| Parameter | Type | Description |
|
|
72
|
+
| --- | --- | --- |
|
|
73
|
+
| url | `UrlEnum` | This variable specifies the type of environment. Environments:<br><br>* `api.shell.com/na/ev` - Production<br>* `api-test.shell.com/na/ev` - TEST<br>*Default*: `UrlEnum::ENUM_APITESTSHELLCOMNAEV` |
|
|
74
|
+
| environment | [`Environment`](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/README.md#environments) | The API environment. <br> **Default: `Environment.PRODUCTION`** |
|
|
75
|
+
| connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
|
|
76
|
+
| adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
|
|
77
|
+
| timeout | `Float` | The value to use for connection timeout. <br> **Default: 60** |
|
|
78
|
+
| max_retries | `Integer` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
|
|
79
|
+
| retry_interval | `Float` | Pause in seconds between retries. <br> **Default: 1** |
|
|
80
|
+
| backoff_factor | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. <br> **Default: 2** |
|
|
81
|
+
| retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
|
|
82
|
+
| retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
|
|
83
|
+
| http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
|
|
84
|
+
| proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
|
|
85
|
+
| bearer_authorization_credentials | [`BearerAuthorizationCredentials`](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/auth/oauth-2-bearer-token.md) | The credential object for OAuth 2 Bearer token |
|
|
86
|
+
| ocpi_authorization_credentials | [`OcpiAuthorizationCredentials`](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/auth/custom-header-signature.md) | The credential object for Custom Header Signature |
|
|
87
|
+
|
|
88
|
+
The API client can be initialized as follows:
|
|
89
|
+
|
|
90
|
+
### Code-Based Client Initialization
|
|
91
|
+
|
|
92
|
+
```ruby
|
|
93
|
+
require 'e_mobility_vmspocpiap_is'
|
|
94
|
+
include EMobilityVmspocpiapIs
|
|
95
|
+
|
|
96
|
+
client = Client.new(
|
|
97
|
+
bearer_authorization_credentials: BearerAuthorizationCredentials.new(
|
|
98
|
+
access_token: 'AccessToken'
|
|
99
|
+
),
|
|
100
|
+
ocpi_authorization_credentials: OcpiAuthorizationCredentials.new(
|
|
101
|
+
authorization: 'Authorization'
|
|
102
|
+
),
|
|
103
|
+
environment: Environment::PRODUCTION,
|
|
104
|
+
url: UrlEnum::ENUM_APITESTSHELLCOMNAEV
|
|
105
|
+
)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Environment-Based Client Initialization
|
|
109
|
+
|
|
110
|
+
```ruby
|
|
111
|
+
require 'e_mobility_vmspocpiap_is'
|
|
112
|
+
include EMobilityVmspocpiapIs
|
|
113
|
+
|
|
114
|
+
# Create client from environment
|
|
115
|
+
client = Client.from_env
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
See the [`Environment-Based Client Initialization`](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/environment-based-client-initialization.md) section for details.
|
|
119
|
+
|
|
120
|
+
## Environments
|
|
121
|
+
|
|
122
|
+
The SDK can be configured to use a different environment for making API calls. Available environments are:
|
|
123
|
+
|
|
124
|
+
### Fields
|
|
125
|
+
|
|
126
|
+
| Name | Description |
|
|
127
|
+
| --- | --- |
|
|
128
|
+
| PRODUCTION | **Default** |
|
|
129
|
+
|
|
130
|
+
## Authorization
|
|
131
|
+
|
|
132
|
+
This API uses the following authentication schemes.
|
|
133
|
+
|
|
134
|
+
* [`bearerAuthorization (OAuth 2 Bearer token)`](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/auth/oauth-2-bearer-token.md)
|
|
135
|
+
* [`ocpiAuthorization (Custom Header Signature)`](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/auth/custom-header-signature.md)
|
|
136
|
+
|
|
137
|
+
## List of APIs
|
|
138
|
+
|
|
139
|
+
* [CD Rs PULL](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/controllers/cd-rs-pull.md)
|
|
140
|
+
* [CD Rs PUSH](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/controllers/cd-rs-push.md)
|
|
141
|
+
* [Commands Callback](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/controllers/commands-callback.md)
|
|
142
|
+
* [Locations PULL](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/controllers/locations-pull.md)
|
|
143
|
+
* [Locations PUSH](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/controllers/locations-push.md)
|
|
144
|
+
* [Sessions PULL](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/controllers/sessions-pull.md)
|
|
145
|
+
* [Sessions PUSH](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/controllers/sessions-push.md)
|
|
146
|
+
* [Tariffs PULL](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/controllers/tariffs-pull.md)
|
|
147
|
+
* [Tariffs PUSH](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/controllers/tariffs-push.md)
|
|
148
|
+
* [Account](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/controllers/account.md)
|
|
149
|
+
* [Commands](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/controllers/commands.md)
|
|
150
|
+
|
|
151
|
+
## SDK Infrastructure
|
|
152
|
+
|
|
153
|
+
### Configuration
|
|
154
|
+
|
|
155
|
+
* [ProxySettings](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/proxy-settings.md)
|
|
156
|
+
* [Environment-Based Client Initialization](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/environment-based-client-initialization.md)
|
|
157
|
+
|
|
158
|
+
### HTTP
|
|
159
|
+
|
|
160
|
+
* [HttpResponse](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/http-response.md)
|
|
161
|
+
* [HttpRequest](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/http-request.md)
|
|
162
|
+
|
|
163
|
+
### Utilities
|
|
164
|
+
|
|
165
|
+
* [ApiHelper](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/api-helper.md)
|
|
166
|
+
* [DateTimeHelper](https://www.github.com/sdks-io/vmsp-sdk-ruby-sdk/tree/0.0.1/doc/date-time-helper.md)
|
|
167
|
+
|
data/bin/console
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
# Load the lib folder into Ruby's load path
|
|
4
|
+
$LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
|
|
5
|
+
|
|
6
|
+
# Require the gem
|
|
7
|
+
require 'e_mobility_vmspocpiap_is'
|
|
8
|
+
|
|
9
|
+
puts 'EMobilityVmspocpiapIs SDK loaded!'
|
|
10
|
+
puts 'You can now create a client with: client = EMobilityVmspocpiapIs::Client.new'
|
|
11
|
+
puts 'Or use from_env: client = EMobilityVmspocpiapIs::Client.from_env'
|
|
12
|
+
|
|
13
|
+
# Start an interactive IRB session
|
|
14
|
+
require 'irb'
|
|
15
|
+
IRB.start
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# e_mobility_vmspocpiap_is
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module EMobilityVmspocpiapIs
|
|
7
|
+
# e_mobility_vmspocpiap_is client class.
|
|
8
|
+
class Client
|
|
9
|
+
include CoreLibrary
|
|
10
|
+
attr_reader :config, :auth_managers
|
|
11
|
+
|
|
12
|
+
def user_agent_detail
|
|
13
|
+
config.user_agent_detail
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Access to account controller.
|
|
17
|
+
# @return [AccountController] Returns the controller instance.
|
|
18
|
+
def account
|
|
19
|
+
@account ||= AccountController.new @global_configuration
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Access to cd_rs_pull controller.
|
|
23
|
+
# @return [CDRsPULLController] Returns the controller instance.
|
|
24
|
+
def cd_rs_pull
|
|
25
|
+
@cd_rs_pull ||= CDRsPULLController.new @global_configuration
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Access to cd_rs_push controller.
|
|
29
|
+
# @return [CDRsPUSHController] Returns the controller instance.
|
|
30
|
+
def cd_rs_push
|
|
31
|
+
@cd_rs_push ||= CDRsPUSHController.new @global_configuration
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Access to commands controller.
|
|
35
|
+
# @return [CommandsController] Returns the controller instance.
|
|
36
|
+
def commands
|
|
37
|
+
@commands ||= CommandsController.new @global_configuration
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Access to commands_callback controller.
|
|
41
|
+
# @return [CommandsCallbackController] Returns the controller instance.
|
|
42
|
+
def commands_callback
|
|
43
|
+
@commands_callback ||= CommandsCallbackController.new @global_configuration
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Access to locations_pull controller.
|
|
47
|
+
# @return [LocationsPULLController] Returns the controller instance.
|
|
48
|
+
def locations_pull
|
|
49
|
+
@locations_pull ||= LocationsPULLController.new @global_configuration
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Access to locations_push controller.
|
|
53
|
+
# @return [LocationsPUSHController] Returns the controller instance.
|
|
54
|
+
def locations_push
|
|
55
|
+
@locations_push ||= LocationsPUSHController.new @global_configuration
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Access to sessions_pull controller.
|
|
59
|
+
# @return [SessionsPULLController] Returns the controller instance.
|
|
60
|
+
def sessions_pull
|
|
61
|
+
@sessions_pull ||= SessionsPULLController.new @global_configuration
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Access to sessions_push controller.
|
|
65
|
+
# @return [SessionsPUSHController] Returns the controller instance.
|
|
66
|
+
def sessions_push
|
|
67
|
+
@sessions_push ||= SessionsPUSHController.new @global_configuration
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Access to tariffs_pull controller.
|
|
71
|
+
# @return [TariffsPULLController] Returns the controller instance.
|
|
72
|
+
def tariffs_pull
|
|
73
|
+
@tariffs_pull ||= TariffsPULLController.new @global_configuration
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Access to tariffs_push controller.
|
|
77
|
+
# @return [TariffsPUSHController] Returns the controller instance.
|
|
78
|
+
def tariffs_push
|
|
79
|
+
@tariffs_push ||= TariffsPUSHController.new @global_configuration
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def initialize(
|
|
83
|
+
connection: nil, adapter: :net_http_persistent, timeout: 60,
|
|
84
|
+
max_retries: 0, retry_interval: 1, backoff_factor: 2,
|
|
85
|
+
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
|
86
|
+
retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
|
|
87
|
+
environment: Environment::PRODUCTION,
|
|
88
|
+
url: UrlEnum::ENUM_APITESTSHELLCOMNAEV,
|
|
89
|
+
bearer_authorization_credentials: nil,
|
|
90
|
+
ocpi_authorization_credentials: nil, config: nil
|
|
91
|
+
)
|
|
92
|
+
@config = if config.nil?
|
|
93
|
+
Configuration.new(
|
|
94
|
+
connection: connection, adapter: adapter, timeout: timeout,
|
|
95
|
+
max_retries: max_retries, retry_interval: retry_interval,
|
|
96
|
+
backoff_factor: backoff_factor,
|
|
97
|
+
retry_statuses: retry_statuses,
|
|
98
|
+
retry_methods: retry_methods, http_callback: http_callback,
|
|
99
|
+
proxy_settings: proxy_settings, environment: environment,
|
|
100
|
+
url: url,
|
|
101
|
+
bearer_authorization_credentials: bearer_authorization_credentials,
|
|
102
|
+
ocpi_authorization_credentials: ocpi_authorization_credentials
|
|
103
|
+
)
|
|
104
|
+
else
|
|
105
|
+
config
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
@global_configuration = GlobalConfiguration.new(client_configuration: @config)
|
|
109
|
+
.base_uri_executor(@config.method(:get_base_uri))
|
|
110
|
+
.global_errors(BaseController::GLOBAL_ERRORS)
|
|
111
|
+
.user_agent(BaseController.user_agent)
|
|
112
|
+
|
|
113
|
+
initialize_auth_managers(@global_configuration)
|
|
114
|
+
@global_configuration = @global_configuration.auth_managers(@auth_managers)
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Initializes the auth managers hash used for authenticating API calls.
|
|
118
|
+
# @param [GlobalConfiguration] global_config The global configuration of the SDK)
|
|
119
|
+
def initialize_auth_managers(global_config)
|
|
120
|
+
@auth_managers = {}
|
|
121
|
+
http_client_config = global_config.client_configuration
|
|
122
|
+
%w[bearerAuthorization ocpiAuthorization].each { |auth| @auth_managers[auth] = nil }
|
|
123
|
+
@auth_managers['bearerAuthorization'] = BearerAuthorization.new(
|
|
124
|
+
http_client_config.bearer_authorization_credentials
|
|
125
|
+
)
|
|
126
|
+
@auth_managers['ocpiAuthorization'] = OcpiAuthorization.new(
|
|
127
|
+
http_client_config.ocpi_authorization_credentials
|
|
128
|
+
)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Creates a client directly from environment variables.
|
|
132
|
+
def self.from_env(**overrides)
|
|
133
|
+
default_config = Configuration.build_default_config_from_env
|
|
134
|
+
new_config = default_config.clone_with(**overrides)
|
|
135
|
+
new(config: new_config)
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
end
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# e_mobility_vmspocpiap_is
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module EMobilityVmspocpiapIs
|
|
7
|
+
# An enum for SDK environments.
|
|
8
|
+
class Environment
|
|
9
|
+
ENVIRONMENT = [
|
|
10
|
+
PRODUCTION = 'production'.freeze
|
|
11
|
+
].freeze
|
|
12
|
+
|
|
13
|
+
# Converts a string or symbol into a valid Environment constant.
|
|
14
|
+
def self.from_value(value, default_value = PRODUCTION)
|
|
15
|
+
return default_value if value.nil?
|
|
16
|
+
|
|
17
|
+
default_value
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# An enum for API servers.
|
|
22
|
+
class Server
|
|
23
|
+
SERVER = [
|
|
24
|
+
DEFAULT = 'default'.freeze
|
|
25
|
+
].freeze
|
|
26
|
+
|
|
27
|
+
# Converts a string or symbol into a valid Server constant.
|
|
28
|
+
def self.from_value(value, default_value = DEFAULT)
|
|
29
|
+
return default_value if value.nil?
|
|
30
|
+
|
|
31
|
+
default_value
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# All configuration including auth info and base URI for the API access
|
|
36
|
+
# are configured in this class.
|
|
37
|
+
class Configuration < CoreLibrary::HttpClientConfiguration
|
|
38
|
+
# The attribute readers for properties.
|
|
39
|
+
attr_reader :environment, :url, :bearer_authorization_credentials,
|
|
40
|
+
:ocpi_authorization_credentials
|
|
41
|
+
|
|
42
|
+
class << self
|
|
43
|
+
attr_reader :environments
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def initialize(
|
|
47
|
+
connection: nil, adapter: :net_http_persistent, timeout: 60,
|
|
48
|
+
max_retries: 0, retry_interval: 1, backoff_factor: 2,
|
|
49
|
+
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
|
50
|
+
retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
|
|
51
|
+
environment: Environment::PRODUCTION,
|
|
52
|
+
url: UrlEnum::ENUM_APITESTSHELLCOMNAEV,
|
|
53
|
+
bearer_authorization_credentials: nil,
|
|
54
|
+
ocpi_authorization_credentials: nil
|
|
55
|
+
)
|
|
56
|
+
super connection: connection, adapter: adapter, timeout: timeout,
|
|
57
|
+
max_retries: max_retries, retry_interval: retry_interval,
|
|
58
|
+
backoff_factor: backoff_factor, retry_statuses: retry_statuses,
|
|
59
|
+
retry_methods: retry_methods, http_callback: http_callback,
|
|
60
|
+
proxy_settings: proxy_settings
|
|
61
|
+
|
|
62
|
+
# Current API environment
|
|
63
|
+
@environment = String(environment)
|
|
64
|
+
|
|
65
|
+
# This variable specifies the type of environment. Environments: * `api.shell.com/na/ev` - Production * `api-test.shell.com/na/ev` - TEST
|
|
66
|
+
@url = url
|
|
67
|
+
|
|
68
|
+
# The object holding OAuth 2 Bearer token credentials
|
|
69
|
+
@bearer_authorization_credentials = bearer_authorization_credentials
|
|
70
|
+
|
|
71
|
+
# The object holding Custom Header Signature credentials
|
|
72
|
+
@ocpi_authorization_credentials = ocpi_authorization_credentials
|
|
73
|
+
|
|
74
|
+
# The Http Client to use for making requests.
|
|
75
|
+
set_http_client CoreLibrary::FaradayClient.new(self)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def clone_with(connection: nil, adapter: nil, timeout: nil,
|
|
79
|
+
max_retries: nil, retry_interval: nil, backoff_factor: nil,
|
|
80
|
+
retry_statuses: nil, retry_methods: nil, http_callback: nil,
|
|
81
|
+
proxy_settings: nil, environment: nil, url: nil,
|
|
82
|
+
bearer_authorization_credentials: nil,
|
|
83
|
+
ocpi_authorization_credentials: nil)
|
|
84
|
+
connection ||= self.connection
|
|
85
|
+
adapter ||= self.adapter
|
|
86
|
+
timeout ||= self.timeout
|
|
87
|
+
max_retries ||= self.max_retries
|
|
88
|
+
retry_interval ||= self.retry_interval
|
|
89
|
+
backoff_factor ||= self.backoff_factor
|
|
90
|
+
retry_statuses ||= self.retry_statuses
|
|
91
|
+
retry_methods ||= self.retry_methods
|
|
92
|
+
http_callback ||= self.http_callback
|
|
93
|
+
proxy_settings ||= self.proxy_settings
|
|
94
|
+
environment ||= self.environment
|
|
95
|
+
url ||= self.url
|
|
96
|
+
bearer_authorization_credentials ||= self.bearer_authorization_credentials
|
|
97
|
+
ocpi_authorization_credentials ||= self.ocpi_authorization_credentials
|
|
98
|
+
|
|
99
|
+
Configuration.new(
|
|
100
|
+
connection: connection, adapter: adapter, timeout: timeout,
|
|
101
|
+
max_retries: max_retries, retry_interval: retry_interval,
|
|
102
|
+
backoff_factor: backoff_factor, retry_statuses: retry_statuses,
|
|
103
|
+
retry_methods: retry_methods, http_callback: http_callback,
|
|
104
|
+
proxy_settings: proxy_settings, environment: environment, url: url,
|
|
105
|
+
bearer_authorization_credentials: bearer_authorization_credentials,
|
|
106
|
+
ocpi_authorization_credentials: ocpi_authorization_credentials
|
|
107
|
+
)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
# All the environments the SDK can run in.
|
|
112
|
+
ENVIRONMENTS = {
|
|
113
|
+
Environment::PRODUCTION => {
|
|
114
|
+
Server::DEFAULT => 'https://{url}'
|
|
115
|
+
}
|
|
116
|
+
}.freeze
|
|
117
|
+
|
|
118
|
+
# Generates the appropriate base URI for the environment and the server.
|
|
119
|
+
# @param [Configuration::Server] server The server enum for which the base URI is
|
|
120
|
+
# required.
|
|
121
|
+
# @return [String] The base URI.
|
|
122
|
+
def get_base_uri(server = Server::DEFAULT)
|
|
123
|
+
parameters = {
|
|
124
|
+
'url' => { 'value' => url, 'encode' => false }
|
|
125
|
+
}
|
|
126
|
+
APIHelper.append_url_with_template_parameters(
|
|
127
|
+
ENVIRONMENTS[environment][server], parameters
|
|
128
|
+
)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Builds a Configuration instance using environment variables.
|
|
132
|
+
def self.build_default_config_from_env
|
|
133
|
+
# === Core environment ===
|
|
134
|
+
environment = Environment.from_value(ENV.fetch('ENVIRONMENT', 'production'))
|
|
135
|
+
url = UrlEnum.from_value(ENV.fetch('URL', 'enum_apitestshellcomnaev'))
|
|
136
|
+
timeout = (ENV['TIMEOUT'] || 60).to_f
|
|
137
|
+
max_retries = (ENV['MAX_RETRIES'] || 0).to_i
|
|
138
|
+
retry_interval = (ENV['RETRY_INTERVAL'] || 1).to_f
|
|
139
|
+
backoff_factor = (ENV['BACKOFF_FACTOR'] || 2).to_f
|
|
140
|
+
retry_statuses = ENV.fetch('RETRY_STATUSES',
|
|
141
|
+
'[408, 413, 429, 500, 502, 503, 504, 521, 522, 524]').gsub(/[\[\]]/, '')
|
|
142
|
+
.split(',')
|
|
143
|
+
.map(&:strip)
|
|
144
|
+
.map do |item|
|
|
145
|
+
item.match?(/\A\d+\z/) ? item.to_i : item.downcase
|
|
146
|
+
end
|
|
147
|
+
retry_methods = ENV.fetch('RETRY_METHODS', '%i[get put]').gsub(/[\[\]]/, '')
|
|
148
|
+
.split(',')
|
|
149
|
+
.map(&:strip)
|
|
150
|
+
.map do |item|
|
|
151
|
+
item.match?(/\A\d+\z/) ? item.to_i : item.downcase
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# === Authentication credentials ===
|
|
155
|
+
bearer_authorization_credentials = BearerAuthorizationCredentials.from_env
|
|
156
|
+
ocpi_authorization_credentials = OcpiAuthorizationCredentials.from_env
|
|
157
|
+
|
|
158
|
+
# === Proxy settings ===
|
|
159
|
+
proxy_settings = ProxySettings.from_env
|
|
160
|
+
|
|
161
|
+
Configuration.new(
|
|
162
|
+
environment: environment,
|
|
163
|
+
url: url,
|
|
164
|
+
timeout: timeout,
|
|
165
|
+
max_retries: max_retries,
|
|
166
|
+
retry_interval: retry_interval,
|
|
167
|
+
backoff_factor: backoff_factor,
|
|
168
|
+
retry_statuses: retry_statuses,
|
|
169
|
+
retry_methods: retry_methods,
|
|
170
|
+
bearer_authorization_credentials: bearer_authorization_credentials,
|
|
171
|
+
ocpi_authorization_credentials: ocpi_authorization_credentials,
|
|
172
|
+
proxy_settings: proxy_settings
|
|
173
|
+
)
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# e_mobility_vmspocpiap_is
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module EMobilityVmspocpiapIs
|
|
7
|
+
# AccountController
|
|
8
|
+
class AccountController < BaseController
|
|
9
|
+
# Returns the account details for the authenticated user, including
|
|
10
|
+
# products, benefits, and eMAIDs.
|
|
11
|
+
# @param [String] x_request_id Required parameter: Every request SHALL
|
|
12
|
+
# contain a unique request ID, the response to this request SHALL contain
|
|
13
|
+
# the same ID. It is advised to use GUID/UUID as values.
|
|
14
|
+
# @param [String] x_correlation_id Required parameter: Every
|
|
15
|
+
# request/response SHALL contain a unique correlation ID, every response to
|
|
16
|
+
# this request SHALL contain the same ID. It is advised to use GUID/UUID as
|
|
17
|
+
# values. When a Hub forwards a request to a party, the request SHALL
|
|
18
|
+
# contain the same X-Correlation-ID HTTP header (with the same value).
|
|
19
|
+
# @param [String] x_customer_id Required parameter: Unique customer ID.
|
|
20
|
+
# @return [AccountResponse] Response from the API call.
|
|
21
|
+
def get_account(x_request_id,
|
|
22
|
+
x_correlation_id,
|
|
23
|
+
x_customer_id)
|
|
24
|
+
@api_call
|
|
25
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
26
|
+
'/v3/accounts',
|
|
27
|
+
Server::DEFAULT)
|
|
28
|
+
.header_param(new_parameter(x_request_id, key: 'X-Request-ID'))
|
|
29
|
+
.header_param(new_parameter(x_correlation_id, key: 'X-Correlation-ID'))
|
|
30
|
+
.header_param(new_parameter(x_customer_id, key: 'X-Customer-ID'))
|
|
31
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
32
|
+
.auth(Or.new('ocpiAuthorization', 'bearerAuthorization')))
|
|
33
|
+
.response(new_response_handler
|
|
34
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
35
|
+
.deserialize_into(AccountResponse.method(:from_hash))
|
|
36
|
+
.local_error('400',
|
|
37
|
+
'OCPI error response envelope. Error codes are returned based'\
|
|
38
|
+
' on account state.',
|
|
39
|
+
AccountsOCPIErrorResponseException)
|
|
40
|
+
.local_error('401',
|
|
41
|
+
'Authorization failed.',
|
|
42
|
+
AccountsOCPIUnauthorizedResponseException)
|
|
43
|
+
.local_error('404',
|
|
44
|
+
'The requested resource was not found.',
|
|
45
|
+
AccountsOCPIResponseException)
|
|
46
|
+
.local_error('500',
|
|
47
|
+
'OCPI error response envelope. Error codes are returned based'\
|
|
48
|
+
' on account state.',
|
|
49
|
+
AccountsOCPIErrorResponseException))
|
|
50
|
+
.execute
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# e_mobility_vmspocpiap_is
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module EMobilityVmspocpiapIs
|
|
7
|
+
# BaseController.
|
|
8
|
+
class BaseController
|
|
9
|
+
include CoreLibrary
|
|
10
|
+
attr_accessor :config, :http_call_back
|
|
11
|
+
|
|
12
|
+
def self.user_agent
|
|
13
|
+
'APIMATIC 3.0'
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
GLOBAL_ERRORS = {
|
|
18
|
+
'default' => ErrorCase.new
|
|
19
|
+
.error_message('HTTP response not OK.')
|
|
20
|
+
.exception_type(APIException)
|
|
21
|
+
}.freeze
|
|
22
|
+
|
|
23
|
+
# Initialization constructor.
|
|
24
|
+
# @param [GlobalConfiguration] global_configuration The instance of GlobalConfiguration.
|
|
25
|
+
def initialize(global_configuration)
|
|
26
|
+
@global_configuration = global_configuration
|
|
27
|
+
@config = @global_configuration.client_configuration
|
|
28
|
+
@http_call_back = @config.http_callback
|
|
29
|
+
@api_call = ApiCall.new(@global_configuration)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Creates a new instance of the request builder.
|
|
33
|
+
# @param [String] http_method The HTTP method to use in the request.
|
|
34
|
+
# @param [String] path The endpoint path to use in the request.
|
|
35
|
+
# @param [String] server The server to extract the base uri for the request.
|
|
36
|
+
# @return [RequestBuilder] The instance of RequestBuilder.
|
|
37
|
+
def new_request_builder(http_method, path, server)
|
|
38
|
+
RequestBuilder.new
|
|
39
|
+
.http_method(http_method)
|
|
40
|
+
.path(path)
|
|
41
|
+
.server(server)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Creates a new instance of the response handler.
|
|
45
|
+
# @return [ResponseHandler] The instance of ResponseHandler.
|
|
46
|
+
def new_response_handler
|
|
47
|
+
ResponseHandler.new
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Creates a new instance of the parameter.
|
|
51
|
+
# @param [String|optional] key The key of the parameter.
|
|
52
|
+
# @param [Object] value The value of the parameter.
|
|
53
|
+
# @return [Parameter] The instance of Parameter.
|
|
54
|
+
def new_parameter(value, key: nil)
|
|
55
|
+
Parameter.new
|
|
56
|
+
.key(key)
|
|
57
|
+
.value(value)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|