ev-recharge-sdk 1.4.0 → 2.1.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/LICENSE +1 -1
- data/README.md +89 -25
- data/bin/console +15 -0
- data/lib/shell_ev/api_helper.rb +2 -2
- data/lib/shell_ev/client.rb +15 -4
- data/lib/shell_ev/configuration.rb +81 -9
- data/lib/shell_ev/controllers/base_controller.rb +3 -9
- data/lib/shell_ev/controllers/charging_controller.rb +19 -18
- data/lib/shell_ev/controllers/locations_controller.rb +48 -50
- data/lib/shell_ev/controllers/o_auth_authorization_controller.rb +4 -4
- data/lib/shell_ev/exceptions/api_exception.rb +2 -2
- data/lib/shell_ev/exceptions/bad_request_exception.rb +7 -5
- data/lib/shell_ev/exceptions/internal_server_error_exception.rb +7 -5
- data/lib/shell_ev/exceptions/not_found_exception.rb +7 -5
- data/lib/shell_ev/exceptions/o_auth_provider_exception.rb +7 -5
- data/lib/shell_ev/exceptions/serviceunavailable_exception.rb +7 -5
- data/lib/shell_ev/exceptions/too_many_requests_exception.rb +7 -5
- data/lib/shell_ev/exceptions/unauthorized_exception.rb +7 -5
- data/lib/shell_ev/exceptions/v2_charge_session_retrieve404_error_exception.rb +67 -0
- data/lib/shell_ev/exceptions/v2_charge_session_start404_error_exception.rb +67 -0
- data/lib/shell_ev/exceptions/v2_charge_session_stop404_error_exception.rb +67 -0
- data/lib/shell_ev/http/auth/o_auth2.rb +18 -3
- data/lib/shell_ev/http/http_call_back.rb +2 -2
- data/lib/shell_ev/http/http_method_enum.rb +2 -2
- data/lib/shell_ev/http/http_request.rb +2 -2
- data/lib/shell_ev/http/http_response.rb +2 -2
- data/lib/shell_ev/http/proxy_settings.rb +22 -0
- data/lib/shell_ev/models/accessibility_status_enum.rb +17 -2
- data/lib/shell_ev/models/{accessibility.rb → accessibility_v2.rb} +7 -16
- data/lib/shell_ev/models/active_response200_json.rb +2 -2
- data/lib/shell_ev/models/active_response200_json_status_enum.rb +15 -2
- data/lib/shell_ev/models/address.rb +2 -2
- data/lib/shell_ev/models/bad_request_err_msg.rb +2 -2
- data/lib/shell_ev/models/base_model.rb +2 -2
- data/lib/shell_ev/models/charge_error.rb +2 -2
- data/lib/shell_ev/models/charge_retrieve_state.rb +2 -2
- data/lib/shell_ev/models/chargesession_start_body.rb +2 -2
- data/lib/shell_ev/models/connector_types_enum.rb +100 -0
- data/lib/shell_ev/models/connector_v2.rb +95 -0
- data/lib/shell_ev/models/connector_vo_connector_type_enum.rb +31 -2
- data/lib/shell_ev/models/connector_vo_updated_by_enum.rb +17 -2
- data/lib/shell_ev/models/coordinates.rb +2 -2
- data/lib/shell_ev/models/coordinates1.rb +81 -0
- data/lib/shell_ev/models/data_active.rb +2 -2
- data/lib/shell_ev/models/data_retrieve.rb +2 -2
- data/lib/shell_ev/models/day_of_week_enum.rb +56 -0
- data/lib/shell_ev/models/electrical_properties_power_type_enum.rb +16 -2
- data/lib/shell_ev/models/{electrical_properties.rb → electrical_properties_v2.rb} +8 -8
- data/lib/shell_ev/models/evse_status_enum.rb +44 -0
- data/lib/shell_ev/models/{evse_vo.rb → evse_v2.rb} +33 -43
- data/lib/shell_ev/models/evse_vo_authorization_methods_enum.rb +16 -2
- data/lib/shell_ev/models/evse_vo_status_enum.rb +17 -2
- data/lib/shell_ev/models/get_charge_session_retrieve_response200_json.rb +2 -2
- data/lib/shell_ev/models/get_charge_session_retrieve_response200_json_status_enum.rb +15 -2
- data/lib/shell_ev/models/get_ev_locations_authorization_methods_enum.rb +16 -2
- data/lib/shell_ev/models/get_ev_locations_connector_types_enum.rb +31 -2
- data/lib/shell_ev/models/get_ev_locations_evse_status_enum.rb +17 -2
- data/lib/shell_ev/models/inline_response202.rb +4 -6
- data/lib/shell_ev/models/inline_response2021.rb +2 -2
- data/lib/shell_ev/models/inline_response2021_status_enum.rb +15 -2
- data/lib/shell_ev/models/inline_response202_data.rb +2 -2
- data/lib/shell_ev/models/inline_response202_status_enum.rb +15 -2
- data/lib/shell_ev/models/internal_error_object.rb +2 -2
- data/lib/shell_ev/models/{location_respone_object.rb → location_respone_object_v2.rb} +46 -34
- data/lib/shell_ev/models/locations_markers_authorization_methods_enum.rb +16 -2
- data/lib/shell_ev/models/locations_markers_connector_types_enum.rb +31 -2
- data/lib/shell_ev/models/locations_markers_evse_status_enum.rb +17 -2
- data/lib/shell_ev/models/multi_location_marker.rb +5 -5
- data/lib/shell_ev/models/multi_location_marker_v2.rb +126 -0
- data/lib/shell_ev/models/nearby_locations_authorization_methods_enum.rb +16 -2
- data/lib/shell_ev/models/nearby_locations_connector_types_enum.rb +31 -2
- data/lib/shell_ev/models/nearby_locations_evse_status_enum.rb +17 -2
- data/lib/shell_ev/models/not_found_err_msg.rb +2 -2
- data/lib/shell_ev/models/o_auth_provider_error_enum.rb +19 -2
- data/lib/shell_ev/models/o_auth_token.rb +2 -2
- data/lib/shell_ev/models/opening_hours_object.rb +3 -3
- data/lib/shell_ev/models/opening_hours_object_week_day_enum.rb +20 -2
- data/lib/shell_ev/models/power_range.rb +68 -0
- data/lib/shell_ev/models/price_component.rb +86 -0
- data/lib/shell_ev/models/ratelimit_err_msg.rb +2 -2
- data/lib/shell_ev/models/{response.rb → response_v2.rb} +9 -9
- data/lib/shell_ev/models/restrictions.rb +183 -0
- data/lib/shell_ev/models/search_by_id_connector.rb +115 -0
- data/lib/shell_ev/models/search_by_id_evse.rb +145 -0
- data/lib/shell_ev/models/search_by_id_location_respone.rb +196 -0
- data/lib/shell_ev/models/search_by_id_response.rb +91 -0
- data/lib/shell_ev/models/serviceunavailable_err_msg.rb +2 -2
- data/lib/shell_ev/models/single_location_marker.rb +8 -6
- data/lib/shell_ev/models/single_location_marker_authorization_methods_items_enum.rb +16 -2
- data/lib/shell_ev/models/single_location_marker_response.rb +2 -2
- data/lib/shell_ev/models/single_location_marker_response_v2.rb +94 -0
- data/lib/shell_ev/models/single_location_marker_status_enum.rb +17 -2
- data/lib/shell_ev/models/single_location_marker_v2.rb +157 -0
- data/lib/shell_ev/models/tariff.rb +3 -3
- data/lib/shell_ev/models/tariff_alt_text.rb +68 -0
- data/lib/shell_ev/models/tariff_element.rb +80 -0
- data/lib/shell_ev/models/tariff_type_enum.rb +44 -0
- data/lib/shell_ev/models/tariff_v2.rb +226 -0
- data/lib/shell_ev/models/tariff_vo_updated_by_enum.rb +17 -2
- data/lib/shell_ev/models/type_enum.rb +44 -0
- data/lib/shell_ev/models/unauthorized_err_msg.rb +2 -2
- data/lib/shell_ev/utilities/date_time_helper.rb +2 -2
- data/lib/shell_ev/utilities/file_wrapper.rb +2 -2
- data/lib/shell_ev/utilities/union_type_lookup.rb +19 -2
- data/lib/shell_ev.rb +34 -10
- data/test/controllers/controller_test_base.rb +5 -10
- data/test/controllers/test_charging_controller.rb +7 -11
- data/test/controllers/test_locations_controller.rb +8 -11
- data/test/http_response_catcher.rb +3 -3
- metadata +38 -15
- data/lib/shell_ev/models/connector_vo.rb +0 -149
- data/lib/shell_ev/models/tariff_vo.rb +0 -124
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# shell_ev
|
|
2
2
|
#
|
|
3
|
-
# This file was automatically generated by APIMATIC
|
|
4
|
-
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
5
|
|
|
6
6
|
module ShellEv
|
|
7
7
|
# Indicates overall status of the request
|
|
@@ -19,5 +19,18 @@ module ShellEv
|
|
|
19
19
|
|
|
20
20
|
INLINE_RESPONSE2021_STATUS_ENUM.include?(value)
|
|
21
21
|
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = SUCCESS)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'success' then SUCCESS
|
|
30
|
+
when 'failed' then FAILED
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
22
35
|
end
|
|
23
36
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# shell_ev
|
|
2
2
|
#
|
|
3
|
-
# This file was automatically generated by APIMATIC
|
|
4
|
-
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
5
|
|
|
6
6
|
module ShellEv
|
|
7
7
|
# Indicates overall status of the request
|
|
@@ -19,5 +19,18 @@ module ShellEv
|
|
|
19
19
|
|
|
20
20
|
INLINE_RESPONSE202_STATUS_ENUM.include?(value)
|
|
21
21
|
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = SUCCESS)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'success' then SUCCESS
|
|
30
|
+
when 'failed' then FAILED
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
22
35
|
end
|
|
23
36
|
end
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# shell_ev
|
|
2
2
|
#
|
|
3
|
-
# This file was automatically generated by APIMATIC
|
|
4
|
-
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
5
|
|
|
6
6
|
module ShellEv
|
|
7
|
-
#
|
|
8
|
-
class
|
|
7
|
+
# LocationResponeObjectV2 Model.
|
|
8
|
+
class LocationResponeObjectV2 < BaseModel
|
|
9
9
|
SKIP = Object.new
|
|
10
10
|
private_constant :SKIP
|
|
11
11
|
|
|
12
12
|
# Unique Internal identifier used to refer to this Location by Shell
|
|
13
13
|
# Recharge
|
|
14
|
-
# @return [
|
|
14
|
+
# @return [String]
|
|
15
15
|
attr_accessor :uid
|
|
16
16
|
|
|
17
17
|
# Identifier as given by the Shell Recharge Operator, unique for that
|
|
@@ -32,11 +32,11 @@ module ShellEv
|
|
|
32
32
|
attr_accessor :address
|
|
33
33
|
|
|
34
34
|
# Accessibility of the Location
|
|
35
|
-
# @return [
|
|
35
|
+
# @return [AccessibilityV2]
|
|
36
36
|
attr_accessor :accessibility
|
|
37
37
|
|
|
38
38
|
# Accessibility of the Location
|
|
39
|
-
# @return [Array[
|
|
39
|
+
# @return [Array[EvseV2]]
|
|
40
40
|
attr_accessor :evses
|
|
41
41
|
|
|
42
42
|
# Optional Opening Hours of the Location. Please note that it is not
|
|
@@ -48,14 +48,18 @@ module ShellEv
|
|
|
48
48
|
# @return [String]
|
|
49
49
|
attr_accessor :updated
|
|
50
50
|
|
|
51
|
-
# optional Operator-wide arbitrary text (eg promotional, warning)
|
|
52
|
-
# @return [String]
|
|
53
|
-
attr_accessor :operator_comment
|
|
54
|
-
|
|
55
51
|
# the type of the location. Could be "UNKNOWN".
|
|
56
52
|
# @return [String]
|
|
57
53
|
attr_accessor :location_type
|
|
58
54
|
|
|
55
|
+
# Unique Id of the operator
|
|
56
|
+
# @return [String]
|
|
57
|
+
attr_accessor :operator_id
|
|
58
|
+
|
|
59
|
+
# Whether the location is open 24/7
|
|
60
|
+
# @return [TrueClass | FalseClass]
|
|
61
|
+
attr_accessor :open_twenty_four_seven
|
|
62
|
+
|
|
59
63
|
# A mapping from model property names to API property names.
|
|
60
64
|
def self.names
|
|
61
65
|
@_hash = {} if @_hash.nil?
|
|
@@ -68,8 +72,9 @@ module ShellEv
|
|
|
68
72
|
@_hash['evses'] = 'evses'
|
|
69
73
|
@_hash['opening_hours'] = 'openingHours'
|
|
70
74
|
@_hash['updated'] = 'updated'
|
|
71
|
-
@_hash['operator_comment'] = 'operatorComment'
|
|
72
75
|
@_hash['location_type'] = 'locationType'
|
|
76
|
+
@_hash['operator_id'] = 'operatorId'
|
|
77
|
+
@_hash['open_twenty_four_seven'] = 'openTwentyFourSeven'
|
|
73
78
|
@_hash
|
|
74
79
|
end
|
|
75
80
|
|
|
@@ -85,8 +90,9 @@ module ShellEv
|
|
|
85
90
|
evses
|
|
86
91
|
opening_hours
|
|
87
92
|
updated
|
|
88
|
-
operator_comment
|
|
89
93
|
location_type
|
|
94
|
+
operator_id
|
|
95
|
+
open_twenty_four_seven
|
|
90
96
|
]
|
|
91
97
|
end
|
|
92
98
|
|
|
@@ -98,7 +104,8 @@ module ShellEv
|
|
|
98
104
|
def initialize(uid = SKIP, external_id = SKIP, coordinates = SKIP,
|
|
99
105
|
operator_name = SKIP, address = SKIP, accessibility = SKIP,
|
|
100
106
|
evses = SKIP, opening_hours = SKIP, updated = SKIP,
|
|
101
|
-
|
|
107
|
+
location_type = SKIP, operator_id = SKIP,
|
|
108
|
+
open_twenty_four_seven = SKIP)
|
|
102
109
|
@uid = uid unless uid == SKIP
|
|
103
110
|
@external_id = external_id unless external_id == SKIP
|
|
104
111
|
@coordinates = coordinates unless coordinates == SKIP
|
|
@@ -108,8 +115,9 @@ module ShellEv
|
|
|
108
115
|
@evses = evses unless evses == SKIP
|
|
109
116
|
@opening_hours = opening_hours unless opening_hours == SKIP
|
|
110
117
|
@updated = updated unless updated == SKIP
|
|
111
|
-
@operator_comment = operator_comment unless operator_comment == SKIP
|
|
112
118
|
@location_type = location_type unless location_type == SKIP
|
|
119
|
+
@operator_id = operator_id unless operator_id == SKIP
|
|
120
|
+
@open_twenty_four_seven = open_twenty_four_seven unless open_twenty_four_seven == SKIP
|
|
113
121
|
end
|
|
114
122
|
|
|
115
123
|
# Creates an instance of the object from a hash.
|
|
@@ -122,13 +130,13 @@ module ShellEv
|
|
|
122
130
|
coordinates = Coordinates.from_hash(hash['coordinates']) if hash['coordinates']
|
|
123
131
|
operator_name = hash.key?('operatorName') ? hash['operatorName'] : SKIP
|
|
124
132
|
address = Address.from_hash(hash['address']) if hash['address']
|
|
125
|
-
accessibility =
|
|
133
|
+
accessibility = AccessibilityV2.from_hash(hash['accessibility']) if hash['accessibility']
|
|
126
134
|
# Parameter is an array, so we need to iterate through it
|
|
127
135
|
evses = nil
|
|
128
136
|
unless hash['evses'].nil?
|
|
129
137
|
evses = []
|
|
130
138
|
hash['evses'].each do |structure|
|
|
131
|
-
evses << (
|
|
139
|
+
evses << (EvseV2.from_hash(structure) if structure)
|
|
132
140
|
end
|
|
133
141
|
end
|
|
134
142
|
|
|
@@ -144,22 +152,24 @@ module ShellEv
|
|
|
144
152
|
|
|
145
153
|
opening_hours = SKIP unless hash.key?('openingHours')
|
|
146
154
|
updated = hash.key?('updated') ? hash['updated'] : SKIP
|
|
147
|
-
operator_comment =
|
|
148
|
-
hash.key?('operatorComment') ? hash['operatorComment'] : SKIP
|
|
149
155
|
location_type = hash.key?('locationType') ? hash['locationType'] : SKIP
|
|
156
|
+
operator_id = hash.key?('operatorId') ? hash['operatorId'] : SKIP
|
|
157
|
+
open_twenty_four_seven =
|
|
158
|
+
hash.key?('openTwentyFourSeven') ? hash['openTwentyFourSeven'] : SKIP
|
|
150
159
|
|
|
151
160
|
# Create object from extracted values.
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
LocationResponeObjectV2.new(uid,
|
|
162
|
+
external_id,
|
|
163
|
+
coordinates,
|
|
164
|
+
operator_name,
|
|
165
|
+
address,
|
|
166
|
+
accessibility,
|
|
167
|
+
evses,
|
|
168
|
+
opening_hours,
|
|
169
|
+
updated,
|
|
170
|
+
location_type,
|
|
171
|
+
operator_id,
|
|
172
|
+
open_twenty_four_seven)
|
|
163
173
|
end
|
|
164
174
|
|
|
165
175
|
# Provides a human-readable string representation of the object.
|
|
@@ -167,8 +177,9 @@ module ShellEv
|
|
|
167
177
|
class_name = self.class.name.split('::').last
|
|
168
178
|
"<#{class_name} uid: #{@uid}, external_id: #{@external_id}, coordinates: #{@coordinates},"\
|
|
169
179
|
" operator_name: #{@operator_name}, address: #{@address}, accessibility: #{@accessibility},"\
|
|
170
|
-
" evses: #{@evses}, opening_hours: #{@opening_hours}, updated: #{@updated},"\
|
|
171
|
-
"
|
|
180
|
+
" evses: #{@evses}, opening_hours: #{@opening_hours}, updated: #{@updated}, location_type:"\
|
|
181
|
+
" #{@location_type}, operator_id: #{@operator_id}, open_twenty_four_seven:"\
|
|
182
|
+
" #{@open_twenty_four_seven}>"
|
|
172
183
|
end
|
|
173
184
|
|
|
174
185
|
# Provides a debugging-friendly string with detailed object information.
|
|
@@ -177,8 +188,9 @@ module ShellEv
|
|
|
177
188
|
"<#{class_name} uid: #{@uid.inspect}, external_id: #{@external_id.inspect}, coordinates:"\
|
|
178
189
|
" #{@coordinates.inspect}, operator_name: #{@operator_name.inspect}, address:"\
|
|
179
190
|
" #{@address.inspect}, accessibility: #{@accessibility.inspect}, evses: #{@evses.inspect},"\
|
|
180
|
-
" opening_hours: #{@opening_hours.inspect}, updated: #{@updated.inspect},
|
|
181
|
-
" #{@
|
|
191
|
+
" opening_hours: #{@opening_hours.inspect}, updated: #{@updated.inspect}, location_type:"\
|
|
192
|
+
" #{@location_type.inspect}, operator_id: #{@operator_id.inspect}, open_twenty_four_seven:"\
|
|
193
|
+
" #{@open_twenty_four_seven.inspect}>"
|
|
182
194
|
end
|
|
183
195
|
end
|
|
184
196
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# shell_ev
|
|
2
2
|
#
|
|
3
|
-
# This file was automatically generated by APIMATIC
|
|
4
|
-
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
5
|
|
|
6
6
|
module ShellEv
|
|
7
7
|
# Filter by Locations that support the given Authorization Methods
|
|
@@ -22,5 +22,19 @@ module ShellEv
|
|
|
22
22
|
|
|
23
23
|
LOCATIONS_MARKERS_AUTHORIZATION_METHODS_ENUM.include?(value)
|
|
24
24
|
end
|
|
25
|
+
|
|
26
|
+
def self.from_value(value, default_value = NEWMOTIONAPP)
|
|
27
|
+
return default_value if value.nil?
|
|
28
|
+
|
|
29
|
+
str = value.to_s.strip
|
|
30
|
+
|
|
31
|
+
case str.downcase
|
|
32
|
+
when 'newmotionapp' then NEWMOTIONAPP
|
|
33
|
+
when 'rfidtoken' then RFIDTOKEN
|
|
34
|
+
when 'pnc' then PNC
|
|
35
|
+
else
|
|
36
|
+
default_value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
25
39
|
end
|
|
26
40
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# shell_ev
|
|
2
2
|
#
|
|
3
|
-
# This file was automatically generated by APIMATIC
|
|
4
|
-
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
5
|
|
|
6
6
|
module ShellEv
|
|
7
7
|
# Filter by Locations that have Connectors with the set of Connector Types
|
|
@@ -67,5 +67,34 @@ module ShellEv
|
|
|
67
67
|
|
|
68
68
|
LOCATIONS_MARKERS_CONNECTOR_TYPES_ENUM.include?(value)
|
|
69
69
|
end
|
|
70
|
+
|
|
71
|
+
def self.from_value(value, default_value = AVCON)
|
|
72
|
+
return default_value if value.nil?
|
|
73
|
+
|
|
74
|
+
str = value.to_s.strip
|
|
75
|
+
|
|
76
|
+
case str.downcase
|
|
77
|
+
when 'avcon' then AVCON
|
|
78
|
+
when 'domestic' then DOMESTIC
|
|
79
|
+
when 'industrial2pdc' then INDUSTRIAL2PDC
|
|
80
|
+
when 'industrialpneac' then INDUSTRIALPNEAC
|
|
81
|
+
when 'industrial3peac' then INDUSTRIAL3PEAC
|
|
82
|
+
when 'industrial3penac' then INDUSTRIAL3PENAC
|
|
83
|
+
when 'type1' then TYPE1
|
|
84
|
+
when 'type1combo' then TYPE1COMBO
|
|
85
|
+
when 'type2' then TYPE2
|
|
86
|
+
when 'type2combo' then TYPE2COMBO
|
|
87
|
+
when 'type3' then TYPE3
|
|
88
|
+
when 'lpi' then LPI
|
|
89
|
+
when 'nema520' then NEMA520
|
|
90
|
+
when 'saej1772' then SAEJ1772
|
|
91
|
+
when 'spi' then SPI
|
|
92
|
+
when 'tepcochademo' then TEPCOCHADEMO
|
|
93
|
+
when 'tesla' then TESLA
|
|
94
|
+
when 'unspecified' then UNSPECIFIED
|
|
95
|
+
else
|
|
96
|
+
default_value
|
|
97
|
+
end
|
|
98
|
+
end
|
|
70
99
|
end
|
|
71
100
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# shell_ev
|
|
2
2
|
#
|
|
3
|
-
# This file was automatically generated by APIMATIC
|
|
4
|
-
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
5
|
|
|
6
6
|
module ShellEv
|
|
7
7
|
# Filter by Locations that have the given status
|
|
@@ -25,5 +25,20 @@ module ShellEv
|
|
|
25
25
|
|
|
26
26
|
LOCATIONS_MARKERS_EVSE_STATUS_ENUM.include?(value)
|
|
27
27
|
end
|
|
28
|
+
|
|
29
|
+
def self.from_value(value, default_value = AVAILABLE)
|
|
30
|
+
return default_value if value.nil?
|
|
31
|
+
|
|
32
|
+
str = value.to_s.strip
|
|
33
|
+
|
|
34
|
+
case str.downcase
|
|
35
|
+
when 'available' then AVAILABLE
|
|
36
|
+
when 'occupied' then OCCUPIED
|
|
37
|
+
when 'unavailable' then UNAVAILABLE
|
|
38
|
+
when 'unknown' then UNKNOWN
|
|
39
|
+
else
|
|
40
|
+
default_value
|
|
41
|
+
end
|
|
42
|
+
end
|
|
28
43
|
end
|
|
29
44
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# shell_ev
|
|
2
2
|
#
|
|
3
|
-
# This file was automatically generated by APIMATIC
|
|
4
|
-
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
5
|
|
|
6
6
|
module ShellEv
|
|
7
7
|
# A Marker is a place on the map that represent multiple Locations at the same
|
|
@@ -19,8 +19,8 @@ module ShellEv
|
|
|
19
19
|
# @return [String]
|
|
20
20
|
attr_accessor :unique_key
|
|
21
21
|
|
|
22
|
-
#
|
|
23
|
-
# @return [
|
|
22
|
+
# Uniquely identifies the marker object
|
|
23
|
+
# @return [Coordinates1]
|
|
24
24
|
attr_accessor :coordinates
|
|
25
25
|
|
|
26
26
|
# Number of Locations that this Marker represents in the given set of bounds
|
|
@@ -89,7 +89,7 @@ module ShellEv
|
|
|
89
89
|
# Extract variables from the hash.
|
|
90
90
|
marker_type = hash.key?('markerType') ? hash['markerType'] : nil
|
|
91
91
|
unique_key = hash.key?('uniqueKey') ? hash['uniqueKey'] : SKIP
|
|
92
|
-
coordinates =
|
|
92
|
+
coordinates = Coordinates1.from_hash(hash['coordinates']) if hash['coordinates']
|
|
93
93
|
location_count = hash.key?('locationCount') ? hash['locationCount'] : SKIP
|
|
94
94
|
evse_count = hash.key?('evseCount') ? hash['evseCount'] : SKIP
|
|
95
95
|
max_power = hash.key?('maxPower') ? hash['maxPower'] : SKIP
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# shell_ev
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ShellEv
|
|
7
|
+
# A Marker is a place on the map that represent multiple Locations at the same
|
|
8
|
+
# spot
|
|
9
|
+
class MultiLocationMarkerV2 < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# Coordinates of the Shell Recharge Site Location
|
|
14
|
+
# @return [Coordinates]
|
|
15
|
+
attr_accessor :coordinates
|
|
16
|
+
|
|
17
|
+
# Number of Locations that this Marker represents in the given set of bounds
|
|
18
|
+
# @return [Float]
|
|
19
|
+
attr_accessor :location_count
|
|
20
|
+
|
|
21
|
+
# Total number of Evses in Locations that this Marker represents
|
|
22
|
+
# @return [Float]
|
|
23
|
+
attr_accessor :evse_count
|
|
24
|
+
|
|
25
|
+
# Maximum power in kW across all locations grouped in this marker
|
|
26
|
+
# (disregarding availability)
|
|
27
|
+
# @return [Float]
|
|
28
|
+
attr_accessor :max_power
|
|
29
|
+
|
|
30
|
+
# Operator of this Shell Recharge Location
|
|
31
|
+
# @return [String]
|
|
32
|
+
attr_accessor :operator_name
|
|
33
|
+
|
|
34
|
+
# Type of the Marker, in this case it will always be MultiLocation
|
|
35
|
+
# @return [String]
|
|
36
|
+
attr_reader :marker_type
|
|
37
|
+
|
|
38
|
+
# A mapping from model property names to API property names.
|
|
39
|
+
def self.names
|
|
40
|
+
@_hash = {} if @_hash.nil?
|
|
41
|
+
@_hash['coordinates'] = 'coordinates'
|
|
42
|
+
@_hash['location_count'] = 'locationCount'
|
|
43
|
+
@_hash['evse_count'] = 'evseCount'
|
|
44
|
+
@_hash['max_power'] = 'maxPower'
|
|
45
|
+
@_hash['operator_name'] = 'operatorName'
|
|
46
|
+
@_hash['marker_type'] = 'markerType'
|
|
47
|
+
@_hash
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# An array for optional fields
|
|
51
|
+
def self.optionals
|
|
52
|
+
%w[
|
|
53
|
+
coordinates
|
|
54
|
+
location_count
|
|
55
|
+
evse_count
|
|
56
|
+
max_power
|
|
57
|
+
operator_name
|
|
58
|
+
]
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# An array for nullable fields
|
|
62
|
+
def self.nullables
|
|
63
|
+
[]
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def initialize(coordinates = SKIP, location_count = SKIP, evse_count = SKIP,
|
|
67
|
+
max_power = SKIP, operator_name = SKIP)
|
|
68
|
+
@coordinates = coordinates unless coordinates == SKIP
|
|
69
|
+
@location_count = location_count unless location_count == SKIP
|
|
70
|
+
@evse_count = evse_count unless evse_count == SKIP
|
|
71
|
+
@max_power = max_power unless max_power == SKIP
|
|
72
|
+
@operator_name = operator_name unless operator_name == SKIP
|
|
73
|
+
@marker_type = 'MultiLocation'
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Creates an instance of the object from a hash.
|
|
77
|
+
def self.from_hash(hash)
|
|
78
|
+
return nil unless hash
|
|
79
|
+
|
|
80
|
+
# Extract variables from the hash.
|
|
81
|
+
coordinates = Coordinates.from_hash(hash['coordinates']) if hash['coordinates']
|
|
82
|
+
location_count = hash.key?('locationCount') ? hash['locationCount'] : SKIP
|
|
83
|
+
evse_count = hash.key?('evseCount') ? hash['evseCount'] : SKIP
|
|
84
|
+
max_power = hash.key?('maxPower') ? hash['maxPower'] : SKIP
|
|
85
|
+
operator_name = hash.key?('operatorName') ? hash['operatorName'] : SKIP
|
|
86
|
+
|
|
87
|
+
# Create object from extracted values.
|
|
88
|
+
MultiLocationMarkerV2.new(coordinates,
|
|
89
|
+
location_count,
|
|
90
|
+
evse_count,
|
|
91
|
+
max_power,
|
|
92
|
+
operator_name)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Validates an instance of the object from a given value.
|
|
96
|
+
# @param [MultiLocationMarkerV2 | Hash] The value against the validation is performed.
|
|
97
|
+
def self.validate(value)
|
|
98
|
+
if value.instance_of? self
|
|
99
|
+
return APIHelper.valid_type?(value.marker_type,
|
|
100
|
+
->(val) { val.instance_of? String })
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
return false unless value.instance_of? Hash
|
|
104
|
+
|
|
105
|
+
APIHelper.valid_type?(value['markerType'],
|
|
106
|
+
->(val) { val.instance_of? String })
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Provides a human-readable string representation of the object.
|
|
110
|
+
def to_s
|
|
111
|
+
class_name = self.class.name.split('::').last
|
|
112
|
+
"<#{class_name} coordinates: #{@coordinates}, location_count: #{@location_count},"\
|
|
113
|
+
" evse_count: #{@evse_count}, max_power: #{@max_power}, operator_name: #{@operator_name},"\
|
|
114
|
+
" marker_type: #{@marker_type}>"
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
118
|
+
def inspect
|
|
119
|
+
class_name = self.class.name.split('::').last
|
|
120
|
+
"<#{class_name} coordinates: #{@coordinates.inspect}, location_count:"\
|
|
121
|
+
" #{@location_count.inspect}, evse_count: #{@evse_count.inspect}, max_power:"\
|
|
122
|
+
" #{@max_power.inspect}, operator_name: #{@operator_name.inspect}, marker_type:"\
|
|
123
|
+
" #{@marker_type.inspect}>"
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# shell_ev
|
|
2
2
|
#
|
|
3
|
-
# This file was automatically generated by APIMATIC
|
|
4
|
-
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
5
|
|
|
6
6
|
module ShellEv
|
|
7
7
|
# Filter by Locations that support the given Authorization Methods
|
|
@@ -22,5 +22,19 @@ module ShellEv
|
|
|
22
22
|
|
|
23
23
|
NEARBY_LOCATIONS_AUTHORIZATION_METHODS_ENUM.include?(value)
|
|
24
24
|
end
|
|
25
|
+
|
|
26
|
+
def self.from_value(value, default_value = NEWMOTIONAPP)
|
|
27
|
+
return default_value if value.nil?
|
|
28
|
+
|
|
29
|
+
str = value.to_s.strip
|
|
30
|
+
|
|
31
|
+
case str.downcase
|
|
32
|
+
when 'newmotionapp' then NEWMOTIONAPP
|
|
33
|
+
when 'rfidtoken' then RFIDTOKEN
|
|
34
|
+
when 'pnc' then PNC
|
|
35
|
+
else
|
|
36
|
+
default_value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
25
39
|
end
|
|
26
40
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# shell_ev
|
|
2
2
|
#
|
|
3
|
-
# This file was automatically generated by APIMATIC
|
|
4
|
-
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
5
|
|
|
6
6
|
module ShellEv
|
|
7
7
|
# Filter by Locations that have Connectors with these Connector Types
|
|
@@ -67,5 +67,34 @@ module ShellEv
|
|
|
67
67
|
|
|
68
68
|
NEARBY_LOCATIONS_CONNECTOR_TYPES_ENUM.include?(value)
|
|
69
69
|
end
|
|
70
|
+
|
|
71
|
+
def self.from_value(value, default_value = AVCON)
|
|
72
|
+
return default_value if value.nil?
|
|
73
|
+
|
|
74
|
+
str = value.to_s.strip
|
|
75
|
+
|
|
76
|
+
case str.downcase
|
|
77
|
+
when 'avcon' then AVCON
|
|
78
|
+
when 'domestic' then DOMESTIC
|
|
79
|
+
when 'industrial2pdc' then INDUSTRIAL2PDC
|
|
80
|
+
when 'industrialpneac' then INDUSTRIALPNEAC
|
|
81
|
+
when 'industrial3peac' then INDUSTRIAL3PEAC
|
|
82
|
+
when 'industrial3penac' then INDUSTRIAL3PENAC
|
|
83
|
+
when 'type1' then TYPE1
|
|
84
|
+
when 'type1combo' then TYPE1COMBO
|
|
85
|
+
when 'type2' then TYPE2
|
|
86
|
+
when 'type2combo' then TYPE2COMBO
|
|
87
|
+
when 'type3' then TYPE3
|
|
88
|
+
when 'lpi' then LPI
|
|
89
|
+
when 'nema520' then NEMA520
|
|
90
|
+
when 'saej1772' then SAEJ1772
|
|
91
|
+
when 'spi' then SPI
|
|
92
|
+
when 'tepcochademo' then TEPCOCHADEMO
|
|
93
|
+
when 'tesla' then TESLA
|
|
94
|
+
when 'unspecified' then UNSPECIFIED
|
|
95
|
+
else
|
|
96
|
+
default_value
|
|
97
|
+
end
|
|
98
|
+
end
|
|
70
99
|
end
|
|
71
100
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# shell_ev
|
|
2
2
|
#
|
|
3
|
-
# This file was automatically generated by APIMATIC
|
|
4
|
-
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
5
|
|
|
6
6
|
module ShellEv
|
|
7
7
|
# Filter by Locations that have the given status
|
|
@@ -25,5 +25,20 @@ module ShellEv
|
|
|
25
25
|
|
|
26
26
|
NEARBY_LOCATIONS_EVSE_STATUS_ENUM.include?(value)
|
|
27
27
|
end
|
|
28
|
+
|
|
29
|
+
def self.from_value(value, default_value = AVAILABLE)
|
|
30
|
+
return default_value if value.nil?
|
|
31
|
+
|
|
32
|
+
str = value.to_s.strip
|
|
33
|
+
|
|
34
|
+
case str.downcase
|
|
35
|
+
when 'available' then AVAILABLE
|
|
36
|
+
when 'occupied' then OCCUPIED
|
|
37
|
+
when 'unavailable' then UNAVAILABLE
|
|
38
|
+
when 'unknown' then UNKNOWN
|
|
39
|
+
else
|
|
40
|
+
default_value
|
|
41
|
+
end
|
|
42
|
+
end
|
|
28
43
|
end
|
|
29
44
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# shell_ev
|
|
2
2
|
#
|
|
3
|
-
# This file was automatically generated by APIMATIC
|
|
4
|
-
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
5
|
|
|
6
6
|
module ShellEv
|
|
7
7
|
# OAuth 2 Authorization error codes
|
|
@@ -41,5 +41,22 @@ module ShellEv
|
|
|
41
41
|
|
|
42
42
|
O_AUTH_PROVIDER_ERROR_ENUM.include?(value)
|
|
43
43
|
end
|
|
44
|
+
|
|
45
|
+
def self.from_value(value, default_value = INVALID_REQUEST)
|
|
46
|
+
return default_value if value.nil?
|
|
47
|
+
|
|
48
|
+
str = value.to_s.strip
|
|
49
|
+
|
|
50
|
+
case str.downcase
|
|
51
|
+
when 'invalid_request' then INVALID_REQUEST
|
|
52
|
+
when 'invalid_client' then INVALID_CLIENT
|
|
53
|
+
when 'invalid_grant' then INVALID_GRANT
|
|
54
|
+
when 'unauthorized_client' then UNAUTHORIZED_CLIENT
|
|
55
|
+
when 'unsupported_grant_type' then UNSUPPORTED_GRANT_TYPE
|
|
56
|
+
when 'invalid_scope' then INVALID_SCOPE
|
|
57
|
+
else
|
|
58
|
+
default_value
|
|
59
|
+
end
|
|
60
|
+
end
|
|
44
61
|
end
|
|
45
62
|
end
|