crisphive 0.2.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 (107) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +98 -10
  3. data/lib/crisphive/api/business_skill_api.rb +348 -0
  4. data/lib/crisphive/api/customer_api.rb +7 -4
  5. data/lib/crisphive/api/job_request_business_api.rb +243 -27
  6. data/lib/crisphive/api/job_types_api.rb +208 -0
  7. data/lib/crisphive/api/permission_api.rb +79 -0
  8. data/lib/crisphive/api/service_area_api.rb +208 -0
  9. data/lib/crisphive/api/technician_api.rb +8 -8
  10. data/lib/crisphive/api/technician_time_off_api.rb +240 -0
  11. data/lib/crisphive/api/vehicle_api.rb +208 -0
  12. data/lib/crisphive/api/webhooks_api.rb +213 -0
  13. data/lib/crisphive/models/api_internal_techtimeoff_actions.rb +232 -0
  14. data/lib/crisphive/models/api_internal_techtimeoff_status.rb +42 -0
  15. data/lib/crisphive/models/assignable_group.rb +289 -0
  16. data/lib/crisphive/models/book_and_confirm_job_request200_response.rb +253 -0
  17. data/lib/crisphive/models/commit_absence_resolve200_response.rb +253 -0
  18. data/lib/crisphive/models/create_job_type200_response.rb +253 -0
  19. data/lib/crisphive/models/create_service_area200_response.rb +253 -0
  20. data/lib/crisphive/models/create_skill200_response.rb +253 -0
  21. data/lib/crisphive/models/create_skill_category200_response.rb +253 -0
  22. data/lib/crisphive/models/create_technician_time_off200_response.rb +253 -0
  23. data/lib/crisphive/models/create_vehicle200_response.rb +253 -0
  24. data/lib/crisphive/models/create_webhook_endpoint200_response.rb +253 -0
  25. data/lib/crisphive/models/customer.rb +11 -1
  26. data/lib/crisphive/models/customer_contact.rb +25 -5
  27. data/lib/crisphive/models/customer_create_request.rb +12 -2
  28. data/lib/crisphive/models/customer_list_item.rb +11 -1
  29. data/lib/crisphive/models/customer_quick_books_link.rb +235 -0
  30. data/lib/crisphive/models/customer_service_area_ref.rb +225 -0
  31. data/lib/crisphive/models/customer_technician_ref.rb +225 -0
  32. data/lib/crisphive/models/customer_update_request.rb +23 -20
  33. data/lib/crisphive/models/internal_jobrequest_http_address_req.rb +475 -0
  34. data/lib/crisphive/models/job_request.rb +11 -1
  35. data/lib/crisphive/models/job_request_absence_alternative.rb +356 -0
  36. data/lib/crisphive/models/job_request_absence_alternative_cost.rb +275 -0
  37. data/lib/crisphive/models/job_request_absence_assignment.rb +319 -0
  38. data/lib/crisphive/models/job_request_absence_commit_request.rb +296 -0
  39. data/lib/crisphive/models/job_request_absence_notification.rb +283 -0
  40. data/lib/crisphive/models/job_request_absence_plan.rb +322 -0
  41. data/lib/crisphive/models/job_request_absence_preview_request.rb +280 -0
  42. data/lib/crisphive/models/job_request_absence_resolved_job.rb +499 -0
  43. data/lib/crisphive/models/job_request_absence_solver.rb +289 -0
  44. data/lib/crisphive/models/job_request_absence_time_off.rb +281 -0
  45. data/lib/crisphive/models/job_request_absence_unresolved_job.rb +364 -0
  46. data/lib/crisphive/models/job_request_action_summary.rb +1 -1
  47. data/lib/crisphive/models/job_request_attention_summary.rb +2 -2
  48. data/lib/crisphive/models/job_request_blocker.rb +363 -0
  49. data/lib/crisphive/models/job_request_blocker_ref.rb +223 -0
  50. data/lib/crisphive/models/job_request_book_and_confirm_customer.rb +302 -0
  51. data/lib/crisphive/models/job_request_book_and_confirm_emergency.rb +315 -0
  52. data/lib/crisphive/models/job_request_book_and_confirm_emergency_result.rb +279 -0
  53. data/lib/crisphive/models/job_request_book_and_confirm_refusal.rb +280 -0
  54. data/lib/crisphive/models/job_request_book_and_confirm_request.rb +466 -0
  55. data/lib/crisphive/models/job_request_book_and_confirm_response.rb +295 -0
  56. data/lib/crisphive/models/job_request_confirm_request.rb +14 -4
  57. data/lib/crisphive/models/job_request_create_request.rb +1 -1
  58. data/lib/crisphive/models/job_request_emergency_candidate.rb +26 -4
  59. data/lib/crisphive/models/job_request_emergency_candidates.rb +1 -1
  60. data/lib/crisphive/models/job_request_emergency_candidates_request.rb +24 -11
  61. data/lib/crisphive/models/job_request_emergency_commit_request.rb +11 -1
  62. data/lib/crisphive/models/job_request_emergency_inline_job.rb +353 -0
  63. data/lib/crisphive/models/job_request_emergency_plan.rb +25 -3
  64. data/lib/crisphive/models/job_request_emergency_preview_request.rb +24 -11
  65. data/lib/crisphive/models/job_request_move_commit_req.rb +11 -1
  66. data/lib/crisphive/models/job_request_move_plan.rb +11 -1
  67. data/lib/crisphive/models/job_request_move_preview_req.rb +11 -1
  68. data/lib/crisphive/models/job_request_move_warning.rb +32 -8
  69. data/lib/crisphive/models/job_request_priority_update_result.rb +217 -0
  70. data/lib/crisphive/models/job_request_quote_request.rb +14 -11
  71. data/lib/crisphive/models/job_request_reassign_fallback.rb +287 -0
  72. data/lib/crisphive/models/job_request_skill_summary.rb +1 -1
  73. data/lib/crisphive/models/job_request_status_summary.rb +1 -1
  74. data/lib/crisphive/models/job_request_time_segments.rb +2 -2
  75. data/lib/crisphive/models/job_type.rb +42 -2
  76. data/lib/crisphive/models/job_type_create_request.rb +399 -0
  77. data/lib/crisphive/models/job_type_create_response.rb +215 -0
  78. data/lib/crisphive/models/job_type_update_request.rb +400 -0
  79. data/lib/crisphive/models/list_assignable_groups200_response.rb +255 -0
  80. data/lib/crisphive/models/list_technician_time_off200_response.rb +253 -0
  81. data/lib/crisphive/models/list_webhook_event_types200_response.rb +255 -0
  82. data/lib/crisphive/models/quote_job_request200_response.rb +253 -0
  83. data/lib/crisphive/models/service_area.rb +21 -1
  84. data/lib/crisphive/models/service_area_create_request.rb +455 -0
  85. data/lib/crisphive/models/service_area_create_response.rb +215 -0
  86. data/lib/crisphive/models/service_area_update_request.rb +451 -0
  87. data/lib/crisphive/models/skill_category_create_request.rb +270 -0
  88. data/lib/crisphive/models/skill_category_create_response.rb +215 -0
  89. data/lib/crisphive/models/skill_create_request.rb +270 -0
  90. data/lib/crisphive/models/skill_create_response.rb +215 -0
  91. data/lib/crisphive/models/skill_update_request.rb +281 -0
  92. data/lib/crisphive/models/technician.rb +64 -2
  93. data/lib/crisphive/models/technician_create_request.rb +14 -11
  94. data/lib/crisphive/models/technician_time_off.rb +334 -0
  95. data/lib/crisphive/models/technician_time_off_create_request.rb +285 -0
  96. data/lib/crisphive/models/technician_time_off_create_response.rb +215 -0
  97. data/lib/crisphive/models/technician_time_off_list.rb +246 -0
  98. data/lib/crisphive/models/technician_update_request.rb +2 -2
  99. data/lib/crisphive/models/vehicle_create_request.rb +420 -0
  100. data/lib/crisphive/models/vehicle_create_response.rb +215 -0
  101. data/lib/crisphive/models/vehicle_update_request.rb +440 -0
  102. data/lib/crisphive/models/webhook_create_request.rb +320 -0
  103. data/lib/crisphive/models/webhook_create_response.rb +391 -0
  104. data/lib/crisphive/models/webhook_verification.rb +235 -0
  105. data/lib/crisphive/version.rb +1 -1
  106. data/lib/crisphive.rb +66 -0
  107. metadata +68 -2
