tesla-api-sdk 1.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 (112) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +160 -0
  4. data/bin/console +15 -0
  5. data/lib/tesla_fleet_management_api/api_helper.rb +10 -0
  6. data/lib/tesla_fleet_management_api/client.rb +110 -0
  7. data/lib/tesla_fleet_management_api/configuration.rb +181 -0
  8. data/lib/tesla_fleet_management_api/controllers/base_controller.rb +65 -0
  9. data/lib/tesla_fleet_management_api/controllers/charging_controller.rb +62 -0
  10. data/lib/tesla_fleet_management_api/controllers/energy_controller.rb +315 -0
  11. data/lib/tesla_fleet_management_api/controllers/oauth_authorization_controller.rb +87 -0
  12. data/lib/tesla_fleet_management_api/controllers/partner_controller.rb +82 -0
  13. data/lib/tesla_fleet_management_api/controllers/user_controller.rb +73 -0
  14. data/lib/tesla_fleet_management_api/controllers/vehicles_controller.rb +431 -0
  15. data/lib/tesla_fleet_management_api/exceptions/api_exception.rb +21 -0
  16. data/lib/tesla_fleet_management_api/exceptions/oauth_provider_exception.rb +64 -0
  17. data/lib/tesla_fleet_management_api/http/api_response.rb +19 -0
  18. data/lib/tesla_fleet_management_api/http/auth/bearer_auth.rb +53 -0
  19. data/lib/tesla_fleet_management_api/http/auth/oauth_2.rb +154 -0
  20. data/lib/tesla_fleet_management_api/http/http_call_back.rb +10 -0
  21. data/lib/tesla_fleet_management_api/http/http_method_enum.rb +10 -0
  22. data/lib/tesla_fleet_management_api/http/http_request.rb +10 -0
  23. data/lib/tesla_fleet_management_api/http/http_response.rb +10 -0
  24. data/lib/tesla_fleet_management_api/http/proxy_settings.rb +22 -0
  25. data/lib/tesla_fleet_management_api/logging/configuration/api_logging_configuration.rb +186 -0
  26. data/lib/tesla_fleet_management_api/logging/sdk_logger.rb +17 -0
  27. data/lib/tesla_fleet_management_api/models/api1_dx_vehicles_options_response.rb +76 -0
  28. data/lib/tesla_fleet_management_api/models/api1_dx_warranty_details_response.rb +76 -0
  29. data/lib/tesla_fleet_management_api/models/api1_vehicles_mobile_enabled_response.rb +75 -0
  30. data/lib/tesla_fleet_management_api/models/api1_vehicles_nearby_charging_sites_response.rb +75 -0
  31. data/lib/tesla_fleet_management_api/models/api1_vehicles_response.rb +104 -0
  32. data/lib/tesla_fleet_management_api/models/api1_vehicles_response_get_vehicle.rb +75 -0
  33. data/lib/tesla_fleet_management_api/models/api1_vehicles_wake_up_response.rb +75 -0
  34. data/lib/tesla_fleet_management_api/models/backup_request.rb +75 -0
  35. data/lib/tesla_fleet_management_api/models/backup_response.rb +73 -0
  36. data/lib/tesla_fleet_management_api/models/base_model.rb +110 -0
  37. data/lib/tesla_fleet_management_api/models/calendar_history_response.rb +73 -0
  38. data/lib/tesla_fleet_management_api/models/charge_duration.rb +73 -0
  39. data/lib/tesla_fleet_management_api/models/charge_history.rb +96 -0
  40. data/lib/tesla_fleet_management_api/models/charge_history_response.rb +73 -0
  41. data/lib/tesla_fleet_management_api/models/charge_start_time.rb +73 -0
  42. data/lib/tesla_fleet_management_api/models/charging_dimension.rb +85 -0
  43. data/lib/tesla_fleet_management_api/models/charging_fee.rb +312 -0
  44. data/lib/tesla_fleet_management_api/models/charging_history_data.rb +81 -0
  45. data/lib/tesla_fleet_management_api/models/charging_history_item.rb +222 -0
  46. data/lib/tesla_fleet_management_api/models/charging_history_response.rb +73 -0
  47. data/lib/tesla_fleet_management_api/models/charging_invoice.rb +95 -0
  48. data/lib/tesla_fleet_management_api/models/charging_location.rb +158 -0
  49. data/lib/tesla_fleet_management_api/models/charging_period.rb +96 -0
  50. data/lib/tesla_fleet_management_api/models/charging_session.rb +187 -0
  51. data/lib/tesla_fleet_management_api/models/charging_sessions_data.rb +116 -0
  52. data/lib/tesla_fleet_management_api/models/charging_sessions_response.rb +73 -0
  53. data/lib/tesla_fleet_management_api/models/default_real_mode.rb +36 -0
  54. data/lib/tesla_fleet_management_api/models/driver.rb +164 -0
  55. data/lib/tesla_fleet_management_api/models/drivers_response.rb +94 -0
  56. data/lib/tesla_fleet_management_api/models/enterprise_payer_request.rb +94 -0
  57. data/lib/tesla_fleet_management_api/models/event.rb +89 -0
  58. data/lib/tesla_fleet_management_api/models/fleet_status_request.rb +74 -0
  59. data/lib/tesla_fleet_management_api/models/fleet_telemetry_error.rb +90 -0
  60. data/lib/tesla_fleet_management_api/models/fleet_telemetry_errors_response.rb +74 -0
  61. data/lib/tesla_fleet_management_api/models/fleet_telemetry_jws_request.rb +85 -0
  62. data/lib/tesla_fleet_management_api/models/generic_update_response.rb +73 -0
  63. data/lib/tesla_fleet_management_api/models/kind.rb +36 -0
  64. data/lib/tesla_fleet_management_api/models/kind_get_wall_connector_charging_history.rb +26 -0
  65. data/lib/tesla_fleet_management_api/models/live_status_response.rb +73 -0
  66. data/lib/tesla_fleet_management_api/models/location.rb +85 -0
  67. data/lib/tesla_fleet_management_api/models/location1.rb +85 -0
  68. data/lib/tesla_fleet_management_api/models/me_response.rb +73 -0
  69. data/lib/tesla_fleet_management_api/models/mobile_enabled.rb +85 -0
  70. data/lib/tesla_fleet_management_api/models/oauth_provider_error.rb +62 -0
  71. data/lib/tesla_fleet_management_api/models/oauth_token.rb +96 -0
  72. data/lib/tesla_fleet_management_api/models/off_grid_vehicle_charging_reserve_request.rb +79 -0
  73. data/lib/tesla_fleet_management_api/models/operation_request.rb +75 -0
  74. data/lib/tesla_fleet_management_api/models/orders_response.rb +91 -0
  75. data/lib/tesla_fleet_management_api/models/pagination.rb +127 -0
  76. data/lib/tesla_fleet_management_api/models/price_component.rb +95 -0
  77. data/lib/tesla_fleet_management_api/models/products_response.rb +85 -0
  78. data/lib/tesla_fleet_management_api/models/public_key_response.rb +73 -0
  79. data/lib/tesla_fleet_management_api/models/region_response.rb +73 -0
  80. data/lib/tesla_fleet_management_api/models/register_partner_request.rb +73 -0
  81. data/lib/tesla_fleet_management_api/models/register_partner_response.rb +73 -0
  82. data/lib/tesla_fleet_management_api/models/response.rb +82 -0
  83. data/lib/tesla_fleet_management_api/models/response1.rb +75 -0
  84. data/lib/tesla_fleet_management_api/models/response2.rb +74 -0
  85. data/lib/tesla_fleet_management_api/models/response3.rb +115 -0
  86. data/lib/tesla_fleet_management_api/models/response_api1_dx_vehicles_options_response.rb +84 -0
  87. data/lib/tesla_fleet_management_api/models/response_api1_dx_warranty_details_response.rb +124 -0
  88. data/lib/tesla_fleet_management_api/models/response_calendar_history_response.rb +91 -0
  89. data/lib/tesla_fleet_management_api/models/response_charge_history_response.rb +83 -0
  90. data/lib/tesla_fleet_management_api/models/response_fleet_telemetry_errors_response.rb +83 -0
  91. data/lib/tesla_fleet_management_api/models/response_live_status_response.rb +196 -0
  92. data/lib/tesla_fleet_management_api/models/response_me_response.rb +102 -0
  93. data/lib/tesla_fleet_management_api/models/response_orders_response.rb +157 -0
  94. data/lib/tesla_fleet_management_api/models/response_public_key_response.rb +74 -0
  95. data/lib/tesla_fleet_management_api/models/response_region_response.rb +83 -0
  96. data/lib/tesla_fleet_management_api/models/response_register_partner_response.rb +223 -0
  97. data/lib/tesla_fleet_management_api/models/signaling.rb +94 -0
  98. data/lib/tesla_fleet_management_api/models/simple_ok_response.rb +75 -0
  99. data/lib/tesla_fleet_management_api/models/site_info_response.rb +75 -0
  100. data/lib/tesla_fleet_management_api/models/storm_mode_request.rb +73 -0
  101. data/lib/tesla_fleet_management_api/models/tariff_element.rb +95 -0
  102. data/lib/tesla_fleet_management_api/models/tariffs.rb +94 -0
  103. data/lib/tesla_fleet_management_api/models/time_of_use_settings_request.rb +74 -0
  104. data/lib/tesla_fleet_management_api/models/total_cost.rb +95 -0
  105. data/lib/tesla_fleet_management_api/models/tou_settings.rb +77 -0
  106. data/lib/tesla_fleet_management_api/models/vehicle_base.rb +147 -0
  107. data/lib/tesla_fleet_management_api/models/vehicle_option.rb +107 -0
  108. data/lib/tesla_fleet_management_api/models/warranty_item.rb +155 -0
  109. data/lib/tesla_fleet_management_api/utilities/date_time_helper.rb +11 -0
  110. data/lib/tesla_fleet_management_api/utilities/file_wrapper.rb +28 -0
  111. data/lib/tesla_fleet_management_api.rb +153 -0
  112. metadata +195 -0
