ev-recharge-sdk 1.4.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 +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,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 response
@@ -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
  # OpeningHoursObject Model.
@@ -9,7 +9,7 @@ module ShellEv
9
9
  SKIP = Object.new
10
10
  private_constant :SKIP
11
11
 
12
- # TODO: Write general description for this method
12
+ # 3 letter day of the week
13
13
  # @return [OpeningHoursObjectWeekDayEnum]
14
14
  attr_accessor :week_day
15
15
 
@@ -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
  # 3 letter day of the week
@@ -34,5 +34,23 @@ module ShellEv
34
34
 
35
35
  OPENING_HOURS_OBJECT_WEEK_DAY_ENUM.include?(value)
36
36
  end
37
+
38
+ def self.from_value(value, default_value = SUN)
39
+ return default_value if value.nil?
40
+
41
+ str = value.to_s.strip
42
+
43
+ case str.downcase
44
+ when 'sun' then SUN
45
+ when 'mon' then MON
46
+ when 'tue' then TUE
47
+ when 'wed' then WED
48
+ when 'thu' then THU
49
+ when 'fri' then FRI
50
+ when 'sat' then SAT
51
+ else
52
+ default_value
53
+ end
54
+ end
37
55
  end
38
56
  end
@@ -0,0 +1,68 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module ShellEv
7
+ # PowerRange Model.
8
+ class PowerRange < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Minimum supported power in kW
13
+ # @return [Integer]
14
+ attr_accessor :min
15
+
16
+ # Maximum supported power in kW
17
+ # @return [Integer]
18
+ attr_accessor :max
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['min'] = 'min'
24
+ @_hash['max'] = 'max'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ []
31
+ end
32
+
33
+ # An array for nullable fields
34
+ def self.nullables
35
+ []
36
+ end
37
+
38
+ def initialize(min = nil, max = nil)
39
+ @min = min
40
+ @max = max
41
+ end
42
+
43
+ # Creates an instance of the object from a hash.
44
+ def self.from_hash(hash)
45
+ return nil unless hash
46
+
47
+ # Extract variables from the hash.
48
+ min = hash.key?('min') ? hash['min'] : nil
49
+ max = hash.key?('max') ? hash['max'] : nil
50
+
51
+ # Create object from extracted values.
52
+ PowerRange.new(min,
53
+ max)
54
+ end
55
+
56
+ # Provides a human-readable string representation of the object.
57
+ def to_s
58
+ class_name = self.class.name.split('::').last
59
+ "<#{class_name} min: #{@min}, max: #{@max}>"
60
+ end
61
+
62
+ # Provides a debugging-friendly string with detailed object information.
63
+ def inspect
64
+ class_name = self.class.name.split('::').last
65
+ "<#{class_name} min: #{@min.inspect}, max: #{@max.inspect}>"
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,86 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module ShellEv
7
+ # PriceComponent Model.
8
+ class PriceComponent < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Type of the price component
13
+ # @return [TypeEnum]
14
+ attr_accessor :type
15
+
16
+ # Step size in seconds for TIME-based components, in kWh for ENERGY-based
17
+ # components, or 1 for FLAT components
18
+ # @return [Integer]
19
+ attr_accessor :step_size
20
+
21
+ # Price per step in the specified currency for this price component
22
+ # @return [Float]
23
+ attr_accessor :price
24
+
25
+ # VAT percentage applicable to this price component
26
+ # @return [Float]
27
+ attr_accessor :vat
28
+
29
+ # A mapping from model property names to API property names.
30
+ def self.names
31
+ @_hash = {} if @_hash.nil?
32
+ @_hash['type'] = 'type'
33
+ @_hash['step_size'] = 'stepSize'
34
+ @_hash['price'] = 'price'
35
+ @_hash['vat'] = 'vat'
36
+ @_hash
37
+ end
38
+
39
+ # An array for optional fields
40
+ def self.optionals
41
+ []
42
+ end
43
+
44
+ # An array for nullable fields
45
+ def self.nullables
46
+ []
47
+ end
48
+
49
+ def initialize(type = nil, step_size = nil, price = nil, vat = nil)
50
+ @type = type
51
+ @step_size = step_size
52
+ @price = price
53
+ @vat = vat
54
+ end
55
+
56
+ # Creates an instance of the object from a hash.
57
+ def self.from_hash(hash)
58
+ return nil unless hash
59
+
60
+ # Extract variables from the hash.
61
+ type = hash.key?('type') ? hash['type'] : nil
62
+ step_size = hash.key?('stepSize') ? hash['stepSize'] : nil
63
+ price = hash.key?('price') ? hash['price'] : nil
64
+ vat = hash.key?('vat') ? hash['vat'] : nil
65
+
66
+ # Create object from extracted values.
67
+ PriceComponent.new(type,
68
+ step_size,
69
+ price,
70
+ vat)
71
+ end
72
+
73
+ # Provides a human-readable string representation of the object.
74
+ def to_s
75
+ class_name = self.class.name.split('::').last
76
+ "<#{class_name} type: #{@type}, step_size: #{@step_size}, price: #{@price}, vat: #{@vat}>"
77
+ end
78
+
79
+ # Provides a debugging-friendly string with detailed object information.
80
+ def inspect
81
+ class_name = self.class.name.split('::').last
82
+ "<#{class_name} type: #{@type.inspect}, step_size: #{@step_size.inspect}, price:"\
83
+ " #{@price.inspect}, vat: #{@vat.inspect}>"
84
+ end
85
+ end
86
+ 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
  # RatelimitErrMsg Model.
