crisphive 0.1.0 → 0.2.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.
Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +90 -11
  3. data/crisphive.gemspec +5 -5
  4. data/lib/crisphive/api/business_skill_api.rb +154 -8
  5. data/lib/crisphive/api/customer_api.rb +15 -12
  6. data/lib/crisphive/api/job_request_business_api.rb +1002 -112
  7. data/lib/crisphive/api/job_types_api.rb +6 -2
  8. data/lib/crisphive/api/service_area_api.rb +6 -6
  9. data/lib/crisphive/api/technician_api.rb +510 -6
  10. data/lib/crisphive/api/vehicle_api.rb +6 -6
  11. data/lib/crisphive/api_client.rb +2 -2
  12. data/lib/crisphive/api_error.rb +2 -2
  13. data/lib/crisphive/configuration.rb +3 -3
  14. data/lib/crisphive/models/commit_emergency_reschedule200_response.rb +253 -0
  15. data/lib/crisphive/models/commit_job_request_move200_response.rb +253 -0
  16. data/lib/crisphive/models/create_customer200_response.rb +5 -2
  17. data/lib/crisphive/models/create_job_request200_response.rb +5 -2
  18. data/lib/crisphive/models/create_technician200_response.rb +253 -0
  19. data/lib/crisphive/models/customer.rb +2 -2
  20. data/lib/crisphive/models/customer_address.rb +2 -2
  21. data/lib/crisphive/models/customer_address_request.rb +11 -2
  22. data/lib/crisphive/models/customer_contact.rb +2 -2
  23. data/lib/crisphive/models/customer_create_request.rb +2 -2
  24. data/lib/crisphive/models/customer_create_response.rb +2 -2
  25. data/lib/crisphive/models/customer_list.rb +3 -3
  26. data/lib/crisphive/models/customer_list_item.rb +2 -2
  27. data/lib/crisphive/models/customer_profile.rb +2 -2
  28. data/lib/crisphive/models/customer_spending.rb +2 -2
  29. data/lib/crisphive/models/customer_tier_progress.rb +2 -2
  30. data/lib/crisphive/models/customer_update_request.rb +2 -2
  31. data/lib/crisphive/models/get_customer200_response.rb +5 -2
  32. data/lib/crisphive/models/get_job_request200_response.rb +5 -2
  33. data/lib/crisphive/models/get_job_request_timeline200_response.rb +5 -2
  34. data/lib/crisphive/models/get_job_type200_response.rb +5 -2
  35. data/lib/crisphive/models/get_service_area200_response.rb +5 -2
  36. data/lib/crisphive/models/get_technician200_response.rb +5 -2
  37. data/lib/crisphive/models/get_technician_schedule200_response.rb +253 -0
  38. data/lib/crisphive/models/get_vehicle200_response.rb +5 -2
  39. data/lib/crisphive/models/job_date.rb +5 -3
  40. data/lib/crisphive/models/job_date_business_range.rb +7 -3
  41. data/lib/crisphive/models/job_date_period.rb +2 -2
  42. data/lib/crisphive/models/job_date_period_entry.rb +4 -2
  43. data/lib/crisphive/models/job_request.rb +46 -6
  44. data/lib/crisphive/models/job_request_action_audit_by.rb +2 -2
  45. data/lib/crisphive/models/job_request_action_audit_entry.rb +3 -3
  46. data/lib/crisphive/models/job_request_action_summary.rb +2 -2
  47. data/lib/crisphive/models/job_request_address_summary.rb +2 -2
  48. data/lib/crisphive/models/job_request_archive_summary.rb +2 -2
  49. data/lib/crisphive/models/job_request_arrival_window.rb +4 -4
  50. data/lib/crisphive/models/job_request_assigned_vehicle.rb +2 -2
  51. data/lib/crisphive/models/job_request_assignment_summary.rb +2 -2
  52. data/lib/crisphive/models/job_request_attention_summary.rb +259 -0
  53. data/lib/crisphive/models/job_request_available_vehicle.rb +235 -0
  54. data/lib/crisphive/models/job_request_booking_windows.rb +2 -2
  55. data/lib/crisphive/models/job_request_buddy_slot_candidates.rb +239 -0
  56. data/lib/crisphive/models/job_request_business_time_range.rb +3 -3
  57. data/lib/crisphive/models/job_request_changes.rb +2 -2
  58. data/lib/crisphive/models/job_request_confirm_request.rb +245 -0
  59. data/lib/crisphive/models/job_request_create_request.rb +60 -6
  60. data/lib/crisphive/models/job_request_create_response.rb +2 -2
  61. data/lib/crisphive/models/job_request_crew_candidates.rb +227 -0
  62. data/lib/crisphive/models/job_request_crew_change.rb +299 -0
  63. data/lib/crisphive/models/job_request_crew_member.rb +7 -4
  64. data/lib/crisphive/models/job_request_crew_member_input.rb +284 -0
  65. data/lib/crisphive/models/job_request_crew_recommendation.rb +255 -0
  66. data/lib/crisphive/models/job_request_customer_summary.rb +2 -2
  67. data/lib/crisphive/models/job_request_day_windows.rb +3 -3
  68. data/lib/crisphive/models/job_request_emergency_candidate.rb +297 -0
  69. data/lib/crisphive/models/job_request_emergency_candidates.rb +311 -0
  70. data/lib/crisphive/models/job_request_emergency_candidates_request.rb +328 -0
  71. data/lib/crisphive/models/job_request_emergency_commit_request.rb +351 -0
  72. data/lib/crisphive/models/job_request_emergency_plan.rb +345 -0
  73. data/lib/crisphive/models/job_request_emergency_preview_request.rb +329 -0
  74. data/lib/crisphive/models/job_request_job_date_business_range_request.rb +3 -3
  75. data/lib/crisphive/models/job_request_job_date_period_request.rb +2 -2
  76. data/lib/crisphive/models/job_request_job_date_request.rb +3 -3
  77. data/lib/crisphive/models/job_request_lead_candidate.rb +311 -0
  78. data/lib/crisphive/models/job_request_list.rb +2 -2
  79. data/lib/crisphive/models/job_request_move_commit_req.rb +343 -0
  80. data/lib/crisphive/models/job_request_move_member.rb +299 -0
  81. data/lib/crisphive/models/job_request_move_plan.rb +377 -0
  82. data/lib/crisphive/models/job_request_move_preview_req.rb +290 -0
  83. data/lib/crisphive/models/job_request_move_warning.rb +311 -0
  84. data/lib/crisphive/models/job_request_period.rb +2 -2
  85. data/lib/crisphive/models/job_request_quote_request.rb +340 -0
  86. data/lib/crisphive/models/job_request_quote_summary.rb +2 -2
  87. data/lib/crisphive/models/job_request_rating_summary.rb +2 -2
  88. data/lib/crisphive/models/job_request_reschedule_day.rb +227 -0
  89. data/lib/crisphive/models/job_request_reschedule_move.rb +319 -0
  90. data/lib/crisphive/models/job_request_reschedule_reassignment.rb +339 -0
  91. data/lib/crisphive/models/job_request_schedule.rb +2 -2
  92. data/lib/crisphive/models/job_request_session.rb +8 -7
  93. data/lib/crisphive/models/job_request_skill_summary.rb +2 -2
  94. data/lib/crisphive/models/job_request_status_summary.rb +2 -2
  95. data/lib/crisphive/models/job_request_tech_candidate.rb +287 -0
  96. data/lib/crisphive/models/job_request_technician_info.rb +2 -2
  97. data/lib/crisphive/models/job_request_time_segments.rb +287 -0
  98. data/lib/crisphive/models/job_request_time_segments_business_time.rb +321 -0
  99. data/lib/crisphive/models/job_request_time_segments_day.rb +247 -0
  100. data/lib/crisphive/models/job_request_time_segments_slot.rb +375 -0
  101. data/lib/crisphive/models/job_request_time_segments_worker.rb +295 -0
  102. data/lib/crisphive/models/job_request_timeline.rb +2 -2
  103. data/lib/crisphive/models/job_request_timeline_action.rb +2 -2
  104. data/lib/crisphive/models/job_request_timeline_event.rb +2 -2
  105. data/lib/crisphive/models/job_request_update_priority_request.rb +295 -0
  106. data/lib/crisphive/models/job_type.rb +2 -2
  107. data/lib/crisphive/models/list_crew_candidates200_response.rb +253 -0
  108. data/lib/crisphive/models/list_customers200_response.rb +5 -2
  109. data/lib/crisphive/models/list_emergency_candidates200_response.rb +253 -0
  110. data/lib/crisphive/models/list_job_request_booking_windows200_response.rb +5 -2
  111. data/lib/crisphive/models/list_job_request_changes200_response.rb +5 -2
  112. data/lib/crisphive/models/list_job_requests200_response.rb +5 -2
  113. data/lib/crisphive/models/list_job_types200_response.rb +5 -2
  114. data/lib/crisphive/models/list_matching_slots200_response.rb +253 -0
  115. data/lib/crisphive/models/list_nearby_technicians200_response.rb +253 -0
  116. data/lib/crisphive/models/list_service_areas200_response.rb +5 -2
  117. data/lib/crisphive/models/list_skill_categories200_response.rb +5 -2
  118. data/lib/crisphive/models/list_skills200_response.rb +5 -2
  119. data/lib/crisphive/models/list_skills_by_category200_response.rb +5 -2
  120. data/lib/crisphive/models/list_technician_skills200_response.rb +253 -0
  121. data/lib/crisphive/models/list_technicians200_response.rb +5 -2
  122. data/lib/crisphive/models/list_vehicles200_response.rb +5 -2
  123. data/lib/crisphive/models/nearby_technician.rb +319 -0
  124. data/lib/crisphive/models/nearby_technicians.rb +237 -0
  125. data/lib/crisphive/models/pagination.rb +7 -2
  126. data/lib/crisphive/models/replace_technician_service_areas200_response.rb +253 -0
  127. data/lib/crisphive/models/response_envelope.rb +6 -2
  128. data/lib/crisphive/models/service_area.rb +2 -2
  129. data/lib/crisphive/models/service_area_list.rb +2 -2
  130. data/lib/crisphive/models/skill.rb +9 -2
  131. data/lib/crisphive/models/skill_by_category_list.rb +4 -2
  132. data/lib/crisphive/models/skill_category.rb +7 -2
  133. data/lib/crisphive/models/skill_category_list.rb +4 -2
  134. data/lib/crisphive/models/skill_list.rb +2 -2
  135. data/lib/crisphive/models/skill_summary.rb +2 -2
  136. data/lib/crisphive/models/technician.rb +2 -2
  137. data/lib/crisphive/models/technician_address.rb +2 -2
  138. data/lib/crisphive/models/technician_address_input.rb +408 -0
  139. data/lib/crisphive/models/technician_buddies_request.rb +236 -0
  140. data/lib/crisphive/models/technician_create_request.rb +600 -0
  141. data/lib/crisphive/models/technician_create_response.rb +215 -0
  142. data/lib/crisphive/models/technician_lead_ref.rb +2 -2
  143. data/lib/crisphive/models/technician_leads_request.rb +236 -0
  144. data/lib/crisphive/models/technician_list.rb +3 -3
  145. data/lib/crisphive/models/technician_schedule.rb +279 -0
  146. data/lib/crisphive/models/technician_schedule_block.rb +225 -0
  147. data/lib/crisphive/models/technician_schedule_session.rb +311 -0
  148. data/lib/crisphive/models/technician_service_area_ref.rb +2 -2
  149. data/lib/crisphive/models/technician_service_areas_request.rb +236 -0
  150. data/lib/crisphive/models/technician_service_areas_response.rb +217 -0
  151. data/lib/crisphive/models/technician_skill.rb +265 -0
  152. data/lib/crisphive/models/technician_skill_list.rb +227 -0
  153. data/lib/crisphive/models/technician_skills_request.rb +236 -0
  154. data/lib/crisphive/models/technician_status.rb +2 -2
  155. data/lib/crisphive/models/technician_update_request.rb +507 -0
  156. data/lib/crisphive/models/technician_vehicles_request.rb +236 -0
  157. data/lib/crisphive/models/vehicle.rb +26 -4
  158. data/lib/crisphive/models/vehicle_list.rb +2 -2
  159. data/lib/crisphive/models/vehicle_owner.rb +2 -2
  160. data/lib/crisphive/version.rb +3 -3
  161. data/lib/crisphive.rb +60 -2
  162. data/spec/spec_helper.rb +2 -2
  163. metadata +63 -5
