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,223 @@
|
|
|
1
|
+
# tesla_fleet_management_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
require 'date'
|
|
7
|
+
module TeslaFleetManagementApi
|
|
8
|
+
# ResponseRegisterPartnerResponse Model.
|
|
9
|
+
class ResponseRegisterPartnerResponse < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for this method
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :client_id
|
|
16
|
+
|
|
17
|
+
# TODO: Write general description for this method
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :name
|
|
20
|
+
|
|
21
|
+
# TODO: Write general description for this method
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :description
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for this method
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :domain
|
|
28
|
+
|
|
29
|
+
# TODO: Write general description for this method
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :ca
|
|
32
|
+
|
|
33
|
+
# TODO: Write general description for this method
|
|
34
|
+
# @return [DateTime]
|
|
35
|
+
attr_accessor :created_at
|
|
36
|
+
|
|
37
|
+
# TODO: Write general description for this method
|
|
38
|
+
# @return [DateTime]
|
|
39
|
+
attr_accessor :updated_at
|
|
40
|
+
|
|
41
|
+
# TODO: Write general description for this method
|
|
42
|
+
# @return [String]
|
|
43
|
+
attr_accessor :enterprise_tier
|
|
44
|
+
|
|
45
|
+
# TODO: Write general description for this method
|
|
46
|
+
# @return [String]
|
|
47
|
+
attr_accessor :account_id
|
|
48
|
+
|
|
49
|
+
# TODO: Write general description for this method
|
|
50
|
+
# @return [String]
|
|
51
|
+
attr_accessor :issuer
|
|
52
|
+
|
|
53
|
+
# TODO: Write general description for this method
|
|
54
|
+
# @return [String]
|
|
55
|
+
attr_accessor :csr
|
|
56
|
+
|
|
57
|
+
# TODO: Write general description for this method
|
|
58
|
+
# @return [DateTime]
|
|
59
|
+
attr_accessor :csr_updated_at
|
|
60
|
+
|
|
61
|
+
# TODO: Write general description for this method
|
|
62
|
+
# @return [String]
|
|
63
|
+
attr_accessor :public_key
|
|
64
|
+
|
|
65
|
+
# TODO: Write general description for this method
|
|
66
|
+
# @return [String]
|
|
67
|
+
attr_accessor :public_key_hash
|
|
68
|
+
|
|
69
|
+
# A mapping from model property names to API property names.
|
|
70
|
+
def self.names
|
|
71
|
+
@_hash = {} if @_hash.nil?
|
|
72
|
+
@_hash['client_id'] = 'client_id'
|
|
73
|
+
@_hash['name'] = 'name'
|
|
74
|
+
@_hash['description'] = 'description'
|
|
75
|
+
@_hash['domain'] = 'domain'
|
|
76
|
+
@_hash['ca'] = 'ca'
|
|
77
|
+
@_hash['created_at'] = 'created_at'
|
|
78
|
+
@_hash['updated_at'] = 'updated_at'
|
|
79
|
+
@_hash['enterprise_tier'] = 'enterprise_tier'
|
|
80
|
+
@_hash['account_id'] = 'account_id'
|
|
81
|
+
@_hash['issuer'] = 'issuer'
|
|
82
|
+
@_hash['csr'] = 'csr'
|
|
83
|
+
@_hash['csr_updated_at'] = 'csr_updated_at'
|
|
84
|
+
@_hash['public_key'] = 'public_key'
|
|
85
|
+
@_hash['public_key_hash'] = 'public_key_hash'
|
|
86
|
+
@_hash
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# An array for optional fields
|
|
90
|
+
def self.optionals
|
|
91
|
+
%w[
|
|
92
|
+
description
|
|
93
|
+
ca
|
|
94
|
+
issuer
|
|
95
|
+
csr
|
|
96
|
+
csr_updated_at
|
|
97
|
+
]
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# An array for nullable fields
|
|
101
|
+
def self.nullables
|
|
102
|
+
%w[
|
|
103
|
+
ca
|
|
104
|
+
issuer
|
|
105
|
+
csr
|
|
106
|
+
csr_updated_at
|
|
107
|
+
]
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
def initialize(client_id:, name:, domain:, created_at:, updated_at:,
|
|
111
|
+
enterprise_tier:, account_id:, public_key:, public_key_hash:,
|
|
112
|
+
description: SKIP, ca: SKIP, issuer: SKIP, csr: SKIP,
|
|
113
|
+
csr_updated_at: SKIP, additional_properties: nil)
|
|
114
|
+
# Add additional model properties to the instance
|
|
115
|
+
additional_properties = {} if additional_properties.nil?
|
|
116
|
+
|
|
117
|
+
@client_id = client_id
|
|
118
|
+
@name = name
|
|
119
|
+
@description = description unless description == SKIP
|
|
120
|
+
@domain = domain
|
|
121
|
+
@ca = ca unless ca == SKIP
|
|
122
|
+
@created_at = created_at
|
|
123
|
+
@updated_at = updated_at
|
|
124
|
+
@enterprise_tier = enterprise_tier
|
|
125
|
+
@account_id = account_id
|
|
126
|
+
@issuer = issuer unless issuer == SKIP
|
|
127
|
+
@csr = csr unless csr == SKIP
|
|
128
|
+
@csr_updated_at = csr_updated_at unless csr_updated_at == SKIP
|
|
129
|
+
@public_key = public_key
|
|
130
|
+
@public_key_hash = public_key_hash
|
|
131
|
+
@additional_properties = additional_properties
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Creates an instance of the object from a hash.
|
|
135
|
+
def self.from_hash(hash)
|
|
136
|
+
return nil unless hash
|
|
137
|
+
|
|
138
|
+
# Extract variables from the hash.
|
|
139
|
+
client_id = hash.key?('client_id') ? hash['client_id'] : nil
|
|
140
|
+
name = hash.key?('name') ? hash['name'] : nil
|
|
141
|
+
domain = hash.key?('domain') ? hash['domain'] : nil
|
|
142
|
+
created_at = if hash.key?('created_at')
|
|
143
|
+
(DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at'])
|
|
144
|
+
end
|
|
145
|
+
updated_at = if hash.key?('updated_at')
|
|
146
|
+
(DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at'])
|
|
147
|
+
end
|
|
148
|
+
enterprise_tier =
|
|
149
|
+
hash.key?('enterprise_tier') ? hash['enterprise_tier'] : nil
|
|
150
|
+
account_id = hash.key?('account_id') ? hash['account_id'] : nil
|
|
151
|
+
public_key = hash.key?('public_key') ? hash['public_key'] : nil
|
|
152
|
+
public_key_hash =
|
|
153
|
+
hash.key?('public_key_hash') ? hash['public_key_hash'] : nil
|
|
154
|
+
description = hash.key?('description') ? hash['description'] : SKIP
|
|
155
|
+
ca = hash.key?('ca') ? hash['ca'] : SKIP
|
|
156
|
+
issuer = hash.key?('issuer') ? hash['issuer'] : SKIP
|
|
157
|
+
csr = hash.key?('csr') ? hash['csr'] : SKIP
|
|
158
|
+
csr_updated_at = if hash.key?('csr_updated_at')
|
|
159
|
+
(DateTimeHelper.from_rfc3339(hash['csr_updated_at']) if hash['csr_updated_at'])
|
|
160
|
+
else
|
|
161
|
+
SKIP
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Create a new hash for additional properties, removing known properties.
|
|
165
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
166
|
+
|
|
167
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
168
|
+
new_hash, proc { |value| value }
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
# Create object from extracted values.
|
|
172
|
+
ResponseRegisterPartnerResponse.new(client_id: client_id,
|
|
173
|
+
name: name,
|
|
174
|
+
domain: domain,
|
|
175
|
+
created_at: created_at,
|
|
176
|
+
updated_at: updated_at,
|
|
177
|
+
enterprise_tier: enterprise_tier,
|
|
178
|
+
account_id: account_id,
|
|
179
|
+
public_key: public_key,
|
|
180
|
+
public_key_hash: public_key_hash,
|
|
181
|
+
description: description,
|
|
182
|
+
ca: ca,
|
|
183
|
+
issuer: issuer,
|
|
184
|
+
csr: csr,
|
|
185
|
+
csr_updated_at: csr_updated_at,
|
|
186
|
+
additional_properties: additional_properties)
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
def to_custom_created_at
|
|
190
|
+
DateTimeHelper.to_rfc3339(created_at)
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
def to_custom_updated_at
|
|
194
|
+
DateTimeHelper.to_rfc3339(updated_at)
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
def to_custom_csr_updated_at
|
|
198
|
+
DateTimeHelper.to_rfc3339(csr_updated_at)
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Provides a human-readable string representation of the object.
|
|
202
|
+
def to_s
|
|
203
|
+
class_name = self.class.name.split('::').last
|
|
204
|
+
"<#{class_name} client_id: #{@client_id}, name: #{@name}, description: #{@description},"\
|
|
205
|
+
" domain: #{@domain}, ca: #{@ca}, created_at: #{@created_at}, updated_at: #{@updated_at},"\
|
|
206
|
+
" enterprise_tier: #{@enterprise_tier}, account_id: #{@account_id}, issuer: #{@issuer}, csr:"\
|
|
207
|
+
" #{@csr}, csr_updated_at: #{@csr_updated_at}, public_key: #{@public_key}, public_key_hash:"\
|
|
208
|
+
" #{@public_key_hash}, additional_properties: #{@additional_properties}>"
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
212
|
+
def inspect
|
|
213
|
+
class_name = self.class.name.split('::').last
|
|
214
|
+
"<#{class_name} client_id: #{@client_id.inspect}, name: #{@name.inspect}, description:"\
|
|
215
|
+
" #{@description.inspect}, domain: #{@domain.inspect}, ca: #{@ca.inspect}, created_at:"\
|
|
216
|
+
" #{@created_at.inspect}, updated_at: #{@updated_at.inspect}, enterprise_tier:"\
|
|
217
|
+
" #{@enterprise_tier.inspect}, account_id: #{@account_id.inspect}, issuer:"\
|
|
218
|
+
" #{@issuer.inspect}, csr: #{@csr.inspect}, csr_updated_at: #{@csr_updated_at.inspect},"\
|
|
219
|
+
" public_key: #{@public_key.inspect}, public_key_hash: #{@public_key_hash.inspect},"\
|
|
220
|
+
" additional_properties: #{@additional_properties}>"
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
end
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
# Signaling Model.
|
|
8
|
+
class Signaling < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [TrueClass | FalseClass]
|
|
14
|
+
attr_accessor :enabled
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [TrueClass | FalseClass]
|
|
18
|
+
attr_accessor :subscribe_connectivity
|
|
19
|
+
|
|
20
|
+
# TODO: Write general description for this method
|
|
21
|
+
# @return [TrueClass | FalseClass]
|
|
22
|
+
attr_accessor :use_auth_token
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['enabled'] = 'enabled'
|
|
28
|
+
@_hash['subscribe_connectivity'] = 'subscribe_connectivity'
|
|
29
|
+
@_hash['use_auth_token'] = 'use_auth_token'
|
|
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(enabled:, subscribe_connectivity:, use_auth_token:,
|
|
44
|
+
additional_properties: nil)
|
|
45
|
+
# Add additional model properties to the instance
|
|
46
|
+
additional_properties = {} if additional_properties.nil?
|
|
47
|
+
|
|
48
|
+
@enabled = enabled
|
|
49
|
+
@subscribe_connectivity = subscribe_connectivity
|
|
50
|
+
@use_auth_token = use_auth_token
|
|
51
|
+
@additional_properties = additional_properties
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Creates an instance of the object from a hash.
|
|
55
|
+
def self.from_hash(hash)
|
|
56
|
+
return nil unless hash
|
|
57
|
+
|
|
58
|
+
# Extract variables from the hash.
|
|
59
|
+
enabled = hash.key?('enabled') ? hash['enabled'] : nil
|
|
60
|
+
subscribe_connectivity =
|
|
61
|
+
hash.key?('subscribe_connectivity') ? hash['subscribe_connectivity'] : nil
|
|
62
|
+
use_auth_token =
|
|
63
|
+
hash.key?('use_auth_token') ? hash['use_auth_token'] : nil
|
|
64
|
+
|
|
65
|
+
# Create a new hash for additional properties, removing known properties.
|
|
66
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
67
|
+
|
|
68
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
69
|
+
new_hash, proc { |value| value }
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
# Create object from extracted values.
|
|
73
|
+
Signaling.new(enabled: enabled,
|
|
74
|
+
subscribe_connectivity: subscribe_connectivity,
|
|
75
|
+
use_auth_token: use_auth_token,
|
|
76
|
+
additional_properties: additional_properties)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Provides a human-readable string representation of the object.
|
|
80
|
+
def to_s
|
|
81
|
+
class_name = self.class.name.split('::').last
|
|
82
|
+
"<#{class_name} enabled: #{@enabled}, subscribe_connectivity: #{@subscribe_connectivity},"\
|
|
83
|
+
" use_auth_token: #{@use_auth_token}, additional_properties: #{@additional_properties}>"
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
87
|
+
def inspect
|
|
88
|
+
class_name = self.class.name.split('::').last
|
|
89
|
+
"<#{class_name} enabled: #{@enabled.inspect}, subscribe_connectivity:"\
|
|
90
|
+
" #{@subscribe_connectivity.inspect}, use_auth_token: #{@use_auth_token.inspect},"\
|
|
91
|
+
" additional_properties: #{@additional_properties}>"
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
# SimpleOkResponse Model.
|
|
8
|
+
class SimpleOkResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
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
|
+
%w[
|
|
26
|
+
response
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(response: SKIP, additional_properties: nil)
|
|
36
|
+
# Add additional model properties to the instance
|
|
37
|
+
additional_properties = {} if additional_properties.nil?
|
|
38
|
+
|
|
39
|
+
@response = response unless response == SKIP
|
|
40
|
+
@additional_properties = additional_properties
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Creates an instance of the object from a hash.
|
|
44
|
+
def self.from_hash(hash)
|
|
45
|
+
return nil unless hash
|
|
46
|
+
|
|
47
|
+
# Extract variables from the hash.
|
|
48
|
+
response = hash.key?('response') ? hash['response'] : SKIP
|
|
49
|
+
|
|
50
|
+
# Create a new hash for additional properties, removing known properties.
|
|
51
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
52
|
+
|
|
53
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
54
|
+
new_hash, proc { |value| value }
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
# Create object from extracted values.
|
|
58
|
+
SimpleOkResponse.new(response: response,
|
|
59
|
+
additional_properties: additional_properties)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Provides a human-readable string representation of the object.
|
|
63
|
+
def to_s
|
|
64
|
+
class_name = self.class.name.split('::').last
|
|
65
|
+
"<#{class_name} response: #{@response}, additional_properties: #{@additional_properties}>"
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
69
|
+
def inspect
|
|
70
|
+
class_name = self.class.name.split('::').last
|
|
71
|
+
"<#{class_name} response: #{@response.inspect}, additional_properties:"\
|
|
72
|
+
" #{@additional_properties}>"
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
# SiteInfoResponse Model.
|
|
8
|
+
class SiteInfoResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Object]
|
|
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
|
+
%w[
|
|
26
|
+
response
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(response: SKIP, additional_properties: nil)
|
|
36
|
+
# Add additional model properties to the instance
|
|
37
|
+
additional_properties = {} if additional_properties.nil?
|
|
38
|
+
|
|
39
|
+
@response = response unless response == SKIP
|
|
40
|
+
@additional_properties = additional_properties
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Creates an instance of the object from a hash.
|
|
44
|
+
def self.from_hash(hash)
|
|
45
|
+
return nil unless hash
|
|
46
|
+
|
|
47
|
+
# Extract variables from the hash.
|
|
48
|
+
response = hash.key?('response') ? hash['response'] : SKIP
|
|
49
|
+
|
|
50
|
+
# Create a new hash for additional properties, removing known properties.
|
|
51
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
52
|
+
|
|
53
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
54
|
+
new_hash, proc { |value| value }
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
# Create object from extracted values.
|
|
58
|
+
SiteInfoResponse.new(response: response,
|
|
59
|
+
additional_properties: additional_properties)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Provides a human-readable string representation of the object.
|
|
63
|
+
def to_s
|
|
64
|
+
class_name = self.class.name.split('::').last
|
|
65
|
+
"<#{class_name} response: #{@response}, additional_properties: #{@additional_properties}>"
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
69
|
+
def inspect
|
|
70
|
+
class_name = self.class.name.split('::').last
|
|
71
|
+
"<#{class_name} response: #{@response.inspect}, additional_properties:"\
|
|
72
|
+
" #{@additional_properties}>"
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
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
|
+
# StormModeRequest Model.
|
|
8
|
+
class StormModeRequest < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [TrueClass | FalseClass]
|
|
14
|
+
attr_accessor :enabled
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['enabled'] = 'enabled'
|
|
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(enabled:, additional_properties: nil)
|
|
34
|
+
# Add additional model properties to the instance
|
|
35
|
+
additional_properties = {} if additional_properties.nil?
|
|
36
|
+
|
|
37
|
+
@enabled = enabled
|
|
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
|
+
enabled = hash.key?('enabled') ? hash['enabled'] : nil
|
|
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
|
+
StormModeRequest.new(enabled: enabled,
|
|
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} enabled: #{@enabled}, 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} enabled: #{@enabled.inspect}, additional_properties:"\
|
|
70
|
+
" #{@additional_properties}>"
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
+
# TariffElement Model.
|
|
8
|
+
class TariffElement < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Array[PriceComponent]]
|
|
14
|
+
attr_accessor :price_components
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [Hash[String, Object]]
|
|
18
|
+
attr_accessor :restrictions
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['price_components'] = 'price_components'
|
|
24
|
+
@_hash['restrictions'] = 'restrictions'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
price_components
|
|
32
|
+
restrictions
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(price_components: SKIP, restrictions: SKIP,
|
|
42
|
+
additional_properties: nil)
|
|
43
|
+
# Add additional model properties to the instance
|
|
44
|
+
additional_properties = {} if additional_properties.nil?
|
|
45
|
+
|
|
46
|
+
@price_components = price_components unless price_components == SKIP
|
|
47
|
+
@restrictions = restrictions unless restrictions == SKIP
|
|
48
|
+
@additional_properties = additional_properties
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Creates an instance of the object from a hash.
|
|
52
|
+
def self.from_hash(hash)
|
|
53
|
+
return nil unless hash
|
|
54
|
+
|
|
55
|
+
# Extract variables from the hash.
|
|
56
|
+
# Parameter is an array, so we need to iterate through it
|
|
57
|
+
price_components = nil
|
|
58
|
+
unless hash['price_components'].nil?
|
|
59
|
+
price_components = []
|
|
60
|
+
hash['price_components'].each do |structure|
|
|
61
|
+
price_components << (PriceComponent.from_hash(structure) if structure)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
price_components = SKIP unless hash.key?('price_components')
|
|
66
|
+
restrictions = hash.key?('restrictions') ? hash['restrictions'] : SKIP
|
|
67
|
+
|
|
68
|
+
# Create a new hash for additional properties, removing known properties.
|
|
69
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
70
|
+
|
|
71
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
72
|
+
new_hash, proc { |value| value }
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
# Create object from extracted values.
|
|
76
|
+
TariffElement.new(price_components: price_components,
|
|
77
|
+
restrictions: restrictions,
|
|
78
|
+
additional_properties: additional_properties)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Provides a human-readable string representation of the object.
|
|
82
|
+
def to_s
|
|
83
|
+
class_name = self.class.name.split('::').last
|
|
84
|
+
"<#{class_name} price_components: #{@price_components}, restrictions: #{@restrictions},"\
|
|
85
|
+
" additional_properties: #{@additional_properties}>"
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
89
|
+
def inspect
|
|
90
|
+
class_name = self.class.name.split('::').last
|
|
91
|
+
"<#{class_name} price_components: #{@price_components.inspect}, restrictions:"\
|
|
92
|
+
" #{@restrictions.inspect}, additional_properties: #{@additional_properties}>"
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|