vmsp-sdk 0.0.1

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 (130) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +167 -0
  4. data/bin/console +15 -0
  5. data/lib/e_mobility_vmspocpiap_is/api_helper.rb +10 -0
  6. data/lib/e_mobility_vmspocpiap_is/client.rb +138 -0
  7. data/lib/e_mobility_vmspocpiap_is/configuration.rb +176 -0
  8. data/lib/e_mobility_vmspocpiap_is/controllers/account_controller.rb +53 -0
  9. data/lib/e_mobility_vmspocpiap_is/controllers/base_controller.rb +60 -0
  10. data/lib/e_mobility_vmspocpiap_is/controllers/cd_rs_pull_controller.rb +103 -0
  11. data/lib/e_mobility_vmspocpiap_is/controllers/cd_rs_push_controller.rb +51 -0
  12. data/lib/e_mobility_vmspocpiap_is/controllers/commands_callback_controller.rb +56 -0
  13. data/lib/e_mobility_vmspocpiap_is/controllers/commands_controller.rb +102 -0
  14. data/lib/e_mobility_vmspocpiap_is/controllers/locations_pull_controller.rb +125 -0
  15. data/lib/e_mobility_vmspocpiap_is/controllers/locations_push_controller.rb +68 -0
  16. data/lib/e_mobility_vmspocpiap_is/controllers/sessions_pull_controller.rb +91 -0
  17. data/lib/e_mobility_vmspocpiap_is/controllers/sessions_push_controller.rb +74 -0
  18. data/lib/e_mobility_vmspocpiap_is/controllers/tariffs_pull_controller.rb +117 -0
  19. data/lib/e_mobility_vmspocpiap_is/controllers/tariffs_push_controller.rb +62 -0
  20. data/lib/e_mobility_vmspocpiap_is/exceptions/accounts_ocpi_error_response_exception.rb +69 -0
  21. data/lib/e_mobility_vmspocpiap_is/exceptions/accounts_ocpi_response_exception.rb +67 -0
  22. data/lib/e_mobility_vmspocpiap_is/exceptions/accounts_ocpi_unauthorized_response_exception.rb +64 -0
  23. data/lib/e_mobility_vmspocpiap_is/exceptions/api_exception.rb +21 -0
  24. data/lib/e_mobility_vmspocpiap_is/exceptions/ocpi_error_response_exception.rb +71 -0
  25. data/lib/e_mobility_vmspocpiap_is/exceptions/ocpi_response_error_exception.rb +67 -0
  26. data/lib/e_mobility_vmspocpiap_is/exceptions/ocpi_unauthorized_response_exception.rb +64 -0
  27. data/lib/e_mobility_vmspocpiap_is/exceptions/v3_commands_startsession400_error_exception.rb +67 -0
  28. data/lib/e_mobility_vmspocpiap_is/http/auth/bearer_authorization.rb +53 -0
  29. data/lib/e_mobility_vmspocpiap_is/http/auth/ocpi_authorization.rb +52 -0
  30. data/lib/e_mobility_vmspocpiap_is/http/http_call_back.rb +10 -0
  31. data/lib/e_mobility_vmspocpiap_is/http/http_method_enum.rb +10 -0
  32. data/lib/e_mobility_vmspocpiap_is/http/http_request.rb +10 -0
  33. data/lib/e_mobility_vmspocpiap_is/http/http_response.rb +10 -0
  34. data/lib/e_mobility_vmspocpiap_is/http/proxy_settings.rb +22 -0
  35. data/lib/e_mobility_vmspocpiap_is/models/account_details.rb +237 -0
  36. data/lib/e_mobility_vmspocpiap_is/models/account_details2.rb +237 -0
  37. data/lib/e_mobility_vmspocpiap_is/models/account_response.rb +98 -0
  38. data/lib/e_mobility_vmspocpiap_is/models/account_state_enum.rb +46 -0
  39. data/lib/e_mobility_vmspocpiap_is/models/account_state_reason_enum.rb +67 -0
  40. data/lib/e_mobility_vmspocpiap_is/models/add_on_fee.rb +101 -0
  41. data/lib/e_mobility_vmspocpiap_is/models/add_on_fee_type_enum.rb +52 -0
  42. data/lib/e_mobility_vmspocpiap_is/models/additional_geo_location.rb +82 -0
  43. data/lib/e_mobility_vmspocpiap_is/models/auth_method_enum.rb +40 -0
  44. data/lib/e_mobility_vmspocpiap_is/models/base_model.rb +110 -0
  45. data/lib/e_mobility_vmspocpiap_is/models/benefit.rb +181 -0
  46. data/lib/e_mobility_vmspocpiap_is/models/booking_restriction_type_enum.rb +44 -0
  47. data/lib/e_mobility_vmspocpiap_is/models/business_details.rb +84 -0
  48. data/lib/e_mobility_vmspocpiap_is/models/capability_enum.rb +88 -0
  49. data/lib/e_mobility_vmspocpiap_is/models/cdr.rb +462 -0
  50. data/lib/e_mobility_vmspocpiap_is/models/cdr1.rb +457 -0
  51. data/lib/e_mobility_vmspocpiap_is/models/cdr_dimension.rb +71 -0
  52. data/lib/e_mobility_vmspocpiap_is/models/cdr_dimension_type_enum.rb +97 -0
  53. data/lib/e_mobility_vmspocpiap_is/models/cdr_location.rb +206 -0
  54. data/lib/e_mobility_vmspocpiap_is/models/cdr_token.rb +91 -0
  55. data/lib/e_mobility_vmspocpiap_is/models/charge_type_enum.rb +52 -0
  56. data/lib/e_mobility_vmspocpiap_is/models/charging_period.rb +100 -0
  57. data/lib/e_mobility_vmspocpiap_is/models/command_response.rb +92 -0
  58. data/lib/e_mobility_vmspocpiap_is/models/command_response1.rb +91 -0
  59. data/lib/e_mobility_vmspocpiap_is/models/command_response_type_enum.rb +44 -0
  60. data/lib/e_mobility_vmspocpiap_is/models/command_result.rb +81 -0
  61. data/lib/e_mobility_vmspocpiap_is/models/command_result_type_enum.rb +64 -0
  62. data/lib/e_mobility_vmspocpiap_is/models/connector.rb +184 -0
  63. data/lib/e_mobility_vmspocpiap_is/models/connector_format_enum.rb +36 -0
  64. data/lib/e_mobility_vmspocpiap_is/models/connector_type_enum.rb +196 -0
  65. data/lib/e_mobility_vmspocpiap_is/models/day_of_week_enum.rb +56 -0
  66. data/lib/e_mobility_vmspocpiap_is/models/display_text.rb +68 -0
  67. data/lib/e_mobility_vmspocpiap_is/models/emaid.rb +137 -0
  68. data/lib/e_mobility_vmspocpiap_is/models/energy_mix.rb +127 -0
  69. data/lib/e_mobility_vmspocpiap_is/models/energy_source.rb +69 -0
  70. data/lib/e_mobility_vmspocpiap_is/models/energy_source_category_enum.rb +60 -0
  71. data/lib/e_mobility_vmspocpiap_is/models/environmental_impact.rb +68 -0
  72. data/lib/e_mobility_vmspocpiap_is/models/environmental_impact_category_enum.rb +36 -0
  73. data/lib/e_mobility_vmspocpiap_is/models/evse.rb +250 -0
  74. data/lib/e_mobility_vmspocpiap_is/models/exceptional_period.rb +84 -0
  75. data/lib/e_mobility_vmspocpiap_is/models/facility_enum.rb +108 -0
  76. data/lib/e_mobility_vmspocpiap_is/models/geo_location.rb +73 -0
  77. data/lib/e_mobility_vmspocpiap_is/models/hours.rb +127 -0
  78. data/lib/e_mobility_vmspocpiap_is/models/image.rb +114 -0
  79. data/lib/e_mobility_vmspocpiap_is/models/image_category_enum.rb +58 -0
  80. data/lib/e_mobility_vmspocpiap_is/models/location.rb +379 -0
  81. data/lib/e_mobility_vmspocpiap_is/models/location1.rb +375 -0
  82. data/lib/e_mobility_vmspocpiap_is/models/ocpi_command_response.rb +62 -0
  83. data/lib/e_mobility_vmspocpiap_is/models/ocpi_response.rb +98 -0
  84. data/lib/e_mobility_vmspocpiap_is/models/parking_direction_enum.rb +40 -0
  85. data/lib/e_mobility_vmspocpiap_is/models/parking_restriction_enum.rb +61 -0
  86. data/lib/e_mobility_vmspocpiap_is/models/parking_type_enum.rb +53 -0
  87. data/lib/e_mobility_vmspocpiap_is/models/power_type_enum.rb +48 -0
  88. data/lib/e_mobility_vmspocpiap_is/models/price.rb +80 -0
  89. data/lib/e_mobility_vmspocpiap_is/models/price_component.rb +99 -0
  90. data/lib/e_mobility_vmspocpiap_is/models/price_limit.rb +71 -0
  91. data/lib/e_mobility_vmspocpiap_is/models/product.rb +186 -0
  92. data/lib/e_mobility_vmspocpiap_is/models/publish_token_type.rb +106 -0
  93. data/lib/e_mobility_vmspocpiap_is/models/regular_hours.rb +80 -0
  94. data/lib/e_mobility_vmspocpiap_is/models/reservation_restriction_type_enum.rb +36 -0
  95. data/lib/e_mobility_vmspocpiap_is/models/session.rb +298 -0
  96. data/lib/e_mobility_vmspocpiap_is/models/session_status_enum.rb +60 -0
  97. data/lib/e_mobility_vmspocpiap_is/models/signed_data.rb +116 -0
  98. data/lib/e_mobility_vmspocpiap_is/models/signed_value.rb +85 -0
  99. data/lib/e_mobility_vmspocpiap_is/models/start_session.rb +107 -0
  100. data/lib/e_mobility_vmspocpiap_is/models/start_session_token.rb +68 -0
  101. data/lib/e_mobility_vmspocpiap_is/models/status2_enum.rb +44 -0
  102. data/lib/e_mobility_vmspocpiap_is/models/status_enum.rb +64 -0
  103. data/lib/e_mobility_vmspocpiap_is/models/status_schedule.rb +97 -0
  104. data/lib/e_mobility_vmspocpiap_is/models/stop_session.rb +70 -0
  105. data/lib/e_mobility_vmspocpiap_is/models/subscription_renewal_cadence_enum.rb +44 -0
  106. data/lib/e_mobility_vmspocpiap_is/models/tariff.rb +347 -0
  107. data/lib/e_mobility_vmspocpiap_is/models/tariff1.rb +336 -0
  108. data/lib/e_mobility_vmspocpiap_is/models/tariff_dimension_type_enum.rb +60 -0
  109. data/lib/e_mobility_vmspocpiap_is/models/tariff_element.rb +91 -0
  110. data/lib/e_mobility_vmspocpiap_is/models/tariff_restrictions.rb +310 -0
  111. data/lib/e_mobility_vmspocpiap_is/models/tariff_type_enum.rb +48 -0
  112. data/lib/e_mobility_vmspocpiap_is/models/tax_amount.rb +95 -0
  113. data/lib/e_mobility_vmspocpiap_is/models/tax_included_enum.rb +40 -0
  114. data/lib/e_mobility_vmspocpiap_is/models/token_type_enum.rb +48 -0
  115. data/lib/e_mobility_vmspocpiap_is/models/type_of_emaid_enum.rb +36 -0
  116. data/lib/e_mobility_vmspocpiap_is/models/url_enum.rb +36 -0
  117. data/lib/e_mobility_vmspocpiap_is/models/v3_cdrs_response.rb +107 -0
  118. data/lib/e_mobility_vmspocpiap_is/models/v3_cdrs_response1.rb +98 -0
  119. data/lib/e_mobility_vmspocpiap_is/models/v3_commands_startsession_response.rb +98 -0
  120. data/lib/e_mobility_vmspocpiap_is/models/v3_commands_stopsession_response.rb +98 -0
  121. data/lib/e_mobility_vmspocpiap_is/models/v3_locations_response.rb +107 -0
  122. data/lib/e_mobility_vmspocpiap_is/models/v3_locations_response1.rb +98 -0
  123. data/lib/e_mobility_vmspocpiap_is/models/v3_sessions_response.rb +107 -0
  124. data/lib/e_mobility_vmspocpiap_is/models/v3_tariffs_response.rb +107 -0
  125. data/lib/e_mobility_vmspocpiap_is/models/v3_tariffs_response1.rb +98 -0
  126. data/lib/e_mobility_vmspocpiap_is/models/vehicle_type_enum.rb +64 -0
  127. data/lib/e_mobility_vmspocpiap_is/utilities/date_time_helper.rb +11 -0
  128. data/lib/e_mobility_vmspocpiap_is/utilities/file_wrapper.rb +28 -0
  129. data/lib/e_mobility_vmspocpiap_is.rb +164 -0
  130. metadata +213 -0
