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
@@ -0,0 +1,81 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module ShellEv
7
+ # Coordinates1 Model.
8
+ class Coordinates1 < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Latitude of the Coordinate
13
+ # @return [Float]
14
+ attr_accessor :latitude
15
+
16
+ # Longitude of the Coordinate
17
+ # @return [Float]
18
+ attr_accessor :longitude
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['latitude'] = 'latitude'
24
+ @_hash['longitude'] = 'longitude'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ latitude
32
+ longitude
33
+ ]
34
+ end
35
+
36
+ # An array for nullable fields
37
+ def self.nullables
38
+ []
39
+ end
40
+
41
+ def initialize(latitude = SKIP, longitude = SKIP)
42
+ @latitude = latitude unless latitude == SKIP
43
+ @longitude = longitude unless longitude == SKIP
44
+ end
45
+
46
+ # Creates an instance of the object from a hash.
47
+ def self.from_hash(hash)
48
+ return nil unless hash
49
+
50
+ # Extract variables from the hash.
51
+ latitude = hash.key?('latitude') ? hash['latitude'] : SKIP
52
+ longitude = hash.key?('longitude') ? hash['longitude'] : SKIP
53
+
54
+ # Create object from extracted values.
55
+ Coordinates1.new(latitude,
56
+ longitude)
57
+ end
58
+
59
+ # Validates an instance of the object from a given value.
60
+ # @param [Coordinates1 | Hash] The value against the validation is performed.
61
+ def self.validate(value)
62
+ return true if value.instance_of? self
63
+
64
+ return false unless value.instance_of? Hash
65
+
66
+ true
67
+ end
68
+
69
+ # Provides a human-readable string representation of the object.
70
+ def to_s
71
+ class_name = self.class.name.split('::').last
72
+ "<#{class_name} latitude: #{@latitude}, longitude: #{@longitude}>"
73
+ end
74
+
75
+ # Provides a debugging-friendly string with detailed object information.
76
+ def inspect
77
+ class_name = self.class.name.split('::').last
78
+ "<#{class_name} latitude: #{@latitude.inspect}, longitude: #{@longitude.inspect}>"
79
+ end
80
+ end
81
+ 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
  require 'date'
7
7
  module ShellEv
@@ -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
  require 'date'
7
7
  module ShellEv
@@ -0,0 +1,56 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module ShellEv
7
+ # DayOfWeek.
8
+ class DayOfWeekEnum
9
+ DAY_OF_WEEK_ENUM = [
10
+ # TODO: Write general description for MONDAY
11
+ MONDAY = 'MONDAY'.freeze,
12
+
13
+ # TODO: Write general description for TUESDAY
14
+ TUESDAY = 'TUESDAY'.freeze,
15
+
16
+ # TODO: Write general description for WEDNESDAY
17
+ WEDNESDAY = 'WEDNESDAY'.freeze,
18
+
19
+ # TODO: Write general description for THURSDAY
20
+ THURSDAY = 'THURSDAY'.freeze,
21
+
22
+ # TODO: Write general description for FRIDAY
23
+ FRIDAY = 'FRIDAY'.freeze,
24
+
25
+ # TODO: Write general description for SATURDAY
26
+ SATURDAY = 'SATURDAY'.freeze,
27
+
28
+ # TODO: Write general description for SUNDAY
29
+ SUNDAY = 'SUNDAY'.freeze
30
+ ].freeze
31
+
32
+ def self.validate(value)
33
+ return false if value.nil?
34
+
35
+ DAY_OF_WEEK_ENUM.include?(value)
36
+ end
37
+
38
+ def self.from_value(value, default_value = MONDAY)
39
+ return default_value if value.nil?
40
+
41
+ str = value.to_s.strip
42
+
43
+ case str.downcase
44
+ when 'monday' then MONDAY
45
+ when 'tuesday' then TUESDAY
46
+ when 'wednesday' then WEDNESDAY
47
+ when 'thursday' then THURSDAY
48
+ when 'friday' then FRIDAY
49
+ when 'saturday' then SATURDAY
50
+ when 'sunday' then SUNDAY
51
+ else
52
+ default_value
53
+ end
54
+ end
55
+ end
56
+ 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
  # Power Type used in this connector.
@@ -22,5 +22,19 @@ module ShellEv
22
22
 
23
23
  ELECTRICAL_PROPERTIES_POWER_TYPE_ENUM.include?(value)
24
24
  end
25
+
26
+ def self.from_value(value, default_value = AC1PHASE)
27
+ return default_value if value.nil?
28
+
29
+ str = value.to_s.strip
30
+
31
+ case str.downcase
32
+ when 'ac1phase' then AC1PHASE
33
+ when 'ac3phase' then AC3PHASE
34
+ when 'dc' then DC
35
+ else
36
+ default_value
37
+ end
38
+ end
25
39
  end