@@ -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
- # Response Model.
8
- class Response < BaseModel
7
+ # ResponseV2 Model.
8
+ class ResponseV2 < BaseModel
9
9
  SKIP = Object.new
10
10
  private_constant :SKIP
11
11
 
@@ -19,7 +19,7 @@ module ShellEv
19
19
  attr_accessor :status
20
20
 
21
21
  # API Response
22
- # @return [Array[LocationResponeObject]]
22
+ # @return [Array[LocationResponeObjectV2]]
23
23
  attr_accessor :data
24
24
 
25
25
  # A mapping from model property names to API property names.
@@ -63,16 +63,16 @@ module ShellEv
63
63
  unless hash['data'].nil?
64
64
  data = []
65
65
  hash['data'].each do |structure|
66
- data << (LocationResponeObject.from_hash(structure) if structure)
66
+ data << (LocationResponeObjectV2.from_hash(structure) if structure)
67
67
  end
68
68
  end
69
69
 
70
70
  data = SKIP unless hash.key?('data')
71
71
 
72
72
  # Create object from extracted values.
73
- Response.new(request_id,
74
- status,
75
- data)
73
+ ResponseV2.new(request_id,
74
+ status,
75
+ data)
76
76
  end
77
77
 
78
78
  # Provides a human-readable string representation of the object.
