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,457 @@
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
+ # Response data object or list of objects.
9
+ class CDR1 < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # ISO-3166 alpha-2 country code of the CPO that 'owns' this CDR.
14
+ # @return [String]
15
+ attr_accessor :country_code
16
+
17
+ # ID of the CPO that 'owns' this CDR (following the ISO-15118 standard).
18
+ # @return [String]
19
+ attr_accessor :party_id
20
+
21
+ # Uniquely identifies the CDR.
22
+ # @return [String]
23
+ attr_accessor :id
24
+
25
+ # Start timestamp of the charging session, or in-case of a reservation
26
+ # (before the start of a session) the start of the reservation.
27
+ # @return [DateTime]
28
+ attr_accessor :start_date_time
29
+
30
+ # The timestamp when the session was completed/finished, charging might have
31
+ # finished before the session ends, for example EV is full, but parking cost
32
+ # also has to be paid.
33
+ # @return [DateTime]
34
+ attr_accessor :end_date_time
35
+
36
+ # Unique ID of the Session for which this CDR is sent. Is only allowed to be
37
+ # omitted when the CPO has not implemented the Sessions module or this CDR
38
+ # is the result of a reservation that never became a charging session.
39
+ # @return [String]
40
+ attr_accessor :session_id
41
+
42
+ # Unique ID of the Booking for which this CDR can also be sent. Is only
43
+ # allowed to be omitted when the Session was reserved.
44
+ # @return [String]
45
+ attr_accessor :booking_id
46
+
47
+ # Token information used to start a charging session, containing all
48
+ # relevant information to identify the unique token.
49
+ # @return [CdrToken]
50
+ attr_accessor :cdr_token
51
+
52
+ # Method used for authentication.
53
+ # @return [AuthMethodEnum]
54
+ attr_accessor :auth_method
55
+
56
+ # Reference to the authorization given by the eMSP. When the eMSP provided
57
+ # an
58
+ # authorization_reference in either real-time authorization, StartSession or
59
+ # ReserveNow,
60
+ # this field SHALL contain the same value. When different
61
+ # authorization_reference values
62
+ # have been given by the eMSP that are relevant to this Session, the last
63
+ # given value
64
+ # SHALL be used here.
65
+ # @return [String]
66
+ attr_accessor :authorization_reference
67
+
68
+ # The CdrLocation class contains only the relevant information from the
69
+ # Location object
70
+ # that is needed in a CDR.
71
+ # @return [CdrLocation]
72
+ attr_accessor :cdr_location
73
+
74
+ # Identification of the Meter inside the Charge Point.
75
+ # @return [String]
76
+ attr_accessor :meter_id
77
+
78
+ # Currency of the CDR in ISO 4217 Code.
79
+ # @return [String]
80
+ attr_accessor :currency
81
+
82
+ # List of relevant Tariffs, see the Tariffs module. When relevant, a "Free
83
+ # of Charge"
84
+ # tariff should also be in this list, and point to a defined "Free of
85
+ # Charge" Tariff.
86
+ # @return [Array[Tariff]]
87
+ attr_accessor :tariffs
88
+
89
+ # List of Charging Periods that make up this charging session.
90
+ # @return [Array[ChargingPeriod]]
91
+ attr_accessor :charging_periods
92
+
93
+ # This class contains all the information of the signed data. Which encoding
94
+ # method is used,
95
+ # if needed, the public key and a list of signed values.
96
+ # @return [SignedData]
97
+ attr_accessor :signed_data
98
+
99
+ # Price information with tax details.
100
+ # @return [Price]
101
+ attr_accessor :total_cost
102
+
103
+ # Price information with tax details.
104
+ # @return [Price]
105
+ attr_accessor :total_fixed_cost
106
+
107
+ # Total energy charged, in kWh.
108
+ # @return [Float]
109
+ attr_accessor :total_energy
110
+
111
+ # Price information with tax details.
112
+ # @return [Price]
113
+ attr_accessor :total_energy_cost
114
+
115
+ # Total duration of the charging session (including the duration of charging
116
+ # and not charging), in hours.
117
+ # @return [Float]
118
+ attr_accessor :total_time
119
+
120
+ # Price information with tax details.
121
+ # @return [Price]
122
+ attr_accessor :total_time_cost
123
+
124
+ # Total duration of the charging session where the EV was not charging (no
125
+ # energy was transferred between EVSE and EV), in hours.
126
+ # @return [Float]
127
+ attr_accessor :total_parking_time
128
+
129
+ # Price information with tax details.
130
+ # @return [Price]
131
+ attr_accessor :total_parking_cost
132
+
133
+ # Price information with tax details.
134
+ # @return [Price]
135
+ attr_accessor :total_reservation_cost
136
+
137
+ # Optional remark, can be used to provide additional human readable
138
+ # information to the CDR, for example reason why a transaction was stopped.
139
+ # @return [String]
140
+ attr_accessor :remark
141
+
142
+ # Optional remark, can be used to provide additional human readable
143
+ # information to the CDR, for example reason why a transaction was stopped.
144
+ # @return [Array[AddOnFee]]
145
+ attr_accessor :add_on_fee
146
+
147
+ # This field can be used to reference an invoice, that will later be sent
148
+ # for this CDR. Making it easier to link a CDR to a given invoice. Maybe
149
+ # even group CDRs that will be on the same invoice.
150
+ # @return [String]
151
+ attr_accessor :invoice_reference_id
152
+
153
+ # When set to true, this is a Credit CDR, and the field credit_reference_id
154
+ # needs to be set as well.
155
+ # @return [TrueClass | FalseClass]
156
+ attr_accessor :credit
157
+
158
+ # Is required to be set for a Credit CDR. This SHALL contain the id of the
159
+ # CDR for which this is a Credit CDR.
160
+ # @return [String]
161
+ attr_accessor :credit_reference_id
162
+
163
+ # When set to true, this CDR is for a charging session using the home
164
+ # charger of the EV Driver for which the energy cost needs to be financially
165
+ # compensated to the EV Driver.
166
+ # @return [TrueClass | FalseClass]
167
+ attr_accessor :home_charging_compensation
168
+
169
+ # Timestamp when this CDR was last updated (or created).
170
+ # @return [DateTime]
171
+ attr_accessor :last_updated
172
+
173
+ # A mapping from model property names to API property names.
174
+ def self.names
175
+ @_hash = {} if @_hash.nil?
176
+ @_hash['country_code'] = 'country_code'
177
+ @_hash['party_id'] = 'party_id'
178
+ @_hash['id'] = 'id'
179
+ @_hash['start_date_time'] = 'start_date_time'
180
+ @_hash['end_date_time'] = 'end_date_time'
181
+ @_hash['session_id'] = 'session_id'
182
+ @_hash['booking_id'] = 'booking_id'
183
+ @_hash['cdr_token'] = 'cdr_token'
184
+ @_hash['auth_method'] = 'auth_method'
185
+ @_hash['authorization_reference'] = 'authorization_reference'
186
+ @_hash['cdr_location'] = 'cdr_location'
187
+ @_hash['meter_id'] = 'meter_id'
188
+ @_hash['currency'] = 'currency'
189
+ @_hash['tariffs'] = 'tariffs'
190
+ @_hash['charging_periods'] = 'charging_periods'
191
+ @_hash['signed_data'] = 'signed_data'
192
+ @_hash['total_cost'] = 'total_cost'
193
+ @_hash['total_fixed_cost'] = 'total_fixed_cost'
194
+ @_hash['total_energy'] = 'total_energy'
195
+ @_hash['total_energy_cost'] = 'total_energy_cost'
196
+ @_hash['total_time'] = 'total_time'
197
+ @_hash['total_time_cost'] = 'total_time_cost'
198
+ @_hash['total_parking_time'] = 'total_parking_time'
199
+ @_hash['total_parking_cost'] = 'total_parking_cost'
200
+ @_hash['total_reservation_cost'] = 'total_reservation_cost'
201
+ @_hash['remark'] = 'remark'
202
+ @_hash['add_on_fee'] = 'add_on_fee'
203
+ @_hash['invoice_reference_id'] = 'invoice_reference_id'
204
+ @_hash['credit'] = 'credit'
205
+ @_hash['credit_reference_id'] = 'credit_reference_id'
206
+ @_hash['home_charging_compensation'] = 'home_charging_compensation'
207
+ @_hash['last_updated'] = 'last_updated'
208
+ @_hash
209
+ end
210
+
211
+ # An array for optional fields
212
+ def self.optionals
213
+ %w[
214
+ session_id
215
+ booking_id
216
+ authorization_reference
217
+ meter_id
218
+ tariffs
219
+ signed_data
220
+ total_fixed_cost
221
+ total_energy_cost
222
+ total_time_cost
223
+ total_parking_time
224
+ total_parking_cost
225
+ total_reservation_cost
226
+ remark
227
+ add_on_fee
228
+ invoice_reference_id
229
+ credit
230
+ credit_reference_id
231
+ home_charging_compensation
232
+ ]
233
+ end
234
+
235
+ # An array for nullable fields
236
+ def self.nullables
237
+ []
238
+ end
239
+
240
+ def initialize(country_code = nil, party_id = nil, id = nil,
241
+ start_date_time = nil, end_date_time = nil, cdr_token = nil,
242
+ auth_method = nil, cdr_location = nil, currency = nil,
243
+ charging_periods = nil, total_cost = nil, total_energy = nil,
244
+ total_time = nil, last_updated = nil, session_id = SKIP,
245
+ booking_id = SKIP, authorization_reference = SKIP,
246
+ meter_id = SKIP, tariffs = SKIP, signed_data = SKIP,
247
+ total_fixed_cost = SKIP, total_energy_cost = SKIP,
248
+ total_time_cost = SKIP, total_parking_time = SKIP,
249
+ total_parking_cost = SKIP, total_reservation_cost = SKIP,
250
+ remark = SKIP, add_on_fee = SKIP,
251
+ invoice_reference_id = SKIP, credit = SKIP,
252
+ credit_reference_id = SKIP,
253
+ home_charging_compensation = SKIP)
254
+ @country_code = country_code
255
+ @party_id = party_id
256
+ @id = id
257
+ @start_date_time = start_date_time
258
+ @end_date_time = end_date_time
259
+ @session_id = session_id unless session_id == SKIP
260
+ @booking_id = booking_id unless booking_id == SKIP
261
+ @cdr_token = cdr_token
262
+ @auth_method = auth_method
263
+ @authorization_reference = authorization_reference unless authorization_reference == SKIP
264
+ @cdr_location = cdr_location
265
+ @meter_id = meter_id unless meter_id == SKIP
266
+ @currency = currency
267
+ @tariffs = tariffs unless tariffs == SKIP
268
+ @charging_periods = charging_periods
269
+ @signed_data = signed_data unless signed_data == SKIP
270
+ @total_cost = total_cost
271
+ @total_fixed_cost = total_fixed_cost unless total_fixed_cost == SKIP
272
+ @total_energy = total_energy
273
+ @total_energy_cost = total_energy_cost unless total_energy_cost == SKIP
274
+ @total_time = total_time
275
+ @total_time_cost = total_time_cost unless total_time_cost == SKIP
276
+ @total_parking_time = total_parking_time unless total_parking_time == SKIP
277
+ @total_parking_cost = total_parking_cost unless total_parking_cost == SKIP
278
+ @total_reservation_cost = total_reservation_cost unless total_reservation_cost == SKIP
279
+ @remark = remark unless remark == SKIP
280
+ @add_on_fee = add_on_fee unless add_on_fee == SKIP
281
+ @invoice_reference_id = invoice_reference_id unless invoice_reference_id == SKIP
282
+ @credit = credit unless credit == SKIP
283
+ @credit_reference_id = credit_reference_id unless credit_reference_id == SKIP
284
+ unless home_charging_compensation == SKIP
285
+ @home_charging_compensation =
286
+ home_charging_compensation
287
+ end
288
+ @last_updated = last_updated
289
+ end
290
+
291
+ # Creates an instance of the object from a hash.
292
+ def self.from_hash(hash)
293
+ return nil unless hash
294
+
295
+ # Extract variables from the hash.
296
+ country_code = hash.key?('country_code') ? hash['country_code'] : nil
297
+ party_id = hash.key?('party_id') ? hash['party_id'] : nil
298
+ id = hash.key?('id') ? hash['id'] : nil
299
+ start_date_time = if hash.key?('start_date_time')
300
+ (DateTimeHelper.from_rfc3339(hash['start_date_time']) if hash['start_date_time'])
301
+ end
302
+ end_date_time = if hash.key?('end_date_time')
303
+ (DateTimeHelper.from_rfc3339(hash['end_date_time']) if hash['end_date_time'])
304
+ end
305
+ cdr_token = CdrToken.from_hash(hash['cdr_token']) if hash['cdr_token']
306
+ auth_method = hash.key?('auth_method') ? hash['auth_method'] : nil
307
+ cdr_location = CdrLocation.from_hash(hash['cdr_location']) if hash['cdr_location']
308
+ currency = hash.key?('currency') ? hash['currency'] : nil
309
+ # Parameter is an array, so we need to iterate through it
310
+ charging_periods = nil
311
+ unless hash['charging_periods'].nil?
312
+ charging_periods = []
313
+ hash['charging_periods'].each do |structure|
314
+ charging_periods << (ChargingPeriod.from_hash(structure) if structure)
315
+ end
316
+ end
317
+
318
+ charging_periods = nil unless hash.key?('charging_periods')
319
+ total_cost = Price.from_hash(hash['total_cost']) if hash['total_cost']
320
+ total_energy = hash.key?('total_energy') ? hash['total_energy'] : nil
321
+ total_time = hash.key?('total_time') ? hash['total_time'] : nil
322
+ last_updated = if hash.key?('last_updated')
323
+ (DateTimeHelper.from_rfc3339(hash['last_updated']) if hash['last_updated'])
324
+ end
325
+ session_id = hash.key?('session_id') ? hash['session_id'] : SKIP
326
+ booking_id = hash.key?('booking_id') ? hash['booking_id'] : SKIP
327
+ authorization_reference =
328
+ hash.key?('authorization_reference') ? hash['authorization_reference'] : SKIP
329
+ meter_id = hash.key?('meter_id') ? hash['meter_id'] : SKIP
330
+ # Parameter is an array, so we need to iterate through it
331
+ tariffs = nil
332
+ unless hash['tariffs'].nil?
333
+ tariffs = []
334
+ hash['tariffs'].each do |structure|
335
+ tariffs << (Tariff.from_hash(structure) if structure)
336
+ end
337
+ end
338
+
339
+ tariffs = SKIP unless hash.key?('tariffs')
340
+ signed_data = SignedData.from_hash(hash['signed_data']) if hash['signed_data']
341
+ total_fixed_cost = Price.from_hash(hash['total_fixed_cost']) if hash['total_fixed_cost']
342
+ total_energy_cost = Price.from_hash(hash['total_energy_cost']) if hash['total_energy_cost']
343
+ total_time_cost = Price.from_hash(hash['total_time_cost']) if hash['total_time_cost']
344
+ total_parking_time =
345
+ hash.key?('total_parking_time') ? hash['total_parking_time'] : SKIP
346
+ total_parking_cost = Price.from_hash(hash['total_parking_cost']) if
347
+ hash['total_parking_cost']
348
+ total_reservation_cost = Price.from_hash(hash['total_reservation_cost']) if
349
+ hash['total_reservation_cost']
350
+ remark = hash.key?('remark') ? hash['remark'] : SKIP
351
+ # Parameter is an array, so we need to iterate through it
352
+ add_on_fee = nil
353
+ unless hash['add_on_fee'].nil?
354
+ add_on_fee = []
355
+ hash['add_on_fee'].each do |structure|
356
+ add_on_fee << (AddOnFee.from_hash(structure) if structure)
357
+ end
358
+ end
359
+
360
+ add_on_fee = SKIP unless hash.key?('add_on_fee')
361
+ invoice_reference_id =
362
+ hash.key?('invoice_reference_id') ? hash['invoice_reference_id'] : SKIP
363
+ credit = hash.key?('credit') ? hash['credit'] : SKIP
364
+ credit_reference_id =
365
+ hash.key?('credit_reference_id') ? hash['credit_reference_id'] : SKIP
366
+ home_charging_compensation =
367
+ hash.key?('home_charging_compensation') ? hash['home_charging_compensation'] : SKIP
368
+
369
+ # Create object from extracted values.
370
+ CDR1.new(country_code,
371
+ party_id,
372
+ id,
373
+ start_date_time,
374
+ end_date_time,
375
+ cdr_token,
376
+ auth_method,
377
+ cdr_location,
378
+ currency,
379
+ charging_periods,
380
+ total_cost,
381
+ total_energy,
382
+ total_time,
383
+ last_updated,
384
+ session_id,
385
+ booking_id,
386
+ authorization_reference,
387
+ meter_id,
388
+ tariffs,
389
+ signed_data,
390
+ total_fixed_cost,
391
+ total_energy_cost,
392
+ total_time_cost,
393
+ total_parking_time,
394
+ total_parking_cost,
395
+ total_reservation_cost,
396
+ remark,
397
+ add_on_fee,
398
+ invoice_reference_id,
399
+ credit,
400
+ credit_reference_id,
401
+ home_charging_compensation)
402
+ end
403
+
404
+ def to_custom_start_date_time
405
+ DateTimeHelper.to_rfc3339(start_date_time)
406
+ end
407
+
408
+ def to_custom_end_date_time
409
+ DateTimeHelper.to_rfc3339(end_date_time)
410
+ end
411
+
412
+ def to_custom_last_updated
413
+ DateTimeHelper.to_rfc3339(last_updated)
414
+ end
415
+
416
+ # Provides a human-readable string representation of the object.
417
+ def to_s
418
+ class_name = self.class.name.split('::').last
419
+ "<#{class_name} country_code: #{@country_code}, party_id: #{@party_id}, id: #{@id},"\
420
+ " start_date_time: #{@start_date_time}, end_date_time: #{@end_date_time}, session_id:"\
421
+ " #{@session_id}, booking_id: #{@booking_id}, cdr_token: #{@cdr_token}, auth_method:"\
422
+ " #{@auth_method}, authorization_reference: #{@authorization_reference}, cdr_location:"\
423
+ " #{@cdr_location}, meter_id: #{@meter_id}, currency: #{@currency}, tariffs: #{@tariffs},"\
424
+ " charging_periods: #{@charging_periods}, signed_data: #{@signed_data}, total_cost:"\
425
+ " #{@total_cost}, total_fixed_cost: #{@total_fixed_cost}, total_energy: #{@total_energy},"\
426
+ " total_energy_cost: #{@total_energy_cost}, total_time: #{@total_time}, total_time_cost:"\
427
+ " #{@total_time_cost}, total_parking_time: #{@total_parking_time}, total_parking_cost:"\
428
+ " #{@total_parking_cost}, total_reservation_cost: #{@total_reservation_cost}, remark:"\
429
+ " #{@remark}, add_on_fee: #{@add_on_fee}, invoice_reference_id: #{@invoice_reference_id},"\
430
+ " credit: #{@credit}, credit_reference_id: #{@credit_reference_id},"\
431
+ " home_charging_compensation: #{@home_charging_compensation}, last_updated:"\
432
+ " #{@last_updated}>"
433
+ end
434
+
435
+ # Provides a debugging-friendly string with detailed object information.
436
+ def inspect
437
+ class_name = self.class.name.split('::').last
438
+ "<#{class_name} country_code: #{@country_code.inspect}, party_id: #{@party_id.inspect}, id:"\
439
+ " #{@id.inspect}, start_date_time: #{@start_date_time.inspect}, end_date_time:"\
440
+ " #{@end_date_time.inspect}, session_id: #{@session_id.inspect}, booking_id:"\
441
+ " #{@booking_id.inspect}, cdr_token: #{@cdr_token.inspect}, auth_method:"\
442
+ " #{@auth_method.inspect}, authorization_reference: #{@authorization_reference.inspect},"\
443
+ " cdr_location: #{@cdr_location.inspect}, meter_id: #{@meter_id.inspect}, currency:"\
444
+ " #{@currency.inspect}, tariffs: #{@tariffs.inspect}, charging_periods:"\
445
+ " #{@charging_periods.inspect}, signed_data: #{@signed_data.inspect}, total_cost:"\
446
+ " #{@total_cost.inspect}, total_fixed_cost: #{@total_fixed_cost.inspect}, total_energy:"\
447
+ " #{@total_energy.inspect}, total_energy_cost: #{@total_energy_cost.inspect}, total_time:"\
448
+ " #{@total_time.inspect}, total_time_cost: #{@total_time_cost.inspect}, total_parking_time:"\
449
+ " #{@total_parking_time.inspect}, total_parking_cost: #{@total_parking_cost.inspect},"\
450
+ " total_reservation_cost: #{@total_reservation_cost.inspect}, remark: #{@remark.inspect},"\
451
+ " add_on_fee: #{@add_on_fee.inspect}, invoice_reference_id:"\
452
+ " #{@invoice_reference_id.inspect}, credit: #{@credit.inspect}, credit_reference_id:"\
453
+ " #{@credit_reference_id.inspect}, home_charging_compensation:"\
454
+ " #{@home_charging_compensation.inspect}, last_updated: #{@last_updated.inspect}>"
455
+ end
456
+ end
457
+ end
@@ -0,0 +1,71 @@
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
+ # A dimension value for a charging period.
8
+ class CdrDimension < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Defines the type of a CDR dimension. Some of these values are not useful
13
+ # for CDRs,
14
+ # and SHALL therefore only be used in Sessions (marked as Session Only).
15
+ # @return [CdrDimensionTypeEnum]
16
+ attr_accessor :type
17
+
18
+ # Volume of the dimension consumed, measured according to the dimension
19
+ # type.
20
+ # @return [Float]
21
+ attr_accessor :volume
22
+
23
+ # A mapping from model property names to API property names.
24
+ def self.names
25
+ @_hash = {} if @_hash.nil?
26
+ @_hash['type'] = 'type'
27
+ @_hash['volume'] = 'volume'
28
+ @_hash
29
+ end
30
+
31
+ # An array for optional fields
32
+ def self.optionals
33
+ []
34
+ end
35
+
36
+ # An array for nullable fields
37
+ def self.nullables
38
+ []
39
+ end
40
+
41
+ def initialize(type = nil, volume = nil)
42
+ @type = type
43
+ @volume = volume
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
+ type = hash.key?('type') ? hash['type'] : nil
52
+ volume = hash.key?('volume') ? hash['volume'] : nil
53
+
54
+ # Create object from extracted values.
55
+ CdrDimension.new(type,
56
+ volume)
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} type: #{@type}, volume: #{@volume}>"
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} type: #{@type.inspect}, volume: #{@volume.inspect}>"
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,97 @@
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 type of a CDR dimension. Some of these values are not useful for
8
+ # CDRs, and SHALL therefore only be used in Sessions (marked as Session Only).
9
+ class CdrDimensionTypeEnum
10
+ CDR_DIMENSION_TYPE_ENUM = [
11
+ # TODO: Write general description for CURRENT
12
+ CURRENT = 'CURRENT'.freeze,
13
+
14
+ # TODO: Write general description for ENERGY
15
+ ENERGY = 'ENERGY'.freeze,
16
+
17
+ # TODO: Write general description for ENERGY_EXPORT
18
+ ENERGY_EXPORT = 'ENERGY_EXPORT'.freeze,
19
+
20
+ # TODO: Write general description for ENERGY_IMPORT
21
+ ENERGY_IMPORT = 'ENERGY_IMPORT'.freeze,
22
+
23
+ # TODO: Write general description for MAX_CURRENT
24
+ MAX_CURRENT = 'MAX_CURRENT'.freeze,
25
+
26
+ # TODO: Write general description for MIN_CURRENT
27
+ MIN_CURRENT = 'MIN_CURRENT'.freeze,
28
+
29
+ # TODO: Write general description for MAX_POWER
30
+ MAX_POWER = 'MAX_POWER'.freeze,
31
+
32
+ # TODO: Write general description for MIN_POWER
33
+ MIN_POWER = 'MIN_POWER'.freeze,
34
+
35
+ # TODO: Write general description for PARKING_TIME
36
+ PARKING_TIME = 'PARKING_TIME'.freeze,
37
+
38
+ # TODO: Write general description for POWER
39
+ POWER = 'POWER'.freeze,
40
+
41
+ # TODO: Write general description for RESERVATION_TIME
42
+ RESERVATION_TIME = 'RESERVATION_TIME'.freeze,
43
+
44
+ # TODO: Write general description for RESERVATION_EXPIRES
45
+ RESERVATION_EXPIRES = 'RESERVATION_EXPIRES'.freeze,
46
+
47
+ # TODO: Write general description for RESERVATION_OVERTIME
48
+ RESERVATION_OVERTIME = 'RESERVATION_OVERTIME'.freeze,
49
+
50
+ # TODO: Write general description for STATE_OF_CHARGE
51
+ STATE_OF_CHARGE = 'STATE_OF_CHARGE'.freeze,
52
+
53
+ # TODO: Write general description for TIME
54
+ TIME = 'TIME'.freeze,
55
+
56
+ # TODO: Write general description for MIN
57
+ MIN = 'MIN'.freeze,
58
+
59
+ # TODO: Write general description for MAX
60
+ MAX = 'MAX'.freeze
61
+ ].freeze
62
+
63
+ def self.validate(value)
64
+ return false if value.nil?
65
+
66
+ CDR_DIMENSION_TYPE_ENUM.include?(value)
67
+ end
68
+
69
+ def self.from_value(value, default_value = CURRENT)
70
+ return default_value if value.nil?
71
+
72
+ str = value.to_s.strip
73
+
74
+ case str.downcase
75
+ when 'current' then CURRENT
76
+ when 'energy' then ENERGY
77
+ when 'energy_export' then ENERGY_EXPORT
78
+ when 'energy_import' then ENERGY_IMPORT
79
+ when 'max_current' then MAX_CURRENT
80
+ when 'min_current' then MIN_CURRENT
81
+ when 'max_power' then MAX_POWER
82
+ when 'min_power' then MIN_POWER
83
+ when 'parking_time' then PARKING_TIME
84
+ when 'power' then POWER
85
+ when 'reservation_time' then RESERVATION_TIME
86
+ when 'reservation_expires' then RESERVATION_EXPIRES
87
+ when 'reservation_overtime' then RESERVATION_OVERTIME
88
+ when 'state_of_charge' then STATE_OF_CHARGE
89
+ when 'time' then TIME
90
+ when 'min' then MIN
91
+ when 'max' then MAX
92
+ else
93
+ default_value
94
+ end
95
+ end
96
+ end
97
+ end