@@ -0,0 +1,281 @@
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 SkillUpdateRequest
18
+ # nil = keep; \"\" clears the description.
19
+ attr_accessor :description
20
+
21
+ attr_accessor :is_active
22
+
23
+ # nil = keep; min=1 rejects an explicit \"\".
24
+ attr_accessor :name
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'description' => :'description',
30
+ :'is_active' => :'is_active',
31
+ :'name' => :'name'
32
+ }
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'description' => :'String',
44
+ :'is_active' => :'Boolean',
45
+ :'name' => :'String'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Crisphive::SkillUpdateRequest` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Crisphive::SkillUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'description')
71
+ self.description = attributes[:'description']
72
+ end
73
+
74
+ if attributes.key?(:'is_active')
75
+ self.is_active = attributes[:'is_active']
76
+ end
77
+
78
+ if attributes.key?(:'name')
79
+ self.name = attributes[:'name']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if !@description.nil? && @description.to_s.length > 4000
89
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 4000.')
90
+ end
91
+
92
+ if !@name.nil? && @name.to_s.length > 200
93
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 200.')
94
+ end
95
+
96
+ if !@name.nil? && @name.to_s.length < 1
97
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
98
+ end
99
+
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ warn '[DEPRECATED] the `valid?` method is obsolete'
107
+ return false if !@description.nil? && @description.to_s.length > 4000
108
+ return false if !@name.nil? && @name.to_s.length > 200
109
+ return false if !@name.nil? && @name.to_s.length < 1
110
+ true
111
+ end
112
+
113
+ # Custom attribute writer method with validation
114
+ # @param [Object] description Value to be assigned
115
+ def description=(description)
116
+ if description.nil?
117
+ fail ArgumentError, 'description cannot be nil'
118
+ end
119
+
120
+ if description.to_s.length > 4000
121
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 4000.'
122
+ end
123
+
124
+ @description = description
125
+ end
126
+
127
+ # Custom attribute writer method with validation
128
+ # @param [Object] name Value to be assigned
129
+ def name=(name)
130
+ if name.nil?
131
+ fail ArgumentError, 'name cannot be nil'
132
+ end
133
+
134
+ if name.to_s.length > 200
135
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 200.'
136
+ end
137
+
138
+ if name.to_s.length < 1
139
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
140
+ end
141
+
142
+ @name = name
143
+ end
144
+
145
+ # Checks equality by comparing each attribute.
146
+ # @param [Object] Object to be compared
147
+ def ==(o)
148
+ return true if self.equal?(o)
149
+ self.class == o.class &&
150
+ description == o.description &&
151
+ is_active == o.is_active &&
152
+ name == o.name
153
+ end
154
+
155
+ # @see the `==` method
156
+ # @param [Object] Object to be compared
157
+ def eql?(o)
158
+ self == o
159
+ end
160
+
161
+ # Calculates hash code according to all attributes.
162
+ # @return [Integer] Hash code
163
+ def hash
164
+ [description, is_active, name].hash
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def self.build_from_hash(attributes)
171
+ return nil unless attributes.is_a?(Hash)
172
+ attributes = attributes.transform_keys(&:to_sym)
173
+ transformed_hash = {}
174
+ openapi_types.each_pair do |key, type|
175
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
176
+ transformed_hash["#{key}"] = nil
177
+ elsif type =~ /\AArray<(.*)>/i
178
+ # check to ensure the input is an array given that the attribute
179
+ # is documented as an array but the input is not
180
+ if attributes[attribute_map[key]].is_a?(Array)
181
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
182
+ end
183
+ elsif !attributes[attribute_map[key]].nil?
184
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
185
+ end
186
+ end
187
+ new(transformed_hash)
188
+ end
189
+
190
+ # Deserializes the data based on type
191
+ # @param string type Data type
192
+ # @param string value Value to be deserialized
193
+ # @return [Object] Deserialized data
194
+ def self._deserialize(type, value)
195
+ case type.to_sym
196
+ when :Time
197
+ Time.parse(value)
198
+ when :Date
199
+ Date.parse(value)
200
+ when :String
201
+ value.to_s
202
+ when :Integer
203
+ value.to_i
204
+ when :Float
205
+ value.to_f
206
+ when :Boolean
207
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
208
+ true
209
+ else
210
+ false
211
+ end
212
+ when :Object
213
+ # generic object (usually a Hash), return directly
214
+ value
215
+ when /\AArray<(?<inner_type>.+)>\z/
216
+ inner_type = Regexp.last_match[:inner_type]
217
+ value.map { |v| _deserialize(inner_type, v) }
218
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
219
+ k_type = Regexp.last_match[:k_type]
220
+ v_type = Regexp.last_match[:v_type]
221
+ {}.tap do |hash|
222
+ value.each do |k, v|
223
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
224
+ end
225
+ end
226
+ else # model
227
+ # models (e.g. Pet) or oneOf
228
+ klass = Crisphive.const_get(type)
229
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
230
+ end
231
+ end
232
+
233
+ # Returns the string representation of the object
234
+ # @return [String] String presentation of the object
235
+ def to_s
236
+ to_hash.to_s
237
+ end
238
+
239
+ # to_body is an alias to to_hash (backward compatibility)
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_body
242
+ to_hash
243
+ end
244
+
245
+ # Returns the object in the form of hash
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_hash
248
+ hash = {}
249
+ self.class.attribute_map.each_pair do |attr, param|
250
+ value = self.send(attr)
251
+ if value.nil?
252
+ is_nullable = self.class.openapi_nullable.include?(attr)
253
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
254
+ end
255
+
256
+ hash[param] = _to_hash(value)
257
+ end
258
+ hash
259
+ end
260
+
261
+ # Outputs non-array value in the form of hash
262
+ # For object, use to_hash. Otherwise, just return the value
263
+ # @param [Object] value Any valid value
264
+ # @return [Hash] Returns the value in the form of hash
265
+ def _to_hash(value)
266
+ if value.is_a?(Array)
267
+ value.compact.map { |v| _to_hash(v) }
268
+ elsif value.is_a?(Hash)
269
+ {}.tap do |hash|
270
+ value.each { |k, v| hash[k] = _to_hash(v) }
271
+ end
272
+ elsif value.respond_to? :to_hash
273
+ value.to_hash
274
+ else
275
+ value
276
+ end
277
+ end
278
+
279
+ end
280
+
281
+ end
@@ -30,6 +30,15 @@ module Crisphive
30
30
  # UUID of the business this technician belongs to.
31
31
  attr_accessor :business_id
32
32
 
33
+ # Precomputed deadline for the single calendar-connect nudge -- CalendarRequestedAt plus the sweep's three-day window -- so the dashboard never has to add three days and guess (the `is_fallback` / `token_stale` convention: the server computes the table state). Omitted, never null, whenever nothing is due: never requested, or already nudged.
34
+ attr_accessor :calendar_nudge_due_at
35
+
36
+ # Set (RFC3339) once the one-time unanswered-request reminder has been sent (calendarsync.nudge_sweep); omitted otherwise -- either because the technician answered, or because the three-day window has not elapsed yet. The sweep never nudges twice.
37
+ attr_accessor :calendar_nudged_at
38
+
39
+ # Set (RFC3339) when the business asked this technician to connect a personal calendar (calendarsync's invite flow, CALENDAR_SYNC_DESIGN.md §5); omitted if never asked. This is the ONLY surface that reports it for a technician who has not yet connected -- calendarsync's own connections list has no row for them at all.
40
+ attr_accessor :calendar_requested_at
41
+
33
42
  # When the technician record was created (RFC3339).
34
43
  attr_accessor :created_at
35
44
 
@@ -57,12 +66,18 @@ module Crisphive
57
66
  # Leads this technician is a buddy of (id + name).
58
67
  attr_accessor :leads
59
68
 
69
+ # Set (RFC3339) only when the member RESIGNED themselves; null otherwise. It is what separates the two meanings of `status: \"deactive\"`: with `left_at` set the member chose to leave (\"Đã nghỉ việc\"), with it null the business suspended them (\"Tạm khoá\"). Render them differently — the roster otherwise shows somebody who resigned exactly like somebody who was disciplined. Cleared when they are reactivated.
70
+ attr_accessor :left_at
71
+
60
72
  # Phone number in the form it was supplied; null if not set.
