tesla-api-sdk 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tesla_api_sdk-1.0.0.dist-info/METADATA +145 -0
- tesla_api_sdk-1.0.0.dist-info/RECORD +119 -0
- tesla_api_sdk-1.0.0.dist-info/WHEEL +5 -0
- tesla_api_sdk-1.0.0.dist-info/licenses/LICENSE +28 -0
- tesla_api_sdk-1.0.0.dist-info/top_level.txt +1 -0
- teslafleetmanagementapi/__init__.py +13 -0
- teslafleetmanagementapi/api_helper.py +19 -0
- teslafleetmanagementapi/configuration.py +270 -0
- teslafleetmanagementapi/controllers/__init__.py +11 -0
- teslafleetmanagementapi/controllers/base_controller.py +70 -0
- teslafleetmanagementapi/controllers/charging_controller.py +140 -0
- teslafleetmanagementapi/controllers/energy_controller.py +572 -0
- teslafleetmanagementapi/controllers/oauth_authorization_controller.py +165 -0
- teslafleetmanagementapi/controllers/partner_controller.py +181 -0
- teslafleetmanagementapi/controllers/user_controller.py +158 -0
- teslafleetmanagementapi/controllers/vehicles_controller.py +832 -0
- teslafleetmanagementapi/exceptions/__init__.py +6 -0
- teslafleetmanagementapi/exceptions/api_exception.py +36 -0
- teslafleetmanagementapi/exceptions/oauth_provider_exception.py +75 -0
- teslafleetmanagementapi/http/__init__.py +11 -0
- teslafleetmanagementapi/http/api_response.py +67 -0
- teslafleetmanagementapi/http/auth/__init__.py +6 -0
- teslafleetmanagementapi/http/auth/bearer_auth.py +103 -0
- teslafleetmanagementapi/http/auth/oauth_2.py +311 -0
- teslafleetmanagementapi/http/http_call_back.py +20 -0
- teslafleetmanagementapi/http/http_client_provider.py +23 -0
- teslafleetmanagementapi/http/http_method_enum.py +25 -0
- teslafleetmanagementapi/http/http_request.py +55 -0
- teslafleetmanagementapi/http/http_response.py +45 -0
- teslafleetmanagementapi/http/proxy_settings.py +50 -0
- teslafleetmanagementapi/logging/__init__.py +6 -0
- teslafleetmanagementapi/logging/configuration/__init__.py +5 -0
- teslafleetmanagementapi/logging/configuration/api_logging_configuration.py +398 -0
- teslafleetmanagementapi/logging/sdk_logger.py +28 -0
- teslafleetmanagementapi/models/__init__.py +85 -0
- teslafleetmanagementapi/models/api_1_dx_vehicles_options_response.py +110 -0
- teslafleetmanagementapi/models/api_1_dx_warranty_details_response.py +110 -0
- teslafleetmanagementapi/models/api_1_vehicles_mobile_enabled_response.py +109 -0
- teslafleetmanagementapi/models/api_1_vehicles_nearby_charging_sites_response.py +109 -0
- teslafleetmanagementapi/models/api_1_vehicles_response.py +162 -0
- teslafleetmanagementapi/models/api_1_vehicles_response_get_vehicle.py +109 -0
- teslafleetmanagementapi/models/api_1_vehicles_wake_up_response.py +109 -0
- teslafleetmanagementapi/models/backup_request.py +92 -0
- teslafleetmanagementapi/models/backup_response.py +95 -0
- teslafleetmanagementapi/models/calendar_history_response.py +96 -0
- teslafleetmanagementapi/models/charge_duration.py +92 -0
- teslafleetmanagementapi/models/charge_history.py +125 -0
- teslafleetmanagementapi/models/charge_history_response.py +96 -0
- teslafleetmanagementapi/models/charge_start_time.py +92 -0
- teslafleetmanagementapi/models/charging_dimension.py +128 -0
- teslafleetmanagementapi/models/charging_fee.py +641 -0
- teslafleetmanagementapi/models/charging_history_data.py +98 -0
- teslafleetmanagementapi/models/charging_history_item.py +336 -0
- teslafleetmanagementapi/models/charging_history_response.py +96 -0
- teslafleetmanagementapi/models/charging_invoice.py +151 -0
- teslafleetmanagementapi/models/charging_location.py +293 -0
- teslafleetmanagementapi/models/charging_period.py +136 -0
- teslafleetmanagementapi/models/charging_session.py +355 -0
- teslafleetmanagementapi/models/charging_sessions_data.py +182 -0
- teslafleetmanagementapi/models/charging_sessions_response.py +96 -0
- teslafleetmanagementapi/models/default_real_mode.py +45 -0
- teslafleetmanagementapi/models/driver.py +289 -0
- teslafleetmanagementapi/models/drivers_response.py +135 -0
- teslafleetmanagementapi/models/enterprise_payer_request.py +141 -0
- teslafleetmanagementapi/models/event.py +107 -0
- teslafleetmanagementapi/models/fleet_status_request.py +105 -0
- teslafleetmanagementapi/models/fleet_telemetry_error.py +118 -0
- teslafleetmanagementapi/models/fleet_telemetry_errors_response.py +96 -0
- teslafleetmanagementapi/models/fleet_telemetry_jws_request.py +128 -0
- teslafleetmanagementapi/models/generic_update_response.py +95 -0
- teslafleetmanagementapi/models/kind.py +45 -0
- teslafleetmanagementapi/models/kind_get_wall_connector_charging_history.py +42 -0
- teslafleetmanagementapi/models/live_status_response.py +96 -0
- teslafleetmanagementapi/models/location.py +128 -0
- teslafleetmanagementapi/models/location_1.py +128 -0
- teslafleetmanagementapi/models/me_response.py +95 -0
- teslafleetmanagementapi/models/mobile_enabled.py +128 -0
- teslafleetmanagementapi/models/oauth_provider_error.py +67 -0
- teslafleetmanagementapi/models/oauth_token.py +115 -0
- teslafleetmanagementapi/models/off_grid_vehicle_charging_reserve_request.py +95 -0
- teslafleetmanagementapi/models/operation_request.py +93 -0
- teslafleetmanagementapi/models/orders_response.py +111 -0
- teslafleetmanagementapi/models/pagination.py +225 -0
- teslafleetmanagementapi/models/price_component.py +151 -0
- teslafleetmanagementapi/models/products_response.py +128 -0
- teslafleetmanagementapi/models/public_key_response.py +96 -0
- teslafleetmanagementapi/models/region_response.py +96 -0
- teslafleetmanagementapi/models/register_partner_request.py +92 -0
- teslafleetmanagementapi/models/register_partner_response.py +96 -0
- teslafleetmanagementapi/models/response.py +105 -0
- teslafleetmanagementapi/models/response_1.py +92 -0
- teslafleetmanagementapi/models/response_2.py +95 -0
- teslafleetmanagementapi/models/response_3.py +164 -0
- teslafleetmanagementapi/models/response_api_1_dx_vehicles_options_response.py +112 -0
- teslafleetmanagementapi/models/response_api_1_dx_warranty_details_response.py +169 -0
- teslafleetmanagementapi/models/response_calendar_history_response.py +110 -0
- teslafleetmanagementapi/models/response_charge_history_response.py +98 -0
- teslafleetmanagementapi/models/response_fleet_telemetry_errors_response.py +98 -0
- teslafleetmanagementapi/models/response_live_status_response.py +310 -0
- teslafleetmanagementapi/models/response_me_response.py +131 -0
- teslafleetmanagementapi/models/response_orders_response.py +209 -0
- teslafleetmanagementapi/models/response_public_key_response.py +92 -0
- teslafleetmanagementapi/models/response_region_response.py +105 -0
- teslafleetmanagementapi/models/response_register_partner_response.py +331 -0
- teslafleetmanagementapi/models/signaling.py +118 -0
- teslafleetmanagementapi/models/simple_ok_response.py +105 -0
- teslafleetmanagementapi/models/site_info_response.py +105 -0
- teslafleetmanagementapi/models/storm_mode_request.py +92 -0
- teslafleetmanagementapi/models/tariff_element.py +136 -0
- teslafleetmanagementapi/models/tariffs.py +136 -0
- teslafleetmanagementapi/models/time_of_use_settings_request.py +95 -0
- teslafleetmanagementapi/models/total_cost.py +151 -0
- teslafleetmanagementapi/models/tou_settings.py +105 -0
- teslafleetmanagementapi/models/vehicle_base.py +266 -0
- teslafleetmanagementapi/models/vehicle_option.py +178 -0
- teslafleetmanagementapi/models/warranty_item.py +249 -0
- teslafleetmanagementapi/teslafleetmanagementapi_client.py +128 -0
- teslafleetmanagementapi/utilities/__init__.py +6 -0
- teslafleetmanagementapi/utilities/file_wrapper.py +45 -0
|
@@ -0,0 +1,572 @@
|
|
|
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.backup_response import (
|
|
27
|
+
BackupResponse,
|
|
28
|
+
)
|
|
29
|
+
from teslafleetmanagementapi.models.calendar_history_response import (
|
|
30
|
+
CalendarHistoryResponse,
|
|
31
|
+
)
|
|
32
|
+
from teslafleetmanagementapi.models.charge_history_response import (
|
|
33
|
+
ChargeHistoryResponse,
|
|
34
|
+
)
|
|
35
|
+
from teslafleetmanagementapi.models.generic_update_response import (
|
|
36
|
+
GenericUpdateResponse,
|
|
37
|
+
)
|
|
38
|
+
from teslafleetmanagementapi.models.live_status_response import (
|
|
39
|
+
LiveStatusResponse,
|
|
40
|
+
)
|
|
41
|
+
from teslafleetmanagementapi.models.products_response import (
|
|
42
|
+
ProductsResponse,
|
|
43
|
+
)
|
|
44
|
+
from teslafleetmanagementapi.models.site_info_response import (
|
|
45
|
+
SiteInfoResponse,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class EnergyController(BaseController):
|
|
50
|
+
"""A Controller to access Endpoints in the teslafleetmanagementapi API."""
|
|
51
|
+
|
|
52
|
+
def __init__(self, config):
|
|
53
|
+
"""Initialize EnergyController object."""
|
|
54
|
+
super(EnergyController, self).__init__(config)
|
|
55
|
+
|
|
56
|
+
def adjust_site_s_backup_reserve(self,
|
|
57
|
+
energy_site_id,
|
|
58
|
+
body):
|
|
59
|
+
"""Perform a POST request to
|
|
60
|
+
/api/1/energy_sites/{energy_site_id}/backup.
|
|
61
|
+
|
|
62
|
+
Args:
|
|
63
|
+
energy_site_id (str): The request template parameter.
|
|
64
|
+
body (BackupRequest): The request body parameter.
|
|
65
|
+
|
|
66
|
+
Returns:
|
|
67
|
+
ApiResponse: An object with the response value as well as other useful
|
|
68
|
+
information such as status codes and headers. Backup reserve updated
|
|
69
|
+
|
|
70
|
+
Raises:
|
|
71
|
+
ApiException: When an error occurs while fetching the data from the
|
|
72
|
+
remote API. This exception includes the HTTP Response code, an error
|
|
73
|
+
message, and the HTTP body that was received in the request.
|
|
74
|
+
|
|
75
|
+
"""
|
|
76
|
+
return super().new_api_call_builder.request(
|
|
77
|
+
RequestBuilder().server(Server.DEFAULT)
|
|
78
|
+
.path("/api/1/energy_sites/{energy_site_id}/backup")
|
|
79
|
+
.http_method(HttpMethodEnum.POST)
|
|
80
|
+
.template_param(Parameter()
|
|
81
|
+
.key("energy_site_id")
|
|
82
|
+
.value(energy_site_id)
|
|
83
|
+
.is_required(True)
|
|
84
|
+
.should_encode(True))
|
|
85
|
+
.header_param(Parameter()
|
|
86
|
+
.key("Content-Type")
|
|
87
|
+
.value("application/json"))
|
|
88
|
+
.body_param(Parameter()
|
|
89
|
+
.value(body)
|
|
90
|
+
.is_required(True))
|
|
91
|
+
.header_param(Parameter()
|
|
92
|
+
.key("accept")
|
|
93
|
+
.value("application/json"))
|
|
94
|
+
.body_serializer(APIHelper.json_serialize)
|
|
95
|
+
.auth(Single("bearerAuth")),
|
|
96
|
+
).response(
|
|
97
|
+
ResponseHandler()
|
|
98
|
+
.deserializer(APIHelper.json_deserialize)
|
|
99
|
+
.deserialize_into(BackupResponse.from_dictionary)
|
|
100
|
+
.is_api_response(True),
|
|
101
|
+
).execute()
|
|
102
|
+
|
|
103
|
+
def get_backup_or_energy_history(self,
|
|
104
|
+
energy_site_id,
|
|
105
|
+
kind,
|
|
106
|
+
start_date,
|
|
107
|
+
end_date,
|
|
108
|
+
period=None,
|
|
109
|
+
time_zone=None):
|
|
110
|
+
"""Perform a GET request to
|
|
111
|
+
/api/1/energy_sites/{energy_site_id}/calendar_history.
|
|
112
|
+
|
|
113
|
+
Args:
|
|
114
|
+
energy_site_id (str): The request template parameter.
|
|
115
|
+
kind (Kind): The request query parameter.
|
|
116
|
+
start_date (datetime): The request query parameter.
|
|
117
|
+
end_date (datetime): The request query parameter.
|
|
118
|
+
period (str, optional): The request query parameter.
|
|
119
|
+
time_zone (str, optional): The request query parameter.
|
|
120
|
+
|
|
121
|
+
Returns:
|
|
122
|
+
ApiResponse: An object with the response value as well as other useful
|
|
123
|
+
information such as status codes and headers. History retrieved
|
|
124
|
+
|
|
125
|
+
Raises:
|
|
126
|
+
ApiException: When an error occurs while fetching the data from the
|
|
127
|
+
remote API. This exception includes the HTTP Response code, an error
|
|
128
|
+
message, and the HTTP body that was received in the request.
|
|
129
|
+
|
|
130
|
+
"""
|
|
131
|
+
return super().new_api_call_builder.request(
|
|
132
|
+
RequestBuilder().server(Server.DEFAULT)
|
|
133
|
+
.path("/api/1/energy_sites/{energy_site_id}/calendar_history")
|
|
134
|
+
.http_method(HttpMethodEnum.GET)
|
|
135
|
+
.template_param(Parameter()
|
|
136
|
+
.key("energy_site_id")
|
|
137
|
+
.value(energy_site_id)
|
|
138
|
+
.is_required(True)
|
|
139
|
+
.should_encode(True))
|
|
140
|
+
.query_param(Parameter()
|
|
141
|
+
.key("kind")
|
|
142
|
+
.value(kind)
|
|
143
|
+
.is_required(True))
|
|
144
|
+
.query_param(Parameter()
|
|
145
|
+
.key("start_date")
|
|
146
|
+
.value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
|
|
147
|
+
start_date))
|
|
148
|
+
.is_required(True))
|
|
149
|
+
.query_param(Parameter()
|
|
150
|
+
.key("end_date")
|
|
151
|
+
.value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
|
|
152
|
+
end_date))
|
|
153
|
+
.is_required(True))
|
|
154
|
+
.query_param(Parameter()
|
|
155
|
+
.key("period")
|
|
156
|
+
.value(period))
|
|
157
|
+
.query_param(Parameter()
|
|
158
|
+
.key("time_zone")
|
|
159
|
+
.value(time_zone))
|
|
160
|
+
.header_param(Parameter()
|
|
161
|
+
.key("accept")
|
|
162
|
+
.value("application/json"))
|
|
163
|
+
.auth(Single("bearerAuth")),
|
|
164
|
+
).response(
|
|
165
|
+
ResponseHandler()
|
|
166
|
+
.deserializer(APIHelper.json_deserialize)
|
|
167
|
+
.deserialize_into(CalendarHistoryResponse.from_dictionary)
|
|
168
|
+
.is_api_response(True),
|
|
169
|
+
).execute()
|
|
170
|
+
|
|
171
|
+
def get_wall_connector_charging_history(self,
|
|
172
|
+
energy_site_id,
|
|
173
|
+
kind,
|
|
174
|
+
start_date,
|
|
175
|
+
end_date,
|
|
176
|
+
time_zone=None):
|
|
177
|
+
"""Perform a GET request to
|
|
178
|
+
/api/1/energy_sites/{energy_site_id}/telemetry_history.
|
|
179
|
+
|
|
180
|
+
Args:
|
|
181
|
+
energy_site_id (str): The request template parameter.
|
|
182
|
+
kind (KindGetWallConnectorChargingHistory): The request query parameter.
|
|
183
|
+
start_date (datetime): The request query parameter.
|
|
184
|
+
end_date (datetime): The request query parameter.
|
|
185
|
+
time_zone (str, optional): The request query parameter.
|
|
186
|
+
|
|
187
|
+
Returns:
|
|
188
|
+
ApiResponse: An object with the response value as well as other useful
|
|
189
|
+
information such as status codes and headers. Charging history
|
|
190
|
+
retrieved
|
|
191
|
+
|
|
192
|
+
Raises:
|
|
193
|
+
ApiException: When an error occurs while fetching the data from the
|
|
194
|
+
remote API. This exception includes the HTTP Response code, an error
|
|
195
|
+
message, and the HTTP body that was received in the request.
|
|
196
|
+
|
|
197
|
+
"""
|
|
198
|
+
return super().new_api_call_builder.request(
|
|
199
|
+
RequestBuilder().server(Server.DEFAULT)
|
|
200
|
+
.path("/api/1/energy_sites/{energy_site_id}/telemetry_history")
|
|
201
|
+
.http_method(HttpMethodEnum.GET)
|
|
202
|
+
.template_param(Parameter()
|
|
203
|
+
.key("energy_site_id")
|
|
204
|
+
.value(energy_site_id)
|
|
205
|
+
.is_required(True)
|
|
206
|
+
.should_encode(True))
|
|
207
|
+
.query_param(Parameter()
|
|
208
|
+
.key("kind")
|
|
209
|
+
.value(kind)
|
|
210
|
+
.is_required(True))
|
|
211
|
+
.query_param(Parameter()
|
|
212
|
+
.key("start_date")
|
|
213
|
+
.value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
|
|
214
|
+
start_date))
|
|
215
|
+
.is_required(True))
|
|
216
|
+
.query_param(Parameter()
|
|
217
|
+
.key("end_date")
|
|
218
|
+
.value(APIHelper.when_defined(APIHelper.RFC3339DateTime,
|
|
219
|
+
end_date))
|
|
220
|
+
.is_required(True))
|
|
221
|
+
.query_param(Parameter()
|
|
222
|
+
.key("time_zone")
|
|
223
|
+
.value(time_zone))
|
|
224
|
+
.header_param(Parameter()
|
|
225
|
+
.key("accept")
|
|
226
|
+
.value("application/json"))
|
|
227
|
+
.auth(Single("bearerAuth")),
|
|
228
|
+
).response(
|
|
229
|
+
ResponseHandler()
|
|
230
|
+
.deserializer(APIHelper.json_deserialize)
|
|
231
|
+
.deserialize_into(ChargeHistoryResponse.from_dictionary)
|
|
232
|
+
.is_api_response(True),
|
|
233
|
+
).execute()
|
|
234
|
+
|
|
235
|
+
def get_live_site_status(self,
|
|
236
|
+
energy_site_id):
|
|
237
|
+
"""Perform a GET request to
|
|
238
|
+
/api/1/energy_sites/{energy_site_id}/live_status.
|
|
239
|
+
|
|
240
|
+
Args:
|
|
241
|
+
energy_site_id (str): The request template parameter.
|
|
242
|
+
|
|
243
|
+
Returns:
|
|
244
|
+
ApiResponse: An object with the response value as well as other useful
|
|
245
|
+
information such as status codes and headers. Live status retrieved
|
|
246
|
+
|
|
247
|
+
Raises:
|
|
248
|
+
ApiException: When an error occurs while fetching the data from the
|
|
249
|
+
remote API. This exception includes the HTTP Response code, an error
|
|
250
|
+
message, and the HTTP body that was received in the request.
|
|
251
|
+
|
|
252
|
+
"""
|
|
253
|
+
return super().new_api_call_builder.request(
|
|
254
|
+
RequestBuilder().server(Server.DEFAULT)
|
|
255
|
+
.path("/api/1/energy_sites/{energy_site_id}/live_status")
|
|
256
|
+
.http_method(HttpMethodEnum.GET)
|
|
257
|
+
.template_param(Parameter()
|
|
258
|
+
.key("energy_site_id")
|
|
259
|
+
.value(energy_site_id)
|
|
260
|
+
.is_required(True)
|
|
261
|
+
.should_encode(True))
|
|
262
|
+
.header_param(Parameter()
|
|
263
|
+
.key("accept")
|
|
264
|
+
.value("application/json"))
|
|
265
|
+
.auth(Single("bearerAuth")),
|
|
266
|
+
).response(
|
|
267
|
+
ResponseHandler()
|
|
268
|
+
.deserializer(APIHelper.json_deserialize)
|
|
269
|
+
.deserialize_into(LiveStatusResponse.from_dictionary)
|
|
270
|
+
.is_api_response(True),
|
|
271
|
+
).execute()
|
|
272
|
+
|
|
273
|
+
def set_site_mode_autonomous_or_self_consumption(self,
|
|
274
|
+
energy_site_id,
|
|
275
|
+
body):
|
|
276
|
+
"""Perform a POST request to
|
|
277
|
+
/api/1/energy_sites/{energy_site_id}/operation.
|
|
278
|
+
|
|
279
|
+
Args:
|
|
280
|
+
energy_site_id (str): The request template parameter.
|
|
281
|
+
body (OperationRequest): The request body parameter.
|
|
282
|
+
|
|
283
|
+
Returns:
|
|
284
|
+
ApiResponse: An object with the response value as well as other useful
|
|
285
|
+
information such as status codes and headers. Operation mode updated
|
|
286
|
+
|
|
287
|
+
Raises:
|
|
288
|
+
ApiException: When an error occurs while fetching the data from the
|
|
289
|
+
remote API. This exception includes the HTTP Response code, an error
|
|
290
|
+
message, and the HTTP body that was received in the request.
|
|
291
|
+
|
|
292
|
+
"""
|
|
293
|
+
return super().new_api_call_builder.request(
|
|
294
|
+
RequestBuilder().server(Server.DEFAULT)
|
|
295
|
+
.path("/api/1/energy_sites/{energy_site_id}/operation")
|
|
296
|
+
.http_method(HttpMethodEnum.POST)
|
|
297
|
+
.template_param(Parameter()
|
|
298
|
+
.key("energy_site_id")
|
|
299
|
+
.value(energy_site_id)
|
|
300
|
+
.is_required(True)
|
|
301
|
+
.should_encode(True))
|
|
302
|
+
.header_param(Parameter()
|
|
303
|
+
.key("Content-Type")
|
|
304
|
+
.value("application/json"))
|
|
305
|
+
.body_param(Parameter()
|
|
306
|
+
.value(body)
|
|
307
|
+
.is_required(True))
|
|
308
|
+
.header_param(Parameter()
|
|
309
|
+
.key("accept")
|
|
310
|
+
.value("application/json"))
|
|
311
|
+
.body_serializer(APIHelper.json_serialize)
|
|
312
|
+
.auth(Single("bearerAuth")),
|
|
313
|
+
).response(
|
|
314
|
+
ResponseHandler()
|
|
315
|
+
.deserializer(APIHelper.json_deserialize)
|
|
316
|
+
.deserialize_into(GenericUpdateResponse.from_dictionary)
|
|
317
|
+
.is_api_response(True),
|
|
318
|
+
).execute()
|
|
319
|
+
|
|
320
|
+
def allow_disallow_charging_from_the_grid_and_exporting_energy_to_the_grid(self,
|
|
321
|
+
energy_site_id,
|
|
322
|
+
body=None):
|
|
323
|
+
"""Perform a POST request to
|
|
324
|
+
/api/1/energy_sites/{energy_site_id}/grid_import_export.
|
|
325
|
+
|
|
326
|
+
Args:
|
|
327
|
+
energy_site_id (str): The request template parameter.
|
|
328
|
+
body (Any, optional): The request body parameter.
|
|
329
|
+
|
|
330
|
+
Returns:
|
|
331
|
+
ApiResponse: An object with the response value as well as other useful
|
|
332
|
+
information such as status codes and headers. Grid import/export
|
|
333
|
+
updated
|
|
334
|
+
|
|
335
|
+
Raises:
|
|
336
|
+
ApiException: When an error occurs while fetching the data from the
|
|
337
|
+
remote API. This exception includes the HTTP Response code, an error
|
|
338
|
+
message, and the HTTP body that was received in the request.
|
|
339
|
+
|
|
340
|
+
"""
|
|
341
|
+
return super().new_api_call_builder.request(
|
|
342
|
+
RequestBuilder().server(Server.DEFAULT)
|
|
343
|
+
.path("/api/1/energy_sites/{energy_site_id}/grid_import_export")
|
|
344
|
+
.http_method(HttpMethodEnum.POST)
|
|
345
|
+
.template_param(Parameter()
|
|
346
|
+
.key("energy_site_id")
|
|
347
|
+
.value(energy_site_id)
|
|
348
|
+
.is_required(True)
|
|
349
|
+
.should_encode(True))
|
|
350
|
+
.header_param(Parameter()
|
|
351
|
+
.key("Content-Type")
|
|
352
|
+
.value("application/json"))
|
|
353
|
+
.body_param(Parameter()
|
|
354
|
+
.value(body))
|
|
355
|
+
.header_param(Parameter()
|
|
356
|
+
.key("accept")
|
|
357
|
+
.value("application/json"))
|
|
358
|
+
.body_serializer(APIHelper.json_serialize)
|
|
359
|
+
.auth(Single("bearerAuth")),
|
|
360
|
+
).response(
|
|
361
|
+
ResponseHandler()
|
|
362
|
+
.deserializer(APIHelper.json_deserialize)
|
|
363
|
+
.deserialize_into(GenericUpdateResponse.from_dictionary)
|
|
364
|
+
.is_api_response(True),
|
|
365
|
+
).execute()
|
|
366
|
+
|
|
367
|
+
def adjust_site_s_off_grid_vehicle_charging_reserve(self,
|
|
368
|
+
energy_site_id,
|
|
369
|
+
body):
|
|
370
|
+
"""Perform a POST request to
|
|
371
|
+
/api/1/energy_sites/{energy_site_id}/off_grid_vehicle_charging_reserve.
|
|
372
|
+
|
|
373
|
+
Args:
|
|
374
|
+
energy_site_id (str): The request template parameter.
|
|
375
|
+
body (OffGridVehicleChargingReserveRequest): The request body parameter.
|
|
376
|
+
|
|
377
|
+
Returns:
|
|
378
|
+
ApiResponse: An object with the response value as well as other useful
|
|
379
|
+
information such as status codes and headers. Reserve updated
|
|
380
|
+
|
|
381
|
+
Raises:
|
|
382
|
+
ApiException: When an error occurs while fetching the data from the
|
|
383
|
+
remote API. This exception includes the HTTP Response code, an error
|
|
384
|
+
message, and the HTTP body that was received in the request.
|
|
385
|
+
|
|
386
|
+
"""
|
|
387
|
+
return super().new_api_call_builder.request(
|
|
388
|
+
RequestBuilder().server(Server.DEFAULT)
|
|
389
|
+
.path("/api/1/energy_sites/{energy_site_id}/off_grid_vehicle_charging_reserve")
|
|
390
|
+
.http_method(HttpMethodEnum.POST)
|
|
391
|
+
.template_param(Parameter()
|
|
392
|
+
.key("energy_site_id")
|
|
393
|
+
.value(energy_site_id)
|
|
394
|
+
.is_required(True)
|
|
395
|
+
.should_encode(True))
|
|
396
|
+
.header_param(Parameter()
|
|
397
|
+
.key("Content-Type")
|
|
398
|
+
.value("application/json"))
|
|
399
|
+
.body_param(Parameter()
|
|
400
|
+
.value(body)
|
|
401
|
+
.is_required(True))
|
|
402
|
+
.header_param(Parameter()
|
|
403
|
+
.key("accept")
|
|
404
|
+
.value("application/json"))
|
|
405
|
+
.body_serializer(APIHelper.json_serialize)
|
|
406
|
+
.auth(Single("bearerAuth")),
|
|
407
|
+
).response(
|
|
408
|
+
ResponseHandler()
|
|
409
|
+
.deserializer(APIHelper.json_deserialize)
|
|
410
|
+
.deserialize_into(GenericUpdateResponse.from_dictionary)
|
|
411
|
+
.is_api_response(True),
|
|
412
|
+
).execute()
|
|
413
|
+
|
|
414
|
+
def update_storm_watch_participation(self,
|
|
415
|
+
energy_site_id,
|
|
416
|
+
body):
|
|
417
|
+
"""Perform a POST request to
|
|
418
|
+
/api/1/energy_sites/{energy_site_id}/storm_mode.
|
|
419
|
+
|
|
420
|
+
Args:
|
|
421
|
+
energy_site_id (str): The request template parameter.
|
|
422
|
+
body (StormModeRequest): The request body parameter.
|
|
423
|
+
|
|
424
|
+
Returns:
|
|
425
|
+
ApiResponse: An object with the response value as well as other useful
|
|
426
|
+
information such as status codes and headers. Storm mode updated
|
|
427
|
+
|
|
428
|
+
Raises:
|
|
429
|
+
ApiException: When an error occurs while fetching the data from the
|
|
430
|
+
remote API. This exception includes the HTTP Response code, an error
|
|
431
|
+
message, and the HTTP body that was received in the request.
|
|
432
|
+
|
|
433
|
+
"""
|
|
434
|
+
return super().new_api_call_builder.request(
|
|
435
|
+
RequestBuilder().server(Server.DEFAULT)
|
|
436
|
+
.path("/api/1/energy_sites/{energy_site_id}/storm_mode")
|
|
437
|
+
.http_method(HttpMethodEnum.POST)
|
|
438
|
+
.template_param(Parameter()
|
|
439
|
+
.key("energy_site_id")
|
|
440
|
+
.value(energy_site_id)
|
|
441
|
+
.is_required(True)
|
|
442
|
+
.should_encode(True))
|
|
443
|
+
.header_param(Parameter()
|
|
444
|
+
.key("Content-Type")
|
|
445
|
+
.value("application/json"))
|
|
446
|
+
.body_param(Parameter()
|
|
447
|
+
.value(body)
|
|
448
|
+
.is_required(True))
|
|
449
|
+
.header_param(Parameter()
|
|
450
|
+
.key("accept")
|
|
451
|
+
.value("application/json"))
|
|
452
|
+
.body_serializer(APIHelper.json_serialize)
|
|
453
|
+
.auth(Single("bearerAuth")),
|
|
454
|
+
).response(
|
|
455
|
+
ResponseHandler()
|
|
456
|
+
.deserializer(APIHelper.json_deserialize)
|
|
457
|
+
.deserialize_into(GenericUpdateResponse.from_dictionary)
|
|
458
|
+
.is_api_response(True),
|
|
459
|
+
).execute()
|
|
460
|
+
|
|
461
|
+
def update_time_of_use_tou_settings(self,
|
|
462
|
+
energy_site_id,
|
|
463
|
+
body):
|
|
464
|
+
"""Perform a POST request to
|
|
465
|
+
/api/1/energy_sites/{energy_site_id}/time_of_use_settings.
|
|
466
|
+
|
|
467
|
+
Args:
|
|
468
|
+
energy_site_id (str): The request template parameter.
|
|
469
|
+
body (TimeOfUseSettingsRequest): The request body parameter.
|
|
470
|
+
|
|
471
|
+
Returns:
|
|
472
|
+
ApiResponse: An object with the response value as well as other useful
|
|
473
|
+
information such as status codes and headers. TOU settings updated
|
|
474
|
+
|
|
475
|
+
Raises:
|
|
476
|
+
ApiException: When an error occurs while fetching the data from the
|
|
477
|
+
remote API. This exception includes the HTTP Response code, an error
|
|
478
|
+
message, and the HTTP body that was received in the request.
|
|
479
|
+
|
|
480
|
+
"""
|
|
481
|
+
return super().new_api_call_builder.request(
|
|
482
|
+
RequestBuilder().server(Server.DEFAULT)
|
|
483
|
+
.path("/api/1/energy_sites/{energy_site_id}/time_of_use_settings")
|
|
484
|
+
.http_method(HttpMethodEnum.POST)
|
|
485
|
+
.template_param(Parameter()
|
|
486
|
+
.key("energy_site_id")
|
|
487
|
+
.value(energy_site_id)
|
|
488
|
+
.is_required(True)
|
|
489
|
+
.should_encode(True))
|
|
490
|
+
.header_param(Parameter()
|
|
491
|
+
.key("Content-Type")
|
|
492
|
+
.value("application/json"))
|
|
493
|
+
.body_param(Parameter()
|
|
494
|
+
.value(body)
|
|
495
|
+
.is_required(True))
|
|
496
|
+
.header_param(Parameter()
|
|
497
|
+
.key("accept")
|
|
498
|
+
.value("application/json"))
|
|
499
|
+
.body_serializer(APIHelper.json_serialize)
|
|
500
|
+
.auth(Single("bearerAuth")),
|
|
501
|
+
).response(
|
|
502
|
+
ResponseHandler()
|
|
503
|
+
.deserializer(APIHelper.json_deserialize)
|
|
504
|
+
.deserialize_into(GenericUpdateResponse.from_dictionary)
|
|
505
|
+
.is_api_response(True),
|
|
506
|
+
).execute()
|
|
507
|
+
|
|
508
|
+
def get_user_products_vehicles_energy_sites(self):
|
|
509
|
+
"""Perform a GET request to /api/1/products.
|
|
510
|
+
|
|
511
|
+
Returns:
|
|
512
|
+
ApiResponse: An object with the response value as well as other useful
|
|
513
|
+
information such as status codes and headers. Products retrieved
|
|
514
|
+
|
|
515
|
+
Raises:
|
|
516
|
+
ApiException: When an error occurs while fetching the data from the
|
|
517
|
+
remote API. This exception includes the HTTP Response code, an error
|
|
518
|
+
message, and the HTTP body that was received in the request.
|
|
519
|
+
|
|
520
|
+
"""
|
|
521
|
+
return super().new_api_call_builder.request(
|
|
522
|
+
RequestBuilder().server(Server.DEFAULT)
|
|
523
|
+
.path("/api/1/products")
|
|
524
|
+
.http_method(HttpMethodEnum.GET)
|
|
525
|
+
.header_param(Parameter()
|
|
526
|
+
.key("accept")
|
|
527
|
+
.value("application/json"))
|
|
528
|
+
.auth(Single("bearerAuth")),
|
|
529
|
+
).response(
|
|
530
|
+
ResponseHandler()
|
|
531
|
+
.deserializer(APIHelper.json_deserialize)
|
|
532
|
+
.deserialize_into(ProductsResponse.from_dictionary)
|
|
533
|
+
.is_api_response(True),
|
|
534
|
+
).execute()
|
|
535
|
+
|
|
536
|
+
def get_site_information_assets_settings_features(self,
|
|
537
|
+
energy_site_id):
|
|
538
|
+
"""Perform a GET request to
|
|
539
|
+
/api/1/energy_sites/{energy_site_id}/site_info.
|
|
540
|
+
|
|
541
|
+
Args:
|
|
542
|
+
energy_site_id (str): The request template parameter.
|
|
543
|
+
|
|
544
|
+
Returns:
|
|
545
|
+
ApiResponse: An object with the response value as well as other useful
|
|
546
|
+
information such as status codes and headers. Site info retrieved
|
|
547
|
+
|
|
548
|
+
Raises:
|
|
549
|
+
ApiException: When an error occurs while fetching the data from the
|
|
550
|
+
remote API. This exception includes the HTTP Response code, an error
|
|
551
|
+
message, and the HTTP body that was received in the request.
|
|
552
|
+
|
|
553
|
+
"""
|
|
554
|
+
return super().new_api_call_builder.request(
|
|
555
|
+
RequestBuilder().server(Server.DEFAULT)
|
|
556
|
+
.path("/api/1/energy_sites/{energy_site_id}/site_info")
|
|
557
|
+
.http_method(HttpMethodEnum.GET)
|
|
558
|
+
.template_param(Parameter()
|
|
559
|
+
.key("energy_site_id")
|
|
560
|
+
.value(energy_site_id)
|
|
561
|
+
.is_required(True)
|
|
562
|
+
.should_encode(True))
|
|
563
|
+
.header_param(Parameter()
|
|
564
|
+
.key("accept")
|
|
565
|
+
.value("application/json"))
|
|
566
|
+
.auth(Single("bearerAuth")),
|
|
567
|
+
).response(
|
|
568
|
+
ResponseHandler()
|
|
569
|
+
.deserializer(APIHelper.json_deserialize)
|
|
570
|
+
.deserialize_into(SiteInfoResponse.from_dictionary)
|
|
571
|
+
.is_api_response(True),
|
|
572
|
+
).execute()
|