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.
- tesla_api_sdk-1.0.0.dist-info/METADATA +145 -0
- tesla_api_sdk-1.0.0.dist-info/RECORD +119 -0
- tesla_api_sdk-1.0.0.dist-info/WHEEL +5 -0
- tesla_api_sdk-1.0.0.dist-info/licenses/LICENSE +28 -0
- tesla_api_sdk-1.0.0.dist-info/top_level.txt +1 -0
- teslafleetmanagementapi/__init__.py +13 -0
- teslafleetmanagementapi/api_helper.py +19 -0
- teslafleetmanagementapi/configuration.py +270 -0
- teslafleetmanagementapi/controllers/__init__.py +11 -0
- teslafleetmanagementapi/controllers/base_controller.py +70 -0
- teslafleetmanagementapi/controllers/charging_controller.py +140 -0
- teslafleetmanagementapi/controllers/energy_controller.py +572 -0
- teslafleetmanagementapi/controllers/oauth_authorization_controller.py +165 -0
- teslafleetmanagementapi/controllers/partner_controller.py +181 -0
- teslafleetmanagementapi/controllers/user_controller.py +158 -0
- teslafleetmanagementapi/controllers/vehicles_controller.py +832 -0
- teslafleetmanagementapi/exceptions/__init__.py +6 -0
- teslafleetmanagementapi/exceptions/api_exception.py +36 -0
- teslafleetmanagementapi/exceptions/oauth_provider_exception.py +75 -0
- teslafleetmanagementapi/http/__init__.py +11 -0
- teslafleetmanagementapi/http/api_response.py +67 -0
- teslafleetmanagementapi/http/auth/__init__.py +6 -0
- teslafleetmanagementapi/http/auth/bearer_auth.py +103 -0
- teslafleetmanagementapi/http/auth/oauth_2.py +311 -0
- teslafleetmanagementapi/http/http_call_back.py +20 -0
- teslafleetmanagementapi/http/http_client_provider.py +23 -0
- teslafleetmanagementapi/http/http_method_enum.py +25 -0
- teslafleetmanagementapi/http/http_request.py +55 -0
- teslafleetmanagementapi/http/http_response.py +45 -0
- teslafleetmanagementapi/http/proxy_settings.py +50 -0
- teslafleetmanagementapi/logging/__init__.py +6 -0
- teslafleetmanagementapi/logging/configuration/__init__.py +5 -0
- teslafleetmanagementapi/logging/configuration/api_logging_configuration.py +398 -0
- teslafleetmanagementapi/logging/sdk_logger.py +28 -0
- teslafleetmanagementapi/models/__init__.py +85 -0
- teslafleetmanagementapi/models/api_1_dx_vehicles_options_response.py +110 -0
- teslafleetmanagementapi/models/api_1_dx_warranty_details_response.py +110 -0
- teslafleetmanagementapi/models/api_1_vehicles_mobile_enabled_response.py +109 -0
- teslafleetmanagementapi/models/api_1_vehicles_nearby_charging_sites_response.py +109 -0
- teslafleetmanagementapi/models/api_1_vehicles_response.py +162 -0
- teslafleetmanagementapi/models/api_1_vehicles_response_get_vehicle.py +109 -0
- teslafleetmanagementapi/models/api_1_vehicles_wake_up_response.py +109 -0
- teslafleetmanagementapi/models/backup_request.py +92 -0
- teslafleetmanagementapi/models/backup_response.py +95 -0
- teslafleetmanagementapi/models/calendar_history_response.py +96 -0
- teslafleetmanagementapi/models/charge_duration.py +92 -0
- teslafleetmanagementapi/models/charge_history.py +125 -0
- teslafleetmanagementapi/models/charge_history_response.py +96 -0
- teslafleetmanagementapi/models/charge_start_time.py +92 -0
- teslafleetmanagementapi/models/charging_dimension.py +128 -0
- teslafleetmanagementapi/models/charging_fee.py +641 -0
- teslafleetmanagementapi/models/charging_history_data.py +98 -0
- teslafleetmanagementapi/models/charging_history_item.py +336 -0
- teslafleetmanagementapi/models/charging_history_response.py +96 -0
- teslafleetmanagementapi/models/charging_invoice.py +151 -0
- teslafleetmanagementapi/models/charging_location.py +293 -0
- teslafleetmanagementapi/models/charging_period.py +136 -0
- teslafleetmanagementapi/models/charging_session.py +355 -0
- teslafleetmanagementapi/models/charging_sessions_data.py +182 -0
- teslafleetmanagementapi/models/charging_sessions_response.py +96 -0
- teslafleetmanagementapi/models/default_real_mode.py +45 -0
- teslafleetmanagementapi/models/driver.py +289 -0
- teslafleetmanagementapi/models/drivers_response.py +135 -0
- teslafleetmanagementapi/models/enterprise_payer_request.py +141 -0
- teslafleetmanagementapi/models/event.py +107 -0
- teslafleetmanagementapi/models/fleet_status_request.py +105 -0
- teslafleetmanagementapi/models/fleet_telemetry_error.py +118 -0
- teslafleetmanagementapi/models/fleet_telemetry_errors_response.py +96 -0
- teslafleetmanagementapi/models/fleet_telemetry_jws_request.py +128 -0
- teslafleetmanagementapi/models/generic_update_response.py +95 -0
- teslafleetmanagementapi/models/kind.py +45 -0
- teslafleetmanagementapi/models/kind_get_wall_connector_charging_history.py +42 -0
- teslafleetmanagementapi/models/live_status_response.py +96 -0
- teslafleetmanagementapi/models/location.py +128 -0
- teslafleetmanagementapi/models/location_1.py +128 -0
- teslafleetmanagementapi/models/me_response.py +95 -0
- teslafleetmanagementapi/models/mobile_enabled.py +128 -0
- teslafleetmanagementapi/models/oauth_provider_error.py +67 -0
- teslafleetmanagementapi/models/oauth_token.py +115 -0
- teslafleetmanagementapi/models/off_grid_vehicle_charging_reserve_request.py +95 -0
- teslafleetmanagementapi/models/operation_request.py +93 -0
- teslafleetmanagementapi/models/orders_response.py +111 -0
- teslafleetmanagementapi/models/pagination.py +225 -0
- teslafleetmanagementapi/models/price_component.py +151 -0
- teslafleetmanagementapi/models/products_response.py +128 -0
- teslafleetmanagementapi/models/public_key_response.py +96 -0
- teslafleetmanagementapi/models/region_response.py +96 -0
- teslafleetmanagementapi/models/register_partner_request.py +92 -0
- teslafleetmanagementapi/models/register_partner_response.py +96 -0
- teslafleetmanagementapi/models/response.py +105 -0
- teslafleetmanagementapi/models/response_1.py +92 -0
- teslafleetmanagementapi/models/response_2.py +95 -0
- teslafleetmanagementapi/models/response_3.py +164 -0
- teslafleetmanagementapi/models/response_api_1_dx_vehicles_options_response.py +112 -0
- teslafleetmanagementapi/models/response_api_1_dx_warranty_details_response.py +169 -0
- teslafleetmanagementapi/models/response_calendar_history_response.py +110 -0
- teslafleetmanagementapi/models/response_charge_history_response.py +98 -0
- teslafleetmanagementapi/models/response_fleet_telemetry_errors_response.py +98 -0
- teslafleetmanagementapi/models/response_live_status_response.py +310 -0
- teslafleetmanagementapi/models/response_me_response.py +131 -0
- teslafleetmanagementapi/models/response_orders_response.py +209 -0
- teslafleetmanagementapi/models/response_public_key_response.py +92 -0
- teslafleetmanagementapi/models/response_region_response.py +105 -0
- teslafleetmanagementapi/models/response_register_partner_response.py +331 -0
- teslafleetmanagementapi/models/signaling.py +118 -0
- teslafleetmanagementapi/models/simple_ok_response.py +105 -0
- teslafleetmanagementapi/models/site_info_response.py +105 -0
- teslafleetmanagementapi/models/storm_mode_request.py +92 -0
- teslafleetmanagementapi/models/tariff_element.py +136 -0
- teslafleetmanagementapi/models/tariffs.py +136 -0
- teslafleetmanagementapi/models/time_of_use_settings_request.py +95 -0
- teslafleetmanagementapi/models/total_cost.py +151 -0
- teslafleetmanagementapi/models/tou_settings.py +105 -0
- teslafleetmanagementapi/models/vehicle_base.py +266 -0
- teslafleetmanagementapi/models/vehicle_option.py +178 -0
- teslafleetmanagementapi/models/warranty_item.py +249 -0
- teslafleetmanagementapi/teslafleetmanagementapi_client.py +128 -0
- teslafleetmanagementapi/utilities/__init__.py +6 -0
- teslafleetmanagementapi/utilities/file_wrapper.py +45 -0
|
@@ -0,0 +1,105 @@
|
|
|
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 FleetStatusRequest(object):
|
|
13
|
+
"""Implementation of the 'FleetStatusRequest' model.
|
|
14
|
+
|
|
15
|
+
Attributes:
|
|
16
|
+
vins (List[str]): The model property of type List[str].
|
|
17
|
+
additional_properties (Dict[str, Any]): The additional properties for the
|
|
18
|
+
model.
|
|
19
|
+
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
# Create a mapping from Model property names to API property names
|
|
23
|
+
_names = {
|
|
24
|
+
"vins": "vins",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
_optionals = [
|
|
28
|
+
"vins",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
def __init__(
|
|
32
|
+
self,
|
|
33
|
+
vins=APIHelper.SKIP,
|
|
34
|
+
additional_properties=None):
|
|
35
|
+
"""Initialize a FleetStatusRequest instance."""
|
|
36
|
+
# Initialize members of the class
|
|
37
|
+
if vins is not APIHelper.SKIP:
|
|
38
|
+
self.vins = vins
|
|
39
|
+
|
|
40
|
+
# Add additional model properties to the instance
|
|
41
|
+
if additional_properties is None:
|
|
42
|
+
additional_properties = {}
|
|
43
|
+
self.additional_properties = additional_properties
|
|
44
|
+
|
|
45
|
+
@classmethod
|
|
46
|
+
def from_dictionary(cls,
|
|
47
|
+
dictionary):
|
|
48
|
+
"""Create an instance of this model from a dictionary
|
|
49
|
+
|
|
50
|
+
Args:
|
|
51
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
52
|
+
as obtained from the deserialization of the server's response. The
|
|
53
|
+
keys MUST match property names in the API description.
|
|
54
|
+
|
|
55
|
+
Returns:
|
|
56
|
+
object: An instance of this structure class.
|
|
57
|
+
|
|
58
|
+
"""
|
|
59
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
60
|
+
return None
|
|
61
|
+
|
|
62
|
+
# Extract variables from the dictionary
|
|
63
|
+
vins =\
|
|
64
|
+
dictionary.get("vins")\
|
|
65
|
+
if dictionary.get("vins")\
|
|
66
|
+
else APIHelper.SKIP
|
|
67
|
+
|
|
68
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
69
|
+
dictionary={k: v for k, v in dictionary.items()
|
|
70
|
+
if k not in cls._names.values()},
|
|
71
|
+
unboxing_function=lambda value: value)
|
|
72
|
+
|
|
73
|
+
# Return an object of this model
|
|
74
|
+
return cls(vins,
|
|
75
|
+
additional_properties)
|
|
76
|
+
|
|
77
|
+
def __repr__(self):
|
|
78
|
+
"""Return a unambiguous string representation."""
|
|
79
|
+
_vins=(
|
|
80
|
+
self.vins
|
|
81
|
+
if hasattr(self, "vins")
|
|
82
|
+
else None
|
|
83
|
+
)
|
|
84
|
+
_additional_properties=self.additional_properties
|
|
85
|
+
return (
|
|
86
|
+
f"{self.__class__.__name__}("
|
|
87
|
+
f"vins={_vins!r}, "
|
|
88
|
+
f"additional_properties={_additional_properties!r}, "
|
|
89
|
+
f")"
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
def __str__(self):
|
|
93
|
+
"""Return a human-readable string representation."""
|
|
94
|
+
_vins=(
|
|
95
|
+
self.vins
|
|
96
|
+
if hasattr(self, "vins")
|
|
97
|
+
else None
|
|
98
|
+
)
|
|
99
|
+
_additional_properties=self.additional_properties
|
|
100
|
+
return (
|
|
101
|
+
f"{self.__class__.__name__}("
|
|
102
|
+
f"vins={_vins!s}, "
|
|
103
|
+
f"additional_properties={_additional_properties!s}, "
|
|
104
|
+
f")"
|
|
105
|
+
)
|
|
@@ -0,0 +1,118 @@
|
|
|
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 FleetTelemetryError(object):
|
|
13
|
+
"""Implementation of the 'FleetTelemetryError' model.
|
|
14
|
+
|
|
15
|
+
Attributes:
|
|
16
|
+
name (str): The model property of type str.
|
|
17
|
+
error (str): The model property of type str.
|
|
18
|
+
vin (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
|
+
"name": "name",
|
|
27
|
+
"error": "error",
|
|
28
|
+
"vin": "vin",
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
def __init__(
|
|
32
|
+
self,
|
|
33
|
+
name=None,
|
|
34
|
+
error=None,
|
|
35
|
+
vin=None,
|
|
36
|
+
additional_properties=None):
|
|
37
|
+
"""Initialize a FleetTelemetryError instance."""
|
|
38
|
+
# Initialize members of the class
|
|
39
|
+
self.name = name
|
|
40
|
+
self.error = error
|
|
41
|
+
self.vin = vin
|
|
42
|
+
|
|
43
|
+
# Add additional model properties to the instance
|
|
44
|
+
if additional_properties is None:
|
|
45
|
+
additional_properties = {}
|
|
46
|
+
self.additional_properties = additional_properties
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_dictionary(cls,
|
|
50
|
+
dictionary):
|
|
51
|
+
"""Create an instance of this model from a dictionary
|
|
52
|
+
|
|
53
|
+
Args:
|
|
54
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
55
|
+
as obtained from the deserialization of the server's response. The
|
|
56
|
+
keys MUST match property names in the API description.
|
|
57
|
+
|
|
58
|
+
Returns:
|
|
59
|
+
object: An instance of this structure class.
|
|
60
|
+
|
|
61
|
+
"""
|
|
62
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
63
|
+
return None
|
|
64
|
+
|
|
65
|
+
# Extract variables from the dictionary
|
|
66
|
+
name =\
|
|
67
|
+
dictionary.get("name")\
|
|
68
|
+
if dictionary.get("name")\
|
|
69
|
+
else None
|
|
70
|
+
error =\
|
|
71
|
+
dictionary.get("error")\
|
|
72
|
+
if dictionary.get("error")\
|
|
73
|
+
else None
|
|
74
|
+
vin =\
|
|
75
|
+
dictionary.get("vin")\
|
|
76
|
+
if dictionary.get("vin")\
|
|
77
|
+
else None
|
|
78
|
+
|
|
79
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
80
|
+
dictionary={k: v for k, v in dictionary.items()
|
|
81
|
+
if k not in cls._names.values()},
|
|
82
|
+
unboxing_function=lambda value: value)
|
|
83
|
+
|
|
84
|
+
# Return an object of this model
|
|
85
|
+
return cls(name,
|
|
86
|
+
error,
|
|
87
|
+
vin,
|
|
88
|
+
additional_properties)
|
|
89
|
+
|
|
90
|
+
def __repr__(self):
|
|
91
|
+
"""Return a unambiguous string representation."""
|
|
92
|
+
_name=self.name
|
|
93
|
+
_error=self.error
|
|
94
|
+
_vin=self.vin
|
|
95
|
+
_additional_properties=self.additional_properties
|
|
96
|
+
return (
|
|
97
|
+
f"{self.__class__.__name__}("
|
|
98
|
+
f"name={_name!r}, "
|
|
99
|
+
f"error={_error!r}, "
|
|
100
|
+
f"vin={_vin!r}, "
|
|
101
|
+
f"additional_properties={_additional_properties!r}, "
|
|
102
|
+
f")"
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
def __str__(self):
|
|
106
|
+
"""Return a human-readable string representation."""
|
|
107
|
+
_name=self.name
|
|
108
|
+
_error=self.error
|
|
109
|
+
_vin=self.vin
|
|
110
|
+
_additional_properties=self.additional_properties
|
|
111
|
+
return (
|
|
112
|
+
f"{self.__class__.__name__}("
|
|
113
|
+
f"name={_name!s}, "
|
|
114
|
+
f"error={_error!s}, "
|
|
115
|
+
f"vin={_vin!s}, "
|
|
116
|
+
f"additional_properties={_additional_properties!s}, "
|
|
117
|
+
f")"
|
|
118
|
+
)
|
|
@@ -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.response_fleet_telemetry_errors_response import (
|
|
11
|
+
ResponseFleetTelemetryErrorsResponse,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class FleetTelemetryErrorsResponse(object):
|
|
16
|
+
"""Implementation of the 'FleetTelemetryErrorsResponse' model.
|
|
17
|
+
|
|
18
|
+
Attributes:
|
|
19
|
+
response (ResponseFleetTelemetryErrorsResponse): The model property of type
|
|
20
|
+
ResponseFleetTelemetryErrorsResponse.
|
|
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 FleetTelemetryErrorsResponse 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
|
+
ResponseFleetTelemetryErrorsResponse.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,128 @@
|
|
|
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 FleetTelemetryJwsRequest(object):
|
|
13
|
+
"""Implementation of the 'FleetTelemetryJwsRequest' model.
|
|
14
|
+
|
|
15
|
+
Attributes:
|
|
16
|
+
token (str): The model property of type str.
|
|
17
|
+
vins (List[str]): The model property of type List[str].
|
|
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
|
+
"token": "token",
|
|
26
|
+
"vins": "vins",
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
_optionals = [
|
|
30
|
+
"token",
|
|
31
|
+
"vins",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
def __init__(
|
|
35
|
+
self,
|
|
36
|
+
token=APIHelper.SKIP,
|
|
37
|
+
vins=APIHelper.SKIP,
|
|
38
|
+
additional_properties=None):
|
|
39
|
+
"""Initialize a FleetTelemetryJwsRequest instance."""
|
|
40
|
+
# Initialize members of the class
|
|
41
|
+
if token is not APIHelper.SKIP:
|
|
42
|
+
self.token = token
|
|
43
|
+
if vins is not APIHelper.SKIP:
|
|
44
|
+
self.vins = vins
|
|
45
|
+
|
|
46
|
+
# Add additional model properties to the instance
|
|
47
|
+
if additional_properties is None:
|
|
48
|
+
additional_properties = {}
|
|
49
|
+
self.additional_properties = additional_properties
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_dictionary(cls,
|
|
53
|
+
dictionary):
|
|
54
|
+
"""Create an instance of this model from a dictionary
|
|
55
|
+
|
|
56
|
+
Args:
|
|
57
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
58
|
+
as obtained from the deserialization of the server's response. The
|
|
59
|
+
keys MUST match property names in the API description.
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
object: An instance of this structure class.
|
|
63
|
+
|
|
64
|
+
"""
|
|
65
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
66
|
+
return None
|
|
67
|
+
|
|
68
|
+
# Extract variables from the dictionary
|
|
69
|
+
token =\
|
|
70
|
+
dictionary.get("token")\
|
|
71
|
+
if dictionary.get("token")\
|
|
72
|
+
else APIHelper.SKIP
|
|
73
|
+
vins =\
|
|
74
|
+
dictionary.get("vins")\
|
|
75
|
+
if dictionary.get("vins")\
|
|
76
|
+
else APIHelper.SKIP
|
|
77
|
+
|
|
78
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
79
|
+
dictionary={k: v for k, v in dictionary.items()
|
|
80
|
+
if k not in cls._names.values()},
|
|
81
|
+
unboxing_function=lambda value: value)
|
|
82
|
+
|
|
83
|
+
# Return an object of this model
|
|
84
|
+
return cls(token,
|
|
85
|
+
vins,
|
|
86
|
+
additional_properties)
|
|
87
|
+
|
|
88
|
+
def __repr__(self):
|
|
89
|
+
"""Return a unambiguous string representation."""
|
|
90
|
+
_token=(
|
|
91
|
+
self.token
|
|
92
|
+
if hasattr(self, "token")
|
|
93
|
+
else None
|
|
94
|
+
)
|
|
95
|
+
_vins=(
|
|
96
|
+
self.vins
|
|
97
|
+
if hasattr(self, "vins")
|
|
98
|
+
else None
|
|
99
|
+
)
|
|
100
|
+
_additional_properties=self.additional_properties
|
|
101
|
+
return (
|
|
102
|
+
f"{self.__class__.__name__}("
|
|
103
|
+
f"token={_token!r}, "
|
|
104
|
+
f"vins={_vins!r}, "
|
|
105
|
+
f"additional_properties={_additional_properties!r}, "
|
|
106
|
+
f")"
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
def __str__(self):
|
|
110
|
+
"""Return a human-readable string representation."""
|
|
111
|
+
_token=(
|
|
112
|
+
self.token
|
|
113
|
+
if hasattr(self, "token")
|
|
114
|
+
else None
|
|
115
|
+
)
|
|
116
|
+
_vins=(
|
|
117
|
+
self.vins
|
|
118
|
+
if hasattr(self, "vins")
|
|
119
|
+
else None
|
|
120
|
+
)
|
|
121
|
+
_additional_properties=self.additional_properties
|
|
122
|
+
return (
|
|
123
|
+
f"{self.__class__.__name__}("
|
|
124
|
+
f"token={_token!s}, "
|
|
125
|
+
f"vins={_vins!s}, "
|
|
126
|
+
f"additional_properties={_additional_properties!s}, "
|
|
127
|
+
f")"
|
|
128
|
+
)
|
|
@@ -0,0 +1,95 @@
|
|
|
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.response import (
|
|
11
|
+
Response,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class GenericUpdateResponse(object):
|
|
16
|
+
"""Implementation of the 'GenericUpdateResponse' model.
|
|
17
|
+
|
|
18
|
+
Attributes:
|
|
19
|
+
response (Response): The model property of type Response.
|
|
20
|
+
additional_properties (Dict[str, Any]): The additional properties for the
|
|
21
|
+
model.
|
|
22
|
+
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
# Create a mapping from Model property names to API property names
|
|
26
|
+
_names = {
|
|
27
|
+
"response": "response",
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
def __init__(
|
|
31
|
+
self,
|
|
32
|
+
response=None,
|
|
33
|
+
additional_properties=None):
|
|
34
|
+
"""Initialize a GenericUpdateResponse instance."""
|
|
35
|
+
# Initialize members of the class
|
|
36
|
+
self.response = response
|
|
37
|
+
|
|
38
|
+
# Add additional model properties to the instance
|
|
39
|
+
if additional_properties is None:
|
|
40
|
+
additional_properties = {}
|
|
41
|
+
self.additional_properties = additional_properties
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def from_dictionary(cls,
|
|
45
|
+
dictionary):
|
|
46
|
+
"""Create an instance of this model from a dictionary
|
|
47
|
+
|
|
48
|
+
Args:
|
|
49
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
50
|
+
as obtained from the deserialization of the server's response. The
|
|
51
|
+
keys MUST match property names in the API description.
|
|
52
|
+
|
|
53
|
+
Returns:
|
|
54
|
+
object: An instance of this structure class.
|
|
55
|
+
|
|
56
|
+
"""
|
|
57
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
58
|
+
return None
|
|
59
|
+
|
|
60
|
+
# Extract variables from the dictionary
|
|
61
|
+
response =\
|
|
62
|
+
Response.from_dictionary(
|
|
63
|
+
dictionary.get("response"))\
|
|
64
|
+
if dictionary.get("response") else None
|
|
65
|
+
|
|
66
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
67
|
+
dictionary={k: v for k, v in dictionary.items()
|
|
68
|
+
if k not in cls._names.values()},
|
|
69
|
+
unboxing_function=lambda value: value)
|
|
70
|
+
|
|
71
|
+
# Return an object of this model
|
|
72
|
+
return cls(response,
|
|
73
|
+
additional_properties)
|
|
74
|
+
|
|
75
|
+
def __repr__(self):
|
|
76
|
+
"""Return a unambiguous string representation."""
|
|
77
|
+
_response=self.response
|
|
78
|
+
_additional_properties=self.additional_properties
|
|
79
|
+
return (
|
|
80
|
+
f"{self.__class__.__name__}("
|
|
81
|
+
f"response={_response!r}, "
|
|
82
|
+
f"additional_properties={_additional_properties!r}, "
|
|
83
|
+
f")"
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
def __str__(self):
|
|
87
|
+
"""Return a human-readable string representation."""
|
|
88
|
+
_response=self.response
|
|
89
|
+
_additional_properties=self.additional_properties
|
|
90
|
+
return (
|
|
91
|
+
f"{self.__class__.__name__}("
|
|
92
|
+
f"response={_response!s}, "
|
|
93
|
+
f"additional_properties={_additional_properties!s}, "
|
|
94
|
+
f")"
|
|
95
|
+
)
|
|
@@ -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 Kind(object):
|
|
9
|
+
"""Implementation of the 'kind' enum.
|
|
10
|
+
|
|
11
|
+
Attributes:
|
|
12
|
+
BACKUP: The enum member of type str.
|
|
13
|
+
ENERGY: The enum member of type str.
|
|
14
|
+
additional_properties (Dict[str, Any]): The additional properties for the
|
|
15
|
+
model.
|
|
16
|
+
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
BACKUP = "backup"
|
|
20
|
+
|
|
21
|
+
ENERGY = "energy"
|
|
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
|
|
@@ -0,0 +1,42 @@
|
|
|
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 KindGetWallConnectorChargingHistory(object):
|
|
9
|
+
"""Implementation of the 'kind_Get wall connector charging history' enum.
|
|
10
|
+
|
|
11
|
+
Attributes:
|
|
12
|
+
CHARGE: The enum member of type str.
|
|
13
|
+
additional_properties (Dict[str, Any]): The additional properties for the
|
|
14
|
+
model.
|
|
15
|
+
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
CHARGE = "charge"
|
|
19
|
+
|
|
20
|
+
@classmethod
|
|
21
|
+
def from_value(cls, value, default=None):
|
|
22
|
+
"""Return the matching enum value for the given input."""
|
|
23
|
+
if value is None:
|
|
24
|
+
return default
|
|
25
|
+
|
|
26
|
+
# If numeric and matches directly
|
|
27
|
+
if isinstance(value, int):
|
|
28
|
+
for name, val in cls.__dict__.items():
|
|
29
|
+
if not name.startswith("_") and val == value:
|
|
30
|
+
return val
|
|
31
|
+
|
|
32
|
+
# If string, perform case-insensitive match
|
|
33
|
+
if isinstance(value, str):
|
|
34
|
+
value_lower = value.lower()
|
|
35
|
+
for name, val in cls.__dict__.items():
|
|
36
|
+
if not name.startswith("_") and (
|
|
37
|
+
name.lower() == value_lower or str(val).lower() == value_lower
|
|
38
|
+
):
|
|
39
|
+
return val
|
|
40
|
+
|
|
41
|
+
# Fallback to default
|
|
42
|
+
return default
|