Class: Propertyware::WorkOrdersApi

Inherits:
Object
  • Object
show all
Defined in:
lib/propertyware/api/work_orders_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ WorkOrdersApi

Returns a new instance of WorkOrdersApi.



19
20
21
# File 'lib/propertyware/api/work_orders_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/propertyware/api/work_orders_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_work_order(save_work_order, opts = {}) ⇒ WorkOrder

Create a work order (BETA) <p class="betaError">Note: Write access is only available to customers who have opted in to our beta program. Please reach out to support if you’d like to be included.</p> Creates a work order.<br/><br/>Required permission:<br/><span class="permissionBlock">WORK ORDERS</span> - Write

Parameters:

  • save_work_order (SaveWorkOrder)

    saveWorkOrder

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/propertyware/api/work_orders_api.rb', line 27

def create_work_order(save_work_order, opts = {})
  data, _status_code, _headers = create_work_order_with_http_info(save_work_order, opts)
  data
end

#create_work_order_task(work_order_id, save_work_order_task, opts = {}) ⇒ Task

Create a task to workOrder (BETA) <p class="betaError">Note: Write access is only available to customers who have opted in to our beta program. Please reach out to support if you’d like to be included.</p> Create a task to an workOrder.<br/><br/>Required permission:<br/><span class="permissionBlock">WORK ORDERS</span> - Write

Parameters:

  • work_order_id (Integer)

    Work Order ID

  • save_work_order_task (SaveWorkOrderTask)

    saveWorkOrderTask

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



96
97
98
99
# File 'lib/propertyware/api/work_orders_api.rb', line 96

def create_work_order_task(work_order_id, save_work_order_task, opts = {})
  data, _status_code, _headers = create_work_order_task_with_http_info(work_order_id, save_work_order_task, opts)
  data
end

#create_work_order_task_with_http_info(work_order_id, save_work_order_task, opts = {}) ⇒ Array<(Task, Integer, Hash)>

Create a task to workOrder (BETA) &lt;p class&#x3D;&quot;betaError&quot;&gt;&lt;b&gt;Note: &lt;/b&gt;Write access is only available to customers who have opted in to our beta program. Please reach out to support if you&#39;d like to be included.&lt;/p&gt; Create a task to an workOrder.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Required permission:&lt;/b&gt;&lt;br/&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;WORK ORDERS&lt;/span&gt; - &lt;code&gt;Write&lt;/code&gt;

Parameters:

  • work_order_id (Integer)

    Work Order ID

  • save_work_order_task (SaveWorkOrderTask)

    saveWorkOrderTask

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Task, Integer, Hash)>)

    Task data, response status code and response headers



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/propertyware/api/work_orders_api.rb', line 107