@@ -0,0 +1,36 @@
1
+ # e_mobility_vmspocpiap_is
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module EMobilityVmspocpiapIs
7
+ # Defines if a TariffElement is applicable for a reservation.
8
+ class ReservationRestrictionTypeEnum
9
+ RESERVATION_RESTRICTION_TYPE_ENUM = [
10
+ # TODO: Write general description for RESERVATION
11
+ RESERVATION = 'RESERVATION'.freeze,
12
+
13
+ # TODO: Write general description for RESERVATION_EXPIRES
14
+ RESERVATION_EXPIRES = 'RESERVATION_EXPIRES'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ RESERVATION_RESTRICTION_TYPE_ENUM.include?(value)
21
+ end
22
+
23
+ def self.from_value(value, default_value = RESERVATION)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'reservation' then RESERVATION
30
+ when 'reservation_expires' then RESERVATION_EXPIRES
31
+ else
32
+ default_value
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,298 @@
1
+ # e_mobility_vmspocpiap_is
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module EMobilityVmspocpiapIs
8
+ # The Session object describes one charging session. That doesn't mean it is
9
+ # required that energy has been transferred between EV and the Charge Point.
10
+ # It is possible that the EV never took energy from the Charge Point because
11
+ # it was instructed not to take energy by the driver. But as the EV was
12
+ # connected to the Charge Point, some form of start tariff, park tariff or
13
+ # reservation cost might be relevant.
14
+ class Session < BaseModel
15
+ SKIP = Object.new
16
+ private_constant :SKIP
17
+
18
+ # ISO-3166 alpha-2 country code of the CPO that 'owns' this Session.
19
+ # @return [String]
20
+ attr_accessor :country_code
21
+
22
+ # ID of the CPO that 'owns' this Session (following the ISO-15118 standard).
23
+ # @return [String]
24
+ attr_accessor :party_id
25
+
26
+ # The unique id that identifies the charging session in the CPO platform.
27
+ # @return [String]
28
+ attr_accessor :id
29
+
30
+ # The timestamp when the session became ACTIVE in the Charge Point.
31
+ # When the session is still PENDING, this field SHALL be set to the time the
32
+ # Session was
33
+ # created at the Charge Point. When a Session goes from PENDING to ACTIVE,
34
+ # this field SHALL
35
+ # be updated to the moment the Session went to ACTIVE in the Charge Point.
36
+ # @return [DateTime]
37
+ attr_accessor :start_date_time
38
+
39
+ # The timestamp when the session was completed/finished, charging might have
40
+ # finished before the session ends, for example EV is full, but parking cost
41
+ # also has to be paid.
42
+ # @return [DateTime]
43
+ attr_accessor :end_date_time
44
+
45
+ # How many kWh were charged.
46
+ # @return [Float]
47
+ attr_accessor :kwh
48
+
49
+ # Token information used to start a charging session, containing all
50
+ # relevant information to identify the unique token.
51
+ # @return [CdrToken]
52
+ attr_accessor :cdr_token
53
+
54
+ # Method used for authentication.
55
+ # @return [AuthMethodEnum]
56
+ attr_accessor :auth_method
57
+
58
+ # Reference to the authorization given by the eMSP. When the eMSP provided
59
+ # an
60
+ # authorization_reference in either real-time authorization, StartSession or
61
+ # ReserveNow,
62
+ # this field SHALL contain the same value. When different
63
+ # authorization_reference values
64
+ # have been given by the eMSP that are relevant to this Session, the last
65
+ # given value
66
+ # SHALL be used here.
67
+ # @return [String]
68
+ attr_accessor :authorization_reference
69
+
70
+ # Reference to the authorization given by the eMSP. When the eMSP provided
71
+ # an
72
+ # authorization_reference in either real-time authorization, StartSession or
73
+ # ReserveNow,
74
+ # this field SHALL contain the same value. When different
75
+ # authorization_reference values
76
+ # have been given by the eMSP that are relevant to this Session, the last
77
+ # given value
78
+ # SHALL be used here.
79
+ # @return [Array[AddOnFee]]
80
+ attr_accessor :add_on_fee
81
+
82
+ # Location.id of the Location object of this CPO, on which the charging
83
+ # session is/was happening.
84
+ # @return [String]
85
+ attr_accessor :location_id
86
+
87
+ # EVSE.uid of the EVSE of this Location on which the charging session is/was
88
+ # happening. Allowed to be set to '#NA' when this session is created for a
89
+ # reservation, but no EVSE yet assigned to the driver.
90
+ # @return [String]
91
+ attr_accessor :evse_uid
92
+
93
+ # Connector.id of the Connector of this Location where the charging session
94
+ # is/was happening. Allowed to be set to '#NA' when this session is created
95
+ # for a reservation, but no connector yet assigned to the driver.
96
+ # @return [String]
97
+ attr_accessor :connector_id
98
+
99
+ # ISO 4217 code of the currency used for this session.
100
+ # @return [String]
101
+ attr_accessor :currency
102
+
103
+ # An optional list of Charging Periods that can be used to calculate and
104
+ # verify the total cost.
105
+ # @return [Array[ChargingPeriod]]
106
+ attr_accessor :charging_periods
107
+
108
+ # Price information with tax details.
109
+ # @return [Price]
110
+ attr_accessor :total_cost
111
+
112
+ # Defines the state of a session.
113
+ # @return [SessionStatusEnum]
114
+ attr_accessor :status
115
+
116
+ # Timestamp when this Session was last updated (or created).
117
+ # @return [DateTime]
118
+ attr_accessor :last_updated
119
+
120
+ # A mapping from model property names to API property names.
121
+ def self.names
122
+ @_hash = {} if @_hash.nil?
123
+ @_hash['country_code'] = 'country_code'
124
+ @_hash['party_id'] = 'party_id'
125
+ @_hash['id'] = 'id'
126
+ @_hash['start_date_time'] = 'start_date_time'
127
+ @_hash['end_date_time'] = 'end_date_time'
128
+ @_hash['kwh'] = 'kwh'
129
+ @_hash['cdr_token'] = 'cdr_token'
130
+ @_hash['auth_method'] = 'auth_method'
131
+ @_hash['authorization_reference'] = 'authorization_reference'
132
+ @_hash['add_on_fee'] = 'add_on_fee'
133
+ @_hash['location_id'] = 'location_id'
134
+ @_hash['evse_uid'] = 'evse_uid'
135
+ @_hash['connector_id'] = 'connector_id'
136
+ @_hash['currency'] = 'currency'
137
+ @_hash['charging_periods'] = 'charging_periods'
138
+ @_hash['total_cost'] = 'total_cost'
139
+ @_hash['status'] = 'status'
140
+ @_hash['last_updated'] = 'last_updated'
141
+ @_hash
142
+ end
143
+
144
+ # An array for optional fields
145
+ def self.optionals
146
+ %w[
147
+ end_date_time
148
+ authorization_reference
149
+ add_on_fee
150
+ connector_id
151
+ charging_periods
152
+ total_cost
153
+ ]
154
+ end
155
+
156
+ # An array for nullable fields
157
+ def self.nullables
158
+ []
159
+ end
160
+
161
+ def initialize(country_code = nil, party_id = nil, id = nil,
162
+ start_date_time = nil, kwh = nil, cdr_token = nil,
163
+ auth_method = nil, location_id = nil, evse_uid = nil,
164
+ currency = nil, status = nil, last_updated = nil,
165
+ end_date_time = SKIP, authorization_reference = SKIP,
166
+ add_on_fee = SKIP, connector_id = SKIP,
167
+ charging_periods = SKIP, total_cost = SKIP)
168
+ @country_code = country_code
169
+ @party_id = party_id
170
+ @id = id
171
+ @start_date_time = start_date_time
172
+ @end_date_time = end_date_time unless end_date_time == SKIP
173
+ @kwh = kwh
174
+ @cdr_token = cdr_token
175
+ @auth_method = auth_method
176
+ @authorization_reference = authorization_reference unless authorization_reference == SKIP
177
+ @add_on_fee = add_on_fee unless add_on_fee == SKIP
178
+ @location_id = location_id
179
+ @evse_uid = evse_uid
180
+ @connector_id = connector_id unless connector_id == SKIP
181
+ @currency = currency
182
+ @charging_periods = charging_periods unless charging_periods == SKIP
183
+ @total_cost = total_cost unless total_cost == SKIP
184
+ @status = status
185
+ @last_updated = last_updated
186
+ end
187
+
188
+ # Creates an instance of the object from a hash.
189
+ def self.from_hash(hash)
190
+ return nil unless hash
191
+
192
+ # Extract variables from the hash.
193
+ country_code = hash.key?('country_code') ? hash['country_code'] : nil
194
+ party_id = hash.key?('party_id') ? hash['party_id'] : nil
195
+ id = hash.key?('id') ? hash['id'] : nil
196
+ start_date_time = if hash.key?('start_date_time')
197
+ (DateTimeHelper.from_rfc3339(hash['start_date_time']) if hash['start_date_time'])
198
+ end
199
+ kwh = hash.key?('kwh') ? hash['kwh'] : nil
200
+ cdr_token = CdrToken.from_hash(hash['cdr_token']) if hash['cdr_token']
201
+ auth_method = hash.key?('auth_method') ? hash['auth_method'] : nil
202
+ location_id = hash.key?('location_id') ? hash['location_id'] : nil
203
+ evse_uid = hash.key?('evse_uid') ? hash['evse_uid'] : nil
204
+ currency = hash.key?('currency') ? hash['currency'] : nil
205
+ status = hash.key?('status') ? hash['status'] : nil
206
+ last_updated = if hash.key?('last_updated')
207
+ (DateTimeHelper.from_rfc3339(hash['last_updated']) if hash['last_updated'])
208
+ end
209
+ end_date_time = if hash.key?('end_date_time')
210
+ (DateTimeHelper.from_rfc3339(hash['end_date_time']) if hash['end_date_time'])
211
+ else
212
+ SKIP
213
+ end
214
+ authorization_reference =
215
+ hash.key?('authorization_reference') ? hash['authorization_reference'] : SKIP
216
+ # Parameter is an array, so we need to iterate through it
217
+ add_on_fee = nil
218
+ unless hash['add_on_fee'].nil?
219
+ add_on_fee = []
220
+ hash['add_on_fee'].each do |structure|
221
+ add_on_fee << (AddOnFee.from_hash(structure) if structure)
222
+ end
223
+ end
224
+
225
+ add_on_fee = SKIP unless hash.key?('add_on_fee')
226
+ connector_id = hash.key?('connector_id') ? hash['connector_id'] : SKIP
227
+ # Parameter is an array, so we need to iterate through it
228
+ charging_periods = nil
229
+ unless hash['charging_periods'].nil?
230
+ charging_periods = []
231
+ hash['charging_periods'].each do |structure|
232
+ charging_periods << (ChargingPeriod.from_hash(structure) if structure)
233
+ end
234
+ end
235
+
236
+ charging_periods = SKIP unless hash.key?('charging_periods')
237
+ total_cost = Price.from_hash(hash['total_cost']) if hash['total_cost']
238
+
239
+ # Create object from extracted values.
240
+ Session.new(country_code,
241
+ party_id,
242
+ id,
243
+ start_date_time,
244
+ kwh,
245
+ cdr_token,
246
+ auth_method,
247
+ location_id,
248
+ evse_uid,
249
+ currency,
250
+ status,
251
+ last_updated,
252
+ end_date_time,
253
+ authorization_reference,
254
+ add_on_fee,
255
+ connector_id,
256
+ charging_periods,
257
+ total_cost)
258
+ end
259
+
260
+ def to_custom_start_date_time
261
+ DateTimeHelper.to_rfc3339(start_date_time)
262
+ end
263
+
264
+ def to_custom_end_date_time
265
+ DateTimeHelper.to_rfc3339(end_date_time)
266
+ end
267
+
268
+ def to_custom_last_updated
269
+ DateTimeHelper.to_rfc3339(last_updated)
270
+ end
271
+
272
+ # Provides a human-readable string representation of the object.
273
+ def to_s
274
+ class_name = self.class.name.split('::').last
275
+ "<#{class_name} country_code: #{@country_code}, party_id: #{@party_id}, id: #{@id},"\
276
+ " start_date_time: #{@start_date_time}, end_date_time: #{@end_date_time}, kwh: #{@kwh},"\
277
+ " cdr_token: #{@cdr_token}, auth_method: #{@auth_method}, authorization_reference:"\
278
+ " #{@authorization_reference}, add_on_fee: #{@add_on_fee}, location_id: #{@location_id},"\
279
+ " evse_uid: #{@evse_uid}, connector_id: #{@connector_id}, currency: #{@currency},"\
280
+ " charging_periods: #{@charging_periods}, total_cost: #{@total_cost}, status: #{@status},"\
281
+ " last_updated: #{@last_updated}>"
282
+ end
283
+
284
+ # Provides a debugging-friendly string with detailed object information.
285
+ def inspect
286
+ class_name = self.class.name.split('::').last
287
+ "<#{class_name} country_code: #{@country_code.inspect}, party_id: #{@party_id.inspect}, id:"\
288
+ " #{@id.inspect}, start_date_time: #{@start_date_time.inspect}, end_date_time:"\
289
+ " #{@end_date_time.inspect}, kwh: #{@kwh.inspect}, cdr_token: #{@cdr_token.inspect},"\
290
+ " auth_method: #{@auth_method.inspect}, authorization_reference:"\
291
+ " #{@authorization_reference.inspect}, add_on_fee: #{@add_on_fee.inspect}, location_id:"\
292
+ " #{@location_id.inspect}, evse_uid: #{@evse_uid.inspect}, connector_id:"\
293
+ " #{@connector_id.inspect}, currency: #{@currency.inspect}, charging_periods:"\
294
+ " #{@charging_periods.inspect}, total_cost: #{@total_cost.inspect}, status:"\
295
+ " #{@status.inspect}, last_updated: #{@last_updated.inspect}>"
296
+ end
297
+ end
298
+ end
@@ -0,0 +1,60 @@
1
+ # e_mobility_vmspocpiap_is
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module EMobilityVmspocpiapIs
7
+ # Defines the state of a session.
8
+ class SessionStatusEnum
9
+ SESSION_STATUS_ENUM = [
10
+ # TODO: Write general description for ACTIVE
11
+ ACTIVE = 'ACTIVE'.freeze,
12
+
13
+ # TODO: Write general description for COMPLETED
14
+ COMPLETED = 'COMPLETED'.freeze,
15
+
16
+ # TODO: Write general description for INVALID
17
+ INVALID = 'INVALID'.freeze,
18
+
19
+ # TODO: Write general description for PENDING
20
+ PENDING = 'PENDING'.freeze,
21
+
22
+ # TODO: Write general description for RESERVATION
23
+ RESERVATION = 'RESERVATION'.freeze,
24
+
25
+ # TODO: Write general description for CONGESTED
26
+ CONGESTED = 'CONGESTED'.freeze,
27
+
28
+ # TODO: Write general description for IDLING
29
+ IDLING = 'IDLING'.freeze,
30
+
31
+ # TODO: Write general description for UNKNOWN
32
+ UNKNOWN = 'UNKNOWN'.freeze
33
+ ].freeze
34
+
35
+ def self.validate(value)
36
+ return false if value.nil?
37
+
38
+ SESSION_STATUS_ENUM.include?(value)
39
+ end
40
+
41
+ def self.from_value(value, default_value = ACTIVE)
42
+ return default_value if value.nil?
43
+
44
+ str = value.to_s.strip
45
+
46
+ case str.downcase
47
+ when 'active' then ACTIVE
48
+ when 'completed' then COMPLETED
49
+ when 'invalid' then INVALID
50
+ when 'pending' then PENDING
51
+ when 'reservation' then RESERVATION
52
+ when 'congested' then CONGESTED
53
+ when 'idling' then IDLING
54
+ when 'unknown' then UNKNOWN
55
+ else
56
+ default_value
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,116 @@
1
+ # e_mobility_vmspocpiap_is
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module EMobilityVmspocpiapIs
7
+ # This class contains all the information of the signed data. Which encoding
8
+ # method is used, if needed, the public key and a list of signed values.
9
+ class SignedData < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # The name of the encoding used in the SignedData field. This is the name
14
+ # given to the encoding by a company or group of companies.
15
+ # @return [String]
16
+ attr_accessor :encoding_method
17
+
18
+ # Version of the EncodingMethod (when applicable).
19
+ # @return [Integer]
20
+ attr_accessor :encoding_method_version
21
+
22
+ # Public key used to sign the data, base64 encoded.
23
+ # @return [String]
24
+ attr_accessor :public_key
25
+
26
+ # One or more signed values.
27
+ # @return [Array[SignedValue]]
28
+ attr_accessor :signed_values
29
+
30
+ # URL that can be shown to an EV driver. This URL gives the EV driver the
31
+ # possibility to check the signed data from a charging session.
32
+ # @return [String]
33
+ attr_accessor :url
34
+
35
+ # A mapping from model property names to API property names.
36
+ def self.names
37
+ @_hash = {} if @_hash.nil?
38
+ @_hash['encoding_method'] = 'encoding_method'
39
+ @_hash['encoding_method_version'] = 'encoding_method_version'
40
+ @_hash['public_key'] = 'public_key'
41
+ @_hash['signed_values'] = 'signed_values'
42
+ @_hash['url'] = 'url'
43
+ @_hash
44
+ end
45
+
46
+ # An array for optional fields
47
+ def self.optionals
48
+ %w[
49
+ encoding_method_version
50
+ public_key
51
+ url
52
+ ]
53
+ end
54
+
55
+ # An array for nullable fields
56
+ def self.nullables
57
+ []
58
+ end
59
+
60
+ def initialize(encoding_method = nil, signed_values = nil,
61
+ encoding_method_version = SKIP, public_key = SKIP,
62
+ url = SKIP)
63
+ @encoding_method = encoding_method
64
+ @encoding_method_version = encoding_method_version unless encoding_method_version == SKIP
65
+ @public_key = public_key unless public_key == SKIP
66
+ @signed_values = signed_values
67
+ @url = url unless url == 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
+ encoding_method =
76
+ hash.key?('encoding_method') ? hash['encoding_method'] : nil
77
+ # Parameter is an array, so we need to iterate through it
78
+ signed_values = nil
79
+ unless hash['signed_values'].nil?
80
+ signed_values = []
81
+ hash['signed_values'].each do |structure|
82
+ signed_values << (SignedValue.from_hash(structure) if structure)
83
+ end
84
+ end
85
+
86
+ signed_values = nil unless hash.key?('signed_values')
87
+ encoding_method_version =
88
+ hash.key?('encoding_method_version') ? hash['encoding_method_version'] : SKIP
89
+ public_key = hash.key?('public_key') ? hash['public_key'] : SKIP
90
+ url = hash.key?('url') ? hash['url'] : SKIP
91
+
92
+ # Create object from extracted values.
93
+ SignedData.new(encoding_method,
94
+ signed_values,
95
+ encoding_method_version,
96
+ public_key,
97
+ url)
98
+ end
99
+
100
+ # Provides a human-readable string representation of the object.
101
+ def to_s
102
+ class_name = self.class.name.split('::').last
103
+ "<#{class_name} encoding_method: #{@encoding_method}, encoding_method_version:"\
104
+ " #{@encoding_method_version}, public_key: #{@public_key}, signed_values: #{@signed_values},"\
105
+ " url: #{@url}>"
106
+ end
107
+
108
+ # Provides a debugging-friendly string with detailed object information.
109
+ def inspect
110
+ class_name = self.class.name.split('::').last
111
+ "<#{class_name} encoding_method: #{@encoding_method.inspect}, encoding_method_version:"\
112
+ " #{@encoding_method_version.inspect}, public_key: #{@public_key.inspect}, signed_values:"\
113
+ " #{@signed_values.inspect}, url: #{@url.inspect}>"
114
+ end
115
+ end
116
+ end
@@ -0,0 +1,85 @@
1
+ # e_mobility_vmspocpiap_is
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module EMobilityVmspocpiapIs
7
+ # This class contains the signed and the plain/unsigned data. By decoding the
8
+ # data, the receiver can check if the content has not been altered.
9
+ class SignedValue < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Nature of the value, in other words, the event this value belongs to.
14
+ # Possible values: Start (value at the start of the Session), End (signed
15
+ # value at
16
+ # the end of the Session), Intermediate (signed values taken during the
17
+ # Session).
18
+ # @return [String]
19
+ attr_accessor :nature
20
+
21
+ # The un-encoded string of data. The format of the content depends on the
22
+ # EncodingMethod field.
23
+ # @return [String]
24
+ attr_accessor :plain_data
25
+
26
+ # Blob of signed data, base64 encoded. The format of the content depends on
27
+ # the EncodingMethod field.
28
+ # @return [String]
29
+ attr_accessor :signed_data
30
+
31
+ # A mapping from model property names to API property names.
32
+ def self.names
33
+ @_hash = {} if @_hash.nil?
34
+ @_hash['nature'] = 'nature'
35
+ @_hash['plain_data'] = 'plain_data'
36
+ @_hash['signed_data'] = 'signed_data'
37
+ @_hash
38
+ end
39
+
40
+ # An array for optional fields
41
+ def self.optionals
42
+ []
43
+ end
44
+
45
+ # An array for nullable fields
46
+ def self.nullables
47
+ []
48
+ end
49
+
50
+ def initialize(nature = nil, plain_data = nil, signed_data = nil)
51
+ @nature = nature
52
+ @plain_data = plain_data
53
+ @signed_data = signed_data
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
+ nature = hash.key?('nature') ? hash['nature'] : nil
62
+ plain_data = hash.key?('plain_data') ? hash['plain_data'] : nil
63
+ signed_data = hash.key?('signed_data') ? hash['signed_data'] : nil
64
+
65
+ # Create object from extracted values.
66
+ SignedValue.new(nature,
67
+ plain_data,
68
+ signed_data)
69
+ end
70
+
71
+ # Provides a human-readable string representation of the object.
72
+ def to_s
73
+ class_name = self.class.name.split('::').last
74
+ "<#{class_name} nature: #{@nature}, plain_data: #{@plain_data}, signed_data:"\
75
+ " #{@signed_data}>"
76
+ end
77
+
78
+ # Provides a debugging-friendly string with detailed object information.
79
+ def inspect
80
+ class_name = self.class.name.split('::').last
81
+ "<#{class_name} nature: #{@nature.inspect}, plain_data: #{@plain_data.inspect},"\
82
+ " signed_data: #{@signed_data.inspect}>"
83
+ end
84
+ end
85
+ end