@@ -0,0 +1,312 @@
1
+ # tesla_fleet_management_api
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module TeslaFleetManagementApi
7
+ # ChargingFee Model.
8
+ class ChargingFee < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [Integer]
14
+ attr_accessor :session_fee_id
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :fee_type
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [String]
22
+ attr_accessor :currency_code
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [String]
26
+ attr_accessor :pricing_type
27
+
28
+ # TODO: Write general description for this method
29
+ # @return [Float]
30
+ attr_accessor :rate_base
31
+
32
+ # TODO: Write general description for this method
33
+ # @return [Float]
34
+ attr_accessor :rate_tier1
35
+
36
+ # TODO: Write general description for this method
37
+ # @return [Float]
38
+ attr_accessor :rate_tier2
39
+
40
+ # TODO: Write general description for this method
41
+ # @return [Float]
42
+ attr_accessor :rate_tier3
43
+
44
+ # TODO: Write general description for this method
45
+ # @return [Float]
46
+ attr_accessor :rate_tier4
47
+
48
+ # TODO: Write general description for this method
49
+ # @return [Float]
50
+ attr_accessor :usage_base
51
+
52
+ # TODO: Write general description for this method
53
+ # @return [Float]
54
+ attr_accessor :usage_tier1
55
+
56
+ # TODO: Write general description for this method
57
+ # @return [Float]
58
+ attr_accessor :usage_tier2
59
+
60
+ # TODO: Write general description for this method
61
+ # @return [Float]
62
+ attr_accessor :usage_tier3
63
+
64
+ # TODO: Write general description for this method
65
+ # @return [Float]
66
+ attr_accessor :usage_tier4
67
+
68
+ # TODO: Write general description for this method
69
+ # @return [Float]
70
+ attr_accessor :total_base
71
+
72
+ # TODO: Write general description for this method
73
+ # @return [Float]
74
+ attr_accessor :total_tier1
75
+
76
+ # TODO: Write general description for this method
77
+ # @return [Float]
78
+ attr_accessor :total_tier2
79
+
80
+ # TODO: Write general description for this method
81
+ # @return [Float]
82
+ attr_accessor :total_tier3
83
+
84
+ # TODO: Write general description for this method
85
+ # @return [Float]
86
+ attr_accessor :total_tier4
87
+
88
+ # TODO: Write general description for this method
89
+ # @return [Float]
90
+ attr_accessor :total_due
91
+
92
+ # TODO: Write general description for this method
93
+ # @return [Float]
94
+ attr_accessor :net_due
95
+
96
+ # TODO: Write general description for this method
97
+ # @return [String]
98
+ attr_accessor :uom
99
+
100
+ # TODO: Write general description for this method
101
+ # @return [TrueClass | FalseClass]
102
+ attr_accessor :is_paid
103
+
104
+ # TODO: Write general description for this method
105
+ # @return [String]
106
+ attr_accessor :status
107
+
108
+ # A mapping from model property names to API property names.
109
+ def self.names
110
+ @_hash = {} if @_hash.nil?
111
+ @_hash['session_fee_id'] = 'sessionFeeId'
112
+ @_hash['fee_type'] = 'feeType'
113
+ @_hash['currency_code'] = 'currencyCode'
114
+ @_hash['pricing_type'] = 'pricingType'
115
+ @_hash['rate_base'] = 'rateBase'
116
+ @_hash['rate_tier1'] = 'rateTier1'
117
+ @_hash['rate_tier2'] = 'rateTier2'
118
+ @_hash['rate_tier3'] = 'rateTier3'
119
+ @_hash['rate_tier4'] = 'rateTier4'
120
+ @_hash['usage_base'] = 'usageBase'
121
+ @_hash['usage_tier1'] = 'usageTier1'
122
+ @_hash['usage_tier2'] = 'usageTier2'
123
+ @_hash['usage_tier3'] = 'usageTier3'
124
+ @_hash['usage_tier4'] = 'usageTier4'
125
+ @_hash['total_base'] = 'totalBase'
126
+ @_hash['total_tier1'] = 'totalTier1'
127
+ @_hash['total_tier2'] = 'totalTier2'
128
+ @_hash['total_tier3'] = 'totalTier3'
129
+ @_hash['total_tier4'] = 'totalTier4'
130
+ @_hash['total_due'] = 'totalDue'
131
+ @_hash['net_due'] = 'netDue'
132
+ @_hash['uom'] = 'uom'
133
+ @_hash['is_paid'] = 'isPaid'
134
+ @_hash['status'] = 'status'
135
+ @_hash
136
+ end
137
+
138
+ # An array for optional fields
139
+ def self.optionals
140
+ %w[
141
+ session_fee_id
142
+ fee_type
143
+ currency_code
144
+ pricing_type
145
+ rate_base
146
+ rate_tier1
147
+ rate_tier2
148
+ rate_tier3
149
+ rate_tier4
150
+ usage_base
151
+ usage_tier1
152
+ usage_tier2
153
+ usage_tier3
154
+ usage_tier4
155
+ total_base
156
+ total_tier1
157
+ total_tier2
158
+ total_tier3
159
+ total_tier4
160
+ total_due
161
+ net_due
162
+ uom
163
+ is_paid
164
+ status
165
+ ]
166
+ end
167
+
168
+ # An array for nullable fields
169
+ def self.nullables
170
+ %w[
171
+ rate_tier3
172
+ rate_tier4
173
+ usage_tier3
174
+ usage_tier4
175
+ ]
176
+ end
177
+
178
+ def initialize(session_fee_id: SKIP, fee_type: SKIP, currency_code: SKIP,
179
+ pricing_type: SKIP, rate_base: SKIP, rate_tier1: SKIP,
180
+ rate_tier2: SKIP, rate_tier3: SKIP, rate_tier4: SKIP,
181
+ usage_base: SKIP, usage_tier1: SKIP, usage_tier2: SKIP,
182
+ usage_tier3: SKIP, usage_tier4: SKIP, total_base: SKIP,
183
+ total_tier1: SKIP, total_tier2: SKIP, total_tier3: SKIP,
184
+ total_tier4: SKIP, total_due: SKIP, net_due: SKIP, uom: SKIP,
185
+ is_paid: SKIP, status: SKIP, additional_properties: nil)
186
+ # Add additional model properties to the instance
187
+ additional_properties = {} if additional_properties.nil?
188
+
189
+ @session_fee_id = session_fee_id unless session_fee_id == SKIP
190
+ @fee_type = fee_type unless fee_type == SKIP
191
+ @currency_code = currency_code unless currency_code == SKIP
192
+ @pricing_type = pricing_type unless pricing_type == SKIP
193
+ @rate_base = rate_base unless rate_base == SKIP
194
+ @rate_tier1 = rate_tier1 unless rate_tier1 == SKIP
195
+ @rate_tier2 = rate_tier2 unless rate_tier2 == SKIP
196
+ @rate_tier3 = rate_tier3 unless rate_tier3 == SKIP
197
+ @rate_tier4 = rate_tier4 unless rate_tier4 == SKIP
198
+ @usage_base = usage_base unless usage_base == SKIP
199
+ @usage_tier1 = usage_tier1 unless usage_tier1 == SKIP
200
+ @usage_tier2 = usage_tier2 unless usage_tier2 == SKIP
201
+ @usage_tier3 = usage_tier3 unless usage_tier3 == SKIP
202
+ @usage_tier4 = usage_tier4 unless usage_tier4 == SKIP
203
+ @total_base = total_base unless total_base == SKIP
204
+ @total_tier1 = total_tier1 unless total_tier1 == SKIP
205
+ @total_tier2 = total_tier2 unless total_tier2 == SKIP
206
+ @total_tier3 = total_tier3 unless total_tier3 == SKIP
207
+ @total_tier4 = total_tier4 unless total_tier4 == SKIP
208
+ @total_due = total_due unless total_due == SKIP
209
+ @net_due = net_due unless net_due == SKIP
210
+ @uom = uom unless uom == SKIP
211
+ @is_paid = is_paid unless is_paid == SKIP
212
+ @status = status unless status == SKIP
213
+ @additional_properties = additional_properties
214
+ end
215
+
216
+ # Creates an instance of the object from a hash.
217
+ def self.from_hash(hash)
218
+ return nil unless hash
219
+
220
+ # Extract variables from the hash.
221
+ session_fee_id = hash.key?('sessionFeeId') ? hash['sessionFeeId'] : SKIP
222
+ fee_type = hash.key?('feeType') ? hash['feeType'] : SKIP
223
+ currency_code = hash.key?('currencyCode') ? hash['currencyCode'] : SKIP
224
+ pricing_type = hash.key?('pricingType') ? hash['pricingType'] : SKIP
225
+ rate_base = hash.key?('rateBase') ? hash['rateBase'] : SKIP
226
+ rate_tier1 = hash.key?('rateTier1') ? hash['rateTier1'] : SKIP
227
+ rate_tier2 = hash.key?('rateTier2') ? hash['rateTier2'] : SKIP
228
+ rate_tier3 = hash.key?('rateTier3') ? hash['rateTier3'] : SKIP
229
+ rate_tier4 = hash.key?('rateTier4') ? hash['rateTier4'] : SKIP
230
+ usage_base = hash.key?('usageBase') ? hash['usageBase'] : SKIP
231
+ usage_tier1 = hash.key?('usageTier1') ? hash['usageTier1'] : SKIP
232
+ usage_tier2 = hash.key?('usageTier2') ? hash['usageTier2'] : SKIP
233
+ usage_tier3 = hash.key?('usageTier3') ? hash['usageTier3'] : SKIP
234
+ usage_tier4 = hash.key?('usageTier4') ? hash['usageTier4'] : SKIP
235
+ total_base = hash.key?('totalBase') ? hash['totalBase'] : SKIP
236
+ total_tier1 = hash.key?('totalTier1') ? hash['totalTier1'] : SKIP
237
+ total_tier2 = hash.key?('totalTier2') ? hash['totalTier2'] : SKIP
238
+ total_tier3 = hash.key?('totalTier3') ? hash['totalTier3'] : SKIP
239
+ total_tier4 = hash.key?('totalTier4') ? hash['totalTier4'] : SKIP
240
+ total_due = hash.key?('totalDue') ? hash['totalDue'] : SKIP
241
+ net_due = hash.key?('netDue') ? hash['netDue'] : SKIP
242
+ uom = hash.key?('uom') ? hash['uom'] : SKIP
243
+ is_paid = hash.key?('isPaid') ? hash['isPaid'] : SKIP
244
+ status = hash.key?('status') ? hash['status'] : SKIP
245
+
246
+ # Create a new hash for additional properties, removing known properties.
247
+ new_hash = hash.reject { |k, _| names.value?(k) }
248
+
249
+ additional_properties = APIHelper.get_additional_properties(
250
+ new_hash, proc { |value| value }
251
+ )
252
+
253
+ # Create object from extracted values.
254
+ ChargingFee.new(session_fee_id: session_fee_id,
255
+ fee_type: fee_type,
256
+ currency_code: currency_code,
257
+ pricing_type: pricing_type,
258
+ rate_base: rate_base,
259
+ rate_tier1: rate_tier1,
260
+ rate_tier2: rate_tier2,
261
+ rate_tier3: rate_tier3,
262
+ rate_tier4: rate_tier4,
263
+ usage_base: usage_base,
264
+ usage_tier1: usage_tier1,
265
+ usage_tier2: usage_tier2,
266
+ usage_tier3: usage_tier3,
267
+ usage_tier4: usage_tier4,
268
+ total_base: total_base,
269
+ total_tier1: total_tier1,
270
+ total_tier2: total_tier2,
271
+ total_tier3: total_tier3,
272
+ total_tier4: total_tier4,
273
+ total_due: total_due,
274
+ net_due: net_due,
275
+ uom: uom,
276
+ is_paid: is_paid,
277
+ status: status,
278
+ additional_properties: additional_properties)
279
+ end
280
+
281
+ # Provides a human-readable string representation of the object.
282
+ def to_s
283
+ class_name = self.class.name.split('::').last
284
+ "<#{class_name} session_fee_id: #{@session_fee_id}, fee_type: #{@fee_type}, currency_code:"\
285
+ " #{@currency_code}, pricing_type: #{@pricing_type}, rate_base: #{@rate_base}, rate_tier1:"\
286
+ " #{@rate_tier1}, rate_tier2: #{@rate_tier2}, rate_tier3: #{@rate_tier3}, rate_tier4:"\
287
+ " #{@rate_tier4}, usage_base: #{@usage_base}, usage_tier1: #{@usage_tier1}, usage_tier2:"\
288
+ " #{@usage_tier2}, usage_tier3: #{@usage_tier3}, usage_tier4: #{@usage_tier4}, total_base:"\
289
+ " #{@total_base}, total_tier1: #{@total_tier1}, total_tier2: #{@total_tier2}, total_tier3:"\
290
+ " #{@total_tier3}, total_tier4: #{@total_tier4}, total_due: #{@total_due}, net_due:"\
291
+ " #{@net_due}, uom: #{@uom}, is_paid: #{@is_paid}, status: #{@status},"\
292
+ " additional_properties: #{@additional_properties}>"
293
+ end
294
+
295
+ # Provides a debugging-friendly string with detailed object information.
296
+ def inspect
297
+ class_name = self.class.name.split('::').last
298
+ "<#{class_name} session_fee_id: #{@session_fee_id.inspect}, fee_type: #{@fee_type.inspect},"\
299
+ " currency_code: #{@currency_code.inspect}, pricing_type: #{@pricing_type.inspect},"\
300
+ " rate_base: #{@rate_base.inspect}, rate_tier1: #{@rate_tier1.inspect}, rate_tier2:"\
301
+ " #{@rate_tier2.inspect}, rate_tier3: #{@rate_tier3.inspect}, rate_tier4:"\
302
+ " #{@rate_tier4.inspect}, usage_base: #{@usage_base.inspect}, usage_tier1:"\
303
+ " #{@usage_tier1.inspect}, usage_tier2: #{@usage_tier2.inspect}, usage_tier3:"\
304
+ " #{@usage_tier3.inspect}, usage_tier4: #{@usage_tier4.inspect}, total_base:"\
305
+ " #{@total_base.inspect}, total_tier1: #{@total_tier1.inspect}, total_tier2:"\
306
+ " #{@total_tier2.inspect}, total_tier3: #{@total_tier3.inspect}, total_tier4:"\
307
+ " #{@total_tier4.inspect}, total_due: #{@total_due.inspect}, net_due: #{@net_due.inspect},"\
308
+ " uom: #{@uom.inspect}, is_paid: #{@is_paid.inspect}, status: #{@status.inspect},"\
309
+ " additional_properties: #{@additional_properties}>"
310
+ end
311
+ end
312
+ end
@@ -0,0 +1,81 @@
1
+ # tesla_fleet_management_api
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module TeslaFleetManagementApi
7
+ # ChargingHistoryData Model.
8
+ class ChargingHistoryData < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [Array[ChargingHistoryItem]]
14
+ attr_accessor :data
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['data'] = 'data'
20
+ @_hash
21
+ end
22
+
23
+ # An array for optional fields
24
+ def self.optionals
25
+ []
26
+ end
27
+
28
+ # An array for nullable fields
29
+ def self.nullables
30
+ []
31
+ end
32
+
33
+ def initialize(data:, additional_properties: nil)
34
+ # Add additional model properties to the instance
35
+ additional_properties = {} if additional_properties.nil?
36
+
37
+ @data = data
38
+ @additional_properties = additional_properties
39
+ end
40
+
41
+ # Creates an instance of the object from a hash.
42
+ def self.from_hash(hash)
43
+ return nil unless hash
44
+
45
+ # Extract variables from the hash.
46
+ # Parameter is an array, so we need to iterate through it
47
+ data = nil
48
+ unless hash['data'].nil?
49
+ data = []
50
+ hash['data'].each do |structure|
51
+ data << (ChargingHistoryItem.from_hash(structure) if structure)
52
+ end
53
+ end
54
+
55
+ data = nil unless hash.key?('data')
56
+
57
+ # Create a new hash for additional properties, removing known properties.
58
+ new_hash = hash.reject { |k, _| names.value?(k) }
59
+
60
+ additional_properties = APIHelper.get_additional_properties(
61
+ new_hash, proc { |value| value }
62
+ )
63
+
64
+ # Create object from extracted values.
65
+ ChargingHistoryData.new(data: data,
66
+ additional_properties: additional_properties)
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} data: #{@data}, additional_properties: #{@additional_properties}>"
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} data: #{@data.inspect}, additional_properties: #{@additional_properties}>"
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,222 @@
1
+ # tesla_fleet_management_api
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module TeslaFleetManagementApi
8
+ # ChargingHistoryItem Model.
9
+ class ChargingHistoryItem < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [Integer]
15
+ attr_accessor :session_id
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [String]
19
+ attr_accessor :vin
20
+
21
+ # TODO: Write general description for this method
22
+ # @return [String]
23
+ attr_accessor :site_location_name
24
+
25
+ # TODO: Write general description for this method
26
+ # @return [DateTime]
27
+ attr_accessor :charge_start_date_time
28
+
29
+ # TODO: Write general description for this method
30
+ # @return [DateTime]
31
+ attr_accessor :charge_stop_date_time
32
+
33
+ # TODO: Write general description for this method
34
+ # @return [DateTime]
35
+ attr_accessor :unlatch_date_time
36
+
37
+ # TODO: Write general description for this method
38
+ # @return [String]
39
+ attr_accessor :country_code
40
+
41
+ # TODO: Write general description for this method
42
+ # @return [Array[ChargingFee]]
43
+ attr_accessor :fees
44
+
45
+ # TODO: Write general description for this method
46
+ # @return [String]
47
+ attr_accessor :billing_type
48
+
49
+ # TODO: Write general description for this method
50
+ # @return [Array[ChargingInvoice]]
51
+ attr_accessor :invoices
52
+
53
+ # TODO: Write general description for this method
54
+ # @return [String]
55
+ attr_accessor :vehicle_make_type
56
+
57
+ # A mapping from model property names to API property names.
58
+ def self.names
59
+ @_hash = {} if @_hash.nil?
60
+ @_hash['session_id'] = 'sessionId'
61
+ @_hash['vin'] = 'vin'
62
+ @_hash['site_location_name'] = 'siteLocationName'
63
+ @_hash['charge_start_date_time'] = 'chargeStartDateTime'
64
+ @_hash['charge_stop_date_time'] = 'chargeStopDateTime'
65
+ @_hash['unlatch_date_time'] = 'unlatchDateTime'
66
+ @_hash['country_code'] = 'countryCode'
67
+ @_hash['fees'] = 'fees'
68
+ @_hash['billing_type'] = 'billingType'
69
+ @_hash['invoices'] = 'invoices'
70
+ @_hash['vehicle_make_type'] = 'vehicleMakeType'
71
+ @_hash
72
+ end
73
+
74
+ # An array for optional fields
75
+ def self.optionals
76
+ %w[
77
+ site_location_name
78
+ charge_start_date_time
79
+ charge_stop_date_time
80
+ unlatch_date_time
81
+ country_code
82
+ fees
83
+ billing_type
84
+ invoices
85
+ vehicle_make_type
86
+ ]
87
+ end
88
+
89
+ # An array for nullable fields
90
+ def self.nullables
91
+ []
92
+ end
93
+
94
+ def initialize(session_id:, vin:, site_location_name: SKIP,
95
+ charge_start_date_time: SKIP, charge_stop_date_time: SKIP,
96
+ unlatch_date_time: SKIP, country_code: SKIP, fees: SKIP,
97
+ billing_type: SKIP, invoices: SKIP, vehicle_make_type: SKIP,
98
+ additional_properties: nil)
99
+ # Add additional model properties to the instance
100
+ additional_properties = {} if additional_properties.nil?
101
+
102
+ @session_id = session_id
103
+ @vin = vin
104
+ @site_location_name = site_location_name unless site_location_name == SKIP
105
+ @charge_start_date_time = charge_start_date_time unless charge_start_date_time == SKIP
106
+ @charge_stop_date_time = charge_stop_date_time unless charge_stop_date_time == SKIP
107
+ @unlatch_date_time = unlatch_date_time unless unlatch_date_time == SKIP
108
+ @country_code = country_code unless country_code == SKIP
109
+ @fees = fees unless fees == SKIP
110
+ @billing_type = billing_type unless billing_type == SKIP
111
+ @invoices = invoices unless invoices == SKIP
112
+ @vehicle_make_type = vehicle_make_type unless vehicle_make_type == SKIP
113
+ @additional_properties = additional_properties
114
+ end
115
+
116
+ # Creates an instance of the object from a hash.
117
+ def self.from_hash(hash)
118
+ return nil unless hash
119
+
120
+ # Extract variables from the hash.
121
+ session_id = hash.key?('sessionId') ? hash['sessionId'] : nil
122
+ vin = hash.key?('vin') ? hash['vin'] : nil
123
+ site_location_name =
124
+ hash.key?('siteLocationName') ? hash['siteLocationName'] : SKIP
125
+ charge_start_date_time = if hash.key?('chargeStartDateTime')
126
+ (DateTimeHelper.from_rfc3339(hash['chargeStartDateTime']) if hash['chargeStartDateTime'])
127
+ else
128
+ SKIP
129
+ end
130
+ charge_stop_date_time = if hash.key?('chargeStopDateTime')
131
+ (DateTimeHelper.from_rfc3339(hash['chargeStopDateTime']) if hash['chargeStopDateTime'])
132
+ else
133
+ SKIP
134
+ end
135
+ unlatch_date_time = if hash.key?('unlatchDateTime')
136
+ (DateTimeHelper.from_rfc3339(hash['unlatchDateTime']) if hash['unlatchDateTime'])
137
+ else
138
+ SKIP
139
+ end
140
+ country_code = hash.key?('countryCode') ? hash['countryCode'] : SKIP
141
+ # Parameter is an array, so we need to iterate through it
142
+ fees = nil
143
+ unless hash['fees'].nil?
144
+ fees = []
145
+ hash['fees'].each do |structure|
146
+ fees << (ChargingFee.from_hash(structure) if structure)
147
+ end
148
+ end
149
+
150
+ fees = SKIP unless hash.key?('fees')
151
+ billing_type = hash.key?('billingType') ? hash['billingType'] : SKIP
152
+ # Parameter is an array, so we need to iterate through it
153
+ invoices = nil
154
+ unless hash['invoices'].nil?
155
+ invoices = []
156
+ hash['invoices'].each do |structure|
157
+ invoices << (ChargingInvoice.from_hash(structure) if structure)
158
+ end
159
+ end
160
+
161
+ invoices = SKIP unless hash.key?('invoices')
162
+ vehicle_make_type =
163
+ hash.key?('vehicleMakeType') ? hash['vehicleMakeType'] : SKIP
164
+
165
+ # Create a new hash for additional properties, removing known properties.
166
+ new_hash = hash.reject { |k, _| names.value?(k) }
167
+
168
+ additional_properties = APIHelper.get_additional_properties(
169
+ new_hash, proc { |value| value }
170
+ )
171
+
172
+ # Create object from extracted values.
173
+ ChargingHistoryItem.new(session_id: session_id,
174
+ vin: vin,
175
+ site_location_name: site_location_name,
176
+ charge_start_date_time: charge_start_date_time,
177
+ charge_stop_date_time: charge_stop_date_time,
178
+ unlatch_date_time: unlatch_date_time,
179
+ country_code: country_code,
180
+ fees: fees,
181
+ billing_type: billing_type,
182
+ invoices: invoices,
183
+ vehicle_make_type: vehicle_make_type,
184
+ additional_properties: additional_properties)
185
+ end
186
+
187
+ def to_custom_charge_start_date_time
188
+ DateTimeHelper.to_rfc3339(charge_start_date_time)
189
+ end
190
+
191
+ def to_custom_charge_stop_date_time
192
+ DateTimeHelper.to_rfc3339(charge_stop_date_time)
193
+ end
194
+
195
+ def to_custom_unlatch_date_time
196
+ DateTimeHelper.to_rfc3339(unlatch_date_time)
197
+ end
198
+
199
+ # Provides a human-readable string representation of the object.
200
+ def to_s
201
+ class_name = self.class.name.split('::').last
202
+ "<#{class_name} session_id: #{@session_id}, vin: #{@vin}, site_location_name:"\
203
+ " #{@site_location_name}, charge_start_date_time: #{@charge_start_date_time},"\
204
+ " charge_stop_date_time: #{@charge_stop_date_time}, unlatch_date_time:"\
205
+ " #{@unlatch_date_time}, country_code: #{@country_code}, fees: #{@fees}, billing_type:"\
206
+ " #{@billing_type}, invoices: #{@invoices}, vehicle_make_type: #{@vehicle_make_type},"\
207
+ " additional_properties: #{@additional_properties}>"
208
+ end
209
+
210
+ # Provides a debugging-friendly string with detailed object information.
211
+ def inspect
212
+ class_name = self.class.name.split('::').last
213
+ "<#{class_name} session_id: #{@session_id.inspect}, vin: #{@vin.inspect},"\
214
+ " site_location_name: #{@site_location_name.inspect}, charge_start_date_time:"\
215
+ " #{@charge_start_date_time.inspect}, charge_stop_date_time:"\
216
+ " #{@charge_stop_date_time.inspect}, unlatch_date_time: #{@unlatch_date_time.inspect},"\
217
+ " country_code: #{@country_code.inspect}, fees: #{@fees.inspect}, billing_type:"\
218
+ " #{@billing_type.inspect}, invoices: #{@invoices.inspect}, vehicle_make_type:"\
219
+ " #{@vehicle_make_type.inspect}, additional_properties: #{@additional_properties}>"
220
+ end
221
+ end
222
+ end
@@ -0,0 +1,73 @@
1
+ # tesla_fleet_management_api
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module TeslaFleetManagementApi
7
+ # ChargingHistoryResponse Model.
8
+ class ChargingHistoryResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [ChargingHistoryData]
14
+ attr_accessor :response
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['response'] = 'response'
20
+ @_hash
21
+ end
22
+
23
+ # An array for optional fields
24
+ def self.optionals
25
+ []
26
+ end
27
+
28
+ # An array for nullable fields
29
+ def self.nullables
30
+ []
31
+ end
32
+
33
+ def initialize(response:, additional_properties: nil)
34
+ # Add additional model properties to the instance
35
+ additional_properties = {} if additional_properties.nil?
36
+
37
+ @response = response
38
+ @additional_properties = additional_properties
39
+ end
40
+
41
+ # Creates an instance of the object from a hash.
42
+ def self.from_hash(hash)
43
+ return nil unless hash
44
+
45
+ # Extract variables from the hash.
46
+ response = ChargingHistoryData.from_hash(hash['response']) if hash['response']
47
+
48
+ # Create a new hash for additional properties, removing known properties.
49
+ new_hash = hash.reject { |k, _| names.value?(k) }
50
+
51
+ additional_properties = APIHelper.get_additional_properties(
52
+ new_hash, proc { |value| value }
53
+ )
54
+
55
+ # Create object from extracted values.
56
+ ChargingHistoryResponse.new(response: response,
57
+ additional_properties: additional_properties)
58
+ end
59
+
60
+ # Provides a human-readable string representation of the object.
61
+ def to_s
62
+ class_name = self.class.name.split('::').last
63
+ "<#{class_name} response: #{@response}, additional_properties: #{@additional_properties}>"
64
+ end
65
+
66
+ # Provides a debugging-friendly string with detailed object information.
67
+ def inspect
68
+ class_name = self.class.name.split('::').last
69
+ "<#{class_name} response: #{@response.inspect}, additional_properties:"\
70
+ " #{@additional_properties}>"
71
+ end
72
+ end
73
+ end