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,151 @@
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 TotalCost(object):
13
+ """Implementation of the 'TotalCost' model.
14
+
15
+ Attributes:
16
+ excl_vat (float): The model property of type float.
17
+ incl_vat (float): The model property of type float.
18
+ vat (float): The model property of type float.
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
+ "excl_vat": "excl_vat",
27
+ "incl_vat": "incl_vat",
28
+ "vat": "vat",
29
+ }
30
+
31
+ _optionals = [
32
+ "excl_vat",
33
+ "incl_vat",
34
+ "vat",
35
+ ]
36
+
37
+ def __init__(
38
+ self,
39
+ excl_vat=APIHelper.SKIP,
40
+ incl_vat=APIHelper.SKIP,
41
+ vat=APIHelper.SKIP,
42
+ additional_properties=None):
43
+ """Initialize a TotalCost instance."""
44
+ # Initialize members of the class
45
+ if excl_vat is not APIHelper.SKIP:
46
+ self.excl_vat = excl_vat
47
+ if incl_vat is not APIHelper.SKIP:
48
+ self.incl_vat = incl_vat
49
+ if vat is not APIHelper.SKIP:
50
+ self.vat = vat
51
+
52
+ # Add additional model properties to the instance
53
+ if additional_properties is None:
54
+ additional_properties = {}
55
+ self.additional_properties = additional_properties
56
+
57
+ @classmethod
58
+ def from_dictionary(cls,
59
+ dictionary):
60
+ """Create an instance of this model from a dictionary
61
+
62
+ Args:
63
+ dictionary (dictionary): A dictionary representation of the object
64
+ as obtained from the deserialization of the server's response. The
65
+ keys MUST match property names in the API description.
66
+
67
+ Returns:
68
+ object: An instance of this structure class.
69
+
70
+ """
71
+ if not isinstance(dictionary, dict) or dictionary is None:
72
+ return None
73
+
74
+ # Extract variables from the dictionary
75
+ excl_vat =\
76
+ dictionary.get("excl_vat")\
77
+ if dictionary.get("excl_vat")\
78
+ else APIHelper.SKIP
79
+ incl_vat =\
80
+ dictionary.get("incl_vat")\
81
+ if dictionary.get("incl_vat")\
82
+ else APIHelper.SKIP
83
+ vat =\
84
+ dictionary.get("vat")\
85
+ if dictionary.get("vat")\
86
+ else APIHelper.SKIP
87
+
88
+ additional_properties = APIHelper.get_additional_properties(
89
+ dictionary={k: v for k, v in dictionary.items()
90
+ if k not in cls._names.values()},
91
+ unboxing_function=lambda value: value)
92
+
93
+ # Return an object of this model
94
+ return cls(excl_vat,
95
+ incl_vat,
96
+ vat,
97
+ additional_properties)
98
+
99
+ def __repr__(self):
100
+ """Return a unambiguous string representation."""
101
+ _excl_vat=(
102
+ self.excl_vat
103
+ if hasattr(self, "excl_vat")
104
+ else None
105
+ )
106
+ _incl_vat=(
107
+ self.incl_vat
108
+ if hasattr(self, "incl_vat")
109
+ else None
110
+ )
111
+ _vat=(
112
+ self.vat
113
+ if hasattr(self, "vat")
114
+ else None
115
+ )
116
+ _additional_properties=self.additional_properties
117
+ return (
118
+ f"{self.__class__.__name__}("
119
+ f"excl_vat={_excl_vat!r}, "
120
+ f"incl_vat={_incl_vat!r}, "
121
+ f"vat={_vat!r}, "
122
+ f"additional_properties={_additional_properties!r}, "
123
+ f")"
124
+ )
125
+
126
+ def __str__(self):
127
+ """Return a human-readable string representation."""
128
+ _excl_vat=(
129
+ self.excl_vat
130
+ if hasattr(self, "excl_vat")
131
+ else None
132
+ )
133
+ _incl_vat=(
134
+ self.incl_vat
135
+ if hasattr(self, "incl_vat")
136
+ else None
137
+ )
138
+ _vat=(
139
+ self.vat
140
+ if hasattr(self, "vat")
141
+ else None
142
+ )
143
+ _additional_properties=self.additional_properties
144
+ return (
145
+ f"{self.__class__.__name__}("
146
+ f"excl_vat={_excl_vat!s}, "
147
+ f"incl_vat={_incl_vat!s}, "
148
+ f"vat={_vat!s}, "
149
+ f"additional_properties={_additional_properties!s}, "
150
+ f")"
151
+ )
@@ -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 TouSettings(object):
13
+ """Implementation of the 'TouSettings' model.
14
+
15
+ Attributes:
16
+ tariff_content_v_2 (Any): The model property of type Any.
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
+ "tariff_content_v_2": "tariff_content_v2",
25
+ }
26
+
27
+ _optionals = [
28
+ "tariff_content_v_2",
29
+ ]
30
+
31
+ def __init__(
32
+ self,
33
+ tariff_content_v_2=APIHelper.SKIP,
34
+ additional_properties=None):
35
+ """Initialize a TouSettings instance."""
36
+ # Initialize members of the class
37
+ if tariff_content_v_2 is not APIHelper.SKIP:
38
+ self.tariff_content_v_2 = tariff_content_v_2
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
+ tariff_content_v_2 =\
64
+ dictionary.get("tariff_content_v2")\
65
+ if dictionary.get("tariff_content_v2")\
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(tariff_content_v_2,
75
+ additional_properties)
76
+
77
+ def __repr__(self):
78
+ """Return a unambiguous string representation."""
79
+ _tariff_content_v_2=(
80
+ self.tariff_content_v_2
81
+ if hasattr(self, "tariff_content_v_2")
82
+ else None
83
+ )
84
+ _additional_properties=self.additional_properties
85
+ return (
86
+ f"{self.__class__.__name__}("
87
+ f"tariff_content_v_2={_tariff_content_v_2!r}, "
88
+ f"additional_properties={_additional_properties!r}, "
89
+ f")"
90
+ )
91
+
92
+ def __str__(self):
93
+ """Return a human-readable string representation."""
94
+ _tariff_content_v_2=(
95
+ self.tariff_content_v_2
96
+ if hasattr(self, "tariff_content_v_2")
97
+ else None
98
+ )
99
+ _additional_properties=self.additional_properties
100
+ return (
101
+ f"{self.__class__.__name__}("
102
+ f"tariff_content_v_2={_tariff_content_v_2!s}, "
103
+ f"additional_properties={_additional_properties!s}, "
104
+ f")"
105
+ )
@@ -0,0 +1,266 @@
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 VehicleBase(object):
13
+ """Implementation of the 'VehicleBase' model.
14
+
15
+ Attributes:
16
+ id (int): The model property of type int.
17
+ vehicle_id (int): The model property of type int.
18
+ vin (str): The model property of type str.
19
+ display_name (str): The model property of type str.
20
+ access_type (str): The model property of type str.
21
+ state (str): The model property of type str.
22
+ in_service (bool): The model property of type bool.
23
+ calendar_enabled (bool): The model property of type bool.
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
+ "id": "id",
32
+ "vehicle_id": "vehicle_id",
33
+ "vin": "vin",
34
+ "display_name": "display_name",
35
+ "access_type": "access_type",
36
+ "state": "state",
37
+ "in_service": "in_service",
38
+ "calendar_enabled": "calendar_enabled",
39
+ }
40
+
41
+ _optionals = [
42
+ "id",
43
+ "vehicle_id",
44
+ "vin",
45
+ "display_name",
46
+ "access_type",
47
+ "state",
48
+ "in_service",
49
+ "calendar_enabled",
50
+ ]
51
+
52
+ def __init__(
53
+ self,
54
+ id=APIHelper.SKIP,
55
+ vehicle_id=APIHelper.SKIP,
56
+ vin=APIHelper.SKIP,
57
+ display_name=APIHelper.SKIP,
58
+ access_type=APIHelper.SKIP,
59
+ state=APIHelper.SKIP,
60
+ in_service=APIHelper.SKIP,
61
+ calendar_enabled=APIHelper.SKIP,
62
+ additional_properties=None):
63
+ """Initialize a VehicleBase instance."""
64
+ # Initialize members of the class
65
+ if id is not APIHelper.SKIP:
66
+ self.id = id
67
+ if vehicle_id is not APIHelper.SKIP:
68
+ self.vehicle_id = vehicle_id
69
+ if vin is not APIHelper.SKIP:
70
+ self.vin = vin
71
+ if display_name is not APIHelper.SKIP:
72
+ self.display_name = display_name
73
+ if access_type is not APIHelper.SKIP:
74
+ self.access_type = access_type
75
+ if state is not APIHelper.SKIP:
76
+ self.state = state
77
+ if in_service is not APIHelper.SKIP:
78
+ self.in_service = in_service
79
+ if calendar_enabled is not APIHelper.SKIP:
80
+ self.calendar_enabled = calendar_enabled
81
+
82
+ # Add additional model properties to the instance
83
+ if additional_properties is None:
84
+ additional_properties = {}
85
+ self.additional_properties = additional_properties
86
+
87
+ @classmethod
88
+ def from_dictionary(cls,
89
+ dictionary):
90
+ """Create an instance of this model from a dictionary
91
+
92
+ Args:
93
+ dictionary (dictionary): A dictionary representation of the object
94
+ as obtained from the deserialization of the server's response. The
95
+ keys MUST match property names in the API description.
96
+
97
+ Returns:
98
+ object: An instance of this structure class.
99
+
100
+ """
101
+ if not isinstance(dictionary, dict) or dictionary is None:
102
+ return None
103
+
104
+ # Extract variables from the dictionary
105
+ id =\
106
+ dictionary.get("id")\
107
+ if dictionary.get("id")\
108
+ else APIHelper.SKIP
109
+ vehicle_id =\
110
+ dictionary.get("vehicle_id")\
111
+ if dictionary.get("vehicle_id")\
112
+ else APIHelper.SKIP
113
+ vin =\
114
+ dictionary.get("vin")\
115
+ if dictionary.get("vin")\
116
+ else APIHelper.SKIP
117
+ display_name =\
118
+ dictionary.get("display_name")\
119
+ if dictionary.get("display_name")\
120
+ else APIHelper.SKIP
121
+ access_type =\
122
+ dictionary.get("access_type")\
123
+ if dictionary.get("access_type")\
124
+ else APIHelper.SKIP
125
+ state =\
126
+ dictionary.get("state")\
127
+ if dictionary.get("state")\
128
+ else APIHelper.SKIP
129
+ in_service =\
130
+ dictionary.get("in_service")\
131
+ if "in_service" in dictionary.keys()\
132
+ else APIHelper.SKIP
133
+ calendar_enabled =\
134
+ dictionary.get("calendar_enabled")\
135
+ if "calendar_enabled" in dictionary.keys()\
136
+ else APIHelper.SKIP
137
+
138
+ additional_properties = APIHelper.get_additional_properties(
139
+ dictionary={k: v for k, v in dictionary.items()
140
+ if k not in cls._names.values()},
141
+ unboxing_function=lambda value: value)
142
+
143
+ # Return an object of this model
144
+ return cls(id,
145
+ vehicle_id,
146
+ vin,
147
+ display_name,
148
+ access_type,
149
+ state,
150
+ in_service,
151
+ calendar_enabled,
152
+ additional_properties)
153
+
154
+ def __repr__(self):
155
+ """Return a unambiguous string representation."""
156
+ _id=(
157
+ self.id
158
+ if hasattr(self, "id")
159
+ else None
160
+ )
161
+ _vehicle_id=(
162
+ self.vehicle_id
163
+ if hasattr(self, "vehicle_id")
164
+ else None
165
+ )
166
+ _vin=(
167
+ self.vin
168
+ if hasattr(self, "vin")
169
+ else None
170
+ )
171
+ _display_name=(
172
+ self.display_name
173
+ if hasattr(self, "display_name")
174
+ else None
175
+ )
176
+ _access_type=(
177
+ self.access_type
178
+ if hasattr(self, "access_type")
179
+ else None
180
+ )
181
+ _state=(
182
+ self.state
183
+ if hasattr(self, "state")
184
+ else None
185
+ )
186
+ _in_service=(
187
+ self.in_service
188
+ if hasattr(self, "in_service")
189
+ else None
190
+ )
191
+ _calendar_enabled=(
192
+ self.calendar_enabled
193
+ if hasattr(self, "calendar_enabled")
194
+ else None
195
+ )
196
+ _additional_properties=self.additional_properties
197
+ return (
198
+ f"{self.__class__.__name__}("
199
+ f"id={_id!r}, "
200
+ f"vehicle_id={_vehicle_id!r}, "
201
+ f"vin={_vin!r}, "
202
+ f"display_name={_display_name!r}, "
203
+ f"access_type={_access_type!r}, "
204
+ f"state={_state!r}, "
205
+ f"in_service={_in_service!r}, "
206
+ f"calendar_enabled={_calendar_enabled!r}, "
207
+ f"additional_properties={_additional_properties!r}, "
208
+ f")"
209
+ )
210
+
211
+ def __str__(self):
212
+ """Return a human-readable string representation."""
213
+ _id=(
214
+ self.id
215
+ if hasattr(self, "id")
216
+ else None
217
+ )
218
+ _vehicle_id=(
219
+ self.vehicle_id
220
+ if hasattr(self, "vehicle_id")
221
+ else None
222
+ )
223
+ _vin=(
224
+ self.vin
225
+ if hasattr(self, "vin")
226
+ else None
227
+ )
228
+ _display_name=(
229
+ self.display_name
230
+ if hasattr(self, "display_name")
231
+ else None
232
+ )
233
+ _access_type=(
234
+ self.access_type
235
+ if hasattr(self, "access_type")
236
+ else None
237
+ )
238
+ _state=(
239
+ self.state
240
+ if hasattr(self, "state")
241
+ else None
242
+ )
243
+ _in_service=(
244
+ self.in_service
245
+ if hasattr(self, "in_service")
246
+ else None
247
+ )
248
+ _calendar_enabled=(
249
+ self.calendar_enabled
250
+ if hasattr(self, "calendar_enabled")
251
+ else None
252
+ )
253
+ _additional_properties=self.additional_properties
254
+ return (
255
+ f"{self.__class__.__name__}("
256
+ f"id={_id!s}, "
257
+ f"vehicle_id={_vehicle_id!s}, "
258
+ f"vin={_vin!s}, "
259
+ f"display_name={_display_name!s}, "
260
+ f"access_type={_access_type!s}, "
261
+ f"state={_state!s}, "
262
+ f"in_service={_in_service!s}, "
263
+ f"calendar_enabled={_calendar_enabled!s}, "
264
+ f"additional_properties={_additional_properties!s}, "
265
+ f")"
266
+ )
@@ -0,0 +1,178 @@
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 VehicleOption(object):
13
+ """Implementation of the 'VehicleOption' model.
14
+
15
+ Attributes:
16
+ code (str): The model property of type str.
17
+ display_name (str): The model property of type str.
18
+ color_code (str): The model property of type str.
19
+ is_active (bool): The model property of type bool.
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
+ "code": "code",
28
+ "display_name": "displayName",
29
+ "color_code": "colorCode",
30
+ "is_active": "isActive",
31
+ }
32
+
33
+ _optionals = [
34
+ "code",
35
+ "display_name",
36
+ "color_code",
37
+ "is_active",
38
+ ]
39
+
40
+ _nullables = [
41
+ "color_code",
42
+ ]
43
+
44
+ def __init__(
45
+ self,
46
+ code=APIHelper.SKIP,
47
+ display_name=APIHelper.SKIP,
48
+ color_code=APIHelper.SKIP,
49
+ is_active=APIHelper.SKIP,
50
+ additional_properties=None):
51
+ """Initialize a VehicleOption instance."""
52
+ # Initialize members of the class
53
+ if code is not APIHelper.SKIP:
54
+ self.code = code
55
+ if display_name is not APIHelper.SKIP:
56
+ self.display_name = display_name
57
+ if color_code is not APIHelper.SKIP:
58
+ self.color_code = color_code
59
+ if is_active is not APIHelper.SKIP:
60
+ self.is_active = is_active
61
+
62
+ # Add additional model properties to the instance
63
+ if additional_properties is None:
64
+ additional_properties = {}
65
+ self.additional_properties = additional_properties
66
+
67
+ @classmethod
68
+ def from_dictionary(cls,
69
+ dictionary):
70
+ """Create an instance of this model from a dictionary
71
+
72
+ Args:
73
+ dictionary (dictionary): A dictionary representation of the object
74
+ as obtained from the deserialization of the server's response. The
75
+ keys MUST match property names in the API description.
76
+
77
+ Returns:
78
+ object: An instance of this structure class.
79
+
80
+ """
81
+ if not isinstance(dictionary, dict) or dictionary is None:
82
+ return None
83
+
84
+ # Extract variables from the dictionary
85
+ code =\
86
+ dictionary.get("code")\
87
+ if dictionary.get("code")\
88
+ else APIHelper.SKIP
89
+ display_name =\
90
+ dictionary.get("displayName")\
91
+ if dictionary.get("displayName")\
92
+ else APIHelper.SKIP
93
+ color_code =\
94
+ dictionary.get("colorCode")\
95
+ if "colorCode" in dictionary.keys()\
96
+ else APIHelper.SKIP
97
+ is_active =\
98
+ dictionary.get("isActive")\
99
+ if "isActive" in dictionary.keys()\
100
+ else APIHelper.SKIP
101
+
102
+ additional_properties = APIHelper.get_additional_properties(
103
+ dictionary={k: v for k, v in dictionary.items()
104
+ if k not in cls._names.values()},
105
+ unboxing_function=lambda value: value)
106
+
107
+ # Return an object of this model
108
+ return cls(code,
109
+ display_name,
110
+ color_code,
111
+ is_active,
112
+ additional_properties)
113
+
114
+ def __repr__(self):
115
+ """Return a unambiguous string representation."""
116
+ _code=(
117
+ self.code
118
+ if hasattr(self, "code")
119
+ else None
120
+ )
121
+ _display_name=(
122
+ self.display_name
123
+ if hasattr(self, "display_name")
124
+ else None
125
+ )
126
+ _color_code=(
127
+ self.color_code
128
+ if hasattr(self, "color_code")
129
+ else None
130
+ )
131
+ _is_active=(
132
+ self.is_active
133
+ if hasattr(self, "is_active")
134
+ else None
135
+ )
136
+ _additional_properties=self.additional_properties
137
+ return (
138
+ f"{self.__class__.__name__}("
139
+ f"code={_code!r}, "
140
+ f"display_name={_display_name!r}, "
141
+ f"color_code={_color_code!r}, "
142
+ f"is_active={_is_active!r}, "
143
+ f"additional_properties={_additional_properties!r}, "
144
+ f")"
145
+ )
146
+
147
+ def __str__(self):
148
+ """Return a human-readable string representation."""
149
+ _code=(
150
+ self.code
151
+ if hasattr(self, "code")
152
+ else None
153
+ )
154
+ _display_name=(
155
+ self.display_name
156
+ if hasattr(self, "display_name")
157
+ else None
158
+ )
159
+ _color_code=(
160
+ self.color_code
161
+ if hasattr(self, "color_code")
162
+ else None
163
+ )
164
+ _is_active=(
165
+ self.is_active
166
+ if hasattr(self, "is_active")
167
+ else None
168
+ )
169
+ _additional_properties=self.additional_properties
170
+ return (
171
+ f"{self.__class__.__name__}("
172
+ f"code={_code!s}, "
173
+ f"display_name={_display_name!s}, "
174
+ f"color_code={_color_code!s}, "
175
+ f"is_active={_is_active!s}, "
176
+ f"additional_properties={_additional_properties!s}, "
177
+ f")"
178
+ )