26
40
  end
@@ -1,15 +1,15 @@
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
  # Electrical Properties of the Connector
8
- class ElectricalProperties < BaseModel
8
+ class ElectricalPropertiesV2 < BaseModel
9
9
  SKIP = Object.new
10
10
  private_constant :SKIP
11
11
 
12
- # TODO: Write general description for this method
12
+ # Power Type used in this connector.
13
13
  # @return [ElectricalPropertiesPowerTypeEnum]
14
14
  attr_accessor :power_type
15
15
 
@@ -70,10 +70,10 @@ module ShellEv
70
70
  hash.key?('maxElectricPower') ? hash['maxElectricPower'] : SKIP
71
71
 
72
72
  # Create object from extracted values.
73
- ElectricalProperties.new(power_type,
74
- voltage,
75
- amperage,
76
- max_electric_power)
73
+ ElectricalPropertiesV2.new(power_type,
74
+ voltage,
75
+ amperage,
76
+ max_electric_power)
77
77
  end
78
78
 
79
79
  # Provides a human-readable string representation of the object.
@@ -0,0 +1,44 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module ShellEv
7
+ # evseStatus.
8
+ class EvseStatusEnum
9
+ EVSE_STATUS_ENUM = [
10
+ # TODO: Write general description for AVAILABLE
11
+ AVAILABLE = 'Available'.freeze,
12
+
13
+ # TODO: Write general description for OCCUPIED
14
+ OCCUPIED = 'Occupied'.freeze,
15
+
16
+ # TODO: Write general description for UNAVAILABLE
17
+ UNAVAILABLE = 'Unavailable'.freeze,
18
+
19
+ # TODO: Write general description for UNKNOWN
20
+ UNKNOWN = 'Unknown'.freeze
21
+ ].freeze
22
+
23
+ def self.validate(value)
24
+ return false if value.nil?
25
+
26
+ EVSE_STATUS_ENUM.include?(value)
27
+ end
28
+
29
+ def self.from_value(value, default_value = AVAILABLE)
30
+ return default_value if value.nil?
31
+
32
+ str = value.to_s.strip
33
+
34
+ case str.downcase
35
+ when 'available' then AVAILABLE
36
+ when 'occupied' then OCCUPIED
37
+ when 'unavailable' then UNAVAILABLE
38
+ when 'unknown' then UNKNOWN
39
+ else
40
+ default_value
41
+ end
42
+ end
43
+ end
44
+ end
@@ -1,17 +1,17 @@
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
  # Each Location will contain one or more EVSEs (Electric Vehicle Supply
8
8
  # Equipment). Each EVSE is capable of charging one car at a time.
9
- class EvseVO < BaseModel
9
+ class EvseV2 < BaseModel
10
10
  SKIP = Object.new
11
11
  private_constant :SKIP
12
12
 
13
13
  # Internal identifier used to refer to single individual EVSE unit.
14
- # @return [Integer]
14
+ # @return [String]
15
15
  attr_accessor :uid
16
16
 
17
17
  # Identifier of the Evse as given by the Operator, unique for that Operator
@@ -26,27 +26,23 @@ module ShellEv
26
26
  # @return [EvseVOStatusEnum]
27
27
  attr_accessor :status
28
28
 
29
- # List of all connectors available on this EVSE unit.
30
- # @return [Array[ConnectorVO]]
31
- attr_accessor :connectors
32
-
33
- # Methods that can be used to Authorize sessions on this EVSE
34
- # @return [EvseVOAuthorizationMethodsEnum]
35
- attr_accessor :authorization_methods
36
-
37
29
  # ISO8601-compliant UTC datetime of the last update of the EVSE
38
30
  # @return [String]
39
31
  attr_accessor :updated
40
32
 
41
- # optional ISO8601-compliant UTC deletion timestamp of the Evse
42
- # @return [String]
43
- attr_accessor :deleted
44
-
45
33
  # An optional number/string printed on the outside of the EVSE for visual
46
34
  # identification
47
35
  # @return [String]
48
36
  attr_accessor :physical_reference
49
37
 
38
+ # List of all connectors available on this EVSE unit.
39
+ # @return [Array[ConnectorV2]]
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
+
50
46
  # A mapping from model property names to API property names.
51
47
  def self.names
52
48
  @_hash = {} if @_hash.nil?
@@ -54,11 +50,10 @@ module ShellEv
54
50
  @_hash['external_id'] = 'externalId'
55
51
  @_hash['evse_id'] = 'evseId'
56
52
  @_hash['status'] = 'status'
