crisphive 0.1.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/Gemfile +9 -0
- data/README.md +219 -0
- data/Rakefile +10 -0
- data/crisphive.gemspec +40 -0
- data/git_push.sh +57 -0
- data/lib/crisphive/api/business_skill_api.rb +211 -0
- data/lib/crisphive/api/customer_api.rb +371 -0
- data/lib/crisphive/api/job_request_business_api.rb +449 -0
- data/lib/crisphive/api/job_types_api.rb +141 -0
- data/lib/crisphive/api/service_area_api.rb +148 -0
- data/lib/crisphive/api/technician_api.rb +163 -0
- data/lib/crisphive/api/vehicle_api.rb +157 -0
- data/lib/crisphive/api_client.rb +437 -0
- data/lib/crisphive/api_error.rb +58 -0
- data/lib/crisphive/configuration.rb +393 -0
- data/lib/crisphive/models/create_customer200_response.rb +250 -0
- data/lib/crisphive/models/create_job_request200_response.rb +250 -0
- data/lib/crisphive/models/customer.rb +235 -0
- data/lib/crisphive/models/customer_address.rb +295 -0
- data/lib/crisphive/models/customer_address_request.rb +475 -0
- data/lib/crisphive/models/customer_contact.rb +255 -0
- data/lib/crisphive/models/customer_create_request.rb +383 -0
- data/lib/crisphive/models/customer_create_response.rb +215 -0
- data/lib/crisphive/models/customer_list.rb +247 -0
- data/lib/crisphive/models/customer_list_item.rb +341 -0
- data/lib/crisphive/models/customer_profile.rb +321 -0
- data/lib/crisphive/models/customer_spending.rb +299 -0
- data/lib/crisphive/models/customer_tier_progress.rb +235 -0
- data/lib/crisphive/models/customer_update_request.rb +434 -0
- data/lib/crisphive/models/get_customer200_response.rb +250 -0
- data/lib/crisphive/models/get_job_request200_response.rb +250 -0
- data/lib/crisphive/models/get_job_request_timeline200_response.rb +250 -0
- data/lib/crisphive/models/get_job_type200_response.rb +250 -0
- data/lib/crisphive/models/get_service_area200_response.rb +250 -0
- data/lib/crisphive/models/get_technician200_response.rb +250 -0
- data/lib/crisphive/models/get_vehicle200_response.rb +250 -0
- data/lib/crisphive/models/job_date.rb +225 -0
- data/lib/crisphive/models/job_date_business_range.rb +263 -0
- data/lib/crisphive/models/job_date_period.rb +41 -0
- data/lib/crisphive/models/job_date_period_entry.rb +247 -0
- data/lib/crisphive/models/job_request.rb +537 -0
- data/lib/crisphive/models/job_request_action_audit_by.rb +259 -0
- data/lib/crisphive/models/job_request_action_audit_entry.rb +235 -0
- data/lib/crisphive/models/job_request_action_summary.rb +281 -0
- data/lib/crisphive/models/job_request_address_summary.rb +295 -0
- data/lib/crisphive/models/job_request_archive_summary.rb +245 -0
- data/lib/crisphive/models/job_request_arrival_window.rb +235 -0
- data/lib/crisphive/models/job_request_assigned_vehicle.rb +225 -0
- data/lib/crisphive/models/job_request_assignment_summary.rb +255 -0
- data/lib/crisphive/models/job_request_booking_windows.rb +247 -0
- data/lib/crisphive/models/job_request_business_time_range.rb +279 -0
- data/lib/crisphive/models/job_request_changes.rb +237 -0
- data/lib/crisphive/models/job_request_create_request.rb +339 -0
- data/lib/crisphive/models/job_request_create_response.rb +245 -0
- data/lib/crisphive/models/job_request_crew_member.rb +352 -0
- data/lib/crisphive/models/job_request_customer_summary.rb +245 -0
- data/lib/crisphive/models/job_request_day_windows.rb +227 -0
- data/lib/crisphive/models/job_request_job_date_business_range_request.rb +279 -0
- data/lib/crisphive/models/job_request_job_date_period_request.rb +268 -0
- data/lib/crisphive/models/job_request_job_date_request.rb +269 -0
- data/lib/crisphive/models/job_request_list.rb +227 -0
- data/lib/crisphive/models/job_request_period.rb +261 -0
- data/lib/crisphive/models/job_request_quote_summary.rb +245 -0
- data/lib/crisphive/models/job_request_rating_summary.rb +245 -0
- data/lib/crisphive/models/job_request_schedule.rb +289 -0
- data/lib/crisphive/models/job_request_session.rb +274 -0
- data/lib/crisphive/models/job_request_skill_summary.rb +255 -0
- data/lib/crisphive/models/job_request_status_summary.rb +225 -0
- data/lib/crisphive/models/job_request_technician_info.rb +265 -0
- data/lib/crisphive/models/job_request_timeline.rb +257 -0
- data/lib/crisphive/models/job_request_timeline_action.rb +311 -0
- data/lib/crisphive/models/job_request_timeline_event.rb +291 -0
- data/lib/crisphive/models/job_type.rb +309 -0
- data/lib/crisphive/models/list_customers200_response.rb +250 -0
- data/lib/crisphive/models/list_job_request_booking_windows200_response.rb +250 -0
- data/lib/crisphive/models/list_job_request_changes200_response.rb +250 -0
- data/lib/crisphive/models/list_job_requests200_response.rb +250 -0
- data/lib/crisphive/models/list_job_types200_response.rb +252 -0
- data/lib/crisphive/models/list_service_areas200_response.rb +250 -0
- data/lib/crisphive/models/list_skill_categories200_response.rb +250 -0
- data/lib/crisphive/models/list_skills200_response.rb +250 -0
- data/lib/crisphive/models/list_skills_by_category200_response.rb +250 -0
- data/lib/crisphive/models/list_technicians200_response.rb +250 -0
- data/lib/crisphive/models/list_vehicles200_response.rb +250 -0
- data/lib/crisphive/models/pagination.rb +250 -0
- data/lib/crisphive/models/response_envelope.rb +244 -0
- data/lib/crisphive/models/service_area.rb +315 -0
- data/lib/crisphive/models/service_area_list.rb +227 -0
- data/lib/crisphive/models/skill.rb +278 -0
- data/lib/crisphive/models/skill_by_category_list.rb +225 -0
- data/lib/crisphive/models/skill_category.rb +250 -0
- data/lib/crisphive/models/skill_category_list.rb +225 -0
- data/lib/crisphive/models/skill_list.rb +217 -0
- data/lib/crisphive/models/skill_summary.rb +255 -0
- data/lib/crisphive/models/technician.rb +499 -0
- data/lib/crisphive/models/technician_address.rb +275 -0
- data/lib/crisphive/models/technician_lead_ref.rb +225 -0
- data/lib/crisphive/models/technician_list.rb +247 -0
- data/lib/crisphive/models/technician_service_area_ref.rb +225 -0
- data/lib/crisphive/models/technician_status.rb +41 -0
- data/lib/crisphive/models/vehicle.rb +413 -0
- data/lib/crisphive/models/vehicle_list.rb +247 -0
- data/lib/crisphive/models/vehicle_owner.rb +225 -0
- data/lib/crisphive/version.rb +15 -0
- data/lib/crisphive.rb +134 -0
- data/spec/spec_helper.rb +111 -0
- metadata +220 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#CrispHive Developer API
|
|
3
|
+
|
|
4
|
+
#Public REST API for integrating CrispHive from your own backend. Authenticate every request with a secret API key as a Bearer token (`Authorization: Bearer chsk_live_…`). The key prefix selects the data environment: `chsk_live_…` → production (live), `chsk_test_…` → sandbox (isolated test). **Key scopes (restricted keys).** A key is either *full-access* (can call every endpoint below) or *restricted* to a set of permission codes chosen at creation — the same codes as the dashboard permission grid (e.g. `customers_view`, `job_create`, `team_manage`). A restricted key calling an endpoint outside its scope gets `403`. The full code list is the permission catalog (`GET /permission/modules` on the dashboard API). Create, scope, and revoke keys from the business dashboard. Every response is wrapped in the envelope `{ \"error_code\": 0, \"message\": \"Success\", \"data\": <payload> }`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.11.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Crisphive
|
|
16
|
+
class ServiceAreaApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get a service area
|
|
23
|
+
# Returns details of a specific service area
|
|
24
|
+
# @param id [String] Service Area ID
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [GetServiceArea200Response]
|
|
27
|
+
def get_service_area(id, opts = {})
|
|
28
|
+
data, _status_code, _headers = get_service_area_with_http_info(id, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get a service area
|
|
33
|
+
# Returns details of a specific service area
|
|
34
|
+
# @param id [String] Service Area ID
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(GetServiceArea200Response, Integer, Hash)>] GetServiceArea200Response data, response status code and response headers
|
|
37
|
+
def get_service_area_with_http_info(id, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: ServiceAreaApi.get_service_area ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'id' is set
|
|
42
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ServiceAreaApi.get_service_area"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/service-areas/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
|
|
56
|
+
# form parameters
|
|
57
|
+
form_params = opts[:form_params] || {}
|
|
58
|
+
|
|
59
|
+
# http body (model)
|
|
60
|
+
post_body = opts[:debug_body]
|
|
61
|
+
|
|
62
|
+
# return_type
|
|
63
|
+
return_type = opts[:debug_return_type] || 'GetServiceArea200Response'
|
|
64
|
+
|
|
65
|
+
# auth_names
|
|
66
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
67
|
+
|
|
68
|
+
new_options = opts.merge(
|
|
69
|
+
:operation => :"ServiceAreaApi.get_service_area",
|
|
70
|
+
:header_params => header_params,
|
|
71
|
+
:query_params => query_params,
|
|
72
|
+
:form_params => form_params,
|
|
73
|
+
:body => post_body,
|
|
74
|
+
:auth_names => auth_names,
|
|
75
|
+
:return_type => return_type
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
79
|
+
if @api_client.config.debugging
|
|
80
|
+
@api_client.config.logger.debug "API called: ServiceAreaApi#get_service_area\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
|
+
end
|
|
82
|
+
return data, status_code, headers
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# List service areas
|
|
86
|
+
# Returns a paginated list of service areas for the business
|
|
87
|
+
# @param [Hash] opts the optional parameters
|
|
88
|
+
# @option opts [Integer] :page Page number (default 1)
|
|
89
|
+
# @option opts [Integer] :limit Items per page (default 15, max 1000)
|
|
90
|
+
# @return [ListServiceAreas200Response]
|
|
91
|
+
def list_service_areas(opts = {})
|
|
92
|
+
data, _status_code, _headers = list_service_areas_with_http_info(opts)
|
|
93
|
+
data
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# List service areas
|
|
97
|
+
# Returns a paginated list of service areas for the business
|
|
98
|
+
# @param [Hash] opts the optional parameters
|
|
99
|
+
# @option opts [Integer] :page Page number (default 1)
|
|
100
|
+
# @option opts [Integer] :limit Items per page (default 15, max 1000)
|
|
101
|
+
# @return [Array<(ListServiceAreas200Response, Integer, Hash)>] ListServiceAreas200Response data, response status code and response headers
|
|
102
|
+
def list_service_areas_with_http_info(opts = {})
|
|
103
|
+
if @api_client.config.debugging
|
|
104
|
+
@api_client.config.logger.debug 'Calling API: ServiceAreaApi.list_service_areas ...'
|
|
105
|
+
end
|
|
106
|
+
# resource path
|
|
107
|
+
local_var_path = '/service-areas'
|
|
108
|
+
|
|
109
|
+
# query parameters
|
|
110
|
+
query_params = opts[:query_params] || {}
|
|
111
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
112
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
113
|
+
|
|
114
|
+
# header parameters
|
|
115
|
+
header_params = opts[:header_params] || {}
|
|
116
|
+
# HTTP header 'Accept' (if needed)
|
|
117
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
118
|
+
|
|
119
|
+
# form parameters
|
|
120
|
+
form_params = opts[:form_params] || {}
|
|
121
|
+
|
|
122
|
+
# http body (model)
|
|
123
|
+
post_body = opts[:debug_body]
|
|
124
|
+
|
|
125
|
+
# return_type
|
|
126
|
+
return_type = opts[:debug_return_type] || 'ListServiceAreas200Response'
|
|
127
|
+
|
|
128
|
+
# auth_names
|
|
129
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
130
|
+
|
|
131
|
+
new_options = opts.merge(
|
|
132
|
+
:operation => :"ServiceAreaApi.list_service_areas",
|
|
133
|
+
:header_params => header_params,
|
|
134
|
+
:query_params => query_params,
|
|
135
|
+
:form_params => form_params,
|
|
136
|
+
:body => post_body,
|
|
137
|
+
:auth_names => auth_names,
|
|
138
|
+
:return_type => return_type
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
142
|
+
if @api_client.config.debugging
|
|
143
|
+
@api_client.config.logger.debug "API called: ServiceAreaApi#list_service_areas\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
144
|
+
end
|
|
145
|
+
return data, status_code, headers
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
end
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#CrispHive Developer API
|
|
3
|
+
|
|
4
|
+
#Public REST API for integrating CrispHive from your own backend. Authenticate every request with a secret API key as a Bearer token (`Authorization: Bearer chsk_live_…`). The key prefix selects the data environment: `chsk_live_…` → production (live), `chsk_test_…` → sandbox (isolated test). **Key scopes (restricted keys).** A key is either *full-access* (can call every endpoint below) or *restricted* to a set of permission codes chosen at creation — the same codes as the dashboard permission grid (e.g. `customers_view`, `job_create`, `team_manage`). A restricted key calling an endpoint outside its scope gets `403`. The full code list is the permission catalog (`GET /permission/modules` on the dashboard API). Create, scope, and revoke keys from the business dashboard. Every response is wrapped in the envelope `{ \"error_code\": 0, \"message\": \"Success\", \"data\": <payload> }`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.11.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Crisphive
|
|
16
|
+
class TechnicianApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get a technician
|
|
23
|
+
# Returns details for a specific technician
|
|
24
|
+
# @param id [String] Technician ID
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [GetTechnician200Response]
|
|
27
|
+
def get_technician(id, opts = {})
|
|
28
|
+
data, _status_code, _headers = get_technician_with_http_info(id, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get a technician
|
|
33
|
+
# Returns details for a specific technician
|
|
34
|
+
# @param id [String] Technician ID
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(GetTechnician200Response, Integer, Hash)>] GetTechnician200Response data, response status code and response headers
|
|
37
|
+
def get_technician_with_http_info(id, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: TechnicianApi.get_technician ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'id' is set
|
|
42
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TechnicianApi.get_technician"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/technicians/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
|
|
56
|
+
# form parameters
|
|
57
|
+
form_params = opts[:form_params] || {}
|
|
58
|
+
|
|
59
|
+
# http body (model)
|
|
60
|
+
post_body = opts[:debug_body]
|
|
61
|
+
|
|
62
|
+
# return_type
|
|
63
|
+
return_type = opts[:debug_return_type] || 'GetTechnician200Response'
|
|
64
|
+
|
|
65
|
+
# auth_names
|
|
66
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
67
|
+
|
|
68
|
+
new_options = opts.merge(
|
|
69
|
+
:operation => :"TechnicianApi.get_technician",
|
|
70
|
+
:header_params => header_params,
|
|
71
|
+
:query_params => query_params,
|
|
72
|
+
:form_params => form_params,
|
|
73
|
+
:body => post_body,
|
|
74
|
+
:auth_names => auth_names,
|
|
75
|
+
:return_type => return_type
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
79
|
+
if @api_client.config.debugging
|
|
80
|
+
@api_client.config.logger.debug "API called: TechnicianApi#get_technician\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
|
+
end
|
|
82
|
+
return data, status_code, headers
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# List technicians
|
|
86
|
+
# Returns a paginated list of technicians for the current business
|
|
87
|
+
# @param [Hash] opts the optional parameters
|
|
88
|
+
# @option opts [Integer] :page Page number (default 1)
|
|
89
|
+
# @option opts [Integer] :limit Items per page (default 15, max 1000)
|
|
90
|
+
# @option opts [String] :status Filter by status (active, onboarding, deactive)
|
|
91
|
+
# @option opts [String] :assignment_tier Filter by assignment tier (lead, buddy, float)
|
|
92
|
+
# @option opts [String] :keyword Search by full name, email, phone, or address
|
|
93
|
+
# @option opts [String] :sort Sort: created_at_desc|created_at_asc|name_asc|name_desc (default: created_at_desc)
|
|
94
|
+
# @option opts [String] :since RFC3339 cursor for short-polling; echo back next_since from prior response
|
|
95
|
+
# @return [ListTechnicians200Response]
|
|
96
|
+
def list_technicians(opts = {})
|
|
97
|
+
data, _status_code, _headers = list_technicians_with_http_info(opts)
|
|
98
|
+
data
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# List technicians
|
|
102
|
+
# Returns a paginated list of technicians for the current business
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @option opts [Integer] :page Page number (default 1)
|
|
105
|
+
# @option opts [Integer] :limit Items per page (default 15, max 1000)
|
|
106
|
+
# @option opts [String] :status Filter by status (active, onboarding, deactive)
|
|
107
|
+
# @option opts [String] :assignment_tier Filter by assignment tier (lead, buddy, float)
|
|
108
|
+
# @option opts [String] :keyword Search by full name, email, phone, or address
|
|
109
|
+
# @option opts [String] :sort Sort: created_at_desc|created_at_asc|name_asc|name_desc (default: created_at_desc)
|
|
110
|
+
# @option opts [String] :since RFC3339 cursor for short-polling; echo back next_since from prior response
|
|
111
|
+
# @return [Array<(ListTechnicians200Response, Integer, Hash)>] ListTechnicians200Response data, response status code and response headers
|
|
112
|
+
def list_technicians_with_http_info(opts = {})
|
|
113
|
+
if @api_client.config.debugging
|
|
114
|
+
@api_client.config.logger.debug 'Calling API: TechnicianApi.list_technicians ...'
|
|
115
|
+
end
|
|
116
|
+
# resource path
|
|
117
|
+
local_var_path = '/technicians'
|
|
118
|
+
|
|
119
|
+
# query parameters
|
|
120
|
+
query_params = opts[:query_params] || {}
|
|
121
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
122
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
123
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
|
124
|
+
query_params[:'assignment_tier'] = opts[:'assignment_tier'] if !opts[:'assignment_tier'].nil?
|
|
125
|
+
query_params[:'keyword'] = opts[:'keyword'] if !opts[:'keyword'].nil?
|
|
126
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
127
|
+
query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
|
|
128
|
+
|
|
129
|
+
# header parameters
|
|
130
|
+
header_params = opts[:header_params] || {}
|
|
131
|
+
# HTTP header 'Accept' (if needed)
|
|
132
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
133
|
+
|
|
134
|
+
# form parameters
|
|
135
|
+
form_params = opts[:form_params] || {}
|
|
136
|
+
|
|
137
|
+
# http body (model)
|
|
138
|
+
post_body = opts[:debug_body]
|
|
139
|
+
|
|
140
|
+
# return_type
|
|
141
|
+
return_type = opts[:debug_return_type] || 'ListTechnicians200Response'
|
|
142
|
+
|
|
143
|
+
# auth_names
|
|
144
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
145
|
+
|
|
146
|
+
new_options = opts.merge(
|
|
147
|
+
:operation => :"TechnicianApi.list_technicians",
|
|
148
|
+
:header_params => header_params,
|
|
149
|
+
:query_params => query_params,
|
|
150
|
+
:form_params => form_params,
|
|
151
|
+
:body => post_body,
|
|
152
|
+
:auth_names => auth_names,
|
|
153
|
+
:return_type => return_type
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
157
|
+
if @api_client.config.debugging
|
|
158
|
+
@api_client.config.logger.debug "API called: TechnicianApi#list_technicians\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
159
|
+
end
|
|
160
|
+
return data, status_code, headers
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
end
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#CrispHive Developer API
|
|
3
|
+
|
|
4
|
+
#Public REST API for integrating CrispHive from your own backend. Authenticate every request with a secret API key as a Bearer token (`Authorization: Bearer chsk_live_…`). The key prefix selects the data environment: `chsk_live_…` → production (live), `chsk_test_…` → sandbox (isolated test). **Key scopes (restricted keys).** A key is either *full-access* (can call every endpoint below) or *restricted* to a set of permission codes chosen at creation — the same codes as the dashboard permission grid (e.g. `customers_view`, `job_create`, `team_manage`). A restricted key calling an endpoint outside its scope gets `403`. The full code list is the permission catalog (`GET /permission/modules` on the dashboard API). Create, scope, and revoke keys from the business dashboard. Every response is wrapped in the envelope `{ \"error_code\": 0, \"message\": \"Success\", \"data\": <payload> }`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.11.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Crisphive
|
|
16
|
+
class VehicleApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get a vehicle
|
|
23
|
+
# Returns details of a specific vehicle
|
|
24
|
+
# @param id [String] Vehicle ID
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [GetVehicle200Response]
|
|
27
|
+
def get_vehicle(id, opts = {})
|
|
28
|
+
data, _status_code, _headers = get_vehicle_with_http_info(id, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get a vehicle
|
|
33
|
+
# Returns details of a specific vehicle
|
|
34
|
+
# @param id [String] Vehicle ID
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(GetVehicle200Response, Integer, Hash)>] GetVehicle200Response data, response status code and response headers
|
|
37
|
+
def get_vehicle_with_http_info(id, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: VehicleApi.get_vehicle ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'id' is set
|
|
42
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling VehicleApi.get_vehicle"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/vehicles/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
|
|
56
|
+
# form parameters
|
|
57
|
+
form_params = opts[:form_params] || {}
|
|
58
|
+
|
|
59
|
+
# http body (model)
|
|
60
|
+
post_body = opts[:debug_body]
|
|
61
|
+
|
|
62
|
+
# return_type
|
|
63
|
+
return_type = opts[:debug_return_type] || 'GetVehicle200Response'
|
|
64
|
+
|
|
65
|
+
# auth_names
|
|
66
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
67
|
+
|
|
68
|
+
new_options = opts.merge(
|
|
69
|
+
:operation => :"VehicleApi.get_vehicle",
|
|
70
|
+
:header_params => header_params,
|
|
71
|
+
:query_params => query_params,
|
|
72
|
+
:form_params => form_params,
|
|
73
|
+
:body => post_body,
|
|
74
|
+
:auth_names => auth_names,
|
|
75
|
+
:return_type => return_type
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
79
|
+
if @api_client.config.debugging
|
|
80
|
+
@api_client.config.logger.debug "API called: VehicleApi#get_vehicle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
|
+
end
|
|
82
|
+
return data, status_code, headers
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# List vehicles
|
|
86
|
+
# Returns a paginated list of vehicles for the business
|
|
87
|
+
# @param [Hash] opts the optional parameters
|
|
88
|
+
# @option opts [Integer] :page Page number (default 1)
|
|
89
|
+
# @option opts [Integer] :limit Items per page (default 15, max 1000)
|
|
90
|
+
# @option opts [String] :status Filter by status (inactive, idle, on_job, maintenance)
|
|
91
|
+
# @option opts [String] :keyword Search by name, brand, model, or plate number
|
|
92
|
+
# @option opts [String] :since RFC3339 cursor for short-polling; echo back next_since from prior response
|
|
93
|
+
# @return [ListVehicles200Response]
|
|
94
|
+
def list_vehicles(opts = {})
|
|
95
|
+
data, _status_code, _headers = list_vehicles_with_http_info(opts)
|
|
96
|
+
data
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# List vehicles
|
|
100
|
+
# Returns a paginated list of vehicles for the business
|
|
101
|
+
# @param [Hash] opts the optional parameters
|
|
102
|
+
# @option opts [Integer] :page Page number (default 1)
|
|
103
|
+
# @option opts [Integer] :limit Items per page (default 15, max 1000)
|
|
104
|
+
# @option opts [String] :status Filter by status (inactive, idle, on_job, maintenance)
|
|
105
|
+
# @option opts [String] :keyword Search by name, brand, model, or plate number
|
|
106
|
+
# @option opts [String] :since RFC3339 cursor for short-polling; echo back next_since from prior response
|
|
107
|
+
# @return [Array<(ListVehicles200Response, Integer, Hash)>] ListVehicles200Response data, response status code and response headers
|
|
108
|
+
def list_vehicles_with_http_info(opts = {})
|
|
109
|
+
if @api_client.config.debugging
|
|
110
|
+
@api_client.config.logger.debug 'Calling API: VehicleApi.list_vehicles ...'
|
|
111
|
+
end
|
|
112
|
+
# resource path
|
|
113
|
+
local_var_path = '/vehicles'
|
|
114
|
+
|
|
115
|
+
# query parameters
|
|
116
|
+
query_params = opts[:query_params] || {}
|
|
117
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
118
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
119
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
|
120
|
+
query_params[:'keyword'] = opts[:'keyword'] if !opts[:'keyword'].nil?
|
|
121
|
+
query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
|
|
122
|
+
|
|
123
|
+
# header parameters
|
|
124
|
+
header_params = opts[:header_params] || {}
|
|
125
|
+
# HTTP header 'Accept' (if needed)
|
|
126
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
127
|
+
|
|
128
|
+
# form parameters
|
|
129
|
+
form_params = opts[:form_params] || {}
|
|
130
|
+
|
|
131
|
+
# http body (model)
|
|
132
|
+
post_body = opts[:debug_body]
|
|
133
|
+
|
|
134
|
+
# return_type
|
|
135
|
+
return_type = opts[:debug_return_type] || 'ListVehicles200Response'
|
|
136
|
+
|
|
137
|
+
# auth_names
|
|
138
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
139
|
+
|
|
140
|
+
new_options = opts.merge(
|
|
141
|
+
:operation => :"VehicleApi.list_vehicles",
|
|
142
|
+
:header_params => header_params,
|
|
143
|
+
:query_params => query_params,
|
|
144
|
+
:form_params => form_params,
|
|
145
|
+
:body => post_body,
|
|
146
|
+
:auth_names => auth_names,
|
|
147
|
+
:return_type => return_type
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
151
|
+
if @api_client.config.debugging
|
|
152
|
+
@api_client.config.logger.debug "API called: VehicleApi#list_vehicles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
153
|
+
end
|
|
154
|
+
return data, status_code, headers
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
end
|