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,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_live_status_response import (
11
+ ResponseLiveStatusResponse,
12
+ )
13
+
14
+
15
+ class LiveStatusResponse(object):
16
+ """Implementation of the 'LiveStatusResponse' model.
17
+
18
+ Attributes:
19
+ response (ResponseLiveStatusResponse): The model property of type
20
+ ResponseLiveStatusResponse.
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 LiveStatusResponse 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
+ ResponseLiveStatusResponse.from_dictionary(
64
+ dictionary.get("response"))\
65
+ if dictionary.get("response") else None
66
+
67
+ additional_properties = APIHelper.get_additional_properties(
68
+ dictionary={k: v for k, v in dictionary.items()
69
+ if k not in cls._names.values()},
70
+ unboxing_function=lambda value: value)
71
+
72
+ # Return an object of this model
73
+ return cls(response,
74
+ additional_properties)
75
+
76
+ def __repr__(self):
77
+ """Return a unambiguous string representation."""
78
+ _response=self.response
79
+ _additional_properties=self.additional_properties
80
+ return (
81
+ f"{self.__class__.__name__}("
82
+ f"response={_response!r}, "
83
+ f"additional_properties={_additional_properties!r}, "
84
+ f")"
85
+ )
86
+
87
+ def __str__(self):
88
+ """Return a human-readable string representation."""
89
+ _response=self.response
90
+ _additional_properties=self.additional_properties
91
+ return (
92
+ f"{self.__class__.__name__}("
93
+ f"response={_response!s}, "
94
+ f"additional_properties={_additional_properties!s}, "
95
+ f")"
96
+ )
@@ -0,0 +1,128 @@
1
+ """teslafleetmanagementapi.
2
+
3
+ This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
4
+ """
5
+
6
+ # ruff: noqa: E501
7
+ from teslafleetmanagementapi.api_helper import (
8
+ APIHelper,
9
+ )
10
+
11
+
12
+ class Location(object):
13
+ """Implementation of the 'Location' model.
14
+
15
+ Attributes:
16
+ country (str): The model property of type str.
17
+ name (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
+ "country": "country",
26
+ "name": "name",
27
+ }
28
+
29
+ _optionals = [
30
+ "country",
31
+ "name",
32
+ ]
33
+
34
+ def __init__(
35
+ self,
36
+ country=APIHelper.SKIP,
37
+ name=APIHelper.SKIP,
38
+ additional_properties=None):
39
+ """Initialize a Location instance."""
40
+ # Initialize members of the class
41
+ if country is not APIHelper.SKIP:
42
+ self.country = country
43
+ if name is not APIHelper.SKIP:
44
+ self.name = name
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
+ country =\
70
+ dictionary.get("country")\
71
+ if dictionary.get("country")\
72
+ else APIHelper.SKIP
73
+ name =\
74
+ dictionary.get("name")\
75
+ if dictionary.get("name")\
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(country,
85
+ name,
86
+ additional_properties)
87
+
88
+ def __repr__(self):
89
+ """Return a unambiguous string representation."""
90
+ _country=(
91
+ self.country
92
+ if hasattr(self, "country")
93
+ else None
94
+ )
95
+ _name=(
96
+ self.name
97
+ if hasattr(self, "name")
98
+ else None
99
+ )
100
+ _additional_properties=self.additional_properties
101
+ return (
102
+ f"{self.__class__.__name__}("
103
+ f"country={_country!r}, "
104
+ f"name={_name!r}, "
105
+ f"additional_properties={_additional_properties!r}, "
106
+ f")"
107
+ )
108
+
109
+ def __str__(self):
110
+ """Return a human-readable string representation."""
111
+ _country=(
112
+ self.country
113
+ if hasattr(self, "country")
114
+ else None
115
+ )
116
+ _name=(
117
+ self.name
118
+ if hasattr(self, "name")
119
+ else None
120
+ )
121
+ _additional_properties=self.additional_properties
122
+ return (
123
+ f"{self.__class__.__name__}("
124
+ f"country={_country!s}, "
125
+ f"name={_name!s}, "
126
+ f"additional_properties={_additional_properties!s}, "
127
+ f")"
128
+ )
@@ -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 Location1(object):
13
+ """Implementation of the 'Location1' model.
14
+
15
+ Attributes:
16
+ lat (float): The model property of type float.
17
+ long (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
+ "lat": "lat",
26
+ "long": "long",
27
+ }
28
+
29
+ _optionals = [
30
+ "lat",
31
+ "long",
32
+ ]
33
+
34
+ def __init__(
35
+ self,
36
+ lat=APIHelper.SKIP,
37
+ long=APIHelper.SKIP,
38
+ additional_properties=None):
39
+ """Initialize a Location1 instance."""
40
+ # Initialize members of the class
41
+ if lat is not APIHelper.SKIP:
42
+ self.lat = lat
43
+ if long is not APIHelper.SKIP:
44
+ self.long = long
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
+ lat =\
70
+ dictionary.get("lat")\
71
+ if dictionary.get("lat")\
72
+ else APIHelper.SKIP
73
+ long =\
74
+ dictionary.get("long")\
75
+ if dictionary.get("long")\
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(lat,
85
+ long,
86
+ additional_properties)
87
+
88
+ def __repr__(self):
89
+ """Return a unambiguous string representation."""
90
+ _lat=(
91
+ self.lat
92
+ if hasattr(self, "lat")
93
+ else None
94
+ )
95
+ _long=(
96
+ self.long
97
+ if hasattr(self, "long")
98
+ else None
99
+ )
100
+ _additional_properties=self.additional_properties
101
+ return (
102
+ f"{self.__class__.__name__}("
103
+ f"lat={_lat!r}, "
104
+ f"long={_long!r}, "
105
+ f"additional_properties={_additional_properties!r}, "
106
+ f")"
107
+ )
108
+
109
+ def __str__(self):
110
+ """Return a human-readable string representation."""
111
+ _lat=(
112
+ self.lat
113
+ if hasattr(self, "lat")
114
+ else None
115
+ )
116
+ _long=(
117
+ self.long
118
+ if hasattr(self, "long")
119
+ else None
120
+ )
121
+ _additional_properties=self.additional_properties
122
+ return (
123
+ f"{self.__class__.__name__}("
124
+ f"lat={_lat!s}, "
125
+ f"long={_long!s}, "
126
+ f"additional_properties={_additional_properties!s}, "
127
+ f")"
128
+ )
@@ -0,0 +1,95 @@
1
+ """teslafleetmanagementapi.
2
+
3
+ This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
4
+ """
5
+
6
+ # ruff: noqa: E501
7
+ from teslafleetmanagementapi.api_helper import (
8
+ APIHelper,
9
+ )
10
+ from teslafleetmanagementapi.models.response_me_response import (
11
+ ResponseMeResponse,
12
+ )
13
+
14
+
15
+ class MeResponse(object):
16
+ """Implementation of the 'MeResponse' model.
17
+
18
+ Attributes:
19
+ response (ResponseMeResponse): The model property of type ResponseMeResponse.
20
+ additional_properties (Dict[str, Any]): The additional properties for the
21
+ model.
22
+
23
+ """
24
+
25
+ # Create a mapping from Model property names to API property names
26
+ _names = {
27
+ "response": "response",
28
+ }
29
+
30
+ def __init__(
31
+ self,
32
+ response=None,
33
+ additional_properties=None):
34
+ """Initialize a MeResponse instance."""
35
+ # Initialize members of the class
36
+ self.response = response
37
+
38
+ # Add additional model properties to the instance
39
+ if additional_properties is None:
40
+ additional_properties = {}
41
+ self.additional_properties = additional_properties
42
+
43
+ @classmethod
44
+ def from_dictionary(cls,
45
+ dictionary):
46
+ """Create an instance of this model from a dictionary
47
+
48
+ Args:
49
+ dictionary (dictionary): A dictionary representation of the object
50
+ as obtained from the deserialization of the server's response. The
51
+ keys MUST match property names in the API description.
52
+
53
+ Returns:
54
+ object: An instance of this structure class.
55
+
56
+ """
57
+ if not isinstance(dictionary, dict) or dictionary is None:
58
+ return None
59
+
60
+ # Extract variables from the dictionary
61
+ response =\
62
+ ResponseMeResponse.from_dictionary(
63
+ dictionary.get("response"))\
64
+ if dictionary.get("response") else None
65
+
66
+ additional_properties = APIHelper.get_additional_properties(
67
+ dictionary={k: v for k, v in dictionary.items()
68
+ if k not in cls._names.values()},
69
+ unboxing_function=lambda value: value)
70
+
71
+ # Return an object of this model
72
+ return cls(response,
73
+ additional_properties)
74
+
75
+ def __repr__(self):
76
+ """Return a unambiguous string representation."""
77
+ _response=self.response
78
+ _additional_properties=self.additional_properties
79
+ return (
80
+ f"{self.__class__.__name__}("
81
+ f"response={_response!r}, "
82
+ f"additional_properties={_additional_properties!r}, "
83
+ f")"
84
+ )
85
+
86
+ def __str__(self):
87
+ """Return a human-readable string representation."""
88
+ _response=self.response
89
+ _additional_properties=self.additional_properties
90
+ return (
91
+ f"{self.__class__.__name__}("
92
+ f"response={_response!s}, "
93
+ f"additional_properties={_additional_properties!s}, "
94
+ f")"
95
+ )
@@ -0,0 +1,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 MobileEnabled(object):
13
+ """Implementation of the 'MobileEnabled' model.
14
+
15
+ Attributes:
16
+ result (bool): The model property of type bool.
17
+ reason (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
+ "result": "result",
26
+ "reason": "reason",
27
+ }
28
+
29
+ _optionals = [
30
+ "result",
31
+ "reason",
32
+ ]
33
+
34
+ def __init__(
35
+ self,
36
+ result=APIHelper.SKIP,
37
+ reason=APIHelper.SKIP,
38
+ additional_properties=None):
39
+ """Initialize a MobileEnabled instance."""
40
+ # Initialize members of the class
41
+ if result is not APIHelper.SKIP:
42
+ self.result = result
43
+ if reason is not APIHelper.SKIP:
44
+ self.reason = reason
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
+ result =\
70
+ dictionary.get("result")\
71
+ if "result" in dictionary.keys()\
72
+ else APIHelper.SKIP
73
+ reason =\
74
+ dictionary.get("reason")\
75
+ if dictionary.get("reason")\
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(result,
85
+ reason,
86
+ additional_properties)
87
+
88
+ def __repr__(self):
89
+ """Return a unambiguous string representation."""
90
+ _result=(
91
+ self.result
92
+ if hasattr(self, "result")
93
+ else None
94
+ )
95
+ _reason=(
96
+ self.reason
97
+ if hasattr(self, "reason")
98
+ else None
99
+ )
100
+ _additional_properties=self.additional_properties
101
+ return (
102
+ f"{self.__class__.__name__}("
103
+ f"result={_result!r}, "
104
+ f"reason={_reason!r}, "
105
+ f"additional_properties={_additional_properties!r}, "
106
+ f")"
107
+ )
108
+
109
+ def __str__(self):
110
+ """Return a human-readable string representation."""
111
+ _result=(
112
+ self.result
113
+ if hasattr(self, "result")
114
+ else None
115
+ )
116
+ _reason=(
117
+ self.reason
118
+ if hasattr(self, "reason")
119
+ else None
120
+ )
121
+ _additional_properties=self.additional_properties
122
+ return (
123
+ f"{self.__class__.__name__}("
124
+ f"result={_result!s}, "
125
+ f"reason={_reason!s}, "
126
+ f"additional_properties={_additional_properties!s}, "
127
+ f")"
128
+ )
@@ -0,0 +1,67 @@
1
+ """teslafleetmanagementapi.
2
+
3
+ This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
4
+ """
5
+
6
+ # ruff: noqa: E501
7
+
8
+ class OauthProviderError(object):
9
+ """Implementation of the 'OAuthProviderError' enum.
10
+
11
+ OAuth 2 Authorization error codes
12
+
13
+ Attributes:
14
+ INVALID_REQUEST: The request is missing a required parameter, includes an
15
+ unsupported parameter value (other than grant type), repeats a parameter,
16
+ includes multiple credentials, utilizes more than one mechanism for
17
+ authenticating the client, or is otherwise malformed.
18
+ INVALID_CLIENT: Client authentication failed (e.g., unknown client, no client
19
+ authentication included, or unsupported authentication method).
20
+ INVALID_GRANT: The provided authorization grant (e.g., authorization code,
21
+ resource owner credentials) or refresh token is invalid, expired,
22
+ revoked, does not match the redirection URI used in the authorization
23
+ request, or was issued to another client.
24
+ UNAUTHORIZED_CLIENT: The authenticated client is not authorized to use this
25
+ authorization grant type.
26
+ UNSUPPORTED_GRANT_TYPE: The authorization grant type is not supported by the
27
+ authorization server.
28
+ INVALID_SCOPE: The requested scope is invalid, unknown, malformed, or exceeds
29
+ the scope granted by the resource owner.
30
+
31
+ """
32
+
33
+ INVALID_REQUEST = "invalid_request"
34
+
35
+ INVALID_CLIENT = "invalid_client"
36
+
37
+ INVALID_GRANT = "invalid_grant"
38
+
39
+ UNAUTHORIZED_CLIENT = "unauthorized_client"
40
+
41
+ UNSUPPORTED_GRANT_TYPE = "unsupported_grant_type"
42
+
43
+ INVALID_SCOPE = "invalid_scope"
44
+
45
+ @classmethod
46
+ def from_value(cls, value, default=None):
47
+ """Return the matching enum value for the given input."""
48
+ if value is None:
49
+ return default
50
+
51
+ # If numeric and matches directly
52
+ if isinstance(value, int):
53
+ for name, val in cls.__dict__.items():
54
+ if not name.startswith("_") and val == value:
55
+ return val
56
+
57
+ # If string, perform case-insensitive match
58
+ if isinstance(value, str):
59
+ value_lower = value.lower()
60
+ for name, val in cls.__dict__.items():
61
+ if not name.startswith("_") and (
62
+ name.lower() == value_lower or str(val).lower() == value_lower
63
+ ):
64
+ return val
65
+
66
+ # Fallback to default
67
+ return default