ev-recharge-sdk 1.3.0 → 2.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.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +91 -25
  4. data/bin/console +15 -0
  5. data/lib/shell_ev/api_helper.rb +2 -2
  6. data/lib/shell_ev/client.rb +15 -4
  7. data/lib/shell_ev/configuration.rb +88 -15
  8. data/lib/shell_ev/controllers/base_controller.rb +3 -9
  9. data/lib/shell_ev/controllers/charging_controller.rb +19 -18
  10. data/lib/shell_ev/controllers/locations_controller.rb +48 -50
  11. data/lib/shell_ev/controllers/o_auth_authorization_controller.rb +5 -5
  12. data/lib/shell_ev/exceptions/api_exception.rb +13 -2
  13. data/lib/shell_ev/exceptions/bad_request_exception.rb +20 -5
  14. data/lib/shell_ev/exceptions/internal_server_error_exception.rb +21 -5
  15. data/lib/shell_ev/exceptions/not_found_exception.rb +20 -5
  16. data/lib/shell_ev/exceptions/o_auth_provider_exception.rb +21 -5
  17. data/lib/shell_ev/exceptions/serviceunavailable_exception.rb +20 -5
  18. data/lib/shell_ev/exceptions/too_many_requests_exception.rb +20 -5
  19. data/lib/shell_ev/exceptions/unauthorized_exception.rb +20 -5
  20. data/lib/shell_ev/exceptions/v2_charge_session_retrieve404_error_exception.rb +67 -0
  21. data/lib/shell_ev/exceptions/v2_charge_session_start404_error_exception.rb +67 -0
  22. data/lib/shell_ev/exceptions/v2_charge_session_stop404_error_exception.rb +67 -0
  23. data/lib/shell_ev/http/auth/o_auth2.rb +18 -3
  24. data/lib/shell_ev/http/http_call_back.rb +2 -2
  25. data/lib/shell_ev/http/http_method_enum.rb +2 -2
  26. data/lib/shell_ev/http/http_request.rb +2 -2
  27. data/lib/shell_ev/http/http_response.rb +2 -2
  28. data/lib/shell_ev/http/proxy_settings.rb +22 -0
  29. data/lib/shell_ev/models/accessibility_status_enum.rb +17 -2
  30. data/lib/shell_ev/models/{accessibility.rb → accessibility_v2.rb} +17 -14
  31. data/lib/shell_ev/models/active_response200_json.rb +15 -2
  32. data/lib/shell_ev/models/active_response200_json_status_enum.rb +15 -2
  33. data/lib/shell_ev/models/address.rb +16 -2
  34. data/lib/shell_ev/models/bad_request_err_msg.rb +16 -2
  35. data/lib/shell_ev/models/base_model.rb +2 -2
  36. data/lib/shell_ev/models/charge_error.rb +14 -2
  37. data/lib/shell_ev/models/charge_retrieve_state.rb +14 -2
  38. data/lib/shell_ev/models/chargesession_start_body.rb +15 -2
  39. data/lib/shell_ev/models/connector_types_enum.rb +100 -0
  40. data/lib/shell_ev/models/connector_v2.rb +95 -0
  41. data/lib/shell_ev/models/connector_vo_connector_type_enum.rb +31 -2
  42. data/lib/shell_ev/models/connector_vo_updated_by_enum.rb +17 -2
  43. data/lib/shell_ev/models/coordinates.rb +14 -2
  44. data/lib/shell_ev/models/coordinates1.rb +81 -0
  45. data/lib/shell_ev/models/data_active.rb +19 -2
  46. data/lib/shell_ev/models/data_retrieve.rb +19 -2
  47. data/lib/shell_ev/models/day_of_week_enum.rb +56 -0
  48. data/lib/shell_ev/models/electrical_properties_power_type_enum.rb +16 -2
  49. data/lib/shell_ev/models/{electrical_properties.rb → electrical_properties_v2.rb} +22 -8
  50. data/lib/shell_ev/models/evse_status_enum.rb +44 -0
  51. data/lib/shell_ev/models/{evse_vo.rb → evse_v2.rb} +45 -38
  52. data/lib/shell_ev/models/evse_vo_authorization_methods_enum.rb +16 -2
  53. data/lib/shell_ev/models/evse_vo_status_enum.rb +17 -2
  54. data/lib/shell_ev/models/get_charge_session_retrieve_response200_json.rb +15 -2
  55. data/lib/shell_ev/models/get_charge_session_retrieve_response200_json_status_enum.rb +15 -2
  56. data/lib/shell_ev/models/get_ev_locations_authorization_methods_enum.rb +16 -2
  57. data/lib/shell_ev/models/get_ev_locations_connector_types_enum.rb +31 -2
  58. data/lib/shell_ev/models/get_ev_locations_evse_status_enum.rb +17 -2
  59. data/lib/shell_ev/models/inline_response202.rb +17 -6
  60. data/lib/shell_ev/models/inline_response2021.rb +14 -2
  61. data/lib/shell_ev/models/inline_response2021_status_enum.rb +15 -2
  62. data/lib/shell_ev/models/inline_response202_data.rb +14 -2
  63. data/lib/shell_ev/models/inline_response202_status_enum.rb +15 -2
  64. data/lib/shell_ev/models/internal_error_object.rb +15 -2
  65. data/lib/shell_ev/models/{location_respone_object.rb → location_respone_object_v2.rb} +61 -30
  66. data/lib/shell_ev/models/locations_markers_authorization_methods_enum.rb +16 -2
  67. data/lib/shell_ev/models/locations_markers_connector_types_enum.rb +31 -2
  68. data/lib/shell_ev/models/locations_markers_evse_status_enum.rb +17 -2
  69. data/lib/shell_ev/models/multi_location_marker.rb +22 -5
  70. data/lib/shell_ev/models/multi_location_marker_v2.rb +126 -0
  71. data/lib/shell_ev/models/nearby_locations_authorization_methods_enum.rb +16 -2
  72. data/lib/shell_ev/models/nearby_locations_connector_types_enum.rb +31 -2
  73. data/lib/shell_ev/models/nearby_locations_evse_status_enum.rb +17 -2
  74. data/lib/shell_ev/models/not_found_err_msg.rb +16 -2
  75. data/lib/shell_ev/models/o_auth_provider_error_enum.rb +19 -2
  76. data/lib/shell_ev/models/o_auth_token.rb +2 -2
  77. data/lib/shell_ev/models/opening_hours_object.rb +17 -3
  78. data/lib/shell_ev/models/opening_hours_object_week_day_enum.rb +20 -2
  79. data/lib/shell_ev/models/power_range.rb +68 -0
  80. data/lib/shell_ev/models/price_component.rb +86 -0
  81. data/lib/shell_ev/models/ratelimit_err_msg.rb +16 -2
  82. data/lib/shell_ev/models/{response.rb → response_v2.rb} +22 -9
  83. data/lib/shell_ev/models/restrictions.rb +183 -0
  84. data/lib/shell_ev/models/search_by_id_connector.rb +115 -0
  85. data/lib/shell_ev/models/search_by_id_evse.rb +145 -0
  86. data/lib/shell_ev/models/search_by_id_location_respone.rb +196 -0
  87. data/lib/shell_ev/models/search_by_id_response.rb +91 -0
  88. data/lib/shell_ev/models/serviceunavailable_err_msg.rb +16 -2
  89. data/lib/shell_ev/models/single_location_marker.rb +27 -6
  90. data/lib/shell_ev/models/single_location_marker_authorization_methods_items_enum.rb +16 -2
  91. data/lib/shell_ev/models/single_location_marker_response.rb +15 -2
  92. data/lib/shell_ev/models/single_location_marker_response_v2.rb +94 -0
  93. data/lib/shell_ev/models/single_location_marker_status_enum.rb +17 -2
  94. data/lib/shell_ev/models/single_location_marker_v2.rb +157 -0
  95. data/lib/shell_ev/models/tariff.rb +20 -3
  96. data/lib/shell_ev/models/tariff_alt_text.rb +68 -0
  97. data/lib/shell_ev/models/tariff_element.rb +80 -0
  98. data/lib/shell_ev/models/tariff_type_enum.rb +44 -0
  99. data/lib/shell_ev/models/tariff_v2.rb +226 -0
  100. data/lib/shell_ev/models/tariff_vo_updated_by_enum.rb +17 -2
  101. data/lib/shell_ev/models/type_enum.rb +44 -0
  102. data/lib/shell_ev/models/unauthorized_err_msg.rb +16 -2
  103. data/lib/shell_ev/utilities/date_time_helper.rb +2 -2
  104. data/lib/shell_ev/utilities/file_wrapper.rb +16 -4
  105. data/lib/shell_ev/utilities/union_type_lookup.rb +19 -2
  106. data/lib/shell_ev.rb +34 -10
  107. data/test/controllers/controller_test_base.rb +5 -10
  108. data/test/controllers/test_charging_controller.rb +7 -11
  109. data/test/controllers/test_locations_controller.rb +8 -11
  110. data/test/http_response_catcher.rb +3 -3
  111. metadata +38 -15
  112. data/lib/shell_ev/models/connector_vo.rb +0 -131
  113. data/lib/shell_ev/models/tariff_vo.rb +0 -107
