Class: Crisphive::JobRequestBusinessApi
- Inherits:
-
Object
- Object
- Crisphive::JobRequestBusinessApi
- Defined in:
- lib/crisphive/api/job_request_business_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_job_request(job_request_create_request, opts = {}) ⇒ CreateJobRequest200Response
Create a job request (business actor).
-
#create_job_request_with_http_info(job_request_create_request, opts = {}) ⇒ Array<(CreateJobRequest200Response, Integer, Hash)>
Create a job request (business actor).
-
#get_job_request(id, opts = {}) ⇒ GetJobRequest200Response
Get a job request.
-
#get_job_request_timeline(id, opts = {}) ⇒ GetJobRequestTimeline200Response
Job timeline (business surface — also serves tech via BusinessAuth) Per-status events composed from workflow snapshot + scattered typed cols + action_audit.
-
#get_job_request_timeline_with_http_info(id, opts = {}) ⇒ Array<(GetJobRequestTimeline200Response, Integer, Hash)>
Job timeline (business surface — also serves tech via BusinessAuth) Per-status events composed from workflow snapshot + scattered typed cols + action_audit.
-
#get_job_request_with_http_info(id, opts = {}) ⇒ Array<(GetJobRequest200Response, Integer, Hash)>
Get a job request.
-
#initialize(api_client = ApiClient.default) ⇒ JobRequestBusinessApi
constructor
A new instance of JobRequestBusinessApi.
-
#list_job_request_booking_windows(x_timezone, opts = {}) ⇒ ListJobRequestBookingWindows200Response
Booking availability (business actor).
-
#list_job_request_booking_windows_with_http_info(x_timezone, opts = {}) ⇒ Array<(ListJobRequestBookingWindows200Response, Integer, Hash)>
Booking availability (business actor).
-
#list_job_request_changes(opts = {}) ⇒ ListJobRequestChanges200Response
Poll for new & changed job requests (sync feed) Keep your own copy of bookings in sync WITHOUT re-listing everything: returns the job requests whose state changed (created, status transition, reschedule, soft-delete/archive) at or after the
sincecursor, ordered oldest-change-first (updated_at ASC). -
#list_job_request_changes_with_http_info(opts = {}) ⇒ Array<(ListJobRequestChanges200Response, Integer, Hash)>
Poll for new & changed job requests (sync feed) Keep your own copy of bookings in sync WITHOUT re-listing everything: returns the job requests whose state changed (created, status transition, reschedule, soft-delete/archive) at or after the `since` cursor, ordered oldest-change-first (updated_at ASC).
-
#list_job_requests(opts = {}) ⇒ ListJobRequests200Response
List job requests.
-
#list_job_requests_with_http_info(opts = {}) ⇒ Array<(ListJobRequests200Response, Integer, Hash)>
List job requests.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ JobRequestBusinessApi
Returns a new instance of JobRequestBusinessApi.
19 20 21 |
# File 'lib/crisphive/api/job_request_business_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/crisphive/api/job_request_business_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_job_request(job_request_create_request, opts = {}) ⇒ CreateJobRequest200Response
Create a job request (business actor)
27 28 29 30 |
# File 'lib/crisphive/api/job_request_business_api.rb', line 27 def create_job_request(job_request_create_request, opts = {}) data, _status_code, _headers = create_job_request_with_http_info(job_request_create_request, opts) data end |
#create_job_request_with_http_info(job_request_create_request, opts = {}) ⇒ Array<(CreateJobRequest200Response, Integer, Hash)>
Create a job request (business actor)
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/crisphive/api/job_request_business_api.rb', line 37 def create_job_request_with_http_info(job_request_create_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: JobRequestBusinessApi.create_job_request ...' end # verify the required parameter 'job_request_create_request' is set if @api_client.config.client_side_validation && job_request_create_request.nil? fail ArgumentError, "Missing the required parameter 'job_request_create_request' when calling JobRequestBusinessApi.create_job_request" end # resource path local_var_path = '/job-requests' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'X-Timezone'] = opts[:'x_timezone'] if !opts[:'x_timezone'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(job_request_create_request) # return_type return_type = opts[:debug_return_type] || 'CreateJobRequest200Response' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"JobRequestBusinessApi.create_job_request", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: JobRequestBusinessApi#create_job_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_job_request(id, opts = {}) ⇒ GetJobRequest200Response
Get a job request
95 96 97 98 |
# File 'lib/crisphive/api/job_request_business_api.rb', line 95 def get_job_request(id, opts = {}) data, _status_code, _headers = get_job_request_with_http_info(id, opts) data end |
#get_job_request_timeline(id, opts = {}) ⇒ GetJobRequestTimeline200Response
Job timeline (business surface — also serves tech via BusinessAuth) Per-status events composed from workflow snapshot + scattered typed cols + action_audit. FE renders as the Job Timeline panel (completed step = filled check, current = outline ring, upcoming = empty). entered_at nil for upcoming steps + older jobs missing the typed-col backfill.
157 158 159 160 |
# File 'lib/crisphive/api/job_request_business_api.rb', line 157 def get_job_request_timeline(id, opts = {}) data, _status_code, _headers = get_job_request_timeline_with_http_info(id, opts) data end |
#get_job_request_timeline_with_http_info(id, opts = {}) ⇒ Array<(GetJobRequestTimeline200Response, Integer, Hash)>
Job timeline (business surface — also serves tech via BusinessAuth) Per-status events composed from workflow snapshot + scattered typed cols + action_audit. FE renders as the Job Timeline panel (completed step = filled check, current = outline ring, upcoming = empty). entered_at nil for upcoming steps + older jobs missing the typed-col backfill.
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/crisphive/api/job_request_business_api.rb', line 167 def get_job_request_timeline_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: JobRequestBusinessApi.get_job_request_timeline ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling JobRequestBusinessApi.get_job_request_timeline" end # resource path local_var_path = '/job-requests/{id}/timeline'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetJobRequestTimeline200Response' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"JobRequestBusinessApi.get_job_request_timeline", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: JobRequestBusinessApi#get_job_request_timeline\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_job_request_with_http_info(id, opts = {}) ⇒ Array<(GetJobRequest200Response, Integer, Hash)>
Get a job request
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/crisphive/api/job_request_business_api.rb', line 104 def get_job_request_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: JobRequestBusinessApi.get_job_request ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling JobRequestBusinessApi.get_job_request" end # resource path local_var_path = '/job-requests/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetJobRequest200Response' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"JobRequestBusinessApi.get_job_request", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: JobRequestBusinessApi#get_job_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_job_request_booking_windows(x_timezone, opts = {}) ⇒ ListJobRequestBookingWindows200Response
Booking availability (business actor)
221 222 223 224 |
# File 'lib/crisphive/api/job_request_business_api.rb', line 221 def list_job_request_booking_windows(x_timezone, opts = {}) data, _status_code, _headers = list_job_request_booking_windows_with_http_info(x_timezone, opts) data end |
#list_job_request_booking_windows_with_http_info(x_timezone, opts = {}) ⇒ Array<(ListJobRequestBookingWindows200Response, Integer, Hash)>
Booking availability (business actor)
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/crisphive/api/job_request_business_api.rb', line 232 def list_job_request_booking_windows_with_http_info(x_timezone, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: JobRequestBusinessApi.list_job_request_booking_windows ...' end # verify the required parameter 'x_timezone' is set if @api_client.config.client_side_validation && x_timezone.nil? fail ArgumentError, "Missing the required parameter 'x_timezone' when calling JobRequestBusinessApi.list_job_request_booking_windows" end # resource path local_var_path = '/job-requests/booking-windows' # query parameters query_params = opts[:query_params] || {} query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil? query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'X-Timezone'] = x_timezone # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListJobRequestBookingWindows200Response' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"JobRequestBusinessApi.list_job_request_booking_windows", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: JobRequestBusinessApi#list_job_request_booking_windows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_job_request_changes(opts = {}) ⇒ ListJobRequestChanges200Response
Poll for new & changed job requests (sync feed)
Keep your own copy of bookings in sync WITHOUT re-listing everything: returns the job requests whose state changed (created, status transition, reschedule, soft-delete/archive) at or after the since cursor, ordered oldest-change-first (updated_at ASC). How to use it: (1) On your first poll OMIT since — the server primes the cursor at "now", returns no items and a next_since. (2) Store next_since and pass it as since on the next poll. (3) Apply each returned item to your store by UPSERTING on id (the server re-scans a ~5s safety window, so the same job may appear again — never blindly append). (4) If has_more is true the page filled to limit and more changes are already waiting — poll again immediately; otherwise wait your normal interval (e.g. 5–15s). This is NOT pagination — it is a time-keyed change feed. Use the paginated GET /job-requests for the initial bulk load, then this endpoint to stay live. Filters (status_keys, customer_id, …) narrow the feed to the slice you care about.
295 296 297 298 |
# File 'lib/crisphive/api/job_request_business_api.rb', line 295 def list_job_request_changes(opts = {}) data, _status_code, _headers = list_job_request_changes_with_http_info(opts) data end |
#list_job_request_changes_with_http_info(opts = {}) ⇒ Array<(ListJobRequestChanges200Response, Integer, Hash)>
Poll for new & changed job requests (sync feed) Keep your own copy of bookings in sync WITHOUT re-listing everything: returns the job requests whose state changed (created, status transition, reschedule, soft-delete/archive) at or after the `since` cursor, ordered oldest-change-first (updated_at ASC). How to use it: (1) On your first poll OMIT `since` — the server primes the cursor at "now", returns no items and a `next_since`. (2) Store `next_since` and pass it as `since` on the next poll. (3) Apply each returned item to your store by UPSERTING on `id` (the server re-scans a ~5s safety window, so the same job may appear again — never blindly append). (4) If `has_more` is true the page filled to `limit` and more changes are already waiting — poll again immediately; otherwise wait your normal interval (e.g. 5–15s). This is NOT pagination — it is a time-keyed change feed. Use the paginated GET /job-requests for the initial bulk load, then this endpoint to stay live. Filters (status_keys, customer_id, …) narrow the feed to the slice you care about.
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 |
# File 'lib/crisphive/api/job_request_business_api.rb', line 312 def list_job_request_changes_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: JobRequestBusinessApi.list_job_request_changes ...' end # resource path local_var_path = '/job-requests/changes' # query parameters query_params = opts[:query_params] || {} query_params[:'status_keys'] = opts[:'status_keys'] if !opts[:'status_keys'].nil? query_params[:'priority'] = opts[:'priority'] if !opts[:'priority'].nil? query_params[:'customer_id'] = opts[:'customer_id'] if !opts[:'customer_id'].nil? query_params[:'technician_id'] = opts[:'technician_id'] if !opts[:'technician_id'].nil? query_params[:'scheduled_from'] = opts[:'scheduled_from'] if !opts[:'scheduled_from'].nil? query_params[:'scheduled_to'] = opts[:'scheduled_to'] if !opts[:'scheduled_to'].nil? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListJobRequestChanges200Response' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"JobRequestBusinessApi.list_job_request_changes", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: JobRequestBusinessApi#list_job_request_changes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_job_requests(opts = {}) ⇒ ListJobRequests200Response
List job requests
377 378 379 380 |
# File 'lib/crisphive/api/job_request_business_api.rb', line 377 def list_job_requests(opts = {}) data, _status_code, _headers = list_job_requests_with_http_info(opts) data end |
#list_job_requests_with_http_info(opts = {}) ⇒ Array<(ListJobRequests200Response, Integer, Hash)>
List job requests
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
# File 'lib/crisphive/api/job_request_business_api.rb', line 395 def list_job_requests_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: JobRequestBusinessApi.list_job_requests ...' end # resource path local_var_path = '/job-requests' # query parameters query_params = opts[:query_params] || {} query_params[:'status_keys'] = opts[:'status_keys'] if !opts[:'status_keys'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'customer_id'] = opts[:'customer_id'] if !opts[:'customer_id'].nil? query_params[:'technician_id'] = opts[:'technician_id'] if !opts[:'technician_id'].nil? query_params[:'scheduled_from'] = opts[:'scheduled_from'] if !opts[:'scheduled_from'].nil? query_params[:'scheduled_to'] = opts[:'scheduled_to'] if !opts[:'scheduled_to'].nil? query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListJobRequests200Response' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"JobRequestBusinessApi.list_job_requests", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: JobRequestBusinessApi#list_job_requests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |