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,289 @@
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
+
11
+
12
+ class Driver(object):
13
+ """Implementation of the 'Driver' model.
14
+
15
+ Attributes:
16
+ my_tesla_unique_id (int): The model property of type int.
17
+ user_id (int): The model property of type int.
18
+ user_id_s (str): The model property of type str.
19
+ vault_uuid (str): The model property of type str.
20
+ driver_first_name (str): The model property of type str.
21
+ driver_last_name (str): The model property of type str.
22
+ granular_access (Any): The model property of type Any.
23
+ active_pubkeys (List[str]): The model property of type List[str].
24
+ public_key (str): The model property of type str.
25
+ additional_properties (Dict[str, Any]): The additional properties for the
26
+ model.
27
+
28
+ """
29
+
30
+ # Create a mapping from Model property names to API property names
31
+ _names = {
32
+ "my_tesla_unique_id": "my_tesla_unique_id",
33
+ "user_id": "user_id",
34
+ "user_id_s": "user_id_s",
35
+ "vault_uuid": "vault_uuid",
36
+ "driver_first_name": "driver_first_name",
37
+ "driver_last_name": "driver_last_name",
38
+ "granular_access": "granular_access",
39
+ "active_pubkeys": "active_pubkeys",
40
+ "public_key": "public_key",
41
+ }
42
+
43
+ _optionals = [
44
+ "my_tesla_unique_id",
45
+ "user_id",
46
+ "user_id_s",
47
+ "vault_uuid",
48
+ "driver_first_name",
49
+ "driver_last_name",
50
+ "granular_access",
51
+ "active_pubkeys",
52
+ "public_key",
53
+ ]
54
+
55
+ def __init__(
56
+ self,
57
+ my_tesla_unique_id=APIHelper.SKIP,
58
+ user_id=APIHelper.SKIP,
59
+ user_id_s=APIHelper.SKIP,
60
+ vault_uuid=APIHelper.SKIP,
61
+ driver_first_name=APIHelper.SKIP,
62
+ driver_last_name=APIHelper.SKIP,
63
+ granular_access=APIHelper.SKIP,
64
+ active_pubkeys=APIHelper.SKIP,
65
+ public_key=APIHelper.SKIP,
66
+ additional_properties=None):
67
+ """Initialize a Driver instance."""
68
+ # Initialize members of the class
69
+ if my_tesla_unique_id is not APIHelper.SKIP:
70
+ self.my_tesla_unique_id = my_tesla_unique_id
71
+ if user_id is not APIHelper.SKIP:
72
+ self.user_id = user_id
73
+ if user_id_s is not APIHelper.SKIP:
74
+ self.user_id_s = user_id_s
75
+ if vault_uuid is not APIHelper.SKIP:
76
+ self.vault_uuid = vault_uuid
77
+ if driver_first_name is not APIHelper.SKIP:
78
+ self.driver_first_name = driver_first_name
79
+ if driver_last_name is not APIHelper.SKIP:
80
+ self.driver_last_name = driver_last_name
81
+ if granular_access is not APIHelper.SKIP:
82
+ self.granular_access = granular_access
83
+ if active_pubkeys is not APIHelper.SKIP:
84
+ self.active_pubkeys = active_pubkeys
85
+ if public_key is not APIHelper.SKIP:
86
+ self.public_key = public_key
87
+
88
+ # Add additional model properties to the instance
89
+ if additional_properties is None:
90
+ additional_properties = {}
91
+ self.additional_properties = additional_properties
92
+
93
+ @classmethod
94
+ def from_dictionary(cls,
95
+ dictionary):
96
+ """Create an instance of this model from a dictionary
97
+
98
+ Args:
99
+ dictionary (dictionary): A dictionary representation of the object
100
+ as obtained from the deserialization of the server's response. The
101
+ keys MUST match property names in the API description.
102
+
103
+ Returns:
104
+ object: An instance of this structure class.
105
+
106
+ """
107
+ if not isinstance(dictionary, dict) or dictionary is None:
108
+ return None
109
+
110
+ # Extract variables from the dictionary
111
+ my_tesla_unique_id =\
112
+ dictionary.get("my_tesla_unique_id")\
113
+ if dictionary.get("my_tesla_unique_id")\
114
+ else APIHelper.SKIP
115
+ user_id =\
116
+ dictionary.get("user_id")\
117
+ if dictionary.get("user_id")\
118
+ else APIHelper.SKIP
119
+ user_id_s =\
120
+ dictionary.get("user_id_s")\
121
+ if dictionary.get("user_id_s")\
122
+ else APIHelper.SKIP
123
+ vault_uuid =\
124
+ dictionary.get("vault_uuid")\
125
+ if dictionary.get("vault_uuid")\
126
+ else APIHelper.SKIP
127
+ driver_first_name =\
128
+ dictionary.get("driver_first_name")\
129
+ if dictionary.get("driver_first_name")\
130
+ else APIHelper.SKIP
131
+ driver_last_name =\
132
+ dictionary.get("driver_last_name")\
133
+ if dictionary.get("driver_last_name")\
134
+ else APIHelper.SKIP
135
+ granular_access =\
136
+ dictionary.get("granular_access")\
137
+ if dictionary.get("granular_access")\
138
+ else APIHelper.SKIP
139
+ active_pubkeys =\
140
+ dictionary.get("active_pubkeys")\
141
+ if dictionary.get("active_pubkeys")\
142
+ else APIHelper.SKIP
143
+ public_key =\
144
+ dictionary.get("public_key")\
145
+ if dictionary.get("public_key")\
146
+ else APIHelper.SKIP
147
+
148
+ additional_properties = APIHelper.get_additional_properties(
149
+ dictionary={k: v for k, v in dictionary.items()
150
+ if k not in cls._names.values()},
151
+ unboxing_function=lambda value: value)
152
+
153
+ # Return an object of this model
154
+ return cls(my_tesla_unique_id,
155
+ user_id,
156
+ user_id_s,
157
+ vault_uuid,
158
+ driver_first_name,
159
+ driver_last_name,
160
+ granular_access,
161
+ active_pubkeys,
162
+ public_key,
163
+ additional_properties)
164
+
165
+ def __repr__(self):
166
+ """Return a unambiguous string representation."""
167
+ _my_tesla_unique_id=(
168
+ self.my_tesla_unique_id
169
+ if hasattr(self, "my_tesla_unique_id")
170
+ else None
171
+ )
172
+ _user_id=(
173
+ self.user_id
174
+ if hasattr(self, "user_id")
175
+ else None
176
+ )
177
+ _user_id_s=(
178
+ self.user_id_s
179
+ if hasattr(self, "user_id_s")
180
+ else None
181
+ )
182
+ _vault_uuid=(
183
+ self.vault_uuid
184
+ if hasattr(self, "vault_uuid")
185
+ else None
186
+ )
187
+ _driver_first_name=(
188
+ self.driver_first_name
189
+ if hasattr(self, "driver_first_name")
190
+ else None
191
+ )
192
+ _driver_last_name=(
193
+ self.driver_last_name
194
+ if hasattr(self, "driver_last_name")
195
+ else None
196
+ )
197
+ _granular_access=(
198
+ self.granular_access
199
+ if hasattr(self, "granular_access")
200
+ else None
201
+ )
202
+ _active_pubkeys=(
203
+ self.active_pubkeys
204
+ if hasattr(self, "active_pubkeys")
205
+ else None
206
+ )
207
+ _public_key=(
208
+ self.public_key
209
+ if hasattr(self, "public_key")
210
+ else None
211
+ )
212
+ _additional_properties=self.additional_properties
213
+ return (
214
+ f"{self.__class__.__name__}("
215
+ f"my_tesla_unique_id={_my_tesla_unique_id!r}, "
216
+ f"user_id={_user_id!r}, "
217
+ f"user_id_s={_user_id_s!r}, "
218
+ f"vault_uuid={_vault_uuid!r}, "
219
+ f"driver_first_name={_driver_first_name!r}, "
220
+ f"driver_last_name={_driver_last_name!r}, "
221
+ f"granular_access={_granular_access!r}, "
222
+ f"active_pubkeys={_active_pubkeys!r}, "
223
+ f"public_key={_public_key!r}, "
224
+ f"additional_properties={_additional_properties!r}, "
225
+ f")"
226
+ )
227
+
228
+ def __str__(self):
229
+ """Return a human-readable string representation."""
230
+ _my_tesla_unique_id=(
231
+ self.my_tesla_unique_id
232
+ if hasattr(self, "my_tesla_unique_id")
233
+ else None
234
+ )
235
+ _user_id=(
236
+ self.user_id
237
+ if hasattr(self, "user_id")
238
+ else None
239
+ )
240
+ _user_id_s=(
241
+ self.user_id_s
242
+ if hasattr(self, "user_id_s")
243
+ else None
244
+ )
245
+ _vault_uuid=(
246
+ self.vault_uuid
247
+ if hasattr(self, "vault_uuid")
248
+ else None
249
+ )
250
+ _driver_first_name=(
251
+ self.driver_first_name
252
+ if hasattr(self, "driver_first_name")
253
+ else None
254
+ )
255
+ _driver_last_name=(
256
+ self.driver_last_name
257
+ if hasattr(self, "driver_last_name")
258
+ else None
259
+ )
260
+ _granular_access=(
261
+ self.granular_access
262
+ if hasattr(self, "granular_access")
263
+ else None
264
+ )
265
+ _active_pubkeys=(
266
+ self.active_pubkeys
267
+ if hasattr(self, "active_pubkeys")
268
+ else None
269
+ )
270
+ _public_key=(
271
+ self.public_key
272
+ if hasattr(self, "public_key")
273
+ else None
274
+ )
275
+ _additional_properties=self.additional_properties
276
+ return (
277
+ f"{self.__class__.__name__}("
278
+ f"my_tesla_unique_id={_my_tesla_unique_id!s}, "
279
+ f"user_id={_user_id!s}, "
280
+ f"user_id_s={_user_id_s!s}, "
281
+ f"vault_uuid={_vault_uuid!s}, "
282
+ f"driver_first_name={_driver_first_name!s}, "
283
+ f"driver_last_name={_driver_last_name!s}, "
284
+ f"granular_access={_granular_access!s}, "
285
+ f"active_pubkeys={_active_pubkeys!s}, "
286
+ f"public_key={_public_key!s}, "
287
+ f"additional_properties={_additional_properties!s}, "
288
+ f")"
289
+ )
@@ -0,0 +1,135 @@
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.driver import (
11
+ Driver,
12
+ )
13
+
14
+
15
+ class DriversResponse(object):
16
+ """Implementation of the 'DriversResponse' model.
17
+
18
+ Attributes:
19
+ response (List[Driver]): The model property of type List[Driver].
20
+ count (int): The model property of type int.
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
+ "count": "count",
30
+ }
31
+
32
+ _optionals = [
33
+ "response",
34
+ "count",
35
+ ]
36
+
37
+ def __init__(
38
+ self,
39
+ response=APIHelper.SKIP,
40
+ count=APIHelper.SKIP,
41
+ additional_properties=None):
42
+ """Initialize a DriversResponse instance."""
43
+ # Initialize members of the class
44
+ if response is not APIHelper.SKIP:
45
+ self.response = response
46
+ if count is not APIHelper.SKIP:
47
+ self.count = count
48
+
49
+ # Add additional model properties to the instance
50
+ if additional_properties is None:
51
+ additional_properties = {}
52
+ self.additional_properties = additional_properties
53
+
54
+ @classmethod
55
+ def from_dictionary(cls,
56
+ dictionary):
57
+ """Create an instance of this model from a dictionary
58
+
59
+ Args:
60
+ dictionary (dictionary): A dictionary representation of the object
61
+ as obtained from the deserialization of the server's response. The
62
+ keys MUST match property names in the API description.
63
+
64
+ Returns:
65
+ object: An instance of this structure class.
66
+
67
+ """
68
+ if not isinstance(dictionary, dict) or dictionary is None:
69
+ return None
70
+
71
+ # Extract variables from the dictionary
72
+ response = None
73
+ if dictionary.get("response") is not None:
74
+ response = [
75
+ Driver.from_dictionary(x)
76
+ for x in dictionary.get("response")
77
+ ]
78
+ else:
79
+ response = APIHelper.SKIP
80
+ count =\
81
+ dictionary.get("count")\
82
+ if dictionary.get("count")\
83
+ else APIHelper.SKIP
84
+
85
+ additional_properties = APIHelper.get_additional_properties(
86
+ dictionary={k: v for k, v in dictionary.items()
87
+ if k not in cls._names.values()},
88
+ unboxing_function=lambda value: value)
89
+
90
+ # Return an object of this model
91
+ return cls(response,
92
+ count,
93
+ additional_properties)
94
+
95
+ def __repr__(self):
96
+ """Return a unambiguous string representation."""
97
+ _response=(
98
+ self.response
99
+ if hasattr(self, "response")
100
+ else None
101
+ )
102
+ _count=(
103
+ self.count
104
+ if hasattr(self, "count")
105
+ else None
106
+ )
107
+ _additional_properties=self.additional_properties
108
+ return (
109
+ f"{self.__class__.__name__}("
110
+ f"response={_response!r}, "
111
+ f"count={_count!r}, "
112
+ f"additional_properties={_additional_properties!r}, "
113
+ f")"
114
+ )
115
+
116
+ def __str__(self):
117
+ """Return a human-readable string representation."""
118
+ _response=(
119
+ self.response
120
+ if hasattr(self, "response")
121
+ else None
122
+ )
123
+ _count=(
124
+ self.count
125
+ if hasattr(self, "count")
126
+ else None
127
+ )
128
+ _additional_properties=self.additional_properties
129
+ return (
130
+ f"{self.__class__.__name__}("
131
+ f"response={_response!s}, "
132
+ f"count={_count!s}, "
133
+ f"additional_properties={_additional_properties!s}, "
134
+ f")"
135
+ )
@@ -0,0 +1,141 @@
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
+
11
+
12
+ class EnterprisePayerRequest(object):
13
+ """Implementation of the 'EnterprisePayerRequest' model.
14
+
15
+ Attributes:
16
+ role (str): The model property of type str.
17
+ federation_id (str): The model property of type str.
18
+ account_id (str): The model property of type str.
19
+ additional_properties (Dict[str, Any]): The additional properties for the
20
+ model.
21
+
22
+ """
23
+
24
+ # Create a mapping from Model property names to API property names
25
+ _names = {
26
+ "role": "role",
27
+ "federation_id": "federation_id",
28
+ "account_id": "account_id",
29
+ }
30
+
31
+ _optionals = [
32
+ "federation_id",
33
+ "account_id",
34
+ ]
35
+
36
+ def __init__(
37
+ self,
38
+ role=None,
39
+ federation_id=APIHelper.SKIP,
40
+ account_id=APIHelper.SKIP,
41
+ additional_properties=None):
42
+ """Initialize a EnterprisePayerRequest instance."""
43
+ # Initialize members of the class
44
+ self.role = role
45
+ if federation_id is not APIHelper.SKIP:
46
+ self.federation_id = federation_id
47
+ if account_id is not APIHelper.SKIP:
48
+ self.account_id = account_id
49
+
50
+ # Add additional model properties to the instance
51
+ if additional_properties is None:
52
+ additional_properties = {}
53
+ self.additional_properties = additional_properties
54
+
55
+ @classmethod
56
+ def from_dictionary(cls,
57
+ dictionary):
58
+ """Create an instance of this model from a dictionary
59
+
60
+ Args:
61
+ dictionary (dictionary): A dictionary representation of the object
62
+ as obtained from the deserialization of the server's response. The
63
+ keys MUST match property names in the API description.
64
+
65
+ Returns:
66
+ object: An instance of this structure class.
67
+
68
+ """
69
+ if not isinstance(dictionary, dict) or dictionary is None:
70
+ return None
71
+
72
+ # Extract variables from the dictionary
73
+ role =\
74
+ dictionary.get("role")\
75
+ if dictionary.get("role")\
76
+ else None
77
+ federation_id =\
78
+ dictionary.get("federation_id")\
79
+ if dictionary.get("federation_id")\
80
+ else APIHelper.SKIP
81
+ account_id =\
82
+ dictionary.get("account_id")\
83
+ if dictionary.get("account_id")\
84
+ else APIHelper.SKIP
85
+
86
+ additional_properties = APIHelper.get_additional_properties(
87
+ dictionary={k: v for k, v in dictionary.items()
88
+ if k not in cls._names.values()},
89
+ unboxing_function=lambda value: value)
90
+
91
+ # Return an object of this model
92
+ return cls(role,
93
+ federation_id,
94
+ account_id,
95
+ additional_properties)
96
+
97
+ def __repr__(self):
98
+ """Return a unambiguous string representation."""
99
+ _role=self.role
100
+ _federation_id=(
101
+ self.federation_id
102
+ if hasattr(self, "federation_id")
103
+ else None
104
+ )
105
+ _account_id=(
106
+ self.account_id
107
+ if hasattr(self, "account_id")
108
+ else None
109
+ )
110
+ _additional_properties=self.additional_properties
111
+ return (
112
+ f"{self.__class__.__name__}("
113
+ f"role={_role!r}, "
114
+ f"federation_id={_federation_id!r}, "
115
+ f"account_id={_account_id!r}, "
116
+ f"additional_properties={_additional_properties!r}, "
117
+ f")"
118
+ )
119
+
120
+ def __str__(self):
121
+ """Return a human-readable string representation."""
122
+ _role=self.role
123
+ _federation_id=(
124
+ self.federation_id
125
+ if hasattr(self, "federation_id")
126
+ else None
127
+ )
128
+ _account_id=(
129
+ self.account_id
130
+ if hasattr(self, "account_id")
131
+ else None
132
+ )
133
+ _additional_properties=self.additional_properties
134
+ return (
135
+ f"{self.__class__.__name__}("
136
+ f"role={_role!s}, "
137
+ f"federation_id={_federation_id!s}, "
138
+ f"account_id={_account_id!s}, "
139
+ f"additional_properties={_additional_properties!s}, "
140
+ f")"
141
+ )
@@ -0,0 +1,107 @@
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
+
11
+
12
+ class Event(object):
13
+ """Implementation of the 'Event' model.
14
+
15
+ Attributes:
16
+ timestamp (datetime): The model property of type datetime.
17
+ duration (int): The model property of type int.
18
+ additional_properties (Dict[str, Any]): The additional properties for the
19
+ model.
20
+
21
+ """
22
+
23
+ # Create a mapping from Model property names to API property names
24
+ _names = {
25
+ "timestamp": "timestamp",
26
+ "duration": "duration",
27
+ }
28
+
29
+ def __init__(
30
+ self,
31
+ timestamp=None,
32
+ duration=None,
33
+ additional_properties=None):
34
+ """Initialize a Event instance."""
35
+ # Initialize members of the class
36
+ self.timestamp =\
37
+ APIHelper.apply_datetime_converter(
38
+ timestamp, APIHelper.RFC3339DateTime)\
39
+ if timestamp else None
40
+ self.duration = duration
41
+
42
+ # Add additional model properties to the instance
43
+ if additional_properties is None:
44
+ additional_properties = {}
45
+ self.additional_properties = additional_properties
46
+
47
+ @classmethod
48
+ def from_dictionary(cls,
49
+ dictionary):
50
+ """Create an instance of this model from a dictionary
51
+
52
+ Args:
53
+ dictionary (dictionary): A dictionary representation of the object
54
+ as obtained from the deserialization of the server's response. The
55
+ keys MUST match property names in the API description.
56
+
57
+ Returns:
58
+ object: An instance of this structure class.
59
+
60
+ """
61
+ if not isinstance(dictionary, dict) or dictionary is None:
62
+ return None
63
+
64
+ # Extract variables from the dictionary
65
+ timestamp = APIHelper.RFC3339DateTime.from_value(
66
+ dictionary.get("timestamp")).datetime\
67
+ if dictionary.get("timestamp") else None
68
+ duration =\
69
+ dictionary.get("duration")\
70
+ if dictionary.get("duration")\
71
+ else None
72
+
73
+ additional_properties = APIHelper.get_additional_properties(
74
+ dictionary={k: v for k, v in dictionary.items()
75
+ if k not in cls._names.values()},
76
+ unboxing_function=lambda value: value)
77
+
78
+ # Return an object of this model
79
+ return cls(timestamp,
80
+ duration,
81
+ additional_properties)
82
+
83
+ def __repr__(self):
84
+ """Return a unambiguous string representation."""
85
+ _timestamp=self.timestamp
86
+ _duration=self.duration
87
+ _additional_properties=self.additional_properties
88
+ return (
89
+ f"{self.__class__.__name__}("
90
+ f"timestamp={_timestamp!r}, "
91
+ f"duration={_duration!r}, "
92
+ f"additional_properties={_additional_properties!r}, "
93
+ f")"
94
+ )
95
+
96
+ def __str__(self):
97
+ """Return a human-readable string representation."""
98
+ _timestamp=self.timestamp
99
+ _duration=self.duration
100
+ _additional_properties=self.additional_properties
101
+ return (
102
+ f"{self.__class__.__name__}("
103
+ f"timestamp={_timestamp!s}, "
104
+ f"duration={_duration!s}, "
105
+ f"additional_properties={_additional_properties!s}, "
106
+ f")"
107
+ )