@@ -0,0 +1,145 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.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 SearchByIdEvse < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Internal identifier used to refer to single individual EVSE unit.
14
+ # @return [String]
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
+ # ISO8601-compliant UTC datetime of the last update of the EVSE
30
+ # @return [String]
31
+ attr_accessor :updated
32
+
33
+ # An optional number/string printed on the outside of the EVSE for visual
34
+ # identification
35
+ # @return [String]
36
+ attr_accessor :physical_reference
37
+
38
+ # List of all connectors available on this EVSE unit.
39
+ # @return [Array[SearchByIdConnector]]
40
+ attr_accessor :connectors
41
+
42
+ # Methods that can be used to Authorize sessions on this EVSE
43
+ # @return [Array[SingleLocationMarkerAuthorizationMethodsItemsEnum]]
44
+ attr_accessor :authorization_methods
45
+
46
+ # A mapping from model property names to API property names.
47
+ def self.names
48
+ @_hash = {} if @_hash.nil?
49
+ @_hash['uid'] = 'uid'
50
+ @_hash['external_id'] = 'externalId'
51
+ @_hash['evse_id'] = 'evseId'
52
+ @_hash['status'] = 'status'
53
+ @_hash['updated'] = 'updated'
54
+ @_hash['physical_reference'] = 'physicalReference'
55
+ @_hash['connectors'] = 'connectors'
56
+ @_hash['authorization_methods'] = 'authorizationMethods'
57
+ @_hash
58
+ end
59
+
60
+ # An array for optional fields
61
+ def self.optionals
62
+ %w[
63
+ uid
64
+ external_id
65
+ evse_id
66
+ status
67
+ updated
68
+ physical_reference
69
+ connectors
70
+ authorization_methods
71
+ ]
72
+ end
73
+
74
+ # An array for nullable fields
75
+ def self.nullables
76
+ []
77
+ end
78
+
79
+ def initialize(uid = SKIP, external_id = SKIP, evse_id = SKIP,
80
+ status = SKIP, updated = SKIP, physical_reference = SKIP,
81
+ connectors = SKIP, authorization_methods = SKIP)
82
+ @uid = uid unless uid == SKIP
83
+ @external_id = external_id unless external_id == SKIP
84
+ @evse_id = evse_id unless evse_id == SKIP
85
+ @status = status unless status == SKIP
86
+ @updated = updated unless updated == SKIP
87
+ @physical_reference = physical_reference unless physical_reference == SKIP
88
+ @connectors = connectors unless connectors == SKIP
89
+ @authorization_methods = authorization_methods unless authorization_methods == SKIP
90
+ end
91
+
92
+ # Creates an instance of the object from a hash.
93
+ def self.from_hash(hash)
94
+ return nil unless hash
95
+
96
+ # Extract variables from the hash.
97
+ uid = hash.key?('uid') ? hash['uid'] : SKIP
98
+ external_id = hash.key?('externalId') ? hash['externalId'] : SKIP
99
+ evse_id = hash.key?('evseId') ? hash['evseId'] : SKIP
100
+ status = hash.key?('status') ? hash['status'] : SKIP
101
+ updated = hash.key?('updated') ? hash['updated'] : SKIP
102
+ physical_reference =
103
+ hash.key?('physicalReference') ? hash['physicalReference'] : SKIP
104
+ # Parameter is an array, so we need to iterate through it
105
+ connectors = nil
106
+ unless hash['connectors'].nil?
107
+ connectors = []
108
+ hash['connectors'].each do |structure|
109
+ connectors << (SearchByIdConnector.from_hash(structure) if structure)
110
+ end
111
+ end
112
+
113
+ connectors = SKIP unless hash.key?('connectors')
114
+ authorization_methods =
115
+ hash.key?('authorizationMethods') ? hash['authorizationMethods'] : SKIP
116
+
117
+ # Create object from extracted values.
118
+ SearchByIdEvse.new(uid,
119
+ external_id,
120
+ evse_id,
121
+ status,
122
+ updated,
123
+ physical_reference,
124
+ connectors,
125
+ authorization_methods)
126
+ end
127
+
128
+ # Provides a human-readable string representation of the object.
129
+ def to_s
130
+ class_name = self.class.name.split('::').last
131
+ "<#{class_name} uid: #{@uid}, external_id: #{@external_id}, evse_id: #{@evse_id}, status:"\
132
+ " #{@status}, updated: #{@updated}, physical_reference: #{@physical_reference}, connectors:"\
133
+ " #{@connectors}, authorization_methods: #{@authorization_methods}>"
134
+ end
135
+
136
+ # Provides a debugging-friendly string with detailed object information.
137
+ def inspect
138
+ class_name = self.class.name.split('::').last
139
+ "<#{class_name} uid: #{@uid.inspect}, external_id: #{@external_id.inspect}, evse_id:"\
140
+ " #{@evse_id.inspect}, status: #{@status.inspect}, updated: #{@updated.inspect},"\
141
+ " physical_reference: #{@physical_reference.inspect}, connectors: #{@connectors.inspect},"\
142
+ " authorization_methods: #{@authorization_methods.inspect}>"
143
+ end
144
+ end
145
+ end
@@ -0,0 +1,196 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module ShellEv
7
+ # SearchByIdLocationRespone Model.
8
+ class SearchByIdLocationRespone < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Unique Internal identifier used to refer to this Location by Shell
13
+ # Recharge
14
+ # @return [String]
15
+ attr_accessor :uid
16
+
17
+ # Identifier as given by the Shell Recharge Operator, unique for that
18
+ # Operator
19
+ # @return [String]
20
+ attr_accessor :external_id
21
+
22
+ # Coordinates of the Shell Recharge Site Location
23
+ # @return [Coordinates]
24
+ attr_accessor :coordinates
25
+
26
+ # Operator of this Shell Recharge Location
27
+ # @return [String]
28
+ attr_accessor :operator_name
29
+
30
+ # Address of the Shell Recharge Location
31
+ # @return [Address]
32
+ attr_accessor :address
33
+
34
+ # Accessibility of the Location
35
+ # @return [AccessibilityV2]
36
+ attr_accessor :accessibility
37
+
38
+ # Accessibility of the Location
39
+ # @return [Array[SearchByIdEvse]]
40
+ attr_accessor :evses
41
+
42
+ # Optional Opening Hours of the Location. Please note that it is not
43
+ # available for all sites.
44
+ # @return [Array[OpeningHoursObject]]
45
+ attr_accessor :opening_hours
46
+
47
+ # ISO8601-compliant UTC datetime of the last update of the location
48
+ # @return [String]
49
+ attr_accessor :updated
50
+
51
+ # the type of the location. Could be "UNKNOWN".
52
+ # @return [String]
53
+ attr_accessor :location_type
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
+
63
+ # A mapping from model property names to API property names.
64
+ def self.names
65
+ @_hash = {} if @_hash.nil?
66
+ @_hash['uid'] = 'uid'
67
+ @_hash['external_id'] = 'externalId'
68
+ @_hash['coordinates'] = 'coordinates'
69
+ @_hash['operator_name'] = 'operatorName'
70
+ @_hash['address'] = 'address'
71
+ @_hash['accessibility'] = 'accessibility'
72
+ @_hash['evses'] = 'evses'
73
+ @_hash['opening_hours'] = 'openingHours'
74
+ @_hash['updated'] = 'updated'
75
+ @_hash['location_type'] = 'locationType'
76
+ @_hash['operator_id'] = 'operatorId'
77
+ @_hash['open_twenty_four_seven'] = 'openTwentyFourSeven'
78
+ @_hash
79
+ end
80
+
81
+ # An array for optional fields
82
+ def self.optionals
83
+ %w[
84
+ uid
85
+ external_id
86
+ coordinates
87
+ operator_name
88
+ address
89
+ accessibility
90
+ evses
91
+ opening_hours
92
+ updated
93
+ location_type
94
+ operator_id
95
+ open_twenty_four_seven
96
+ ]
97
+ end
98
+
99
+ # An array for nullable fields
100
+ def self.nullables
101
+ []
102
+ end
103
+
104
+ def initialize(uid = SKIP, external_id = SKIP, coordinates = SKIP,
105
+ operator_name = SKIP, address = SKIP, accessibility = SKIP,
106
+ evses = SKIP, opening_hours = SKIP, updated = SKIP,
107
+ location_type = SKIP, operator_id = SKIP,
108
+ open_twenty_four_seven = SKIP)
109
+ @uid = uid unless uid == SKIP
110
+ @external_id = external_id unless external_id == SKIP
111
+ @coordinates = coordinates unless coordinates == SKIP
112
+ @operator_name = operator_name unless operator_name == SKIP
113
+ @address = address unless address == SKIP
114
+ @accessibility = accessibility unless accessibility == SKIP
115
+ @evses = evses unless evses == SKIP
116
+ @opening_hours = opening_hours unless opening_hours == SKIP
117
+ @updated = updated unless updated == SKIP
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
121
+ end
122
+
123
+ # Creates an instance of the object from a hash.
124
+ def self.from_hash(hash)
125
+ return nil unless hash
126
+
127
+ # Extract variables from the hash.
128
+ uid = hash.key?('uid') ? hash['uid'] : SKIP
129
+ external_id = hash.key?('externalId') ? hash['externalId'] : SKIP
130
+ coordinates = Coordinates.from_hash(hash['coordinates']) if hash['coordinates']
131
+ operator_name = hash.key?('operatorName') ? hash['operatorName'] : SKIP
132
+ address = Address.from_hash(hash['address']) if hash['address']
133
+ accessibility = AccessibilityV2.from_hash(hash['accessibility']) if hash['accessibility']
134
+ # Parameter is an array, so we need to iterate through it
135
+ evses = nil
136
+ unless hash['evses'].nil?
137
+ evses = []
138
+ hash['evses'].each do |structure|
139
+ evses << (SearchByIdEvse.from_hash(structure) if structure)
140
+ end
141
+ end
142
+
143
+ evses = SKIP unless hash.key?('evses')
144
+ # Parameter is an array, so we need to iterate through it
145
+ opening_hours = nil
146
+ unless hash['openingHours'].nil?
147
+ opening_hours = []
148
+ hash['openingHours'].each do |structure|
149
+ opening_hours << (OpeningHoursObject.from_hash(structure) if structure)
150
+ end
151
+ end
152
+
153
+ opening_hours = SKIP unless hash.key?('openingHours')
154
+ updated = hash.key?('updated') ? hash['updated'] : SKIP
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
159
+
160
+ # Create object from extracted values.
161
+ SearchByIdLocationRespone.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)
173
+ end
174
+
175
+ # Provides a human-readable string representation of the object.
176
+ def to_s
177
+ class_name = self.class.name.split('::').last
178
+ "<#{class_name} uid: #{@uid}, external_id: #{@external_id}, coordinates: #{@coordinates},"\
179
+ " operator_name: #{@operator_name}, address: #{@address}, accessibility: #{@accessibility},"\
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}>"
183
+ end
184
+
185
+ # Provides a debugging-friendly string with detailed object information.
186
+ def inspect
187
+ class_name = self.class.name.split('::').last
188
+ "<#{class_name} uid: #{@uid.inspect}, external_id: #{@external_id.inspect}, coordinates:"\
189
+ " #{@coordinates.inspect}, operator_name: #{@operator_name.inspect}, address:"\
190
+ " #{@address.inspect}, accessibility: #{@accessibility.inspect}, evses: #{@evses.inspect},"\
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}>"
194
+ end
195
+ end
196
+ end
@@ -0,0 +1,91 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module ShellEv
7
+ # SearchByIdResponse Model.
8
+ class SearchByIdResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # requestId is unique identifier value that is attached to requests and
13
+ # messages that allow reference to a particular transaction or event chain.
14
+ # @return [UUID | String]
15
+ attr_accessor :request_id
16
+
17
+ # status of the API call
18
+ # @return [String]
19
+ attr_accessor :status
20
+
21
+ # API Response
22
+ # @return [Array[SearchByIdLocationRespone]]
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
+ request_id
38
+ status
39
+ data
40
+ ]
41
+ end
42
+
43
+ # An array for nullable fields
44
+ def self.nullables
45
+ []
46
+ end
47
+
48
+ def initialize(request_id = SKIP, status = SKIP, data = SKIP)
49
+ @request_id = request_id unless request_id == SKIP
50
+ @status = status unless status == SKIP
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'] : SKIP
60
+ status = hash.key?('status') ? hash['status'] : SKIP
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 << (SearchByIdLocationRespone.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
+ SearchByIdResponse.new(request_id,
74
+ status,
75
+ data)
76
+ end
77
+
78
+ # Provides a human-readable string representation of the object.
79
+ def to_s
80
+ class_name = self.class.name.split('::').last
81
+ "<#{class_name} request_id: #{@request_id}, status: #{@status}, data: #{@data}>"
82
+ end
83
+
84
+ # Provides a debugging-friendly string with detailed object information.
85
+ def inspect
86
+ class_name = self.class.name.split('::').last
87
+ "<#{class_name} request_id: #{@request_id.inspect}, status: #{@status.inspect}, data:"\
88
+ " #{@data.inspect}>"
89
+ end
90
+ end
91
+ end
@@ -1,7 +1,7 @@
1
1
  # shell_ev
2
2
  #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
5
 
6
6
  module ShellEv
7
7
  # ServiceunavailableErrMsg Model.
@@ -78,5 +78,19 @@ module ShellEv
78
78
  description,
79
79
  details)