@@ -1,7 +1,7 @@
1
1
  =begin
2
- #CrispHive Developer API
2
+ #Crisphive Developer API
3
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> }`.
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
5
 
6
6
  The version of the OpenAPI document: 1.0
7
7
 
@@ -20,6 +20,7 @@ module Crisphive
20
20
  @api_client = api_client
21
21
  end
22
22
  # Get a job type
23
+ # Returns one entry of the business's service catalog (job/work-order type) with its localized display name — e.g. an HVAC tune-up, drain cleaning or electrical inspection offering.
23
24
  # @param id [String] Job Type ID
24
25
  # @param [Hash] opts the optional parameters
25
26
  # @return [GetJobType200Response]
@@ -29,6 +30,7 @@ module Crisphive
29
30
  end
30
31
 
31
32
  # Get a job type
33
+ # Returns one entry of the business&#39;s service catalog (job/work-order type) with its localized display name — e.g. an HVAC tune-up, drain cleaning or electrical inspection offering.
32
34
  # @param id [String] Job Type ID
33
35
  # @param [Hash] opts the optional parameters
34
36
  # @return [Array<(GetJobType200Response, Integer, Hash)>] GetJobType200Response data, response status code and response headers
@@ -81,6 +83,7 @@ module Crisphive
81
83
  end
82
84
 
83
85
  # List job types
86
+ # Returns the business's service catalog — the job/work-order types it offers (e.g. installation, repair, maintenance, inspection for trades like HVAC, plumbing, electrical, cleaning). Use it to discover the `job_type_id` accepted when booking a job request, or to render a services menu on your own site.
84
87
  # @param [Hash] opts the optional parameters
85
88
  # @option opts [String] :status Filter by status (active|inactive)
86
89
  # @return [ListJobTypes200Response]
@@ -90,6 +93,7 @@ module Crisphive
90
93
  end
91
94
 
92
95
  # List job types
96
+ # Returns the business&#39;s service catalog — the job/work-order types it offers (e.g. installation, repair, maintenance, inspection for trades like HVAC, plumbing, electrical, cleaning). Use it to discover the &#x60;job_type_id&#x60; accepted when booking a job request, or to render a services menu on your own site.
93
97
  # @param [Hash] opts the optional parameters
94
98
  # @option opts [String] :status Filter by status (active|inactive)
95
99
  # @return [Array<(ListJobTypes200Response, Integer, Hash)>] ListJobTypes200Response data, response status code and response headers
@@ -1,7 +1,7 @@
1
1
  =begin
2
- #CrispHive Developer API
2
+ #Crisphive Developer API
3
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> }`.
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
5
 
