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,70 @@
1
+ """teslafleetmanagementapi.
2
+
3
+ This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
4
+ """
5
+
6
+ import platform
7
+
8
+ from apimatic_core.api_call import ApiCall
9
+ from apimatic_core.types.error_case import ErrorCase
10
+
11
+ from teslafleetmanagementapi.exceptions.api_exception import (
12
+ ApiException,
13
+ )
14
+
15
+
16
+ class BaseController(object):
17
+ """All controllers inherit from this base class.
18
+
19
+ Attributes:
20
+ config (Configuration): The HttpClient which a specific controller
21
+ instance will use. By default all the controller objects share
22
+ the same HttpClient. A user can use his own custom HttpClient
23
+ as well.
24
+ http_call_back (HttpCallBack): An object which holds call back
25
+ methods to be called before and after the execution of an HttpRequest.
26
+ new_api_call_builder (APICall): Returns the API Call builder instance.
27
+
28
+ """
29
+
30
+ @staticmethod
31
+ def user_agent():
32
+ """Return UserAgent value."""
33
+ return "Python SDK, Version: 1.0.0, on OS {os-info}"
34
+
35
+ @staticmethod
36
+ def user_agent_parameters():
37
+ """Return UserAgentParameters value."""
38
+ return {
39
+ "os-info": {"value": platform.system(), "encode": False},
40
+ }
41
+
42
+ @staticmethod
43
+ def global_errors():
44
+ """Return GlobalErrors value."""
45
+ return {
46
+ "default": ErrorCase()
47
+ .error_message("HTTP response not OK.")
48
+ .exception_type(ApiException),
49
+ }
50
+
51
+ def __init__(self, config):
52
+ """Initialize BaseController object."""
53
+ self._config = config.get_http_client_configuration()
54
+ self._http_call_back = self.config.http_callback
55
+ self.api_call = ApiCall(config)
56
+
57
+ @property
58
+ def config(self):
59
+ """Return Configuration object."""
60
+ return self._config
61
+
62
+ @property
63
+ def http_call_back(self):
64
+ """Return HttpCallBack object."""
65
+ return self._http_call_back
66
+
67
+ @property
68
+ def new_api_call_builder(self):
69
+ """Return New ApiCallBuilder object."""
70
+ return self.api_call.new_builder
@@ -0,0 +1,140 @@
1
+ """teslafleetmanagementapi.
2
+
3
+ This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
4
+ """
5
+
6
+ # ruff: noqa: D410, E501, E101, D206
7
+ from apimatic_core.authentication.multiple.single_auth import (
8
+ Single,
9
+ )
10
+ from apimatic_core.request_builder import RequestBuilder
11
+ from apimatic_core.response_handler import ResponseHandler
12
+ from apimatic_core.types.parameter import Parameter
13
+
14
+ from teslafleetmanagementapi.api_helper import (
15
+ APIHelper,
16
+ )
17
+ from teslafleetmanagementapi.configuration import (
18
+ Server,
19
+ )
20
+ from teslafleetmanagementapi.controllers.base_controller import (
21
+ BaseController,
22
+ )
23
+ from teslafleetmanagementapi.http.http_method_enum import (
24
+ HttpMethodEnum,
25
+ )
26
+ from teslafleetmanagementapi.models.charging_history_response import (
27
+ ChargingHistoryResponse,
28
+ )
29
+ from teslafleetmanagementapi.models.charging_sessions_response import (
30
+ ChargingSessionsResponse,
31
+ )
32
+
33
+
34
+ class ChargingController(BaseController):
35
+ """A Controller to access Endpoints in the teslafleetmanagementapi API."""
36
+
37
+ def __init__(self, config):
38
+ """Initialize ChargingController object."""
39
+ super(ChargingController, self).__init__(config)
40
+
41
+ def get_charging_history(self):
42
+ """Perform a GET request to /api/1/dx/charging/history.
43
+
44
+ Returns the paginated charging history for the authenticated account.
45
+
46
+ Returns:
47
+ ApiResponse: An object with the response value as well as other useful
48
+ information such as status codes and headers. Charging history
49
+ retrieved successfully
50
+
51
+ Raises:
52
+ ApiException: When an error occurs while fetching the data from the
53
+ remote API. This exception includes the HTTP Response code, an error
54
+ message, and the HTTP body that was received in the request.
55
+
56
+ """
57
+ return super().new_api_call_builder.request(
58
+ RequestBuilder().server(Server.DEFAULT)
59
+ .path("/api/1/dx/charging/history")
60
+ .http_method(HttpMethodEnum.GET)
61
+ .header_param(Parameter()
62
+ .key("accept")
63
+ .value("application/json"))
64
+ .auth(Single("bearerAuth")),
65
+ ).response(
66
+ ResponseHandler()
67
+ .deserializer(APIHelper.json_deserialize)
68
+ .deserialize_into(ChargingHistoryResponse.from_dictionary)
69
+ .is_api_response(True),
70
+ ).execute()
71
+
72
+ def get_charging_invoice(self,
73
+ id):
74
+ """Perform a GET request to /api/1/dx/charging/invoice/{id}.
75
+
76
+ Returns a charging invoice PDF for a charging session.
77
+
78
+ Args:
79
+ id (str): Charging session invoice identifier
80
+
81
+ Returns:
82
+ ApiResponse: An object with the response value as well as other useful
83
+ information such as status codes and headers. Invoice PDF document
84
+
85
+ Raises:
86
+ ApiException: When an error occurs while fetching the data from the
87
+ remote API. This exception includes the HTTP Response code, an error
88
+ message, and the HTTP body that was received in the request.
89
+
90
+ """
91
+ return super().new_api_call_builder.request(
92
+ RequestBuilder().server(Server.DEFAULT)
93
+ .path("/api/1/dx/charging/invoice/{id}")
94
+ .http_method(HttpMethodEnum.GET)
95
+ .template_param(Parameter()
96
+ .key("id")
97
+ .value(id)
98
+ .is_required(True)
99
+ .should_encode(True))
100
+ .header_param(Parameter()
101
+ .key("accept")
102
+ .value("application/json"))
103
+ .auth(Single("bearerAuth")),
104
+ ).response(
105
+ ResponseHandler()
106
+ .deserializer(APIHelper.dynamic_deserialize)
107
+ .is_api_response(True),
108
+ ).execute()
109
+
110
+ def get_charging_sessions(self):
111
+ """Perform a GET request to /api/1/dx/charging/sessions.
112
+
113
+ Returns charging session information. Only available for business fleet
114
+ owners.
115
+
116
+ Returns:
117
+ ApiResponse: An object with the response value as well as other useful
118
+ information such as status codes and headers. Charging sessions
119
+ retrieved successfully
120
+
121
+ Raises:
122
+ ApiException: When an error occurs while fetching the data from the
123
+ remote API. This exception includes the HTTP Response code, an error
124
+ message, and the HTTP body that was received in the request.
125
+
126
+ """
127
+ return super().new_api_call_builder.request(
128
+ RequestBuilder().server(Server.DEFAULT)
129
+ .path("/api/1/dx/charging/sessions")
130
+ .http_method(HttpMethodEnum.GET)
131
+ .header_param(Parameter()
132
+ .key("accept")
133
+ .value("application/json"))
134
+ .auth(Single("bearerAuth")),
135
+ ).response(
136
+ ResponseHandler()
137
+ .deserializer(APIHelper.json_deserialize)
138
+ .deserialize_into(ChargingSessionsResponse.from_dictionary)
139
+ .is_api_response(True),
140
+ ).execute()