tesla-api-sdk 1.0.0__py3-none-any.whl

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 (119) hide show
  1. tesla_api_sdk-1.0.0.dist-info/METADATA +145 -0
  2. tesla_api_sdk-1.0.0.dist-info/RECORD +119 -0
  3. tesla_api_sdk-1.0.0.dist-info/WHEEL +5 -0
  4. tesla_api_sdk-1.0.0.dist-info/licenses/LICENSE +28 -0
  5. tesla_api_sdk-1.0.0.dist-info/top_level.txt +1 -0
  6. teslafleetmanagementapi/__init__.py +13 -0
  7. teslafleetmanagementapi/api_helper.py +19 -0
  8. teslafleetmanagementapi/configuration.py +270 -0
  9. teslafleetmanagementapi/controllers/__init__.py +11 -0
  10. teslafleetmanagementapi/controllers/base_controller.py +70 -0
  11. teslafleetmanagementapi/controllers/charging_controller.py +140 -0
  12. teslafleetmanagementapi/controllers/energy_controller.py +572 -0
  13. teslafleetmanagementapi/controllers/oauth_authorization_controller.py +165 -0
  14. teslafleetmanagementapi/controllers/partner_controller.py +181 -0
  15. teslafleetmanagementapi/controllers/user_controller.py +158 -0
  16. teslafleetmanagementapi/controllers/vehicles_controller.py +832 -0
  17. teslafleetmanagementapi/exceptions/__init__.py +6 -0
  18. teslafleetmanagementapi/exceptions/api_exception.py +36 -0
  19. teslafleetmanagementapi/exceptions/oauth_provider_exception.py +75 -0
  20. teslafleetmanagementapi/http/__init__.py +11 -0
  21. teslafleetmanagementapi/http/api_response.py +67 -0
  22. teslafleetmanagementapi/http/auth/__init__.py +6 -0
  23. teslafleetmanagementapi/http/auth/bearer_auth.py +103 -0
  24. teslafleetmanagementapi/http/auth/oauth_2.py +311 -0
  25. teslafleetmanagementapi/http/http_call_back.py +20 -0
  26. teslafleetmanagementapi/http/http_client_provider.py +23 -0
  27. teslafleetmanagementapi/http/http_method_enum.py +25 -0
  28. teslafleetmanagementapi/http/http_request.py +55 -0
  29. teslafleetmanagementapi/http/http_response.py +45 -0
  30. teslafleetmanagementapi/http/proxy_settings.py +50 -0
  31. teslafleetmanagementapi/logging/__init__.py +6 -0
  32. teslafleetmanagementapi/logging/configuration/__init__.py +5 -0
  33. teslafleetmanagementapi/logging/configuration/api_logging_configuration.py +398 -0
  34. teslafleetmanagementapi/logging/sdk_logger.py +28 -0
  35. teslafleetmanagementapi/models/__init__.py +85 -0
  36. teslafleetmanagementapi/models/api_1_dx_vehicles_options_response.py +110 -0
  37. teslafleetmanagementapi/models/api_1_dx_warranty_details_response.py +110 -0
  38. teslafleetmanagementapi/models/api_1_vehicles_mobile_enabled_response.py +109 -0
  39. teslafleetmanagementapi/models/api_1_vehicles_nearby_charging_sites_response.py +109 -0
  40. teslafleetmanagementapi/models/api_1_vehicles_response.py +162 -0
  41. teslafleetmanagementapi/models/api_1_vehicles_response_get_vehicle.py +109 -0
  42. teslafleetmanagementapi/models/api_1_vehicles_wake_up_response.py +109 -0
  43. teslafleetmanagementapi/models/backup_request.py +92 -0
  44. teslafleetmanagementapi/models/backup_response.py +95 -0
  45. teslafleetmanagementapi/models/calendar_history_response.py +96 -0
  46. teslafleetmanagementapi/models/charge_duration.py +92 -0
  47. teslafleetmanagementapi/models/charge_history.py +125 -0
  48. teslafleetmanagementapi/models/charge_history_response.py +96 -0
  49. teslafleetmanagementapi/models/charge_start_time.py +92 -0
  50. teslafleetmanagementapi/models/charging_dimension.py +128 -0
  51. teslafleetmanagementapi/models/charging_fee.py +641 -0
  52. teslafleetmanagementapi/models/charging_history_data.py +98 -0
  53. teslafleetmanagementapi/models/charging_history_item.py +336 -0
  54. teslafleetmanagementapi/models/charging_history_response.py +96 -0
  55. teslafleetmanagementapi/models/charging_invoice.py +151 -0
  56. teslafleetmanagementapi/models/charging_location.py +293 -0
  57. teslafleetmanagementapi/models/charging_period.py +136 -0
  58. teslafleetmanagementapi/models/charging_session.py +355 -0
  59. teslafleetmanagementapi/models/charging_sessions_data.py +182 -0
  60. teslafleetmanagementapi/models/charging_sessions_response.py +96 -0
  61. teslafleetmanagementapi/models/default_real_mode.py +45 -0
  62. teslafleetmanagementapi/models/driver.py +289 -0
  63. teslafleetmanagementapi/models/drivers_response.py +135 -0
  64. teslafleetmanagementapi/models/enterprise_payer_request.py +141 -0
  65. teslafleetmanagementapi/models/event.py +107 -0
  66. teslafleetmanagementapi/models/fleet_status_request.py +105 -0
  67. teslafleetmanagementapi/models/fleet_telemetry_error.py +118 -0
  68. teslafleetmanagementapi/models/fleet_telemetry_errors_response.py +96 -0
  69. teslafleetmanagementapi/models/fleet_telemetry_jws_request.py +128 -0
  70. teslafleetmanagementapi/models/generic_update_response.py +95 -0
  71. teslafleetmanagementapi/models/kind.py +45 -0
  72. teslafleetmanagementapi/models/kind_get_wall_connector_charging_history.py +42 -0
  73. teslafleetmanagementapi/models/live_status_response.py +96 -0
  74. teslafleetmanagementapi/models/location.py +128 -0
  75. teslafleetmanagementapi/models/location_1.py +128 -0
  76. teslafleetmanagementapi/models/me_response.py +95 -0
  77. teslafleetmanagementapi/models/mobile_enabled.py +128 -0
  78. teslafleetmanagementapi/models/oauth_provider_error.py +67 -0
  79. teslafleetmanagementapi/models/oauth_token.py +115 -0
  80. teslafleetmanagementapi/models/off_grid_vehicle_charging_reserve_request.py +95 -0
  81. teslafleetmanagementapi/models/operation_request.py +93 -0
  82. teslafleetmanagementapi/models/orders_response.py +111 -0
  83. teslafleetmanagementapi/models/pagination.py +225 -0
  84. teslafleetmanagementapi/models/price_component.py +151 -0
  85. teslafleetmanagementapi/models/products_response.py +128 -0
  86. teslafleetmanagementapi/models/public_key_response.py +96 -0
  87. teslafleetmanagementapi/models/region_response.py +96 -0
  88. teslafleetmanagementapi/models/register_partner_request.py +92 -0
  89. teslafleetmanagementapi/models/register_partner_response.py +96 -0
  90. teslafleetmanagementapi/models/response.py +105 -0
  91. teslafleetmanagementapi/models/response_1.py +92 -0
  92. teslafleetmanagementapi/models/response_2.py +95 -0
  93. teslafleetmanagementapi/models/response_3.py +164 -0
  94. teslafleetmanagementapi/models/response_api_1_dx_vehicles_options_response.py +112 -0
  95. teslafleetmanagementapi/models/response_api_1_dx_warranty_details_response.py +169 -0
  96. teslafleetmanagementapi/models/response_calendar_history_response.py +110 -0
  97. teslafleetmanagementapi/models/response_charge_history_response.py +98 -0
  98. teslafleetmanagementapi/models/response_fleet_telemetry_errors_response.py +98 -0
  99. teslafleetmanagementapi/models/response_live_status_response.py +310 -0
  100. teslafleetmanagementapi/models/response_me_response.py +131 -0
  101. teslafleetmanagementapi/models/response_orders_response.py +209 -0
  102. teslafleetmanagementapi/models/response_public_key_response.py +92 -0
  103. teslafleetmanagementapi/models/response_region_response.py +105 -0
  104. teslafleetmanagementapi/models/response_register_partner_response.py +331 -0
  105. teslafleetmanagementapi/models/signaling.py +118 -0
  106. teslafleetmanagementapi/models/simple_ok_response.py +105 -0
  107. teslafleetmanagementapi/models/site_info_response.py +105 -0
  108. teslafleetmanagementapi/models/storm_mode_request.py +92 -0
  109. teslafleetmanagementapi/models/tariff_element.py +136 -0
  110. teslafleetmanagementapi/models/tariffs.py +136 -0
  111. teslafleetmanagementapi/models/time_of_use_settings_request.py +95 -0
  112. teslafleetmanagementapi/models/total_cost.py +151 -0
  113. teslafleetmanagementapi/models/tou_settings.py +105 -0
  114. teslafleetmanagementapi/models/vehicle_base.py +266 -0
  115. teslafleetmanagementapi/models/vehicle_option.py +178 -0
  116. teslafleetmanagementapi/models/warranty_item.py +249 -0
  117. teslafleetmanagementapi/teslafleetmanagementapi_client.py +128 -0
  118. teslafleetmanagementapi/utilities/__init__.py +6 -0
  119. teslafleetmanagementapi/utilities/file_wrapper.py +45 -0