61
73
  attr_accessor :phone
62
74
 
63
- # Resolved role/group name (e.g. \"Technician\", \"Owner\").
75
+ # Resolved role/group name, localized to the request locale (e.g. \"Technician\", \"기술자\").
64
76
  attr_accessor :role
65
77
 
78
+ # Stable machine key of the role for SYSTEM groups; empty for custom (business-authored) groups. Compare role-specific client behavior against THIS, never against the localized role name.
79
+ attr_accessor :role_key
80
+
66
81
  # Service areas this technician is assigned to (id + name).
67
82
  attr_accessor :service_areas
68
83
 
@@ -117,6 +132,9 @@ module Crisphive
117
132
  :'buddy_ids' => :'buddy_ids',
118
133
  :'business_group_id' => :'business_group_id',
119
134
  :'business_id' => :'business_id',
135
+ :'calendar_nudge_due_at' => :'calendar_nudge_due_at',
136
+ :'calendar_nudged_at' => :'calendar_nudged_at',
137
+ :'calendar_requested_at' => :'calendar_requested_at',
120
138
  :'created_at' => :'created_at',
121
139
  :'deleted_at' => :'deleted_at',
122
140
  :'email' => :'email',
@@ -126,8 +144,10 @@ module Crisphive
126
144
  :'join_date' => :'join_date',
