tesla-api-sdk 1.0.0
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 +7 -0
- data/LICENSE +28 -0
- data/README.md +160 -0
- data/bin/console +15 -0
- data/lib/tesla_fleet_management_api/api_helper.rb +10 -0
- data/lib/tesla_fleet_management_api/client.rb +110 -0
- data/lib/tesla_fleet_management_api/configuration.rb +181 -0
- data/lib/tesla_fleet_management_api/controllers/base_controller.rb +65 -0
- data/lib/tesla_fleet_management_api/controllers/charging_controller.rb +62 -0
- data/lib/tesla_fleet_management_api/controllers/energy_controller.rb +315 -0
- data/lib/tesla_fleet_management_api/controllers/oauth_authorization_controller.rb +87 -0
- data/lib/tesla_fleet_management_api/controllers/partner_controller.rb +82 -0
- data/lib/tesla_fleet_management_api/controllers/user_controller.rb +73 -0
- data/lib/tesla_fleet_management_api/controllers/vehicles_controller.rb +431 -0
- data/lib/tesla_fleet_management_api/exceptions/api_exception.rb +21 -0
- data/lib/tesla_fleet_management_api/exceptions/oauth_provider_exception.rb +64 -0
- data/lib/tesla_fleet_management_api/http/api_response.rb +19 -0
- data/lib/tesla_fleet_management_api/http/auth/bearer_auth.rb +53 -0
- data/lib/tesla_fleet_management_api/http/auth/oauth_2.rb +154 -0
- data/lib/tesla_fleet_management_api/http/http_call_back.rb +10 -0
- data/lib/tesla_fleet_management_api/http/http_method_enum.rb +10 -0
- data/lib/tesla_fleet_management_api/http/http_request.rb +10 -0
- data/lib/tesla_fleet_management_api/http/http_response.rb +10 -0
- data/lib/tesla_fleet_management_api/http/proxy_settings.rb +22 -0
- data/lib/tesla_fleet_management_api/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/tesla_fleet_management_api/logging/sdk_logger.rb +17 -0
- data/lib/tesla_fleet_management_api/models/api1_dx_vehicles_options_response.rb +76 -0
- data/lib/tesla_fleet_management_api/models/api1_dx_warranty_details_response.rb +76 -0
- data/lib/tesla_fleet_management_api/models/api1_vehicles_mobile_enabled_response.rb +75 -0
- data/lib/tesla_fleet_management_api/models/api1_vehicles_nearby_charging_sites_response.rb +75 -0
- data/lib/tesla_fleet_management_api/models/api1_vehicles_response.rb +104 -0
- data/lib/tesla_fleet_management_api/models/api1_vehicles_response_get_vehicle.rb +75 -0
- data/lib/tesla_fleet_management_api/models/api1_vehicles_wake_up_response.rb +75 -0
- data/lib/tesla_fleet_management_api/models/backup_request.rb +75 -0
- data/lib/tesla_fleet_management_api/models/backup_response.rb +73 -0
- data/lib/tesla_fleet_management_api/models/base_model.rb +110 -0
- data/lib/tesla_fleet_management_api/models/calendar_history_response.rb +73 -0
- data/lib/tesla_fleet_management_api/models/charge_duration.rb +73 -0
- data/lib/tesla_fleet_management_api/models/charge_history.rb +96 -0
- data/lib/tesla_fleet_management_api/models/charge_history_response.rb +73 -0
- data/lib/tesla_fleet_management_api/models/charge_start_time.rb +73 -0
- data/lib/tesla_fleet_management_api/models/charging_dimension.rb +85 -0
- data/lib/tesla_fleet_management_api/models/charging_fee.rb +312 -0
- data/lib/tesla_fleet_management_api/models/charging_history_data.rb +81 -0
- data/lib/tesla_fleet_management_api/models/charging_history_item.rb +222 -0
- data/lib/tesla_fleet_management_api/models/charging_history_response.rb +73 -0
- data/lib/tesla_fleet_management_api/models/charging_invoice.rb +95 -0
- data/lib/tesla_fleet_management_api/models/charging_location.rb +158 -0
- data/lib/tesla_fleet_management_api/models/charging_period.rb +96 -0
- data/lib/tesla_fleet_management_api/models/charging_session.rb +187 -0
- data/lib/tesla_fleet_management_api/models/charging_sessions_data.rb +116 -0
- data/lib/tesla_fleet_management_api/models/charging_sessions_response.rb +73 -0
- data/lib/tesla_fleet_management_api/models/default_real_mode.rb +36 -0
- data/lib/tesla_fleet_management_api/models/driver.rb +164 -0
- data/lib/tesla_fleet_management_api/models/drivers_response.rb +94 -0
- data/lib/tesla_fleet_management_api/models/enterprise_payer_request.rb +94 -0
- data/lib/tesla_fleet_management_api/models/event.rb +89 -0
- data/lib/tesla_fleet_management_api/models/fleet_status_request.rb +74 -0
- data/lib/tesla_fleet_management_api/models/fleet_telemetry_error.rb +90 -0
- data/lib/tesla_fleet_management_api/models/fleet_telemetry_errors_response.rb +74 -0
- data/lib/tesla_fleet_management_api/models/fleet_telemetry_jws_request.rb +85 -0
- data/lib/tesla_fleet_management_api/models/generic_update_response.rb +73 -0
- data/lib/tesla_fleet_management_api/models/kind.rb +36 -0
- data/lib/tesla_fleet_management_api/models/kind_get_wall_connector_charging_history.rb +26 -0
- data/lib/tesla_fleet_management_api/models/live_status_response.rb +73 -0
- data/lib/tesla_fleet_management_api/models/location.rb +85 -0
- data/lib/tesla_fleet_management_api/models/location1.rb +85 -0
- data/lib/tesla_fleet_management_api/models/me_response.rb +73 -0
- data/lib/tesla_fleet_management_api/models/mobile_enabled.rb +85 -0
- data/lib/tesla_fleet_management_api/models/oauth_provider_error.rb +62 -0
- data/lib/tesla_fleet_management_api/models/oauth_token.rb +96 -0
- data/lib/tesla_fleet_management_api/models/off_grid_vehicle_charging_reserve_request.rb +79 -0
- data/lib/tesla_fleet_management_api/models/operation_request.rb +75 -0
- data/lib/tesla_fleet_management_api/models/orders_response.rb +91 -0
- data/lib/tesla_fleet_management_api/models/pagination.rb +127 -0
- data/lib/tesla_fleet_management_api/models/price_component.rb +95 -0
- data/lib/tesla_fleet_management_api/models/products_response.rb +85 -0
- data/lib/tesla_fleet_management_api/models/public_key_response.rb +73 -0
- data/lib/tesla_fleet_management_api/models/region_response.rb +73 -0
- data/lib/tesla_fleet_management_api/models/register_partner_request.rb +73 -0
- data/lib/tesla_fleet_management_api/models/register_partner_response.rb +73 -0
- data/lib/tesla_fleet_management_api/models/response.rb +82 -0
- data/lib/tesla_fleet_management_api/models/response1.rb +75 -0
- data/lib/tesla_fleet_management_api/models/response2.rb +74 -0
- data/lib/tesla_fleet_management_api/models/response3.rb +115 -0
- data/lib/tesla_fleet_management_api/models/response_api1_dx_vehicles_options_response.rb +84 -0
- data/lib/tesla_fleet_management_api/models/response_api1_dx_warranty_details_response.rb +124 -0
- data/lib/tesla_fleet_management_api/models/response_calendar_history_response.rb +91 -0
- data/lib/tesla_fleet_management_api/models/response_charge_history_response.rb +83 -0
- data/lib/tesla_fleet_management_api/models/response_fleet_telemetry_errors_response.rb +83 -0
- data/lib/tesla_fleet_management_api/models/response_live_status_response.rb +196 -0
- data/lib/tesla_fleet_management_api/models/response_me_response.rb +102 -0
- data/lib/tesla_fleet_management_api/models/response_orders_response.rb +157 -0
- data/lib/tesla_fleet_management_api/models/response_public_key_response.rb +74 -0
- data/lib/tesla_fleet_management_api/models/response_region_response.rb +83 -0
- data/lib/tesla_fleet_management_api/models/response_register_partner_response.rb +223 -0
- data/lib/tesla_fleet_management_api/models/signaling.rb +94 -0
- data/lib/tesla_fleet_management_api/models/simple_ok_response.rb +75 -0
- data/lib/tesla_fleet_management_api/models/site_info_response.rb +75 -0
- data/lib/tesla_fleet_management_api/models/storm_mode_request.rb +73 -0
- data/lib/tesla_fleet_management_api/models/tariff_element.rb +95 -0
- data/lib/tesla_fleet_management_api/models/tariffs.rb +94 -0
- data/lib/tesla_fleet_management_api/models/time_of_use_settings_request.rb +74 -0
- data/lib/tesla_fleet_management_api/models/total_cost.rb +95 -0
- data/lib/tesla_fleet_management_api/models/tou_settings.rb +77 -0
- data/lib/tesla_fleet_management_api/models/vehicle_base.rb +147 -0
- data/lib/tesla_fleet_management_api/models/vehicle_option.rb +107 -0
- data/lib/tesla_fleet_management_api/models/warranty_item.rb +155 -0
- data/lib/tesla_fleet_management_api/utilities/date_time_helper.rb +11 -0
- data/lib/tesla_fleet_management_api/utilities/file_wrapper.rb +28 -0
- data/lib/tesla_fleet_management_api.rb +153 -0
- metadata +195 -0
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
# FleetTelemetryError Model.
|
|
8
|
+
class FleetTelemetryError < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :name
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :error
|
|
19
|
+
|
|
20
|
+
# TODO: Write general description for this method
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :vin
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['name'] = 'name'
|
|
28
|
+
@_hash['error'] = 'error'
|
|
29
|
+
@_hash['vin'] = 'vin'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
[]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# An array for nullable fields
|
|
39
|
+
def self.nullables
|
|
40
|
+
[]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def initialize(name:, error:, vin:, additional_properties: nil)
|
|
44
|
+
# Add additional model properties to the instance
|
|
45
|
+
additional_properties = {} if additional_properties.nil?
|
|
46
|
+
|
|
47
|
+
@name = name
|
|
48
|
+
@error = error
|
|
49
|
+
@vin = vin
|
|
50
|
+
@additional_properties = additional_properties
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Creates an instance of the object from a hash.
|
|
54
|
+
def self.from_hash(hash)
|
|
55
|
+
return nil unless hash
|
|
56
|
+
|
|
57
|
+
# Extract variables from the hash.
|
|
58
|
+
name = hash.key?('name') ? hash['name'] : nil
|
|
59
|
+
error = hash.key?('error') ? hash['error'] : nil
|
|
60
|
+
vin = hash.key?('vin') ? hash['vin'] : nil
|
|
61
|
+
|
|
62
|
+
# Create a new hash for additional properties, removing known properties.
|
|
63
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
64
|
+
|
|
65
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
66
|
+
new_hash, proc { |value| value }
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
# Create object from extracted values.
|
|
70
|
+
FleetTelemetryError.new(name: name,
|
|
71
|
+
error: error,
|
|
72
|
+
vin: vin,
|
|
73
|
+
additional_properties: additional_properties)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Provides a human-readable string representation of the object.
|
|
77
|
+
def to_s
|
|
78
|
+
class_name = self.class.name.split('::').last
|
|
79
|
+
"<#{class_name} name: #{@name}, error: #{@error}, vin: #{@vin}, additional_properties:"\
|
|
80
|
+
" #{@additional_properties}>"
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
84
|
+
def inspect
|
|
85
|
+
class_name = self.class.name.split('::').last
|
|
86
|
+
"<#{class_name} name: #{@name.inspect}, error: #{@error.inspect}, vin: #{@vin.inspect},"\
|
|
87
|
+
" additional_properties: #{@additional_properties}>"
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
# FleetTelemetryErrorsResponse Model.
|
|
8
|
+
class FleetTelemetryErrorsResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [ResponseFleetTelemetryErrorsResponse]
|
|
14
|
+
attr_accessor :response
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['response'] = 'response'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
[]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for nullable fields
|
|
29
|
+
def self.nullables
|
|
30
|
+
[]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def initialize(response:, additional_properties: nil)
|
|
34
|
+
# Add additional model properties to the instance
|
|
35
|
+
additional_properties = {} if additional_properties.nil?
|
|
36
|
+
|
|
37
|
+
@response = response
|
|
38
|
+
@additional_properties = additional_properties
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Creates an instance of the object from a hash.
|
|
42
|
+
def self.from_hash(hash)
|
|
43
|
+
return nil unless hash
|
|
44
|
+
|
|
45
|
+
# Extract variables from the hash.
|
|
46
|
+
response = ResponseFleetTelemetryErrorsResponse.from_hash(hash['response']) if
|
|
47
|
+
hash['response']
|
|
48
|
+
|
|
49
|
+
# Create a new hash for additional properties, removing known properties.
|
|
50
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
51
|
+
|
|
52
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
53
|
+
new_hash, proc { |value| value }
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
# Create object from extracted values.
|
|
57
|
+
FleetTelemetryErrorsResponse.new(response: response,
|
|
58
|
+
additional_properties: additional_properties)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Provides a human-readable string representation of the object.
|
|
62
|
+
def to_s
|
|
63
|
+
class_name = self.class.name.split('::').last
|
|
64
|
+
"<#{class_name} response: #{@response}, additional_properties: #{@additional_properties}>"
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
68
|
+
def inspect
|
|
69
|
+
class_name = self.class.name.split('::').last
|
|
70
|
+
"<#{class_name} response: #{@response.inspect}, additional_properties:"\
|
|
71
|
+
" #{@additional_properties}>"
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
# FleetTelemetryJwsRequest Model.
|
|
8
|
+
class FleetTelemetryJwsRequest < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :token
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [Array[String]]
|
|
18
|
+
attr_accessor :vins
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['token'] = 'token'
|
|
24
|
+
@_hash['vins'] = 'vins'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
token
|
|
32
|
+
vins
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(token: SKIP, vins: SKIP, additional_properties: nil)
|
|
42
|
+
# Add additional model properties to the instance
|
|
43
|
+
additional_properties = {} if additional_properties.nil?
|
|
44
|
+
|
|
45
|
+
@token = token unless token == SKIP
|
|
46
|
+
@vins = vins unless vins == SKIP
|
|
47
|
+
@additional_properties = additional_properties
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Creates an instance of the object from a hash.
|
|
51
|
+
def self.from_hash(hash)
|
|
52
|
+
return nil unless hash
|
|
53
|
+
|
|
54
|
+
# Extract variables from the hash.
|
|
55
|
+
token = hash.key?('token') ? hash['token'] : SKIP
|
|
56
|
+
vins = hash.key?('vins') ? hash['vins'] : SKIP
|
|
57
|
+
|
|
58
|
+
# Create a new hash for additional properties, removing known properties.
|
|
59
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
60
|
+
|
|
61
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
62
|
+
new_hash, proc { |value| value }
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Create object from extracted values.
|
|
66
|
+
FleetTelemetryJwsRequest.new(token: token,
|
|
67
|
+
vins: vins,
|
|
68
|
+
additional_properties: additional_properties)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Provides a human-readable string representation of the object.
|
|
72
|
+
def to_s
|
|
73
|
+
class_name = self.class.name.split('::').last
|
|
74
|
+
"<#{class_name} token: #{@token}, vins: #{@vins}, additional_properties:"\
|
|
75
|
+
" #{@additional_properties}>"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
79
|
+
def inspect
|
|
80
|
+
class_name = self.class.name.split('::').last
|
|
81
|
+
"<#{class_name} token: #{@token.inspect}, vins: #{@vins.inspect}, additional_properties:"\
|
|
82
|
+
" #{@additional_properties}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
# GenericUpdateResponse Model.
|
|
8
|
+
class GenericUpdateResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Response]
|
|
14
|
+
attr_accessor :response
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['response'] = 'response'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
[]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for nullable fields
|
|
29
|
+
def self.nullables
|
|
30
|
+
[]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def initialize(response:, additional_properties: nil)
|
|
34
|
+
# Add additional model properties to the instance
|
|
35
|
+
additional_properties = {} if additional_properties.nil?
|
|
36
|
+
|
|
37
|
+
@response = response
|
|
38
|
+
@additional_properties = additional_properties
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Creates an instance of the object from a hash.
|
|
42
|
+
def self.from_hash(hash)
|
|
43
|
+
return nil unless hash
|
|
44
|
+
|
|
45
|
+
# Extract variables from the hash.
|
|
46
|
+
response = Response.from_hash(hash['response']) if hash['response']
|
|
47
|
+
|
|
48
|
+
# Create a new hash for additional properties, removing known properties.
|
|
49
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
50
|
+
|
|
51
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
52
|
+
new_hash, proc { |value| value }
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# Create object from extracted values.
|
|
56
|
+
GenericUpdateResponse.new(response: response,
|
|
57
|
+
additional_properties: additional_properties)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Provides a human-readable string representation of the object.
|
|
61
|
+
def to_s
|
|
62
|
+
class_name = self.class.name.split('::').last
|
|
63
|
+
"<#{class_name} response: #{@response}, additional_properties: #{@additional_properties}>"
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
67
|
+
def inspect
|
|
68
|
+
class_name = self.class.name.split('::').last
|
|
69
|
+
"<#{class_name} response: #{@response.inspect}, additional_properties:"\
|
|
70
|
+
" #{@additional_properties}>"
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
# kind.
|
|
8
|
+
class Kind
|
|
9
|
+
KIND = [
|
|
10
|
+
# TODO: Write general description for BACKUP
|
|
11
|
+
BACKUP = 'backup'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for ENERGY
|
|
14
|
+
ENERGY = 'energy'.freeze
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
def self.validate(value)
|
|
18
|
+
return false if value.nil?
|
|
19
|
+
|
|
20
|
+
true
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = BACKUP)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'backup' then BACKUP
|
|
30
|
+
when 'energy' then ENERGY
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
# kind_Get wall connector charging history.
|
|
8
|
+
class KindGetWallConnectorChargingHistory
|
|
9
|
+
KIND_GET_WALL_CONNECTOR_CHARGING_HISTORY = [
|
|
10
|
+
# TODO: Write general description for CHARGE
|
|
11
|
+
CHARGE = 'charge'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
def self.validate(value)
|
|
15
|
+
return false if value.nil?
|
|
16
|
+
|
|
17
|
+
true
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.from_value(value, default_value = CHARGE)
|
|
21
|
+
return default_value if value.nil?
|
|
22
|
+
|
|
23
|
+
default_value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
# LiveStatusResponse Model.
|
|
8
|
+
class LiveStatusResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [ResponseLiveStatusResponse]
|
|
14
|
+
attr_accessor :response
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['response'] = 'response'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
[]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for nullable fields
|
|
29
|
+
def self.nullables
|
|
30
|
+
[]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def initialize(response:, additional_properties: nil)
|
|
34
|
+
# Add additional model properties to the instance
|
|
35
|
+
additional_properties = {} if additional_properties.nil?
|
|
36
|
+
|
|
37
|
+
@response = response
|
|
38
|
+
@additional_properties = additional_properties
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Creates an instance of the object from a hash.
|
|
42
|
+
def self.from_hash(hash)
|
|
43
|
+
return nil unless hash
|
|
44
|
+
|
|
45
|
+
# Extract variables from the hash.
|
|
46
|
+
response = ResponseLiveStatusResponse.from_hash(hash['response']) if hash['response']
|
|
47
|
+
|
|
48
|
+
# Create a new hash for additional properties, removing known properties.
|
|
49
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
50
|
+
|
|
51
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
52
|
+
new_hash, proc { |value| value }
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# Create object from extracted values.
|
|
56
|
+
LiveStatusResponse.new(response: response,
|
|
57
|
+
additional_properties: additional_properties)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Provides a human-readable string representation of the object.
|
|
61
|
+
def to_s
|
|
62
|
+
class_name = self.class.name.split('::').last
|
|
63
|
+
"<#{class_name} response: #{@response}, additional_properties: #{@additional_properties}>"
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
67
|
+
def inspect
|
|
68
|
+
class_name = self.class.name.split('::').last
|
|
69
|
+
"<#{class_name} response: #{@response.inspect}, additional_properties:"\
|
|
70
|
+
" #{@additional_properties}>"
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
# Location Model.
|
|
8
|
+
class Location < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :country
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :name
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['country'] = 'country'
|
|
24
|
+
@_hash['name'] = 'name'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
country
|
|
32
|
+
name
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(country: SKIP, name: SKIP, additional_properties: nil)
|
|
42
|
+
# Add additional model properties to the instance
|
|
43
|
+
additional_properties = {} if additional_properties.nil?
|
|
44
|
+
|
|
45
|
+
@country = country unless country == SKIP
|
|
46
|
+
@name = name unless name == SKIP
|
|
47
|
+
@additional_properties = additional_properties
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Creates an instance of the object from a hash.
|
|
51
|
+
def self.from_hash(hash)
|
|
52
|
+
return nil unless hash
|
|
53
|
+
|
|
54
|
+
# Extract variables from the hash.
|
|
55
|
+
country = hash.key?('country') ? hash['country'] : SKIP
|
|
56
|
+
name = hash.key?('name') ? hash['name'] : SKIP
|
|
57
|
+
|
|
58
|
+
# Create a new hash for additional properties, removing known properties.
|
|
59
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
60
|
+
|
|
61
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
62
|
+
new_hash, proc { |value| value }
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Create object from extracted values.
|
|
66
|
+
Location.new(country: country,
|
|
67
|
+
name: name,
|
|
68
|
+
additional_properties: additional_properties)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Provides a human-readable string representation of the object.
|
|
72
|
+
def to_s
|
|
73
|
+
class_name = self.class.name.split('::').last
|
|
74
|
+
"<#{class_name} country: #{@country}, name: #{@name}, additional_properties:"\
|
|
75
|
+
" #{@additional_properties}>"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
79
|
+
def inspect
|
|
80
|
+
class_name = self.class.name.split('::').last
|
|
81
|
+
"<#{class_name} country: #{@country.inspect}, name: #{@name.inspect},"\
|
|
82
|
+
" additional_properties: #{@additional_properties}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
# Location1 Model.
|
|
8
|
+
class Location1 < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Float]
|
|
14
|
+
attr_accessor :lat
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [Float]
|
|
18
|
+
attr_accessor :long
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['lat'] = 'lat'
|
|
24
|
+
@_hash['long'] = 'long'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
lat
|
|
32
|
+
long
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(lat: SKIP, long: SKIP, additional_properties: nil)
|
|
42
|
+
# Add additional model properties to the instance
|
|
43
|
+
additional_properties = {} if additional_properties.nil?
|
|
44
|
+
|
|
45
|
+
@lat = lat unless lat == SKIP
|
|
46
|
+
@long = long unless long == SKIP
|
|
47
|
+
@additional_properties = additional_properties
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Creates an instance of the object from a hash.
|
|
51
|
+
def self.from_hash(hash)
|
|
52
|
+
return nil unless hash
|
|
53
|
+
|
|
54
|
+
# Extract variables from the hash.
|
|
55
|
+
lat = hash.key?('lat') ? hash['lat'] : SKIP
|
|
56
|
+
long = hash.key?('long') ? hash['long'] : SKIP
|
|
57
|
+
|
|
58
|
+
# Create a new hash for additional properties, removing known properties.
|
|
59
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
60
|
+
|
|
61
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
62
|
+
new_hash, proc { |value| value }
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Create object from extracted values.
|
|
66
|
+
Location1.new(lat: lat,
|
|
67
|
+
long: long,
|
|
68
|
+
additional_properties: additional_properties)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Provides a human-readable string representation of the object.
|
|
72
|
+
def to_s
|
|
73
|
+
class_name = self.class.name.split('::').last
|
|
74
|
+
"<#{class_name} lat: #{@lat}, long: #{@long}, additional_properties:"\
|
|
75
|
+
" #{@additional_properties}>"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
79
|
+
def inspect
|
|
80
|
+
class_name = self.class.name.split('::').last
|
|
81
|
+
"<#{class_name} lat: #{@lat.inspect}, long: #{@long.inspect}, additional_properties:"\
|
|
82
|
+
" #{@additional_properties}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
# MeResponse Model.
|
|
8
|
+
class MeResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [ResponseMeResponse]
|
|
14
|
+
attr_accessor :response
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['response'] = 'response'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
[]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for nullable fields
|
|
29
|
+
def self.nullables
|
|
30
|
+
[]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def initialize(response:, additional_properties: nil)
|
|
34
|
+
# Add additional model properties to the instance
|
|
35
|
+
additional_properties = {} if additional_properties.nil?
|
|
36
|
+
|
|
37
|
+
@response = response
|
|
38
|
+
@additional_properties = additional_properties
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Creates an instance of the object from a hash.
|
|
42
|
+
def self.from_hash(hash)
|
|
43
|
+
return nil unless hash
|
|
44
|
+
|
|
45
|
+
# Extract variables from the hash.
|
|
46
|
+
response = ResponseMeResponse.from_hash(hash['response']) if hash['response']
|
|
47
|
+
|
|
48
|
+
# Create a new hash for additional properties, removing known properties.
|
|
49
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
50
|
+
|
|
51
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
52
|
+
new_hash, proc { |value| value }
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# Create object from extracted values.
|
|
56
|
+
MeResponse.new(response: response,
|
|
57
|
+
additional_properties: additional_properties)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Provides a human-readable string representation of the object.
|
|
61
|
+
def to_s
|
|
62
|
+
class_name = self.class.name.split('::').last
|
|
63
|
+
"<#{class_name} response: #{@response}, additional_properties: #{@additional_properties}>"
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
67
|
+
def inspect
|
|
68
|
+
class_name = self.class.name.split('::').last
|
|
69
|
+
"<#{class_name} response: #{@response.inspect}, additional_properties:"\
|
|
70
|
+
" #{@additional_properties}>"
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|