80
80
  end
81
+
82
+ # Provides a human-readable string representation of the object.
83
+ def to_s
84
+ class_name = self.class.name.split('::').last
85
+ "<#{class_name} code: #{@code}, message: #{@message}, description: #{@description},"\
86
+ " details: #{@details}>"
87
+ end
88
+
89
+ # Provides a debugging-friendly string with detailed object information.
90
+ def inspect
91
+ class_name = self.class.name.split('::').last
92
+ "<#{class_name} code: #{@code.inspect}, message: #{@message.inspect}, description:"\
93
+ " #{@description.inspect}, details: #{@details.inspect}>"
94
+ end
81
95
  end
82
96
  end
@@ -1,7 +1,7 @@
1
1
  # shell_ev
2
2
  #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
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 a single Location
@@ -18,12 +18,14 @@ module ShellEv
18
18
  # @return [String]
19
19
  attr_accessor :unique_key
20
20
 
21
- # Uniquely identifies the marker object
21
+ # Minimum of all status values in the Marker, e.g. if at least one Evse in
22
+ # the Marker is available, the value will be available
22
23
  # @return [SingleLocationMarkerStatusEnum]
23
24
  attr_accessor :status
24
25
 
25
- # Coordinates of the Shell Recharge Site Location
26
- # @return [Coordinates]
26
+ # Minimum of all status values in the Marker, e.g. if at least one Evse in
27
+ # the Marker is available, the value will be available
28
+ # @return [Coordinates1]
27
29
  attr_accessor :coordinates