127
145
  :'last_login_at' => :'last_login_at',
128
146
  :'leads' => :'leads',
147
+ :'left_at' => :'left_at',
129
148
  :'phone' => :'phone',
130
149
  :'role' => :'role',
150
+ :'role_key' => :'role_key',
131
151
  :'service_areas' => :'service_areas',
132
152
  :'start_location_lat' => :'start_location_lat',
133
153
  :'start_location_long' => :'start_location_long',
@@ -152,6 +172,9 @@ module Crisphive
152
172
  :'buddy_ids' => :'Array<String>',
153
173
  :'business_group_id' => :'String',
154
174
  :'business_id' => :'String',
175
+ :'calendar_nudge_due_at' => :'Time',
176
+ :'calendar_nudged_at' => :'Time',
177
+ :'calendar_requested_at' => :'Time',
155
178
  :'created_at' => :'Time',
156
179
  :'deleted_at' => :'Time',
157
180
  :'email' => :'String',
@@ -161,8 +184,10 @@ module Crisphive
161
184
  :'join_date' => :'Date',
162
185
  :'last_login_at' => :'Time',
163
186
  :'leads' => :'Array<TechnicianLeadRef>',
187
+ :'left_at' => :'Time',
164
188
  :'phone' => :'String',
165
189
  :'role' => :'String',
