ev-recharge-sdk 1.0.0 → 1.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/README.md +38 -21
- data/lib/shell_ev/client.rb +8 -8
- data/lib/shell_ev/configuration.rb +13 -17
- 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
@@ -0,0 +1,82 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# BadRequestErrMsg Model.
|
8
|
+
class BadRequestErrMsg < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Error code
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :code
|
15
|
+
|
16
|
+
# Error desctiption in English
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :message
|
19
|
+
|
20
|
+
# Technical details of the error message, the example which is given in the
|
21
|
+
# sample payload is one of the scenarios. actual response will vary based on
|
22
|
+
# the validation error
|
23
|
+
# @return [String]
|
24
|
+
attr_accessor :description
|
25
|
+
|
26
|
+
# Technical details of the error message, the example which is given in the
|
27
|
+
# sample payload is one of the scenarios. actual response will vary based on
|
28
|
+
# the validation error
|
29
|
+
# @return [Array[String]]
|
30
|
+
attr_accessor :details
|
31
|
+
|
32
|
+
# A mapping from model property names to API property names.
|
33
|
+
def self.names
|
34
|
+
@_hash = {} if @_hash.nil?
|
35
|
+
@_hash['code'] = 'code'
|
36
|
+
@_hash['message'] = 'message'
|
37
|
+
@_hash['description'] = 'description'
|
38
|
+
@_hash['details'] = 'details'
|
39
|
+
@_hash
|
40
|
+
end
|
41
|
+
|
42
|
+
# An array for optional fields
|
43
|
+
def self.optionals
|
44
|
+
%w[
|
45
|
+
code
|
46
|
+
message
|
47
|
+
description
|
48
|
+
details
|
49
|
+
]
|
50
|
+
end
|
51
|
+
|
52
|
+
# An array for nullable fields
|
53
|
+
def self.nullables
|
54
|
+
[]
|
55
|
+
end
|
56
|
+
|
57
|
+
def initialize(code = SKIP, message = SKIP, description = SKIP,
|
58
|
+
details = SKIP)
|
59
|
+
@code = code unless code == SKIP
|
60
|
+
@message = message unless message == SKIP
|
61
|
+
@description = description unless description == SKIP
|
62
|
+
@details = details unless details == SKIP
|
63
|
+
end
|
64
|
+
|
65
|
+
# Creates an instance of the object from a hash.
|
66
|
+
def self.from_hash(hash)
|
67
|
+
return nil unless hash
|
68
|
+
|
69
|
+
# Extract variables from the hash.
|
70
|
+
code = hash.key?('code') ? hash['code'] : SKIP
|
71
|
+
message = hash.key?('message') ? hash['message'] : SKIP
|
72
|
+
description = hash.key?('description') ? hash['description'] : SKIP
|
73
|
+
details = hash.key?('details') ? hash['details'] : SKIP
|
74
|
+
|
75
|
+
# Create object from extracted values.
|
76
|
+
BadRequestErrMsg.new(code,
|
77
|
+
message,
|
78
|
+
description,
|
79
|
+
details)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -4,25 +4,33 @@
|
|
4
4
|
# ( https://apimatic.io ).
|
5
5
|
|
6
6
|
module ShellEv
|
7
|
-
#
|
8
|
-
class
|
7
|
+
# ChargeError Model.
|
8
|
+
class ChargeError < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
12
|
-
# Session
|
12
|
+
# Session code e.g InternalError
|
13
13
|
# @return [String]
|
14
|
-
attr_accessor :
|
14
|
+
attr_accessor :code
|
15
|
+
|
16
|
+
# Session message
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :message
|
15
19
|
|
16
20
|
# A mapping from model property names to API property names.
|
17
21
|
def self.names
|
18
22
|
@_hash = {} if @_hash.nil?
|
19
|
-
@_hash['
|
23
|
+
@_hash['code'] = 'code'
|
24
|
+
@_hash['message'] = 'message'
|
20
25
|
@_hash
|
21
26
|
end
|
22
27
|
|
23
28
|
# An array for optional fields
|
24
29
|
def self.optionals
|
25
|
-
[
|
30
|
+
%w[
|
31
|
+
code
|
32
|
+
message
|
33
|
+
]
|
26
34
|
end
|
27
35
|
|
28
36
|
# An array for nullable fields
|
@@ -30,8 +38,9 @@ module ShellEv
|
|
30
38
|
[]
|
31
39
|
end
|
32
40
|
|
33
|
-
def initialize(
|
34
|
-
@
|
41
|
+
def initialize(code = SKIP, message = SKIP)
|
42
|
+
@code = code unless code == SKIP
|
43
|
+
@message = message unless message == SKIP
|
35
44
|
end
|
36
45
|
|
37
46
|
# Creates an instance of the object from a hash.
|
@@ -39,10 +48,12 @@ module ShellEv
|
|
39
48
|
return nil unless hash
|
40
49
|
|
41
50
|
# Extract variables from the hash.
|
42
|
-
|
51
|
+
code = hash.key?('code') ? hash['code'] : SKIP
|
52
|
+
message = hash.key?('message') ? hash['message'] : SKIP
|
43
53
|
|
44
54
|
# Create object from extracted values.
|
45
|
-
|
55
|
+
ChargeError.new(code,
|
56
|
+
message)
|
46
57
|
end
|
47
58
|
end
|
48
59
|
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# shell_ev
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellEv
|
7
|
+
# ChargeRetrieveState Model.
|
8
|
+
class ChargeRetrieveState < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Describes the session state
|
13
|
+
# started, stopped, start-requested, stop-requested, failed-to-start,
|
14
|
+
# failed-to-stop
|
15
|
+
# @return [String]
|
16
|
+
attr_accessor :status
|
17
|
+
|
18
|
+
# Describes the session state
|
19
|
+
# started, stopped, start-requested, stop-requested, failed-to-start,
|
20
|
+
# failed-to-stop
|
21
|
+
# @return [ChargeError]
|
22
|
+
attr_accessor :error
|
23
|
+
|
24
|
+
# A mapping from model property names to API property names.
|
25
|
+
def self.names
|
26
|
+
@_hash = {} if @_hash.nil?
|
27
|
+
@_hash['status'] = 'status'
|
28
|
+
@_hash['error'] = 'error'
|
29
|
+
@_hash
|
30
|
+
end
|
31
|
+
|
32
|
+
# An array for optional fields
|
33
|
+
def self.optionals
|
34
|
+
%w[
|
35
|
+
status
|
36
|
+
error
|
37
|
+
]
|
38
|
+
end
|
39
|
+
|
40
|
+
# An array for nullable fields
|
41
|
+
def self.nullables
|
42
|
+
[]
|
43
|
+
end
|
44
|
+
|
45
|
+
def initialize(status = SKIP, error = SKIP)
|
46
|
+
@status = status unless status == SKIP
|
47
|
+
@error = error unless error == SKIP
|
48
|
+
end
|
49
|
+
|
50
|
+
# Creates an instance of the object from a hash.
|
51
|
+
def self.from_hash(hash)
|
52
|
+
return nil unless hash
|
53
|
+
|
54
|
+
# Extract variables from the hash.
|
55
|
+
status = hash.key?('status') ? hash['status'] : SKIP
|
56
|
+
error = ChargeError.from_hash(hash['error']) if hash['error']
|
57
|
+
|
58
|
+
# Create object from extracted values.
|
59
|
+
ChargeRetrieveState.new(status,
|
60
|
+
error)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -9,20 +9,19 @@ module ShellEv
|
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
12
|
-
#
|
12
|
+
# Ev charge number
|
13
13
|
# @return [String]
|
14
14
|
attr_accessor :ev_charge_number
|
15
15
|
|
16
|
-
#
|
17
|
-
# (ISO-IEC-15118)
|
16
|
+
# This is the Electric Vehicle EquipmentID
|
18
17
|
# @return [String]
|
19
18
|
attr_accessor :evse_id
|
20
19
|
|
21
20
|
# A mapping from model property names to API property names.
|
22
21
|
def self.names
|
23
22
|
@_hash = {} if @_hash.nil?
|
24
|
-
@_hash['ev_charge_number'] = '
|
25
|
-
@_hash['evse_id'] = '
|
23
|
+
@_hash['ev_charge_number'] = 'evChargeNumber'
|
24
|
+
@_hash['evse_id'] = 'evseId'
|
26
25
|
@_hash
|
27
26
|
end
|
28
27
|
|
@@ -36,8 +35,7 @@ module ShellEv
|
|
36
35
|
[]
|
37
36
|
end
|
38
37
|
|
39
|
-
def initialize(ev_charge_number = nil,
|
40
|
-
evse_id = nil)
|
38
|
+
def initialize(ev_charge_number = nil, evse_id = nil)
|
41
39
|
@ev_charge_number = ev_charge_number
|
42
40
|
@evse_id = evse_id
|
43
41
|
end
|
@@ -48,8 +46,8 @@ module ShellEv
|
|
48
46
|
|
49
47
|
# Extract variables from the hash.
|
50
48
|
ev_charge_number =
|
51
|
-
hash.key?('
|
52
|
-
evse_id = hash.key?('
|
49
|
+
hash.key?('evChargeNumber') ? hash['evChargeNumber'] : nil
|
50
|
+
evse_id = hash.key?('evseId') ? hash['evseId'] : nil
|
53
51
|
|
54
52
|
# Create object from extracted values.
|
55
53
|
ChargesessionStartBody.new(ev_charge_number,
|
@@ -36,7 +36,7 @@ module ShellEv
|
|
36
36
|
# @return [TariffVO]
|
37
37
|
attr_accessor :tariff
|
38
38
|
|
39
|
-
# ISO8601-compliant UTC datetime of the last update of the
|
39
|
+
# ISO8601-compliant UTC datetime of the last update of the Connector’s data
|
40
40
|
# @return [String]
|
41
41
|
attr_accessor :updated
|
42
42
|
|
@@ -83,14 +83,9 @@ module ShellEv
|
|
83
83
|
[]
|
84
84
|
end
|
85
85
|
|
86
|
-
def initialize(uid = SKIP,
|
87
|
-
|
88
|
-
|
89
|
-
electrical_properties = SKIP,
|
90
|
-
fixed_cable = SKIP,
|
91
|
-
tariff = SKIP,
|
92
|
-
updated = SKIP,
|
93
|
-
updated_by = SKIP,
|
86
|
+
def initialize(uid = SKIP, external_id = SKIP, connector_type = SKIP,
|
87
|
+
electrical_properties = SKIP, fixed_cable = SKIP,
|
88
|
+
tariff = SKIP, updated = SKIP, updated_by = SKIP,
|
94
89
|
deleted = SKIP)
|
95
90
|
@uid = uid unless uid == SKIP
|
96
91
|
@external_id = external_id unless external_id == SKIP
|
@@ -35,30 +35,25 @@ module ShellEv
|
|
35
35
|
# @return [DateTime]
|
36
36
|
attr_accessor :stopped_at
|
37
37
|
|
38
|
-
#
|
39
|
-
# @return [
|
38
|
+
# When the session is stopped
|
39
|
+
# @return [ChargeRetrieveState]
|
40
40
|
attr_accessor :session_state
|
41
41
|
|
42
|
-
#
|
43
|
-
# @return [DataActiveSessionCodeEnum]
|
44
|
-
attr_accessor :session_code
|
45
|
-
|
46
|
-
# Session message
|
42
|
+
# When the session is stopped
|
47
43
|
# @return [String]
|
48
|
-
attr_accessor :
|
44
|
+
attr_accessor :last_updated
|
49
45
|
|
50
46
|
# A mapping from model property names to API property names.
|
51
47
|
def self.names
|
52
48
|
@_hash = {} if @_hash.nil?
|
53
|
-
@_hash['id'] = '
|
54
|
-
@_hash['user_id'] = '
|
55
|
-
@_hash['ema_id'] = '
|
56
|
-
@_hash['evse_id'] = '
|
57
|
-
@_hash['started_at'] = '
|
58
|
-
@_hash['stopped_at'] = '
|
49
|
+
@_hash['id'] = 'id'
|
50
|
+
@_hash['user_id'] = 'userId'
|
51
|
+
@_hash['ema_id'] = 'emaId'
|
52
|
+
@_hash['evse_id'] = 'evseId'
|
53
|
+
@_hash['started_at'] = 'startedAt'
|
54
|
+
@_hash['stopped_at'] = 'stoppedAt'
|
59
55
|
@_hash['session_state'] = 'SessionState'
|
60
|
-
@_hash['
|
61
|
-
@_hash['session_message'] = 'SessionMessage'
|
56
|
+
@_hash['last_updated'] = 'lastUpdated'
|
62
57
|
@_hash
|
63
58
|
end
|
64
59
|
|
@@ -72,8 +67,7 @@ module ShellEv
|
|
72
67
|
started_at
|
73
68
|
stopped_at
|
74
69
|
session_state
|
75
|
-
|
76
|
-
session_message
|
70
|
+
last_updated
|
77
71
|
]
|
78
72
|
end
|
79
73
|
|
@@ -81,20 +75,12 @@ module ShellEv
|
|
81
75
|
def self.nullables
|
82
76
|
%w[
|
83
77
|
stopped_at
|
84
|
-
session_code
|
85
|
-
session_message
|
86
78
|
]
|
87
79
|
end
|
88
80
|
|
89
|
-
def initialize(id = SKIP,
|
90
|
-
|
91
|
-
|
92
|
-
evse_id = SKIP,
|
93
|
-
started_at = SKIP,
|
94
|
-
stopped_at = SKIP,
|
95
|
-
session_state = SKIP,
|
96
|
-
session_code = SKIP,
|
97
|
-
session_message = SKIP)
|
81
|
+
def initialize(id = SKIP, user_id = SKIP, ema_id = SKIP, evse_id = SKIP,
|
82
|
+
started_at = SKIP, stopped_at = SKIP, session_state = SKIP,
|
83
|
+
last_updated = SKIP)
|
98
84
|
@id = id unless id == SKIP
|
99
85
|
@user_id = user_id unless user_id == SKIP
|
100
86
|
@ema_id = ema_id unless ema_id == SKIP
|
@@ -102,8 +88,7 @@ module ShellEv
|
|
102
88
|
@started_at = started_at unless started_at == SKIP
|
103
89
|
@stopped_at = stopped_at unless stopped_at == SKIP
|
104
90
|
@session_state = session_state unless session_state == SKIP
|
105
|
-
@
|
106
|
-
@session_message = session_message unless session_message == SKIP
|
91
|
+
@last_updated = last_updated unless last_updated == SKIP
|
107
92
|
end
|
108
93
|
|
109
94
|
# Creates an instance of the object from a hash.
|
@@ -111,24 +96,22 @@ module ShellEv
|
|
111
96
|
return nil unless hash
|
112
97
|
|
113
98
|
# Extract variables from the hash.
|
114
|
-
id = hash.key?('
|
115
|
-
user_id = hash.key?('
|
116
|
-
ema_id = hash.key?('
|
117
|
-
evse_id = hash.key?('
|
118
|
-
started_at = if hash.key?('
|
119
|
-
(DateTimeHelper.from_rfc3339(hash['
|
99
|
+
id = hash.key?('id') ? hash['id'] : SKIP
|
100
|
+
user_id = hash.key?('userId') ? hash['userId'] : SKIP
|
101
|
+
ema_id = hash.key?('emaId') ? hash['emaId'] : SKIP
|
102
|
+
evse_id = hash.key?('evseId') ? hash['evseId'] : SKIP
|
103
|
+
started_at = if hash.key?('startedAt')
|
104
|
+
(DateTimeHelper.from_rfc3339(hash['startedAt']) if hash['startedAt'])
|
120
105
|
else
|
121
106
|
SKIP
|
122
107
|
end
|
123
|
-
stopped_at = if hash.key?('
|
124
|
-
(DateTimeHelper.from_rfc3339(hash['
|
108
|
+
stopped_at = if hash.key?('stoppedAt')
|
109
|
+
(DateTimeHelper.from_rfc3339(hash['stoppedAt']) if hash['stoppedAt'])
|
125
110
|
else
|
126
111
|
SKIP
|
127
112
|
end
|
128
|
-
session_state =
|
129
|
-
|
130
|
-
session_message =
|
131
|
-
hash.key?('SessionMessage') ? hash['SessionMessage'] : SKIP
|
113
|
+
session_state = ChargeRetrieveState.from_hash(hash['SessionState']) if hash['SessionState']
|
114
|
+
last_updated = hash.key?('lastUpdated') ? hash['lastUpdated'] : SKIP
|
132
115
|
|
133
116
|
# Create object from extracted values.
|
134
117
|
DataActive.new(id,
|
@@ -138,8 +121,7 @@ module ShellEv
|
|
138
121
|
started_at,
|
139
122
|
stopped_at,
|
140
123
|
session_state,
|
141
|
-
|
142
|
-
session_message)
|
124
|
+
last_updated)
|
143
125
|
end
|
144
126
|
|
145
127
|
def to_custom_started_at
|
@@ -26,6 +26,10 @@ module ShellEv
|
|
26
26
|
# @return [String]
|
27
27
|
attr_accessor :evse_id
|
28
28
|
|
29
|
+
# Last updated date
|
30
|
+
# @return [String]
|
31
|
+
attr_accessor :last_updated
|
32
|
+
|
29
33
|
# When the session is started
|
30
34
|
# @return [DateTime]
|
31
35
|
attr_accessor :started_at
|
@@ -34,30 +38,21 @@ module ShellEv
|
|
34
38
|
# @return [DateTime]
|
35
39
|
attr_accessor :stopped_at
|
36
40
|
|
37
|
-
#
|
38
|
-
# @return [
|
41
|
+
# When the session is stopped
|
42
|
+
# @return [ChargeRetrieveState]
|
39
43
|
attr_accessor :session_state
|
40
44
|
|
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
45
|
# A mapping from model property names to API property names.
|
50
46
|
def self.names
|
51
47
|
@_hash = {} if @_hash.nil?
|
52
|
-
@_hash['id'] = '
|
53
|
-
@_hash['user_id'] = '
|
54
|
-
@_hash['ema_id'] = '
|
55
|
-
@_hash['evse_id'] = '
|
56
|
-
@_hash['
|
57
|
-
@_hash['
|
58
|
-
@_hash['
|
59
|
-
@_hash['
|
60
|
-
@_hash['session_message'] = 'SessionMessage'
|
48
|
+
@_hash['id'] = 'id'
|
49
|
+
@_hash['user_id'] = 'userId'
|
50
|
+
@_hash['ema_id'] = 'emaId'
|
51
|
+
@_hash['evse_id'] = 'evseId'
|
52
|
+
@_hash['last_updated'] = 'lastUpdated'
|
53
|
+
@_hash['started_at'] = 'startedAt'
|
54
|
+
@_hash['stopped_at'] = 'stoppedAt'
|
55
|
+
@_hash['session_state'] = 'sessionState'
|
61
56
|
@_hash
|
62
57
|
end
|
63
58
|
|
@@ -68,11 +63,10 @@ module ShellEv
|
|
68
63
|
user_id
|
69
64
|
ema_id
|
70
65
|
evse_id
|
66
|
+
last_updated
|
71
67
|
started_at
|
72
68
|
stopped_at
|
73
69
|
session_state
|
74
|
-
session_code
|
75
|
-
session_message
|
76
70
|
]
|
77
71
|
end
|
78
72
|
|
@@ -80,29 +74,20 @@ module ShellEv
|
|
80
74
|
def self.nullables
|
81
75
|
%w[
|
82
76
|
stopped_at
|
83
|
-
session_code
|
84
|
-
session_message
|
85
77
|
]
|
86
78
|
end
|
87
79
|
|
88
|
-
def initialize(id = SKIP,
|
89
|
-
|
90
|
-
|
91
|
-
evse_id = SKIP,
|
92
|
-
started_at = SKIP,
|
93
|
-
stopped_at = SKIP,
|
94
|
-
session_state = SKIP,
|
95
|
-
session_code = SKIP,
|
96
|
-
session_message = SKIP)
|
80
|
+
def initialize(id = SKIP, user_id = SKIP, ema_id = SKIP, evse_id = SKIP,
|
81
|
+
last_updated = SKIP, started_at = SKIP, stopped_at = SKIP,
|
82
|
+
session_state = SKIP)
|
97
83
|
@id = id unless id == SKIP
|
98
84
|
@user_id = user_id unless user_id == SKIP
|
99
85
|
@ema_id = ema_id unless ema_id == SKIP
|
100
86
|
@evse_id = evse_id unless evse_id == SKIP
|
87
|
+
@last_updated = last_updated unless last_updated == SKIP
|
101
88
|
@started_at = started_at unless started_at == SKIP
|
102
89
|
@stopped_at = stopped_at unless stopped_at == SKIP
|
103
90
|
@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
91
|
end
|
107
92
|
|
108
93
|
# Creates an instance of the object from a hash.
|
@@ -110,35 +95,32 @@ module ShellEv
|
|
110
95
|
return nil unless hash
|
111
96
|
|
112
97
|
# Extract variables from the hash.
|
113
|
-
id = hash.key?('
|
114
|
-
user_id = hash.key?('
|
115
|
-
ema_id = hash.key?('
|
116
|
-
evse_id = hash.key?('
|
117
|
-
|
118
|
-
|
98
|
+
id = hash.key?('id') ? hash['id'] : SKIP
|
99
|
+
user_id = hash.key?('userId') ? hash['userId'] : SKIP
|
100
|
+
ema_id = hash.key?('emaId') ? hash['emaId'] : SKIP
|
101
|
+
evse_id = hash.key?('evseId') ? hash['evseId'] : SKIP
|
102
|
+
last_updated = hash.key?('lastUpdated') ? hash['lastUpdated'] : SKIP
|
103
|
+
started_at = if hash.key?('startedAt')
|
104
|
+
(DateTimeHelper.from_rfc3339(hash['startedAt']) if hash['startedAt'])
|
119
105
|
else
|
120
106
|
SKIP
|
121
107
|
end
|
122
|
-
stopped_at = if hash.key?('
|
123
|
-
(DateTimeHelper.from_rfc3339(hash['
|
108
|
+
stopped_at = if hash.key?('stoppedAt')
|
109
|
+
(DateTimeHelper.from_rfc3339(hash['stoppedAt']) if hash['stoppedAt'])
|
124
110
|
else
|
125
111
|
SKIP
|
126
112
|
end
|
127
|
-
session_state =
|
128
|
-
session_code = hash.key?('SessionCode') ? hash['SessionCode'] : SKIP
|
129
|
-
session_message =
|
130
|
-
hash.key?('SessionMessage') ? hash['SessionMessage'] : SKIP
|
113
|
+
session_state = ChargeRetrieveState.from_hash(hash['sessionState']) if hash['sessionState']
|
131
114
|
|
132
115
|
# Create object from extracted values.
|
133
116
|
DataRetrieve.new(id,
|
134
117
|
user_id,
|
135
118
|
ema_id,
|
136
119
|
evse_id,
|
120
|
+
last_updated,
|
137
121
|
started_at,
|
138
122
|
stopped_at,
|
139
|
-
session_state
|
140
|
-
session_code,
|
141
|
-
session_message)
|
123
|
+
session_state)
|
142
124
|
end
|
143
125
|
|
144
126
|
def to_custom_started_at
|
@@ -50,9 +50,7 @@ module ShellEv
|
|
50
50
|
[]
|
51
51
|
end
|
52
52
|
|
53
|
-
def initialize(power_type = SKIP,
|
54
|
-
voltage = SKIP,
|
55
|
-
amperage = SKIP,
|
53
|
+
def initialize(power_type = SKIP, voltage = SKIP, amperage = SKIP,
|
56
54
|
max_electric_power = SKIP)
|
57
55
|
@power_type = power_type unless power_type == SKIP
|
58
56
|
@voltage = voltage unless voltage == SKIP
|
@@ -82,14 +82,9 @@ module ShellEv
|
|
82
82
|
[]
|
83
83
|
end
|
84
84
|
|
85
|
-
def initialize(uid = SKIP,
|
86
|
-
|
87
|
-
|
88
|
-
status = SKIP,
|
89
|
-
connectors = SKIP,
|
90
|
-
authorization_methods = SKIP,
|
91
|
-
updated = SKIP,
|
92
|
-
deleted = SKIP,
|
85
|
+
def initialize(uid = SKIP, external_id = SKIP, evse_id = SKIP,
|
86
|
+
status = SKIP, connectors = SKIP,
|
87
|
+
authorization_methods = SKIP, updated = SKIP, deleted = SKIP,
|
93
88
|
physical_reference = SKIP)
|
94
89
|
@uid = uid unless uid == SKIP
|
95
90
|
@external_id = external_id unless external_id == SKIP
|
@@ -9,8 +9,8 @@ module ShellEv
|
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
12
|
-
#
|
13
|
-
#
|
12
|
+
# Mandatory UUID (according to RFC 4122 standards) for requests and
|
13
|
+
# responses. This will be played back in the response from the request.
|
14
14
|
# @return [UUID | String]
|
15
15
|
attr_accessor :request_id
|
16
16
|
|
@@ -25,9 +25,9 @@ module ShellEv
|
|
25
25
|
# A mapping from model property names to API property names.
|
26
26
|
def self.names
|
27
27
|
@_hash = {} if @_hash.nil?
|
28
|
-
@_hash['request_id'] = '
|
29
|
-
@_hash['status'] = '
|
30
|
-
@_hash['data'] = '
|
28
|
+
@_hash['request_id'] = 'requestId'
|
29
|
+
@_hash['status'] = 'status'
|
30
|
+
@_hash['data'] = 'data'
|
31
31
|
@_hash
|
32
32
|
end
|
33
33
|
|
@@ -43,9 +43,7 @@ module ShellEv
|
|
43
43
|
[]
|
44
44
|
end
|
45
45
|
|
46
|
-
def initialize(request_id = nil,
|
47
|
-
status = nil,
|
48
|
-
data = SKIP)
|
46
|
+
def initialize(request_id = nil, status = nil, data = SKIP)
|
49
47
|
@request_id = request_id
|
50
48
|
@status = status
|
51
49
|
@data = data unless data == SKIP
|
@@ -56,18 +54,18 @@ module ShellEv
|
|
56
54
|
return nil unless hash
|
57
55
|
|
58
56
|
# Extract variables from the hash.
|
59
|
-
request_id = hash.key?('
|
60
|
-
status = hash.key?('
|
57
|
+
request_id = hash.key?('requestId') ? hash['requestId'] : nil
|
58
|
+
status = hash.key?('status') ? hash['status'] : nil
|
61
59
|
# Parameter is an array, so we need to iterate through it
|
62
60
|
data = nil
|
63
|
-
unless hash['
|
61
|
+
unless hash['data'].nil?
|
64
62
|
data = []
|
65
|
-
hash['
|
63
|
+
hash['data'].each do |structure|
|
66
64
|
data << (DataRetrieve.from_hash(structure) if structure)
|
67
65
|
end
|
68
66
|
end
|
69
67
|
|
70
|
-
data = SKIP unless hash.key?('
|
68
|
+
data = SKIP unless hash.key?('data')
|
71
69
|
|
72
70
|
# Create object from extracted values.
|
73
71
|
GetChargeSessionRetrieveResponse200Json.new(request_id,
|