@@ -0,0 +1,355 @@
1
+ """teslafleetmanagementapi.
2
+
3
+ This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
4
+ """
5
+
6
+ # ruff: noqa: E501
7
+ from teslafleetmanagementapi.api_helper import (
8
+ APIHelper,
9
+ )
10
+ from teslafleetmanagementapi.models.charging_period import (
11
+ ChargingPeriod,
12
+ )
13
+ from teslafleetmanagementapi.models.location import (
14
+ Location,
15
+ )
16
+ from teslafleetmanagementapi.models.tariffs import (
17
+ Tariffs,
18
+ )
19
+ from teslafleetmanagementapi.models.total_cost import (
20
+ TotalCost,
21
+ )
22
+
23
+
24
+ class ChargingSession(object):
25
+ """Implementation of the 'ChargingSession' model.
26
+
27
+ Attributes:
28
+ id (str): The model property of type str.
29
+ vin (str): The model property of type str.
30
+ model (str): The model property of type str.
31
+ start_date_time (str): The model property of type str.
32
+ stop_date_time (str): The model property of type str.
33
+ total_energy (float): The model property of type float.
34
+ total_time (float): The model property of type float.
35
+ total_cost (TotalCost): The model property of type TotalCost.
36
+ location (Location): The model property of type Location.
37
+ charging_periods (List[ChargingPeriod]): The model property of type
38
+ List[ChargingPeriod].
39
+ tariffs (Tariffs): The model property of type Tariffs.
40
+ additional_properties (Dict[str, Any]): The additional properties for the
41
+ model.
42
+
43
+ """
44
+
45
+ # Create a mapping from Model property names to API property names
46
+ _names = {
47
+ "id": "id",
48
+ "vin": "vin",
49
+ "model": "model",
50
+ "start_date_time": "start_date_time",
51
+ "stop_date_time": "stop_date_time",
52
+ "total_energy": "total_energy",
53
+ "total_time": "total_time",
54
+ "total_cost": "total_cost",
55
+ "location": "location",
56
+ "charging_periods": "charging_periods",
57
+ "tariffs": "tariffs",
58
+ }
59
+
60
+ _optionals = [
61
+ "id",
62
+ "vin",
63
+ "model",
64
+ "start_date_time",
65
+ "stop_date_time",
66
+ "total_energy",
67
+ "total_time",
68
+ "total_cost",
69
+ "location",
70
+ "charging_periods",
71
+ "tariffs",
72
+ ]
73
+
74
+ def __init__(
75
+ self,
76
+ id=APIHelper.SKIP,
77
+ vin=APIHelper.SKIP,
78
+ model=APIHelper.SKIP,
79
+ start_date_time=APIHelper.SKIP,
80
+ stop_date_time=APIHelper.SKIP,
81
+ total_energy=APIHelper.SKIP,
82
+ total_time=APIHelper.SKIP,
83
+ total_cost=APIHelper.SKIP,
84
+ location=APIHelper.SKIP,
85
+ charging_periods=APIHelper.SKIP,
86
+ tariffs=APIHelper.SKIP,
87
+ additional_properties=None):
88
+ """Initialize a ChargingSession instance."""
89
+ # Initialize members of the class
90
+ if id is not APIHelper.SKIP:
91
+ self.id = id
92
+ if vin is not APIHelper.SKIP:
93
+ self.vin = vin
94
+ if model is not APIHelper.SKIP:
95
+ self.model = model
96
+ if start_date_time is not APIHelper.SKIP:
97
+ self.start_date_time = start_date_time
98
+ if stop_date_time is not APIHelper.SKIP:
99
+ self.stop_date_time = stop_date_time
100
+ if total_energy is not APIHelper.SKIP:
101
+ self.total_energy = total_energy
102
+ if total_time is not APIHelper.SKIP:
103
+ self.total_time = total_time
104
+ if total_cost is not APIHelper.SKIP:
105
+ self.total_cost = total_cost
106
+ if location is not APIHelper.SKIP:
107
+ self.location = location
108
+ if charging_periods is not APIHelper.SKIP:
109
+ self.charging_periods = charging_periods
110
+ if tariffs is not APIHelper.SKIP:
111
+ self.tariffs = tariffs
112
+
113
+ # Add additional model properties to the instance
114
+ if additional_properties is None:
115
+ additional_properties = {}
116
+ self.additional_properties = additional_properties
117
+
118
+ @classmethod
119
+ def from_dictionary(cls,
120
+ dictionary):
121
+ """Create an instance of this model from a dictionary
122
+
123
+ Args:
124
+ dictionary (dictionary): A dictionary representation of the object
125
+ as obtained from the deserialization of the server's response. The
126
+ keys MUST match property names in the API description.
127
+
128
+ Returns:
129
+ object: An instance of this structure class.
130
+
131
+ """
132
+ if not isinstance(dictionary, dict) or dictionary is None:
133
+ return None
134
+
135
+ # Extract variables from the dictionary
136
+ id =\
137
+ dictionary.get("id")\
138
+ if dictionary.get("id")\
139
+ else APIHelper.SKIP
140
+ vin =\
141
+ dictionary.get("vin")\
142
+ if dictionary.get("vin")\
143
+ else APIHelper.SKIP
144
+ model =\
145
+ dictionary.get("model")\
146
+ if dictionary.get("model")\
147
+ else APIHelper.SKIP
148
+ start_date_time =\
149
+ dictionary.get("start_date_time")\
150
+ if dictionary.get("start_date_time")\
151
+ else APIHelper.SKIP
152
+ stop_date_time =\
153
+ dictionary.get("stop_date_time")\
154
+ if dictionary.get("stop_date_time")\
155
+ else APIHelper.SKIP
156
+ total_energy =\
157
+ dictionary.get("total_energy")\
158
+ if dictionary.get("total_energy")\
159
+ else APIHelper.SKIP
160
+ total_time =\
161
+ dictionary.get("total_time")\
162
+ if dictionary.get("total_time")\
163
+ else APIHelper.SKIP
164
+ total_cost =\
165
+ TotalCost.from_dictionary(
166
+ dictionary.get("total_cost"))\
167
+ if "total_cost" in dictionary.keys()\
168
+ else APIHelper.SKIP
169
+ location =\
170
+ Location.from_dictionary(
171
+ dictionary.get("location"))\
172
+ if "location" in dictionary.keys()\
173
+ else APIHelper.SKIP
174
+ charging_periods = None
175
+ if dictionary.get("charging_periods") is not None:
176
+ charging_periods = [
177
+ ChargingPeriod.from_dictionary(x)
178
+ for x in dictionary.get("charging_periods")
179
+ ]
180
+ else:
181
+ charging_periods = APIHelper.SKIP
182
+ tariffs =\
183
+ Tariffs.from_dictionary(
184
+ dictionary.get("tariffs"))\
185
+ if "tariffs" in dictionary.keys()\
186
+ else APIHelper.SKIP
187
+
188
+ additional_properties = APIHelper.get_additional_properties(
189
+ dictionary={k: v for k, v in dictionary.items()
190
+ if k not in cls._names.values()},
191
+ unboxing_function=lambda value: value)
192
+
193
+ # Return an object of this model
194
+ return cls(id,
195
+ vin,
196
+ model,
197
+ start_date_time,
198
+ stop_date_time,
199
+ total_energy,
200
+ total_time,
201
+ total_cost,
202
+ location,
203
+ charging_periods,
204
+ tariffs,
205
+ additional_properties)
206
+
207
+ def __repr__(self):
208
+ """Return a unambiguous string representation."""
209
+ _id=(
210
+ self.id
211
+ if hasattr(self, "id")
212
+ else None
213
+ )
214
+ _vin=(
215
+ self.vin
216
+ if hasattr(self, "vin")
217
+ else None
218
+ )
219
+ _model=(
220
+ self.model
221
+ if hasattr(self, "model")
222
+ else None
223
+ )
224
+ _start_date_time=(
225
+ self.start_date_time
226
+ if hasattr(self, "start_date_time")
227
+ else None
228
+ )
229
+ _stop_date_time=(
230
+ self.stop_date_time
231
+ if hasattr(self, "stop_date_time")
232
+ else None
233
+ )
234
+ _total_energy=(
235
+ self.total_energy
236
+ if hasattr(self, "total_energy")
237
+ else None
238
+ )
239
+ _total_time=(
240
+ self.total_time
241
+ if hasattr(self, "total_time")
242
+ else None
243
+ )
244
+ _total_cost=(
245
+ self.total_cost
246
+ if hasattr(self, "total_cost")
247
+ else None
248
+ )
249
+ _location=(
250
+ self.location
251
+ if hasattr(self, "location")
252
+ else None
253
+ )
254
+ _charging_periods=(
255
+ self.charging_periods
256
+ if hasattr(self, "charging_periods")
257
+ else None
258
+ )
259
+ _tariffs=(
260
+ self.tariffs
261
+ if hasattr(self, "tariffs")
262
+ else None
263
+ )
264
+ _additional_properties=self.additional_properties
265
+ return (
266
+ f"{self.__class__.__name__}("
267
+ f"id={_id!r}, "
268
+ f"vin={_vin!r}, "
269
+ f"model={_model!r}, "
270
+ f"start_date_time={_start_date_time!r}, "
271
+ f"stop_date_time={_stop_date_time!r}, "
272
+ f"total_energy={_total_energy!r}, "
273
+ f"total_time={_total_time!r}, "
274
+ f"total_cost={_total_cost!r}, "
275
+ f"location={_location!r}, "
276
+ f"charging_periods={_charging_periods!r}, "
277
+ f"tariffs={_tariffs!r}, "
278
+ f"additional_properties={_additional_properties!r}, "
279
+ f")"
280
+ )
281
+
282
+ def __str__(self):
283
+ """Return a human-readable string representation."""
284
+ _id=(
285
+ self.id
286
+ if hasattr(self, "id")
287
+ else None
288
+ )
289
+ _vin=(
290
+ self.vin
291
+ if hasattr(self, "vin")
292
+ else None
293
+ )
294
+ _model=(
295
+ self.model
296
+ if hasattr(self, "model")
297
+ else None
298
+ )
299
+ _start_date_time=(
300
+ self.start_date_time
301
+ if hasattr(self, "start_date_time")
302
+ else None
303
+ )
304
+ _stop_date_time=(
305
+ self.stop_date_time
306
+ if hasattr(self, "stop_date_time")
307
+ else None
308
+ )
309
+ _total_energy=(
310
+ self.total_energy
311
+ if hasattr(self, "total_energy")
312
+ else None
313
+ )
314
+ _total_time=(
315
+ self.total_time
316
+ if hasattr(self, "total_time")
317
+ else None
318
+ )
319
+ _total_cost=(
320
+ self.total_cost
321
+ if hasattr(self, "total_cost")
322
+ else None
323
+ )
324
+ _location=(
325
+ self.location
326
+ if hasattr(self, "location")
327
+ else None
328
+ )
329
+ _charging_periods=(
330
+ self.charging_periods
331
+ if hasattr(self, "charging_periods")
332
+ else None
333
+ )
334
+ _tariffs=(
335
+ self.tariffs
336
+ if hasattr(self, "tariffs")
337
+ else None
338
+ )
339
+ _additional_properties=self.additional_properties
340
+ return (
341
+ f"{self.__class__.__name__}("
342
+ f"id={_id!s}, "
343
+ f"vin={_vin!s}, "
344
+ f"model={_model!s}, "
345
+ f"start_date_time={_start_date_time!s}, "
346
+ f"stop_date_time={_stop_date_time!s}, "
347
+ f"total_energy={_total_energy!s}, "
348
+ f"total_time={_total_time!s}, "
349
+ f"total_cost={_total_cost!s}, "
350
+ f"location={_location!s}, "
351
+ f"charging_periods={_charging_periods!s}, "
352
+ f"tariffs={_tariffs!s}, "
353
+ f"additional_properties={_additional_properties!s}, "
354
+ f")"
355
+ )
@@ -0,0 +1,182 @@
1
+ """teslafleetmanagementapi.
2
+
3
+ This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
4
+ """
5
+
6
+ # ruff: noqa: E501
7
+ from teslafleetmanagementapi.api_helper import (
8
+ APIHelper,
9
+ )
10
+ from teslafleetmanagementapi.models.charging_session import (
11
+ ChargingSession,
12
+ )
13
+
14
+
15
+ class ChargingSessionsData(object):
16
+ """Implementation of the 'ChargingSessionsData' model.
17
+
18
+ Attributes:
19
+ data (List[ChargingSession]): The model property of type
20
+ List[ChargingSession].
21
+ status_code (int): The model property of type int.
22
+ status_message (str): The model property of type str.
23
+ timestamp (Dict[str, str]): The model property of type Dict[str, str].
24
+ additional_properties (Dict[str, Any]): The additional properties for the
25
+ model.
26
+
27
+ """
28
+
29
+ # Create a mapping from Model property names to API property names
30
+ _names = {
31
+ "data": "data",
32
+ "status_code": "status_code",
33
+ "status_message": "status_message",
34
+ "timestamp": "timestamp",
35
+ }
36
+
37
+ _optionals = [
38
+ "data",
39
+ "status_code",
40
+ "status_message",
41
+ "timestamp",
42
+ ]
43
+
44
+ def __init__(
45
+ self,
46
+ data=APIHelper.SKIP,
47
+ status_code=APIHelper.SKIP,
48
+ status_message=APIHelper.SKIP,
49
+ timestamp=APIHelper.SKIP,
50
+ additional_properties=None):
51
+ """Initialize a ChargingSessionsData instance."""
52
+ # Initialize members of the class
53
+ if data is not APIHelper.SKIP:
54
+ self.data = data
55
+ if status_code is not APIHelper.SKIP:
56
+ self.status_code = status_code
57
+ if status_message is not APIHelper.SKIP:
58
+ self.status_message = status_message
59
+ if timestamp is not APIHelper.SKIP:
60
+ self.timestamp = timestamp
61
+
62
+ # Add additional model properties to the instance
63
+ if additional_properties is None:
64
+ additional_properties = {}
65
+ self.additional_properties = additional_properties
66
+
67
+ @classmethod
68
+ def from_dictionary(cls,
69
+ dictionary):
70
+ """Create an instance of this model from a dictionary
71
+
72
+ Args:
73
+ dictionary (dictionary): A dictionary representation of the object
74
+ as obtained from the deserialization of the server's response. The
75
+ keys MUST match property names in the API description.
76
+
77
+ Returns:
78
+ object: An instance of this structure class.
79
+
80
+ """
81
+ if not isinstance(dictionary, dict) or dictionary is None:
82
+ return None
83
+
84
+ # Extract variables from the dictionary
85
+ data = None
86
+ if dictionary.get("data") is not None:
87
+ data = [
88
+ ChargingSession.from_dictionary(x)
89
+ for x in dictionary.get("data")
90
+ ]
91
+ else:
92
+ data = APIHelper.SKIP
93
+ status_code =\
94
+ dictionary.get("status_code")\
95
+ if dictionary.get("status_code")\
96
+ else APIHelper.SKIP
97
+ status_message =\
98
+ dictionary.get("status_message")\
99
+ if dictionary.get("status_message")\
100
+ else APIHelper.SKIP
101
+ timestamp =\
102
+ dictionary.get("timestamp")\
103
+ if dictionary.get("timestamp")\
104
+ else APIHelper.SKIP
105
+
106
+ additional_properties = APIHelper.get_additional_properties(
107
+ dictionary={k: v for k, v in dictionary.items()
108
+ if k not in cls._names.values()},
109
+ unboxing_function=lambda value: value)
110
+
111
+ # Return an object of this model
112
+ return cls(data,
113
+ status_code,
114
+ status_message,
115
+ timestamp,
116
+ additional_properties)
117
+
118
+ def __repr__(self):
119
+ """Return a unambiguous string representation."""
120
+ _data=(
121
+ self.data
122
+ if hasattr(self, "data")
123
+ else None
124
+ )
125
+ _status_code=(
126
+ self.status_code
127
+ if hasattr(self, "status_code")
128
+ else None
129
+ )
130
+ _status_message=(
131
+ self.status_message
132
+ if hasattr(self, "status_message")
133
+ else None
134
+ )
135
+ _timestamp=(
136
+ self.timestamp
137
+ if hasattr(self, "timestamp")
138
+ else None
139
+ )
140
+ _additional_properties=self.additional_properties
141
+ return (
142
+ f"{self.__class__.__name__}("
143
+ f"data={_data!r}, "
144
+ f"status_code={_status_code!r}, "
145
+ f"status_message={_status_message!r}, "
146
+ f"timestamp={_timestamp!r}, "
147
+ f"additional_properties={_additional_properties!r}, "
148
+ f")"
149
+ )
150
+
151
+ def __str__(self):
152
+ """Return a human-readable string representation."""
153
+ _data=(
154
+ self.data
155
+ if hasattr(self, "data")
156
+ else None
157
+ )
158
+ _status_code=(
159
+ self.status_code
160
+ if hasattr(self, "status_code")
161
+ else None
162
+ )
163
+ _status_message=(
164
+ self.status_message
165
+ if hasattr(self, "status_message")
166
+ else None
167
+ )
168
+ _timestamp=(
169
+ self.timestamp
170
+ if hasattr(self, "timestamp")
171
+ else None
172
+ )
173
+ _additional_properties=self.additional_properties
174
+ return (
175
+ f"{self.__class__.__name__}("
176
+ f"data={_data!s}, "
177
+ f"status_code={_status_code!s}, "
178
+ f"status_message={_status_message!s}, "
179
+ f"timestamp={_timestamp!s}, "
180
+ f"additional_properties={_additional_properties!s}, "
181
+ f")"
182
+ )
@@ -0,0 +1,96 @@
1
+ """teslafleetmanagementapi.
2
+
3
+ This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
4
+ """
5
+
6
+ # ruff: noqa: E501
7
+ from teslafleetmanagementapi.api_helper import (
8
+ APIHelper,
9
+ )
10
+ from teslafleetmanagementapi.models.charging_sessions_data import (
11
+ ChargingSessionsData,
12
+ )
13
+
14
+
15
+ class ChargingSessionsResponse(object):
16
+ """Implementation of the 'ChargingSessionsResponse' model.
17
+
18
+ Attributes:
19
+ response (ChargingSessionsData): The model property of type
20
+ ChargingSessionsData.
21
+ additional_properties (Dict[str, Any]): The additional properties for the
22
+ model.
23
+
24
+ """
25
+
26
+ # Create a mapping from Model property names to API property names
27
+ _names = {
28
+ "response": "response",
29
+ }
30
+
31
+ def __init__(
32
+ self,
33
+ response=None,
34
+ additional_properties=None):
35
+ """Initialize a ChargingSessionsResponse instance."""
36
+ # Initialize members of the class
37
+ self.response = response
38
+
39
+ # Add additional model properties to the instance
40
+ if additional_properties is None:
41
+ additional_properties = {}
42
+ self.additional_properties = additional_properties
43
+
44
+ @classmethod
45
+ def from_dictionary(cls,
46
+ dictionary):
47
+ """Create an instance of this model from a dictionary
48
+
49
+ Args:
50
+ dictionary (dictionary): A dictionary representation of the object
51
+ as obtained from the deserialization of the server's response. The
52
+ keys MUST match property names in the API description.
53
+
54
+ Returns:
55
+ object: An instance of this structure class.
56
+
57
+ """
58
+ if not isinstance(dictionary, dict) or dictionary is None:
59
+ return None
60
+
61
+ # Extract variables from the dictionary
62
+ response =\
63
+ ChargingSessionsData.from_dictionary(
64
+ dictionary.get("response"))\
65
+ if dictionary.get("response") else None
66
+
67
+ additional_properties = APIHelper.get_additional_properties(
68
+ dictionary={k: v for k, v in dictionary.items()
69
+ if k not in cls._names.values()},
70
+ unboxing_function=lambda value: value)
71
+
72
+ # Return an object of this model
73
+ return cls(response,
74
+ additional_properties)
75
+
76
+ def __repr__(self):
77
+ """Return a unambiguous string representation."""
78
+ _response=self.response
79
+ _additional_properties=self.additional_properties
80
+ return (
81
+ f"{self.__class__.__name__}("
82
+ f"response={_response!r}, "
83
+ f"additional_properties={_additional_properties!r}, "
84
+ f")"
85
+ )
86
+
87
+ def __str__(self):
88
+ """Return a human-readable string representation."""
89
+ _response=self.response
90
+ _additional_properties=self.additional_properties
91
+ return (
92
+ f"{self.__class__.__name__}("
93
+ f"response={_response!s}, "
94
+ f"additional_properties={_additional_properties!s}, "
95
+ f")"
96
+ )
@@ -0,0 +1,45 @@
1
+ """teslafleetmanagementapi.
2
+
3
+ This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
4
+ """
5
+
6
+ # ruff: noqa: E501
7
+
8
+ class DefaultRealMode(object):
9
+ """Implementation of the 'DefaultRealMode' enum.
10
+
11
+ Attributes:
12
+ AUTONOMOUS: The enum member of type str.
13
+ SELF_CONSUMPTION: The enum member of type str.
14
+ additional_properties (Dict[str, Any]): The additional properties for the
15
+ model.
16
+
17
+ """
18
+
19
+ AUTONOMOUS = "autonomous"
20
+
21
+ SELF_CONSUMPTION = "self_consumption"
22
+
23
+ @classmethod
24
+ def from_value(cls, value, default=None):
25
+ """Return the matching enum value for the given input."""
26
+ if value is None:
27
+ return default
28
+
29
+ # If numeric and matches directly
30
+ if isinstance(value, int):
31
+ for name, val in cls.__dict__.items():
32
+ if not name.startswith("_") and val == value:
33
+ return val
34
+
35
+ # If string, perform case-insensitive match
36
+ if isinstance(value, str):
37
+ value_lower = value.lower()
38
+ for name, val in cls.__dict__.items():
39
+ if not name.startswith("_") and (
40
+ name.lower() == value_lower or str(val).lower() == value_lower
41
+ ):
42
+ return val
43
+
44
+ # Fallback to default
45
+ return default