6
6
  The version of the OpenAPI document: 1.0
7
7
 
@@ -20,7 +20,7 @@ module Crisphive
20
20
  @api_client = api_client
21
21
  end
22
22
  # Get a service area
23
- # Returns details of a specific service area
23
+ # Returns one service area — a geographic coverage zone (service territory) the business operates in, with its name and geometry metadata. Reference its UUID as `service_area_id` on customer records for territory-aware dispatch.
24
24
  # @param id [String] Service Area ID
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [GetServiceArea200Response]
@@ -30,7 +30,7 @@ module Crisphive
30
30
  end
31
31
 
32
32
  # Get a service area
33
- # Returns details of a specific service area
33
+ # Returns one service area — a geographic coverage zone (service territory) the business operates in, with its name and geometry metadata. Reference its UUID as &#x60;service_area_id&#x60; on customer records for territory-aware dispatch.
34
34
  # @param id [String] Service Area ID
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(GetServiceArea200Response, Integer, Hash)>] GetServiceArea200Response data, response status code and response headers
@@ -83,7 +83,7 @@ module Crisphive
83
83
  end
84
84
 
85
85
  # List service areas
86
- # Returns a paginated list of service areas for the business
86
+ # Returns the business's geographic coverage: paginated service areas (service territories / coverage zones) used for routing jobs to the right teams. Discover the `service_area_id` values accepted on customer create/update here.
87
87
  # @param [Hash] opts the optional parameters
