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,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
@@ -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 Stop 404 Error class.
8
+ class V2ChargeSessionStop404ErrorException < 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
@@ -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
  # Utility class for OAuth 2 authorization and token management.
@@ -100,7 +100,7 @@ module ShellEv
100
100
 
101
101
  def initialize(o_auth_client_id:, o_auth_client_secret:, o_auth_token: nil,
102
102
  o_auth_token_provider: nil, o_auth_on_token_update: nil,
103
- o_auth_clock_skew: nil)
103
+ o_auth_clock_skew: 0)
104
104
  raise ArgumentError, 'o_auth_client_id cannot be nil' if o_auth_client_id.nil?
105
105
  raise ArgumentError, 'o_auth_client_secret cannot be nil' if o_auth_client_secret.nil?
106
106
 
@@ -112,6 +112,21 @@ module ShellEv
112
112
  @o_auth_clock_skew = o_auth_clock_skew
113
113
  end
114
114
 
115
+ def self.from_env
116
+ o_auth_client_id = ENV['O_AUTH_CLIENT_ID']
117
+ o_auth_client_secret = ENV['O_AUTH_CLIENT_SECRET']
118
+ o_auth_clock_skew = ENV['O_AUTH_CLOCK_SKEW']
119
+ all_nil = [
120
+ o_auth_client_id,
121
+ o_auth_client_secret
122
+ ].all?(&:nil?)
123
+ return nil if all_nil
124
+
125
+ new(o_auth_client_id: o_auth_client_id,
126
+ o_auth_client_secret: o_auth_client_secret,
127
+ o_auth_clock_skew: o_auth_clock_skew)
128
+ end
129
+
115
130
  def clone_with(o_auth_client_id: nil, o_auth_client_secret: nil,
116
131
  o_auth_token: nil, o_auth_token_provider: nil,
117
132
  o_auth_on_token_update: nil, o_auth_clock_skew: nil)
@@ -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
  # HttpCallBack allows defining callables for pre and post API calls.
@@ -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
  # HTTP Methods Enumeration.
@@ -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
  # Represents a single Http Request.
@@ -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
  # Http response received.
@@ -0,0 +1,22 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module ShellEv
7
+ ##
8
+ # ProxySettings encapsulates HTTP proxy configuration for Faraday,
9
+ # including optional basic authentication.
10
+ #
11
+ class ProxySettings < CoreLibrary::ProxySettings
12
+ def self.from_env
13
+ address = ENV['PROXY_ADDRESS']
14
+ port = ENV['PROXY_PORT']
15
+ username = ENV['PROXY_USERNAME']
16
+ password = ENV['PROXY_PASSWORD']
17
+ return nil if address.nil? || address.strip.empty?
18
+
19
+ new(address: address, port: port, username: username, password: password)
20
+ end
21
+ end
22
+ 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
  # Accessibility Status
@@ -25,5 +25,20 @@ module ShellEv
25
25
 
26
26
  ACCESSIBILITY_STATUS_ENUM.include?(value)
27
27
  end
28
+
29
+ def self.from_value(value, default_value = FREEPUBLIC)
30
+ return default_value if value.nil?
31
+
32
+ str = value.to_s.strip
33
+
34
+ case str.downcase
35
+ when 'freepublic' then FREEPUBLIC
36
+ when 'payingpublic' then PAYINGPUBLIC
37
+ when 'restricted' then RESTRICTED
38
+ when 'unspecified' then UNSPECIFIED
39
+ else
40
+ default_value
41
+ end
42
+ end
28
43
  end
29
44
  end
@@ -1,11 +1,11 @@
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
  # Accessibility of the Location
8
- class Accessibility < BaseModel
8
+ class AccessibilityV2 < BaseModel
9
9
  SKIP = Object.new
10
10
  private_constant :SKIP
11
11
 
@@ -13,15 +13,10 @@ module ShellEv
13
13
  # @return [AccessibilityStatusEnum]
14
14
  attr_accessor :status
15
15
 
16
- # optional Arbitrary text about restrictions of the Location
17
- # @return [String]
18
- attr_accessor :remark
19
-
20
16
  # A mapping from model property names to API property names.
21
17
  def self.names
22
18
  @_hash = {} if @_hash.nil?
23
19
  @_hash['status'] = 'status'
24
- @_hash['remark'] = 'remark'
25
20
  @_hash
26
21
  end
27
22
 
@@ -29,7 +24,6 @@ module ShellEv
29
24
  def self.optionals
30
25
  %w[
31
26
  status
32
- remark
33
27
  ]
34
28
  end
35
29
 
@@ -38,9 +32,8 @@ module ShellEv
38
32
  []
39
33
  end
40
34
 
41
- def initialize(status = SKIP, remark = SKIP)
35
+ def initialize(status = SKIP)
42
36
  @status = status unless status == SKIP
43
- @remark = remark unless remark == SKIP
44
37
  end
45
38
 
