ev-recharge-sdk 2.1.0 → 2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd72057f64494064e86dc04b92918f198d90409cf47f740184a7fbf2f90f4380
4
- data.tar.gz: 2c37041369b8553fa82e16c5cfb6bb12d36d1b9a8a17ada128cf39eca49394a1
3
+ metadata.gz: 87e485796359f70dfe17eeed4559a96553783ff4f5602563626ac6a2d8bf2d22
4
+ data.tar.gz: c3a6e9a96e88729148bb651aa932254d0d9fc12385d241ec88088e5854fa3b42
5
5
  SHA512:
6
- metadata.gz: 37bca8e2855c5c0d13484275ef474386d7ade5d9977e5fdcdd26777c7f7b0e5cd4b5adc33ba043825e0c1e6a9771108c52979af718599917d3dc03de3a36e9f5
7
- data.tar.gz: 109ed1f247ce691638198a82443290c76a0cecb4cea0c957dadaf9e339091ac58e5c3d91ce6510647a29a9b3c51d223d57ae68f854fd16ad4b6e479c4d330ebc
6
+ metadata.gz: 74f2471681ecd05c722327f661fc7531808d41032bd818e88a12cd0368c955780be77bf013516116dff654f361a50e5037b745504897948666093f188a37ee09
7
+ data.tar.gz: 75c67c0d320d0527960f4c102ff47d1e14478a38a994d24fc95625d0d416abd67a76ec6513e1f55bf489ce304ecad97f81b0ba24ad1419c08656ec9ef9d89146
data/README.md CHANGED
@@ -28,16 +28,16 @@ Go to the Shell Developer Portal: [https://developer.shell.com](https://develope
28
28
  Install the gem from the command line:
29
29
 
30
30
  ```bash
31
- gem install ev-recharge-sdk -v 2.1.0
31
+ gem install ev-recharge-sdk -v 2.2.0
32
32
  ```
33
33
 
34
34
  Or add the gem to your Gemfile and run `bundle`:
35
35
 
36
36
  ```ruby
37
- gem 'ev-recharge-sdk', '2.1.0'
37
+ gem 'ev-recharge-sdk', '2.2.0'
38
38
  ```
39
39
 
40
- For additional gem details, see the [RubyGems page for the ev-recharge-sdk gem](https://rubygems.org/gems/ev-recharge-sdk/versions/2.1.0).
40
+ For additional gem details, see the [RubyGems page for the ev-recharge-sdk gem](https://rubygems.org/gems/ev-recharge-sdk/versions/2.2.0).
41
41
 
42
42
  ## IRB Console Usage
43
43
 
@@ -84,13 +84,13 @@ rake
84
84
 
85
85
  ## Initialize the API Client
86
86
 
87
- **_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.1.0/doc/client.md)
87
+ **_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.2.0/doc/client.md)
88
88
 
89
89
  The following parameters are configurable for the API Client:
90
90
 
91
91
  | Parameter | Type | Description |
92
92
  | --- | --- | --- |
93
- | environment | [`Environment`](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.1.0/README.md#environments) | The API environment. <br> **Default: `Environment.PRODUCTION`** |
93
+ | environment | [`Environment`](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.2.0/README.md#environments) | The API environment. <br> **Default: `Environment.SIT`** |
94
94
  | connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
95
95
  | adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
96
96
  | timeout | `Float` | The value to use for connection timeout. <br> **Default: 60** |
@@ -100,8 +100,8 @@ The following parameters are configurable for the API Client:
100
100
  | retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
101
101
  | retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
102
102
  | http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
103
- | proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.1.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
104
- | client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.1.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant |
103
+ | proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.2.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
104
+ | client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.2.0/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant |
105
105
 
106
106
  The API client can be initialized as follows:
107
107
 
@@ -116,7 +116,7 @@ client = Client.new(
116
116
  o_auth_client_id: 'OAuthClientId',
117
117
  o_auth_client_secret: 'OAuthClientSecret'
118
118
  ),
119
- environment: Environment::PRODUCTION
119
+ environment: Environment::SIT
120
120
  )
121
121
  ```
122
122
 
@@ -130,7 +130,7 @@ include ShellEv
130
130
  client = Client.from_env
131
131
  ```
132
132
 
133
- See the [`Environment-Based Client Initialization`](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.1.0/doc/environment-based-client-initialization.md) section for details.
133
+ See the [`Environment-Based Client Initialization`](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.2.0/doc/environment-based-client-initialization.md) section for details.
134
134
 
135
135
  ## Environments
136
136
 
@@ -140,34 +140,34 @@ The SDK can be configured to use a different environment for making API calls. A
140
140
 
141
141
  | Name | Description |
142
142
  | --- | --- |
143
- | PRODUCTION | **Default** Production Server |
144
- | ENVIRONMENT2 | Test Server |
143
+ | SIT | **Default** |
144
+ | PRODUCTION | - |
145
145
 
146
146
  ## Authorization
147
147
 
148
148
  This API uses the following authentication schemes.
149
149
 
150
- * [`BearerAuth (OAuth 2 Client Credentials Grant)`](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.1.0/doc/auth/oauth-2-client-credentials-grant.md)
150
+ * [`BearerAuth (OAuth 2 Client Credentials Grant)`](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.2.0/doc/auth/oauth-2-client-credentials-grant.md)
151
151
 
152
152
  ## List of APIs
153
153
 
154
- * [Locations](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.1.0/doc/controllers/locations.md)
155
- * [Charging](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.1.0/doc/controllers/charging.md)
154
+ * [Locations](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.2.0/doc/controllers/locations.md)
155
+ * [Charging](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.2.0/doc/controllers/charging.md)
156
156
 
157
157
  ## SDK Infrastructure
158
158
 
159
159
  ### Configuration
160
160
 
161
- * [ProxySettings](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.1.0/doc/proxy-settings.md)
162
- * [Environment-Based Client Initialization](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.1.0/doc/environment-based-client-initialization.md)
161
+ * [ProxySettings](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.2.0/doc/proxy-settings.md)
162
+ * [Environment-Based Client Initialization](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.2.0/doc/environment-based-client-initialization.md)
163
163
 
164
164
  ### HTTP
165
165
 
166
- * [HttpResponse](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.1.0/doc/http-response.md)
167
- * [HttpRequest](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.1.0/doc/http-request.md)
166
+ * [HttpResponse](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.2.0/doc/http-response.md)
167
+ * [HttpRequest](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.2.0/doc/http-request.md)
168
168
 
169
169
  ### Utilities
170
170
 
171
- * [ApiHelper](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.1.0/doc/api-helper.md)
172
- * [DateTimeHelper](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.1.0/doc/date-time-helper.md)
171
+ * [ApiHelper](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.2.0/doc/api-helper.md)
172
+ * [DateTimeHelper](https://www.github.com/sdks-io/ev-recharge-ruby-sdk/tree/2.2.0/doc/date-time-helper.md)
173
173
 
@@ -41,7 +41,7 @@ module ShellEv
41
41
  max_retries: 0, retry_interval: 1, backoff_factor: 2,
42
42
  retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
43
43
  retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
44
- environment: Environment::PRODUCTION, o_auth_client_id: nil,
44
+ environment: Environment::SIT, o_auth_client_id: nil,
45
45
  o_auth_client_secret: nil, o_auth_token: nil,
46
46
  client_credentials_auth_credentials: nil, config: nil
47
47
  )
@@ -6,21 +6,19 @@
6
6
  module ShellEv
7
7
  # An enum for SDK environments.
8
8
  class Environment
9
- # PRODUCTION: Production Server
10
- # ENVIRONMENT2: Test Server
11
9
  ENVIRONMENT = [
12
- PRODUCTION = 'production'.freeze,
13
- ENVIRONMENT2 = 'environment2'.freeze
10
+ SIT = 'SIT'.freeze,
11
+ PRODUCTION = 'Production'.freeze
14
12
  ].freeze
15
13
 
16
14
  # Converts a string or symbol into a valid Environment constant.
17
- def self.from_value(value, default_value = PRODUCTION)
15
+ def self.from_value(value, default_value = SIT)
18
16
  return default_value if value.nil?
19
17
 
20
18
  str = value.to_s.strip.downcase
21
19
  case str
20
+ when 'sit' then SIT
22
21
  when 'production' then PRODUCTION
23
- when 'environment2' then ENVIRONMENT2
24
22
 
25
23
  else
26
24
  warn "[Environment] Unknown environment '#{value}', falling back to #{default_value} "
@@ -32,18 +30,18 @@ module ShellEv
32
30
  # An enum for API servers.
33
31
  class Server
34
32
  SERVER = [
35
- DEFAULT = 'default'.freeze,
36
- ACCESS_TOKEN_SERVER = 'access token server'.freeze
33
+ OAUTH_SERVER = 'OAuth Server'.freeze,
34
+ SHELL = 'Shell'.freeze
37
35
  ].freeze
38
36
 
39
37
  # Converts a string or symbol into a valid Server constant.
40
- def self.from_value(value, default_value = DEFAULT)
38
+ def self.from_value(value, default_value = OAUTH_SERVER)
41
39
  return default_value if value.nil?
42
40
 
43
41
  str = value.to_s.strip.downcase
44
42
  case str
45
- when 'default' then DEFAULT
46
- when 'access_token_server' then ACCESS_TOKEN_SERVER
43
+ when 'oauth_server' then OAUTH_SERVER
44
+ when 'shell' then SHELL
47
45
 
48
46
  else
49
47
  warn "[Server] Unknown server '#{value}', falling back to #{default_value} "
@@ -79,7 +77,7 @@ module ShellEv
79
77
  max_retries: 0, retry_interval: 1, backoff_factor: 2,
80
78
  retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
81
79
  retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
82
- environment: Environment::PRODUCTION, o_auth_client_id: nil,
80
+ environment: Environment::SIT, o_auth_client_id: nil,
83
81
  o_auth_client_secret: nil, o_auth_token: nil,
84
82
  client_credentials_auth_credentials: nil
85
83
  )
@@ -174,13 +172,13 @@ module ShellEv
174
172
 
175
173
  # All the environments the SDK can run in.
176
174
  ENVIRONMENTS = {
177
- Environment::PRODUCTION => {
178
- Server::DEFAULT => 'https://api.shell.com/ev',
179
- Server::ACCESS_TOKEN_SERVER => 'https://api.shell.com/v2/oauth'
175
+ Environment::SIT => {
176
+ Server::OAUTH_SERVER => 'https://api-test.shell.com',
177
+ Server::SHELL => 'https://api-test.shell.com/ev'
180
178
  },
181
- Environment::ENVIRONMENT2 => {
182
- Server::DEFAULT => 'https://api-test.shell.com/ev',
183
- Server::ACCESS_TOKEN_SERVER => 'https://api.shell.com/v2/oauth'
179
+ Environment::PRODUCTION => {
180
+ Server::OAUTH_SERVER => 'https://api.shell.com',
181
+ Server::SHELL => 'https://api.shell.com/ev'
184
182
  }
185
183
  }.freeze
186
184
 
@@ -188,14 +186,14 @@ module ShellEv
188
186
  # @param [Configuration::Server] server The server enum for which the base URI is
189
187
  # required.
190
188
  # @return [String] The base URI.
191
- def get_base_uri(server = Server::DEFAULT)
189
+ def get_base_uri(server = Server::SHELL)
192
190
  ENVIRONMENTS[environment][server].clone
193
191
  end
194
192
 
195
193
  # Builds a Configuration instance using environment variables.
196
194
  def self.build_default_config_from_env
197
195
  # === Core environment ===
198
- environment = Environment.from_value(ENV.fetch('ENVIRONMENT', 'production'))
196
+ environment = Environment.from_value(ENV.fetch('ENVIRONMENT', 'sit'))
199
197
  timeout = (ENV['TIMEOUT'] || 60).to_f
200
198
  max_retries = (ENV['MAX_RETRIES'] || 0).to_i
201
199
  retry_interval = (ENV['RETRY_INTERVAL'] || 1).to_f
@@ -22,7 +22,7 @@ module ShellEv
22
22
  @api_call
23
23
  .request(new_request_builder(HttpMethodEnum::POST,
24
24
  '/v2/charge-session/start',
25
- Server::DEFAULT)
25
+ Server::SHELL)
26
26
  .header_param(new_parameter(request_id, key: 'RequestId'))
27
27
  .header_param(new_parameter('application/json', key: 'Content-Type'))
28
28
  .body_param(new_parameter(body))
@@ -73,7 +73,7 @@ module ShellEv
73
73
  @api_call
74
74
  .request(new_request_builder(HttpMethodEnum::POST,
75
75
  '/v2/charge-session/stop',
76
- Server::DEFAULT)
76
+ Server::SHELL)
77
77
  .header_param(new_parameter(request_id, key: 'RequestId'))
78
78
  .query_param(new_parameter(session_id, key: 'sessionId'))
79
79
  .header_param(new_parameter('application/json', key: 'accept'))
@@ -121,7 +121,7 @@ module ShellEv
121
121
  @api_call
122
122
  .request(new_request_builder(HttpMethodEnum::GET,
123
123
  '/v2/charge-session/retrieve',
124
- Server::DEFAULT)
124
+ Server::SHELL)
125
125
  .header_param(new_parameter(request_id, key: 'RequestId'))
126
126
  .query_param(new_parameter(session_id, key: 'sessionId'))
127
127
  .header_param(new_parameter('application/json', key: 'accept'))
@@ -170,7 +170,7 @@ module ShellEv
170
170
  @api_call
171
171
  .request(new_request_builder(HttpMethodEnum::GET,
172
172
  '/v2/charge-session/active',
173
- Server::DEFAULT)
173
+ Server::SHELL)
174
174
  .header_param(new_parameter(request_id, key: 'RequestId'))
175
175
  .query_param(new_parameter(ema_id, key: 'emaId'))
176
176
  .header_param(new_parameter('application/json', key: 'accept'))
@@ -75,7 +75,7 @@ module ShellEv
75
75
  @api_call
76
76
  .request(new_request_builder(HttpMethodEnum::GET,
77
77
  '/v2/locations',
78
- Server::DEFAULT)
78
+ Server::SHELL)
79
79
  .header_param(new_parameter(request_id, key: 'RequestId'))
80
80
  .query_param(new_parameter(evse_status, key: 'evseStatus'))
81
81
  .query_param(new_parameter(connector_types, key: 'connectorTypes'))
@@ -145,7 +145,7 @@ module ShellEv
145
145
  @api_call
146
146
  .request(new_request_builder(HttpMethodEnum::GET,
147
147
  '/v2/locations/{id}',
148
- Server::DEFAULT)
148
+ Server::SHELL)
149
149
  .header_param(new_parameter(request_id, key: 'RequestId'))
150
150
  .template_param(new_parameter(id, key: 'id')
151
151
  .should_encode(true))
@@ -257,7 +257,7 @@ module ShellEv
257
257
  @api_call
258
258
  .request(new_request_builder(HttpMethodEnum::GET,
259
259
  '/v2/locations/nearby',
260
- Server::DEFAULT)
260
+ Server::SHELL)
261
261
  .header_param(new_parameter(request_id, key: 'RequestId'))
262
262
  .query_param(new_parameter(latitude, key: 'latitude'))
263
263
  .query_param(new_parameter(longitude, key: 'longitude'))
@@ -382,7 +382,7 @@ module ShellEv
382
382
  @api_call
383
383
  .request(new_request_builder(HttpMethodEnum::GET,
384
384
  '/v2/locations/markers',
385
- Server::DEFAULT)
385
+ Server::SHELL)
386
386
  .header_param(new_parameter(request_id, key: 'RequestId'))
387
387
  .query_param(new_parameter(west, key: 'west'))
388
388
  .query_param(new_parameter(south, key: 'south'))
@@ -19,8 +19,8 @@ module ShellEv
19
19
  _field_parameters: nil)
20
20
  @api_call
21
21
  .request(new_request_builder(HttpMethodEnum::POST,
22
- '/token',
23
- Server::ACCESS_TOKEN_SERVER)
22
+ '/v2/oauth/token',
23
+ Server::OAUTH_SERVER)
24
24
  .form_param(new_parameter('client_credentials', key: 'grant_type'))
25
25
  .header_param(new_parameter(authorization, key: 'Authorization'))
26
26
  .form_param(new_parameter(scope, key: 'scope'))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ev-recharge-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - developer sdksio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-15 00:00:00.000000000 Z
11
+ date: 2026-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apimatic_core_interfaces