57
- @_hash['connectors'] = 'connectors'
58
- @_hash['authorization_methods'] = 'authorizationMethods'
59
53
  @_hash['updated'] = 'updated'
60
- @_hash['deleted'] = 'deleted'
61
54
  @_hash['physical_reference'] = 'physicalReference'
55
+ @_hash['connectors'] = 'connectors'
56
+ @_hash['authorization_methods'] = 'authorizationMethods'
62
57
  @_hash
63
58
  end
64
59
 
@@ -69,11 +64,10 @@ module ShellEv
69
64
  external_id
70
65
  evse_id
71
66
  status
72
- connectors
73
- authorization_methods
74
67
  updated
75
- deleted
76
68
  physical_reference
69
+ connectors
70
+ authorization_methods
77
71
  ]
78
72
  end
79
73
 
@@ -83,18 +77,16 @@ module ShellEv
83
77
  end
84
78
 
85
79
  def initialize(uid = SKIP, external_id = SKIP, evse_id = SKIP,
86
- status = SKIP, connectors = SKIP,
87
- authorization_methods = SKIP, updated = SKIP, deleted = SKIP,
88
- physical_reference = SKIP)
80
+ status = SKIP, updated = SKIP, physical_reference = SKIP,
81
+ connectors = SKIP, authorization_methods = SKIP)
89
82
  @uid = uid unless uid == SKIP
90
83
  @external_id = external_id unless external_id == SKIP
91
84
  @evse_id = evse_id unless evse_id == SKIP
92
85
  @status = status unless status == SKIP
93
- @connectors = connectors unless connectors == SKIP
94
- @authorization_methods = authorization_methods unless authorization_methods == SKIP
95
86
  @updated = updated unless updated == SKIP
96
- @deleted = deleted unless deleted == SKIP
97
87
  @physical_reference = physical_reference unless physical_reference == SKIP
88
+ @connectors = connectors unless connectors == SKIP
89
+ @authorization_methods = authorization_methods unless authorization_methods == SKIP
98
90
  end
99
91
 
100
92
  # Creates an instance of the object from a hash.
@@ -106,50 +98,48 @@ module ShellEv
106
98
  external_id = hash.key?('externalId') ? hash['externalId'] : SKIP
107
99
  evse_id = hash.key?('evseId') ? hash['evseId'] : SKIP
108
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
109
104
  # Parameter is an array, so we need to iterate through it
110
105
  connectors = nil
111
106
  unless hash['connectors'].nil?
112
107
  connectors = []
113
108
  hash['connectors'].each do |structure|
114
- connectors << (ConnectorVO.from_hash(structure) if structure)
109
+ connectors << (ConnectorV2.from_hash(structure) if structure)
115
110
  end
116
111
  end
117
112
 
118
113
  connectors = SKIP unless hash.key?('connectors')
119
114
  authorization_methods =
120
115
  hash.key?('authorizationMethods') ? hash['authorizationMethods'] : SKIP
121
- updated = hash.key?('updated') ? hash['updated'] : SKIP
122
- deleted = hash.key?('deleted') ? hash['deleted'] : SKIP
123
- physical_reference =
124
- hash.key?('physicalReference') ? hash['physicalReference'] : SKIP
125
116
 
126
117
  # Create object from extracted values.
127
- EvseVO.new(uid,
118
+ EvseV2.new(uid,
128
119
  external_id,
129
120
  evse_id,
130
121
  status,
131
- connectors,
132
- authorization_methods,
133
122
  updated,
134
- deleted,
135
- physical_reference)
123
+ physical_reference,
124
+ connectors,
125
+ authorization_methods)
136
126
  end
137
127
 
138
128
  # Provides a human-readable string representation of the object.
139
129
  def to_s
140
130
  class_name = self.class.name.split('::').last
141
131
  "<#{class_name} uid: #{@uid}, external_id: #{@external_id}, evse_id: #{@evse_id}, status:"\
142
- " #{@status}, connectors: #{@connectors}, authorization_methods: #{@authorization_methods},"\
143
- " updated: #{@updated}, deleted: #{@deleted}, physical_reference: #{@physical_reference}>"
132
+ " #{@status}, updated: #{@updated}, physical_reference: #{@physical_reference}, connectors:"\
133
+ " #{@connectors}, authorization_methods: #{@authorization_methods}>"
144
134
  end
145
135
 
146
136
  # Provides a debugging-friendly string with detailed object information.
147
137
  def inspect
148
138
  class_name = self.class.name.split('::').last
149
139
  "<#{class_name} uid: #{@uid.inspect}, external_id: #{@external_id.inspect}, evse_id:"\
