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.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +89 -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 +81 -9
  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 +4 -4
  12. data/lib/shell_ev/exceptions/api_exception.rb +2 -2
  13. data/lib/shell_ev/exceptions/bad_request_exception.rb +7 -5
  14. data/lib/shell_ev/exceptions/internal_server_error_exception.rb +7 -5
  15. data/lib/shell_ev/exceptions/not_found_exception.rb +7 -5
  16. data/lib/shell_ev/exceptions/o_auth_provider_exception.rb +7 -5
  17. data/lib/shell_ev/exceptions/serviceunavailable_exception.rb +7 -5
  18. data/lib/shell_ev/exceptions/too_many_requests_exception.rb +7 -5
  19. data/lib/shell_ev/exceptions/unauthorized_exception.rb +7 -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} +7 -16
  31. data/lib/shell_ev/models/active_response200_json.rb +2 -2
  32. data/lib/shell_ev/models/active_response200_json_status_enum.rb +15 -2
  33. data/lib/shell_ev/models/address.rb +2 -2
  34. data/lib/shell_ev/models/bad_request_err_msg.rb +2 -2
  35. data/lib/shell_ev/models/base_model.rb +2 -2
  36. data/lib/shell_ev/models/charge_error.rb +2 -2
  37. data/lib/shell_ev/models/charge_retrieve_state.rb +2 -2
  38. data/lib/shell_ev/models/chargesession_start_body.rb +2 -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 +2 -2
  44. data/lib/shell_ev/models/coordinates1.rb +81 -0
  45. data/lib/shell_ev/models/data_active.rb +2 -2
  46. data/lib/shell_ev/models/data_retrieve.rb +2 -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} +8 -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} +33 -43
  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 +2 -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 +4 -6
  60. data/lib/shell_ev/models/inline_response2021.rb +2 -2
  61. data/lib/shell_ev/models/inline_response2021_status_enum.rb +15 -2
  62. data/lib/shell_ev/models/inline_response202_data.rb +2 -2
  63. data/lib/shell_ev/models/inline_response202_status_enum.rb +15 -2
  64. data/lib/shell_ev/models/internal_error_object.rb +2 -2
  65. data/lib/shell_ev/models/{location_respone_object.rb → location_respone_object_v2.rb} +46 -34
  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 +5 -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 +2 -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 +3 -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 +2 -2
  82. data/lib/shell_ev/models/{response.rb → response_v2.rb} +9 -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 +2 -2
  89. data/lib/shell_ev/models/single_location_marker.rb +8 -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 +2 -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 +3 -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 +2 -2
  103. data/lib/shell_ev/utilities/date_time_helper.rb +2 -2
  104. data/lib/shell_ev/utilities/file_wrapper.rb +2 -2
  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 -149
  113. data/lib/shell_ev/models/tariff_vo.rb +0 -124
@@ -1,17 +1,18 @@
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
  # LocationsController
8
8
  class LocationsController < BaseController
9
- # This API provides the list of all Shell Recharge locations. The list
10
- # includes all Shell Recharge network and all locations available through
11
- # our roaming partners. The end point provides flexible search criteria in
12
- # order to get the list of Shell Recharge Network. The end point provides
13
- # the details such as the exact location/address of the site along with the
14
- # up-to-date status information of all the charging units in the site.
9
+ # This API Product provides the list of all public Shell Recharge locations.
10
+ # The list includes Shell Recharge network and locations available publicly
11
+ # through our roaming partners. The end point provides flexible search
12
+ # criteria in order to get the list of Shell Recharge Network. The end point
13
+ # provides the details such as the exact location/address of the site along
14
+ # with the up-to-date status information of all the charging units in the
15
+ # site.
15
16
  # Supported Search Options
16
17
  # * Based on status of the Charging units. Eg : Available or Occupied
17
18
  # * Based on available connector types.
@@ -24,16 +25,15 @@ module ShellEv
24
25
  # digits, displayed in five groups separated by hyphens, in the form
25
26
  # 8-4-4-4-12 for a total of 36 characters (32 hexadecimal characters and 4
