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,115 @@
|
|
|
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 OauthToken(object):
|
|
13
|
+
"""Implementation of the 'OAuthToken' model.
|
|
14
|
+
|
|
15
|
+
OAuth 2 Authorization endpoint response
|
|
16
|
+
|
|
17
|
+
Attributes:
|
|
18
|
+
access_token (str): Access token
|
|
19
|
+
token_type (str): Type of access token
|
|
20
|
+
expires_in (int): Time in seconds before the access token expires
|
|
21
|
+
scope (str): List of scopes granted This is a space-delimited list of strings.
|
|
22
|
+
expiry (int): Time of token expiry as unix timestamp (UTC)
|
|
23
|
+
refresh_token (str): Refresh token Used to get a new access token when it
|
|
24
|
+
expires.
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
# Create a mapping from Model property names to API property names
|
|
29
|
+
_names = {
|
|
30
|
+
"access_token": "access_token",
|
|
31
|
+
"token_type": "token_type",
|
|
32
|
+
"expires_in": "expires_in",
|
|
33
|
+
"scope": "scope",
|
|
34
|
+
"expiry": "expiry",
|
|
35
|
+
"refresh_token": "refresh_token",
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
_optionals = [
|
|
39
|
+
"expires_in",
|
|
40
|
+
"scope",
|
|
41
|
+
"expiry",
|
|
42
|
+
"refresh_token",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
def __init__(
|
|
46
|
+
self,
|
|
47
|
+
access_token=None,
|
|
48
|
+
token_type=None,
|
|
49
|
+
expires_in=APIHelper.SKIP,
|
|
50
|
+
scope=APIHelper.SKIP,
|
|
51
|
+
expiry=APIHelper.SKIP,
|
|
52
|
+
refresh_token=APIHelper.SKIP):
|
|
53
|
+
"""Initialize a OauthToken instance."""
|
|
54
|
+
# Initialize members of the class
|
|
55
|
+
self.access_token = access_token
|
|
56
|
+
self.token_type = token_type
|
|
57
|
+
if expires_in is not APIHelper.SKIP:
|
|
58
|
+
self.expires_in = expires_in
|
|
59
|
+
if scope is not APIHelper.SKIP:
|
|
60
|
+
self.scope = scope
|
|
61
|
+
if expiry is not APIHelper.SKIP:
|
|
62
|
+
self.expiry = expiry
|
|
63
|
+
if refresh_token is not APIHelper.SKIP:
|
|
64
|
+
self.refresh_token = refresh_token
|
|
65
|
+
|
|
66
|
+
@classmethod
|
|
67
|
+
def from_dictionary(cls,
|
|
68
|
+
dictionary):
|
|
69
|
+
"""Create an instance of this model from a dictionary
|
|
70
|
+
|
|
71
|
+
Args:
|
|
72
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
73
|
+
as obtained from the deserialization of the server's response. The
|
|
74
|
+
keys MUST match property names in the API description.
|
|
75
|
+
|
|
76
|
+
Returns:
|
|
77
|
+
object: An instance of this structure class.
|
|
78
|
+
|
|
79
|
+
"""
|
|
80
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
# Extract variables from the dictionary
|
|
84
|
+
access_token =\
|
|
85
|
+
dictionary.get("access_token")\
|
|
86
|
+
if dictionary.get("access_token")\
|
|
87
|
+
else None
|
|
88
|
+
token_type =\
|
|
89
|
+
dictionary.get("token_type")\
|
|
90
|
+
if dictionary.get("token_type")\
|
|
91
|
+
else None
|
|
92
|
+
expires_in =\
|
|
93
|
+
dictionary.get("expires_in")\
|
|
94
|
+
if dictionary.get("expires_in")\
|
|
95
|
+
else APIHelper.SKIP
|
|
96
|
+
scope =\
|
|
97
|
+
dictionary.get("scope")\
|
|
98
|
+
if dictionary.get("scope")\
|
|
99
|
+
else APIHelper.SKIP
|
|
100
|
+
expiry =\
|
|
101
|
+
dictionary.get("expiry")\
|
|
102
|
+
if dictionary.get("expiry")\
|
|
103
|
+
else APIHelper.SKIP
|
|
104
|
+
refresh_token =\
|
|
105
|
+
dictionary.get("refresh_token")\
|
|
106
|
+
if dictionary.get("refresh_token")\
|
|
107
|
+
else APIHelper.SKIP
|
|
108
|
+
|
|
109
|
+
# Return an object of this model
|
|
110
|
+
return cls(access_token,
|
|
111
|
+
token_type,
|
|
112
|
+
expires_in,
|
|
113
|
+
scope,
|
|
114
|
+
expiry,
|
|
115
|
+
refresh_token)
|
|
@@ -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
|
+
|
|
11
|
+
|
|
12
|
+
class OffGridVehicleChargingReserveRequest(object):
|
|
13
|
+
"""Implementation of the 'OffGridVehicleChargingReserveRequest' model.
|
|
14
|
+
|
|
15
|
+
Attributes:
|
|
16
|
+
off_grid_vehicle_charging_reserve_percent (int): The model property of type
|
|
17
|
+
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
|
+
"off_grid_vehicle_charging_reserve_percent":
|
|
26
|
+
"off_grid_vehicle_charging_reserve_percent",
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
def __init__(
|
|
30
|
+
self,
|
|
31
|
+
off_grid_vehicle_charging_reserve_percent=None,
|
|
32
|
+
additional_properties=None):
|
|
33
|
+
"""Initialize a OffGridVehicleChargingReserveRequest instance."""
|
|
34
|
+
# Initialize members of the class
|
|
35
|
+
self.off_grid_vehicle_charging_reserve_percent =\
|
|
36
|
+
off_grid_vehicle_charging_reserve_percent
|
|
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
|
+
off_grid_vehicle_charging_reserve_percent =\
|
|
62
|
+
dictionary.get("off_grid_vehicle_charging_reserve_percent")\
|
|
63
|
+
if dictionary.get("off_grid_vehicle_charging_reserve_percent")\
|
|
64
|
+
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(off_grid_vehicle_charging_reserve_percent,
|
|
73
|
+
additional_properties)
|
|
74
|
+
|
|
75
|
+
def __repr__(self):
|
|
76
|
+
"""Return a unambiguous string representation."""
|
|
77
|
+
_off_grid_vehicle_charging_reserve_percent=self.off_grid_vehicle_charging_reserve_percent
|
|
78
|
+
_additional_properties=self.additional_properties
|
|
79
|
+
return (
|
|
80
|
+
f"{self.__class__.__name__}("
|
|
81
|
+
f"off_grid_vehicle_charging_reserve_percent={_off_grid_vehicle_charging_reserve_percent!r}, "
|
|
82
|
+
f"additional_properties={_additional_properties!r}, "
|
|
83
|
+
f")"
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
def __str__(self):
|
|
87
|
+
"""Return a human-readable string representation."""
|
|
88
|
+
_off_grid_vehicle_charging_reserve_percent=self.off_grid_vehicle_charging_reserve_percent
|
|
89
|
+
_additional_properties=self.additional_properties
|
|
90
|
+
return (
|
|
91
|
+
f"{self.__class__.__name__}("
|
|
92
|
+
f"off_grid_vehicle_charging_reserve_percent={_off_grid_vehicle_charging_reserve_percent!s}, "
|
|
93
|
+
f"additional_properties={_additional_properties!s}, "
|
|
94
|
+
f")"
|
|
95
|
+
)
|
|
@@ -0,0 +1,93 @@
|
|
|
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 OperationRequest(object):
|
|
13
|
+
"""Implementation of the 'OperationRequest' model.
|
|
14
|
+
|
|
15
|
+
Attributes:
|
|
16
|
+
default_real_mode (DefaultRealMode): The model property of type
|
|
17
|
+
DefaultRealMode.
|
|
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
|
+
"default_real_mode": "default_real_mode",
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
def __init__(
|
|
29
|
+
self,
|
|
30
|
+
default_real_mode=None,
|
|
31
|
+
additional_properties=None):
|
|
32
|
+
"""Initialize a OperationRequest instance."""
|
|
33
|
+
# Initialize members of the class
|
|
34
|
+
self.default_real_mode = default_real_mode
|
|
35
|
+
|
|
36
|
+
# Add additional model properties to the instance
|
|
37
|
+
if additional_properties is None:
|
|
38
|
+
additional_properties = {}
|
|
39
|
+
self.additional_properties = additional_properties
|
|
40
|
+
|
|
41
|
+
@classmethod
|
|
42
|
+
def from_dictionary(cls,
|
|
43
|
+
dictionary):
|
|
44
|
+
"""Create an instance of this model from a dictionary
|
|
45
|
+
|
|
46
|
+
Args:
|
|
47
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
48
|
+
as obtained from the deserialization of the server's response. The
|
|
49
|
+
keys MUST match property names in the API description.
|
|
50
|
+
|
|
51
|
+
Returns:
|
|
52
|
+
object: An instance of this structure class.
|
|
53
|
+
|
|
54
|
+
"""
|
|
55
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
56
|
+
return None
|
|
57
|
+
|
|
58
|
+
# Extract variables from the dictionary
|
|
59
|
+
default_real_mode =\
|
|
60
|
+
dictionary.get("default_real_mode")\
|
|
61
|
+
if dictionary.get("default_real_mode")\
|
|
62
|
+
else None
|
|
63
|
+
|
|
64
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
65
|
+
dictionary={k: v for k, v in dictionary.items()
|
|
66
|
+
if k not in cls._names.values()},
|
|
67
|
+
unboxing_function=lambda value: value)
|
|
68
|
+
|
|
69
|
+
# Return an object of this model
|
|
70
|
+
return cls(default_real_mode,
|
|
71
|
+
additional_properties)
|
|
72
|
+
|
|
73
|
+
def __repr__(self):
|
|
74
|
+
"""Return a unambiguous string representation."""
|
|
75
|
+
_default_real_mode=self.default_real_mode
|
|
76
|
+
_additional_properties=self.additional_properties
|
|
77
|
+
return (
|
|
78
|
+
f"{self.__class__.__name__}("
|
|
79
|
+
f"default_real_mode={_default_real_mode!r}, "
|
|
80
|
+
f"additional_properties={_additional_properties!r}, "
|
|
81
|
+
f")"
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
def __str__(self):
|
|
85
|
+
"""Return a human-readable string representation."""
|
|
86
|
+
_default_real_mode=self.default_real_mode
|
|
87
|
+
_additional_properties=self.additional_properties
|
|
88
|
+
return (
|
|
89
|
+
f"{self.__class__.__name__}("
|
|
90
|
+
f"default_real_mode={_default_real_mode!s}, "
|
|
91
|
+
f"additional_properties={_additional_properties!s}, "
|
|
92
|
+
f")"
|
|
93
|
+
)
|
|
@@ -0,0 +1,111 @@
|
|
|
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_orders_response import (
|
|
11
|
+
ResponseOrdersResponse,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class OrdersResponse(object):
|
|
16
|
+
"""Implementation of the 'OrdersResponse' model.
|
|
17
|
+
|
|
18
|
+
Attributes:
|
|
19
|
+
response (List[ResponseOrdersResponse]): The model property of type
|
|
20
|
+
List[ResponseOrdersResponse].
|
|
21
|
+
count (int): The model property of type int.
|
|
22
|
+
additional_properties (Dict[str, Any]): The additional properties for the
|
|
23
|
+
model.
|
|
24
|
+
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
# Create a mapping from Model property names to API property names
|
|
28
|
+
_names = {
|
|
29
|
+
"response": "response",
|
|
30
|
+
"count": "count",
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
def __init__(
|
|
34
|
+
self,
|
|
35
|
+
response=None,
|
|
36
|
+
count=None,
|
|
37
|
+
additional_properties=None):
|
|
38
|
+
"""Initialize a OrdersResponse instance."""
|
|
39
|
+
# Initialize members of the class
|
|
40
|
+
self.response = response
|
|
41
|
+
self.count = count
|
|
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
|
+
response = None
|
|
67
|
+
if dictionary.get("response") is not None:
|
|
68
|
+
response = [
|
|
69
|
+
ResponseOrdersResponse.from_dictionary(x)
|
|
70
|
+
for x in dictionary.get("response")
|
|
71
|
+
]
|
|
72
|
+
count =\
|
|
73
|
+
dictionary.get("count")\
|
|
74
|
+
if dictionary.get("count")\
|
|
75
|
+
else None
|
|
76
|
+
|
|
77
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
78
|
+
dictionary={k: v for k, v in dictionary.items()
|
|
79
|
+
if k not in cls._names.values()},
|
|
80
|
+
unboxing_function=lambda value: value)
|
|
81
|
+
|
|
82
|
+
# Return an object of this model
|
|
83
|
+
return cls(response,
|
|
84
|
+
count,
|
|
85
|
+
additional_properties)
|
|
86
|
+
|
|
87
|
+
def __repr__(self):
|
|
88
|
+
"""Return a unambiguous string representation."""
|
|
89
|
+
_response=self.response
|
|
90
|
+
_count=self.count
|
|
91
|
+
_additional_properties=self.additional_properties
|
|
92
|
+
return (
|
|
93
|
+
f"{self.__class__.__name__}("
|
|
94
|
+
f"response={_response!r}, "
|
|
95
|
+
f"count={_count!r}, "
|
|
96
|
+
f"additional_properties={_additional_properties!r}, "
|
|
97
|
+
f")"
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
def __str__(self):
|
|
101
|
+
"""Return a human-readable string representation."""
|
|
102
|
+
_response=self.response
|
|
103
|
+
_count=self.count
|
|
104
|
+
_additional_properties=self.additional_properties
|
|
105
|
+
return (
|
|
106
|
+
f"{self.__class__.__name__}("
|
|
107
|
+
f"response={_response!s}, "
|
|
108
|
+
f"count={_count!s}, "
|
|
109
|
+
f"additional_properties={_additional_properties!s}, "
|
|
110
|
+
f")"
|
|
111
|
+
)
|
|
@@ -0,0 +1,225 @@
|
|
|
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 Pagination(object):
|
|
13
|
+
"""Implementation of the 'Pagination' model.
|
|
14
|
+
|
|
15
|
+
Attributes:
|
|
16
|
+
previous (int): The model property of type int.
|
|
17
|
+
next (int): The model property of type int.
|
|
18
|
+
current (int): The model property of type int.
|
|
19
|
+
per_page (int): The model property of type int.
|
|
20
|
+
count (int): The model property of type int.
|
|
21
|
+
pages (int): The model property of type int.
|
|
22
|
+
additional_properties (Dict[str, Any]): The additional properties for the
|
|
23
|
+
model.
|
|
24
|
+
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
# Create a mapping from Model property names to API property names
|
|
28
|
+
_names = {
|
|
29
|
+
"previous": "previous",
|
|
30
|
+
"next": "next",
|
|
31
|
+
"current": "current",
|
|
32
|
+
"per_page": "per_page",
|
|
33
|
+
"count": "count",
|
|
34
|
+
"pages": "pages",
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
_optionals = [
|
|
38
|
+
"previous",
|
|
39
|
+
"next",
|
|
40
|
+
"current",
|
|
41
|
+
"per_page",
|
|
42
|
+
"count",
|
|
43
|
+
"pages",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
_nullables = [
|
|
47
|
+
"previous",
|
|
48
|
+
"next",
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
def __init__(
|
|
52
|
+
self,
|
|
53
|
+
previous=APIHelper.SKIP,
|
|
54
|
+
next=APIHelper.SKIP,
|
|
55
|
+
current=APIHelper.SKIP,
|
|
56
|
+
per_page=APIHelper.SKIP,
|
|
57
|
+
count=APIHelper.SKIP,
|
|
58
|
+
pages=APIHelper.SKIP,
|
|
59
|
+
additional_properties=None):
|
|
60
|
+
"""Initialize a Pagination instance."""
|
|
61
|
+
# Initialize members of the class
|
|
62
|
+
if previous is not APIHelper.SKIP:
|
|
63
|
+
self.previous = previous
|
|
64
|
+
if next is not APIHelper.SKIP:
|
|
65
|
+
self.next = next
|
|
66
|
+
if current is not APIHelper.SKIP:
|
|
67
|
+
self.current = current
|
|
68
|
+
if per_page is not APIHelper.SKIP:
|
|
69
|
+
self.per_page = per_page
|
|
70
|
+
if count is not APIHelper.SKIP:
|
|
71
|
+
self.count = count
|
|
72
|
+
if pages is not APIHelper.SKIP:
|
|
73
|
+
self.pages = pages
|
|
74
|
+
|
|
75
|
+
# Add additional model properties to the instance
|
|
76
|
+
if additional_properties is None:
|
|
77
|
+
additional_properties = {}
|
|
78
|
+
self.additional_properties = additional_properties
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_dictionary(cls,
|
|
82
|
+
dictionary):
|
|
83
|
+
"""Create an instance of this model from a dictionary
|
|
84
|
+
|
|
85
|
+
Args:
|
|
86
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
87
|
+
as obtained from the deserialization of the server's response. The
|
|
88
|
+
keys MUST match property names in the API description.
|
|
89
|
+
|
|
90
|
+
Returns:
|
|
91
|
+
object: An instance of this structure class.
|
|
92
|
+
|
|
93
|
+
"""
|
|
94
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
95
|
+
return None
|
|
96
|
+
|
|
97
|
+
# Extract variables from the dictionary
|
|
98
|
+
previous =\
|
|
99
|
+
dictionary.get("previous")\
|
|
100
|
+
if "previous" in dictionary.keys()\
|
|
101
|
+
else APIHelper.SKIP
|
|
102
|
+
next =\
|
|
103
|
+
dictionary.get("next")\
|
|
104
|
+
if "next" in dictionary.keys()\
|
|
105
|
+
else APIHelper.SKIP
|
|
106
|
+
current =\
|
|
107
|
+
dictionary.get("current")\
|
|
108
|
+
if dictionary.get("current")\
|
|
109
|
+
else APIHelper.SKIP
|
|
110
|
+
per_page =\
|
|
111
|
+
dictionary.get("per_page")\
|
|
112
|
+
if dictionary.get("per_page")\
|
|
113
|
+
else APIHelper.SKIP
|
|
114
|
+
count =\
|
|
115
|
+
dictionary.get("count")\
|
|
116
|
+
if dictionary.get("count")\
|
|
117
|
+
else APIHelper.SKIP
|
|
118
|
+
pages =\
|
|
119
|
+
dictionary.get("pages")\
|
|
120
|
+
if dictionary.get("pages")\
|
|
121
|
+
else APIHelper.SKIP
|
|
122
|
+
|
|
123
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
124
|
+
dictionary={k: v for k, v in dictionary.items()
|
|
125
|
+
if k not in cls._names.values()},
|
|
126
|
+
unboxing_function=lambda value: value)
|
|
127
|
+
|
|
128
|
+
# Return an object of this model
|
|
129
|
+
return cls(previous,
|
|
130
|
+
next,
|
|
131
|
+
current,
|
|
132
|
+
per_page,
|
|
133
|
+
count,
|
|
134
|
+
pages,
|
|
135
|
+
additional_properties)
|
|
136
|
+
|
|
137
|
+
def __repr__(self):
|
|
138
|
+
"""Return a unambiguous string representation."""
|
|
139
|
+
_previous=(
|
|
140
|
+
self.previous
|
|
141
|
+
if hasattr(self, "previous")
|
|
142
|
+
else None
|
|
143
|
+
)
|
|
144
|
+
_next=(
|
|
145
|
+
self.next
|
|
146
|
+
if hasattr(self, "next")
|
|
147
|
+
else None
|
|
148
|
+
)
|
|
149
|
+
_current=(
|
|
150
|
+
self.current
|
|
151
|
+
if hasattr(self, "current")
|
|
152
|
+
else None
|
|
153
|
+
)
|
|
154
|
+
_per_page=(
|
|
155
|
+
self.per_page
|
|
156
|
+
if hasattr(self, "per_page")
|
|
157
|
+
else None
|
|
158
|
+
)
|
|
159
|
+
_count=(
|
|
160
|
+
self.count
|
|
161
|
+
if hasattr(self, "count")
|
|
162
|
+
else None
|
|
163
|
+
)
|
|
164
|
+
_pages=(
|
|
165
|
+
self.pages
|
|
166
|
+
if hasattr(self, "pages")
|
|
167
|
+
else None
|
|
168
|
+
)
|
|
169
|
+
_additional_properties=self.additional_properties
|
|
170
|
+
return (
|
|
171
|
+
f"{self.__class__.__name__}("
|
|
172
|
+
f"previous={_previous!r}, "
|
|
173
|
+
f"next={_next!r}, "
|
|
174
|
+
f"current={_current!r}, "
|
|
175
|
+
f"per_page={_per_page!r}, "
|
|
176
|
+
f"count={_count!r}, "
|
|
177
|
+
f"pages={_pages!r}, "
|
|
178
|
+
f"additional_properties={_additional_properties!r}, "
|
|
179
|
+
f")"
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
def __str__(self):
|
|
183
|
+
"""Return a human-readable string representation."""
|
|
184
|
+
_previous=(
|
|
185
|
+
self.previous
|
|
186
|
+
if hasattr(self, "previous")
|
|
187
|
+
else None
|
|
188
|
+
)
|
|
189
|
+
_next=(
|
|
190
|
+
self.next
|
|
191
|
+
if hasattr(self, "next")
|
|
192
|
+
else None
|
|
193
|
+
)
|
|
194
|
+
_current=(
|
|
195
|
+
self.current
|
|
196
|
+
if hasattr(self, "current")
|
|
197
|
+
else None
|
|
198
|
+
)
|
|
199
|
+
_per_page=(
|
|
200
|
+
self.per_page
|
|
201
|
+
if hasattr(self, "per_page")
|
|
202
|
+
else None
|
|
203
|
+
)
|
|
204
|
+
_count=(
|
|
205
|
+
self.count
|
|
206
|
+
if hasattr(self, "count")
|
|
207
|
+
else None
|
|
208
|
+
)
|
|
209
|
+
_pages=(
|
|
210
|
+
self.pages
|
|
211
|
+
if hasattr(self, "pages")
|
|
212
|
+
else None
|
|
213
|
+
)
|
|
214
|
+
_additional_properties=self.additional_properties
|
|
215
|
+
return (
|
|
216
|
+
f"{self.__class__.__name__}("
|
|
217
|
+
f"previous={_previous!s}, "
|
|
218
|
+
f"next={_next!s}, "
|
|
219
|
+
f"current={_current!s}, "
|
|
220
|
+
f"per_page={_per_page!s}, "
|
|
221
|
+
f"count={_count!s}, "
|
|
222
|
+
f"pages={_pages!s}, "
|
|
223
|
+
f"additional_properties={_additional_properties!s}, "
|
|
224
|
+
f")"
|
|
225
|
+
)
|