190
+ :'role_key' => :'String',
166
191
  :'service_areas' => :'Array<TechnicianServiceAreaRef>',
167
192
  :'start_location_lat' => :'Float',
168
193
  :'start_location_long' => :'Float',
@@ -217,6 +242,18 @@ module Crisphive
217
242
  self.business_id = attributes[:'business_id']
218
243
  end
219
244
 
245
+ if attributes.key?(:'calendar_nudge_due_at')
246
+ self.calendar_nudge_due_at = attributes[:'calendar_nudge_due_at']
247
+ end
248
+
249
+ if attributes.key?(:'calendar_nudged_at')
250
+ self.calendar_nudged_at = attributes[:'calendar_nudged_at']
251
+ end
252
+
253
+ if attributes.key?(:'calendar_requested_at')
254
+ self.calendar_requested_at = attributes[:'calendar_requested_at']
255
+ end
256
+
220
257
  if attributes.key?(:'created_at')
221
258
  self.created_at = attributes[:'created_at']
222
259
  end
@@ -255,6 +292,10 @@ module Crisphive
255
292
  end
256
293
  end
257
294
 
295
+ if attributes.key?(:'left_at')
296
+ self.left_at = attributes[:'left_at']
297
+ end
298
+
258
299
  if attributes.key?(:'phone')
259
300
  self.phone = attributes[:'phone']
260
301
  end
@@ -263,6 +304,10 @@ module Crisphive
263
304
  self.role = attributes[:'role']
264
305
  end
265
306
 
307
+ if attributes.key?(:'role_key')
308
+ self.role_key = attributes[:'role_key']
309
+ end
310
+
266
311
  if attributes.key?(:'service_areas')
267
312
  if (value = attributes[:'service_areas']).is_a?(Array)
268
313
  self.service_areas = value
@@ -314,6 +359,8 @@ module Crisphive
314
359
  warn '[DEPRECATED] the `valid?` method is obsolete'
315
360
  assignment_tier_validator = EnumAttributeValidator.new('String', ["lead", "buddy", "float"])
316
361
  return false unless assignment_tier_validator.valid?(@assignment_tier)
362
+ role_key_validator = EnumAttributeValidator.new('String', ["owner", "administrator", "booking_coordinator", "supervisor", "technician"])
363
+ return false unless role_key_validator.valid?(@role_key)
317
364
  start_location_type_validator = EnumAttributeValidator.new('String', ["home", "office"])