26
27
  # hyphens) <br>
27
- # @param [GetEVLocationsEvseStatusEnum] evse_status Optional parameter:
28
- # Filter by Locations that have the given status
29
- # @param [GetEVLocationsConnectorTypesEnum] connector_types Optional
30
- # parameter: Filter by Locations that have Connectors with the set of
31
- # Connector Types
28
+ # @param [EvseStatusEnum] evse_status Optional parameter: Filter by
29
+ # Locations that have the given status
30
+ # @param [ConnectorTypesEnum] connector_types Optional parameter: Filter by
31
+ # Locations that have Connectors with the set of Connector Types
32
32
  # @param [Float] connector_min_power Optional parameter: Filter by Locations
33
33
  # that have a Connector with at least this power output (in kW)
34
- # @param [GetEVLocationsAuthorizationMethodsEnum] authorization_methods
35
- # Optional parameter: Filter by Locations that support the given
36
- # Authorization Methods
34
+ # @param [SingleLocationMarkerAuthorizationMethodsItemsEnum]
35
+ # authorization_methods Optional parameter: Filter by Locations that support
36
+ # the given Authorization Methods
37
37
  # @param [TrueClass | FalseClass] with_operator_name Optional parameter:
38
38
  # Return operator name in marker response object
39
39
  # @param [String] evse_id Optional parameter: optional Standard EVSE
@@ -57,7 +57,7 @@ module ShellEv
57
57
  # @param [Array[String]] exclude_country Optional parameter: Filter by
58
58
  # Locations that are not in one of the given countries (specified using ISO
59
59
  # 3166-1 alpha-3 codes)
60
- # @return [Response] response from the API call.
60
+ # @return [ResponseV2] Response from the API call.
61
61
  def get_ev_locations(request_id,
62
62
  evse_status: nil,
63
63
  connector_types: nil,
@@ -72,9 +72,9 @@ module ShellEv
72
72
  updated_since: nil,
73
73
  country: nil,
74
74
  exclude_country: nil)
75
- new_api_call_builder
75
+ @api_call
76
76
  .request(new_request_builder(HttpMethodEnum::GET,
77
- '/locations',
77
+ '/v2/locations',
78
78
  Server::DEFAULT)
79
79
  .header_param(new_parameter(request_id, key: 'RequestId'))
80
80
  .query_param(new_parameter(evse_status, key: 'evseStatus'))
@@ -94,7 +94,7 @@ module ShellEv
94
94
  .auth(Single.new('BearerAuth')))
