crisphive 0.1.0 → 0.3.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 (229) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +183 -16
  3. data/crisphive.gemspec +5 -5
  4. data/lib/crisphive/api/business_skill_api.rb +502 -8
  5. data/lib/crisphive/api/customer_api.rb +20 -14
  6. data/lib/crisphive/api/job_request_business_api.rb +1273 -167
  7. data/lib/crisphive/api/job_types_api.rb +214 -2
  8. data/lib/crisphive/api/permission_api.rb +79 -0
  9. data/lib/crisphive/api/service_area_api.rb +214 -6
  10. data/lib/crisphive/api/technician_api.rb +510 -6
  11. data/lib/crisphive/api/technician_time_off_api.rb +240 -0
  12. data/lib/crisphive/api/vehicle_api.rb +214 -6
  13. data/lib/crisphive/api/webhooks_api.rb +213 -0
  14. data/lib/crisphive/api_client.rb +2 -2
  15. data/lib/crisphive/api_error.rb +2 -2
  16. data/lib/crisphive/configuration.rb +3 -3
  17. data/lib/crisphive/models/api_internal_techtimeoff_actions.rb +232 -0
  18. data/lib/crisphive/models/api_internal_techtimeoff_status.rb +42 -0
  19. data/lib/crisphive/models/assignable_group.rb +289 -0
  20. data/lib/crisphive/models/book_and_confirm_job_request200_response.rb +253 -0
  21. data/lib/crisphive/models/commit_absence_resolve200_response.rb +253 -0
  22. data/lib/crisphive/models/commit_emergency_reschedule200_response.rb +253 -0
  23. data/lib/crisphive/models/commit_job_request_move200_response.rb +253 -0
  24. data/lib/crisphive/models/create_customer200_response.rb +5 -2
  25. data/lib/crisphive/models/create_job_request200_response.rb +5 -2
  26. data/lib/crisphive/models/create_job_type200_response.rb +253 -0
  27. data/lib/crisphive/models/create_service_area200_response.rb +253 -0
  28. data/lib/crisphive/models/create_skill200_response.rb +253 -0
  29. data/lib/crisphive/models/create_skill_category200_response.rb +253 -0
  30. data/lib/crisphive/models/create_technician200_response.rb +253 -0
  31. data/lib/crisphive/models/create_technician_time_off200_response.rb +253 -0
  32. data/lib/crisphive/models/create_vehicle200_response.rb +253 -0
  33. data/lib/crisphive/models/create_webhook_endpoint200_response.rb +253 -0
  34. data/lib/crisphive/models/customer.rb +13 -3
  35. data/lib/crisphive/models/customer_address.rb +2 -2
  36. data/lib/crisphive/models/customer_address_request.rb +11 -2
  37. data/lib/crisphive/models/customer_contact.rb +27 -7
  38. data/lib/crisphive/models/customer_create_request.rb +14 -4
  39. data/lib/crisphive/models/customer_create_response.rb +2 -2
  40. data/lib/crisphive/models/customer_list.rb +3 -3
  41. data/lib/crisphive/models/customer_list_item.rb +13 -3
  42. data/lib/crisphive/models/customer_profile.rb +2 -2
  43. data/lib/crisphive/models/customer_quick_books_link.rb +235 -0
  44. data/lib/crisphive/models/customer_service_area_ref.rb +225 -0
  45. data/lib/crisphive/models/customer_spending.rb +2 -2
  46. data/lib/crisphive/models/customer_technician_ref.rb +225 -0
  47. data/lib/crisphive/models/customer_tier_progress.rb +2 -2
  48. data/lib/crisphive/models/customer_update_request.rb +25 -22
  49. data/lib/crisphive/models/get_customer200_response.rb +5 -2
  50. data/lib/crisphive/models/get_job_request200_response.rb +5 -2
  51. data/lib/crisphive/models/get_job_request_timeline200_response.rb +5 -2
  52. data/lib/crisphive/models/get_job_type200_response.rb +5 -2
  53. data/lib/crisphive/models/get_service_area200_response.rb +5 -2
  54. data/lib/crisphive/models/get_technician200_response.rb +5 -2
  55. data/lib/crisphive/models/get_technician_schedule200_response.rb +253 -0
  56. data/lib/crisphive/models/get_vehicle200_response.rb +5 -2
  57. data/lib/crisphive/models/internal_jobrequest_http_address_req.rb +475 -0
  58. data/lib/crisphive/models/job_date.rb +5 -3
  59. data/lib/crisphive/models/job_date_business_range.rb +7 -3
  60. data/lib/crisphive/models/job_date_period.rb +2 -2
  61. data/lib/crisphive/models/job_date_period_entry.rb +4 -2
  62. data/lib/crisphive/models/job_request.rb +56 -6
  63. data/lib/crisphive/models/job_request_absence_alternative.rb +356 -0
  64. data/lib/crisphive/models/job_request_absence_alternative_cost.rb +275 -0
  65. data/lib/crisphive/models/job_request_absence_assignment.rb +319 -0
  66. data/lib/crisphive/models/job_request_absence_commit_request.rb +296 -0
  67. data/lib/crisphive/models/job_request_absence_notification.rb +283 -0
  68. data/lib/crisphive/models/job_request_absence_plan.rb +322 -0
  69. data/lib/crisphive/models/job_request_absence_preview_request.rb +280 -0
  70. data/lib/crisphive/models/job_request_absence_resolved_job.rb +499 -0
  71. data/lib/crisphive/models/job_request_absence_solver.rb +289 -0
  72. data/lib/crisphive/models/job_request_absence_time_off.rb +281 -0
  73. data/lib/crisphive/models/job_request_absence_unresolved_job.rb +364 -0
  74. data/lib/crisphive/models/job_request_action_audit_by.rb +2 -2
  75. data/lib/crisphive/models/job_request_action_audit_entry.rb +3 -3
  76. data/lib/crisphive/models/job_request_action_summary.rb +3 -3
  77. data/lib/crisphive/models/job_request_address_summary.rb +2 -2
  78. data/lib/crisphive/models/job_request_archive_summary.rb +2 -2
  79. data/lib/crisphive/models/job_request_arrival_window.rb +4 -4
  80. data/lib/crisphive/models/job_request_assigned_vehicle.rb +2 -2
  81. data/lib/crisphive/models/job_request_assignment_summary.rb +2 -2
  82. data/lib/crisphive/models/job_request_attention_summary.rb +259 -0
  83. data/lib/crisphive/models/job_request_available_vehicle.rb +235 -0
  84. data/lib/crisphive/models/job_request_blocker.rb +363 -0
  85. data/lib/crisphive/models/job_request_blocker_ref.rb +223 -0
  86. data/lib/crisphive/models/job_request_book_and_confirm_customer.rb +302 -0
  87. data/lib/crisphive/models/job_request_book_and_confirm_emergency.rb +315 -0
  88. data/lib/crisphive/models/job_request_book_and_confirm_emergency_result.rb +279 -0
  89. data/lib/crisphive/models/job_request_book_and_confirm_refusal.rb +280 -0
  90. data/lib/crisphive/models/job_request_book_and_confirm_request.rb +466 -0
  91. data/lib/crisphive/models/job_request_book_and_confirm_response.rb +295 -0
  92. data/lib/crisphive/models/job_request_booking_windows.rb +2 -2
  93. data/lib/crisphive/models/job_request_buddy_slot_candidates.rb +239 -0
  94. data/lib/crisphive/models/job_request_business_time_range.rb +3 -3
  95. data/lib/crisphive/models/job_request_changes.rb +2 -2
  96. data/lib/crisphive/models/job_request_confirm_request.rb +255 -0
  97. data/lib/crisphive/models/job_request_create_request.rb +61 -7
  98. data/lib/crisphive/models/job_request_create_response.rb +2 -2
  99. data/lib/crisphive/models/job_request_crew_candidates.rb +227 -0
  100. data/lib/crisphive/models/job_request_crew_change.rb +299 -0
  101. data/lib/crisphive/models/job_request_crew_member.rb +7 -4
  102. data/lib/crisphive/models/job_request_crew_member_input.rb +284 -0
  103. data/lib/crisphive/models/job_request_crew_recommendation.rb +255 -0
  104. data/lib/crisphive/models/job_request_customer_summary.rb +2 -2
  105. data/lib/crisphive/models/job_request_day_windows.rb +3 -3
  106. data/lib/crisphive/models/job_request_emergency_candidate.rb +319 -0
  107. data/lib/crisphive/models/job_request_emergency_candidates.rb +311 -0
  108. data/lib/crisphive/models/job_request_emergency_candidates_request.rb +341 -0
  109. data/lib/crisphive/models/job_request_emergency_commit_request.rb +361 -0
  110. data/lib/crisphive/models/job_request_emergency_inline_job.rb +353 -0
  111. data/lib/crisphive/models/job_request_emergency_plan.rb +367 -0
  112. data/lib/crisphive/models/job_request_emergency_preview_request.rb +342 -0
  113. data/lib/crisphive/models/job_request_job_date_business_range_request.rb +3 -3
  114. data/lib/crisphive/models/job_request_job_date_period_request.rb +2 -2
  115. data/lib/crisphive/models/job_request_job_date_request.rb +3 -3
  116. data/lib/crisphive/models/job_request_lead_candidate.rb +311 -0
  117. data/lib/crisphive/models/job_request_list.rb +2 -2
  118. data/lib/crisphive/models/job_request_move_commit_req.rb +353 -0
  119. data/lib/crisphive/models/job_request_move_member.rb +299 -0
  120. data/lib/crisphive/models/job_request_move_plan.rb +387 -0
  121. data/lib/crisphive/models/job_request_move_preview_req.rb +300 -0
  122. data/lib/crisphive/models/job_request_move_warning.rb +335 -0
  123. data/lib/crisphive/models/job_request_period.rb +2 -2
  124. data/lib/crisphive/models/job_request_priority_update_result.rb +217 -0
  125. data/lib/crisphive/models/job_request_quote_request.rb +343 -0
  126. data/lib/crisphive/models/job_request_quote_summary.rb +2 -2
  127. data/lib/crisphive/models/job_request_rating_summary.rb +2 -2
  128. data/lib/crisphive/models/job_request_reassign_fallback.rb +287 -0
  129. data/lib/crisphive/models/job_request_reschedule_day.rb +227 -0
  130. data/lib/crisphive/models/job_request_reschedule_move.rb +319 -0
  131. data/lib/crisphive/models/job_request_reschedule_reassignment.rb +339 -0
  132. data/lib/crisphive/models/job_request_schedule.rb +2 -2
  133. data/lib/crisphive/models/job_request_session.rb +8 -7
  134. data/lib/crisphive/models/job_request_skill_summary.rb +3 -3
  135. data/lib/crisphive/models/job_request_status_summary.rb +3 -3
  136. data/lib/crisphive/models/job_request_tech_candidate.rb +287 -0
  137. data/lib/crisphive/models/job_request_technician_info.rb +2 -2
  138. data/lib/crisphive/models/job_request_time_segments.rb +287 -0
  139. data/lib/crisphive/models/job_request_time_segments_business_time.rb +321 -0
  140. data/lib/crisphive/models/job_request_time_segments_day.rb +247 -0
  141. data/lib/crisphive/models/job_request_time_segments_slot.rb +375 -0
  142. data/lib/crisphive/models/job_request_time_segments_worker.rb +295 -0
  143. data/lib/crisphive/models/job_request_timeline.rb +2 -2
  144. data/lib/crisphive/models/job_request_timeline_action.rb +2 -2
  145. data/lib/crisphive/models/job_request_timeline_event.rb +2 -2
  146. data/lib/crisphive/models/job_request_update_priority_request.rb +295 -0
  147. data/lib/crisphive/models/job_type.rb +44 -4
  148. data/lib/crisphive/models/job_type_create_request.rb +399 -0
  149. data/lib/crisphive/models/job_type_create_response.rb +215 -0
  150. data/lib/crisphive/models/job_type_update_request.rb +400 -0
  151. data/lib/crisphive/models/list_assignable_groups200_response.rb +255 -0
  152. data/lib/crisphive/models/list_crew_candidates200_response.rb +253 -0
  153. data/lib/crisphive/models/list_customers200_response.rb +5 -2
  154. data/lib/crisphive/models/list_emergency_candidates200_response.rb +253 -0
  155. data/lib/crisphive/models/list_job_request_booking_windows200_response.rb +5 -2
  156. data/lib/crisphive/models/list_job_request_changes200_response.rb +5 -2
  157. data/lib/crisphive/models/list_job_requests200_response.rb +5 -2
  158. data/lib/crisphive/models/list_job_types200_response.rb +5 -2
  159. data/lib/crisphive/models/list_matching_slots200_response.rb +253 -0
  160. data/lib/crisphive/models/list_nearby_technicians200_response.rb +253 -0
  161. data/lib/crisphive/models/list_service_areas200_response.rb +5 -2
  162. data/lib/crisphive/models/list_skill_categories200_response.rb +5 -2
  163. data/lib/crisphive/models/list_skills200_response.rb +5 -2
  164. data/lib/crisphive/models/list_skills_by_category200_response.rb +5 -2
  165. data/lib/crisphive/models/list_technician_skills200_response.rb +253 -0
  166. data/lib/crisphive/models/list_technician_time_off200_response.rb +253 -0
  167. data/lib/crisphive/models/list_technicians200_response.rb +5 -2
  168. data/lib/crisphive/models/list_vehicles200_response.rb +5 -2
  169. data/lib/crisphive/models/list_webhook_event_types200_response.rb +255 -0
  170. data/lib/crisphive/models/nearby_technician.rb +319 -0
  171. data/lib/crisphive/models/nearby_technicians.rb +237 -0
  172. data/lib/crisphive/models/pagination.rb +7 -2
  173. data/lib/crisphive/models/quote_job_request200_response.rb +253 -0
  174. data/lib/crisphive/models/replace_technician_service_areas200_response.rb +253 -0
  175. data/lib/crisphive/models/response_envelope.rb +6 -2
  176. data/lib/crisphive/models/service_area.rb +23 -3
  177. data/lib/crisphive/models/service_area_create_request.rb +455 -0
  178. data/lib/crisphive/models/service_area_create_response.rb +215 -0
  179. data/lib/crisphive/models/service_area_list.rb +2 -2
  180. data/lib/crisphive/models/service_area_update_request.rb +451 -0
  181. data/lib/crisphive/models/skill.rb +9 -2
  182. data/lib/crisphive/models/skill_by_category_list.rb +4 -2
  183. data/lib/crisphive/models/skill_category.rb +7 -2
  184. data/lib/crisphive/models/skill_category_create_request.rb +270 -0
  185. data/lib/crisphive/models/skill_category_create_response.rb +215 -0
  186. data/lib/crisphive/models/skill_category_list.rb +4 -2
  187. data/lib/crisphive/models/skill_create_request.rb +270 -0
  188. data/lib/crisphive/models/skill_create_response.rb +215 -0
  189. data/lib/crisphive/models/skill_list.rb +2 -2
  190. data/lib/crisphive/models/skill_summary.rb +2 -2
  191. data/lib/crisphive/models/skill_update_request.rb +281 -0
  192. data/lib/crisphive/models/technician.rb +66 -4
  193. data/lib/crisphive/models/technician_address.rb +2 -2
  194. data/lib/crisphive/models/technician_address_input.rb +408 -0
  195. data/lib/crisphive/models/technician_buddies_request.rb +236 -0
  196. data/lib/crisphive/models/technician_create_request.rb +603 -0
  197. data/lib/crisphive/models/technician_create_response.rb +215 -0
  198. data/lib/crisphive/models/technician_lead_ref.rb +2 -2
  199. data/lib/crisphive/models/technician_leads_request.rb +236 -0
  200. data/lib/crisphive/models/technician_list.rb +3 -3
  201. data/lib/crisphive/models/technician_schedule.rb +279 -0
  202. data/lib/crisphive/models/technician_schedule_block.rb +225 -0
  203. data/lib/crisphive/models/technician_schedule_session.rb +311 -0
  204. data/lib/crisphive/models/technician_service_area_ref.rb +2 -2
  205. data/lib/crisphive/models/technician_service_areas_request.rb +236 -0
  206. data/lib/crisphive/models/technician_service_areas_response.rb +217 -0
  207. data/lib/crisphive/models/technician_skill.rb +265 -0
  208. data/lib/crisphive/models/technician_skill_list.rb +227 -0
  209. data/lib/crisphive/models/technician_skills_request.rb +236 -0
  210. data/lib/crisphive/models/technician_status.rb +2 -2
  211. data/lib/crisphive/models/technician_time_off.rb +334 -0
  212. data/lib/crisphive/models/technician_time_off_create_request.rb +285 -0
  213. data/lib/crisphive/models/technician_time_off_create_response.rb +215 -0
  214. data/lib/crisphive/models/technician_time_off_list.rb +246 -0
  215. data/lib/crisphive/models/technician_update_request.rb +507 -0
  216. data/lib/crisphive/models/technician_vehicles_request.rb +236 -0
  217. data/lib/crisphive/models/vehicle.rb +26 -4
  218. data/lib/crisphive/models/vehicle_create_request.rb +420 -0
  219. data/lib/crisphive/models/vehicle_create_response.rb +215 -0
  220. data/lib/crisphive/models/vehicle_list.rb +2 -2
  221. data/lib/crisphive/models/vehicle_owner.rb +2 -2
  222. data/lib/crisphive/models/vehicle_update_request.rb +440 -0
  223. data/lib/crisphive/models/webhook_create_request.rb +320 -0
  224. data/lib/crisphive/models/webhook_create_response.rb +391 -0
  225. data/lib/crisphive/models/webhook_verification.rb +235 -0
  226. data/lib/crisphive/version.rb +3 -3
  227. data/lib/crisphive.rb +126 -2
  228. data/spec/spec_helper.rb +2 -2
  229. metadata +129 -5
