accounting/lib/xero-ruby/api/accounting_api.rb
# Allows you to create Attachments on CreditNote by file name
# @param xero_tenant_id [String] Xero identifier for Tenant
# @param credit_note_id [String] Unique identifier for a Credit Note
# @param file_name [String] Name of the file you are attaching to Credit Note
# @param body [String] Byte array of file in body of request
# @param [Hash] opts the optional parameters
# @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers
Allows you to create Attachments on CreditNote by file name
Allows you to create Attachments on CreditNote by file name
def create_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_credit_note_attachment_by_file_name ...'
      end
      if @api_client.config.client_side_validation && xero_tenant_id.nil?
        fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_credit_note_attachment_by_file_name"
      end
      if @api_client.config.client_side_validation && credit_note_id.nil?
        fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.create_credit_note_attachment_by_file_name"
      end
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_credit_note_attachment_by_file_name"
      end
      if @api_client.config.client_side_validation && body.nil?
        fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_credit_note_attachment_by_file_name"
      end
      local_var_path = '/CreditNotes/{CreditNoteID}/Attachments/{FileName}'.sub('{' + 'CreditNoteID' + '}', CGI.escape(credit_note_id.to_s)).sub('{' + 'FileName' + '}', CGI.escape(file_name.to_s))
      query_params = opts[:query_params] || {}
      header_params = opts[:header_params] || {}
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream'])
      header_params[:'Xero-Tenant-Id'] = xero_tenant_id
      form_params = opts[:form_params] || {}
      post_body = opts[:body] || @api_client.object_to_http_body(body) 
      return_type = opts[:return_type] || 'Attachments' 
      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, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AccountingApi#create_credit_note_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
def create_credit_note_attachment_by_file_name_with_http_info ( xero_tenant_id , credit_note_id , file_name , body , opts = { } ) if @api_client . config . debugging @api_client . config . logger . debug 'Calling API: AccountingApi.create_credit_note_attachment_by_file_name ...' end if @api_client . config . client_side_validation && xero_tenant_id . nil? fail ArgumentError , "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_credit_note_attachment_by_file_name" end if @api_client . config . client_side_validation && credit_note_id . nil? fail ArgumentError , "Missing the required parameter 'credit_note_id' when calling AccountingApi.create_credit_note_attachment_by_file_name" end if @api_client . config . client_side_validation && file_name . nil? fail ArgumentError , "Missing the required parameter 'file_name' when calling AccountingApi.create_credit_note_attachment_by_file_name" end if @api_client . config . client_side_validation && body . nil? fail ArgumentError , "Missing the required parameter 'body' when calling AccountingApi.create_credit_note_attachment_by_file_name" end local_var_path = '/CreditNotes/{CreditNoteID}/Attachments/{FileName}' . sub ( '{' + 'CreditNoteID' + '}' , CGI . escape ( credit_note_id . to_s ) ) . sub ( '{' + 'FileName' + '}' , CGI . escape ( file_name . to_s ) ) query_params = opts [ :query_params ] || { } header_params = opts [ :header_params ] || { } header_params [ 'Accept' ] = @api_client . select_header_accept ( [ 'application/json' ] ) header_params [ 'Content-Type' ] = @api_client . select_header_content_type ( [ 'application/octet-stream' ] ) header_params [ :' Xero-Tenant-Id ' ] = xero_tenant_id form_params = opts [ :form_params ] || { } post_body = opts [ :body ] || @api_client . object_to_http_body ( body ) return_type = opts [ :return_type ] || 'Attachments' 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 , new_options ) if @api_client . config . debugging @api_client . config . logger . debug "API called: AccountingApi#create_credit_note_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data , status_code , headers end
Allows you to create Attachments on CreditNote by file name
Allows you to create Attachments on CreditNote by file name
# verify the required parameter 'xero_tenant_id' is set # verify the required parameter 'credit_note_id' is set # verify the required parameter 'file_name' is set # verify the required parameter 'body' is set # resource path # query parameters # header parameters # HTTP header 'Accept' (if needed) # HTTP header 'Content-Type' # form parameters # http body (model) # return_type # auth_names
Attachments data, response status code and response headers
Attachments data response status code and response headers
Array<(Attachments, Integer, Hash)>
xero_tenant_id
Xero identifier for Tenant
Xero identifier for Tenant
credit_note_id
Unique identifier for a Credit Note
Unique identifier for a Credit Note
file_name
Name of the file you are attaching to Credit Note
Name of the file you are attaching to Credit Note
body
Byte array of file in body of request
Byte array of file in body of request
opts
opts the optional parameters
opts the optional parameters