ev-recharge-sdk 1.0.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 +7 -0
- data/LICENSE +28 -0
- data/README.md +92 -0
- data/lib/shell_ev/api_helper.rb +10 -0
- data/lib/shell_ev/client.rb +77 -0
- data/lib/shell_ev/configuration.rb +110 -0
- data/lib/shell_ev/controllers/base_controller.rb +66 -0
- data/lib/shell_ev/controllers/charging_controller.rb +216 -0
- data/lib/shell_ev/controllers/locations_controller.rb +352 -0
- data/lib/shell_ev/controllers/o_auth_authorization_controller.rb +42 -0
- data/lib/shell_ev/exceptions/api_exception.rb +10 -0
- data/lib/shell_ev/exceptions/bad_request_exception.rb +37 -0
- data/lib/shell_ev/exceptions/http401_error_response_exception.rb +52 -0
- data/lib/shell_ev/exceptions/m400_error_response_error1_exception.rb +52 -0
- data/lib/shell_ev/exceptions/m401_error_response_error1_exception.rb +52 -0
- data/lib/shell_ev/exceptions/m404_error_response_error1_exception.rb +53 -0
- data/lib/shell_ev/exceptions/m405_error_response_error1_exception.rb +52 -0
- data/lib/shell_ev/exceptions/m429_error_response_error1_exception.rb +52 -0
- data/lib/shell_ev/exceptions/m500_error_response_error1_exception.rb +52 -0
- data/lib/shell_ev/exceptions/m503_error_response_error1_exception.rb +52 -0
- data/lib/shell_ev/exceptions/not_found_exception.rb +37 -0
- data/lib/shell_ev/exceptions/o_auth_provider_exception.rb +48 -0
- data/lib/shell_ev/exceptions/unauthorized_exception.rb +37 -0
- data/lib/shell_ev/http/auth/o_auth2.rb +90 -0
- data/lib/shell_ev/http/http_call_back.rb +10 -0
- data/lib/shell_ev/http/http_method_enum.rb +10 -0
- data/lib/shell_ev/http/http_request.rb +10 -0
- data/lib/shell_ev/http/http_response.rb +10 -0
- data/lib/shell_ev/models/accessibility.rb +60 -0
- data/lib/shell_ev/models/accessibility_status_enum.rb +29 -0
- data/lib/shell_ev/models/active_response200_json.rb +78 -0
- data/lib/shell_ev/models/active_response200_json_status_enum.rb +23 -0
- data/lib/shell_ev/models/address.rb +81 -0
- data/lib/shell_ev/models/base_model.rb +62 -0
- data/lib/shell_ev/models/chargesession_start_body.rb +59 -0
- data/lib/shell_ev/models/connector_vo.rb +134 -0
- data/lib/shell_ev/models/connector_vo_connector_type_enum.rb +71 -0
- data/lib/shell_ev/models/connector_vo_updated_by_enum.rb +29 -0
- data/lib/shell_ev/models/coordinates.rb +70 -0
- data/lib/shell_ev/models/data_active.rb +153 -0
- data/lib/shell_ev/models/data_active_session_code_enum.rb +44 -0
- data/lib/shell_ev/models/data_active_session_state_enum.rb +35 -0
- data/lib/shell_ev/models/data_retrieve.rb +152 -0
- data/lib/shell_ev/models/data_retrieve_session_code_enum.rb +44 -0
- data/lib/shell_ev/models/data_retrieve_session_state_enum.rb +35 -0
- data/lib/shell_ev/models/electrical_properties.rb +81 -0
- data/lib/shell_ev/models/electrical_properties_power_type_enum.rb +26 -0
- data/lib/shell_ev/models/env_enum.rb +23 -0
- data/lib/shell_ev/models/evse_vo.rb +143 -0
- data/lib/shell_ev/models/evse_vo_authorization_methods_enum.rb +26 -0
- data/lib/shell_ev/models/evse_vo_status_enum.rb +29 -0
- data/lib/shell_ev/models/get_charge_session_retrieve_response200_json.rb +78 -0
- data/lib/shell_ev/models/get_charge_session_retrieve_response200_json_status_enum.rb +23 -0
- data/lib/shell_ev/models/get_locations_list_authorization_methods_enum.rb +26 -0
- data/lib/shell_ev/models/get_locations_list_connector_types_enum.rb +71 -0
- data/lib/shell_ev/models/get_locations_list_evse_status_enum.rb +29 -0
- data/lib/shell_ev/models/get_markers_list_authorization_methods_enum.rb +26 -0
- data/lib/shell_ev/models/get_markers_list_connector_types_enum.rb +71 -0
- data/lib/shell_ev/models/get_markers_list_evse_status_enum.rb +29 -0
- data/lib/shell_ev/models/get_nearby_locations_authorization_methods_enum.rb +26 -0
- data/lib/shell_ev/models/get_nearby_locations_connector_types_enum.rb +71 -0
- data/lib/shell_ev/models/get_nearby_locations_evse_status_enum.rb +29 -0
- data/lib/shell_ev/models/inline_response202.rb +76 -0
- data/lib/shell_ev/models/inline_response2021.rb +58 -0
- data/lib/shell_ev/models/inline_response2021_status_enum.rb +23 -0
- data/lib/shell_ev/models/inline_response202_data.rb +48 -0
- data/lib/shell_ev/models/inline_response202_status_enum.rb +23 -0
- data/lib/shell_ev/models/location_respone_object.rb +172 -0
- data/lib/shell_ev/models/m400_error_response.rb +78 -0
- data/lib/shell_ev/models/m400_error_response_error.rb +80 -0
- data/lib/shell_ev/models/m401_error_response.rb +78 -0
- data/lib/shell_ev/models/m401_error_response_error.rb +80 -0
- data/lib/shell_ev/models/m404_error_response.rb +79 -0
- data/lib/shell_ev/models/m404_error_response_error.rb +80 -0
- data/lib/shell_ev/models/m405_error_response.rb +78 -0
- data/lib/shell_ev/models/m405_error_response_error.rb +80 -0
- data/lib/shell_ev/models/m429_error_response.rb +78 -0
- data/lib/shell_ev/models/m429_error_response_error.rb +80 -0
- data/lib/shell_ev/models/m500_error_response.rb +78 -0
- data/lib/shell_ev/models/m500_error_response_error.rb +80 -0
- data/lib/shell_ev/models/m503_error_response.rb +78 -0
- data/lib/shell_ev/models/m503_error_response_error.rb +80 -0
- data/lib/shell_ev/models/multi_location_marker.rb +126 -0
- data/lib/shell_ev/models/o_auth_provider_error_enum.rb +45 -0
- data/lib/shell_ev/models/o_auth_token.rb +100 -0
- data/lib/shell_ev/models/opening_hours_object.rb +70 -0
- data/lib/shell_ev/models/opening_hours_object_week_day_enum.rb +38 -0
- data/lib/shell_ev/models/response_base_status_enum.rb +26 -0
- data/lib/shell_ev/models/response_error401_all_of1.rb +57 -0
- data/lib/shell_ev/models/response_error401_all_of1_errors_items.rb +80 -0
- data/lib/shell_ev/models/single_location_marker.rb +157 -0
- data/lib/shell_ev/models/single_location_marker_authorization_methods_items_enum.rb +26 -0
- data/lib/shell_ev/models/single_location_marker_status_enum.rb +30 -0
- data/lib/shell_ev/models/stop_charge_session_request_body_json.rb +48 -0
- data/lib/shell_ev/models/success_response.rb +58 -0
- data/lib/shell_ev/models/tariff_vo.rb +111 -0
- data/lib/shell_ev/models/tariff_vo_updated_by_enum.rb +29 -0
- data/lib/shell_ev/utilities/date_time_helper.rb +11 -0
- data/lib/shell_ev/utilities/file_wrapper.rb +16 -0
- data/lib/shell_ev/utilities/union_type_lookup.rb +38 -0
- data/lib/shell_ev.rb +125 -0
- data/test/controllers/controller_test_base.rb +34 -0
- data/test/controllers/test_charging_controller.rb +78 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +224 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# Describes the session state
|
8
|
+
class DataActiveSessionStateEnum
|
9
|
+
DATA_ACTIVE_SESSION_STATE_ENUM = [
|
10
|
+
# TODO: Write general description for STARTED
|
11
|
+
STARTED = 'started'.freeze,
|
12
|
+
|
13
|
+
# TODO: Write general description for STOPPED
|
14
|
+
STOPPED = 'stopped'.freeze,
|
15
|
+
|
16
|
+
# TODO: Write general description for STARTREQUESTED
|
17
|
+
STARTREQUESTED = 'start-requested'.freeze,
|
18
|
+
|
19
|
+
# TODO: Write general description for STOPREQUESTED
|
20
|
+
STOPREQUESTED = 'stop-requested'.freeze,
|
21
|
+
|
22
|
+
# TODO: Write general description for FAILEDTOSTART
|
23
|
+
FAILEDTOSTART = 'failed-to-start'.freeze,
|
24
|
+
|
25
|
+
# TODO: Write general description for FAILEDTOSTOP
|
26
|
+
FAILEDTOSTOP = 'failed-to-stop'.freeze
|
27
|
+
].freeze
|
28
|
+
|
29
|
+
def self.validate(value)
|
30
|
+
return false if value.nil?
|
31
|
+
|
32
|
+
DATA_ACTIVE_SESSION_STATE_ENUM.include?(value)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,152 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
require 'date'
|
7
|
+
module ShellEv
|
8
|
+
# DataRetrieve Model.
|
9
|
+
class DataRetrieve < BaseModel
|
10
|
+
SKIP = Object.new
|
11
|
+
private_constant :SKIP
|
12
|
+
|
13
|
+
# Id of the session
|
14
|
+
# @return [UUID | String]
|
15
|
+
attr_accessor :id
|
16
|
+
|
17
|
+
# Id of the user that started the session
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :user_id
|
20
|
+
|
21
|
+
# Id of the evse that the user is charging
|
22
|
+
# @return [String]
|
23
|
+
attr_accessor :ema_id
|
24
|
+
|
25
|
+
# Ema-id of the charge token that is used
|
26
|
+
# @return [String]
|
27
|
+
attr_accessor :evse_id
|
28
|
+
|
29
|
+
# When the session is started
|
30
|
+
# @return [DateTime]
|
31
|
+
attr_accessor :started_at
|
32
|
+
|
33
|
+
# When the session is stopped
|
34
|
+
# @return [DateTime]
|
35
|
+
attr_accessor :stopped_at
|
36
|
+
|
37
|
+
# Describes the session state
|
38
|
+
# @return [DataRetrieveSessionStateEnum]
|
39
|
+
attr_accessor :session_state
|
40
|
+
|
41
|
+
# Session code e.g InternalError
|
42
|
+
# @return [DataRetrieveSessionCodeEnum]
|
43
|
+
attr_accessor :session_code
|
44
|
+
|
45
|
+
# Session message
|
46
|
+
# @return [String]
|
47
|
+
attr_accessor :session_message
|
48
|
+
|
49
|
+
# A mapping from model property names to API property names.
|
50
|
+
def self.names
|
51
|
+
@_hash = {} if @_hash.nil?
|
52
|
+
@_hash['id'] = 'Id'
|
53
|
+
@_hash['user_id'] = 'UserId'
|
54
|
+
@_hash['ema_id'] = 'EmaId'
|
55
|
+
@_hash['evse_id'] = 'EvseId'
|
56
|
+
@_hash['started_at'] = 'StartedAt'
|
57
|
+
@_hash['stopped_at'] = 'StoppedAt'
|
58
|
+
@_hash['session_state'] = 'SessionState'
|
59
|
+
@_hash['session_code'] = 'SessionCode'
|
60
|
+
@_hash['session_message'] = 'SessionMessage'
|
61
|
+
@_hash
|
62
|
+
end
|
63
|
+
|
64
|
+
# An array for optional fields
|
65
|
+
def self.optionals
|
66
|
+
%w[
|
67
|
+
id
|
68
|
+
user_id
|
69
|
+
ema_id
|
70
|
+
evse_id
|
71
|
+
started_at
|
72
|
+
stopped_at
|
73
|
+
session_state
|
74
|
+
session_code
|
75
|
+
session_message
|
76
|
+
]
|
77
|
+
end
|
78
|
+
|
79
|
+
# An array for nullable fields
|
80
|
+
def self.nullables
|
81
|
+
%w[
|
82
|
+
stopped_at
|
83
|
+
session_code
|
84
|
+
session_message
|
85
|
+
]
|
86
|
+
end
|
87
|
+
|
88
|
+
def initialize(id = SKIP,
|
89
|
+
user_id = SKIP,
|
90
|
+
ema_id = SKIP,
|
91
|
+
evse_id = SKIP,
|
92
|
+
started_at = SKIP,
|
93
|
+
stopped_at = SKIP,
|
94
|
+
session_state = SKIP,
|
95
|
+
session_code = SKIP,
|
96
|
+
session_message = SKIP)
|
97
|
+
@id = id unless id == SKIP
|
98
|
+
@user_id = user_id unless user_id == SKIP
|
99
|
+
@ema_id = ema_id unless ema_id == SKIP
|
100
|
+
@evse_id = evse_id unless evse_id == SKIP
|
101
|
+
@started_at = started_at unless started_at == SKIP
|
102
|
+
@stopped_at = stopped_at unless stopped_at == SKIP
|
103
|
+
@session_state = session_state unless session_state == SKIP
|
104
|
+
@session_code = session_code unless session_code == SKIP
|
105
|
+
@session_message = session_message unless session_message == SKIP
|
106
|
+
end
|
107
|
+
|
108
|
+
# Creates an instance of the object from a hash.
|
109
|
+
def self.from_hash(hash)
|
110
|
+
return nil unless hash
|
111
|
+
|
112
|
+
# Extract variables from the hash.
|
113
|
+
id = hash.key?('Id') ? hash['Id'] : SKIP
|
114
|
+
user_id = hash.key?('UserId') ? hash['UserId'] : SKIP
|
115
|
+
ema_id = hash.key?('EmaId') ? hash['EmaId'] : SKIP
|
116
|
+
evse_id = hash.key?('EvseId') ? hash['EvseId'] : SKIP
|
117
|
+
started_at = if hash.key?('StartedAt')
|
118
|
+
(DateTimeHelper.from_rfc3339(hash['StartedAt']) if hash['StartedAt'])
|
119
|
+
else
|
120
|
+
SKIP
|
121
|
+
end
|
122
|
+
stopped_at = if hash.key?('StoppedAt')
|
123
|
+
(DateTimeHelper.from_rfc3339(hash['StoppedAt']) if hash['StoppedAt'])
|
124
|
+
else
|
125
|
+
SKIP
|
126
|
+
end
|
127
|
+
session_state = hash.key?('SessionState') ? hash['SessionState'] : SKIP
|
128
|
+
session_code = hash.key?('SessionCode') ? hash['SessionCode'] : SKIP
|
129
|
+
session_message =
|
130
|
+
hash.key?('SessionMessage') ? hash['SessionMessage'] : SKIP
|
131
|
+
|
132
|
+
# Create object from extracted values.
|
133
|
+
DataRetrieve.new(id,
|
134
|
+
user_id,
|
135
|
+
ema_id,
|
136
|
+
evse_id,
|
137
|
+
started_at,
|
138
|
+
stopped_at,
|
139
|
+
session_state,
|
140
|
+
session_code,
|
141
|
+
session_message)
|
142
|
+
end
|
143
|
+
|
144
|
+
def to_custom_started_at
|
145
|
+
DateTimeHelper.to_rfc3339(started_at)
|
146
|
+
end
|
147
|
+
|
148
|
+
def to_custom_stopped_at
|
149
|
+
DateTimeHelper.to_rfc3339(stopped_at)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# Session code e.g InternalError
|
8
|
+
class DataRetrieveSessionCodeEnum
|
9
|
+
DATA_RETRIEVE_SESSION_CODE_ENUM = [
|
10
|
+
# TODO: Write general description for INTERNALERROR
|
11
|
+
INTERNALERROR = 'InternalError'.freeze,
|
12
|
+
|
13
|
+
# TODO: Write general description for SERVICEUNAVAILABLE
|
14
|
+
SERVICEUNAVAILABLE = 'ServiceUnavailable'.freeze,
|
15
|
+
|
16
|
+
# TODO: Write general description for CHARGETOKENNOTSUPPORTED
|
17
|
+
CHARGETOKENNOTSUPPORTED = 'ChargeTokenNotSupported'.freeze,
|
18
|
+
|
19
|
+
# TODO: Write general description for SESSIONINVALID
|
20
|
+
SESSIONINVALID = 'SessionInvalid'.freeze,
|
21
|
+
|
22
|
+
# TODO: Write general description for EVNOTCONNECTEDTOEVSE
|
23
|
+
EVNOTCONNECTEDTOEVSE = 'EvNotConnectedToEvse'.freeze,
|
24
|
+
|
25
|
+
# TODO: Write general description for EVSEINUSE
|
26
|
+
EVSEINUSE = 'EvseInUse'.freeze,
|
27
|
+
|
28
|
+
# TODO: Write general description for EVSEOUTOFSERVICE
|
29
|
+
EVSEOUTOFSERVICE = 'EvseOutOfService'.freeze,
|
30
|
+
|
31
|
+
# TODO: Write general description for EVSENOTFOUND
|
32
|
+
EVSENOTFOUND = 'EvseNotFound'.freeze,
|
33
|
+
|
34
|
+
# TODO: Write general description for EVSENOTSUPPORTED
|
35
|
+
EVSENOTSUPPORTED = 'EvseNotSupported'.freeze
|
36
|
+
].freeze
|
37
|
+
|
38
|
+
def self.validate(value)
|
39
|
+
return false if value.nil?
|
40
|
+
|
41
|
+
DATA_RETRIEVE_SESSION_CODE_ENUM.include?(value)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# Describes the session state
|
8
|
+
class DataRetrieveSessionStateEnum
|
9
|
+
DATA_RETRIEVE_SESSION_STATE_ENUM = [
|
10
|
+
# TODO: Write general description for STARTED
|
11
|
+
STARTED = 'started'.freeze,
|
12
|
+
|
13
|
+
# TODO: Write general description for STOPPED
|
14
|
+
STOPPED = 'stopped'.freeze,
|
15
|
+
|
16
|
+
# TODO: Write general description for STARTREQUESTED
|
17
|
+
STARTREQUESTED = 'start-requested'.freeze,
|
18
|
+
|
19
|
+
# TODO: Write general description for STOPREQUESTED
|
20
|
+
STOPREQUESTED = 'stop-requested'.freeze,
|
21
|
+
|
22
|
+
# TODO: Write general description for FAILEDTOSTART
|
23
|
+
FAILEDTOSTART = 'failed-to-start'.freeze,
|
24
|
+
|
25
|
+
# TODO: Write general description for FAILEDTOSTOP
|
26
|
+
FAILEDTOSTOP = 'failed-to-stop'.freeze
|
27
|
+
].freeze
|
28
|
+
|
29
|
+
def self.validate(value)
|
30
|
+
return false if value.nil?
|
31
|
+
|
32
|
+
DATA_RETRIEVE_SESSION_STATE_ENUM.include?(value)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# Electrical Properties of the Connector
|
8
|
+
class ElectricalProperties < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Power Type used in this connector.
|
13
|
+
# @return [ElectricalPropertiesPowerTypeEnum]
|
14
|
+
attr_accessor :power_type
|
15
|
+
|
16
|
+
# Voltage in Volts for this connector
|
17
|
+
# @return [Float]
|
18
|
+
attr_accessor :voltage
|
19
|
+
|
20
|
+
# Electric Current in Amperes for this connector
|
21
|
+
# @return [Float]
|
22
|
+
attr_accessor :amperage
|
23
|
+
|
24
|
+
# Power in Kilowatts for this connector
|
25
|
+
# @return [Float]
|
26
|
+
attr_accessor :max_electric_power
|
27
|
+
|
28
|
+
# A mapping from model property names to API property names.
|
29
|
+
def self.names
|
30
|
+
@_hash = {} if @_hash.nil?
|
31
|
+
@_hash['power_type'] = 'powerType'
|
32
|
+
@_hash['voltage'] = 'voltage'
|
33
|
+
@_hash['amperage'] = 'amperage'
|
34
|
+
@_hash['max_electric_power'] = 'maxElectricPower'
|
35
|
+
@_hash
|
36
|
+
end
|
37
|
+
|
38
|
+
# An array for optional fields
|
39
|
+
def self.optionals
|
40
|
+
%w[
|
41
|
+
power_type
|
42
|
+
voltage
|
43
|
+
amperage
|
44
|
+
max_electric_power
|
45
|
+
]
|
46
|
+
end
|
47
|
+
|
48
|
+
# An array for nullable fields
|
49
|
+
def self.nullables
|
50
|
+
[]
|
51
|
+
end
|
52
|
+
|
53
|
+
def initialize(power_type = SKIP,
|
54
|
+
voltage = SKIP,
|
55
|
+
amperage = SKIP,
|
56
|
+
max_electric_power = SKIP)
|
57
|
+
@power_type = power_type unless power_type == SKIP
|
58
|
+
@voltage = voltage unless voltage == SKIP
|
59
|
+
@amperage = amperage unless amperage == SKIP
|
60
|
+
@max_electric_power = max_electric_power unless max_electric_power == SKIP
|
61
|
+
end
|
62
|
+
|
63
|
+
# Creates an instance of the object from a hash.
|
64
|
+
def self.from_hash(hash)
|
65
|
+
return nil unless hash
|
66
|
+
|
67
|
+
# Extract variables from the hash.
|
68
|
+
power_type = hash.key?('powerType') ? hash['powerType'] : SKIP
|
69
|
+
voltage = hash.key?('voltage') ? hash['voltage'] : SKIP
|
70
|
+
amperage = hash.key?('amperage') ? hash['amperage'] : SKIP
|
71
|
+
max_electric_power =
|
72
|
+
hash.key?('maxElectricPower') ? hash['maxElectricPower'] : SKIP
|
73
|
+
|
74
|
+
# Create object from extracted values.
|
75
|
+
ElectricalProperties.new(power_type,
|
76
|
+
voltage,
|
77
|
+
amperage,
|
78
|
+
max_electric_power)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# Power Type used in this connector.
|
8
|
+
class ElectricalPropertiesPowerTypeEnum
|
9
|
+
ELECTRICAL_PROPERTIES_POWER_TYPE_ENUM = [
|
10
|
+
# TODO: Write general description for AC1PHASE
|
11
|
+
AC1PHASE = 'AC1Phase'.freeze,
|
12
|
+
|
13
|
+
# TODO: Write general description for AC3PHASE
|
14
|
+
AC3PHASE = 'AC3Phase'.freeze,
|
15
|
+
|
16
|
+
# TODO: Write general description for DC
|
17
|
+
DC = 'DC'.freeze
|
18
|
+
].freeze
|
19
|
+
|
20
|
+
def self.validate(value)
|
21
|
+
return false if value.nil?
|
22
|
+
|
23
|
+
ELECTRICAL_PROPERTIES_POWER_TYPE_ENUM.include?(value)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# env.
|
8
|
+
class EnvEnum
|
9
|
+
ENV_ENUM = [
|
10
|
+
# TODO: Write general description for ENUM_APITESTSHELLCOM
|
11
|
+
ENUM_APITESTSHELLCOM = 'api-test.shell.com'.freeze,
|
12
|
+
|
13
|
+
# TODO: Write general description for ENUM_APISHELLCOM
|
14
|
+
ENUM_APISHELLCOM = 'api.shell.com'.freeze
|
15
|
+
].freeze
|
16
|
+
|
17
|
+
def self.validate(value)
|
18
|
+
return false if value.nil?
|
19
|
+
|
20
|
+
ENV_ENUM.include?(value)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,143 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# Each Location will contain one or more EVSEs (Electric Vehicle Supply
|
8
|
+
# Equipment). Each EVSE is capable of charging one car at a time.
|
9
|
+
class EvseVO < BaseModel
|
10
|
+
SKIP = Object.new
|
11
|
+
private_constant :SKIP
|
12
|
+
|
13
|
+
# Internal identifier used to refer to single individual EVSE unit.
|
14
|
+
# @return [Integer]
|
15
|
+
attr_accessor :uid
|
16
|
+
|
17
|
+
# Identifier of the Evse as given by the Operator, unique for that Operator
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :external_id
|
20
|
+
|
21
|
+
# Standard EVSEId identifier (ISO-IEC-15118)
|
22
|
+
# @return [String]
|
23
|
+
attr_accessor :evse_id
|
24
|
+
|
25
|
+
# The current status of the EVSE units availability
|
26
|
+
# @return [EvseVOStatusEnum]
|
27
|
+
attr_accessor :status
|
28
|
+
|
29
|
+
# List of all connectors available on this EVSE unit.
|
30
|
+
# @return [Array[ConnectorVO]]
|
31
|
+
attr_accessor :connectors
|
32
|
+
|
33
|
+
# Methods that can be used to Authorize sessions on this EVSE
|
34
|
+
# @return [EvseVOAuthorizationMethodsEnum]
|
35
|
+
attr_accessor :authorization_methods
|
36
|
+
|
37
|
+
# ISO8601-compliant UTC datetime of the last update of the EVSE
|
38
|
+
# @return [String]
|
39
|
+
attr_accessor :updated
|
40
|
+
|
41
|
+
# optional ISO8601-compliant UTC deletion timestamp of the Evse
|
42
|
+
# @return [String]
|
43
|
+
attr_accessor :deleted
|
44
|
+
|
45
|
+
# An optional number/string printed on the outside of the EVSE for visual
|
46
|
+
# identification
|
47
|
+
# @return [String]
|
48
|
+
attr_accessor :physical_reference
|
49
|
+
|
50
|
+
# A mapping from model property names to API property names.
|
51
|
+
def self.names
|
52
|
+
@_hash = {} if @_hash.nil?
|
53
|
+
@_hash['uid'] = 'uid'
|
54
|
+
@_hash['external_id'] = 'externalId'
|
55
|
+
@_hash['evse_id'] = 'evseId'
|
56
|
+
@_hash['status'] = 'status'
|
57
|
+
@_hash['connectors'] = 'connectors'
|
58
|
+
@_hash['authorization_methods'] = 'authorizationMethods'
|
59
|
+
@_hash['updated'] = 'updated'
|
60
|
+
@_hash['deleted'] = 'deleted'
|
61
|
+
@_hash['physical_reference'] = 'physicalReference'
|
62
|
+
@_hash
|
63
|
+
end
|
64
|
+
|
65
|
+
# An array for optional fields
|
66
|
+
def self.optionals
|
67
|
+
%w[
|
68
|
+
uid
|
69
|
+
external_id
|
70
|
+
evse_id
|
71
|
+
status
|
72
|
+
connectors
|
73
|
+
authorization_methods
|
74
|
+
updated
|
75
|
+
deleted
|
76
|
+
physical_reference
|
77
|
+
]
|
78
|
+
end
|
79
|
+
|
80
|
+
# An array for nullable fields
|
81
|
+
def self.nullables
|
82
|
+
[]
|
83
|
+
end
|
84
|
+
|
85
|
+
def initialize(uid = SKIP,
|
86
|
+
external_id = SKIP,
|
87
|
+
evse_id = SKIP,
|
88
|
+
status = SKIP,
|
89
|
+
connectors = SKIP,
|
90
|
+
authorization_methods = SKIP,
|
91
|
+
updated = SKIP,
|
92
|
+
deleted = SKIP,
|
93
|
+
physical_reference = SKIP)
|
94
|
+
@uid = uid unless uid == SKIP
|
95
|
+
@external_id = external_id unless external_id == SKIP
|
96
|
+
@evse_id = evse_id unless evse_id == SKIP
|
97
|
+
@status = status unless status == SKIP
|
98
|
+
@connectors = connectors unless connectors == SKIP
|
99
|
+
@authorization_methods = authorization_methods unless authorization_methods == SKIP
|
100
|
+
@updated = updated unless updated == SKIP
|
101
|
+
@deleted = deleted unless deleted == SKIP
|
102
|
+
@physical_reference = physical_reference unless physical_reference == SKIP
|
103
|
+
end
|
104
|
+
|
105
|
+
# Creates an instance of the object from a hash.
|
106
|
+
def self.from_hash(hash)
|
107
|
+
return nil unless hash
|
108
|
+
|
109
|
+
# Extract variables from the hash.
|
110
|
+
uid = hash.key?('uid') ? hash['uid'] : SKIP
|
111
|
+
external_id = hash.key?('externalId') ? hash['externalId'] : SKIP
|
112
|
+
evse_id = hash.key?('evseId') ? hash['evseId'] : SKIP
|
113
|
+
status = hash.key?('status') ? hash['status'] : SKIP
|
114
|
+
# Parameter is an array, so we need to iterate through it
|
115
|
+
connectors = nil
|
116
|
+
unless hash['connectors'].nil?
|
117
|
+
connectors = []
|
118
|
+
hash['connectors'].each do |structure|
|
119
|
+
connectors << (ConnectorVO.from_hash(structure) if structure)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
connectors = SKIP unless hash.key?('connectors')
|
124
|
+
authorization_methods =
|
125
|
+
hash.key?('authorizationMethods') ? hash['authorizationMethods'] : SKIP
|
126
|
+
updated = hash.key?('updated') ? hash['updated'] : SKIP
|
127
|
+
deleted = hash.key?('deleted') ? hash['deleted'] : SKIP
|
128
|
+
physical_reference =
|
129
|
+
hash.key?('physicalReference') ? hash['physicalReference'] : SKIP
|
130
|
+
|
131
|
+
# Create object from extracted values.
|
132
|
+
EvseVO.new(uid,
|
133
|
+
external_id,
|
134
|
+
evse_id,
|
135
|
+
status,
|
136
|
+
connectors,
|
137
|
+
authorization_methods,
|
138
|
+
updated,
|
139
|
+
deleted,
|
140
|
+
physical_reference)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# Methods that can be used to Authorize sessions on this EVSE
|
8
|
+
class EvseVOAuthorizationMethodsEnum
|
9
|
+
EVSE_VO_AUTHORIZATION_METHODS_ENUM = [
|
10
|
+
# TODO: Write general description for NEWMOTIONAPP
|
11
|
+
NEWMOTIONAPP = 'NewMotionApp'.freeze,
|
12
|
+
|
13
|
+
# TODO: Write general description for RFIDTOKEN
|
14
|
+
RFIDTOKEN = 'RFIDToken'.freeze,
|
15
|
+
|
16
|
+
# TODO: Write general description for PNC
|
17
|
+
PNC = 'PnC'.freeze
|
18
|
+
].freeze
|
19
|
+
|
20
|
+
def self.validate(value)
|
21
|
+
return false if value.nil?
|
22
|
+
|
23
|
+
EVSE_VO_AUTHORIZATION_METHODS_ENUM.include?(value)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# The current status of the EVSE units availability
|
8
|
+
class EvseVOStatusEnum
|
9
|
+
EVSE_VO_STATUS_ENUM = [
|
10
|
+
# TODO: Write general description for AVAILABLE
|
11
|
+
AVAILABLE = 'Available'.freeze,
|
12
|
+
|
13
|
+
# TODO: Write general description for OCCUPIED
|
14
|
+
OCCUPIED = 'Occupied'.freeze,
|
15
|
+
|
16
|
+
# TODO: Write general description for UNAVAILABLE
|
17
|
+
UNAVAILABLE = 'Unavailable'.freeze,
|
18
|
+
|
19
|
+
# TODO: Write general description for UNKNOWN
|
20
|
+
UNKNOWN = 'Unknown'.freeze
|
21
|
+
].freeze
|
22
|
+
|
23
|
+
def self.validate(value)
|
24
|
+
return false if value.nil?
|
25
|
+
|
26
|
+
EVSE_VO_STATUS_ENUM.include?(value)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# GetChargeSessionRetrieveResponse200Json Model.
|
8
|
+
class GetChargeSessionRetrieveResponse200Json < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# A unique request id in GUID format. The value is written to the Shell API
|
13
|
+
# Platform audit log for end to end traceability of a request.
|
14
|
+
# @return [UUID | String]
|
15
|
+
attr_accessor :request_id
|
16
|
+
|
17
|
+
# Indicates overall status of the request
|
18
|
+
# @return [GetChargeSessionRetrieveResponse200JsonStatusEnum]
|
19
|
+
attr_accessor :status
|
20
|
+
|
21
|
+
# Indicates overall status of the request
|
22
|
+
# @return [Array[DataRetrieve]]
|
23
|
+
attr_accessor :data
|
24
|
+
|
25
|
+
# A mapping from model property names to API property names.
|
26
|
+
def self.names
|
27
|
+
@_hash = {} if @_hash.nil?
|
28
|
+
@_hash['request_id'] = 'RequestId'
|
29
|
+
@_hash['status'] = 'Status'
|
30
|
+
@_hash['data'] = 'Data'
|
31
|
+
@_hash
|
32
|
+
end
|
33
|
+
|
34
|
+
# An array for optional fields
|
35
|
+
def self.optionals
|
36
|
+
%w[
|
37
|
+
data
|
38
|
+
]
|
39
|
+
end
|
40
|
+
|
41
|
+
# An array for nullable fields
|
42
|
+
def self.nullables
|
43
|
+
[]
|
44
|
+
end
|
45
|
+
|
46
|
+
def initialize(request_id = nil,
|
47
|
+
status = nil,
|
48
|
+
data = SKIP)
|
49
|
+
@request_id = request_id
|
50
|
+
@status = status
|
51
|
+
@data = data unless data == SKIP
|
52
|
+
end
|
53
|
+
|
54
|
+
# Creates an instance of the object from a hash.
|
55
|
+
def self.from_hash(hash)
|
56
|
+
return nil unless hash
|
57
|
+
|
58
|
+
# Extract variables from the hash.
|
59
|
+
request_id = hash.key?('RequestId') ? hash['RequestId'] : nil
|
60
|
+
status = hash.key?('Status') ? hash['Status'] : nil
|
61
|
+
# Parameter is an array, so we need to iterate through it
|
62
|
+
data = nil
|
63
|
+
unless hash['Data'].nil?
|
64
|
+
data = []
|
65
|
+
hash['Data'].each do |structure|
|
66
|
+
data << (DataRetrieve.from_hash(structure) if structure)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
data = SKIP unless hash.key?('Data')
|
71
|
+
|
72
|
+
# Create object from extracted values.
|
73
|
+
GetChargeSessionRetrieveResponse200Json.new(request_id,
|
74
|
+
status,
|
75
|
+
data)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|