318
365
  return false unless start_location_type_validator.valid?(@start_location_type)
319
366
  true
@@ -329,6 +376,16 @@ module Crisphive
329
376
  @assignment_tier = assignment_tier
330
377
  end
331
378
 
379
+ # Custom attribute writer method checking allowed values (enum).
380
+ # @param [Object] role_key Object to be assigned
381
+ def role_key=(role_key)
382
+ validator = EnumAttributeValidator.new('String', ["owner", "administrator", "booking_coordinator", "supervisor", "technician"])
383
+ unless validator.valid?(role_key)
384
+ fail ArgumentError, "invalid value for \"role_key\", must be one of #{validator.allowable_values}."
385
+ end
386
+ @role_key = role_key
387
+ end
388
+
332
389
  # Custom attribute writer method checking allowed values (enum).
333
390
  # @param [Object] start_location_type Object to be assigned
334
391
  def start_location_type=(start_location_type)
@@ -349,6 +406,9 @@ module Crisphive
349
406
  buddy_ids == o.buddy_ids &&
350
407
  business_group_id == o.business_group_id &&
351
408
  business_id == o.business_id &&
409
+ calendar_nudge_due_at == o.calendar_nudge_due_at &&
410
+ calendar_nudged_at == o.calendar_nudged_at &&
411
+ calendar_requested_at == o.calendar_requested_at &&
352
412
  created_at == o.created_at &&
353
413
  deleted_at == o.deleted_at &&
354
414
  email == o.email &&
@@ -358,8 +418,10 @@ module Crisphive
358
418
  join_date == o.join_date &&
359
419
  last_login_at == o.last_login_at &&
360
420
  leads == o.leads &&
421
+ left_at == o.left_at &&
361
422
  phone == o.phone &&
362
423
  role == o.role &&
424
+ role_key == o.role_key &&
363
425
  service_areas == o.service_areas &&
364
426
  start_location_lat == o.start_location_lat &&
365
427
  start_location_long == o.start_location_long &&
@@ -379,7 +441,7 @@ module Crisphive
379
441
  # Calculates hash code according to all attributes.
380
442
  # @return [Integer] Hash code
381
443
  def hash
382
- [address, assignment_tier, buddy_ids, business_group_id, business_id, created_at, deleted_at, email, full_name, id, job_title, join_date, last_login_at, leads, phone, role, service_areas, start_location_lat, start_location_long, start_location_type, status, updated_at, user_id, vehicle_ids].hash
444
+ [address, assignment_tier, buddy_ids, business_group_id, business_id, calendar_nudge_due_at, calendar_nudged_at, calendar_requested_at, created_at, deleted_at, email, full_name, id, job_title, join_date, last_login_at, leads, left_at, phone, role, role_key, service_areas, start_location_lat, start_location_long, start_location_type, status, updated_at, user_id, vehicle_ids].hash
383
445
  end
384
446
 
385
447
  # Builds the object from hash
@@ -18,13 +18,13 @@ module Crisphive
18
18
  # Home address (the day-start point when start_location_type=home).
19
19
  attr_accessor :address
20
20
 
21
- # Crew tier the matching engine assigns by: lead (can head a job), buddy (crew helper), float (excluded from auto crew-assign).
21
+ # Crew tier the matching engine assigns by: lead (can head a job), buddy (crew helper), float (excluded from auto crew-assign). IGNORED — stored empty, no error — when the role is Booking Coordinator, Administrator or Viewer: office roles are never assigned jobs. Technician, Owner, Supervisor and custom roles keep the tier.
22
22
  attr_accessor :assignment_tier
23
23
 
24
24
  # Buddies of this technician (set when creating a lead). Optional; max 50 technician ids.
25
25
  attr_accessor :buddy_ids
26
26
 
27
- # Role group for the new member. Discover IDs via GET /permission/groups (Owner/Administrator groups are rejected in sandbox mode).
27
+ # Role group for the new member. Optional: omitted or empty assigns the business's Technician group. To assign another group, copy its ID from the dashboard (Settings → Permissions) or from an existing member's `business_group_id`. Owner/Administrator groups are rejected in sandbox mode and for API-key callers.
28
28
  attr_accessor :business_group_id
29
29
 
30
30
  # Email address. At least one of phone/email is required (identity resolution key).
@@ -42,7 +42,10 @@ module Crisphive
42
42
  # Leads this technician is a buddy of (set when creating a buddy; the technician is appended to each lead's buddy list). Optional; max 50 technician ids.
