Method: Propertyware::DocumentsApi#update_document_with_http_info

Defined in:
lib/propertyware/api/documents_api.rb

#update_document_with_http_info(document_id, update_document, opts = {}) ⇒ Array<(Document, Integer, Hash)>

Update a document (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; Updates the metadata of a specific document.&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;DOCUMENTS&lt;/span&gt; - &lt;code&gt;Write&lt;/code&gt;

Parameters:

  • document_id (Integer)

    ID of the document to be updated

  • update_document (UpdateDocument)

    updateDocument

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

    the optional parameters

Returns:

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

    Document data, response status code and response headers



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
363
364
365
366
367
368
369
370
# File 'lib/propertyware/api/documents_api.rb', line 315

def update_document_with_http_info(document_id, update_document, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DocumentsApi.update_document ...'
  end
  # verify the required parameter 'document_id' is set
  if @api_client.config.client_side_validation && document_id.nil?
    fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.update_document"
  end
  # verify the required parameter 'update_document' is set
  if @api_client.config.client_side_validation && update_document.nil?
    fail ArgumentError, "Missing the required parameter 'update_document' when calling DocumentsApi.update_document"
  end
  # resource path
  local_var_path = '/docs/{documentId}'.sub('{' + 'documentId' + '}', CGI.escape(document_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(update_document)

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

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

  new_options = opts.merge(
    :operation => :"DocumentsApi.update_document",
    :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: DocumentsApi#update_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end