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,371 @@
|
|
|
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 CustomerApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create a customer
|
|
23
|
+
# Adds a new customer record to the current business. Address (street, city, postal_code, ...) and coordinates (latitude/longitude) live under the nested `address` object. service_area_id must be a valid service area UUID belonging to this business.
|
|
24
|
+
# @param customer_create_request [CustomerCreateRequest] Customer details
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [CreateCustomer200Response]
|
|
27
|
+
def create_customer(customer_create_request, opts = {})
|
|
28
|
+
data, _status_code, _headers = create_customer_with_http_info(customer_create_request, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Create a customer
|
|
33
|
+
# Adds a new customer record to the current business. Address (street, city, postal_code, ...) and coordinates (latitude/longitude) live under the nested `address` object. service_area_id must be a valid service area UUID belonging to this business.
|
|
34
|
+
# @param customer_create_request [CustomerCreateRequest] Customer details
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(CreateCustomer200Response, Integer, Hash)>] CreateCustomer200Response data, response status code and response headers
|
|
37
|
+
def create_customer_with_http_info(customer_create_request, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: CustomerApi.create_customer ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'customer_create_request' is set
|
|
42
|
+
if @api_client.config.client_side_validation && customer_create_request.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'customer_create_request' when calling CustomerApi.create_customer"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/customers'
|
|
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
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(customer_create_request)
|
|
66
|
+
|
|
67
|
+
# return_type
|
|
68
|
+
return_type = opts[:debug_return_type] || 'CreateCustomer200Response'
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"CustomerApi.create_customer",
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => return_type
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
84
|
+
if @api_client.config.debugging
|
|
85
|
+
@api_client.config.logger.debug "API called: CustomerApi#create_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Delete a customer
|
|
91
|
+
# Soft-deletes a customer record.
|
|
92
|
+
# @param id [String] Customer ID
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @return [ResponseEnvelope]
|
|
95
|
+
def delete_customer(id, opts = {})
|
|
96
|
+
data, _status_code, _headers = delete_customer_with_http_info(id, opts)
|
|
97
|
+
data
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Delete a customer
|
|
101
|
+
# Soft-deletes a customer record.
|
|
102
|
+
# @param id [String] Customer ID
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @return [Array<(ResponseEnvelope, Integer, Hash)>] ResponseEnvelope data, response status code and response headers
|
|
105
|
+
def delete_customer_with_http_info(id, opts = {})
|
|
106
|
+
if @api_client.config.debugging
|
|
107
|
+
@api_client.config.logger.debug 'Calling API: CustomerApi.delete_customer ...'
|
|
108
|
+
end
|
|
109
|
+
# verify the required parameter 'id' is set
|
|
110
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomerApi.delete_customer"
|
|
112
|
+
end
|
|
113
|
+
# resource path
|
|
114
|
+
local_var_path = '/customers/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
115
|
+
|
|
116
|
+
# query parameters
|
|
117
|
+
query_params = opts[:query_params] || {}
|
|
118
|
+
|
|
119
|
+
# header parameters
|
|
120
|
+
header_params = opts[:header_params] || {}
|
|
121
|
+
# HTTP header 'Accept' (if needed)
|
|
122
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
123
|
+
|
|
124
|
+
# form parameters
|
|
125
|
+
form_params = opts[:form_params] || {}
|
|
126
|
+
|
|
127
|
+
# http body (model)
|
|
128
|
+
post_body = opts[:debug_body]
|
|
129
|
+
|
|
130
|
+
# return_type
|
|
131
|
+
return_type = opts[:debug_return_type] || 'ResponseEnvelope'
|
|
132
|
+
|
|
133
|
+
# auth_names
|
|
134
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
135
|
+
|
|
136
|
+
new_options = opts.merge(
|
|
137
|
+
:operation => :"CustomerApi.delete_customer",
|
|
138
|
+
:header_params => header_params,
|
|
139
|
+
:query_params => query_params,
|
|
140
|
+
:form_params => form_params,
|
|
141
|
+
:body => post_body,
|
|
142
|
+
:auth_names => auth_names,
|
|
143
|
+
:return_type => return_type
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
147
|
+
if @api_client.config.debugging
|
|
148
|
+
@api_client.config.logger.debug "API called: CustomerApi#delete_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
149
|
+
end
|
|
150
|
+
return data, status_code, headers
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Get a customer
|
|
154
|
+
# Returns the full profile, contact details and spending summary. contact.preferred_technician includes {id, name}. contact.service_area includes {id, name}. contact.address.latitude / contact.address.longitude are null if no coordinates saved.
|
|
155
|
+
# @param id [String] Customer ID (UUID)
|
|
156
|
+
# @param [Hash] opts the optional parameters
|
|
157
|
+
# @return [GetCustomer200Response]
|
|
158
|
+
def get_customer(id, opts = {})
|
|
159
|
+
data, _status_code, _headers = get_customer_with_http_info(id, opts)
|
|
160
|
+
data
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Get a customer
|
|
164
|
+
# Returns the full profile, contact details and spending summary. contact.preferred_technician includes {id, name}. contact.service_area includes {id, name}. contact.address.latitude / contact.address.longitude are null if no coordinates saved.
|
|
165
|
+
# @param id [String] Customer ID (UUID)
|
|
166
|
+
# @param [Hash] opts the optional parameters
|
|
167
|
+
# @return [Array<(GetCustomer200Response, Integer, Hash)>] GetCustomer200Response data, response status code and response headers
|
|
168
|
+
def get_customer_with_http_info(id, opts = {})
|
|
169
|
+
if @api_client.config.debugging
|
|
170
|
+
@api_client.config.logger.debug 'Calling API: CustomerApi.get_customer ...'
|
|
171
|
+
end
|
|
172
|
+
# verify the required parameter 'id' is set
|
|
173
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
174
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomerApi.get_customer"
|
|
175
|
+
end
|
|
176
|
+
# resource path
|
|
177
|
+
local_var_path = '/customers/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
178
|
+
|
|
179
|
+
# query parameters
|
|
180
|
+
query_params = opts[:query_params] || {}
|
|
181
|
+
|
|
182
|
+
# header parameters
|
|
183
|
+
header_params = opts[:header_params] || {}
|
|
184
|
+
# HTTP header 'Accept' (if needed)
|
|
185
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
186
|
+
|
|
187
|
+
# form parameters
|
|
188
|
+
form_params = opts[:form_params] || {}
|
|
189
|
+
|
|
190
|
+
# http body (model)
|
|
191
|
+
post_body = opts[:debug_body]
|
|
192
|
+
|
|
193
|
+
# return_type
|
|
194
|
+
return_type = opts[:debug_return_type] || 'GetCustomer200Response'
|
|
195
|
+
|
|
196
|
+
# auth_names
|
|
197
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
198
|
+
|
|
199
|
+
new_options = opts.merge(
|
|
200
|
+
:operation => :"CustomerApi.get_customer",
|
|
201
|
+
:header_params => header_params,
|
|
202
|
+
:query_params => query_params,
|
|
203
|
+
:form_params => form_params,
|
|
204
|
+
:body => post_body,
|
|
205
|
+
:auth_names => auth_names,
|
|
206
|
+
:return_type => return_type
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
210
|
+
if @api_client.config.debugging
|
|
211
|
+
@api_client.config.logger.debug "API called: CustomerApi#get_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
212
|
+
end
|
|
213
|
+
return data, status_code, headers
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# List customers
|
|
217
|
+
# Returns a paginated, searchable list of customers for the current business.
|
|
218
|
+
# @param [Hash] opts the optional parameters
|
|
219
|
+
# @option opts [String] :q Search name, UID, phone, email
|
|
220
|
+
# @option opts [Array<String>] :tier Filter by tier: regular|vip (repeatable)
|
|
221
|
+
# @option opts [String] :status Filter by status: active|inactive
|
|
222
|
+
# @option opts [String] :preferred_technician_id Filter by preferred technician UUID
|
|
223
|
+
# @option opts [String] :sort Sort: created_at_desc|created_at_asc|name_asc|name_desc|uid_asc|uid_desc (default: created_at_desc)
|
|
224
|
+
# @option opts [Integer] :page Page number (default 1)
|
|
225
|
+
# @option opts [Integer] :limit Page size (default 15, max 1000)
|
|
226
|
+
# @option opts [String] :since RFC3339 cursor for short-polling; echo back next_since from prior response
|
|
227
|
+
# @return [ListCustomers200Response]
|
|
228
|
+
def list_customers(opts = {})
|
|
229
|
+
data, _status_code, _headers = list_customers_with_http_info(opts)
|
|
230
|
+
data
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
# List customers
|
|
234
|
+
# Returns a paginated, searchable list of customers for the current business.
|
|
235
|
+
# @param [Hash] opts the optional parameters
|
|
236
|
+
# @option opts [String] :q Search name, UID, phone, email
|
|
237
|
+
# @option opts [Array<String>] :tier Filter by tier: regular|vip (repeatable)
|
|
238
|
+
# @option opts [String] :status Filter by status: active|inactive
|
|
239
|
+
# @option opts [String] :preferred_technician_id Filter by preferred technician UUID
|
|
240
|
+
# @option opts [String] :sort Sort: created_at_desc|created_at_asc|name_asc|name_desc|uid_asc|uid_desc (default: created_at_desc)
|
|
241
|
+
# @option opts [Integer] :page Page number (default 1)
|
|
242
|
+
# @option opts [Integer] :limit Page size (default 15, max 1000)
|
|
243
|
+
# @option opts [String] :since RFC3339 cursor for short-polling; echo back next_since from prior response
|
|
244
|
+
# @return [Array<(ListCustomers200Response, Integer, Hash)>] ListCustomers200Response data, response status code and response headers
|
|
245
|
+
def list_customers_with_http_info(opts = {})
|
|
246
|
+
if @api_client.config.debugging
|
|
247
|
+
@api_client.config.logger.debug 'Calling API: CustomerApi.list_customers ...'
|
|
248
|
+
end
|
|
249
|
+
# resource path
|
|
250
|
+
local_var_path = '/customers'
|
|
251
|
+
|
|
252
|
+
# query parameters
|
|
253
|
+
query_params = opts[:query_params] || {}
|
|
254
|
+
query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
|
|
255
|
+
query_params[:'tier'] = @api_client.build_collection_param(opts[:'tier'], :multi) if !opts[:'tier'].nil?
|
|
256
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
|
257
|
+
query_params[:'preferred_technician_id'] = opts[:'preferred_technician_id'] if !opts[:'preferred_technician_id'].nil?
|
|
258
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
259
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
260
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
261
|
+
query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
|
|
262
|
+
|
|
263
|
+
# header parameters
|
|
264
|
+
header_params = opts[:header_params] || {}
|
|
265
|
+
# HTTP header 'Accept' (if needed)
|
|
266
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
267
|
+
|
|
268
|
+
# form parameters
|
|
269
|
+
form_params = opts[:form_params] || {}
|
|
270
|
+
|
|
271
|
+
# http body (model)
|
|
272
|
+
post_body = opts[:debug_body]
|
|
273
|
+
|
|
274
|
+
# return_type
|
|
275
|
+
return_type = opts[:debug_return_type] || 'ListCustomers200Response'
|
|
276
|
+
|
|
277
|
+
# auth_names
|
|
278
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
279
|
+
|
|
280
|
+
new_options = opts.merge(
|
|
281
|
+
:operation => :"CustomerApi.list_customers",
|
|
282
|
+
:header_params => header_params,
|
|
283
|
+
:query_params => query_params,
|
|
284
|
+
:form_params => form_params,
|
|
285
|
+
:body => post_body,
|
|
286
|
+
:auth_names => auth_names,
|
|
287
|
+
:return_type => return_type
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
291
|
+
if @api_client.config.debugging
|
|
292
|
+
@api_client.config.logger.debug "API called: CustomerApi#list_customers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
293
|
+
end
|
|
294
|
+
return data, status_code, headers
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
# Update a customer
|
|
298
|
+
# Replaces mutable fields on a customer record. Pass service_area_id=\"\" to clear the service area. Address fields (including latitude/longitude) live under the nested `address` object.
|
|
299
|
+
# @param id [String] Customer ID (UUID)
|
|
300
|
+
# @param customer_update_request [CustomerUpdateRequest] Fields to update
|
|
301
|
+
# @param [Hash] opts the optional parameters
|
|
302
|
+
# @return [ResponseEnvelope]
|
|
303
|
+
def update_customer(id, customer_update_request, opts = {})
|
|
304
|
+
data, _status_code, _headers = update_customer_with_http_info(id, customer_update_request, opts)
|
|
305
|
+
data
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
# Update a customer
|
|
309
|
+
# Replaces mutable fields on a customer record. Pass service_area_id=\"\" to clear the service area. Address fields (including latitude/longitude) live under the nested `address` object.
|
|
310
|
+
# @param id [String] Customer ID (UUID)
|
|
311
|
+
# @param customer_update_request [CustomerUpdateRequest] Fields to update
|
|
312
|
+
# @param [Hash] opts the optional parameters
|
|
313
|
+
# @return [Array<(ResponseEnvelope, Integer, Hash)>] ResponseEnvelope data, response status code and response headers
|
|
314
|
+
def update_customer_with_http_info(id, customer_update_request, opts = {})
|
|
315
|
+
if @api_client.config.debugging
|
|
316
|
+
@api_client.config.logger.debug 'Calling API: CustomerApi.update_customer ...'
|
|
317
|
+
end
|
|
318
|
+
# verify the required parameter 'id' is set
|
|
319
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
320
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomerApi.update_customer"
|
|
321
|
+
end
|
|
322
|
+
# verify the required parameter 'customer_update_request' is set
|
|
323
|
+
if @api_client.config.client_side_validation && customer_update_request.nil?
|
|
324
|
+
fail ArgumentError, "Missing the required parameter 'customer_update_request' when calling CustomerApi.update_customer"
|
|
325
|
+
end
|
|
326
|
+
# resource path
|
|
327
|
+
local_var_path = '/customers/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
328
|
+
|
|
329
|
+
# query parameters
|
|
330
|
+
query_params = opts[:query_params] || {}
|
|
331
|
+
|
|
332
|
+
# header parameters
|
|
333
|
+
header_params = opts[:header_params] || {}
|
|
334
|
+
# HTTP header 'Accept' (if needed)
|
|
335
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
336
|
+
# HTTP header 'Content-Type'
|
|
337
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
338
|
+
if !content_type.nil?
|
|
339
|
+
header_params['Content-Type'] = content_type
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
# form parameters
|
|
343
|
+
form_params = opts[:form_params] || {}
|
|
344
|
+
|
|
345
|
+
# http body (model)
|
|
346
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(customer_update_request)
|
|
347
|
+
|
|
348
|
+
# return_type
|
|
349
|
+
return_type = opts[:debug_return_type] || 'ResponseEnvelope'
|
|
350
|
+
|
|
351
|
+
# auth_names
|
|
352
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
353
|
+
|
|
354
|
+
new_options = opts.merge(
|
|
355
|
+
:operation => :"CustomerApi.update_customer",
|
|
356
|
+
:header_params => header_params,
|
|
357
|
+
:query_params => query_params,
|
|
358
|
+
:form_params => form_params,
|
|
359
|
+
:body => post_body,
|
|
360
|
+
:auth_names => auth_names,
|
|
361
|
+
:return_type => return_type
|
|
362
|
+
)
|
|
363
|
+
|
|
364
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
365
|
+
if @api_client.config.debugging
|
|
366
|
+
@api_client.config.logger.debug "API called: CustomerApi#update_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
367
|
+
end
|
|
368
|
+
return data, status_code, headers
|
|
369
|
+
end
|
|
370
|
+
end
|
|
371
|
+
end
|