tesla-api-sdk 1.0.0 → 1.0.1
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.
- checksums.yaml +4 -4
- data/README.md +36 -31
- data/lib/tesla_fleet_management_api/client.rb +14 -8
- data/lib/tesla_fleet_management_api/configuration.rb +8 -8
- data/lib/tesla_fleet_management_api/controllers/base_controller.rb +1 -1
- data/lib/tesla_fleet_management_api/controllers/charging_controller.rb +3 -3
- data/lib/tesla_fleet_management_api/controllers/energy_controller.rb +11 -11
- data/lib/tesla_fleet_management_api/controllers/{oauth_authorization_controller.rb → o_auth_authorization_controller.rb} +16 -16
- data/lib/tesla_fleet_management_api/controllers/partner_controller.rb +4 -4
- data/lib/tesla_fleet_management_api/controllers/user_controller.rb +4 -4
- data/lib/tesla_fleet_management_api/controllers/vehicle_commands_controller.rb +486 -0
- data/lib/tesla_fleet_management_api/controllers/vehicles_controller.rb +21 -21
- data/lib/tesla_fleet_management_api/exceptions/{oauth_provider_exception.rb → o_auth_provider_exception.rb} +2 -2
- data/lib/tesla_fleet_management_api/http/auth/oauth2.rb +163 -0
- data/lib/tesla_fleet_management_api/models/actuate_trunk_request.rb +74 -0
- data/lib/tesla_fleet_management_api/models/add_charge_schedule_request.rb +160 -0
- data/lib/tesla_fleet_management_api/models/add_precondition_schedule_request.rb +132 -0
- data/lib/tesla_fleet_management_api/models/adjust_volume_request.rb +73 -0
- data/lib/tesla_fleet_management_api/models/command_response.rb +75 -0
- data/lib/tesla_fleet_management_api/models/command_result.rb +82 -0
- data/lib/tesla_fleet_management_api/models/guest_mode_request.rb +73 -0
- data/lib/tesla_fleet_management_api/models/kind_get_wall_connector_charging_history.rb +1 -1
- data/lib/tesla_fleet_management_api/models/{oauth_provider_error.rb → o_auth_provider_error.rb} +3 -3
- data/lib/tesla_fleet_management_api/models/o_auth_scope_oauth2.rb +82 -0
- data/lib/tesla_fleet_management_api/models/{oauth_token.rb → o_auth_token.rb} +2 -2
- data/lib/tesla_fleet_management_api/models/which_trunk.rb +36 -0
- data/lib/tesla_fleet_management_api.rb +17 -5
- metadata +17 -7
- data/lib/tesla_fleet_management_api/http/auth/oauth_2.rb +0 -154
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
# tesla_fleet_management_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module TeslaFleetManagementApi
|
|
7
|
+
# VehicleCommandsController
|
|
8
|
+
class VehicleCommandsController < BaseController
|
|
9
|
+
# Controls the front or rear trunk
|
|
10
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
11
|
+
# here
|
|
12
|
+
# @param [ActuateTrunkRequest] body Required parameter: TODO: type
|
|
13
|
+
# description here
|
|
14
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
15
|
+
def actuate_trunk(vehicle_tag,
|
|
16
|
+
body)
|
|
17
|
+
@api_call
|
|
18
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
19
|
+
'/api/1/vehicles/{vehicle_tag}/command/actuate_trunk',
|
|
20
|
+
Server::DEFAULT)
|
|
21
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
22
|
+
.is_required(true)
|
|
23
|
+
.should_encode(true))
|
|
24
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
25
|
+
.body_param(new_parameter(body)
|
|
26
|
+
.is_required(true))
|
|
27
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
28
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
29
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
30
|
+
.response(new_response_handler
|
|
31
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
32
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
33
|
+
.is_api_response(true))
|
|
34
|
+
.execute
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# TODO: type endpoint description here
|
|
38
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
39
|
+
# here
|
|
40
|
+
# @param [AddChargeScheduleRequest] body Required parameter: TODO: type
|
|
41
|
+
# description here
|
|
42
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
43
|
+
def add_charge_schedule(vehicle_tag,
|
|
44
|
+
body)
|
|
45
|
+
@api_call
|
|
46
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
47
|
+
'/api/1/vehicles/{vehicle_tag}/command/add_charge_schedule',
|
|
48
|
+
Server::DEFAULT)
|
|
49
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
50
|
+
.is_required(true)
|
|
51
|
+
.should_encode(true))
|
|
52
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
53
|
+
.body_param(new_parameter(body)
|
|
54
|
+
.is_required(true))
|
|
55
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
56
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
57
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
58
|
+
.response(new_response_handler
|
|
59
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
60
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
61
|
+
.is_api_response(true))
|
|
62
|
+
.execute
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# TODO: type endpoint description here
|
|
66
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
67
|
+
# here
|
|
68
|
+
# @param [AddPreconditionScheduleRequest] body Required parameter: TODO:
|
|
69
|
+
# type description here
|
|
70
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
71
|
+
def add_precondition_schedule(vehicle_tag,
|
|
72
|
+
body)
|
|
73
|
+
@api_call
|
|
74
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
75
|
+
'/api/1/vehicles/{vehicle_tag}/command/add_precondition_schedule',
|
|
76
|
+
Server::DEFAULT)
|
|
77
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
78
|
+
.is_required(true)
|
|
79
|
+
.should_encode(true))
|
|
80
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
81
|
+
.body_param(new_parameter(body)
|
|
82
|
+
.is_required(true))
|
|
83
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
84
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
85
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
86
|
+
.response(new_response_handler
|
|
87
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
88
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
89
|
+
.is_api_response(true))
|
|
90
|
+
.execute
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# TODO: type endpoint description here
|
|
94
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
95
|
+
# here
|
|
96
|
+
# @param [AdjustVolumeRequest] body Required parameter: TODO: type
|
|
97
|
+
# description here
|
|
98
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
99
|
+
def adjust_media_volume(vehicle_tag,
|
|
100
|
+
body)
|
|
101
|
+
@api_call
|
|
102
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
103
|
+
'/api/1/vehicles/{vehicle_tag}/command/adjust_volume',
|
|
104
|
+
Server::DEFAULT)
|
|
105
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
106
|
+
.is_required(true)
|
|
107
|
+
.should_encode(true))
|
|
108
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
109
|
+
.body_param(new_parameter(body)
|
|
110
|
+
.is_required(true))
|
|
111
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
112
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
113
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
114
|
+
.response(new_response_handler
|
|
115
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
116
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
117
|
+
.is_api_response(true))
|
|
118
|
+
.execute
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# TODO: type endpoint description here
|
|
122
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
123
|
+
# here
|
|
124
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
125
|
+
def start_climate_preconditioning(vehicle_tag)
|
|
126
|
+
@api_call
|
|
127
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
128
|
+
'/api/1/vehicles/{vehicle_tag}/command/auto_conditioning_start',
|
|
129
|
+
Server::DEFAULT)
|
|
130
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
131
|
+
.is_required(true)
|
|
132
|
+
.should_encode(true))
|
|
133
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
134
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
135
|
+
.response(new_response_handler
|
|
136
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
137
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
138
|
+
.is_api_response(true))
|
|
139
|
+
.execute
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# TODO: type endpoint description here
|
|
143
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
144
|
+
# here
|
|
145
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
146
|
+
def stop_climate_preconditioning(vehicle_tag)
|
|
147
|
+
@api_call
|
|
148
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
149
|
+
'/api/1/vehicles/{vehicle_tag}/command/auto_conditioning_stop',
|
|
150
|
+
Server::DEFAULT)
|
|
151
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
152
|
+
.is_required(true)
|
|
153
|
+
.should_encode(true))
|
|
154
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
155
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
156
|
+
.response(new_response_handler
|
|
157
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
158
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
159
|
+
.is_api_response(true))
|
|
160
|
+
.execute
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# TODO: type endpoint description here
|
|
164
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
165
|
+
# here
|
|
166
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
167
|
+
def cancel_software_update(vehicle_tag)
|
|
168
|
+
@api_call
|
|
169
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
170
|
+
'/api/1/vehicles/{vehicle_tag}/command/cancel_software_update',
|
|
171
|
+
Server::DEFAULT)
|
|
172
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
173
|
+
.is_required(true)
|
|
174
|
+
.should_encode(true))
|
|
175
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
176
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
177
|
+
.response(new_response_handler
|
|
178
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
179
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
180
|
+
.is_api_response(true))
|
|
181
|
+
.execute
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# TODO: type endpoint description here
|
|
185
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
186
|
+
# here
|
|
187
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
188
|
+
def charge_max_range(vehicle_tag)
|
|
189
|
+
@api_call
|
|
190
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
191
|
+
'/api/1/vehicles/{vehicle_tag}/command/charge_max_range',
|
|
192
|
+
Server::DEFAULT)
|
|
193
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
194
|
+
.is_required(true)
|
|
195
|
+
.should_encode(true))
|
|
196
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
197
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
198
|
+
.response(new_response_handler
|
|
199
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
200
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
201
|
+
.is_api_response(true))
|
|
202
|
+
.execute
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# TODO: type endpoint description here
|
|
206
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
207
|
+
# here
|
|
208
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
209
|
+
def open_charge_port_door(vehicle_tag)
|
|
210
|
+
@api_call
|
|
211
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
212
|
+
'/api/1/vehicles/{vehicle_tag}/command/charge_port_door_open',
|
|
213
|
+
Server::DEFAULT)
|
|
214
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
215
|
+
.is_required(true)
|
|
216
|
+
.should_encode(true))
|
|
217
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
218
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
219
|
+
.response(new_response_handler
|
|
220
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
221
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
222
|
+
.is_api_response(true))
|
|
223
|
+
.execute
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# TODO: type endpoint description here
|
|
227
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
228
|
+
# here
|
|
229
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
230
|
+
def close_charge_port_door(vehicle_tag)
|
|
231
|
+
@api_call
|
|
232
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
233
|
+
'/api/1/vehicles/{vehicle_tag}/command/charge_port_door_close',
|
|
234
|
+
Server::DEFAULT)
|
|
235
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
236
|
+
.is_required(true)
|
|
237
|
+
.should_encode(true))
|
|
238
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
239
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
240
|
+
.response(new_response_handler
|
|
241
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
242
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
243
|
+
.is_api_response(true))
|
|
244
|
+
.execute
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# TODO: type endpoint description here
|
|
248
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
249
|
+
# here
|
|
250
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
251
|
+
def charge_standard(vehicle_tag)
|
|
252
|
+
@api_call
|
|
253
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
254
|
+
'/api/1/vehicles/{vehicle_tag}/command/charge_standard',
|
|
255
|
+
Server::DEFAULT)
|
|
256
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
257
|
+
.is_required(true)
|
|
258
|
+
.should_encode(true))
|
|
259
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
260
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
261
|
+
.response(new_response_handler
|
|
262
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
263
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
264
|
+
.is_api_response(true))
|
|
265
|
+
.execute
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# TODO: type endpoint description here
|
|
269
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
270
|
+
# here
|
|
271
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
272
|
+
def start_charging(vehicle_tag)
|
|
273
|
+
@api_call
|
|
274
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
275
|
+
'/api/1/vehicles/{vehicle_tag}/command/charge_start',
|
|
276
|
+
Server::DEFAULT)
|
|
277
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
278
|
+
.is_required(true)
|
|
279
|
+
.should_encode(true))
|
|
280
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
281
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
282
|
+
.response(new_response_handler
|
|
283
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
284
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
285
|
+
.is_api_response(true))
|
|
286
|
+
.execute
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# TODO: type endpoint description here
|
|
290
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
291
|
+
# here
|
|
292
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
293
|
+
def stop_charging(vehicle_tag)
|
|
294
|
+
@api_call
|
|
295
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
296
|
+
'/api/1/vehicles/{vehicle_tag}/command/charge_stop',
|
|
297
|
+
Server::DEFAULT)
|
|
298
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
299
|
+
.is_required(true)
|
|
300
|
+
.should_encode(true))
|
|
301
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
302
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
303
|
+
.response(new_response_handler
|
|
304
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
305
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
306
|
+
.is_api_response(true))
|
|
307
|
+
.execute
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
# Deactivates PIN to Drive and resets the associated PIN for supported
|
|
311
|
+
# firmware versions.
|
|
312
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
313
|
+
# here
|
|
314
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
315
|
+
def clear_pin_to_drive_admin(vehicle_tag)
|
|
316
|
+
@api_call
|
|
317
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
318
|
+
'/api/1/vehicles/{vehicle_tag}/command/clear_pin_to_drive_admin',
|
|
319
|
+
Server::DEFAULT)
|
|
320
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
321
|
+
.is_required(true)
|
|
322
|
+
.should_encode(true))
|
|
323
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
324
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
325
|
+
.response(new_response_handler
|
|
326
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
327
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
328
|
+
.is_api_response(true))
|
|
329
|
+
.execute
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
# TODO: type endpoint description here
|
|
333
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
334
|
+
# here
|
|
335
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
336
|
+
def lock_doors(vehicle_tag)
|
|
337
|
+
@api_call
|
|
338
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
339
|
+
'/api/1/vehicles/{vehicle_tag}/command/door_lock',
|
|
340
|
+
Server::DEFAULT)
|
|
341
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
342
|
+
.is_required(true)
|
|
343
|
+
.should_encode(true))
|
|
344
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
345
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
346
|
+
.response(new_response_handler
|
|
347
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
348
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
349
|
+
.is_api_response(true))
|
|
350
|
+
.execute
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
# TODO: type endpoint description here
|
|
354
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
355
|
+
# here
|
|
356
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
357
|
+
def unlock_doors(vehicle_tag)
|
|
358
|
+
@api_call
|
|
359
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
360
|
+
'/api/1/vehicles/{vehicle_tag}/command/door_unlock',
|
|
361
|
+
Server::DEFAULT)
|
|
362
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
363
|
+
.is_required(true)
|
|
364
|
+
.should_encode(true))
|
|
365
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
366
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
367
|
+
.response(new_response_handler
|
|
368
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
369
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
370
|
+
.is_api_response(true))
|
|
371
|
+
.execute
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
# Erases user data from the vehicle UI. Requires Guest Mode.
|
|
375
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
376
|
+
# here
|
|
377
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
378
|
+
def erase_user_data(vehicle_tag)
|
|
379
|
+
@api_call
|
|
380
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
381
|
+
'/api/1/vehicles/{vehicle_tag}/command/erase_user_data',
|
|
382
|
+
Server::DEFAULT)
|
|
383
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
384
|
+
.is_required(true)
|
|
385
|
+
.should_encode(true))
|
|
386
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
387
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
388
|
+
.response(new_response_handler
|
|
389
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
390
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
391
|
+
.is_api_response(true))
|
|
392
|
+
.execute
|
|
393
|
+
end
|
|
394
|
+
|
|
395
|
+
# Briefly flashes vehicle headlights.
|
|
396
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
397
|
+
# here
|
|
398
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
399
|
+
def flash_lights(vehicle_tag)
|
|
400
|
+
@api_call
|
|
401
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
402
|
+
'/api/1/vehicles/{vehicle_tag}/command/flash_lights',
|
|
403
|
+
Server::DEFAULT)
|
|
404
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
405
|
+
.is_required(true)
|
|
406
|
+
.should_encode(true))
|
|
407
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
408
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
409
|
+
.response(new_response_handler
|
|
410
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
411
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
412
|
+
.is_api_response(true))
|
|
413
|
+
.execute
|
|
414
|
+
end
|
|
415
|
+
|
|
416
|
+
# TODO: type endpoint description here
|
|
417
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
418
|
+
# here
|
|
419
|
+
# @param [GuestModeRequest] body Required parameter: TODO: type description
|
|
420
|
+
# here
|
|
421
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
422
|
+
def enable_or_disable_guest_mode(vehicle_tag,
|
|
423
|
+
body)
|
|
424
|
+
@api_call
|
|
425
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
426
|
+
'/api/1/vehicles/{vehicle_tag}/command/guest_mode',
|
|
427
|
+
Server::DEFAULT)
|
|
428
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
429
|
+
.is_required(true)
|
|
430
|
+
.should_encode(true))
|
|
431
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
432
|
+
.body_param(new_parameter(body)
|
|
433
|
+
.is_required(true))
|
|
434
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
435
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
436
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
437
|
+
.response(new_response_handler
|
|
438
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
439
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
440
|
+
.is_api_response(true))
|
|
441
|
+
.execute
|
|
442
|
+
end
|
|
443
|
+
|
|
444
|
+
# TODO: type endpoint description here
|
|
445
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
446
|
+
# here
|
|
447
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
448
|
+
def honk_horn(vehicle_tag)
|
|
449
|
+
@api_call
|
|
450
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
451
|
+
'/api/1/vehicles/{vehicle_tag}/command/honk_horn',
|
|
452
|
+
Server::DEFAULT)
|
|
453
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
454
|
+
.is_required(true)
|
|
455
|
+
.should_encode(true))
|
|
456
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
457
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
458
|
+
.response(new_response_handler
|
|
459
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
460
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
461
|
+
.is_api_response(true))
|
|
462
|
+
.execute
|
|
463
|
+
end
|
|
464
|
+
|
|
465
|
+
# TODO: type endpoint description here
|
|
466
|
+
# @param [String] vehicle_tag Required parameter: TODO: type description
|
|
467
|
+
# here
|
|
468
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
469
|
+
def next_favorite_media_track(vehicle_tag)
|
|
470
|
+
@api_call
|
|
471
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
472
|
+
'/api/1/vehicles/{vehicle_tag}/command/media_next_fav',
|
|
473
|
+
Server::DEFAULT)
|
|
474
|
+
.template_param(new_parameter(vehicle_tag, key: 'vehicle_tag')
|
|
475
|
+
.is_required(true)
|
|
476
|
+
.should_encode(true))
|
|
477
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
478
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
479
|
+
.response(new_response_handler
|
|
480
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
481
|
+
.deserialize_into(CommandResponse.method(:from_hash))
|
|
482
|
+
.is_api_response(true))
|
|
483
|
+
.execute
|
|
484
|
+
end
|
|
485
|
+
end
|
|
486
|
+
end
|
|
@@ -14,7 +14,7 @@ module TeslaFleetManagementApi
|
|
|
14
14
|
'/api/1/vehicles',
|
|
15
15
|
Server::DEFAULT)
|
|
16
16
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
17
|
-
.auth(
|
|
17
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
18
18
|
.response(new_response_handler
|
|
19
19
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
20
20
|
.deserialize_into(Api1VehiclesResponse.method(:from_hash))
|
|
@@ -35,7 +35,7 @@ module TeslaFleetManagementApi
|
|
|
35
35
|
.is_required(true)
|
|
36
36
|
.should_encode(true))
|
|
37
37
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
38
|
-
.auth(
|
|
38
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
39
39
|
.response(new_response_handler
|
|
40
40
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
41
41
|
.deserialize_into(Api1VehiclesResponseGetVehicle.method(:from_hash))
|
|
@@ -56,7 +56,7 @@ module TeslaFleetManagementApi
|
|
|
56
56
|
.is_required(true)
|
|
57
57
|
.should_encode(true))
|
|
58
58
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
59
|
-
.auth(
|
|
59
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
60
60
|
.response(new_response_handler
|
|
61
61
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
62
62
|
.deserialize_into(Api1VehiclesMobileEnabledResponse.method(:from_hash))
|
|
@@ -77,7 +77,7 @@ module TeslaFleetManagementApi
|
|
|
77
77
|
.is_required(true)
|
|
78
78
|
.should_encode(true))
|
|
79
79
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
80
|
-
.auth(
|
|
80
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
81
81
|
.response(new_response_handler
|
|
82
82
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
83
83
|
.deserialize_into(Api1VehiclesNearbyChargingSitesResponse.method(:from_hash))
|
|
@@ -98,7 +98,7 @@ module TeslaFleetManagementApi
|
|
|
98
98
|
.is_required(true)
|
|
99
99
|
.should_encode(true))
|
|
100
100
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
101
|
-
.auth(
|
|
101
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
102
102
|
.response(new_response_handler
|
|
103
103
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
104
104
|
.deserialize_into(SiteInfoResponse.method(:from_hash))
|
|
@@ -119,7 +119,7 @@ module TeslaFleetManagementApi
|
|
|
119
119
|
.is_required(true)
|
|
120
120
|
.should_encode(true))
|
|
121
121
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
122
|
-
.auth(
|
|
122
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
123
123
|
.response(new_response_handler
|
|
124
124
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
125
125
|
.deserialize_into(Api1VehiclesWakeUpResponse.method(:from_hash))
|
|
@@ -139,7 +139,7 @@ module TeslaFleetManagementApi
|
|
|
139
139
|
.is_required(true)
|
|
140
140
|
.should_encode(true))
|
|
141
141
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
142
|
-
.auth(
|
|
142
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
143
143
|
.response(new_response_handler
|
|
144
144
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
145
145
|
.deserialize_into(SiteInfoResponse.method(:from_hash))
|
|
@@ -158,7 +158,7 @@ module TeslaFleetManagementApi
|
|
|
158
158
|
.query_param(new_parameter(vin, key: 'vin')
|
|
159
159
|
.is_required(true))
|
|
160
160
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
161
|
-
.auth(
|
|
161
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
162
162
|
.response(new_response_handler
|
|
163
163
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
164
164
|
.deserialize_into(Api1DxVehiclesOptionsResponse.method(:from_hash))
|
|
@@ -174,7 +174,7 @@ module TeslaFleetManagementApi
|
|
|
174
174
|
'/api/1/dx/warranty/details',
|
|
175
175
|
Server::DEFAULT)
|
|
176
176
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
177
|
-
.auth(
|
|
177
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
178
178
|
.response(new_response_handler
|
|
179
179
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
180
180
|
.deserialize_into(Api1DxWarrantyDetailsResponse.method(:from_hash))
|
|
@@ -195,7 +195,7 @@ module TeslaFleetManagementApi
|
|
|
195
195
|
.is_required(true)
|
|
196
196
|
.should_encode(true))
|
|
197
197
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
198
|
-
.auth(
|
|
198
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
199
199
|
.response(new_response_handler
|
|
200
200
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
201
201
|
.deserialize_into(DriversResponse.method(:from_hash))
|
|
@@ -216,7 +216,7 @@ module TeslaFleetManagementApi
|
|
|
216
216
|
.is_required(true)
|
|
217
217
|
.should_encode(true))
|
|
218
218
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
219
|
-
.auth(
|
|
219
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
220
220
|
.response(new_response_handler
|
|
221
221
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
222
222
|
.deserialize_into(SimpleOkResponse.method(:from_hash))
|
|
@@ -235,7 +235,7 @@ module TeslaFleetManagementApi
|
|
|
235
235
|
.query_param(new_parameter(vin, key: 'vin')
|
|
236
236
|
.is_required(true))
|
|
237
237
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
238
|
-
.auth(
|
|
238
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
239
239
|
.response(new_response_handler
|
|
240
240
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
241
241
|
.deserialize_into(SiteInfoResponse.method(:from_hash))
|
|
@@ -254,7 +254,7 @@ module TeslaFleetManagementApi
|
|
|
254
254
|
.query_param(new_parameter(vin, key: 'vin')
|
|
255
255
|
.is_required(true))
|
|
256
256
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
257
|
-
.auth(
|
|
257
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
258
258
|
.response(new_response_handler
|
|
259
259
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
260
260
|
.deserialize_into(SiteInfoResponse.method(:from_hash))
|
|
@@ -280,7 +280,7 @@ module TeslaFleetManagementApi
|
|
|
280
280
|
.body_param(new_parameter(body)
|
|
281
281
|
.is_required(true))
|
|
282
282
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
283
|
-
.auth(
|
|
283
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
284
284
|
.response(new_response_handler
|
|
285
285
|
.is_response_void(true)
|
|
286
286
|
.is_api_response(true))
|
|
@@ -299,7 +299,7 @@ module TeslaFleetManagementApi
|
|
|
299
299
|
.is_required(true)
|
|
300
300
|
.should_encode(true))
|
|
301
301
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
302
|
-
.auth(
|
|
302
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
303
303
|
.response(new_response_handler
|
|
304
304
|
.deserializer(APIHelper.method(:json_deserialize))
|
|
305
305
|
.is_api_response(true))
|
|
@@ -320,7 +320,7 @@ module TeslaFleetManagementApi
|
|
|
320
320
|
.is_required(true))
|
|
321
321
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
322
322
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
323
|
-
.auth(
|
|
323
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
324
324
|
.response(new_response_handler
|
|
325
325
|
.deserializer(APIHelper.method(:json_deserialize))
|
|
326
326
|
.is_api_response(true))
|
|
@@ -340,7 +340,7 @@ module TeslaFleetManagementApi
|
|
|
340
340
|
.is_required(true))
|
|
341
341
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
342
342
|
.body_serializer(APIHelper.method(:json_serialize))
|
|
343
|
-
.auth(
|
|
343
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
344
344
|
.response(new_response_handler
|
|
345
345
|
.deserializer(APIHelper.method(:json_deserialize))
|
|
346
346
|
.is_api_response(true))
|
|
@@ -360,7 +360,7 @@ module TeslaFleetManagementApi
|
|
|
360
360
|
.is_required(true)
|
|
361
361
|
.should_encode(true))
|
|
362
362
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
363
|
-
.auth(
|
|
363
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
364
364
|
.response(new_response_handler
|
|
365
365
|
.deserializer(APIHelper.method(:json_deserialize))
|
|
366
366
|
.is_api_response(true))
|
|
@@ -380,7 +380,7 @@ module TeslaFleetManagementApi
|
|
|
380
380
|
.is_required(true)
|
|
381
381
|
.should_encode(true))
|
|
382
382
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
383
|
-
.auth(
|
|
383
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
384
384
|
.response(new_response_handler
|
|
385
385
|
.deserializer(APIHelper.method(:json_deserialize))
|
|
386
386
|
.is_api_response(true))
|
|
@@ -401,7 +401,7 @@ module TeslaFleetManagementApi
|
|
|
401
401
|
.is_required(true))
|
|
402
402
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
403
403
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
404
|
-
.auth(
|
|
404
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
405
405
|
.response(new_response_handler
|
|
406
406
|
.deserializer(APIHelper.method(:json_deserialize))
|
|
407
407
|
.is_api_response(true))
|
|
@@ -421,7 +421,7 @@ module TeslaFleetManagementApi
|
|
|
421
421
|
.is_required(true)
|
|
422
422
|
.should_encode(true))
|
|
423
423
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
424
|
-
.auth(
|
|
424
|
+
.auth(And.new('bearerAuth', 'oauth2')))
|
|
425
425
|
.response(new_response_handler
|
|
426
426
|
.deserializer(APIHelper.method(:json_deserialize))
|
|
427
427
|
.is_api_response(true))
|