@@ -0,0 +1,183 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module ShellEv
7
+ # Restrictions Model.
8
+ class Restrictions < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Valid from this time of the day (HH:mm)
13
+ # @return [String]
14
+ attr_accessor :start_time
15
+
16
+ # Valid until this time of the day (HH:mm)
17
+ # @return [String]
18
+ attr_accessor :end_time
19
+
20
+ # Valid until this time of the day (HH:mm)
21
+ # @return [Date]
22
+ attr_accessor :start_date
23
+
24
+ # Valid until this time of the day (HH:mm)
25
+ # @return [Date]
26
+ attr_accessor :end_date
27
+
28
+ # Valid until this time of the day (HH:mm)
29
+ # @return [Float]
30
+ attr_accessor :min_kwh
31
+
32
+ # Valid until this time of the day (HH:mm)
33
+ # @return [Float]
34
+ attr_accessor :max_kwh
35
+
36
+ # Valid until this time of the day (HH:mm)
37
+ # @return [Float]
38
+ attr_accessor :min_current
39
+
40
+ # Valid until this time of the day (HH:mm)
41
+ # @return [Float]
42
+ attr_accessor :max_current
43
+
44
+ # Valid until this time of the day (HH:mm)
45
+ # @return [Float]
46
+ attr_accessor :min_power
47
+
48
+ # Valid until this time of the day (HH:mm)
49
+ # @return [Float]
50
+ attr_accessor :max_power
51
+
52
+ # Minimum session duration in seconds
53
+ # @return [Integer]
54
+ attr_accessor :min_duration
55
+
56
+ # Maximum session duration in seconds
57
+ # @return [Integer]
58
+ attr_accessor :max_duration
59
+
60
+ # Maximum session duration in seconds
61
+ # @return [Array[DayOfWeekEnum]]
62
+ attr_accessor :day_of_week
63
+
64
+ # A mapping from model property names to API property names.
65
+ def self.names
66
+ @_hash = {} if @_hash.nil?
67
+ @_hash['start_time'] = 'startTime'
68
+ @_hash['end_time'] = 'endTime'
69
+ @_hash['start_date'] = 'startDate'
70
+ @_hash['end_date'] = 'endDate'
71
+ @_hash['min_kwh'] = 'minKwh'
72
+ @_hash['max_kwh'] = 'maxKwh'
73
+ @_hash['min_current'] = 'minCurrent'
74
+ @_hash['max_current'] = 'maxCurrent'
75
+ @_hash['min_power'] = 'minPower'
76
+ @_hash['max_power'] = 'maxPower'
77
+ @_hash['min_duration'] = 'minDuration'
78
+ @_hash['max_duration'] = 'maxDuration'
79
+ @_hash['day_of_week'] = 'dayOfWeek'
80
+ @_hash
81
+ end
82
+
83
+ # An array for optional fields
84
+ def self.optionals
85
+ %w[
86
+ start_time
87
+ end_time
88
+ start_date
89
+ end_date
90
+ min_kwh
91
+ max_kwh
92
+ min_current
93
+ max_current
94
+ min_power
95
+ max_power
96
+ min_duration
97
+ max_duration
98
+ day_of_week
99
+ ]
100
+ end
101
+
102
+ # An array for nullable fields
103
+ def self.nullables
104
+ []
105
+ end
106
+
107
+ def initialize(start_time = SKIP, end_time = SKIP, start_date = SKIP,
108
+ end_date = SKIP, min_kwh = SKIP, max_kwh = SKIP,
109
+ min_current = SKIP, max_current = SKIP, min_power = SKIP,
110
+ max_power = SKIP, min_duration = SKIP, max_duration = SKIP,
111
+ day_of_week = SKIP)
112
+ @start_time = start_time unless start_time == SKIP
113
+ @end_time = end_time unless end_time == SKIP
114
+ @start_date = start_date unless start_date == SKIP
115
+ @end_date = end_date unless end_date == SKIP
116
+ @min_kwh = min_kwh unless min_kwh == SKIP
117
+ @max_kwh = max_kwh unless max_kwh == SKIP
118
+ @min_current = min_current unless min_current == SKIP
119
+ @max_current = max_current unless max_current == SKIP
120
+ @min_power = min_power unless min_power == SKIP
121
+ @max_power = max_power unless max_power == SKIP
122
+ @min_duration = min_duration unless min_duration == SKIP
123
+ @max_duration = max_duration unless max_duration == SKIP
124
+ @day_of_week = day_of_week unless day_of_week == SKIP
125
+ end
126
+
127
+ # Creates an instance of the object from a hash.
128
+ def self.from_hash(hash)
129
+ return nil unless hash
130
+
131
+ # Extract variables from the hash.
132
+ start_time = hash.key?('startTime') ? hash['startTime'] : SKIP
133
+ end_time = hash.key?('endTime') ? hash['endTime'] : SKIP
134
+ start_date = hash.key?('startDate') ? hash['startDate'] : SKIP
135
+ end_date = hash.key?('endDate') ? hash['endDate'] : SKIP
136
+ min_kwh = hash.key?('minKwh') ? hash['minKwh'] : SKIP
137
+ max_kwh = hash.key?('maxKwh') ? hash['maxKwh'] : SKIP
138
+ min_current = hash.key?('minCurrent') ? hash['minCurrent'] : SKIP
139
+ max_current = hash.key?('maxCurrent') ? hash['maxCurrent'] : SKIP
140
+ min_power = hash.key?('minPower') ? hash['minPower'] : SKIP
141
+ max_power = hash.key?('maxPower') ? hash['maxPower'] : SKIP
142
+ min_duration = hash.key?('minDuration') ? hash['minDuration'] : SKIP
143
+ max_duration = hash.key?('maxDuration') ? hash['maxDuration'] : SKIP
144
+ day_of_week = hash.key?('dayOfWeek') ? hash['dayOfWeek'] : SKIP
145
+
146
+ # Create object from extracted values.
147
+ Restrictions.new(start_time,
148
+ end_time,
149
+ start_date,
150
+ end_date,
151
+ min_kwh,
152
+ max_kwh,
153
+ min_current,
154
+ max_current,
155
+ min_power,
156
+ max_power,
157
+ min_duration,
158
+ max_duration,
159
+ day_of_week)
160
+ end
161
+
162
+ # Provides a human-readable string representation of the object.
163
+ def to_s
164
+ class_name = self.class.name.split('::').last
165
+ "<#{class_name} start_time: #{@start_time}, end_time: #{@end_time}, start_date:"\
166
+ " #{@start_date}, end_date: #{@end_date}, min_kwh: #{@min_kwh}, max_kwh: #{@max_kwh},"\
167
+ " min_current: #{@min_current}, max_current: #{@max_current}, min_power: #{@min_power},"\
168
+ " max_power: #{@max_power}, min_duration: #{@min_duration}, max_duration: #{@max_duration},"\
169
+ " day_of_week: #{@day_of_week}>"
170
+ end
171
+
172
+ # Provides a debugging-friendly string with detailed object information.
173
+ def inspect
174
+ class_name = self.class.name.split('::').last
175
+ "<#{class_name} start_time: #{@start_time.inspect}, end_time: #{@end_time.inspect},"\
176
+ " start_date: #{@start_date.inspect}, end_date: #{@end_date.inspect}, min_kwh:"\
177
+ " #{@min_kwh.inspect}, max_kwh: #{@max_kwh.inspect}, min_current: #{@min_current.inspect},"\
178
+ " max_current: #{@max_current.inspect}, min_power: #{@min_power.inspect}, max_power:"\
179
+ " #{@max_power.inspect}, min_duration: #{@min_duration.inspect}, max_duration:"\
180
+ " #{@max_duration.inspect}, day_of_week: #{@day_of_week.inspect}>"
181
+ end
182
+ end
183
+ end
@@ -0,0 +1,115 @@
1
+ # shell_ev
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module ShellEv
7
+ # An EVSE can have one or many Connectors. Each Connector will normally have a
8
+ # different socket / cable and only one can be used to charge at a time.
9
+ class SearchByIdConnector < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Internal identifier used to refer to this Connector
14
+ # @return [String]
15
+ attr_accessor :uid
16
+
17
+ # Identifier of the Evse as given by the Operator, unique for the containing
18
+ # EVSE'
19
+ # @return [String]
20
+ attr_accessor :external_id
21
+
22
+ # Type of the connector in the EVSE unit.
23
+ # @return [ConnectorVOConnectorTypeEnum]
24
+ attr_accessor :connector_type
25
+
26
+ # Electrical Properties of the Connector
27
+ # @return [ElectricalPropertiesV2]
28
+ attr_accessor :electrical_properties
29
+
30
+ # Tariffs applicable to this Connector
31
+ # @return [Array[TariffV2]]
32
+ attr_accessor :tariffs
33
+
34
+ # A mapping from model property names to API property names.
35
+ def self.names
36
+ @_hash = {} if @_hash.nil?
37
+ @_hash['uid'] = 'uid'
38
+ @_hash['external_id'] = 'externalId'
39
+ @_hash['connector_type'] = 'connectorType'
40
+ @_hash['electrical_properties'] = 'electricalProperties'
41
+ @_hash['tariffs'] = 'tariffs'
42
+ @_hash
43
+ end
44
+
45
+ # An array for optional fields
46
+ def self.optionals
47
+ %w[
48
+ uid
49
+ external_id
50
+ connector_type
51
+ electrical_properties
52
+ tariffs
53
+ ]
54
+ end
55
+
56
+ # An array for nullable fields
57
+ def self.nullables
58
+ []
59
+ end
60
+
61
+ def initialize(uid = SKIP, external_id = SKIP, connector_type = SKIP,
62
+ electrical_properties = SKIP, tariffs = SKIP)
63
+ @uid = uid unless uid == SKIP
64
+ @external_id = external_id unless external_id == SKIP
65
+ @connector_type = connector_type unless connector_type == SKIP
66
+ @electrical_properties = electrical_properties unless electrical_properties == SKIP
67
+ @tariffs = tariffs unless tariffs == SKIP
68
+ end
69
+
70
+ # Creates an instance of the object from a hash.
71
+ def self.from_hash(hash)
72
+ return nil unless hash
73
+
74
+ # Extract variables from the hash.
75
+ uid = hash.key?('uid') ? hash['uid'] : SKIP
76
+ external_id = hash.key?('externalId') ? hash['externalId'] : SKIP
77
+ connector_type = hash.key?('connectorType') ? hash['connectorType'] : SKIP
78
+ electrical_properties = ElectricalPropertiesV2.from_hash(hash['electricalProperties']) if
79
+ hash['electricalProperties']
80
+ # Parameter is an array, so we need to iterate through it
81
+ tariffs = nil
82
+ unless hash['tariffs'].nil?
83
+ tariffs = []
84
+ hash['tariffs'].each do |structure|
85
+ tariffs << (TariffV2.from_hash(structure) if structure)
86
+ end
87
+ end
88
+
89
+ tariffs = SKIP unless hash.key?('tariffs')
90
+
91
+ # Create object from extracted values.
92
+ SearchByIdConnector.new(uid,
93
+ external_id,
94
+ connector_type,
95
+ electrical_properties,
96
+ tariffs)
97
+ end
98
+
99
+ # Provides a human-readable string representation of the object.
100
+ def to_s
101
+ class_name = self.class.name.split('::').last
102
+ "<#{class_name} uid: #{@uid}, external_id: #{@external_id}, connector_type:"\
103
+ " #{@connector_type}, electrical_properties: #{@electrical_properties}, tariffs:"\
104
+ " #{@tariffs}>"
105
+ end
106
+
107
+ # Provides a debugging-friendly string with detailed object information.
108
+ def inspect
109
+ class_name = self.class.name.split('::').last
110
+ "<#{class_name} uid: #{@uid.inspect}, external_id: #{@external_id.inspect}, connector_type:"\
111
+ " #{@connector_type.inspect}, electrical_properties: #{@electrical_properties.inspect},"\
112
+ " tariffs: #{@tariffs.inspect}>"
113
+ end
114
+ end
115
+ end