95
95
  .response(new_response_handler
96
96
  .deserializer(APIHelper.method(:custom_type_deserializer))
97
- .deserialize_into(Response.method(:from_hash))
97
+ .deserialize_into(ResponseV2.method(:from_hash))
98
98
  .local_error('400',
99
99
  'The server cannot or will not process the request due to'\
100
100
  ' something that is perceived to be a client error (e.g.,'\
@@ -133,18 +133,18 @@ module ShellEv
133
133
  # hyphens) <br>
134
134
  # @param [String] id Required parameter: Unique Uid of the location from
135
135
  # List of locations API
136
- # @param [String] provider_id Optional parameter: The provider id that you
137
- # wish to see locations and tariffs for
136
+ # @param [String] provider_id Optional parameter: ProviderId is mandatory in
137
+ # order to get the tariff information as part of API response.
138
138
  # @param [String] since Optional parameter: to get the locations modified
139
139
  # after a date
140
- # @return [Response] response from the API call.
140
+ # @return [SearchByIdResponse] Response from the API call.
141
141
  def ev_locations_by_id(request_id,
142
142
  id,
143
143
  provider_id: nil,
144
144
  since: nil)
145
- new_api_call_builder
145
+ @api_call
146
146
  .request(new_request_builder(HttpMethodEnum::GET,
147
- '/locations/{id}',
147
+ '/v2/locations/{id}',
148
148
  Server::DEFAULT)
149
149
  .header_param(new_parameter(request_id, key: 'RequestId'))
150
150
  .template_param(new_parameter(id, key: 'id')
@@ -155,7 +155,7 @@ module ShellEv
155
155
  .auth(Single.new('BearerAuth')))
156
156
  .response(new_response_handler
157
157
  .deserializer(APIHelper.method(:custom_type_deserializer))
158
- .deserialize_into(Response.method(:from_hash))
158
+ .deserialize_into(SearchByIdResponse.method(:from_hash))
159
159
  .local_error('400',
160
160
  'The server cannot or will not process the request due to'\
161
161
  ' something that is perceived to be a client error (e.g.,'\
@@ -216,16 +216,15 @@ module ShellEv
216
216
  # given by the Operator, unique for that Operator
217
217
  # @param [String] operator_name Optional parameter: Filter by Locations that
218
218
  # have the given operator
219
- # @param [GetEVLocationsEvseStatusEnum] evse_status Optional parameter:
220
- # Filter by Locations that have the given status
221
- # @param [NearbyLocationsConnectorTypesEnum] connector_types Optional
222
- # parameter: Filter by Locations that have Connectors with these Connector
223
- # Types
219
+ # @param [EvseStatusEnum] evse_status Optional parameter: Filter by
220
+ # Locations that have the given status
221
+ # @param [ConnectorTypesEnum] connector_types Optional parameter: Filter by
222
+ # Locations that have Connectors with these Connector Types
224
223
  # @param [Float] connector_min_power Optional parameter: Filter by Locations
225
224
  # that have a Connector with at least this power output (in kW)
226
- # @param [GetEVLocationsAuthorizationMethodsEnum] authorization_methods
227
- # Optional parameter: Filter by Locations that support the given
228
- # Authorization Methods
225
+ # @param [SingleLocationMarkerAuthorizationMethodsItemsEnum]
226
+ # authorization_methods Optional parameter: Filter by Locations that support
227
+ # the given Authorization Methods
229
228
  # @param [TrueClass | FalseClass] with_operator_name Optional parameter:
230
229
  # Return operator name in marker object (only for marker type Single
231
230
  # ChargePoint)
@@ -238,7 +237,7 @@ module ShellEv
238
237
  # @param [Array[String]] exclude_country Optional parameter: Filter by
239
238
  # Locations that are not in one of the given countries (specified using ISO
240
239
  # 3166-1 alpha-3 codes)
241
- # @return [Response] response from the API call.
240
+ # @return [ResponseV2] Response from the API call.
242
241
  def nearby_locations(request_id,
243
242
  latitude,
244
243
  longitude,
@@ -255,9 +254,9 @@ module ShellEv
255
254
  with_max_power: nil,
256
255
  country: nil,
257
256
  exclude_country: nil)
258
- new_api_call_builder
257
+ @api_call
259
258
  .request(new_request_builder(HttpMethodEnum::GET,
260
- '/locations/nearby',
259
+ '/v2/locations/nearby',
261
260
  Server::DEFAULT)
262
261
  .header_param(new_parameter(request_id, key: 'RequestId'))
263
262
  .query_param(new_parameter(latitude, key: 'latitude'))
@@ -279,7 +278,7 @@ module ShellEv
279
278
  .auth(Single.new('BearerAuth')))
280
279
  .response(new_response_handler
281
280
  .deserializer(APIHelper.method(:custom_type_deserializer))
282
- .deserialize_into(Response.method(:from_hash))
281
+ .deserialize_into(ResponseV2.method(:from_hash))
283
282
  .local_error('400',
284
283
  'The server cannot or will not process the request due to'\
285
284
  ' something that is perceived to be a client error (e.g.,'\
@@ -330,16 +329,15 @@ module ShellEv
330
329
  # get the Shell Recharge Locations
331
330
  # @param [String] zoom Required parameter: Zoom level to show ex: (1: World,
332
331
  # 5: Landmass/continent, 10: City, 15: Streets, 20: Buildings)
333
- # @param [GetEVLocationsEvseStatusEnum] evse_status Optional parameter:
334
- # Filter by Locations that have the given status
335
- # @param [GetEVLocationsConnectorTypesEnum] connector_types Optional
336
- # parameter: Filter by Locations that have Connectors with the set of
337
- # Connector Types
332
+ # @param [EvseStatusEnum] evse_status Optional parameter: Filter by
333
+ # Locations that have the given status
334
+ # @param [ConnectorTypesEnum] connector_types Optional parameter: Filter by
335
+ # Locations that have Connectors with the set of Connector Types
338
336
  # @param [Float] connector_min_power Optional parameter: Filter by Locations
339
337
  # that have a Connector with at least this power output (in kW)
340
- # @param [GetEVLocationsAuthorizationMethodsEnum] authorization_methods
341
- # Optional parameter: Filter by Locations that support the given
342
- # Authorization Methods
338
+ # @param [SingleLocationMarkerAuthorizationMethodsItemsEnum]
339
+ # authorization_methods Optional parameter: Filter by Locations that support
340
+ # the given Authorization Methods
343
341
  # @param [TrueClass | FalseClass] with_operator_name Optional parameter:
344
342
  # Return operator name in marker object (only for marker type
345
343
  # SingleChargePoint)
@@ -362,7 +360,7 @@ module ShellEv
362
360
  # @param [Array[String]] exclude_country Optional parameter: Filter by
363
361
  # Locations that are not in one of the given countries (specified using ISO
364
362
  # 3166-1 alpha-3 codes)
365
- # @return [SingleLocationMarkerResponse] response from the API call.
363
+ # @return [SingleLocationMarkerResponseV2] Response from the API call.
366
364
  def locations_markers(request_id,
367
365
  west,
368
366
  south,
@@ -381,9 +379,9 @@ module ShellEv
381
379
  operator_name: nil,
382
380
  country: nil,
383
381
  exclude_country: nil)
384
- new_api_call_builder
382
+ @api_call
385
383
  .request(new_request_builder(HttpMethodEnum::GET,
386
- '/locations/markers',
384
+ '/v2/locations/markers',
387
385
  Server::DEFAULT)
388
386
  .header_param(new_parameter(request_id, key: 'RequestId'))
389
387
  .query_param(new_parameter(west, key: 'west'))
@@ -407,7 +405,7 @@ module ShellEv
407
405
  .auth(Single.new('BearerAuth')))
408
406
  .response(new_response_handler
409
407
  .deserializer(APIHelper.method(:custom_type_deserializer))
410
- .deserialize_into(SingleLocationMarkerResponse.method(:from_hash))
408
+ .deserialize_into(SingleLocationMarkerResponseV2.method(:from_hash))
411
409
  .local_error('400',
412
410
  'The server cannot or will not process the request due to'\
413
411
  ' something that is perceived to be a client error (e.g.,'\
@@ -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
  # OAuthAuthorizationController
@@ -13,11 +13,11 @@ module ShellEv
13
13
  # space-delimited list.
14
14
  # @param [Hash] _field_parameters Additional optional form parameters are
15
15
  # supported by this endpoint.
16
- # @return [OAuthToken] response from the API call.
16
+ # @return [OAuthToken] Response from the API call.
17
17
  def request_token(authorization,
18
18
  scope: nil,
19
19
  _field_parameters: nil)
20
- new_api_call_builder
20
+ @api_call
21
21
  .request(new_request_builder(HttpMethodEnum::POST,
22
22
  '/token',
23
23
  Server::ACCESS_TOKEN_SERVER)
@@ -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
  # Class for exceptions when there is a network error, status code error, etc.
@@ -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
  # BadRequest class.
@@ -23,8 +23,8 @@ module ShellEv
23
23
  attr_accessor :errors
24
24
 
25
25
  # The constructor.
26
- # @param [String] The reason for raising an exception.
27
- # @param [HttpResponse] The HttpReponse of the API call.
26
+ # @param [String] reason The reason for raising an exception.
27
+ # @param [HttpResponse] response The HttpReponse of the API call.
28
28
  def initialize(reason, response)
29
29
  super(reason, response)
30
30
  hash = APIHelper.json_deserialize(@response.raw_body)
@@ -32,9 +32,11 @@ module ShellEv
32
32
  end
33
33
 
34
34
  # Populates this object by extracting properties from a hash.
35
- # @param [Hash] The deserialized response sent by the server in the
35
+ # @param [Hash] hash The deserialized response sent by the server in the
36
36
  # response body.
37
37
  def unbox(hash)
38
+ return nil unless hash
39
+
38
40
  @request_id = hash.key?('requestId') ? hash['requestId'] : SKIP
39
41
  @status = hash.key?('status') ? hash['status'] : SKIP
40
42
  # Parameter is an array, so we need to iterate through it
@@ -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
  # InternalServerError class.
@@ -27,8 +27,8 @@ module ShellEv
27
27
  attr_accessor :details
28
28
 
29
29
  # The constructor.
30
- # @param [String] The reason for raising an exception.
31
- # @param [HttpResponse] The HttpReponse of the API call.
30
+ # @param [String] reason The reason for raising an exception.
31
+ # @param [HttpResponse] response The HttpReponse of the API call.
32
32
  def initialize(reason, response)
33
33
  super(reason, response)
34
34
  hash = APIHelper.json_deserialize(@response.raw_body)
@@ -36,9 +36,11 @@ module ShellEv
36
36
  end
37
37
 
38
38
  # Populates this object by extracting properties from a hash.
39
- # @param [Hash] The deserialized response sent by the server in the
39
+ # @param [Hash] hash The deserialized response sent by the server in the
40
40
  # response body.
41
41
  def unbox(hash)
42
+ return nil unless hash
43
+
42
44
  @request_id = hash.key?('requestId') ? hash['requestId'] : SKIP
43
45
  @status = hash.key?('status') ? hash['status'] : SKIP
44
46
  # Parameter is an array, so we need to iterate through it
@@ -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
  # Requested resource path not available it will provides the error in OpenAPI
@@ -25,8 +25,8 @@ module ShellEv
25
25
  attr_accessor :errors
26
26
 
27
27
  # The constructor.
28
- # @param [String] The reason for raising an exception.
29
- # @param [HttpResponse] The HttpReponse of the API call.
28
+ # @param [String] reason The reason for raising an exception.
29
+ # @param [HttpResponse] response The HttpReponse of the API call.
30
30
  def initialize(reason, response)
31
31
  super(reason, response)
32
32
  hash = APIHelper.json_deserialize(@response.raw_body)
@@ -34,9 +34,11 @@ module ShellEv
34
34
  end
35
35
 
36
36
  # Populates this object by extracting properties from a hash.
37
- # @param [Hash] The deserialized response sent by the server in the
37
+ # @param [Hash] hash The deserialized response sent by the server in the
38
38
  # response body.
39
39
  def unbox(hash)
40
+ return nil unless hash
41
+
40
42
  @request_id = hash.key?('requestId') ? hash['requestId'] : SKIP
41
43
  @status = hash.key?('status') ? hash['status'] : SKIP
42
44
  # Parameter is an array, so we need to iterate through it
@@ -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
  # OAuth 2 Authorization endpoint exception.
@@ -27,8 +27,8 @@ module ShellEv
27
27
  attr_accessor :error_uri
28
28
 
29
29
  # The constructor.
30
- # @param [String] The reason for raising an exception.
31
- # @param [HttpResponse] The HttpReponse of the API call.
30
+ # @param [String] reason The reason for raising an exception.
31
+ # @param [HttpResponse] response The HttpReponse of the API call.
32
32
  def initialize(reason, response)
33
33
  super(reason, response)
34
34
  hash = APIHelper.json_deserialize(@response.raw_body)
@@ -36,9 +36,11 @@ module ShellEv
36
36
  end
37
37
 
38
38
  # Populates this object by extracting properties from a hash.
39
- # @param [Hash] The deserialized response sent by the server in the
39
+ # @param [Hash] hash The deserialized response sent by the server in the
40
40
  # response body.
41
41
  def unbox(hash)
42
+ return nil unless hash
43
+
42
44
  @error = hash.key?('error') ? hash['error'] : nil
43
45
  @error_description =
44
46
  hash.key?('error_description') ? hash['error_description'] : SKIP
@@ -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
  # Serviceunavailable class.
@@ -23,8 +23,8 @@ module ShellEv
23
23
  attr_accessor :errors
24
24
 
25
25
  # The constructor.
26
- # @param [String] The reason for raising an exception.
27
- # @param [HttpResponse] The HttpReponse of the API call.
26
+ # @param [String] reason The reason for raising an exception.
27
+ # @param [HttpResponse] response The HttpReponse of the API call.
28
28
  def initialize(reason, response)
29
29
  super(reason, response)
30
30
  hash = APIHelper.json_deserialize(@response.raw_body)
@@ -32,9 +32,11 @@ module ShellEv
32
32
  end
33
33
 
34
34
  # Populates this object by extracting properties from a hash.
35
- # @param [Hash] The deserialized response sent by the server in the
35
+ # @param [Hash] hash The deserialized response sent by the server in the
36
36
  # response body.
37
37
  def unbox(hash)
38
+ return nil unless hash
39
+
38
40
  @request_id = hash.key?('requestId') ? hash['requestId'] : SKIP
39
41
  @status = hash.key?('status') ? hash['status'] : SKIP
40
42
  # Parameter is an array, so we need to iterate through it
@@ -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
  # TooManyRequests class.
@@ -23,8 +23,8 @@ module ShellEv
23
23
  attr_accessor :errors
24
24
 
25
25
  # The constructor.
26
- # @param [String] The reason for raising an exception.
27
- # @param [HttpResponse] The HttpReponse of the API call.
26
+ # @param [String] reason The reason for raising an exception.
27
+ # @param [HttpResponse] response The HttpReponse of the API call.
28
28
  def initialize(reason, response)
29
29
  super(reason, response)
30
30
  hash = APIHelper.json_deserialize(@response.raw_body)
@@ -32,9 +32,11 @@ module ShellEv
32
32
  end
33
33
 
34
34
  # Populates this object by extracting properties from a hash.
35
- # @param [Hash] The deserialized response sent by the server in the
35
+ # @param [Hash] hash The deserialized response sent by the server in the
36
36
  # response body.
37
37
  def unbox(hash)
38
+ return nil unless hash
39
+
38
40
  @request_id = hash.key?('requestId') ? hash['requestId'] : SKIP
39
41
  @status = hash.key?('status') ? hash['status'] : SKIP
40
42
  # Parameter is an array, so we need to iterate through it
@@ -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
  # Unauthorized class.
@@ -22,8 +22,8 @@ module ShellEv
22
22
  attr_accessor :errors
23
23
 
24
24
  # The constructor.
25
- # @param [String] The reason for raising an exception.
26
- # @param [HttpResponse] The HttpReponse of the API call.
25
+ # @param [String] reason The reason for raising an exception.
26
+ # @param [HttpResponse] response The HttpReponse of the API call.
27
27
  def initialize(reason, response)
28
28
  super(reason, response)
29
29
  hash = APIHelper.json_deserialize(@response.raw_body)
@@ -31,9 +31,11 @@ module ShellEv
31
31
  end
32
32
 
33
33
  # Populates this object by extracting properties from a hash.
34
- # @param [Hash] The deserialized response sent by the server in the
34
+ # @param [Hash] hash The deserialized response sent by the server in the
35
35
  # response body.
36
36
  def unbox(hash)
37
+ return nil unless hash
38
+
37
39
  @request_id = hash.key?('requestId') ? hash['requestId'] : SKIP
38
40
  @status = hash.key?('status') ? hash['status'] : SKIP
39
41
  # Parameter is an array, so we need to iterate through it
@@ -0,0 +1,67 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module ShellEv
7
+ # V2 Charge Session Retrieve 404 Error class.
8
+ class V2ChargeSessionRetrieve404ErrorException < APIException
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 [String]
15
+ attr_accessor :request_id
16
+
17
+ # Status of the request
18
+ # @return [String]
19
+ attr_accessor :status
20
+
21
+ # Exception details of the error
22
+ # @return [Array[NotFoundErrMsg]]
23
+ attr_accessor :errors
24
+
25
+ # The constructor.
26
+ # @param [String] reason The reason for raising an exception.
27
+ # @param [HttpResponse] response The HttpReponse of the API call.
28
+ def initialize(reason, response)
29
+ super(reason, response)
30
+ hash = APIHelper.json_deserialize(@response.raw_body)
31
+ unbox(hash)
32
+ end
33
+
34
+ # Populates this object by extracting properties from a hash.
35
+ # @param [Hash] hash The deserialized response sent by the server in the
36
+ # response body.
37
+ def unbox(hash)
38
+ return nil unless hash
39
+
40
+ @request_id = hash.key?('requestId') ? hash['requestId'] : SKIP
41
+ @status = hash.key?('status') ? hash['status'] : SKIP
42
+ # Parameter is an array, so we need to iterate through it
43
+ @errors = nil
44
+ unless hash['errors'].nil?
45
+ @errors = []
46
+ hash['errors'].each do |structure|
47
+ @errors << (NotFoundErrMsg.from_hash(structure) if structure)
48
+ end
49
+ end
50
+
51
+ @errors = SKIP unless hash.key?('errors')
52
+ end
53
+
54
+ # Provides a human-readable string representation of the object.
55
+ def to_s
56
+ class_name = self.class.name.split('::').last
57
+ "<#{class_name} request_id: #{@request_id}, status: #{@status}, errors: #{@errors}>"
58
+ end
59
+
60
+ # Provides a debugging-friendly string with detailed object information.
61
+ def inspect
62
+ class_name = self.class.name.split('::').last
63
+ "<#{class_name} request_id: #{@request_id.inspect}, status: #{@status.inspect}, errors:"\
64
+ " #{@errors.inspect}>"
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,67 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module ShellEv
7
+ # V2 Charge Session Start 404 Error class.
8
+ class V2ChargeSessionStart404ErrorException < APIException
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 [String]
15
+ attr_accessor :request_id
16
+
17
+ # Status of the request
18
+ # @return [String]
19
+ attr_accessor :status
20
+
21
+ # Exception details of the error
22
+ # @return [Array[NotFoundErrMsg]]
23
+ attr_accessor :errors
24
+
25
+ # The constructor.
26
+ # @param [String] reason The reason for raising an exception.
27
+ # @param [HttpResponse] response The HttpReponse of the API call.
28
+ def initialize(reason, response)
29
+ super(reason, response)
30
+ hash = APIHelper.json_deserialize(@response.raw_body)
31
+ unbox(hash)
32
+ end
33
+
34
+ # Populates this object by extracting properties from a hash.
35
+ # @param [Hash] hash The deserialized response sent by the server in the
36
+ # response body.
37
+ def unbox(hash)
38
+ return nil unless hash
39
+
40
+ @request_id = hash.key?('requestId') ? hash['requestId'] : SKIP
41
+ @status = hash.key?('status') ? hash['status'] : SKIP
42
+ # Parameter is an array, so we need to iterate through it
43
+ @errors = nil
44
+ unless hash['errors'].nil?
45
+ @errors = []
46
+ hash['errors'].each do |structure|
47
+ @errors << (NotFoundErrMsg.from_hash(structure) if structure)
48
+ end
49
+ end
50
+
51
+ @errors = SKIP unless hash.key?('errors')
52
+ end
53
+
54
+ # Provides a human-readable string representation of the object.
55
+ def to_s
56
+ class_name = self.class.name.split('::').last
57
+ "<#{class_name} request_id: #{@request_id}, status: #{@status}, errors: #{@errors}>"
58
+ end
59
+
60
+ # Provides a debugging-friendly string with detailed object information.
61
+ def inspect
62
+ class_name = self.class.name.split('::').last
63
+ "<#{class_name} request_id: #{@request_id.inspect}, status: #{@status.inspect}, errors:"\
64
+ " #{@errors.inspect}>"
65
+ end
66
+ end
67
+ end