150
- " #{@evse_id.inspect}, status: #{@status.inspect}, connectors: #{@connectors.inspect},"\
151
- " authorization_methods: #{@authorization_methods.inspect}, updated: #{@updated.inspect},"\
152
- " deleted: #{@deleted.inspect}, physical_reference: #{@physical_reference.inspect}>"
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}>"
153
143
  end
154
144
  end
155
145
  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
  # Methods that can be used to Authorize sessions on this EVSE
@@ -22,5 +22,19 @@ module ShellEv
22
22
 
23
23
  EVSE_VO_AUTHORIZATION_METHODS_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
  # The current status of the EVSE units availability
@@ -25,5 +25,20 @@ module ShellEv
25
25
 
26
26
  EVSE_VO_STATUS_ENUM.include?(value)
27
27
  end
28
+
29
+ def self.from_value(value, default_value = AVAILABLE)
30
+ return default_value if value.nil?
31
+
32
+ str = value.to_s.strip
33
+
34
+ case str.downcase
35
+ when 'available' then AVAILABLE
36
+ when 'occupied' then OCCUPIED
37
+ when 'unavailable' then UNAVAILABLE
38
+ when 'unknown' then UNKNOWN
39
+ else
40
+ default_value
41
+ end
42
+ end
28
43
  end
29
44
  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
  # GetChargeSessionRetrieveResponse200Json 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
  # Indicates overall status of the request
@@ -19,5 +19,18 @@ module ShellEv
19
19
 
20
20
  GET_CHARGE_SESSION_RETRIEVE_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
  # Filter by Locations that support the given Authorization Methods
@@ -22,5 +22,19 @@ module ShellEv
22
22
 
23
23
  GET_EV_LOCATIONS_AUTHORIZATION_METHODS_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
  # Filter by Locations that have Connectors with the set of Connector Types
@@ -67,5 +67,34 @@ module ShellEv
67
67
 
68
68
  GET_EV_LOCATIONS_CONNECTOR_TYPES_ENUM.include?(value)
69
69
  end
70
+
71
+ def self.from_value(value, default_value = AVCON)
72
+ return default_value if value.nil?
73
+
74
+ str = value.to_s.strip
75
+
76
+ case str.downcase
77
+ when 'avcon' then AVCON
78
+ when 'domestic' then DOMESTIC
79
+ when 'industrial2pdc' then INDUSTRIAL2PDC
80
+ when 'industrialpneac' then INDUSTRIALPNEAC
81
+ when 'industrial3peac' then INDUSTRIAL3PEAC
82
+ when 'industrial3penac' then INDUSTRIAL3PENAC
83
+ when 'type1' then TYPE1
84
+ when 'type1combo' then TYPE1COMBO
85
+ when 'type2' then TYPE2
86
+ when 'type2combo' then TYPE2COMBO
87
+ when 'type3' then TYPE3
88
+ when 'lpi' then LPI
89
+ when 'nema520' then NEMA520
90
+ when 'saej1772' then SAEJ1772
91
+ when 'spi' then SPI
92
+ when 'tepcochademo' then TEPCOCHADEMO
93
+ when 'tesla' then TESLA
94
+ when 'unspecified' then UNSPECIFIED
95
+ else
96
+ default_value
97
+ end
98
+ end
70
99
  end
71
100
  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
  # Filter by Locations that have the given status
@@ -25,5 +25,20 @@ module ShellEv
25
25
 
26
26
  GET_EV_LOCATIONS_EVSE_STATUS_ENUM.include?(value)
27
27
  end
28
+
29
+ def self.from_value(value, default_value = AVAILABLE)
30
+ return default_value if value.nil?
31
+
32
+ str = value.to_s.strip
33
+
34
+ case str.downcase
35
+ when 'available' then AVAILABLE
36
+ when 'occupied' then OCCUPIED
37
+ when 'unavailable' then UNAVAILABLE
38
+ when 'unknown' then UNKNOWN
39
+ else
40
+ default_value
41
+ end
42
+ end
28
43
  end
29
44
  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
  # InlineResponse202 Model.
@@ -14,13 +14,11 @@ module ShellEv
14
14
  # @return [UUID | String]
15
15
  attr_accessor :request_id
16
16
 
17
- # Mandatory UUID (according to RFC 4122 standards) for requests and
18
- # responses. This will be played back in the response from the request.
17
+ # Indicates overall status of the request
19
18
  # @return [GetChargeSessionRetrieveResponse200JsonStatusEnum]
20
19
  attr_accessor :status
21
20
 
22
- # Mandatory UUID (according to RFC 4122 standards) for requests and
23
- # responses. This will be played back in the response from the request.
21
+ # Indicates overall status of the request
24
22
  # @return [Array[InlineResponse202Data]]
25
23
  attr_accessor :data
26
24