43
43
  attr_accessor :lead_ids
44
44
 
45
- # At least one of phone/email is required (identity resolution key).
45
+ # Whether to send the new member the \"you have been added to {business}\" message (email when an email was supplied, SMS when a phone was, both when both). Omitted or true sends it; false stays silent. Set false for bulk imports so seeding a roster does not text everybody at once.
46
+ attr_accessor :notify
47
+
48
+ # Phone number in E.164 international format: a leading `+` and the country code, e.g. `+16135550188`. A bare national number (`6135550188`) is REJECTED with PHONE_INVALID — there is no default region to guess the country from. At least one of phone/email is required (identity resolution key).
46
49
  attr_accessor :phone
47
50
 
48
51
  # Service areas to assign the technician to. Optional; max 50. Discover via GET /service-areas.
@@ -91,6 +94,7 @@ module Crisphive
91
94
  :'job_title' => :'job_title',
92
95
  :'join_date' => :'join_date',
93
96
  :'lead_ids' => :'lead_ids',
97
+ :'notify' => :'notify',
94
98
  :'phone' => :'phone',
95
99
  :'service_area_ids' => :'service_area_ids',
96
100
  :'start_location_lat' => :'start_location_lat',
@@ -116,6 +120,7 @@ module Crisphive
116
120
  :'job_title' => :'String',
117
121
  :'join_date' => :'Date',
118
122
  :'lead_ids' => :'Array<String>',
123
+ :'notify' => :'Boolean',
119
124
  :'phone' => :'String',
120
125
  :'service_area_ids' => :'Array<String>',
121
126
  :'start_location_lat' => :'Float',
@@ -161,8 +166,6 @@ module Crisphive
161
166
 
162
167
  if attributes.key?(:'business_group_id')
163
168
  self.business_group_id = attributes[:'business_group_id']
164
- else
165
- self.business_group_id = nil
166
169
  end
167
170
 
168
171
  if attributes.key?(:'email')
@@ -189,6 +192,10 @@ module Crisphive
189
192
  end
190
193
  end
191
194
 
195
+ if attributes.key?(:'notify')
196
+ self.notify = attributes[:'notify']
197
+ end
198
+
192
199
  if attributes.key?(:'phone')
193
200
  self.phone = attributes[:'phone']
194
201
  end
@@ -221,10 +228,6 @@ module Crisphive
221
228
  invalid_properties.push('invalid value for "buddy_ids", number of items must be less than or equal to 50.')
222
229
  end
223
230
 
224
- if @business_group_id.nil?
225
- invalid_properties.push('invalid value for "business_group_id", business_group_id cannot be nil.')
226
- end
227
-
228
231
  if !@email.nil? && @email.to_s.length > 255
229
232
  invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 255.')
230
233
  end
@@ -279,7 +282,6 @@ module Crisphive
279
282
  assignment_tier_validator = EnumAttributeValidator.new('String', ["lead", "buddy", "float"])
280
283
  return false unless assignment_tier_validator.valid?(@assignment_tier)
281
284
  return false if !@buddy_ids.nil? && @buddy_ids.length > 50
282
- return false if @business_group_id.nil?
283
285
  return false if !@email.nil? && @email.to_s.length > 255
284
286
  return false if @full_name.nil?
285
287
  return false if @full_name.to_s.length > 255
@@ -464,6 +466,7 @@ module Crisphive
464
466
  job_title == o.job_title &&
465
467
  join_date == o.join_date &&
466
468
  lead_ids == o.lead_ids &&
469
+ notify == o.notify &&
467
470
  phone == o.phone &&
468
471
  service_area_ids == o.service_area_ids &&
469
472
  start_location_lat == o.start_location_lat &&
@@ -480,7 +483,7 @@ module Crisphive
480
483
  # Calculates hash code according to all attributes.
481
484
  # @return [Integer] Hash code
482
485
  def hash
483
- [address, assignment_tier, buddy_ids, business_group_id, email, full_name, job_title, join_date, lead_ids, phone, service_area_ids, start_location_lat, start_location_long, start_location_type].hash
486
+ [address, assignment_tier, buddy_ids, business_group_id, email, full_name, job_title, join_date, lead_ids, notify, phone, service_area_ids, start_location_lat, start_location_long, start_location_type].hash
484
487
  end
485
488
 
486
489
  # Builds the object from hash