@@ -0,0 +1,342 @@
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 'date'
14
+ require 'time'
15
+
16
+ module Crisphive
17
+ class JobRequestEmergencyPreviewRequest
18
+ # Place this P0 outside working hours / approved time-off — you have phoned the technician and they agreed. Drops the non-working-day rejection; the response then carries an AFTER_HOURS warning. Double-booking, service area, required skills and the lead-tier rule still reject.
19
+ attr_accessor :after_hours_override
20
+
21
+ # Fate of displaced jobs: reschedule (default — pushed to later windows) or reassign (handed to another feasible technician at their ORIGINAL time; no-capacity jobs fall back to reschedule).
22
+ attr_accessor :displacement_mode
23
+
24
+ # UUID of the P0 job to insert. Send this OR `job`, never both and never neither.
25
+ attr_accessor :emergency_job_id
26
+
27
+ # A job that does not exist yet — the wizard's read-only preview before anything is written. Send this OR `emergency_job_id`.
28
+ attr_accessor :job
29
+
30
+ # Cascade mode: overtime = displaced jobs stay same-day (tech works late); next_day = overflow rolls to the next working day.
31
+ attr_accessor :mode
32
+
33
+ # Desired start — business-local wall clock. Seconds may be omitted and a space may replace the T; an offset is accepted only when it agrees with the business timezone (a disagreeing one is refused with JOB_REQUEST_INVALID_INPUT rather than guessed). Must be in the future.
34
+ attr_accessor :start_at
35
+
36
+ # Target technician (must belong to the business).
37
+ attr_accessor :technician_id
38
+
39
+ class EnumAttributeValidator
40
+ attr_reader :datatype
41
+ attr_reader :allowable_values
42
+
43
+ def initialize(datatype, allowable_values)
44
+ @allowable_values = allowable_values.map do |value|
45
+ case datatype.to_s
46
+ when /Integer/i
47
+ value.to_i
48
+ when /Float/i
49
+ value.to_f
50
+ else
51
+ value
52
+ end
53
+ end
54
+ end
55
+
56
+ def valid?(value)
57
+ !value || allowable_values.include?(value)
58
+ end
59
+ end
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'after_hours_override' => :'after_hours_override',
65
+ :'displacement_mode' => :'displacement_mode',
66
+ :'emergency_job_id' => :'emergency_job_id',
67
+ :'job' => :'job',
68
+ :'mode' => :'mode',
69
+ :'start_at' => :'start_at',
70
+ :'technician_id' => :'technician_id'
71
+ }
72
+ end
73
+
74
+ # Returns all the JSON keys this model knows about
75
+ def self.acceptable_attributes
76
+ attribute_map.values
77
+ end
78
+
79
+ # Attribute type mapping.
80
+ def self.openapi_types
81
+ {
82
+ :'after_hours_override' => :'Boolean',
83
+ :'displacement_mode' => :'String',
84
+ :'emergency_job_id' => :'String',
85
+ :'job' => :'JobRequestEmergencyInlineJob',
86
+ :'mode' => :'String',
87
+ :'start_at' => :'Time',
88
+ :'technician_id' => :'String'
89
+ }
90
+ end
91
+
92
+ # List of attributes with nullable: true
93
+ def self.openapi_nullable
94
+ Set.new([
95
+ ])
96
+ end
97
+
98
+ # Initializes the object
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ def initialize(attributes = {})
101
+ if (!attributes.is_a?(Hash))
102
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Crisphive::JobRequestEmergencyPreviewRequest` initialize method"
103
+ end
104
+
105
+ # check to see if the attribute exists and convert string to symbol for hash key
106
+ attributes = attributes.each_with_object({}) { |(k, v), h|
107
+ if (!self.class.attribute_map.key?(k.to_sym))
108
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Crisphive::JobRequestEmergencyPreviewRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
109
+ end
110
+ h[k.to_sym] = v
111
+ }
112
+
113
+ if attributes.key?(:'after_hours_override')
114
+ self.after_hours_override = attributes[:'after_hours_override']
115
+ end
116
+
117
+ if attributes.key?(:'displacement_mode')
118
+ self.displacement_mode = attributes[:'displacement_mode']
119
+ end
120
+
121
+ if attributes.key?(:'emergency_job_id')
122
+ self.emergency_job_id = attributes[:'emergency_job_id']
123
+ end
124
+
125
+ if attributes.key?(:'job')
126
+ self.job = attributes[:'job']
127
+ end
128
+
129
+ if attributes.key?(:'mode')
130
+ self.mode = attributes[:'mode']
131
+ else
132
+ self.mode = nil
133
+ end
134
+
135
+ if attributes.key?(:'start_at')
136
+ self.start_at = attributes[:'start_at']
137
+ else
138
+ self.start_at = nil
139
+ end
140
+
141
+ if attributes.key?(:'technician_id')
142
+ self.technician_id = attributes[:'technician_id']
143
+ else
144
+ self.technician_id = nil
145
+ end
146
+ end
147
+
148
+ # Show invalid properties with the reasons. Usually used together with valid?
149
+ # @return Array for valid properties with the reasons
150
+ def list_invalid_properties
151
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
152
+ invalid_properties = Array.new
153
+ if @mode.nil?
154
+ invalid_properties.push('invalid value for "mode", mode cannot be nil.')
155
+ end
156
+
157
+ if @start_at.nil?
158
+ invalid_properties.push('invalid value for "start_at", start_at cannot be nil.')
159
+ end
160
+
161
+ if @technician_id.nil?
162
+ invalid_properties.push('invalid value for "technician_id", technician_id cannot be nil.')
163
+ end
164
+
165
+ invalid_properties
166
+ end
167
+
168
+ # Check to see if the all the properties in the model are valid
169
+ # @return true if the model is valid
170
+ def valid?
171
+ warn '[DEPRECATED] the `valid?` method is obsolete'
172
+ displacement_mode_validator = EnumAttributeValidator.new('String', ["reschedule", "reassign"])
173
+ return false unless displacement_mode_validator.valid?(@displacement_mode)
174
+ return false if @mode.nil?
175
+ mode_validator = EnumAttributeValidator.new('String', ["overtime", "next_day"])
176
+ return false unless mode_validator.valid?(@mode)
177
+ return false if @start_at.nil?
178
+ return false if @technician_id.nil?
179
+ true
180
+ end
181
+
182
+ # Custom attribute writer method checking allowed values (enum).
183
+ # @param [Object] displacement_mode Object to be assigned
184
+ def displacement_mode=(displacement_mode)
185
+ validator = EnumAttributeValidator.new('String', ["reschedule", "reassign"])
186
+ unless validator.valid?(displacement_mode)
187
+ fail ArgumentError, "invalid value for \"displacement_mode\", must be one of #{validator.allowable_values}."
188
+ end
189
+ @displacement_mode = displacement_mode
190
+ end
191
+
192
+ # Custom attribute writer method checking allowed values (enum).
193
+ # @param [Object] mode Object to be assigned
194
+ def mode=(mode)
195
+ validator = EnumAttributeValidator.new('String', ["overtime", "next_day"])
196
+ unless validator.valid?(mode)
197
+ fail ArgumentError, "invalid value for \"mode\", must be one of #{validator.allowable_values}."
198
+ end
199
+ @mode = mode
200
+ end
201
+
202
+ # Checks equality by comparing each attribute.
203
+ # @param [Object] Object to be compared
204
+ def ==(o)
205
+ return true if self.equal?(o)
206
+ self.class == o.class &&
207
+ after_hours_override == o.after_hours_override &&
208
+ displacement_mode == o.displacement_mode &&
209
+ emergency_job_id == o.emergency_job_id &&
210
+ job == o.job &&
211
+ mode == o.mode &&
212
+ start_at == o.start_at &&
213
+ technician_id == o.technician_id
214
+ end
215
+
216
+ # @see the `==` method
217
+ # @param [Object] Object to be compared
218
+ def eql?(o)
219
+ self == o
220
+ end
221
+
222
+ # Calculates hash code according to all attributes.
223
+ # @return [Integer] Hash code
224
+ def hash
225
+ [after_hours_override, displacement_mode, emergency_job_id, job, mode, start_at, technician_id].hash
226
+ end
227
+
228
+ # Builds the object from hash
229
+ # @param [Hash] attributes Model attributes in the form of hash
230
+ # @return [Object] Returns the model itself
231
+ def self.build_from_hash(attributes)
232
+ return nil unless attributes.is_a?(Hash)
233
+ attributes = attributes.transform_keys(&:to_sym)
234
+ transformed_hash = {}
235
+ openapi_types.each_pair do |key, type|
236
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
237
+ transformed_hash["#{key}"] = nil
238
+ elsif type =~ /\AArray<(.*)>/i
239
+ # check to ensure the input is an array given that the attribute
240
+ # is documented as an array but the input is not
241
+ if attributes[attribute_map[key]].is_a?(Array)
242
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
243
+ end
244
+ elsif !attributes[attribute_map[key]].nil?
245
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
246
+ end
247
+ end
248
+ new(transformed_hash)
249
+ end
250
+
251
+ # Deserializes the data based on type
252
+ # @param string type Data type
253
+ # @param string value Value to be deserialized
254
+ # @return [Object] Deserialized data
255
+ def self._deserialize(type, value)
256
+ case type.to_sym
257
+ when :Time
258
+ Time.parse(value)
259
+ when :Date
260
+ Date.parse(value)
261
+ when :String
262
+ value.to_s
263
+ when :Integer
264
+ value.to_i
265
+ when :Float
266
+ value.to_f
267
+ when :Boolean
268
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
269
+ true
270
+ else
271
+ false
272
+ end
273
+ when :Object
274
+ # generic object (usually a Hash), return directly
275
+ value
276
+ when /\AArray<(?<inner_type>.+)>\z/
277
+ inner_type = Regexp.last_match[:inner_type]
278
+ value.map { |v| _deserialize(inner_type, v) }
279
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
280
+ k_type = Regexp.last_match[:k_type]
281
+ v_type = Regexp.last_match[:v_type]
282
+ {}.tap do |hash|
283
+ value.each do |k, v|
284
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
285
+ end
286
+ end
287
+ else # model
288
+ # models (e.g. Pet) or oneOf
289
+ klass = Crisphive.const_get(type)
290
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
291
+ end
292
+ end
293
+
294
+ # Returns the string representation of the object
295
+ # @return [String] String presentation of the object
296
+ def to_s
297
+ to_hash.to_s
298
+ end
299
+
300
+ # to_body is an alias to to_hash (backward compatibility)
301
+ # @return [Hash] Returns the object in the form of hash
302
+ def to_body
303
+ to_hash
304
+ end
305
+
306
+ # Returns the object in the form of hash
307
+ # @return [Hash] Returns the object in the form of hash
308
+ def to_hash
309
+ hash = {}
310
+ self.class.attribute_map.each_pair do |attr, param|
311
+ value = self.send(attr)
312
+ if value.nil?
313
+ is_nullable = self.class.openapi_nullable.include?(attr)
314
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
315
+ end
316
+
317
+ hash[param] = _to_hash(value)
318
+ end
319
+ hash
320
+ end
321
+
322
+ # Outputs non-array value in the form of hash
323
+ # For object, use to_hash. Otherwise, just return the value
324
+ # @param [Object] value Any valid value
325
+ # @return [Hash] Returns the value in the form of hash
326
+ def _to_hash(value)
327
+ if value.is_a?(Array)
328
+ value.compact.map { |v| _to_hash(v) }
329
+ elsif value.is_a?(Hash)
330
+ {}.tap do |hash|
331
+ value.each { |k, v| hash[k] = _to_hash(v) }
332
+ end
333
+ elsif value.respond_to? :to_hash
334
+ value.to_hash
335
+ else
336
+ value
337
+ end
338
+ end
339
+
340
+ end
341
+
342
+ end
@@ -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
 
@@ -67,7 +67,7 @@ module Crisphive
67
67
  # Attribute type mapping.
68
68
  def self.openapi_types
69
69
  {
70
- :'date' => :'Time',
70
+ :'date' => :'Date',
71
71
  :'end_minute' => :'Integer',
72
72
  :'period' => :'String',
73
73
  :'start_minute' => :'Integer'
@@ -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
 
@@ -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
 
@@ -37,7 +37,7 @@ module Crisphive
37
37
  # Attribute type mapping.
38
38
  def self.openapi_types
39
39
  {
40
- :'date' => :'Time',
40
+ :'date' => :'Date',
41
41
  :'periods' => :'Array<JobRequestJobDatePeriodRequest>'
42
42
  }
43
43
  end