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,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 Response(object):
13
+ """Implementation of the 'Response' model.
14
+
15
+ Attributes:
16
+ code (int): The model property of type int.
17
+ message (str): The model property of type 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
+ "code": "code",
26
+ "message": "message",
27
+ }
28
+
29
+ def __init__(
30
+ self,
31
+ code=None,
32
+ message=None,
33
+ additional_properties=None):
34
+ """Initialize a Response instance."""
35
+ # Initialize members of the class
36
+ self.code = code
37
+ self.message = message
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
+ code =\
63
+ dictionary.get("code")\
64
+ if dictionary.get("code")\
65
+ else None
66
+ message =\
67
+ dictionary.get("message")\
68
+ if dictionary.get("message")\
69
+ else None
70
+
71
+ additional_properties = APIHelper.get_additional_properties(
72
+ dictionary={k: v for k, v in dictionary.items()
73
+ if k not in cls._names.values()},
74
+ unboxing_function=lambda value: value)
75
+
76
+ # Return an object of this model
77
+ return cls(code,
78
+ message,
79
+ additional_properties)
80
+
81
+ def __repr__(self):
82
+ """Return a unambiguous string representation."""
83
+ _code=self.code
84
+ _message=self.message
85
+ _additional_properties=self.additional_properties
86
+ return (
87
+ f"{self.__class__.__name__}("
88
+ f"code={_code!r}, "
89
+ f"message={_message!r}, "
90
+ f"additional_properties={_additional_properties!r}, "
91
+ f")"
92
+ )
93
+
94
+ def __str__(self):
95
+ """Return a human-readable string representation."""
96
+ _code=self.code
97
+ _message=self.message
98
+ _additional_properties=self.additional_properties
99
+ return (
100
+ f"{self.__class__.__name__}("
101
+ f"code={_code!s}, "
102
+ f"message={_message!s}, "
103
+ f"additional_properties={_additional_properties!s}, "
104
+ f")"
105
+ )
@@ -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 Response1(object):
13
+ """Implementation of the 'Response1' model.
14
+
15
+ Attributes:
16
+ fleet_telemetry_error_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
+ "fleet_telemetry_error_vins": "fleet_telemetry_error_vins",
25
+ }
26
+
27
+ def __init__(
28
+ self,
29
+ fleet_telemetry_error_vins=None,
30
+ additional_properties=None):
31
+ """Initialize a Response1 instance."""
32
+ # Initialize members of the class
33
+ self.fleet_telemetry_error_vins = fleet_telemetry_error_vins
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
+ fleet_telemetry_error_vins =\
59
+ dictionary.get("fleet_telemetry_error_vins")\
60
+ if dictionary.get("fleet_telemetry_error_vins")\
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(fleet_telemetry_error_vins,
70
+ additional_properties)
71
+
72
+ def __repr__(self):
73
+ """Return a unambiguous string representation."""
74
+ _fleet_telemetry_error_vins=self.fleet_telemetry_error_vins
75
+ _additional_properties=self.additional_properties
76
+ return (
77
+ f"{self.__class__.__name__}("
78
+ f"fleet_telemetry_error_vins={_fleet_telemetry_error_vins!r}, "
79
+ f"additional_properties={_additional_properties!r}, "
80
+ f")"
81
+ )
82
+
83
+ def __str__(self):
84
+ """Return a human-readable string representation."""
85
+ _fleet_telemetry_error_vins=self.fleet_telemetry_error_vins
86
+ _additional_properties=self.additional_properties
87
+ return (
88
+ f"{self.__class__.__name__}("
89
+ f"fleet_telemetry_error_vins={_fleet_telemetry_error_vins!s}, "
90
+ f"additional_properties={_additional_properties!s}, "
91
+ f")"
92
+ )
@@ -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.signaling import (
11
+ Signaling,
12
+ )
13
+
14
+
15
+ class Response2(object):
16
+ """Implementation of the 'Response2' model.
17
+
18
+ Attributes:
19
+ signaling (Signaling): The model property of type Signaling.
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
+ "signaling": "signaling",
28
+ }
29
+
30
+ def __init__(
31
+ self,
32
+ signaling=None,
33
+ additional_properties=None):
34
+ """Initialize a Response2 instance."""
35
+ # Initialize members of the class
36
+ self.signaling = signaling
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
+ signaling =\
62
+ Signaling.from_dictionary(
63
+ dictionary.get("signaling"))\
64
+ if dictionary.get("signaling") 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(signaling,
73
+ additional_properties)
74
+
75
+ def __repr__(self):
76
+ """Return a unambiguous string representation."""
77
+ _signaling=self.signaling
78
+ _additional_properties=self.additional_properties
79
+ return (
80
+ f"{self.__class__.__name__}("
81
+ f"signaling={_signaling!r}, "
82
+ f"additional_properties={_additional_properties!r}, "
83
+ f")"
84
+ )
85
+
86
+ def __str__(self):
87
+ """Return a human-readable string representation."""
88
+ _signaling=self.signaling
89
+ _additional_properties=self.additional_properties
90
+ return (
91
+ f"{self.__class__.__name__}("
92
+ f"signaling={_signaling!s}, "
93
+ f"additional_properties={_additional_properties!s}, "
94
+ f")"
95
+ )
@@ -0,0 +1,164 @@
1
+ """teslafleetmanagementapi.
2
+
3
+ This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
4
+ """
5
+
6
+ # ruff: noqa: E501
7
+ from teslafleetmanagementapi.api_helper import (
8
+ APIHelper,
9
+ )
10
+ from teslafleetmanagementapi.models.charging_location import (
11
+ ChargingLocation,
12
+ )
13
+
14
+
15
+ class Response3(object):
16
+ """Implementation of the 'Response3' model.
17
+
18
+ Attributes:
19
+ destination_charging (List[ChargingLocation]): The model property of type
20
+ List[ChargingLocation].
21
+ superchargers (List[ChargingLocation]): The model property of type
22
+ List[ChargingLocation].
23
+ timestamp (int): The model property of type int.
24
+ additional_properties (Dict[str, Any]): The additional properties for the
25
+ model.
26
+
27
+ """
28
+
29
+ # Create a mapping from Model property names to API property names
30
+ _names = {
31
+ "destination_charging": "destination_charging",
32
+ "superchargers": "superchargers",
33
+ "timestamp": "timestamp",
34
+ }
35
+
36
+ _optionals = [
37
+ "destination_charging",
38
+ "superchargers",
39
+ "timestamp",
40
+ ]
41
+
42
+ def __init__(
43
+ self,
44
+ destination_charging=APIHelper.SKIP,
45
+ superchargers=APIHelper.SKIP,
46
+ timestamp=APIHelper.SKIP,
47
+ additional_properties=None):
48
+ """Initialize a Response3 instance."""
49
+ # Initialize members of the class
50
+ if destination_charging is not APIHelper.SKIP:
51
+ self.destination_charging = destination_charging
52
+ if superchargers is not APIHelper.SKIP:
53
+ self.superchargers = superchargers
54
+ if timestamp is not APIHelper.SKIP:
55
+ self.timestamp = timestamp
56
+
57
+ # Add additional model properties to the instance
58
+ if additional_properties is None:
59
+ additional_properties = {}
60
+ self.additional_properties = additional_properties
61
+
62
+ @classmethod
63
+ def from_dictionary(cls,
64
+ dictionary):
65
+ """Create an instance of this model from a dictionary
66
+
67
+ Args:
68
+ dictionary (dictionary): A dictionary representation of the object
69
+ as obtained from the deserialization of the server's response. The
70
+ keys MUST match property names in the API description.
71
+
72
+ Returns:
73
+ object: An instance of this structure class.
74
+
75
+ """
76
+ if not isinstance(dictionary, dict) or dictionary is None:
77
+ return None
78
+
79
+ # Extract variables from the dictionary
80
+ destination_charging = None
81
+ if dictionary.get("destination_charging") is not None:
82
+ destination_charging = [
83
+ ChargingLocation.from_dictionary(x)
84
+ for x in dictionary.get("destination_charging")
85
+ ]
86
+ else:
87
+ destination_charging = APIHelper.SKIP
88
+ superchargers = None
89
+ if dictionary.get("superchargers") is not None:
90
+ superchargers = [
91
+ ChargingLocation.from_dictionary(x)
92
+ for x in dictionary.get("superchargers")
93
+ ]
94
+ else:
95
+ superchargers = APIHelper.SKIP
96
+ timestamp =\
97
+ dictionary.get("timestamp")\
98
+ if dictionary.get("timestamp")\
99
+ else APIHelper.SKIP
100
+
101
+ additional_properties = APIHelper.get_additional_properties(
102
+ dictionary={k: v for k, v in dictionary.items()
103
+ if k not in cls._names.values()},
104
+ unboxing_function=lambda value: value)
105
+
106
+ # Return an object of this model
107
+ return cls(destination_charging,
108
+ superchargers,
109
+ timestamp,
110
+ additional_properties)
111
+
112
+ def __repr__(self):
113
+ """Return a unambiguous string representation."""
114
+ _destination_charging=(
115
+ self.destination_charging
116
+ if hasattr(self, "destination_charging")
117
+ else None
118
+ )
119
+ _superchargers=(
120
+ self.superchargers
121
+ if hasattr(self, "superchargers")
122
+ else None
123
+ )
124
+ _timestamp=(
125
+ self.timestamp
126
+ if hasattr(self, "timestamp")
127
+ else None
128
+ )
129
+ _additional_properties=self.additional_properties
130
+ return (
131
+ f"{self.__class__.__name__}("
132
+ f"destination_charging={_destination_charging!r}, "
133
+ f"superchargers={_superchargers!r}, "
134
+ f"timestamp={_timestamp!r}, "
135
+ f"additional_properties={_additional_properties!r}, "
136
+ f")"
137
+ )
138
+
139
+ def __str__(self):
140
+ """Return a human-readable string representation."""
141
+ _destination_charging=(
142
+ self.destination_charging
143
+ if hasattr(self, "destination_charging")
144
+ else None
145
+ )
146
+ _superchargers=(
147
+ self.superchargers
148
+ if hasattr(self, "superchargers")
149
+ else None
150
+ )
151
+ _timestamp=(
152
+ self.timestamp
153
+ if hasattr(self, "timestamp")
154
+ else None
155
+ )
156
+ _additional_properties=self.additional_properties
157
+ return (
158
+ f"{self.__class__.__name__}("
159
+ f"destination_charging={_destination_charging!s}, "
160
+ f"superchargers={_superchargers!s}, "
161
+ f"timestamp={_timestamp!s}, "
162
+ f"additional_properties={_additional_properties!s}, "
163
+ f")"
164
+ )
@@ -0,0 +1,112 @@
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.vehicle_option import (
11
+ VehicleOption,
12
+ )
13
+
14
+
15
+ class ResponseApi1DxVehiclesOptionsResponse(object):
16
+ """Implementation of the 'Response_Api 1 Dx Vehicles Options Response' model.
17
+
18
+ Attributes:
19
+ codes (List[VehicleOption]): The model property of type List[VehicleOption].
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
+ "codes": "codes",
28
+ }
29
+
30
+ _optionals = [
31
+ "codes",
32
+ ]
33
+
34
+ def __init__(
35
+ self,
36
+ codes=APIHelper.SKIP,
37
+ additional_properties=None):
38
+ """Initialize a ResponseApi1DxVehiclesOptionsResponse instance."""
39
+ # Initialize members of the class
40
+ if codes is not APIHelper.SKIP:
41
+ self.codes = codes
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
+ codes = None
67
+ if dictionary.get("codes") is not None:
68
+ codes = [
69
+ VehicleOption.from_dictionary(x)
70
+ for x in dictionary.get("codes")
71
+ ]
72
+ else:
73
+ codes = APIHelper.SKIP
74
+
75
+ additional_properties = APIHelper.get_additional_properties(
76
+ dictionary={k: v for k, v in dictionary.items()
77
+ if k not in cls._names.values()},
78
+ unboxing_function=lambda value: value)
79
+
80
+ # Return an object of this model
81
+ return cls(codes,
82
+ additional_properties)
83
+
84
+ def __repr__(self):
85
+ """Return a unambiguous string representation."""
86
+ _codes=(
87
+ self.codes
88
+ if hasattr(self, "codes")
89
+ else None
90
+ )
91
+ _additional_properties=self.additional_properties
92
+ return (
93
+ f"{self.__class__.__name__}("
94
+ f"codes={_codes!r}, "
95
+ f"additional_properties={_additional_properties!r}, "
96
+ f")"
97
+ )
98
+
99
+ def __str__(self):
100
+ """Return a human-readable string representation."""
101
+ _codes=(
102
+ self.codes
103
+ if hasattr(self, "codes")
104
+ else None
105
+ )
106
+ _additional_properties=self.additional_properties
107
+ return (
108
+ f"{self.__class__.__name__}("
109
+ f"codes={_codes!s}, "
110
+ f"additional_properties={_additional_properties!s}, "
111
+ f")"
112
+ )