class XeroRuby::FilesApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.new) click to toggle source
# File lib/xero-ruby/api/files_api.rb, line 16
def initialize(api_client = ApiClient.new)
  @api_client = api_client
end

Public Instance Methods

create_file_association(xero_tenant_id, file_id, opts = {}) click to toggle source

Creates a new file association By passing in the appropriate options, you can create a new folder @param xero_tenant_id [String] Xero identifier for Tenant @param file_id [String] File id for single object @param [Hash] opts the optional parameters @option opts [Association] :association @return [Association]

# File lib/xero-ruby/api/files_api.rb, line 26
def create_file_association(xero_tenant_id, file_id, opts = {})
  data, _status_code, _headers = create_file_association_with_http_info(xero_tenant_id, file_id, opts)
  data
end
create_file_association_with_http_info(xero_tenant_id, file_id, options = {}) click to toggle source

Creates a new file association By passing in the appropriate options, you can create a new folder @param xero_tenant_id [String] Xero identifier for Tenant @param file_id [String] File id for single object @param [Hash] opts the optional parameters @option opts [Association] :association @return [Array<(Association, Integer, Hash)>] Association data, response status code and response headers

# File lib/xero-ruby/api/files_api.rb, line 38
def create_file_association_with_http_info(xero_tenant_id, file_id, options = {})
  opts = options.dup
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilesApi.create_file_association ...'
  end
  # verify the required parameter 'xero_tenant_id' is set
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
    fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.create_file_association"
  end
  # verify the required parameter 'file_id' is set
  if @api_client.config.client_side_validation && file_id.nil?
    fail ArgumentError, "Missing the required parameter 'file_id' when calling FilesApi.create_file_association"
  end
  # resource path
  local_var_path = '/Files/{FileId}/Associations'.sub('{' + 'FileId' + '}', file_id.to_s)

  # camelize keys of incoming `where` opts
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?

  # query parameters
  query_params = opts[:query_params] || {}
  
  # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
  query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?

  # 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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'xero-tenant-id'] = xero_tenant_id

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

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

  # return_type
  return_type = opts[:return_type] || 'Association' 

  # auth_names
  auth_names = opts[:auth_names] || ['OAuth2']

  new_options = opts.merge(
    :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, "FilesApi", new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilesApi#create_file_association\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
create_folder(xero_tenant_id, opts = {}) click to toggle source

Creates a new folder By passing in the appropriate properties, you can create a new folder @param xero_tenant_id [String] Xero identifier for Tenant @param [Hash] opts the optional parameters @option opts [Folder] :folder @return [Folder]

# File lib/xero-ruby/api/files_api.rb, line 106
def create_folder(xero_tenant_id, opts = {})
  data, _status_code, _headers = create_folder_with_http_info(xero_tenant_id, opts)
  data
end
create_folder_with_http_info(xero_tenant_id, options = {}) click to toggle source

Creates a new folder By passing in the appropriate properties, you can create a new folder @param xero_tenant_id [String] Xero identifier for Tenant @param [Hash] opts the optional parameters @option opts [Folder] :folder @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers

# File lib/xero-ruby/api/files_api.rb, line 117
def create_folder_with_http_info(xero_tenant_id, options = {})
  opts = options.dup
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilesApi.create_folder ...'
  end
  # verify the required parameter 'xero_tenant_id' is set
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
    fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.create_folder"
  end
  # resource path
  local_var_path = '/Folders'

  # camelize keys of incoming `where` opts
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?

  # query parameters
  query_params = opts[:query_params] || {}
  
  # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
  query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?

  # 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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'xero-tenant-id'] = xero_tenant_id

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

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

  # return_type
  return_type = opts[:return_type] || 'Folder' 

  # auth_names
  auth_names = opts[:auth_names] || ['OAuth2']

  new_options = opts.merge(
    :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, "FilesApi", new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilesApi#create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_file(xero_tenant_id, file_id, opts = {}) click to toggle source

Deletes a specific file Delete a specific file @param xero_tenant_id [String] Xero identifier for Tenant @param file_id [String] File id for single object @param [Hash] opts the optional parameters @return [nil]

# File lib/xero-ruby/api/files_api.rb, line 181
def delete_file(xero_tenant_id, file_id, opts = {})
  delete_file_with_http_info(xero_tenant_id, file_id, opts)
  nil
end
delete_file_association(xero_tenant_id, file_id, object_id, opts = {}) click to toggle source

Deletes an existing file association By passing in the appropriate options, you can create a new folder @param xero_tenant_id [String] Xero identifier for Tenant @param file_id [String] File id for single object @param object_id [String] Object id for single object @param [Hash] opts the optional parameters @return [nil]

# File lib/xero-ruby/api/files_api.rb, line 257
def delete_file_association(xero_tenant_id, file_id, object_id, opts = {})
  delete_file_association_with_http_info(xero_tenant_id, file_id, object_id, opts)
  nil
end
delete_file_association_with_http_info(xero_tenant_id, file_id, object_id, options = {}) click to toggle source

Deletes an existing file association By passing in the appropriate options, you can create a new folder @param xero_tenant_id [String] Xero identifier for Tenant @param file_id [String] File id for single object @param object_id [String] Object id for single object @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/xero-ruby/api/files_api.rb, line 269
def delete_file_association_with_http_info(xero_tenant_id, file_id, object_id, options = {})
  opts = options.dup
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilesApi.delete_file_association ...'
  end
  # verify the required parameter 'xero_tenant_id' is set
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
    fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.delete_file_association"
  end
  # verify the required parameter 'file_id' is set
  if @api_client.config.client_side_validation && file_id.nil?
    fail ArgumentError, "Missing the required parameter 'file_id' when calling FilesApi.delete_file_association"
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling FilesApi.delete_file_association"
  end
  # resource path
  local_var_path = '/Files/{FileId}/Associations/{ObjectId}'.sub('{' + 'FileId' + '}', file_id.to_s).sub('{' + 'ObjectId' + '}', object_id.to_s)

  # camelize keys of incoming `where` opts
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?

  # query parameters
  query_params = opts[:query_params] || {}
  
  # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
  query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'xero-tenant-id'] = xero_tenant_id

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['OAuth2']

  new_options = opts.merge(
    :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, "FilesApi", new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilesApi#delete_file_association\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_file_with_http_info(xero_tenant_id, file_id, options = {}) click to toggle source

Deletes a specific file Delete a specific file @param xero_tenant_id [String] Xero identifier for Tenant @param file_id [String] File id for single object @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/xero-ruby/api/files_api.rb, line 192
def delete_file_with_http_info(xero_tenant_id, file_id, options = {})
  opts = options.dup
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilesApi.delete_file ...'
  end
  # verify the required parameter 'xero_tenant_id' is set
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
    fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.delete_file"
  end
  # verify the required parameter 'file_id' is set
  if @api_client.config.client_side_validation && file_id.nil?
    fail ArgumentError, "Missing the required parameter 'file_id' when calling FilesApi.delete_file"
  end
  # resource path
  local_var_path = '/Files/{FileId}'.sub('{' + 'FileId' + '}', file_id.to_s)

  # camelize keys of incoming `where` opts
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?

  # query parameters
  query_params = opts[:query_params] || {}
  
  # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
  query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'xero-tenant-id'] = xero_tenant_id

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['OAuth2']

  new_options = opts.merge(
    :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, "FilesApi", new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilesApi#delete_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_folder(xero_tenant_id, folder_id, opts = {}) click to toggle source

Deletes a folder By passing in the appropriate ID, you can delete a folder @param xero_tenant_id [String] Xero identifier for Tenant @param folder_id [String] Folder id for single object @param [Hash] opts the optional parameters @return [nil]

# File lib/xero-ruby/api/files_api.rb, line 337
def delete_folder(xero_tenant_id, folder_id, opts = {})
  delete_folder_with_http_info(xero_tenant_id, folder_id, opts)
  nil
end
delete_folder_with_http_info(xero_tenant_id, folder_id, options = {}) click to toggle source

Deletes a folder By passing in the appropriate ID, you can delete a folder @param xero_tenant_id [String] Xero identifier for Tenant @param folder_id [String] Folder id for single object @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/xero-ruby/api/files_api.rb, line 348
def delete_folder_with_http_info(xero_tenant_id, folder_id, options = {})
  opts = options.dup
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilesApi.delete_folder ...'
  end
  # verify the required parameter 'xero_tenant_id' is set
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
    fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.delete_folder"
  end
  # verify the required parameter 'folder_id' is set
  if @api_client.config.client_side_validation && folder_id.nil?
    fail ArgumentError, "Missing the required parameter 'folder_id' when calling FilesApi.delete_folder"
  end
  # resource path
  local_var_path = '/Folders/{FolderId}'.sub('{' + 'FolderId' + '}', folder_id.to_s)

  # camelize keys of incoming `where` opts
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?

  # query parameters
  query_params = opts[:query_params] || {}
  
  # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
  query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'xero-tenant-id'] = xero_tenant_id

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['OAuth2']

  new_options = opts.merge(
    :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, "FilesApi", new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilesApi#delete_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_associations_by_object(xero_tenant_id, object_id, opts = {}) click to toggle source

Retrieves an association object using a unique object ID By passing in the appropriate options, @param xero_tenant_id [String] Xero identifier for Tenant @param object_id [String] Object id for single object @param [Hash] opts the optional parameters @return [Array<Association>]

# File lib/xero-ruby/api/files_api.rb, line 412
def get_associations_by_object(xero_tenant_id, object_id, opts = {})
  data, _status_code, _headers = get_associations_by_object_with_http_info(xero_tenant_id, object_id, opts)
  data
end
get_associations_by_object_with_http_info(xero_tenant_id, object_id, options = {}) click to toggle source

Retrieves an association object using a unique object ID By passing in the appropriate options, @param xero_tenant_id [String] Xero identifier for Tenant @param object_id [String] Object id for single object @param [Hash] opts the optional parameters @return [Array<(Array<Association>, Integer, Hash)>] Array<Association> data, response status code and response headers

# File lib/xero-ruby/api/files_api.rb, line 423
def get_associations_by_object_with_http_info(xero_tenant_id, object_id, options = {})
  opts = options.dup
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilesApi.get_associations_by_object ...'
  end
  # verify the required parameter 'xero_tenant_id' is set
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
    fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.get_associations_by_object"
  end
  # verify the required parameter 'object_id' is set
  if @api_client.config.client_side_validation && object_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_id' when calling FilesApi.get_associations_by_object"
  end
  # resource path
  local_var_path = '/Associations/{ObjectId}'.sub('{' + 'ObjectId' + '}', object_id.to_s)

  # camelize keys of incoming `where` opts
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?

  # query parameters
  query_params = opts[:query_params] || {}
  
  # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
  query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?

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

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

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

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

  # auth_names
  auth_names = opts[:auth_names] || ['OAuth2']

  new_options = opts.merge(
    :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, "FilesApi", new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilesApi#get_associations_by_object\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_file(xero_tenant_id, file_id, opts = {}) click to toggle source

Retrieves a file by a unique file ID @param xero_tenant_id [String] Xero identifier for Tenant @param file_id [String] File id for single object @param [Hash] opts the optional parameters @return [FileObject]

# File lib/xero-ruby/api/files_api.rb, line 488
def get_file(xero_tenant_id, file_id, opts = {})
  data, _status_code, _headers = get_file_with_http_info(xero_tenant_id, file_id, opts)
  data
end
get_file_associations(xero_tenant_id, file_id, opts = {}) click to toggle source

Retrieves a specific file associations By passing in the appropriate options,

@param xero_tenant_id [String] Xero identifier for Tenant @param file_id [String] File id for single object @param [Hash] opts the optional parameters @return [Array<Association>]

# File lib/xero-ruby/api/files_api.rb, line 564
def get_file_associations(xero_tenant_id, file_id, opts = {})
  data, _status_code, _headers = get_file_associations_with_http_info(xero_tenant_id, file_id, opts)
  data
end
get_file_associations_with_http_info(xero_tenant_id, file_id, options = {}) click to toggle source

Retrieves a specific file associations By passing in the appropriate options,

@param xero_tenant_id [String] Xero identifier for Tenant @param file_id [String] File id for single object @param [Hash] opts the optional parameters @return [Array<(Array<Association>, Integer, Hash)>] Array<Association> data, response status code and response headers

# File lib/xero-ruby/api/files_api.rb, line 575
def get_file_associations_with_http_info(xero_tenant_id, file_id, options = {})
  opts = options.dup
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilesApi.get_file_associations ...'
  end
  # verify the required parameter 'xero_tenant_id' is set
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
    fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.get_file_associations"
  end
  # verify the required parameter 'file_id' is set
  if @api_client.config.client_side_validation && file_id.nil?
    fail ArgumentError, "Missing the required parameter 'file_id' when calling FilesApi.get_file_associations"
  end
  # resource path
  local_var_path = '/Files/{FileId}/Associations'.sub('{' + 'FileId' + '}', file_id.to_s)

  # camelize keys of incoming `where` opts
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?

  # query parameters
  query_params = opts[:query_params] || {}
  
  # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
  query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?

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

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

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

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

  # auth_names
  auth_names = opts[:auth_names] || ['OAuth2']

  new_options = opts.merge(
    :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, "FilesApi", new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilesApi#get_file_associations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_file_content(xero_tenant_id, file_id, opts = {}) click to toggle source

Retrieves the content of a specific file By passing in the appropriate options, retrieve data for specific file @param xero_tenant_id [String] Xero identifier for Tenant @param file_id [String] File id for single object @param [Hash] opts the optional parameters @return [File]

# File lib/xero-ruby/api/files_api.rb, line 641
def get_file_content(xero_tenant_id, file_id, opts = {})
  data, _status_code, _headers = get_file_content_with_http_info(xero_tenant_id, file_id, opts)
  data
end
get_file_content_with_http_info(xero_tenant_id, file_id, options = {}) click to toggle source

Retrieves the content of a specific file By passing in the appropriate options, retrieve data for specific file @param xero_tenant_id [String] Xero identifier for Tenant @param file_id [String] File id for single object @param [Hash] opts the optional parameters @return [Array<(File, Integer, Hash)>] File data, response status code and response headers

# File lib/xero-ruby/api/files_api.rb, line 652
def get_file_content_with_http_info(xero_tenant_id, file_id, options = {})
  opts = options.dup
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilesApi.get_file_content ...'
  end
  # verify the required parameter 'xero_tenant_id' is set
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
    fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.get_file_content"
  end
  # verify the required parameter 'file_id' is set
  if @api_client.config.client_side_validation && file_id.nil?
    fail ArgumentError, "Missing the required parameter 'file_id' when calling FilesApi.get_file_content"
  end
  # resource path
  local_var_path = '/Files/{FileId}/Content'.sub('{' + 'FileId' + '}', file_id.to_s)

  # camelize keys of incoming `where` opts
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?

  # query parameters
  query_params = opts[:query_params] || {}
  
  # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
  query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
  header_params[:'xero-tenant-id'] = xero_tenant_id

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

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

  # return_type
  return_type = opts[:return_type] || 'File' 

  # auth_names
  auth_names = opts[:auth_names] || ['OAuth2']

  new_options = opts.merge(
    :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, "FilesApi", new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilesApi#get_file_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_file_with_http_info(xero_tenant_id, file_id, options = {}) click to toggle source

Retrieves a file by a unique file ID @param xero_tenant_id [String] Xero identifier for Tenant @param file_id [String] File id for single object @param [Hash] opts the optional parameters @return [Array<(FileObject, Integer, Hash)>] FileObject data, response status code and response headers

# File lib/xero-ruby/api/files_api.rb, line 498
def get_file_with_http_info(xero_tenant_id, file_id, options = {})
  opts = options.dup
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilesApi.get_file ...'
  end
  # verify the required parameter 'xero_tenant_id' is set
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
    fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.get_file"
  end
  # verify the required parameter 'file_id' is set
  if @api_client.config.client_side_validation && file_id.nil?
    fail ArgumentError, "Missing the required parameter 'file_id' when calling FilesApi.get_file"
  end
  # resource path
  local_var_path = '/Files/{FileId}'.sub('{' + 'FileId' + '}', file_id.to_s)

  # camelize keys of incoming `where` opts
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?

  # query parameters
  query_params = opts[:query_params] || {}
  
  # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
  query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?

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

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

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

  # return_type
  return_type = opts[:return_type] || 'FileObject' 

  # auth_names
  auth_names = opts[:auth_names] || ['OAuth2']

  new_options = opts.merge(
    :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, "FilesApi", new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilesApi#get_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_files(xero_tenant_id, opts = {}) click to toggle source

Retrieves files @param xero_tenant_id [String] Xero identifier for Tenant @param [Hash] opts the optional parameters @option opts [Integer] :pagesize pass an optional page size value @option opts [Integer] :page number of records to skip for pagination @option opts [String] :sort values to sort by @return [Files]

# File lib/xero-ruby/api/files_api.rb, line 719
def get_files(xero_tenant_id, opts = {})
  data, _status_code, _headers = get_files_with_http_info(xero_tenant_id, opts)
  data
end
get_files_with_http_info(xero_tenant_id, options = {}) click to toggle source

Retrieves files @param xero_tenant_id [String] Xero identifier for Tenant @param [Hash] opts the optional parameters @option opts [Integer] :pagesize pass an optional page size value @option opts [Integer] :page number of records to skip for pagination @option opts [String] :sort values to sort by @return [Array<(Files, Integer, Hash)>] Files data, response status code and response headers

# File lib/xero-ruby/api/files_api.rb, line 731
def get_files_with_http_info(xero_tenant_id, options = {})
  opts = options.dup
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilesApi.get_files ...'
  end
  # verify the required parameter 'xero_tenant_id' is set
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
    fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.get_files"
  end
  if @api_client.config.client_side_validation && !opts[:'pagesize'].nil? && opts[:'pagesize'] > 100
    fail ArgumentError, 'invalid value for "opts[:"pagesize"]" when calling FilesApi.get_files, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling FilesApi.get_files, must be greater than or equal to 1.'
  end

  allowable_values = ["Name", "Size", "CreatedDateUTC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/Files'

  # camelize keys of incoming `where` opts
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pagesize'] = opts[:'pagesize'] if !opts[:'pagesize'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  
  # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
  query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?

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

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

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

  # return_type
  return_type = opts[:return_type] || 'Files' 

  # auth_names
  auth_names = opts[:auth_names] || ['OAuth2']

  new_options = opts.merge(
    :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, "FilesApi", new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilesApi#get_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_folder(xero_tenant_id, folder_id, opts = {}) click to toggle source

Retrieves specific folder by using a unique folder ID By passing in the appropriate ID, you can search for specific folder @param xero_tenant_id [String] Xero identifier for Tenant @param folder_id [String] Folder id for single object @param [Hash] opts the optional parameters @return [Folder]

# File lib/xero-ruby/api/files_api.rb, line 808
def get_folder(xero_tenant_id, folder_id, opts = {})
  data, _status_code, _headers = get_folder_with_http_info(xero_tenant_id, folder_id, opts)
  data
end
get_folder_with_http_info(xero_tenant_id, folder_id, options = {}) click to toggle source

Retrieves specific folder by using a unique folder ID By passing in the appropriate ID, you can search for specific folder @param xero_tenant_id [String] Xero identifier for Tenant @param folder_id [String] Folder id for single object @param [Hash] opts the optional parameters @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers

# File lib/xero-ruby/api/files_api.rb, line 819
def get_folder_with_http_info(xero_tenant_id, folder_id, options = {})
  opts = options.dup
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilesApi.get_folder ...'
  end
  # verify the required parameter 'xero_tenant_id' is set
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
    fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.get_folder"
  end
  # verify the required parameter 'folder_id' is set
  if @api_client.config.client_side_validation && folder_id.nil?
    fail ArgumentError, "Missing the required parameter 'folder_id' when calling FilesApi.get_folder"
  end
  # resource path
  local_var_path = '/Folders/{FolderId}'.sub('{' + 'FolderId' + '}', folder_id.to_s)

  # camelize keys of incoming `where` opts
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?

  # query parameters
  query_params = opts[:query_params] || {}
  
  # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
  query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?

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

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

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

  # return_type
  return_type = opts[:return_type] || 'Folder' 

  # auth_names
  auth_names = opts[:auth_names] || ['OAuth2']

  new_options = opts.merge(
    :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, "FilesApi", new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilesApi#get_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_folders(xero_tenant_id, opts = {}) click to toggle source

Retrieves folders By passing in the appropriate options, you can search for available folders @param xero_tenant_id [String] Xero identifier for Tenant @param [Hash] opts the optional parameters @option opts [String] :sort values to sort by @return [Array<Folder>]

# File lib/xero-ruby/api/files_api.rb, line 885
def get_folders(xero_tenant_id, opts = {})
  data, _status_code, _headers = get_folders_with_http_info(xero_tenant_id, opts)
  data
end
get_folders_with_http_info(xero_tenant_id, options = {}) click to toggle source

Retrieves folders By passing in the appropriate options, you can search for available folders @param xero_tenant_id [String] Xero identifier for Tenant @param [Hash] opts the optional parameters @option opts [String] :sort values to sort by @return [Array<(Array<Folder>, Integer, Hash)>] Array<Folder> data, response status code and response headers

# File lib/xero-ruby/api/files_api.rb, line 896
def get_folders_with_http_info(xero_tenant_id, options = {})
  opts = options.dup
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilesApi.get_folders ...'
  end
  # verify the required parameter 'xero_tenant_id' is set
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
    fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.get_folders"
  end
  allowable_values = ["Name", "Size", "CreatedDateUTC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/Folders'

  # camelize keys of incoming `where` opts
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  
  # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
  query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?

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

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

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

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

  # auth_names
  auth_names = opts[:auth_names] || ['OAuth2']

  new_options = opts.merge(
    :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, "FilesApi", new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilesApi#get_folders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_inbox(xero_tenant_id, opts = {}) click to toggle source

Retrieves inbox folder Search for the user inbox @param xero_tenant_id [String] Xero identifier for Tenant @param [Hash] opts the optional parameters @return [Folder]

# File lib/xero-ruby/api/files_api.rb, line 962
def get_inbox(xero_tenant_id, opts = {})
  data, _status_code, _headers = get_inbox_with_http_info(xero_tenant_id, opts)
  data
end
get_inbox_with_http_info(xero_tenant_id, options = {}) click to toggle source

Retrieves inbox folder Search for the user inbox @param xero_tenant_id [String] Xero identifier for Tenant @param [Hash] opts the optional parameters @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers

# File lib/xero-ruby/api/files_api.rb, line 972
def get_inbox_with_http_info(xero_tenant_id, options = {})
  opts = options.dup
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilesApi.get_inbox ...'
  end
  # verify the required parameter 'xero_tenant_id' is set
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
    fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.get_inbox"
  end
  # resource path
  local_var_path = '/Inbox'

  # camelize keys of incoming `where` opts
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?

  # query parameters
  query_params = opts[:query_params] || {}
  
  # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
  query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?

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

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

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

  # return_type
  return_type = opts[:return_type] || 'Folder' 

  # auth_names
  auth_names = opts[:auth_names] || ['OAuth2']

  new_options = opts.merge(
    :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, "FilesApi", new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilesApi#get_inbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_file(xero_tenant_id, file_id, opts = {}) click to toggle source

Update a file Updates file properties of a single file @param xero_tenant_id [String] Xero identifier for Tenant @param file_id [String] File id for single object @param [Hash] opts the optional parameters @option opts [FileObject] :file_object @return [FileObject]

# File lib/xero-ruby/api/files_api.rb, line 1035
def update_file(xero_tenant_id, file_id, opts = {})
  data, _status_code, _headers = update_file_with_http_info(xero_tenant_id, file_id, opts)
  data
end
update_file_with_http_info(xero_tenant_id, file_id, options = {}) click to toggle source

Update a file Updates file properties of a single file @param xero_tenant_id [String] Xero identifier for Tenant @param file_id [String] File id for single object @param [Hash] opts the optional parameters @option opts [FileObject] :file_object @return [Array<(FileObject, Integer, Hash)>] FileObject data, response status code and response headers

# File lib/xero-ruby/api/files_api.rb, line 1047
def update_file_with_http_info(xero_tenant_id, file_id, options = {})
  opts = options.dup
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilesApi.update_file ...'
  end
  # verify the required parameter 'xero_tenant_id' is set
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
    fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.update_file"
  end
  # verify the required parameter 'file_id' is set
  if @api_client.config.client_side_validation && file_id.nil?
    fail ArgumentError, "Missing the required parameter 'file_id' when calling FilesApi.update_file"
  end
  # resource path
  local_var_path = '/Files/{FileId}'.sub('{' + 'FileId' + '}', file_id.to_s)

  # camelize keys of incoming `where` opts
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?

  # query parameters
  query_params = opts[:query_params] || {}
  
  # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
  query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?

  # 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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'xero-tenant-id'] = xero_tenant_id

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

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

  # return_type
  return_type = opts[:return_type] || 'FileObject' 

  # auth_names
  auth_names = opts[:auth_names] || ['OAuth2']

  new_options = opts.merge(
    :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, "FilesApi", new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilesApi#update_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_folder(xero_tenant_id, folder_id, folder, opts = {}) click to toggle source

Updates an existing folder By passing in the appropriate ID and properties, you can update a folder @param xero_tenant_id [String] Xero identifier for Tenant @param folder_id [String] Folder id for single object @param folder [Folder] @param [Hash] opts the optional parameters @return [Folder]

# File lib/xero-ruby/api/files_api.rb, line 1116
def update_folder(xero_tenant_id, folder_id, folder, opts = {})
  data, _status_code, _headers = update_folder_with_http_info(xero_tenant_id, folder_id, folder, opts)
  data
end
update_folder_with_http_info(xero_tenant_id, folder_id, folder, options = {}) click to toggle source

Updates an existing folder By passing in the appropriate ID and properties, you can update a folder @param xero_tenant_id [String] Xero identifier for Tenant @param folder_id [String] Folder id for single object @param folder [Folder] @param [Hash] opts the optional parameters @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers

# File lib/xero-ruby/api/files_api.rb, line 1128
def update_folder_with_http_info(xero_tenant_id, folder_id, folder, options = {})
  opts = options.dup
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilesApi.update_folder ...'
  end
  # verify the required parameter 'xero_tenant_id' is set
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
    fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.update_folder"
  end
  # verify the required parameter 'folder_id' is set
  if @api_client.config.client_side_validation && folder_id.nil?
    fail ArgumentError, "Missing the required parameter 'folder_id' when calling FilesApi.update_folder"
  end
  # verify the required parameter 'folder' is set
  if @api_client.config.client_side_validation && folder.nil?
    fail ArgumentError, "Missing the required parameter 'folder' when calling FilesApi.update_folder"
  end
  # resource path
  local_var_path = '/Folders/{FolderId}'.sub('{' + 'FolderId' + '}', folder_id.to_s)

  # camelize keys of incoming `where` opts
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?

  # query parameters
  query_params = opts[:query_params] || {}
  
  # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
  query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?

  # 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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'xero-tenant-id'] = xero_tenant_id

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

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

  # return_type
  return_type = opts[:return_type] || 'Folder' 

  # auth_names
  auth_names = opts[:auth_names] || ['OAuth2']

  new_options = opts.merge(
    :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, "FilesApi", new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilesApi#update_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
upload_file(xero_tenant_id, body, name, filename, opts = {}) click to toggle source

Uploads a File to the inbox @param xero_tenant_id [String] Xero identifier for Tenant @param body [String] @param name [String] exact name of the file you are uploading @param filename [String] @param [Hash] opts the optional parameters @option opts [String] :mime_type @return [FileObject]

# File lib/xero-ruby/api/files_api.rb, line 1202
def upload_file(xero_tenant_id, body, name, filename, opts = {})
  data, _status_code, _headers = upload_file_with_http_info(xero_tenant_id, body, name, filename, opts)
  data
end
upload_file_to_folder(xero_tenant_id, folder_id, body, name, filename, opts = {}) click to toggle source

Uploads a File to a specific folder @param xero_tenant_id [String] Xero identifier for Tenant @param folder_id [String] pass required folder id to save file to specific folder @param body [String] @param name [String] exact name of the file you are uploading @param filename [String] @param [Hash] opts the optional parameters @option opts [String] :mime_type @return [FileObject]

# File lib/xero-ruby/api/files_api.rb, line 1298
def upload_file_to_folder(xero_tenant_id, folder_id, body, name, filename, opts = {})
  data, _status_code, _headers = upload_file_to_folder_with_http_info(xero_tenant_id, folder_id, body, name, filename, opts)
  data
end
upload_file_to_folder_with_http_info(xero_tenant_id, folder_id, body, name, filename, options = {}) click to toggle source

Uploads a File to a specific folder @param xero_tenant_id [String] Xero identifier for Tenant @param folder_id [String] pass required folder id to save file to specific folder @param body [String] @param name [String] exact name of the file you are uploading @param filename [String] @param [Hash] opts the optional parameters @option opts [String] :mime_type @return [Array<(FileObject, Integer, Hash)>] FileObject data, response status code and response headers

# File lib/xero-ruby/api/files_api.rb, line 1312
def upload_file_to_folder_with_http_info(xero_tenant_id, folder_id, body, name, filename, options = {})
  opts = options.dup
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilesApi.upload_file_to_folder ...'
  end
  # verify the required parameter 'xero_tenant_id' is set
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
    fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.upload_file_to_folder"
  end
  # verify the required parameter 'folder_id' is set
  if @api_client.config.client_side_validation && folder_id.nil?
    fail ArgumentError, "Missing the required parameter 'folder_id' when calling FilesApi.upload_file_to_folder"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling FilesApi.upload_file_to_folder"
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling FilesApi.upload_file_to_folder"
  end
  # verify the required parameter 'filename' is set
  if @api_client.config.client_side_validation && filename.nil?
    fail ArgumentError, "Missing the required parameter 'filename' when calling FilesApi.upload_file_to_folder"
  end
  # resource path
  local_var_path = '/Files/{FolderId}'.sub('{' + 'FolderId' + '}', folder_id.to_s)

  # camelize keys of incoming `where` opts
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?

  # query parameters
  query_params = opts[:query_params] || {}
  
  # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
  query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?

  # 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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
  header_params[:'xero-tenant-id'] = xero_tenant_id

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['body'] = body
  form_params['name'] = name
  form_params['filename'] = filename
  form_params['mimeType'] = opts[:'mime_type'] if !opts[:'mime_type'].nil?

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

  # return_type
  return_type = opts[:return_type] || 'FileObject' 

  # auth_names
  auth_names = opts[:auth_names] || ['OAuth2']

  new_options = opts.merge(
    :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, "FilesApi", new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilesApi#upload_file_to_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
upload_file_with_http_info(xero_tenant_id, body, name, filename, options = {}) click to toggle source

Uploads a File to the inbox @param xero_tenant_id [String] Xero identifier for Tenant @param body [String] @param name [String] exact name of the file you are uploading @param filename [String] @param [Hash] opts the optional parameters @option opts [String] :mime_type @return [Array<(FileObject, Integer, Hash)>] FileObject data, response status code and response headers

# File lib/xero-ruby/api/files_api.rb, line 1215
def upload_file_with_http_info(xero_tenant_id, body, name, filename, options = {})
  opts = options.dup
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FilesApi.upload_file ...'
  end
  # verify the required parameter 'xero_tenant_id' is set
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
    fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.upload_file"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling FilesApi.upload_file"
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling FilesApi.upload_file"
  end
  # verify the required parameter 'filename' is set
  if @api_client.config.client_side_validation && filename.nil?
    fail ArgumentError, "Missing the required parameter 'filename' when calling FilesApi.upload_file"
  end
  # resource path
  local_var_path = '/Files'

  # camelize keys of incoming `where` opts
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?

  # query parameters
  query_params = opts[:query_params] || {}
  
  # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
  query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?

  # 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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
  header_params[:'xero-tenant-id'] = xero_tenant_id

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['body'] = body
  form_params['name'] = name
  form_params['filename'] = filename
  form_params['mimeType'] = opts[:'mime_type'] if !opts[:'mime_type'].nil?

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

  # return_type
  return_type = opts[:return_type] || 'FileObject' 

  # auth_names
  auth_names = opts[:auth_names] || ['OAuth2']

  new_options = opts.merge(
    :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, "FilesApi", new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilesApi#upload_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end