28
30
 
29
31
  # Total number of Evse units in Locations that this Marker represents
@@ -111,7 +113,7 @@ module ShellEv
111
113
  marker_type = hash.key?('markerType') ? hash['markerType'] : nil
112
114
  unique_key = hash.key?('uniqueKey') ? hash['uniqueKey'] : SKIP
113
115
  status = hash.key?('status') ? hash['status'] : SKIP
114
- coordinates = Coordinates.from_hash(hash['coordinates']) if hash['coordinates']
116
+ coordinates = Coordinates1.from_hash(hash['coordinates']) if hash['coordinates']
115
117
  evse_count = hash.key?('evseCount') ? hash['evseCount'] : SKIP
116
118
  max_power = hash.key?('maxPower') ? hash['maxPower'] : SKIP
117
119
  geo_hash = hash.key?('geoHash') ? hash['geoHash'] : SKIP
@@ -146,5 +148,24 @@ module ShellEv
146
148
  APIHelper.valid_type?(value['markerType'],
147
149
  ->(val) { val.instance_of? String })
148
150
  end
151
+
152
+ # Provides a human-readable string representation of the object.
153
+ def to_s
154
+ class_name = self.class.name.split('::').last
155
+ "<#{class_name} marker_type: #{@marker_type}, unique_key: #{@unique_key}, status:"\
156
+ " #{@status}, coordinates: #{@coordinates}, evse_count: #{@evse_count}, max_power:"\
157
+ " #{@max_power}, geo_hash: #{@geo_hash}, location_uid: #{@location_uid},"\
158
+ " authorization_methods: #{@authorization_methods}, operator_id: #{@operator_id}>"
159
+ end
160
+
161
+ # Provides a debugging-friendly string with detailed object information.
162
+ def inspect
163
+ class_name = self.class.name.split('::').last
164
+ "<#{class_name} marker_type: #{@marker_type.inspect}, unique_key: #{@unique_key.inspect},"\
165
+ " status: #{@status.inspect}, coordinates: #{@coordinates.inspect}, evse_count:"\
166
+ " #{@evse_count.inspect}, max_power: #{@max_power.inspect}, geo_hash: #{@geo_hash.inspect},"\
167
+ " location_uid: #{@location_uid.inspect}, authorization_methods:"\
168
+ " #{@authorization_methods.inspect}, operator_id: #{@operator_id.inspect}>"
169
+ end
149
170
  end
