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,125 @@
|
|
|
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.charge_duration import (
|
|
11
|
+
ChargeDuration,
|
|
12
|
+
)
|
|
13
|
+
from teslafleetmanagementapi.models.charge_start_time import (
|
|
14
|
+
ChargeStartTime,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ChargeHistory(object):
|
|
19
|
+
"""Implementation of the 'ChargeHistory' model.
|
|
20
|
+
|
|
21
|
+
Attributes:
|
|
22
|
+
charge_start_time (ChargeStartTime): The model property of type
|
|
23
|
+
ChargeStartTime.
|
|
24
|
+
charge_duration (ChargeDuration): The model property of type ChargeDuration.
|
|
25
|
+
energy_added_wh (int): The model property of type int.
|
|
26
|
+
additional_properties (Dict[str, Any]): The additional properties for the
|
|
27
|
+
model.
|
|
28
|
+
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
# Create a mapping from Model property names to API property names
|
|
32
|
+
_names = {
|
|
33
|
+
"charge_start_time": "charge_start_time",
|
|
34
|
+
"charge_duration": "charge_duration",
|
|
35
|
+
"energy_added_wh": "energy_added_wh",
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
def __init__(
|
|
39
|
+
self,
|
|
40
|
+
charge_start_time=None,
|
|
41
|
+
charge_duration=None,
|
|
42
|
+
energy_added_wh=None,
|
|
43
|
+
additional_properties=None):
|
|
44
|
+
"""Initialize a ChargeHistory instance."""
|
|
45
|
+
# Initialize members of the class
|
|
46
|
+
self.charge_start_time = charge_start_time
|
|
47
|
+
self.charge_duration = charge_duration
|
|
48
|
+
self.energy_added_wh = energy_added_wh
|
|
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
|
+
charge_start_time =\
|
|
74
|
+
ChargeStartTime.from_dictionary(
|
|
75
|
+
dictionary.get("charge_start_time"))\
|
|
76
|
+
if dictionary.get("charge_start_time") else None
|
|
77
|
+
charge_duration =\
|
|
78
|
+
ChargeDuration.from_dictionary(
|
|
79
|
+
dictionary.get("charge_duration"))\
|
|
80
|
+
if dictionary.get("charge_duration") else None
|
|
81
|
+
energy_added_wh =\
|
|
82
|
+
dictionary.get("energy_added_wh")\
|
|
83
|
+
if dictionary.get("energy_added_wh")\
|
|
84
|
+
else None
|
|
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(charge_start_time,
|
|
93
|
+
charge_duration,
|
|
94
|
+
energy_added_wh,
|
|
95
|
+
additional_properties)
|
|
96
|
+
|
|
97
|
+
def __repr__(self):
|
|
98
|
+
"""Return a unambiguous string representation."""
|
|
99
|
+
_charge_start_time=self.charge_start_time
|
|
100
|
+
_charge_duration=self.charge_duration
|
|
101
|
+
_energy_added_wh=self.energy_added_wh
|
|
102
|
+
_additional_properties=self.additional_properties
|
|
103
|
+
return (
|
|
104
|
+
f"{self.__class__.__name__}("
|
|
105
|
+
f"charge_start_time={_charge_start_time!r}, "
|
|
106
|
+
f"charge_duration={_charge_duration!r}, "
|
|
107
|
+
f"energy_added_wh={_energy_added_wh!r}, "
|
|
108
|
+
f"additional_properties={_additional_properties!r}, "
|
|
109
|
+
f")"
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
def __str__(self):
|
|
113
|
+
"""Return a human-readable string representation."""
|
|
114
|
+
_charge_start_time=self.charge_start_time
|
|
115
|
+
_charge_duration=self.charge_duration
|
|
116
|
+
_energy_added_wh=self.energy_added_wh
|
|
117
|
+
_additional_properties=self.additional_properties
|
|
118
|
+
return (
|
|
119
|
+
f"{self.__class__.__name__}("
|
|
120
|
+
f"charge_start_time={_charge_start_time!s}, "
|
|
121
|
+
f"charge_duration={_charge_duration!s}, "
|
|
122
|
+
f"energy_added_wh={_energy_added_wh!s}, "
|
|
123
|
+
f"additional_properties={_additional_properties!s}, "
|
|
124
|
+
f")"
|
|
125
|
+
)
|
|
@@ -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_charge_history_response import (
|
|
11
|
+
ResponseChargeHistoryResponse,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class ChargeHistoryResponse(object):
|
|
16
|
+
"""Implementation of the 'ChargeHistoryResponse' model.
|
|
17
|
+
|
|
18
|
+
Attributes:
|
|
19
|
+
response (ResponseChargeHistoryResponse): The model property of type
|
|
20
|
+
ResponseChargeHistoryResponse.
|
|
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 ChargeHistoryResponse 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
|
+
ResponseChargeHistoryResponse.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,92 @@
|
|
|
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 ChargeStartTime(object):
|
|
13
|
+
"""Implementation of the 'ChargeStartTime' model.
|
|
14
|
+
|
|
15
|
+
Attributes:
|
|
16
|
+
seconds (int): The model property of type int.
|
|
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
|
+
"seconds": "seconds",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
def __init__(
|
|
28
|
+
self,
|
|
29
|
+
seconds=None,
|
|
30
|
+
additional_properties=None):
|
|
31
|
+
"""Initialize a ChargeStartTime instance."""
|
|
32
|
+
# Initialize members of the class
|
|
33
|
+
self.seconds = seconds
|
|
34
|
+
|
|
35
|
+
# Add additional model properties to the instance
|
|
36
|
+
if additional_properties is None:
|
|
37
|
+
additional_properties = {}
|
|
38
|
+
self.additional_properties = additional_properties
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def from_dictionary(cls,
|
|
42
|
+
dictionary):
|
|
43
|
+
"""Create an instance of this model from a dictionary
|
|
44
|
+
|
|
45
|
+
Args:
|
|
46
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
47
|
+
as obtained from the deserialization of the server's response. The
|
|
48
|
+
keys MUST match property names in the API description.
|
|
49
|
+
|
|
50
|
+
Returns:
|
|
51
|
+
object: An instance of this structure class.
|
|
52
|
+
|
|
53
|
+
"""
|
|
54
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
55
|
+
return None
|
|
56
|
+
|
|
57
|
+
# Extract variables from the dictionary
|
|
58
|
+
seconds =\
|
|
59
|
+
dictionary.get("seconds")\
|
|
60
|
+
if dictionary.get("seconds")\
|
|
61
|
+
else None
|
|
62
|
+
|
|
63
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
64
|
+
dictionary={k: v for k, v in dictionary.items()
|
|
65
|
+
if k not in cls._names.values()},
|
|
66
|
+
unboxing_function=lambda value: value)
|
|
67
|
+
|
|
68
|
+
# Return an object of this model
|
|
69
|
+
return cls(seconds,
|
|
70
|
+
additional_properties)
|
|
71
|
+
|
|
72
|
+
def __repr__(self):
|
|
73
|
+
"""Return a unambiguous string representation."""
|
|
74
|
+
_seconds=self.seconds
|
|
75
|
+
_additional_properties=self.additional_properties
|
|
76
|
+
return (
|
|
77
|
+
f"{self.__class__.__name__}("
|
|
78
|
+
f"seconds={_seconds!r}, "
|
|
79
|
+
f"additional_properties={_additional_properties!r}, "
|
|
80
|
+
f")"
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
def __str__(self):
|
|
84
|
+
"""Return a human-readable string representation."""
|
|
85
|
+
_seconds=self.seconds
|
|
86
|
+
_additional_properties=self.additional_properties
|
|
87
|
+
return (
|
|
88
|
+
f"{self.__class__.__name__}("
|
|
89
|
+
f"seconds={_seconds!s}, "
|
|
90
|
+
f"additional_properties={_additional_properties!s}, "
|
|
91
|
+
f")"
|
|
92
|
+
)
|
|
@@ -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 ChargingDimension(object):
|
|
13
|
+
"""Implementation of the 'ChargingDimension' model.
|
|
14
|
+
|
|
15
|
+
Attributes:
|
|
16
|
+
mtype (str): The model property of type str.
|
|
17
|
+
volume (float): The model property of type float.
|
|
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
|
+
"mtype": "type",
|
|
26
|
+
"volume": "volume",
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
_optionals = [
|
|
30
|
+
"mtype",
|
|
31
|
+
"volume",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
def __init__(
|
|
35
|
+
self,
|
|
36
|
+
mtype=APIHelper.SKIP,
|
|
37
|
+
volume=APIHelper.SKIP,
|
|
38
|
+
additional_properties=None):
|
|
39
|
+
"""Initialize a ChargingDimension instance."""
|
|
40
|
+
# Initialize members of the class
|
|
41
|
+
if mtype is not APIHelper.SKIP:
|
|
42
|
+
self.mtype = mtype
|
|
43
|
+
if volume is not APIHelper.SKIP:
|
|
44
|
+
self.volume = volume
|
|
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
|
+
mtype =\
|
|
70
|
+
dictionary.get("type")\
|
|
71
|
+
if dictionary.get("type")\
|
|
72
|
+
else APIHelper.SKIP
|
|
73
|
+
volume =\
|
|
74
|
+
dictionary.get("volume")\
|
|
75
|
+
if dictionary.get("volume")\
|
|
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(mtype,
|
|
85
|
+
volume,
|
|
86
|
+
additional_properties)
|
|
87
|
+
|
|
88
|
+
def __repr__(self):
|
|
89
|
+
"""Return a unambiguous string representation."""
|
|
90
|
+
_mtype=(
|
|
91
|
+
self.mtype
|
|
92
|
+
if hasattr(self, "mtype")
|
|
93
|
+
else None
|
|
94
|
+
)
|
|
95
|
+
_volume=(
|
|
96
|
+
self.volume
|
|
97
|
+
if hasattr(self, "volume")
|
|
98
|
+
else None
|
|
99
|
+
)
|
|
100
|
+
_additional_properties=self.additional_properties
|
|
101
|
+
return (
|
|
102
|
+
f"{self.__class__.__name__}("
|
|
103
|
+
f"mtype={_mtype!r}, "
|
|
104
|
+
f"volume={_volume!r}, "
|
|
105
|
+
f"additional_properties={_additional_properties!r}, "
|
|
106
|
+
f")"
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
def __str__(self):
|
|
110
|
+
"""Return a human-readable string representation."""
|
|
111
|
+
_mtype=(
|
|
112
|
+
self.mtype
|
|
113
|
+
if hasattr(self, "mtype")
|
|
114
|
+
else None
|
|
115
|
+
)
|
|
116
|
+
_volume=(
|
|
117
|
+
self.volume
|
|
118
|
+
if hasattr(self, "volume")
|
|
119
|
+
else None
|
|
120
|
+
)
|
|
121
|
+
_additional_properties=self.additional_properties
|
|
122
|
+
return (
|
|
123
|
+
f"{self.__class__.__name__}("
|
|
124
|
+
f"mtype={_mtype!s}, "
|
|
125
|
+
f"volume={_volume!s}, "
|
|
126
|
+
f"additional_properties={_additional_properties!s}, "
|
|
127
|
+
f")"
|
|
128
|
+
)
|