class DocuSign_Rooms::DocumentsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = DocumentsApi.default) click to toggle source
# File lib/docusign_rooms/api/documents_api.rb, line 29
def initialize(api_client = DocumentsApi.default)
  @api_client = api_client
end

Public Instance Methods

create_document_user(document_id, account_id, body) click to toggle source

Grants access to a document for a user.

@param document_id @param account_id @param body (optional parameter) @return [DocumentUser]

# File lib/docusign_rooms/api/documents_api.rb, line 39
def create_document_user(document_id, account_id, body)
  data, _status_code, _headers = create_document_user_with_http_info(document_id, account_id,  body)
  return data
end
create_document_user_with_http_info(document_id, account_id, body) click to toggle source

Grants access to a document for a user.

@param document_id @param account_id @param body (optional parameter) @return [Array<(DocumentUser, Fixnum, Hash)>] DocumentUser data, response status code and response headers

# File lib/docusign_rooms/api/documents_api.rb, line 50
def create_document_user_with_http_info(document_id, account_id, body)
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DocumentsApi.create_document_user ..."
  end
  # verify the required parameter 'document_id' is set
  fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.create_document_user" if document_id.nil?
  # verify the required parameter 'account_id' is set
  fail ArgumentError, "Missing the required parameter 'account_id' when calling DocumentsApi.create_document_user" if account_id.nil?
  # resource path
  local_var_path = "/v2/accounts/{accountId}/documents/{documentId}/users".sub('{format}','json').sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DocumentUser')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DocumentsApi#create_document_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_document(document_id, account_id) click to toggle source

Deletes a document.

@param document_id @param account_id @return [nil]

# File lib/docusign_rooms/api/documents_api.rb, line 95
def delete_document(document_id, account_id)
  delete_document_with_http_info(document_id, account_id)
  return nil
end
delete_document_with_http_info(document_id, account_id) click to toggle source

Deletes a document.

@param document_id @param account_id @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/docusign_rooms/api/documents_api.rb, line 105
def delete_document_with_http_info(document_id, account_id)
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DocumentsApi.delete_document ..."
  end
  # verify the required parameter 'document_id' is set
  fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.delete_document" if document_id.nil?
  # verify the required parameter 'account_id' is set
  fail ArgumentError, "Missing the required parameter 'account_id' when calling DocumentsApi.delete_document" if account_id.nil?
  # resource path
  local_var_path = "/v2/accounts/{accountId}/documents/{documentId}".sub('{format}','json').sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DocumentsApi#delete_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_document(document_id, account_id, options = DocuSign_Rooms::GetDocumentOptions.default) click to toggle source

Get information about the Document with the given DocumentId.

@param document_id @param account_id @param DocuSign_Rooms::GetDocumentOptions Options for modifying the behavior of the function. @return [Document]

# File lib/docusign_rooms/api/documents_api.rb, line 148
def get_document(document_id, account_id, options = DocuSign_Rooms::GetDocumentOptions.default)
  data, _status_code, _headers = get_document_with_http_info(document_id, account_id, options)
  return data
end
get_document_with_http_info(document_id, account_id, options = DocuSign_Rooms::GetDocumentOptions.default) click to toggle source

Get information about the Document with the given DocumentId.

@param document_id @param account_id @param DocuSign_Rooms::GetDocumentOptions Options for modifying the behavior of the function. @return [Array<(Document, Fixnum, Hash)>] Document data, response status code and response headers

# File lib/docusign_rooms/api/documents_api.rb, line 159
def get_document_with_http_info(document_id, account_id, options = DocuSign_Rooms::GetDocumentOptions.default)
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DocumentsApi.get_document ..."
  end
  # verify the required parameter 'document_id' is set
  fail ArgumentError, "Missing the required parameter 'document_id' when calling DocumentsApi.get_document" if document_id.nil?
  # verify the required parameter 'account_id' is set
  fail ArgumentError, "Missing the required parameter 'account_id' when calling DocumentsApi.get_document" if account_id.nil?
  # resource path
  local_var_path = "/v2/accounts/{accountId}/documents/{documentId}".sub('{format}','json').sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'includeContents'] = options.include_contents if !options.include_contents.nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Document')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DocumentsApi#get_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end