150
171
  end
@@ -1,7 +1,7 @@
1
1
  # shell_ev
2
2
  #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
5
 
6
6
  module ShellEv
7
7
  # singleLocationMarkerAuthorizationMethodsItems.
@@ -22,5 +22,19 @@ module ShellEv
22
22
 
23
23
  SINGLE_LOCATION_MARKER_AUTHORIZATION_METHODS_ITEMS_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 v2.0
4
- # ( https://apimatic.io ).
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
5
 
6
6
  module ShellEv
7
7
  # SingleLocationMarkerResponse Model.
@@ -77,5 +77,18 @@ module ShellEv
77
77
 
78
78
  true
79
79
  end
80
+
81
+ # Provides a human-readable string representation of the object.
82
+ def to_s
83
+ class_name = self.class.name.split('::').last
84
+ "<#{class_name} request_id: #{@request_id}, status: #{@status}, data: #{@data}>"
85
+ end
86
+
87
+ # Provides a debugging-friendly string with detailed object information.
88
+ def inspect
89
+ class_name = self.class.name.split('::').last
90
+ "<#{class_name} request_id: #{@request_id.inspect}, status: #{@status.inspect}, data:"\
91
+ " #{@data.inspect}>"
92
+ end
80
93
  end
81
94
  end
@@ -0,0 +1,94 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module ShellEv
7
+ # SingleLocationMarkerResponseV2 Model.
8
+ class SingleLocationMarkerResponseV2 < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # requestId is unique identifier value that is attached to requests and
13
+ # messages that allow reference to a particular transaction or event chain.
14
+ # @return [UUID | String]
15
+ attr_accessor :request_id
16
+
17
+ # status of the API call
18
+ # @return [String]
19
+ attr_accessor :status
20
+
21
+ # status of the API call
22
+ # @return [Array[Object]]
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
+ request_id
38
+ status
39
+ data
40
+ ]
41
+ end
42
+
43
+ # An array for nullable fields
44
+ def self.nullables
45
+ []
46
+ end
47
+
48
+ def initialize(request_id = SKIP, status = SKIP, data = SKIP)
49
+ @request_id = request_id unless request_id == SKIP
50
+ @status = status unless status == SKIP
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'] : SKIP
60
+ status = hash.key?('status') ? hash['status'] : SKIP
61
+ data = hash.key?('data') ? APIHelper.deserialize_union_type(
62
+ UnionTypeLookUp.get(:LocationMarkerV2), hash['data']
63
+ ) : SKIP
64
+
65
+ # Create object from extracted values.
66
+ SingleLocationMarkerResponseV2.new(request_id,
67
+ status,
68
+ data)
69
+ end
70
+
71
+ # Validates an instance of the object from a given value.
72
+ # @param [SingleLocationMarkerResponseV2 | Hash] The value against the validation is performed.
73
+ def self.validate(value)
74
+ return true if value.instance_of? self
75
+
76
+ return false unless value.instance_of? Hash
77
+
78
+ true
79
+ end
80
+
81
+ # Provides a human-readable string representation of the object.
82
+ def to_s
83
+ class_name = self.class.name.split('::').last
84
+ "<#{class_name} request_id: #{@request_id}, status: #{@status}, data: #{@data}>"
85
+ end
86
+
87
+ # Provides a debugging-friendly string with detailed object information.
88
+ def inspect
89
+ class_name = self.class.name.split('::').last
90
+ "<#{class_name} request_id: #{@request_id.inspect}, status: #{@status.inspect}, data:"\
91
+ " #{@data.inspect}>"
92
+ end
93
+ end
94
+ end