ev-recharge-sdk 1.0.0 → 1.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 +4 -4
- data/README.md +38 -21
- data/lib/shell_ev/client.rb +12 -8
- data/lib/shell_ev/configuration.rb +70 -19
- data/lib/shell_ev/controllers/base_controller.rb +9 -9
- data/lib/shell_ev/controllers/charging_controller.rb +121 -154
- data/lib/shell_ev/controllers/locations_controller.rb +226 -142
- data/lib/shell_ev/controllers/o_auth_authorization_controller.rb +8 -8
- data/lib/shell_ev/exceptions/bad_request_exception.rb +33 -18
- data/lib/shell_ev/exceptions/{m405_error_response_error1_exception.rb → internal_server_error_exception.rb} +31 -26
- data/lib/shell_ev/exceptions/not_found_exception.rb +36 -19
- data/lib/shell_ev/exceptions/o_auth_provider_exception.rb +15 -15
- data/lib/shell_ev/exceptions/{m400_error_response_error1_exception.rb → serviceunavailable_exception.rb} +28 -28
- data/lib/shell_ev/exceptions/{m401_error_response_error1_exception.rb → too_many_requests_exception.rb} +28 -28
- data/lib/shell_ev/exceptions/unauthorized_exception.rb +32 -18
- data/lib/shell_ev/http/auth/o_auth2.rb +54 -10
- data/lib/shell_ev/models/accessibility.rb +1 -2
- data/lib/shell_ev/models/active_response200_json.rb +11 -13
- data/lib/shell_ev/models/address.rb +1 -3
- data/lib/shell_ev/models/bad_request_err_msg.rb +82 -0
- data/lib/shell_ev/models/{stop_charge_session_request_body_json.rb → charge_error.rb} +21 -10
- data/lib/shell_ev/models/charge_retrieve_state.rb +63 -0
- data/lib/shell_ev/models/chargesession_start_body.rb +7 -9
- data/lib/shell_ev/models/connector_vo.rb +4 -9
- data/lib/shell_ev/models/coordinates.rb +1 -2
- data/lib/shell_ev/models/data_active.rb +27 -45
- data/lib/shell_ev/models/data_retrieve.rb +31 -49
- data/lib/shell_ev/models/electrical_properties.rb +1 -3
- data/lib/shell_ev/models/evse_vo.rb +3 -8
- data/lib/shell_ev/models/get_charge_session_retrieve_response200_json.rb +11 -13
- data/lib/shell_ev/models/{get_markers_list_authorization_methods_enum.rb → get_ev_locations_authorization_methods_enum.rb} +4 -4
- data/lib/shell_ev/models/{get_markers_list_connector_types_enum.rb → get_ev_locations_connector_types_enum.rb} +4 -4
- data/lib/shell_ev/models/{get_markers_list_evse_status_enum.rb → get_ev_locations_evse_status_enum.rb} +4 -4
- data/lib/shell_ev/models/inline_response202.rb +9 -11
- data/lib/shell_ev/models/inline_response2021.rb +5 -6
- data/lib/shell_ev/models/inline_response202_data.rb +7 -5
- data/lib/shell_ev/models/internal_error_object.rb +70 -0
- data/lib/shell_ev/models/location_respone_object.rb +4 -11
- data/lib/shell_ev/models/{get_locations_list_authorization_methods_enum.rb → locations_markers_authorization_methods_enum.rb} +4 -4
- data/lib/shell_ev/models/{get_locations_list_connector_types_enum.rb → locations_markers_connector_types_enum.rb} +4 -4
- data/lib/shell_ev/models/{get_locations_list_evse_status_enum.rb → locations_markers_evse_status_enum.rb} +4 -4
- data/lib/shell_ev/models/multi_location_marker.rb +2 -6
- data/lib/shell_ev/models/{get_nearby_locations_authorization_methods_enum.rb → nearby_locations_authorization_methods_enum.rb} +4 -4
- data/lib/shell_ev/models/{get_nearby_locations_connector_types_enum.rb → nearby_locations_connector_types_enum.rb} +4 -4
- data/lib/shell_ev/models/{get_nearby_locations_evse_status_enum.rb → nearby_locations_evse_status_enum.rb} +4 -4
- data/lib/shell_ev/models/not_found_err_msg.rb +82 -0
- data/lib/shell_ev/models/o_auth_token.rb +2 -6
- data/lib/shell_ev/models/opening_hours_object.rb +1 -3
- data/lib/shell_ev/models/ratelimit_err_msg.rb +82 -0
- data/lib/shell_ev/models/response.rb +78 -0
- data/lib/shell_ev/models/serviceunavailable_err_msg.rb +82 -0
- data/lib/shell_ev/models/single_location_marker.rb +5 -11
- data/lib/shell_ev/models/single_location_marker_authorization_methods_items_enum.rb +1 -1
- data/lib/shell_ev/models/single_location_marker_response.rb +81 -0
- data/lib/shell_ev/models/tariff_vo.rb +3 -7
- data/lib/shell_ev/models/unauthorized_err_msg.rb +82 -0
- data/lib/shell_ev/utilities/file_wrapper.rb +9 -9
- data/lib/shell_ev/utilities/union_type_lookup.rb +3 -2
- data/lib/shell_ev.rb +40 -60
- data/test/controllers/controller_test_base.rb +0 -5
- data/test/controllers/test_charging_controller.rb +74 -17
- data/test/controllers/test_locations_controller.rb +65 -0
- metadata +31 -49
- data/lib/shell_ev/exceptions/http401_error_response_exception.rb +0 -52
- data/lib/shell_ev/exceptions/m404_error_response_error1_exception.rb +0 -53
- data/lib/shell_ev/exceptions/m429_error_response_error1_exception.rb +0 -52
- data/lib/shell_ev/exceptions/m500_error_response_error1_exception.rb +0 -52
- data/lib/shell_ev/exceptions/m503_error_response_error1_exception.rb +0 -52
- data/lib/shell_ev/models/data_active_session_code_enum.rb +0 -44
- data/lib/shell_ev/models/data_active_session_state_enum.rb +0 -35
- data/lib/shell_ev/models/data_retrieve_session_code_enum.rb +0 -44
- data/lib/shell_ev/models/data_retrieve_session_state_enum.rb +0 -35
- data/lib/shell_ev/models/env_enum.rb +0 -23
- data/lib/shell_ev/models/m400_error_response.rb +0 -78
- data/lib/shell_ev/models/m400_error_response_error.rb +0 -80
- data/lib/shell_ev/models/m401_error_response.rb +0 -78
- data/lib/shell_ev/models/m401_error_response_error.rb +0 -80
- data/lib/shell_ev/models/m404_error_response.rb +0 -79
- data/lib/shell_ev/models/m404_error_response_error.rb +0 -80
- data/lib/shell_ev/models/m405_error_response.rb +0 -78
- data/lib/shell_ev/models/m405_error_response_error.rb +0 -80
- data/lib/shell_ev/models/m429_error_response.rb +0 -78
- data/lib/shell_ev/models/m429_error_response_error.rb +0 -80
- data/lib/shell_ev/models/m500_error_response.rb +0 -78
- data/lib/shell_ev/models/m500_error_response_error.rb +0 -80
- data/lib/shell_ev/models/m503_error_response.rb +0 -78
- data/lib/shell_ev/models/m503_error_response_error.rb +0 -80
- data/lib/shell_ev/models/response_base_status_enum.rb +0 -26
- data/lib/shell_ev/models/response_error401_all_of1.rb +0 -57
- data/lib/shell_ev/models/response_error401_all_of1_errors_items.rb +0 -80
- data/lib/shell_ev/models/success_response.rb +0 -58
@@ -6,18 +6,18 @@
|
|
6
6
|
module ShellEv
|
7
7
|
# ChargingController
|
8
8
|
class ChargingController < BaseController
|
9
|
-
# This
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
9
|
+
# This endpoint start the charging session for the user.
|
10
|
+
# @param [UUID | String] request_id Required parameter: RequestId must be
|
11
|
+
# unique identifier value that can be used by the consumer to correlate each
|
12
|
+
# request /response .<br>Format.<br> Its canonical textual representation,
|
13
|
+
# the 16 octets of a UUID are represented as 32 hexadecimal (base-16)
|
14
|
+
# digits, displayed in five groups separated by hyphens, in the form
|
15
|
+
# 8-4-4-4-12 for a total of 36 characters (32 hexadecimal characters and 4
|
16
|
+
# hyphens) <br>
|
17
17
|
# @param [ChargesessionStartBody] body Optional parameter: Example:
|
18
18
|
# @return [InlineResponse202] response from the API call
|
19
|
-
def
|
20
|
-
|
19
|
+
def start(request_id,
|
20
|
+
body: nil)
|
21
21
|
new_api_call_builder
|
22
22
|
.request(new_request_builder(HttpMethodEnum::POST,
|
23
23
|
'/ev/v1/charge-session/start',
|
@@ -29,187 +29,154 @@ module ShellEv
|
|
29
29
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
30
30
|
.auth(Single.new('BearerAuth')))
|
31
31
|
.response(new_response_handler
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
' retries are completed',
|
57
|
-
M503ErrorResponseError1Exception))
|
32
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
33
|
+
.deserialize_into(InlineResponse202.method(:from_hash))
|
34
|
+
.local_error('400',
|
35
|
+
'The server cannot or will not process the request due to'\
|
36
|
+
' something that is perceived to be a client error (e.g.,'\
|
37
|
+
' malformed request syntax, invalid request message framing, or'\
|
38
|
+
' deceptive request routing).',
|
39
|
+
BadRequestException)
|
40
|
+
.local_error('401',
|
41
|
+
'The request has not been applied because it lacks valid'\
|
42
|
+
' authentication credentials for the target resource.',
|
43
|
+
UnauthorizedException)
|
44
|
+
.local_error('404',
|
45
|
+
'Location Not Found',
|
46
|
+
NotFoundException)
|
47
|
+
.local_error('429',
|
48
|
+
'The Request reached maximum allocated rate limit',
|
49
|
+
TooManyRequestsException)
|
50
|
+
.local_error('500',
|
51
|
+
'Internal Server error',
|
52
|
+
InternalServerErrorException)
|
53
|
+
.local_error('503',
|
54
|
+
'Service unavailable',
|
55
|
+
ServiceunavailableException))
|
58
56
|
.execute
|
59
57
|
end
|
60
58
|
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
# @param [
|
71
|
-
# Example:
|
59
|
+
# Accepts a request to stop an active session when a valid session id is
|
60
|
+
# provided.
|
61
|
+
# @param [UUID | String] request_id Required parameter: RequestId must be
|
62
|
+
# unique identifier value that can be used by the consumer to correlate each
|
63
|
+
# request /response .<br>Format.<br> Its canonical textual representation,
|
64
|
+
# the 16 octets of a UUID are represented as 32 hexadecimal (base-16)
|
65
|
+
# digits, displayed in five groups separated by hyphens, in the form
|
66
|
+
# 8-4-4-4-12 for a total of 36 characters (32 hexadecimal characters and 4
|
67
|
+
# hyphens) <br>
|
68
|
+
# @param [String] session_id Required parameter: Session Id
|
72
69
|
# @return [InlineResponse2021] response from the API call
|
73
|
-
def
|
74
|
-
|
75
|
-
body: nil)
|
70
|
+
def stop(request_id,
|
71
|
+
session_id)
|
76
72
|
new_api_call_builder
|
77
73
|
.request(new_request_builder(HttpMethodEnum::POST,
|
78
|
-
'/ev/v1/charge-session/stop
|
74
|
+
'/ev/v1/charge-session/stop',
|
79
75
|
Server::DEFAULT)
|
80
76
|
.header_param(new_parameter(request_id, key: 'RequestId'))
|
81
|
-
.
|
82
|
-
.should_encode(true))
|
83
|
-
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
84
|
-
.body_param(new_parameter(body))
|
77
|
+
.query_param(new_parameter(session_id, key: 'sessionId'))
|
85
78
|
.header_param(new_parameter('application/json', key: 'accept'))
|
86
|
-
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
87
79
|
.auth(Single.new('BearerAuth')))
|
88
80
|
.response(new_response_handler
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
' retries are completed\n",
|
114
|
-
M503ErrorResponseError1Exception))
|
81
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
82
|
+
.deserialize_into(InlineResponse2021.method(:from_hash))
|
83
|
+
.local_error('400',
|
84
|
+
'The server cannot or will not process the request due to'\
|
85
|
+
' something that is perceived to be a client error (e.g.,'\
|
86
|
+
' malformed request syntax, invalid request message framing, or'\
|
87
|
+
' deceptive request routing).',
|
88
|
+
BadRequestException)
|
89
|
+
.local_error('401',
|
90
|
+
'The request has not been applied because it lacks valid'\
|
91
|
+
' authentication credentials for the target resource.',
|
92
|
+
UnauthorizedException)
|
93
|
+
.local_error('404',
|
94
|
+
'Location Not Found',
|
95
|
+
NotFoundException)
|
96
|
+
.local_error('429',
|
97
|
+
'The Request reached maximum allocated rate limit',
|
98
|
+
TooManyRequestsException)
|
99
|
+
.local_error('500',
|
100
|
+
'Internal Server error',
|
101
|
+
InternalServerErrorException)
|
102
|
+
.local_error('503',
|
103
|
+
'Service unavailable',
|
104
|
+
ServiceunavailableException))
|
115
105
|
.execute
|
116
106
|
end
|
117
107
|
|
118
|
-
# This
|
119
|
-
#
|
120
|
-
#
|
121
|
-
#
|
122
|
-
#
|
123
|
-
#
|
124
|
-
#
|
125
|
-
#
|
126
|
-
# @param [
|
127
|
-
# was generated to activate a charging session.
|
108
|
+
# This endpoint returns the details of the session if the session is found.
|
109
|
+
# @param [UUID | String] request_id Required parameter: RequestId must be
|
110
|
+
# unique identifier value that can be used by the consumer to correlate each
|
111
|
+
# request /response .<br>Format.<br> Its canonical textual representation,
|
112
|
+
# the 16 octets of a UUID are represented as 32 hexadecimal (base-16)
|
113
|
+
# digits, displayed in five groups separated by hyphens, in the form
|
114
|
+
# 8-4-4-4-12 for a total of 36 characters (32 hexadecimal characters and 4
|
115
|
+
# hyphens) <br>
|
116
|
+
# @param [String] session_id Required parameter: Session Id
|
128
117
|
# @return [GetChargeSessionRetrieveResponse200Json] response from the API call
|
129
118
|
def get_charge_session_retrieve(request_id,
|
130
|
-
session_id
|
131
|
-
uuid)
|
119
|
+
session_id)
|
132
120
|
new_api_call_builder
|
133
121
|
.request(new_request_builder(HttpMethodEnum::GET,
|
134
|
-
'/ev/v1/charge-session/retrieve
|
122
|
+
'/ev/v1/charge-session/retrieve',
|
135
123
|
Server::DEFAULT)
|
136
124
|
.header_param(new_parameter(request_id, key: 'RequestId'))
|
137
|
-
.query_param(new_parameter(session_id, key: '
|
138
|
-
.template_param(new_parameter(uuid, key: 'uuid')
|
139
|
-
.should_encode(true))
|
125
|
+
.query_param(new_parameter(session_id, key: 'sessionId'))
|
140
126
|
.header_param(new_parameter('application/json', key: 'accept'))
|
141
127
|
.auth(Single.new('BearerAuth')))
|
142
128
|
.response(new_response_handler
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
129
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
130
|
+
.deserialize_into(GetChargeSessionRetrieveResponse200Json.method(:from_hash))
|
131
|
+
.local_error('400',
|
132
|
+
'The server cannot or will not process the request due to'\
|
133
|
+
' something that is perceived to be a client error (e.g.,'\
|
134
|
+
' malformed request syntax, invalid request message framing, or'\
|
135
|
+
' deceptive request routing).',
|
136
|
+
BadRequestException)
|
137
|
+
.local_error('401',
|
138
|
+
'The request has not been applied because it lacks valid'\
|
139
|
+
' authentication credentials for the target resource.',
|
140
|
+
UnauthorizedException)
|
141
|
+
.local_error('404',
|
142
|
+
'Location Not Found',
|
143
|
+
NotFoundException)
|
144
|
+
.local_error('429',
|
145
|
+
'The Request reached maximum allocated rate limit',
|
146
|
+
TooManyRequestsException)
|
147
|
+
.local_error('500',
|
148
|
+
'Internal Server error',
|
149
|
+
InternalServerErrorException)
|
150
|
+
.local_error('503',
|
151
|
+
'Service unavailable',
|
152
|
+
ServiceunavailableException))
|
166
153
|
.execute
|
167
154
|
end
|
168
155
|
|
169
|
-
#
|
156
|
+
# Fetrches the active sessions for user.
|
157
|
+
# @param [UUID | String] request_id Required parameter: RequestId must be
|
158
|
+
# unique identifier value that can be used by the consumer to correlate each
|
159
|
+
# request /response .<br>Format.<br> Its canonical textual representation,
|
160
|
+
# the 16 octets of a UUID are represented as 32 hexadecimal (base-16)
|
161
|
+
# digits, displayed in five groups separated by hyphens, in the form
|
162
|
+
# 8-4-4-4-12 for a total of 36 characters (32 hexadecimal characters and 4
|
163
|
+
# hyphens) <br>
|
170
164
|
# @param [String] ema_id Required parameter: Emobility Account
|
171
165
|
# Identifier(Ema-ID)
|
172
|
-
# @param [UUID | String] request_id Required parameter: A unique request id
|
173
|
-
# in GUID format. The value is written to the Shell API Platform audit log
|
174
|
-
# for end to end traceability of a request.
|
175
166
|
# @return [ActiveResponse200Json] response from the API call
|
176
|
-
def active(
|
177
|
-
|
167
|
+
def active(request_id,
|
168
|
+
ema_id)
|
178
169
|
new_api_call_builder
|
179
170
|
.request(new_request_builder(HttpMethodEnum::GET,
|
180
171
|
'/ev/v1/charge-session/active',
|
181
172
|
Server::DEFAULT)
|
182
|
-
.query_param(new_parameter(ema_id, key: 'EmaId'))
|
183
173
|
.header_param(new_parameter(request_id, key: 'RequestId'))
|
174
|
+
.query_param(new_parameter(ema_id, key: 'emaId'))
|
184
175
|
.header_param(new_parameter('application/json', key: 'accept'))
|
185
176
|
.auth(Single.new('BearerAuth')))
|
186
177
|
.response(new_response_handler
|
187
|
-
|
188
|
-
|
189
|
-
.local_error('400',
|
190
|
-
"Bad Request\n",
|
191
|
-
M400ErrorResponseError1Exception)
|
192
|
-
.local_error('401',
|
193
|
-
'Unauthorized',
|
194
|
-
M401ErrorResponseError1Exception)
|
195
|
-
.local_error('404',
|
196
|
-
'Session not found or Session has already been stopped. Map 410'\
|
197
|
-
' Error message into 404.',
|
198
|
-
M404ErrorResponseError1Exception)
|
199
|
-
.local_error('405',
|
200
|
-
'Method Not Allowed',
|
201
|
-
M405ErrorResponseError1Exception)
|
202
|
-
.local_error('429',
|
203
|
-
'Too Many Requests',
|
204
|
-
M429ErrorResponseError1Exception)
|
205
|
-
.local_error('500',
|
206
|
-
'Internal Server Error',
|
207
|
-
M500ErrorResponseError1Exception)
|
208
|
-
.local_error('503',
|
209
|
-
"Returned when a connectivity failure is encountered like DB'\
|
210
|
-
' connection failed, endpoint failed etc or when max number of'\
|
211
|
-
' retries are completed\n",
|
212
|
-
M503ErrorResponseError1Exception))
|
178
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
179
|
+
.deserialize_into(ActiveResponse200Json.method(:from_hash)))
|
213
180
|
.execute
|
214
181
|
end
|
215
182
|
end
|