def create_work_order_task_with_http_info(work_order_id, save_work_order_task, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkOrdersApi.create_work_order_task ...'
  end
  # verify the required parameter 'work_order_id' is set
  if @api_client.config.client_side_validation && work_order_id.nil?
    fail ArgumentError, "Missing the required parameter 'work_order_id' when calling WorkOrdersApi.create_work_order_task"
  end
  # verify the required parameter 'save_work_order_task' is set
  if @api_client.config.client_side_validation && save_work_order_task.nil?
    fail ArgumentError, "Missing the required parameter 'save_work_order_task' when calling WorkOrdersApi.create_work_order_task"
  end
  # resource path
  local_var_path = '/workorders/{workOrderId}/tasks'.sub('{' + 'workOrderId' + '}', CGI.escape(work_order_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(save_work_order_task)

  # return_type
  return_type = opts[:debug_return_type] || 'Task'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['organizationId', 'clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"WorkOrdersApi.create_work_order_task",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkOrdersApi#create_work_order_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_work_order_with_http_info(save_work_order, opts = {}) ⇒ Array<(WorkOrder, Integer, Hash)>

Create a work order (BETA) &lt;p class&#x3D;&quot;betaError&quot;&gt;&lt;b&gt;Note: &lt;/b&gt;Write access is only available to customers who have opted in to our beta program. Please reach out to support if you&#39;d like to be included.&lt;/p&gt; Creates a work order.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Required permission:&lt;/b&gt;&lt;br/&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;WORK ORDERS&lt;/span&gt; - &lt;code&gt;Write&lt;/code&gt;

Parameters:

  • save_work_order (SaveWorkOrder)

    saveWorkOrder

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(WorkOrder, Integer, Hash)>)

    WorkOrder data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/propertyware/api/work_orders_api.rb', line 37

def create_work_order_with_http_info(save_work_order, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkOrdersApi.create_work_order ...'
  end
  # verify the required parameter 'save_work_order' is set
  if @api_client.config.client_side_validation && save_work_order.nil?
    fail ArgumentError, "Missing the required parameter 'save_work_order' when calling WorkOrdersApi.create_work_order"
  end
  # resource path
  local_var_path = '/workorders'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(save_work_order)

  # return_type
  return_type = opts[:debug_return_type] || 'WorkOrder'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['organizationId', 'clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"WorkOrdersApi.create_work_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkOrdersApi#create_work_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_work_orders(save_work_order, opts = {}) ⇒ Array<RESTAPIBulkSuccessResponse>

Create work orders in bulk (BETA) <p class="betaError">Note: Write access is only available to customers who have opted in to our beta program. Please reach out to support if you’d like to be included.</p> Creates word orders in bulk.<br/><br/>Required permission:<br/><span class="permissionBlock">WORK ORDERS</span> - Write

Parameters:

  • save_work_order (Array<SaveWorkOrder>)

    saveWorkOrder

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



169
170
171
172
# File 'lib/propertyware/api/work_orders_api.rb', line 169

def create_work_orders(save_work_order, opts = {})
  data, _status_code, _headers = create_work_orders_with_http_info(save_work_order, opts)
  data
end

#create_work_orders_with_http_info(save_work_order, opts = {}) ⇒ Array<(Array<RESTAPIBulkSuccessResponse>, Integer, Hash)>

Create work orders in bulk (BETA) &lt;p class&#x3D;&quot;betaError&quot;&gt;&lt;b&gt;Note: &lt;/b&gt;Write access is only available to customers who have opted in to our beta program. Please reach out to support if you&#39;d like to be included.&lt;/p&gt; Creates word orders in bulk.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Required permission:&lt;/b&gt;&lt;br/&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;WORK ORDERS&lt;/span&gt; - &lt;code&gt;Write&lt;/code&gt;

Parameters:

  • save_work_order (Array<SaveWorkOrder>)

    saveWorkOrder

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<RESTAPIBulkSuccessResponse>, Integer, Hash)>)

    Array<RESTAPIBulkSuccessResponse> data, response status code and response headers



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/propertyware/api/work_orders_api.rb', line 179

def create_work_orders_with_http_info(save_work_order, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkOrdersApi.create_work_orders ...'
  end
  # verify the required parameter 'save_work_order' is set
  if @api_client.config.client_side_validation && save_work_order.nil?
    fail ArgumentError, "Missing the required parameter 'save_work_order' when calling WorkOrdersApi.create_work_orders"
  end
  # resource path
  local_var_path = '/workorders/bulk'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(save_work_order)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<RESTAPIBulkSuccessResponse>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['organizationId', 'clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"WorkOrdersApi.create_work_orders",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkOrdersApi#create_work_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_work_order(work_order_id, opts = {}) ⇒ ResponseEntity

Delete a Work Order (BETA) <p class="betaError">Note: Write access is only available to customers who have opted in to our beta program. Please reach out to support if you’d like to be included.</p> Delete a Work Order.<br/><br/>Required permission:<br/><span class="permissionBlock">WORK ORDERS</span> - Delete

Parameters:

  • work_order_id (Integer)

    Work Order ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



237
238
239
240
# File 'lib/propertyware/api/work_orders_api.rb', line 237

def delete_work_order(work_order_id, opts = {})
  data, _status_code, _headers = delete_work_order_with_http_info(work_order_id, opts)
  data
end

#delete_work_order_task(work_order_id, task_id, opts = {}) ⇒ ResponseEntity

Delete a work order task (BETA) <p class="betaError">Note: Write access is only available to customers who have opted in to our beta program. Please reach out to support if you’d like to be included.</p> Deletes a specific work order task.<br/><br/>Required permission:<br/><span class="permissionBlock">WORK ORDERS</span> - Delete

Parameters:

  • work_order_id (Integer)

    Work Order ID

  • task_id (Integer)

    Task ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



301
302
303
304
# File 'lib/propertyware/api/work_orders_api.rb', line 301

def delete_work_order_task(work_order_id, task_id, opts = {})
  data, _status_code, _headers = delete_work_order_task_with_http_info(work_order_id, task_id, opts)
  data
end

#delete_work_order_task_with_http_info(work_order_id, task_id, opts = {}) ⇒ Array<(ResponseEntity, Integer, Hash)>

Delete a work order task (BETA) &lt;p class&#x3D;&quot;betaError&quot;&gt;&lt;b&gt;Note: &lt;/b&gt;Write access is only available to customers who have opted in to our beta program. Please reach out to support if you&#39;d like to be included.&lt;/p&gt; Deletes a specific work order task.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Required permission:&lt;/b&gt;&lt;br/&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;WORK ORDERS&lt;/span&gt; - &lt;code&gt;Delete&lt;/code&gt;

Parameters:

  • work_order_id (Integer)

    Work Order ID

  • task_id (Integer)

    Task ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ResponseEntity, Integer, Hash)>)

    ResponseEntity data, response status code and response headers



312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/propertyware/api/work_orders_api.rb', line 312

def delete_work_order_task_with_http_info(work_order_id, task_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkOrdersApi.delete_work_order_task ...'
  end
  # verify the required parameter 'work_order_id' is set
  if @api_client.config.client_side_validation && work_order_id.nil?
    fail ArgumentError, "Missing the required parameter 'work_order_id' when calling WorkOrdersApi.delete_work_order_task"
  end
  # verify the required parameter 'task_id' is set
  if @api_client.config.client_side_validation && task_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_id' when calling WorkOrdersApi.delete_work_order_task"
  end
  # resource path
  local_var_path = '/workorders/{workOrderID}/tasks/{taskID}'.sub('{' + 'workOrderID' + '}', CGI.escape(work_order_id.to_s)).sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ResponseEntity'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['organizationId', 'clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"WorkOrdersApi.delete_work_order_task",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkOrdersApi#delete_work_order_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_work_order_with_http_info(work_order_id, opts = {}) ⇒ Array<(ResponseEntity, Integer, Hash)>

Delete a Work Order (BETA) &lt;p class&#x3D;&quot;betaError&quot;&gt;&lt;b&gt;Note: &lt;/b&gt;Write access is only available to customers who have opted in to our beta program. Please reach out to support if you&#39;d like to be included.&lt;/p&gt; Delete a Work Order.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Required permission:&lt;/b&gt;&lt;br/&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;WORK ORDERS&lt;/span&gt; - &lt;code&gt;Delete&lt;/code&gt;

Parameters:

  • work_order_id (Integer)

    Work Order ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ResponseEntity, Integer, Hash)>)

    ResponseEntity data, response status code and response headers



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/propertyware/api/work_orders_api.rb', line 247

def delete_work_order_with_http_info(work_order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkOrdersApi.delete_work_order ...'
  end
  # verify the required parameter 'work_order_id' is set
  if @api_client.config.client_side_validation && work_order_id.nil?
    fail ArgumentError, "Missing the required parameter 'work_order_id' when calling WorkOrdersApi.delete_work_order"
  end
  # resource path
  local_var_path = '/workorders/{workOrderID}'.sub('{' + 'workOrderID' + '}', CGI.escape(work_order_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ResponseEntity'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['organizationId', 'clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"WorkOrdersApi.delete_work_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkOrdersApi#delete_work_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_work_order(work_order_id, opts = {}) ⇒ WorkOrder

Retrieve a work order Retrieves a specific work order.<br/><br/>Required permission:<br/><span class="permissionBlock">WORK ORDERS</span> - Read

Parameters:

  • work_order_id (Integer)

    Work Order ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_custom_fields (Boolean)

    includeCustomFields (default to true)

Returns:



370
371
372
373
# File 'lib/propertyware/api/work_orders_api.rb', line 370

def get_work_order(work_order_id, opts = {})
  data, _status_code, _headers = get_work_order_with_http_info(work_order_id, opts)
  data
end

#get_work_order_task(work_order_id, task_id, opts = {}) ⇒ Array<Task>

Retrieve a work order task Retrieves a specific work order task.<br/><br/>Required permission:<br/><span class="permissionBlock">WORK ORDERS</span> - Read

Parameters:

  • work_order_id (Integer)

    Work Order ID

  • task_id (Integer)

    Task ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



436
437
438
439
# File 'lib/propertyware/api/work_orders_api.rb', line 436

def get_work_order_task(work_order_id, task_id, opts = {})
  data, _status_code, _headers = get_work_order_task_with_http_info(work_order_id, task_id, opts)
  data
end

#get_work_order_task_with_http_info(work_order_id, task_id, opts = {}) ⇒ Array<(Array<Task>, Integer, Hash)>

Retrieve a work order task Retrieves a specific work order task.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Required permission:&lt;/b&gt;&lt;br/&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;WORK ORDERS&lt;/span&gt; - &lt;code&gt;Read&lt;/code&gt;

Parameters:

  • work_order_id (Integer)

    Work Order ID

  • task_id (Integer)

    Task ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<Task>, Integer, Hash)>)

    Array<Task> data, response status code and response headers



447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
# File 'lib/propertyware/api/work_orders_api.rb', line 447

def get_work_order_task_with_http_info(work_order_id, task_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkOrdersApi.get_work_order_task ...'
  end
  # verify the required parameter 'work_order_id' is set
  if @api_client.config.client_side_validation && work_order_id.nil?
    fail ArgumentError, "Missing the required parameter 'work_order_id' when calling WorkOrdersApi.get_work_order_task"
  end
  # verify the required parameter 'task_id' is set
  if @api_client.config.client_side_validation && task_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_id' when calling WorkOrdersApi.get_work_order_task"
  end
  # resource path
  local_var_path = '/workorders/{workOrderID}/tasks/{taskID}'.sub('{' + 'workOrderID' + '}', CGI.escape(work_order_id.to_s)).sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<Task>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['organizationId', 'clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"WorkOrdersApi.get_work_order_task",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkOrdersApi#get_work_order_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_work_order_tasks(work_order_id, opts = {}) ⇒ Array<Task>

Retrieve all work order tasks Retrieves a list of work order tasks.<br/><br/>Required permission:<br/><span class="permissionBlock">WORK ORDERS</span> - Read <br/><br/>Sortable by: createddate, lastmodifieddatetime, id

Parameters:

  • work_order_id (Integer)

    Work Order ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    &#x60;offset&#x60; indicates the position of the first record to return. The offset is zero-based and the default is 0.

  • :limit (Integer)

    &#x60;limit&#x60; indicates the maximum number of results to be returned in the response. &#x60;limit&#x60; can range between 1 and 500 and the default is 100. (default to 100)

  • :last_modified_date_time_start (Time)

    Filters results to any item modified on or after the date time specified.

  • :last_modified_date_time_end (Time)

    Filters results to any item modified on or prior to the date time specified.

  • :orderby (String)

    Indicates the field(s) and direction to sort the results in the response.

  • :due_date (Date)

    Filters results by due day.

  • :completed (Boolean)

    Filters results by task status.

Returns:



511
512
513
514
# File 'lib/propertyware/api/work_orders_api.rb', line 511

def get_work_order_tasks(work_order_id, opts = {})
  data, _status_code, _headers = get_work_order_tasks_with_http_info(work_order_id, opts)
  data
end

#get_work_order_tasks_with_http_info(work_order_id, opts = {}) ⇒ Array<(Array<Task>, Integer, Hash)>

Retrieve all work order tasks Retrieves a list of work order tasks.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Required permission:&lt;/b&gt;&lt;br/&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;WORK ORDERS&lt;/span&gt; - &lt;code&gt;Read&lt;/code&gt; &lt;br/&gt;&lt;br/&gt;&lt;b&gt;Sortable by:&lt;/b&gt; &lt;code&gt;createddate&lt;/code&gt;, &lt;code&gt;lastmodifieddatetime&lt;/code&gt;, &lt;code&gt;id&lt;/code&gt;

Parameters:

  • work_order_id (Integer)

    Work Order ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    &#x60;offset&#x60; indicates the position of the first record to return. The offset is zero-based and the default is 0.

  • :limit (Integer)

    &#x60;limit&#x60; indicates the maximum number of results to be returned in the response. &#x60;limit&#x60; can range between 1 and 500 and the default is 100. (default to 100)

  • :last_modified_date_time_start (Time)

    Filters results to any item modified on or after the date time specified.

  • :last_modified_date_time_end (Time)

    Filters results to any item modified on or prior to the date time specified.

  • :orderby (String)

    Indicates the field(s) and direction to sort the results in the response.

  • :due_date (Date)

    Filters results by due day.

  • :completed (Boolean)

    Filters results by task status.

Returns:

  • (Array<(Array<Task>, Integer, Hash)>)

    Array<Task> data, response status code and response headers



528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
# File 'lib/propertyware/api/work_orders_api.rb', line 528

def get_work_order_tasks_with_http_info(work_order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkOrdersApi.get_work_order_tasks ...'
  end
  # verify the required parameter 'work_order_id' is set
  if @api_client.config.client_side_validation && work_order_id.nil?
    fail ArgumentError, "Missing the required parameter 'work_order_id' when calling WorkOrdersApi.get_work_order_tasks"
  end
  # resource path
  local_var_path = '/workorders/{workOrderId}/tasks'.sub('{' + 'workOrderId' + '}', CGI.escape(work_order_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'lastModifiedDateTimeStart'] = opts[:'last_modified_date_time_start'] if !opts[:'last_modified_date_time_start'].nil?
  query_params[:'lastModifiedDateTimeEnd'] = opts[:'last_modified_date_time_end'] if !opts[:'last_modified_date_time_end'].nil?
  query_params[:'orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?
  query_params[:'dueDate'] = opts[:'due_date'] if !opts[:'due_date'].nil?
  query_params[:'completed'] = opts[:'completed'] if !opts[:'completed'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<Task>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['organizationId', 'clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"WorkOrdersApi.get_work_order_tasks",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkOrdersApi#get_work_order_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_work_order_with_http_info(work_order_id, opts = {}) ⇒ Array<(WorkOrder, Integer, Hash)>

Retrieve a work order Retrieves a specific work order.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Required permission:&lt;/b&gt;&lt;br/&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;WORK ORDERS&lt;/span&gt; - &lt;code&gt;Read&lt;/code&gt;

Parameters:

  • work_order_id (Integer)

    Work Order ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_custom_fields (Boolean)

    includeCustomFields (default to true)

Returns:

  • (Array<(WorkOrder, Integer, Hash)>)

    WorkOrder data, response status code and response headers



381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
# File 'lib/propertyware/api/work_orders_api.rb', line 381

def get_work_order_with_http_info(work_order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkOrdersApi.get_work_order ...'
  end
  # verify the required parameter 'work_order_id' is set
  if @api_client.config.client_side_validation && work_order_id.nil?
    fail ArgumentError, "Missing the required parameter 'work_order_id' when calling WorkOrdersApi.get_work_order"
  end
  # resource path
  local_var_path = '/workorders/{workOrderId}'.sub('{' + 'workOrderId' + '}', CGI.escape(work_order_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'includeCustomFields'] = opts[:'include_custom_fields'] if !opts[:'include_custom_fields'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'WorkOrder'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['organizationId', 'clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"WorkOrdersApi.get_work_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkOrdersApi#get_work_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_work_orders(opts = {}) ⇒ Array<WorkOrder>

Retrieve all work orders Retrieves a list of work orders.<br/><br/>Required permission:<br/><span class="permissionBlock">WORK ORDERS</span> - Read <br/><br/>Sortable by: createddate, number, type, lastmodifieddatetime, status, id

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    &#x60;offset&#x60; indicates the position of the first record to return. The offset is zero-based and the default is 0.

  • :limit (Integer)

    &#x60;limit&#x60; indicates the maximum number of results to be returned in the response. &#x60;limit&#x60; can range between 1 and 500 and the default is 100. (default to 100)

  • :last_modified_date_time_start (Time)

    Filters results to any item modified on or after the date time specified.

  • :last_modified_date_time_end (Time)

    Filters results to any item modified on or prior to the date time specified.

  • :orderby (String)

    Indicates the field(s) and direction to sort the results in the response.

  • :portfolio_id (Integer)

    Filters results to prospects associated with a specific portfolio.

  • :building_id (Integer)

    Filters results to prospects associated with a specific building.

  • :status (String)

    Filters results to work orders with a specific status.

  • :type (String)

    Filters results to work orders with a specific type.

  • :priority (String)

    Filters results to work orders with a specific priority.

  • :completed_date_start (Date)

    Filters results to any payment with a date on or after to the date specified.

  • :completed_date_end (Date)

    Filters results to any payment with a date on or prior to the date specified.

  • :include_custom_fields (Boolean)

    includeCustomFields (default to false)

Returns:



600
601
602
603
# File 'lib/propertyware/api/work_orders_api.rb', line 600

def get_work_orders(opts = {})
  data, _status_code, _headers = get_work_orders_with_http_info(opts)
  data
end

#get_work_orders_with_http_info(opts = {}) ⇒ Array<(Array<WorkOrder>, Integer, Hash)>

Retrieve all work orders Retrieves a list of work orders.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Required permission:&lt;/b&gt;&lt;br/&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;WORK ORDERS&lt;/span&gt; - &lt;code&gt;Read&lt;/code&gt; &lt;br/&gt;&lt;br/&gt;&lt;b&gt;Sortable by:&lt;/b&gt; &lt;code&gt;createddate&lt;/code&gt;, &lt;code&gt;number&lt;/code&gt;, &lt;code&gt;type&lt;/code&gt;, &lt;code&gt;lastmodifieddatetime&lt;/code&gt;, &lt;code&gt;status&lt;/code&gt;, &lt;code&gt;id&lt;/code&gt;

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    &#x60;offset&#x60; indicates the position of the first record to return. The offset is zero-based and the default is 0.

  • :limit (Integer)

    &#x60;limit&#x60; indicates the maximum number of results to be returned in the response. &#x60;limit&#x60; can range between 1 and 500 and the default is 100. (default to 100)

  • :last_modified_date_time_start (Time)

    Filters results to any item modified on or after the date time specified.

  • :last_modified_date_time_end (Time)

    Filters results to any item modified on or prior to the date time specified.

  • :orderby (String)

    Indicates the field(s) and direction to sort the results in the response.

  • :portfolio_id (Integer)

    Filters results to prospects associated with a specific portfolio.

  • :building_id (Integer)

    Filters results to prospects associated with a specific building.

  • :status (String)

    Filters results to work orders with a specific status.

  • :type (String)

    Filters results to work orders with a specific type.

  • :priority (String)

    Filters results to work orders with a specific priority.

  • :completed_date_start (Date)

    Filters results to any payment with a date on or after to the date specified.

  • :completed_date_end (Date)

    Filters results to any payment with a date on or prior to the date specified.

  • :include_custom_fields (Boolean)

    includeCustomFields (default to false)

Returns:

  • (Array<(Array<WorkOrder>, Integer, Hash)>)

    Array<WorkOrder> data, response status code and response headers



622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
# File 'lib/propertyware/api/work_orders_api.rb', line 622

def get_work_orders_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkOrdersApi.get_work_orders ...'
  end
  allowable_values = ["HIGH", "MEDIUM", "LOW"]
  if @api_client.config.client_side_validation && opts[:'priority'] && !allowable_values.include?(opts[:'priority'])
    fail ArgumentError, "invalid value for \"priority\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/workorders'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'lastModifiedDateTimeStart'] = opts[:'last_modified_date_time_start'] if !opts[:'last_modified_date_time_start'].nil?
  query_params[:'lastModifiedDateTimeEnd'] = opts[:'last_modified_date_time_end'] if !opts[:'last_modified_date_time_end'].nil?
  query_params[:'orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?
  query_params[:'portfolioID'] = opts[:'portfolio_id'] if !opts[:'portfolio_id'].nil?
  query_params[:'buildingID'] = opts[:'building_id'] if !opts[:'building_id'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'priority'] = opts[:'priority'] if !opts[:'priority'].nil?
  query_params[:'completedDateStart'] = opts[:'completed_date_start'] if !opts[:'completed_date_start'].nil?
  query_params[:'completedDateEnd'] = opts[:'completed_date_end'] if !opts[:'completed_date_end'].nil?
  query_params[:'includeCustomFields'] = opts[:'include_custom_fields'] if !opts[:'include_custom_fields'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<WorkOrder>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['organizationId', 'clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"WorkOrdersApi.get_work_orders",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkOrdersApi#get_work_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_work_order_task(work_order_id, task_id, save_work_order_task, opts = {}) ⇒ Task

Update a task in workOrder (BETA) <p class="betaError">Note: Write access is only available to customers who have opted in to our beta program. Please reach out to support if you’d like to be included.</p> Update an existing workOrder task.<br/><br/>Required permission:<br/><span class="permissionBlock">WORK ORDERS</span> - Write

Parameters:

  • work_order_id (Integer)

    Work Order ID

  • task_id (Integer)

    Task ID

  • save_work_order_task (SaveWorkOrderTask)

    saveWorkOrderTask

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



690
691
692
693
# File 'lib/propertyware/api/work_orders_api.rb', line 690

def update_work_order_task(work_order_id, task_id, save_work_order_task, opts = {})
  data, _status_code, _headers = update_work_order_task_with_http_info(work_order_id, task_id, save_work_order_task, opts)
  data
end

#update_work_order_task_with_http_info(work_order_id, task_id, save_work_order_task, opts = {}) ⇒ Array<(Task, Integer, Hash)>

Update a task in workOrder (BETA) &lt;p class&#x3D;&quot;betaError&quot;&gt;&lt;b&gt;Note: &lt;/b&gt;Write access is only available to customers who have opted in to our beta program. Please reach out to support if you&#39;d like to be included.&lt;/p&gt; Update an existing workOrder task.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Required permission:&lt;/b&gt;&lt;br/&gt;&lt;span class&#x3D;&quot;permissionBlock&quot;&gt;WORK ORDERS&lt;/span&gt; - &lt;code&gt;Write&lt;/code&gt;

Parameters:

  • work_order_id (Integer)

    Work Order ID

  • task_id (Integer)

    Task ID

  • save_work_order_task (SaveWorkOrderTask)

    saveWorkOrderTask

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Task, Integer, Hash)>)

    Task data, response status code and response headers



702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
# File 'lib/propertyware/api/work_orders_api.rb', line 702

def update_work_order_task_with_http_info(work_order_id, task_id, save_work_order_task, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkOrdersApi.update_work_order_task ...'
  end
  # verify the required parameter 'work_order_id' is set
  if @api_client.config.client_side_validation && work_order_id.nil?
    fail ArgumentError, "Missing the required parameter 'work_order_id' when calling WorkOrdersApi.update_work_order_task"
  end
  # verify the required parameter 'task_id' is set
  if @api_client.config.client_side_validation && task_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_id' when calling WorkOrdersApi.update_work_order_task"
  end
  # verify the required parameter 'save_work_order_task' is set
  if @api_client.config.client_side_validation && save_work_order_task.nil?
    fail ArgumentError, "Missing the required parameter 'save_work_order_task' when calling WorkOrdersApi.update_work_order_task"
  end
  # resource path
  local_var_path = '/workorders/{workOrderId}/tasks/{taskId}'.sub('{' + 'workOrderId' + '}', CGI.escape(work_order_id.to_s)).sub('{' + 'taskId' + '}', CGI.escape(task_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(save_work_order_task)

  # return_type
  return_type = opts[:debug_return_type] || 'Task'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['organizationId', 'clientId', 'clientSecret']

  new_options = opts.merge(
    :operation => :"WorkOrdersApi.update_work_order_task",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkOrdersApi#update_work_order_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end