46
39
  # Creates an instance of the object from a hash.
@@ -49,11 +42,21 @@ module ShellEv
49
42
 
50
43
  # Extract variables from the hash.
51
44
  status = hash.key?('status') ? hash['status'] : SKIP
52
- remark = hash.key?('remark') ? hash['remark'] : SKIP
53
45
 
54
46
  # Create object from extracted values.
55
- Accessibility.new(status,
56
- remark)
47
+ AccessibilityV2.new(status)
48
+ end
49
+
50
+ # Provides a human-readable string representation of the object.
51
+ def to_s
52
+ class_name = self.class.name.split('::').last
53
+ "<#{class_name} status: #{@status}>"
54
+ end
55
+
56
+ # Provides a debugging-friendly string with detailed object information.
57
+ def inspect
58
+ class_name = self.class.name.split('::').last
59
+ "<#{class_name} status: #{@status.inspect}>"
57
60
  end
58
61
  end
59
62
  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
  # ActiveResponse200Json Model.
@@ -74,5 +74,18 @@ module ShellEv
74
74
  status,
75
75
  data)
76
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
77
90
  end
78
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
  # Indicates overall status of the request
@@ -19,5 +19,18 @@ module ShellEv
19
19
 
20
20
  ACTIVE_RESPONSE200_JSON_STATUS_ENUM.include?(value)
21
21
  end
22
+
23
+ def self.from_value(value, default_value = SUCCESS)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'success' then SUCCESS
30
+ when 'failed' then FAILED
31
+ else
32
+ default_value
33
+ end
34
+ end
22
35
  end
23
36
  end
@@ -1,7 +1,7 @@
1
1
  # shell_ev
2
2
  #
3
- # This file was automatically generated by APIMATIC 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
  # Address of the Shell Recharge Location
@@ -75,5 +75,19 @@ module ShellEv
75
75
  city,
76
76
  country)
77
77
  end
78
+
79
+ # Provides a human-readable string representation of the object.
80
+ def to_s
81
+ class_name = self.class.name.split('::').last
82
+ "<#{class_name} street_and_number: #{@street_and_number}, postal_code: #{@postal_code},"\
83
+ " city: #{@city}, country: #{@country}>"
84
+ end
85
+
86
+ # Provides a debugging-friendly string with detailed object information.
87
+ def inspect
88
+ class_name = self.class.name.split('::').last
89
+ "<#{class_name} street_and_number: #{@street_and_number.inspect}, postal_code:"\
90
+ " #{@postal_code.inspect}, city: #{@city.inspect}, country: #{@country.inspect}>"
91
+ end
78
92
  end
79
93
  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
  # BadRequestErrMsg 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
  # Base model.
@@ -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
  # ChargeError Model.
@@ -55,5 +55,17 @@ module ShellEv
55
55
  ChargeError.new(code,
56
56
  message)
57
57
  end
58
+
59
+ # Provides a human-readable string representation of the object.
60
+ def to_s
61
+ class_name = self.class.name.split('::').last
62
+ "<#{class_name} code: #{@code}, message: #{@message}>"
63
+ end
64
+
65
+ # Provides a debugging-friendly string with detailed object information.
66
+ def inspect
67
+ class_name = self.class.name.split('::').last
68
+ "<#{class_name} code: #{@code.inspect}, message: #{@message.inspect}>"
69
+ end
58
70
  end
59
71
  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
  # ChargeRetrieveState Model.
@@ -59,5 +59,17 @@ module ShellEv
59
59
  ChargeRetrieveState.new(status,
60
60
  error)
61
61
  end
62
+
63
+ # Provides a human-readable string representation of the object.
64
+ def to_s
65
+ class_name = self.class.name.split('::').last
66
+ "<#{class_name} status: #{@status}, error: #{@error}>"
67
+ end
68
+
69
+ # Provides a debugging-friendly string with detailed object information.
70
+ def inspect
71
+ class_name = self.class.name.split('::').last
72
+ "<#{class_name} status: #{@status.inspect}, error: #{@error.inspect}>"
73
+ end
62
74
  end
63
75
  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
  # ChargesessionStartBody Model.
@@ -53,5 +53,18 @@ module ShellEv
53
53
  ChargesessionStartBody.new(ev_charge_number,
54
54
  evse_id)
55
55
  end
56
+
57
+ # Provides a human-readable string representation of the object.
58
+ def to_s
59
+ class_name = self.class.name.split('::').last
60
+ "<#{class_name} ev_charge_number: #{@ev_charge_number}, evse_id: #{@evse_id}>"
61
+ end
62
+
63
+ # Provides a debugging-friendly string with detailed object information.
64
+ def inspect
65
+ class_name = self.class.name.split('::').last
66
+ "<#{class_name} ev_charge_number: #{@ev_charge_number.inspect}, evse_id:"\
67
+ " #{@evse_id.inspect}>"
68
+ end
56
69
  end
57
70
  end