88
88
  # @option opts [Integer] :page Page number (default 1)
89
89
  # @option opts [Integer] :limit Items per page (default 15, max 1000)
@@ -94,7 +94,7 @@ module Crisphive
94
94
  end
95
95
 
96
96
  # List service areas
97
- # Returns a paginated list of service areas for the business
97
+ # Returns the business&#39;s geographic coverage: paginated service areas (service territories / coverage zones) used for routing jobs to the right teams. Discover the &#x60;service_area_id&#x60; values accepted on customer create/update here.
98
98
  # @param [Hash] opts the optional parameters
99
99
  # @option opts [Integer] :page Page number (default 1)
100
100
  # @option opts [Integer] :limit Items per page (default 15, max 1000)
@@ -1,7 +1,7 @@
1
1
  =begin
2
- #CrispHive Developer API
2
+ #Crisphive Developer API
3
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> }`.
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
5
 
6
6
  The version of the OpenAPI document: 1.0
7
7
 
@@ -19,8 +19,142 @@ module Crisphive
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Add a technician
23
+ # Creates a technician membership under the current business. If the phone/email matches an existing user, their account is linked. Otherwise a new user identity is created (no invite email — login is passwordless later). Either way the membership starts active. If the technician was previously removed (deactive) they are reactivated instead. Owner/Administrator groups cannot be assigned via API key, and not at all in sandbox mode. Optional relations (all validated; any missing id → 404 TECHNICIAN_NOT_FOUND with `missing_ids`): `buddy_ids` sets this technician's buddy list (use when creating a lead); `lead_ids` adds this technician as a buddy of each named lead (use when creating a buddy — the buddy-side way to attach the same lead↔buddy relation); `service_area_ids` assigns the technician to those service areas. `start_location_type=office` snapshots the business address + coordinates into the technician at create time; `address`, `start_location_lat`, `start_location_long` in the body are ignored. Requires the business to have coordinates set (else 400 BUSINESS_LOCATION_MISSING). `start_location_type=home` (or empty) uses the address + coordinates from the body.
24
+ # @param technician_create_request [TechnicianCreateRequest] Technician details
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :idempotency_key Unique key making retries safe: a repeat send with the same key replays the original response (header Idempotent-Replayed: true) instead of re-running the operation. Reusing a key with a different body returns 422 IDEMPOTENCY_KEY_REUSE.
27
+ # @return [CreateTechnician200Response]
28
+ def create_technician(technician_create_request, opts = {})
29
+ data, _status_code, _headers = create_technician_with_http_info(technician_create_request, opts)
30
+ data
31
+ end
32
+
33
+ # Add a technician
34
+ # Creates a technician membership under the current business. If the phone/email matches an existing user, their account is linked. Otherwise a new user identity is created (no invite email — login is passwordless later). Either way the membership starts active. If the technician was previously removed (deactive) they are reactivated instead. Owner/Administrator groups cannot be assigned via API key, and not at all in sandbox mode. Optional relations (all validated; any missing id → 404 TECHNICIAN_NOT_FOUND with &#x60;missing_ids&#x60;): &#x60;buddy_ids&#x60; sets this technician&#39;s buddy list (use when creating a lead); &#x60;lead_ids&#x60; adds this technician as a buddy of each named lead (use when creating a buddy — the buddy-side way to attach the same lead↔buddy relation); &#x60;service_area_ids&#x60; assigns the technician to those service areas. &#x60;start_location_type&#x3D;office&#x60; snapshots the business address + coordinates into the technician at create time; &#x60;address&#x60;, &#x60;start_location_lat&#x60;, &#x60;start_location_long&#x60; in the body are ignored. Requires the business to have coordinates set (else 400 BUSINESS_LOCATION_MISSING). &#x60;start_location_type&#x3D;home&#x60; (or empty) uses the address + coordinates from the body.
35
+ # @param technician_create_request [TechnicianCreateRequest] Technician details
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [String] :idempotency_key Unique key making retries safe: a repeat send with the same key replays the original response (header Idempotent-Replayed: true) instead of re-running the operation. Reusing a key with a different body returns 422 IDEMPOTENCY_KEY_REUSE.
38
+ # @return [Array<(CreateTechnician200Response, Integer, Hash)>] CreateTechnician200Response data, response status code and response headers
39
+ def create_technician_with_http_info(technician_create_request, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: TechnicianApi.create_technician ...'
42
+ end
43
+ # verify the required parameter 'technician_create_request' is set
44
+ if @api_client.config.client_side_validation && technician_create_request.nil?
45
+ fail ArgumentError, "Missing the required parameter 'technician_create_request' when calling TechnicianApi.create_technician"
46
+ end
47
+ # resource path
48
+ local_var_path = '/technicians'
49
+
50
+ # query parameters
51
+ query_params = opts[:query_params] || {}
52
+
53
+ # header parameters
54
+ header_params = opts[:header_params] || {}
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
57
+ # HTTP header 'Content-Type'
58
+ content_type = @api_client.select_header_content_type(['application/json'])
59
+ if !content_type.nil?
60
+ header_params['Content-Type'] = content_type
61
+ end
62
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
63
+
64
+ # form parameters
65
+ form_params = opts[:form_params] || {}
66
+
67
+ # http body (model)
68
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(technician_create_request)
69
+
70
+ # return_type
71
+ return_type = opts[:debug_return_type] || 'CreateTechnician200Response'
72
+
73
+ # auth_names
74
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
75
+
76
+ new_options = opts.merge(
77
+ :operation => :"TechnicianApi.create_technician",
78
+ :header_params => header_params,
79
+ :query_params => query_params,
80
+ :form_params => form_params,
81
+ :body => post_body,
82
+ :auth_names => auth_names,
83
+ :return_type => return_type
84
+ )
85
+
86
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
87
+ if @api_client.config.debugging
88
+ @api_client.config.logger.debug "API called: TechnicianApi#create_technician\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
+ end
90
+ return data, status_code, headers
91
+ end
92
+
93
+ # Remove a technician
94
+ # Soft-removes a technician from the business by setting status to deactive
95
+ # @param id [String] Technician ID
96
+ # @param [Hash] opts the optional parameters
97
+ # @return [ResponseEnvelope]
98
+ def delete_technician(id, opts = {})
99
+ data, _status_code, _headers = delete_technician_with_http_info(id, opts)
100
+ data
101
+ end
102
+
103
+ # Remove a technician
104
+ # Soft-removes a technician from the business by setting status to deactive
105
+ # @param id [String] Technician ID
106
+ # @param [Hash] opts the optional parameters
107
+ # @return [Array<(ResponseEnvelope, Integer, Hash)>] ResponseEnvelope data, response status code and response headers
108
+ def delete_technician_with_http_info(id, opts = {})
109
+ if @api_client.config.debugging
110
+ @api_client.config.logger.debug 'Calling API: TechnicianApi.delete_technician ...'
111
+ end
112
+ # verify the required parameter 'id' is set
113
+ if @api_client.config.client_side_validation && id.nil?
114
+ fail ArgumentError, "Missing the required parameter 'id' when calling TechnicianApi.delete_technician"
115
+ end
116
+ # resource path
117
+ local_var_path = '/technicians/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
118
+
119
+ # query parameters
120
+ query_params = opts[:query_params] || {}
121
+
122
+ # header parameters
123
+ header_params = opts[:header_params] || {}
124
+ # HTTP header 'Accept' (if needed)
125
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
126
+
127
+ # form parameters
128
+ form_params = opts[:form_params] || {}
129
+
130
+ # http body (model)
131
+ post_body = opts[:debug_body]
132
+
133
+ # return_type
134
+ return_type = opts[:debug_return_type] || 'ResponseEnvelope'
135
+
136
+ # auth_names
137
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
138
+
139
+ new_options = opts.merge(
140
+ :operation => :"TechnicianApi.delete_technician",
141
+ :header_params => header_params,
142
+ :query_params => query_params,
143
+ :form_params => form_params,
144
+ :body => post_body,
145
+ :auth_names => auth_names,
146
+ :return_type => return_type
147
+ )
148
+
149
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
150
+ if @api_client.config.debugging
151
+ @api_client.config.logger.debug "API called: TechnicianApi#delete_technician\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
152
+ end
153
+ return data, status_code, headers
154
+ end
155
+
22
156
  # Get a technician
23
- # Returns details for a specific technician
157
+ # Returns one technician's full profile: contact info, employment status, assignment tier, skills/qualifications, buddy (crew) relations and assigned vehicles — the dispatch-ready view of a field worker.
24
158
  # @param id [String] Technician ID
25
159
  # @param [Hash] opts the optional parameters
26
160
  # @return [GetTechnician200Response]
@@ -30,7 +164,7 @@ module Crisphive
30
164
  end
31
165
 
32
166
  # Get a technician
33
- # Returns details for a specific technician
167
+ # Returns one technician&#39;s full profile: contact info, employment status, assignment tier, skills/qualifications, buddy (crew) relations and assigned vehicles — the dispatch-ready view of a field worker.
34
168
  # @param id [String] Technician ID
35
169
  # @param [Hash] opts the optional parameters
36
170
  # @return [Array<(GetTechnician200Response, Integer, Hash)>] GetTechnician200Response data, response status code and response headers
@@ -83,7 +217,7 @@ module Crisphive
83
217
  end
84
218
 
85
219
  # List technicians
86
- # Returns a paginated list of technicians for the current business
220
+ # Returns the field workforce roster: paginated technicians (field workers / engineers) with status, assignment tier (lead, buddy, float), skills and crew relations — the people the dispatch engine schedules onto jobs. Discover the `preferred_technician_id` accepted on customer records here. Supports the `since` cursor for incremental workforce sync.
87
221
  # @param [Hash] opts the optional parameters
88
222
  # @option opts [Integer] :page Page number (default 1)
89
223
  # @option opts [Integer] :limit Items per page (default 15, max 1000)
@@ -99,7 +233,7 @@ module Crisphive
99
233
  end
100
234
 
101
235
  # List technicians
102
- # Returns a paginated list of technicians for the current business
236
+ # Returns the field workforce roster: paginated technicians (field workers / engineers) with status, assignment tier (lead, buddy, float), skills and crew relations — the people the dispatch engine schedules onto jobs. Discover the &#x60;preferred_technician_id&#x60; accepted on customer records here. Supports the &#x60;since&#x60; cursor for incremental workforce sync.
103
237
  # @param [Hash] opts the optional parameters
104
238
  # @option opts [Integer] :page Page number (default 1)
105
239
  # @option opts [Integer] :limit Items per page (default 15, max 1000)
@@ -159,5 +293,375 @@ module Crisphive
159
293
  end
160
294
  return data, status_code, headers
161
295
  end
296
+
297
+ # Replace a technician's buddies
298
+ # Overwrites the technician's buddy list with the provided set of technician IDs. Sending an empty list clears all buddies. Each buddy ID must be an active technician of the same business; a technician cannot be their own buddy.
299
+ # @param id [String] Technician ID
300
+ # @param technician_buddies_request [TechnicianBuddiesRequest] Buddy IDs
301
+ # @param [Hash] opts the optional parameters
302
+ # @return [ResponseEnvelope]
303
+ def replace_technician_buddies(id, technician_buddies_request, opts = {})
304
+ data, _status_code, _headers = replace_technician_buddies_with_http_info(id, technician_buddies_request, opts)
305
+ data
306
+ end
307
+
308
+ # Replace a technician&#39;s buddies
309
+ # Overwrites the technician&#39;s buddy list with the provided set of technician IDs. Sending an empty list clears all buddies. Each buddy ID must be an active technician of the same business; a technician cannot be their own buddy.
310
+ # @param id [String] Technician ID
311
+ # @param technician_buddies_request [TechnicianBuddiesRequest] Buddy IDs
312
+ # @param [Hash] opts the optional parameters
313
+ # @return [Array<(ResponseEnvelope, Integer, Hash)>] ResponseEnvelope data, response status code and response headers
314
+ def replace_technician_buddies_with_http_info(id, technician_buddies_request, opts = {})
315
+ if @api_client.config.debugging
316
+ @api_client.config.logger.debug 'Calling API: TechnicianApi.replace_technician_buddies ...'
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 TechnicianApi.replace_technician_buddies"
321
+ end
322
+ # verify the required parameter 'technician_buddies_request' is set
323
+ if @api_client.config.client_side_validation && technician_buddies_request.nil?
324
+ fail ArgumentError, "Missing the required parameter 'technician_buddies_request' when calling TechnicianApi.replace_technician_buddies"
325
+ end
326
+ # resource path
327
+ local_var_path = '/technicians/{id}/buddies'.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(technician_buddies_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 => :"TechnicianApi.replace_technician_buddies",
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: TechnicianApi#replace_technician_buddies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
367
+ end
368
+ return data, status_code, headers
369
+ end
370
+
371
+ # Replace a buddy's leaders (buddy side)
372
+ # Sets the full set of leads this buddy belongs to (many-to-many favorites). Replace-semantics — lead_ids is the complete new list; [] clears every leader. Managed by business staff.
373
+ # @param id [String] Buddy technician ID
374
+ # @param technician_leads_request [TechnicianLeadsRequest] Lead IDs payload
375
+ # @param [Hash] opts the optional parameters
376
+ # @return [ResponseEnvelope]
377
+ def replace_technician_leads(id, technician_leads_request, opts = {})
378
+ data, _status_code, _headers = replace_technician_leads_with_http_info(id, technician_leads_request, opts)
379
+ data
380
+ end
381
+
382
+ # Replace a buddy&#39;s leaders (buddy side)
383
+ # Sets the full set of leads this buddy belongs to (many-to-many favorites). Replace-semantics — lead_ids is the complete new list; [] clears every leader. Managed by business staff.
384
+ # @param id [String] Buddy technician ID
385
+ # @param technician_leads_request [TechnicianLeadsRequest] Lead IDs payload
386
+ # @param [Hash] opts the optional parameters
387
+ # @return [Array<(ResponseEnvelope, Integer, Hash)>] ResponseEnvelope data, response status code and response headers
388
+ def replace_technician_leads_with_http_info(id, technician_leads_request, opts = {})
389
+ if @api_client.config.debugging
390
+ @api_client.config.logger.debug 'Calling API: TechnicianApi.replace_technician_leads ...'
391
+ end
392
+ # verify the required parameter 'id' is set
393
+ if @api_client.config.client_side_validation && id.nil?
394
+ fail ArgumentError, "Missing the required parameter 'id' when calling TechnicianApi.replace_technician_leads"
395
+ end
396
+ # verify the required parameter 'technician_leads_request' is set
397
+ if @api_client.config.client_side_validation && technician_leads_request.nil?
398
+ fail ArgumentError, "Missing the required parameter 'technician_leads_request' when calling TechnicianApi.replace_technician_leads"
399
+ end
400
+ # resource path
401
+ local_var_path = '/technicians/{id}/leads'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
402
+
403
+ # query parameters
404
+ query_params = opts[:query_params] || {}
405
+
406
+ # header parameters
407
+ header_params = opts[:header_params] || {}
408
+ # HTTP header 'Accept' (if needed)
409
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
410
+ # HTTP header 'Content-Type'
411
+ content_type = @api_client.select_header_content_type(['application/json'])
412
+ if !content_type.nil?
413
+ header_params['Content-Type'] = content_type
414
+ end
415
+
416
+ # form parameters
417
+ form_params = opts[:form_params] || {}
418
+
419
+ # http body (model)
420
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(technician_leads_request)
421
+
422
+ # return_type
423
+ return_type = opts[:debug_return_type] || 'ResponseEnvelope'
424
+
425
+ # auth_names
426
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
427
+
428
+ new_options = opts.merge(
429
+ :operation => :"TechnicianApi.replace_technician_leads",
430
+ :header_params => header_params,
431
+ :query_params => query_params,
432
+ :form_params => form_params,
433
+ :body => post_body,
434
+ :auth_names => auth_names,
435
+ :return_type => return_type
436
+ )
437
+
438
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
439
+ if @api_client.config.debugging
440
+ @api_client.config.logger.debug "API called: TechnicianApi#replace_technician_leads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
441
+ end
442
+ return data, status_code, headers
443
+ end
444
+
445
+ # Replace a technician's service areas
446
+ # Overwrites the technician's service-area assignments with the provided set of service area IDs. Sending an empty list clears all. Each service area ID must belong to the same business — any missing id → 404 SERVICE_AREA_NOT_FOUND with `missing_ids` and no writes. The resolved set is returned and also embedded as `service_areas` in the technician GET/list response. Managed by business staff (Booking Coordinator), not tech self-service.
447
+ # @param id [String] Technician ID
448
+ # @param technician_service_areas_request [TechnicianServiceAreasRequest] Service area IDs
449
+ # @param [Hash] opts the optional parameters
450
+ # @return [ReplaceTechnicianServiceAreas200Response]
451
+ def replace_technician_service_areas(id, technician_service_areas_request, opts = {})
452
+ data, _status_code, _headers = replace_technician_service_areas_with_http_info(id, technician_service_areas_request, opts)
453
+ data
454
+ end
455
+
456
+ # Replace a technician&#39;s service areas
457
+ # Overwrites the technician&#39;s service-area assignments with the provided set of service area IDs. Sending an empty list clears all. Each service area ID must belong to the same business — any missing id → 404 SERVICE_AREA_NOT_FOUND with &#x60;missing_ids&#x60; and no writes. The resolved set is returned and also embedded as &#x60;service_areas&#x60; in the technician GET/list response. Managed by business staff (Booking Coordinator), not tech self-service.
458
+ # @param id [String] Technician ID
459
+ # @param technician_service_areas_request [TechnicianServiceAreasRequest] Service area IDs
460
+ # @param [Hash] opts the optional parameters
461
+ # @return [Array<(ReplaceTechnicianServiceAreas200Response, Integer, Hash)>] ReplaceTechnicianServiceAreas200Response data, response status code and response headers
462
+ def replace_technician_service_areas_with_http_info(id, technician_service_areas_request, opts = {})
463
+ if @api_client.config.debugging
464
+ @api_client.config.logger.debug 'Calling API: TechnicianApi.replace_technician_service_areas ...'
465
+ end
466
+ # verify the required parameter 'id' is set
467
+ if @api_client.config.client_side_validation && id.nil?
468
+ fail ArgumentError, "Missing the required parameter 'id' when calling TechnicianApi.replace_technician_service_areas"
469
+ end
470
+ # verify the required parameter 'technician_service_areas_request' is set
471
+ if @api_client.config.client_side_validation && technician_service_areas_request.nil?
472
+ fail ArgumentError, "Missing the required parameter 'technician_service_areas_request' when calling TechnicianApi.replace_technician_service_areas"
473
+ end
474
+ # resource path
475
+ local_var_path = '/technicians/{id}/service-areas'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
476
+
477
+ # query parameters
478
+ query_params = opts[:query_params] || {}
479
+
480
+ # header parameters
481
+ header_params = opts[:header_params] || {}
482
+ # HTTP header 'Accept' (if needed)
483
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
484
+ # HTTP header 'Content-Type'
485
+ content_type = @api_client.select_header_content_type(['application/json'])
486
+ if !content_type.nil?
487
+ header_params['Content-Type'] = content_type
488
+ end
489
+
490
+ # form parameters
491
+ form_params = opts[:form_params] || {}
492
+
493
+ # http body (model)
494
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(technician_service_areas_request)
495
+
496
+ # return_type
497
+ return_type = opts[:debug_return_type] || 'ReplaceTechnicianServiceAreas200Response'
498
+
499
+ # auth_names
500
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
501
+
502
+ new_options = opts.merge(
503
+ :operation => :"TechnicianApi.replace_technician_service_areas",
504
+ :header_params => header_params,
505
+ :query_params => query_params,
506
+ :form_params => form_params,
507
+ :body => post_body,
508
+ :auth_names => auth_names,
509
+ :return_type => return_type
510
+ )
511
+
512
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
513
+ if @api_client.config.debugging
514
+ @api_client.config.logger.debug "API called: TechnicianApi#replace_technician_service_areas\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
515
+ end
516
+ return data, status_code, headers
517
+ end
518
+
519
+ # Replace a technician's vehicles
520
+ # Overwrites the technician's vehicle list with the provided set of vehicle IDs (the vehicles this technician uses). Sending an empty list clears all. Each vehicle ID must belong to the same business. The list is also embedded as `vehicle_ids` in the technician GET/list response.
521
+ # @param id [String] Technician ID
522
+ # @param technician_vehicles_request [TechnicianVehiclesRequest] Vehicle IDs
523
+ # @param [Hash] opts the optional parameters
524
+ # @return [ResponseEnvelope]
525
+ def replace_technician_vehicles(id, technician_vehicles_request, opts = {})
526
+ data, _status_code, _headers = replace_technician_vehicles_with_http_info(id, technician_vehicles_request, opts)
527
+ data
528
+ end
529
+
530
+ # Replace a technician&#39;s vehicles
531
+ # Overwrites the technician&#39;s vehicle list with the provided set of vehicle IDs (the vehicles this technician uses). Sending an empty list clears all. Each vehicle ID must belong to the same business. The list is also embedded as &#x60;vehicle_ids&#x60; in the technician GET/list response.
532
+ # @param id [String] Technician ID
533
+ # @param technician_vehicles_request [TechnicianVehiclesRequest] Vehicle IDs
534
+ # @param [Hash] opts the optional parameters
535
+ # @return [Array<(ResponseEnvelope, Integer, Hash)>] ResponseEnvelope data, response status code and response headers
536
+ def replace_technician_vehicles_with_http_info(id, technician_vehicles_request, opts = {})
537
+ if @api_client.config.debugging
538
+ @api_client.config.logger.debug 'Calling API: TechnicianApi.replace_technician_vehicles ...'
539
+ end
540
+ # verify the required parameter 'id' is set
541
+ if @api_client.config.client_side_validation && id.nil?
542
+ fail ArgumentError, "Missing the required parameter 'id' when calling TechnicianApi.replace_technician_vehicles"
543
+ end
544
+ # verify the required parameter 'technician_vehicles_request' is set
545
+ if @api_client.config.client_side_validation && technician_vehicles_request.nil?
546
+ fail ArgumentError, "Missing the required parameter 'technician_vehicles_request' when calling TechnicianApi.replace_technician_vehicles"
547
+ end
548
+ # resource path
549
+ local_var_path = '/technicians/{id}/vehicles'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
550
+
551
+ # query parameters
552
+ query_params = opts[:query_params] || {}
553
+
554
+ # header parameters
555
+ header_params = opts[:header_params] || {}
556
+ # HTTP header 'Accept' (if needed)
557
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
558
+ # HTTP header 'Content-Type'
559
+ content_type = @api_client.select_header_content_type(['application/json'])
560
+ if !content_type.nil?
561
+ header_params['Content-Type'] = content_type
562
+ end
563
+
564
+ # form parameters
565
+ form_params = opts[:form_params] || {}
566
+
567
+ # http body (model)
568
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(technician_vehicles_request)
569
+
570
+ # return_type
571
+ return_type = opts[:debug_return_type] || 'ResponseEnvelope'
572
+
573
+ # auth_names
574
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
575
+
576
+ new_options = opts.merge(
577
+ :operation => :"TechnicianApi.replace_technician_vehicles",
578
+ :header_params => header_params,
579
+ :query_params => query_params,
580
+ :form_params => form_params,
581
+ :body => post_body,
582
+ :auth_names => auth_names,
583
+ :return_type => return_type
584
+ )
585
+
586
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
587
+ if @api_client.config.debugging
588
+ @api_client.config.logger.debug "API called: TechnicianApi#replace_technician_vehicles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
589
+ end
590
+ return data, status_code, headers
591
+ end
592
+
593
+ # Update a technician
594
+ # Updates mutable technician profile fields. `start_location_type=office` re-snapshots the current business address + coordinates (body `address`/`start_location_lat`/`start_location_long` ignored; requires business coordinates, else 400 BUSINESS_LOCATION_MISSING). `start_location_type=home` (or empty) uses the address + coordinates from the body.
595
+ # @param id [String] Technician ID
596
+ # @param technician_update_request [TechnicianUpdateRequest] Technician details
597
+ # @param [Hash] opts the optional parameters
598
+ # @return [ResponseEnvelope]
599
+ def update_technician(id, technician_update_request, opts = {})
600
+ data, _status_code, _headers = update_technician_with_http_info(id, technician_update_request, opts)
601
+ data
602
+ end
603
+
604
+ # Update a technician
605
+ # Updates mutable technician profile fields. &#x60;start_location_type&#x3D;office&#x60; re-snapshots the current business address + coordinates (body &#x60;address&#x60;/&#x60;start_location_lat&#x60;/&#x60;start_location_long&#x60; ignored; requires business coordinates, else 400 BUSINESS_LOCATION_MISSING). &#x60;start_location_type&#x3D;home&#x60; (or empty) uses the address + coordinates from the body.
606
+ # @param id [String] Technician ID
607
+ # @param technician_update_request [TechnicianUpdateRequest] Technician details
608
+ # @param [Hash] opts the optional parameters
609
+ # @return [Array<(ResponseEnvelope, Integer, Hash)>] ResponseEnvelope data, response status code and response headers
610
+ def update_technician_with_http_info(id, technician_update_request, opts = {})
611
+ if @api_client.config.debugging
612
+ @api_client.config.logger.debug 'Calling API: TechnicianApi.update_technician ...'
613
+ end
614
+ # verify the required parameter 'id' is set
615
+ if @api_client.config.client_side_validation && id.nil?
616
+ fail ArgumentError, "Missing the required parameter 'id' when calling TechnicianApi.update_technician"
617
+ end
618
+ # verify the required parameter 'technician_update_request' is set
619
+ if @api_client.config.client_side_validation && technician_update_request.nil?
620
+ fail ArgumentError, "Missing the required parameter 'technician_update_request' when calling TechnicianApi.update_technician"
621
+ end
622
+ # resource path
623
+ local_var_path = '/technicians/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
624
+
625
+ # query parameters
626
+ query_params = opts[:query_params] || {}
627
+
628
+ # header parameters
629
+ header_params = opts[:header_params] || {}
630
+ # HTTP header 'Accept' (if needed)
631
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
632
+ # HTTP header 'Content-Type'
633
+ content_type = @api_client.select_header_content_type(['application/json'])
634
+ if !content_type.nil?
635
+ header_params['Content-Type'] = content_type
636
+ end
637
+
638
+ # form parameters
639
+ form_params = opts[:form_params] || {}
640
+
641
+ # http body (model)
642
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(technician_update_request)
643
+
644
+ # return_type
645
+ return_type = opts[:debug_return_type] || 'ResponseEnvelope'
646
+
647
+ # auth_names
648
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
649
+
650
+ new_options = opts.merge(
651
+ :operation => :"TechnicianApi.update_technician",
652
+ :header_params => header_params,
653
+ :query_params => query_params,
654
+ :form_params => form_params,
655
+ :body => post_body,
656
+ :auth_names => auth_names,
657
+ :return_type => return_type
658
+ )
659
+
660
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
661
+ if @api_client.config.debugging
662
+ @api_client.config.logger.debug "API called: TechnicianApi#update_technician\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
663
+ end
664
+ return data, status_code, headers
665
+ end
162
666
  end
163
667
  end