=begin
#Accounting API

#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

The version of the OpenAPI document: 2.1.0
Contact: api@xero.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.3.0

=end

require 'cgi'

module XeroRuby
  class AccountingApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # Allows you to create a new chart of accounts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param account [Account] Account object in body of request
    # @param [Hash] opts the optional parameters
    # @return [Accounts]
    def create_account(xero_tenant_id, account, opts = {})
      data, _status_code, _headers = create_account_with_http_info(xero_tenant_id, account, opts)
      data
    end

    # Allows you to create a new chart of accounts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param account [Account] Account object in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(Accounts, Integer, Hash)>] Accounts data, response status code and response headers
    def create_account_with_http_info(xero_tenant_id, account, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_account ...'
      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 AccountingApi.create_account"
      end
      # verify the required parameter 'account' is set
      if @api_client.config.client_side_validation && account.nil?
        fail ArgumentError, "Missing the required parameter 'account' when calling AccountingApi.create_account"
      end
      # resource path
      local_var_path = '/Accounts'

      # 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'
      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(account) 

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

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

    # Allows you to create Attachment on Account
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param account_id [String] Unique identifier for Account object
    # @param file_name [String] Name of the attachment
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def create_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body, opts = {})
      data, _status_code, _headers = create_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_id, file_name, body, opts)
      data
    end

    # Allows you to create Attachment on Account
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param account_id [String] Unique identifier for Account object
    # @param file_name [String] Name of the attachment
    # @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
    def create_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_account_attachment_by_file_name ...'
      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 AccountingApi.create_account_attachment_by_file_name"
      end
      # verify the required parameter 'account_id' is set
      if @api_client.config.client_side_validation && account_id.nil?
        fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.create_account_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_account_attachment_by_file_name"
      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 AccountingApi.create_account_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/Accounts/{AccountID}/Attachments/{FileName}'.sub('{' + 'AccountID' + '}', account_id.to_s).sub('{' + 'FileName' + '}', file_name.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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(body) 

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

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

    # Allows you to createa an Attachment on BankTransaction by Filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
    # @param file_name [String] The name of the file being attached
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def create_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body, opts = {})
      data, _status_code, _headers = create_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transaction_id, file_name, body, opts)
      data
    end

    # Allows you to createa an Attachment on BankTransaction by Filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
    # @param file_name [String] The name of the file being attached
    # @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
    def create_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transaction_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_bank_transaction_attachment_by_file_name ...'
      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 AccountingApi.create_bank_transaction_attachment_by_file_name"
      end
      # verify the required parameter 'bank_transaction_id' is set
      if @api_client.config.client_side_validation && bank_transaction_id.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.create_bank_transaction_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_bank_transaction_attachment_by_file_name"
      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 AccountingApi.create_bank_transaction_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/BankTransactions/{BankTransactionID}/Attachments/{FileName}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s).sub('{' + 'FileName' + '}', file_name.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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(body) 

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

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

    # Allows you to create history record for a bank transactions
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def create_bank_transaction_history_record(xero_tenant_id, bank_transaction_id, history_records, opts = {})
      data, _status_code, _headers = create_bank_transaction_history_record_with_http_info(xero_tenant_id, bank_transaction_id, history_records, opts)
      data
    end

    # Allows you to create history record for a bank transactions
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def create_bank_transaction_history_record_with_http_info(xero_tenant_id, bank_transaction_id, history_records, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_bank_transaction_history_record ...'
      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 AccountingApi.create_bank_transaction_history_record"
      end
      # verify the required parameter 'bank_transaction_id' is set
      if @api_client.config.client_side_validation && bank_transaction_id.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.create_bank_transaction_history_record"
      end
      # verify the required parameter 'history_records' is set
      if @api_client.config.client_side_validation && history_records.nil?
        fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_bank_transaction_history_record"
      end
      # resource path
      local_var_path = '/BankTransactions/{BankTransactionID}/History'.sub('{' + 'BankTransactionID' + '}', bank_transaction_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'
      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(history_records) 

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

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

    # Allows you to create one or more spend or receive money transaction
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transactions [BankTransactions] BankTransactions with an array of BankTransaction objects in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [BankTransactions]
    def create_bank_transactions(xero_tenant_id, bank_transactions, opts = {})
      data, _status_code, _headers = create_bank_transactions_with_http_info(xero_tenant_id, bank_transactions, opts)
      data
    end

    # Allows you to create one or more spend or receive money transaction
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transactions [BankTransactions] BankTransactions with an array of BankTransaction objects in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers
    def create_bank_transactions_with_http_info(xero_tenant_id, bank_transactions, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_bank_transactions ...'
      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 AccountingApi.create_bank_transactions"
      end
      # verify the required parameter 'bank_transactions' is set
      if @api_client.config.client_side_validation && bank_transactions.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transactions' when calling AccountingApi.create_bank_transactions"
      end
      # resource path
      local_var_path = '/BankTransactions'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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(bank_transactions) 

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

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

    # Allows you to create a bank transfers
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transfers [BankTransfers] BankTransfers with array of BankTransfer objects in request body
    # @param [Hash] opts the optional parameters
    # @return [BankTransfers]
    def create_bank_transfer(xero_tenant_id, bank_transfers, opts = {})
      data, _status_code, _headers = create_bank_transfer_with_http_info(xero_tenant_id, bank_transfers, opts)
      data
    end

    # Allows you to create a bank transfers
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transfers [BankTransfers] BankTransfers with array of BankTransfer objects in request body
    # @param [Hash] opts the optional parameters
    # @return [Array<(BankTransfers, Integer, Hash)>] BankTransfers data, response status code and response headers
    def create_bank_transfer_with_http_info(xero_tenant_id, bank_transfers, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_bank_transfer ...'
      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 AccountingApi.create_bank_transfer"
      end
      # verify the required parameter 'bank_transfers' is set
      if @api_client.config.client_side_validation && bank_transfers.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transfers' when calling AccountingApi.create_bank_transfer"
      end
      # resource path
      local_var_path = '/BankTransfers'

      # 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'
      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(bank_transfers) 

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

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

    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer
    # @param file_name [String] The name of the file being attached to a Bank Transfer
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def create_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body, opts = {})
      data, _status_code, _headers = create_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transfer_id, file_name, body, opts)
      data
    end

    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer
    # @param file_name [String] The name of the file being attached to a Bank Transfer
    # @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
    def create_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transfer_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_bank_transfer_attachment_by_file_name ...'
      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 AccountingApi.create_bank_transfer_attachment_by_file_name"
      end
      # verify the required parameter 'bank_transfer_id' is set
      if @api_client.config.client_side_validation && bank_transfer_id.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.create_bank_transfer_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_bank_transfer_attachment_by_file_name"
      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 AccountingApi.create_bank_transfer_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/BankTransfers/{BankTransferID}/Attachments/{FileName}'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s).sub('{' + 'FileName' + '}', file_name.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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(body) 

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

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

    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def create_bank_transfer_history_record(xero_tenant_id, bank_transfer_id, history_records, opts = {})
      data, _status_code, _headers = create_bank_transfer_history_record_with_http_info(xero_tenant_id, bank_transfer_id, history_records, opts)
      data
    end

    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def create_bank_transfer_history_record_with_http_info(xero_tenant_id, bank_transfer_id, history_records, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_bank_transfer_history_record ...'
      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 AccountingApi.create_bank_transfer_history_record"
      end
      # verify the required parameter 'bank_transfer_id' is set
      if @api_client.config.client_side_validation && bank_transfer_id.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.create_bank_transfer_history_record"
      end
      # verify the required parameter 'history_records' is set
      if @api_client.config.client_side_validation && history_records.nil?
        fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_bank_transfer_history_record"
      end
      # resource path
      local_var_path = '/BankTransfers/{BankTransferID}/History'.sub('{' + 'BankTransferID' + '}', bank_transfer_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'
      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(history_records) 

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

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

    # Create one or many BatchPayments for invoices
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param batch_payments [BatchPayments] BatchPayments with an array of Payments in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @return [BatchPayments]
    def create_batch_payment(xero_tenant_id, batch_payments, opts = {})
      data, _status_code, _headers = create_batch_payment_with_http_info(xero_tenant_id, batch_payments, opts)
      data
    end

    # Create one or many BatchPayments for invoices
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param batch_payments [BatchPayments] BatchPayments with an array of Payments in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @return [Array<(BatchPayments, Integer, Hash)>] BatchPayments data, response status code and response headers
    def create_batch_payment_with_http_info(xero_tenant_id, batch_payments, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_batch_payment ...'
      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 AccountingApi.create_batch_payment"
      end
      # verify the required parameter 'batch_payments' is set
      if @api_client.config.client_side_validation && batch_payments.nil?
        fail ArgumentError, "Missing the required parameter 'batch_payments' when calling AccountingApi.create_batch_payment"
      end
      # resource path
      local_var_path = '/BatchPayments'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].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(batch_payments) 

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

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

    # Allows you to create a history record for a Batch Payment
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param batch_payment_id [String] Unique identifier for BatchPayment
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def create_batch_payment_history_record(xero_tenant_id, batch_payment_id, history_records, opts = {})
      data, _status_code, _headers = create_batch_payment_history_record_with_http_info(xero_tenant_id, batch_payment_id, history_records, opts)
      data
    end

    # Allows you to create a history record for a Batch Payment
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param batch_payment_id [String] Unique identifier for BatchPayment
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def create_batch_payment_history_record_with_http_info(xero_tenant_id, batch_payment_id, history_records, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_batch_payment_history_record ...'
      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 AccountingApi.create_batch_payment_history_record"
      end
      # verify the required parameter 'batch_payment_id' is set
      if @api_client.config.client_side_validation && batch_payment_id.nil?
        fail ArgumentError, "Missing the required parameter 'batch_payment_id' when calling AccountingApi.create_batch_payment_history_record"
      end
      # verify the required parameter 'history_records' is set
      if @api_client.config.client_side_validation && history_records.nil?
        fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_batch_payment_history_record"
      end
      # resource path
      local_var_path = '/BatchPayments/{BatchPaymentID}/History'.sub('{' + 'BatchPaymentID' + '}', batch_payment_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'
      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(history_records) 

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

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

    # Allow for the creation of new custom payment service for specified Branding Theme
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param branding_theme_id [String] Unique identifier for a Branding Theme
    # @param payment_service [PaymentService] PaymentService object in body of request
    # @param [Hash] opts the optional parameters
    # @return [PaymentServices]
    def create_branding_theme_payment_services(xero_tenant_id, branding_theme_id, payment_service, opts = {})
      data, _status_code, _headers = create_branding_theme_payment_services_with_http_info(xero_tenant_id, branding_theme_id, payment_service, opts)
      data
    end

    # Allow for the creation of new custom payment service for specified Branding Theme
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param branding_theme_id [String] Unique identifier for a Branding Theme
    # @param payment_service [PaymentService] PaymentService object in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(PaymentServices, Integer, Hash)>] PaymentServices data, response status code and response headers
    def create_branding_theme_payment_services_with_http_info(xero_tenant_id, branding_theme_id, payment_service, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_branding_theme_payment_services ...'
      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 AccountingApi.create_branding_theme_payment_services"
      end
      # verify the required parameter 'branding_theme_id' is set
      if @api_client.config.client_side_validation && branding_theme_id.nil?
        fail ArgumentError, "Missing the required parameter 'branding_theme_id' when calling AccountingApi.create_branding_theme_payment_services"
      end
      # verify the required parameter 'payment_service' is set
      if @api_client.config.client_side_validation && payment_service.nil?
        fail ArgumentError, "Missing the required parameter 'payment_service' when calling AccountingApi.create_branding_theme_payment_services"
      end
      # resource path
      local_var_path = '/BrandingThemes/{BrandingThemeID}/PaymentServices'.sub('{' + 'BrandingThemeID' + '}', branding_theme_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'
      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(payment_service) 

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

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

    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param file_name [String] Name for the file you are attaching
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def create_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body, opts = {})
      data, _status_code, _headers = create_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_id, file_name, body, opts)
      data
    end

    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param file_name [String] Name for the file you are attaching
    # @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
    def create_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_contact_attachment_by_file_name ...'
      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 AccountingApi.create_contact_attachment_by_file_name"
      end
      # verify the required parameter 'contact_id' is set
      if @api_client.config.client_side_validation && contact_id.nil?
        fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.create_contact_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_contact_attachment_by_file_name"
      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 AccountingApi.create_contact_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/Contacts/{ContactID}/Attachments/{FileName}'.sub('{' + 'ContactID' + '}', contact_id.to_s).sub('{' + 'FileName' + '}', file_name.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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(body) 

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

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

    # Allows you to create a contact group
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_groups [ContactGroups] ContactGroups with an array of names in request body
    # @param [Hash] opts the optional parameters
    # @return [ContactGroups]
    def create_contact_group(xero_tenant_id, contact_groups, opts = {})
      data, _status_code, _headers = create_contact_group_with_http_info(xero_tenant_id, contact_groups, opts)
      data
    end

    # Allows you to create a contact group
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_groups [ContactGroups] ContactGroups with an array of names in request body
    # @param [Hash] opts the optional parameters
    # @return [Array<(ContactGroups, Integer, Hash)>] ContactGroups data, response status code and response headers
    def create_contact_group_with_http_info(xero_tenant_id, contact_groups, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_contact_group ...'
      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 AccountingApi.create_contact_group"
      end
      # verify the required parameter 'contact_groups' is set
      if @api_client.config.client_side_validation && contact_groups.nil?
        fail ArgumentError, "Missing the required parameter 'contact_groups' when calling AccountingApi.create_contact_group"
      end
      # resource path
      local_var_path = '/ContactGroups'

      # 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'
      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(contact_groups) 

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

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

    # Allows you to add Contacts to a Contact Group
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_group_id [String] Unique identifier for a Contact Group
    # @param contacts [Contacts] Contacts with array of contacts specifiying the ContactID to be added to ContactGroup in body of request
    # @param [Hash] opts the optional parameters
    # @return [Contacts]
    def create_contact_group_contacts(xero_tenant_id, contact_group_id, contacts, opts = {})
      data, _status_code, _headers = create_contact_group_contacts_with_http_info(xero_tenant_id, contact_group_id, contacts, opts)
      data
    end

    # Allows you to add Contacts to a Contact Group
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_group_id [String] Unique identifier for a Contact Group
    # @param contacts [Contacts] Contacts with array of contacts specifiying the ContactID to be added to ContactGroup in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers
    def create_contact_group_contacts_with_http_info(xero_tenant_id, contact_group_id, contacts, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_contact_group_contacts ...'
      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 AccountingApi.create_contact_group_contacts"
      end
      # verify the required parameter 'contact_group_id' is set
      if @api_client.config.client_side_validation && contact_group_id.nil?
        fail ArgumentError, "Missing the required parameter 'contact_group_id' when calling AccountingApi.create_contact_group_contacts"
      end
      # verify the required parameter 'contacts' is set
      if @api_client.config.client_side_validation && contacts.nil?
        fail ArgumentError, "Missing the required parameter 'contacts' when calling AccountingApi.create_contact_group_contacts"
      end
      # resource path
      local_var_path = '/ContactGroups/{ContactGroupID}/Contacts'.sub('{' + 'ContactGroupID' + '}', contact_group_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'
      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(contacts) 

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

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

    # Allows you to retrieve a history records of an Contact
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def create_contact_history(xero_tenant_id, contact_id, history_records, opts = {})
      data, _status_code, _headers = create_contact_history_with_http_info(xero_tenant_id, contact_id, history_records, opts)
      data
    end

    # Allows you to retrieve a history records of an Contact
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def create_contact_history_with_http_info(xero_tenant_id, contact_id, history_records, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_contact_history ...'
      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 AccountingApi.create_contact_history"
      end
      # verify the required parameter 'contact_id' is set
      if @api_client.config.client_side_validation && contact_id.nil?
        fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.create_contact_history"
      end
      # verify the required parameter 'history_records' is set
      if @api_client.config.client_side_validation && history_records.nil?
        fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_contact_history"
      end
      # resource path
      local_var_path = '/Contacts/{ContactID}/History'.sub('{' + 'ContactID' + '}', contact_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'
      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(history_records) 

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

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

    # Allows you to create a multiple contacts (bulk) in a Xero organisation
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contacts [Contacts] Contacts with an array of Contact objects to create in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @return [Contacts]
    def create_contacts(xero_tenant_id, contacts, opts = {})
      data, _status_code, _headers = create_contacts_with_http_info(xero_tenant_id, contacts, opts)
      data
    end

    # Allows you to create a multiple contacts (bulk) in a Xero organisation
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contacts [Contacts] Contacts with an array of Contact objects to create in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers
    def create_contacts_with_http_info(xero_tenant_id, contacts, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_contacts ...'
      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 AccountingApi.create_contacts"
      end
      # verify the required parameter 'contacts' is set
      if @api_client.config.client_side_validation && contacts.nil?
        fail ArgumentError, "Missing the required parameter 'contacts' when calling AccountingApi.create_contacts"
      end
      # resource path
      local_var_path = '/Contacts'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].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(contacts) 

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

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

    # Allows you to create Allocation on CreditNote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_note_id [String] Unique identifier for a Credit Note
    # @param allocations [Allocations] Allocations with array of Allocation object in body of request.
    # @param [Hash] opts the optional parameters
    # @return [Allocations]
    def create_credit_note_allocation(xero_tenant_id, credit_note_id, allocations, opts = {})
      data, _status_code, _headers = create_credit_note_allocation_with_http_info(xero_tenant_id, credit_note_id, allocations, opts)
      data
    end

    # Allows you to create Allocation on CreditNote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_note_id [String] Unique identifier for a Credit Note
    # @param allocations [Allocations] Allocations with array of Allocation object in body of request.
    # @param [Hash] opts the optional parameters
    # @return [Array<(Allocations, Integer, Hash)>] Allocations data, response status code and response headers
    def create_credit_note_allocation_with_http_info(xero_tenant_id, credit_note_id, allocations, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_credit_note_allocation ...'
      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 AccountingApi.create_credit_note_allocation"
      end
      # verify the required parameter 'credit_note_id' is set
      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_allocation"
      end
      # verify the required parameter 'allocations' is set
      if @api_client.config.client_side_validation && allocations.nil?
        fail ArgumentError, "Missing the required parameter 'allocations' when calling AccountingApi.create_credit_note_allocation"
      end
      # resource path
      local_var_path = '/CreditNotes/{CreditNoteID}/Allocations'.sub('{' + 'CreditNoteID' + '}', credit_note_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'
      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(allocations) 

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

      # 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, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AccountingApi#create_credit_note_allocation\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
    # @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
    # @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice (default to false)
    # @return [Attachments]
    def create_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body, opts = {})
      data, _status_code, _headers = create_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, body, opts)
      data
    end

    # 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
    # @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice
    # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers
    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
      # 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 AccountingApi.create_credit_note_attachment_by_file_name"
      end
      # verify the required parameter 'credit_note_id' is set
      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
      # verify the required parameter 'file_name' is set
      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
      # 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 AccountingApi.create_credit_note_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/CreditNotes/{CreditNoteID}/Attachments/{FileName}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s)

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'IncludeOnline'] = opts[:'include_online'] if !opts[:'include_online'].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/octet-stream'])
      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(body) 

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

      # 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, 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 retrieve a history records of an CreditNote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_note_id [String] Unique identifier for a Credit Note
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def create_credit_note_history(xero_tenant_id, credit_note_id, history_records, opts = {})
      data, _status_code, _headers = create_credit_note_history_with_http_info(xero_tenant_id, credit_note_id, history_records, opts)
      data
    end

    # Allows you to retrieve a history records of an CreditNote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_note_id [String] Unique identifier for a Credit Note
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def create_credit_note_history_with_http_info(xero_tenant_id, credit_note_id, history_records, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_credit_note_history ...'
      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 AccountingApi.create_credit_note_history"
      end
      # verify the required parameter 'credit_note_id' is set
      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_history"
      end
      # verify the required parameter 'history_records' is set
      if @api_client.config.client_side_validation && history_records.nil?
        fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_credit_note_history"
      end
      # resource path
      local_var_path = '/CreditNotes/{CreditNoteID}/History'.sub('{' + 'CreditNoteID' + '}', credit_note_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'
      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(history_records) 

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

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

    # Allows you to create a credit note
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_notes [CreditNotes] Credit Notes with array of CreditNote object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [CreditNotes]
    def create_credit_notes(xero_tenant_id, credit_notes, opts = {})
      data, _status_code, _headers = create_credit_notes_with_http_info(xero_tenant_id, credit_notes, opts)
      data
    end

    # Allows you to create a credit note
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_notes [CreditNotes] Credit Notes with array of CreditNote object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(CreditNotes, Integer, Hash)>] CreditNotes data, response status code and response headers
    def create_credit_notes_with_http_info(xero_tenant_id, credit_notes, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_credit_notes ...'
      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 AccountingApi.create_credit_notes"
      end
      # verify the required parameter 'credit_notes' is set
      if @api_client.config.client_side_validation && credit_notes.nil?
        fail ArgumentError, "Missing the required parameter 'credit_notes' when calling AccountingApi.create_credit_notes"
      end
      # resource path
      local_var_path = '/CreditNotes'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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(credit_notes) 

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

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

    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param currency [Currency] Currency obejct in the body of request
    # @param [Hash] opts the optional parameters
    # @return [Currencies]
    def create_currency(xero_tenant_id, currency, opts = {})
      data, _status_code, _headers = create_currency_with_http_info(xero_tenant_id, currency, opts)
      data
    end

    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param currency [Currency] Currency obejct in the body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(Currencies, Integer, Hash)>] Currencies data, response status code and response headers
    def create_currency_with_http_info(xero_tenant_id, currency, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_currency ...'
      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 AccountingApi.create_currency"
      end
      # verify the required parameter 'currency' is set
      if @api_client.config.client_side_validation && currency.nil?
        fail ArgumentError, "Missing the required parameter 'currency' when calling AccountingApi.create_currency"
      end
      # resource path
      local_var_path = '/Currencies'

      # 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'
      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(currency) 

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

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

    # Allows you to create new employees used in Xero payrun
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param employees [Employees] Employees with array of Employee object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @return [Employees]
    def create_employees(xero_tenant_id, employees, opts = {})
      data, _status_code, _headers = create_employees_with_http_info(xero_tenant_id, employees, opts)
      data
    end

    # Allows you to create new employees used in Xero payrun
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param employees [Employees] Employees with array of Employee object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers
    def create_employees_with_http_info(xero_tenant_id, employees, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_employees ...'
      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 AccountingApi.create_employees"
      end
      # verify the required parameter 'employees' is set
      if @api_client.config.client_side_validation && employees.nil?
        fail ArgumentError, "Missing the required parameter 'employees' when calling AccountingApi.create_employees"
      end
      # resource path
      local_var_path = '/Employees'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].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(employees) 

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

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

    # Allows you to create a history records of an ExpenseClaim
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param expense_claim_id [String] Unique identifier for a ExpenseClaim
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def create_expense_claim_history(xero_tenant_id, expense_claim_id, history_records, opts = {})
      data, _status_code, _headers = create_expense_claim_history_with_http_info(xero_tenant_id, expense_claim_id, history_records, opts)
      data
    end

    # Allows you to create a history records of an ExpenseClaim
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param expense_claim_id [String] Unique identifier for a ExpenseClaim
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def create_expense_claim_history_with_http_info(xero_tenant_id, expense_claim_id, history_records, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_expense_claim_history ...'
      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 AccountingApi.create_expense_claim_history"
      end
      # verify the required parameter 'expense_claim_id' is set
      if @api_client.config.client_side_validation && expense_claim_id.nil?
        fail ArgumentError, "Missing the required parameter 'expense_claim_id' when calling AccountingApi.create_expense_claim_history"
      end
      # verify the required parameter 'history_records' is set
      if @api_client.config.client_side_validation && history_records.nil?
        fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_expense_claim_history"
      end
      # resource path
      local_var_path = '/ExpenseClaims/{ExpenseClaimID}/History'.sub('{' + 'ExpenseClaimID' + '}', expense_claim_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'
      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(history_records) 

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

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

    # Allows you to retrieve expense claims
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param expense_claims [ExpenseClaims] ExpenseClaims with array of ExpenseClaim object in body of request
    # @param [Hash] opts the optional parameters
    # @return [ExpenseClaims]
    def create_expense_claims(xero_tenant_id, expense_claims, opts = {})
      data, _status_code, _headers = create_expense_claims_with_http_info(xero_tenant_id, expense_claims, opts)
      data
    end

    # Allows you to retrieve expense claims
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param expense_claims [ExpenseClaims] ExpenseClaims with array of ExpenseClaim object in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(ExpenseClaims, Integer, Hash)>] ExpenseClaims data, response status code and response headers
    def create_expense_claims_with_http_info(xero_tenant_id, expense_claims, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_expense_claims ...'
      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 AccountingApi.create_expense_claims"
      end
      # verify the required parameter 'expense_claims' is set
      if @api_client.config.client_side_validation && expense_claims.nil?
        fail ArgumentError, "Missing the required parameter 'expense_claims' when calling AccountingApi.create_expense_claims"
      end
      # resource path
      local_var_path = '/ExpenseClaims'

      # 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'
      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(expense_claims) 

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

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

    # Allows you to create an Attachment on invoices or purchase bills by it's filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param file_name [String] Name of the file you are attaching
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice (default to false)
    # @return [Attachments]
    def create_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body, opts = {})
      data, _status_code, _headers = create_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, body, opts)
      data
    end

    # Allows you to create an Attachment on invoices or purchase bills by it&#39;s filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param file_name [String] Name of the file you are attaching
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice
    # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers
    def create_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_invoice_attachment_by_file_name ...'
      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 AccountingApi.create_invoice_attachment_by_file_name"
      end
      # verify the required parameter 'invoice_id' is set
      if @api_client.config.client_side_validation && invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.create_invoice_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_invoice_attachment_by_file_name"
      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 AccountingApi.create_invoice_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/Invoices/{InvoiceID}/Attachments/{FileName}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s)

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'IncludeOnline'] = opts[:'include_online'] if !opts[:'include_online'].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/octet-stream'])
      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(body) 

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

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

    # Allows you to retrieve a history records of an invoice
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def create_invoice_history(xero_tenant_id, invoice_id, history_records, opts = {})
      data, _status_code, _headers = create_invoice_history_with_http_info(xero_tenant_id, invoice_id, history_records, opts)
      data
    end

    # Allows you to retrieve a history records of an invoice
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def create_invoice_history_with_http_info(xero_tenant_id, invoice_id, history_records, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_invoice_history ...'
      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 AccountingApi.create_invoice_history"
      end
      # verify the required parameter 'invoice_id' is set
      if @api_client.config.client_side_validation && invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.create_invoice_history"
      end
      # verify the required parameter 'history_records' is set
      if @api_client.config.client_side_validation && history_records.nil?
        fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_invoice_history"
      end
      # resource path
      local_var_path = '/Invoices/{InvoiceID}/History'.sub('{' + 'InvoiceID' + '}', invoice_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'
      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(history_records) 

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

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

    # Allows you to create one or more sales invoices or purchase bills
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoices [Invoices] Invoices with an array of invoice objects in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Invoices]
    def create_invoices(xero_tenant_id, invoices, opts = {})
      data, _status_code, _headers = create_invoices_with_http_info(xero_tenant_id, invoices, opts)
      data
    end

    # Allows you to create one or more sales invoices or purchase bills
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoices [Invoices] Invoices with an array of invoice objects in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(Invoices, Integer, Hash)>] Invoices data, response status code and response headers
    def create_invoices_with_http_info(xero_tenant_id, invoices, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_invoices ...'
      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 AccountingApi.create_invoices"
      end
      # verify the required parameter 'invoices' is set
      if @api_client.config.client_side_validation && invoices.nil?
        fail ArgumentError, "Missing the required parameter 'invoices' when calling AccountingApi.create_invoices"
      end
      # resource path
      local_var_path = '/Invoices'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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(invoices) 

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

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

    # Allows you to create a history record for items
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param item_id [String] Unique identifier for an Item
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def create_item_history(xero_tenant_id, item_id, history_records, opts = {})
      data, _status_code, _headers = create_item_history_with_http_info(xero_tenant_id, item_id, history_records, opts)
      data
    end

    # Allows you to create a history record for items
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param item_id [String] Unique identifier for an Item
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def create_item_history_with_http_info(xero_tenant_id, item_id, history_records, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_item_history ...'
      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 AccountingApi.create_item_history"
      end
      # verify the required parameter 'item_id' is set
      if @api_client.config.client_side_validation && item_id.nil?
        fail ArgumentError, "Missing the required parameter 'item_id' when calling AccountingApi.create_item_history"
      end
      # verify the required parameter 'history_records' is set
      if @api_client.config.client_side_validation && history_records.nil?
        fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_item_history"
      end
      # resource path
      local_var_path = '/Items/{ItemID}/History'.sub('{' + 'ItemID' + '}', item_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'
      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(history_records) 

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

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

    # Allows you to create one or more items
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param items [Items] Items with an array of Item objects in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Items]
    def create_items(xero_tenant_id, items, opts = {})
      data, _status_code, _headers = create_items_with_http_info(xero_tenant_id, items, opts)
      data
    end

    # Allows you to create one or more items
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param items [Items] Items with an array of Item objects in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(Items, Integer, Hash)>] Items data, response status code and response headers
    def create_items_with_http_info(xero_tenant_id, items, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_items ...'
      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 AccountingApi.create_items"
      end
      # verify the required parameter 'items' is set
      if @api_client.config.client_side_validation && items.nil?
        fail ArgumentError, "Missing the required parameter 'items' when calling AccountingApi.create_items"
      end
      # resource path
      local_var_path = '/Items'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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(items) 

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

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

    # Allows you to create linked transactions (billable expenses)
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param linked_transaction [LinkedTransaction] LinkedTransaction object in body of request
    # @param [Hash] opts the optional parameters
    # @return [LinkedTransactions]
    def create_linked_transaction(xero_tenant_id, linked_transaction, opts = {})
      data, _status_code, _headers = create_linked_transaction_with_http_info(xero_tenant_id, linked_transaction, opts)
      data
    end

    # Allows you to create linked transactions (billable expenses)
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param linked_transaction [LinkedTransaction] LinkedTransaction object in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(LinkedTransactions, Integer, Hash)>] LinkedTransactions data, response status code and response headers
    def create_linked_transaction_with_http_info(xero_tenant_id, linked_transaction, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_linked_transaction ...'
      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 AccountingApi.create_linked_transaction"
      end
      # verify the required parameter 'linked_transaction' is set
      if @api_client.config.client_side_validation && linked_transaction.nil?
        fail ArgumentError, "Missing the required parameter 'linked_transaction' when calling AccountingApi.create_linked_transaction"
      end
      # resource path
      local_var_path = '/LinkedTransactions'

      # 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'
      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(linked_transaction) 

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

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

    # Allows you to create a specified Attachment on ManualJournal by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param manual_journal_id [String] Unique identifier for a ManualJournal
    # @param file_name [String] The name of the file being attached to a ManualJournal
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def create_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body, opts = {})
      data, _status_code, _headers = create_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, manual_journal_id, file_name, body, opts)
      data
    end

    # Allows you to create a specified Attachment on ManualJournal by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param manual_journal_id [String] Unique identifier for a ManualJournal
    # @param file_name [String] The name of the file being attached to a ManualJournal
    # @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
    def create_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, manual_journal_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_manual_journal_attachment_by_file_name ...'
      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 AccountingApi.create_manual_journal_attachment_by_file_name"
      end
      # verify the required parameter 'manual_journal_id' is set
      if @api_client.config.client_side_validation && manual_journal_id.nil?
        fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.create_manual_journal_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_manual_journal_attachment_by_file_name"
      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 AccountingApi.create_manual_journal_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/ManualJournals/{ManualJournalID}/Attachments/{FileName}'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s).sub('{' + 'FileName' + '}', file_name.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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(body) 

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

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

    # Allows you to create one or more manual journals
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param manual_journals [ManualJournals] ManualJournals array with ManualJournal object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @return [ManualJournals]
    def create_manual_journals(xero_tenant_id, manual_journals, opts = {})
      data, _status_code, _headers = create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts)
      data
    end

    # Allows you to create one or more manual journals
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param manual_journals [ManualJournals] ManualJournals array with ManualJournal object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @return [Array<(ManualJournals, Integer, Hash)>] ManualJournals data, response status code and response headers
    def create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_manual_journals ...'
      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 AccountingApi.create_manual_journals"
      end
      # verify the required parameter 'manual_journals' is set
      if @api_client.config.client_side_validation && manual_journals.nil?
        fail ArgumentError, "Missing the required parameter 'manual_journals' when calling AccountingApi.create_manual_journals"
      end
      # resource path
      local_var_path = '/ManualJournals'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].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(manual_journals) 

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

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

    # Allows you to create a single allocation for an overpayment
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param overpayment_id [String] Unique identifier for a Overpayment
    # @param allocations [Allocations] Allocations array with Allocation object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @return [Allocations]
    def create_overpayment_allocations(xero_tenant_id, overpayment_id, allocations, opts = {})
      data, _status_code, _headers = create_overpayment_allocations_with_http_info(xero_tenant_id, overpayment_id, allocations, opts)
      data
    end

    # Allows you to create a single allocation for an overpayment
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param overpayment_id [String] Unique identifier for a Overpayment
    # @param allocations [Allocations] Allocations array with Allocation object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @return [Array<(Allocations, Integer, Hash)>] Allocations data, response status code and response headers
    def create_overpayment_allocations_with_http_info(xero_tenant_id, overpayment_id, allocations, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_overpayment_allocations ...'
      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 AccountingApi.create_overpayment_allocations"
      end
      # verify the required parameter 'overpayment_id' is set
      if @api_client.config.client_side_validation && overpayment_id.nil?
        fail ArgumentError, "Missing the required parameter 'overpayment_id' when calling AccountingApi.create_overpayment_allocations"
      end
      # verify the required parameter 'allocations' is set
      if @api_client.config.client_side_validation && allocations.nil?
        fail ArgumentError, "Missing the required parameter 'allocations' when calling AccountingApi.create_overpayment_allocations"
      end
      # resource path
      local_var_path = '/Overpayments/{OverpaymentID}/Allocations'.sub('{' + 'OverpaymentID' + '}', overpayment_id.to_s)

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].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(allocations) 

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

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

    # Allows you to create history records of an Overpayment
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param overpayment_id [String] Unique identifier for a Overpayment
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def create_overpayment_history(xero_tenant_id, overpayment_id, history_records, opts = {})
      data, _status_code, _headers = create_overpayment_history_with_http_info(xero_tenant_id, overpayment_id, history_records, opts)
      data
    end

    # Allows you to create history records of an Overpayment
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param overpayment_id [String] Unique identifier for a Overpayment
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def create_overpayment_history_with_http_info(xero_tenant_id, overpayment_id, history_records, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_overpayment_history ...'
      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 AccountingApi.create_overpayment_history"
      end
      # verify the required parameter 'overpayment_id' is set
      if @api_client.config.client_side_validation && overpayment_id.nil?
        fail ArgumentError, "Missing the required parameter 'overpayment_id' when calling AccountingApi.create_overpayment_history"
      end
      # verify the required parameter 'history_records' is set
      if @api_client.config.client_side_validation && history_records.nil?
        fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_overpayment_history"
      end
      # resource path
      local_var_path = '/Overpayments/{OverpaymentID}/History'.sub('{' + 'OverpaymentID' + '}', overpayment_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'
      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(history_records) 

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

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

    # Allows you to create a single payment for invoices or credit notes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param payment [Payment] Request body with a single Payment object
    # @param [Hash] opts the optional parameters
    # @return [Payments]
    def create_payment(xero_tenant_id, payment, opts = {})
      data, _status_code, _headers = create_payment_with_http_info(xero_tenant_id, payment, opts)
      data
    end

    # Allows you to create a single payment for invoices or credit notes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param payment [Payment] Request body with a single Payment object
    # @param [Hash] opts the optional parameters
    # @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers
    def create_payment_with_http_info(xero_tenant_id, payment, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_payment ...'
      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 AccountingApi.create_payment"
      end
      # verify the required parameter 'payment' is set
      if @api_client.config.client_side_validation && payment.nil?
        fail ArgumentError, "Missing the required parameter 'payment' when calling AccountingApi.create_payment"
      end
      # resource path
      local_var_path = '/Payments'

      # 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'
      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(payment) 

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

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

    # Allows you to create a history record for a payment
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param payment_id [String] Unique identifier for a Payment
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def create_payment_history(xero_tenant_id, payment_id, history_records, opts = {})
      data, _status_code, _headers = create_payment_history_with_http_info(xero_tenant_id, payment_id, history_records, opts)
      data
    end

    # Allows you to create a history record for a payment
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param payment_id [String] Unique identifier for a Payment
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def create_payment_history_with_http_info(xero_tenant_id, payment_id, history_records, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_payment_history ...'
      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 AccountingApi.create_payment_history"
      end
      # verify the required parameter 'payment_id' is set
      if @api_client.config.client_side_validation && payment_id.nil?
        fail ArgumentError, "Missing the required parameter 'payment_id' when calling AccountingApi.create_payment_history"
      end
      # verify the required parameter 'history_records' is set
      if @api_client.config.client_side_validation && history_records.nil?
        fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_payment_history"
      end
      # resource path
      local_var_path = '/Payments/{PaymentID}/History'.sub('{' + 'PaymentID' + '}', payment_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'
      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(history_records) 

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

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

    # Allows you to create payment services
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param payment_services [PaymentServices] PaymentServices array with PaymentService object in body of request
    # @param [Hash] opts the optional parameters
    # @return [PaymentServices]
    def create_payment_service(xero_tenant_id, payment_services, opts = {})
      data, _status_code, _headers = create_payment_service_with_http_info(xero_tenant_id, payment_services, opts)
      data
    end

    # Allows you to create payment services
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param payment_services [PaymentServices] PaymentServices array with PaymentService object in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(PaymentServices, Integer, Hash)>] PaymentServices data, response status code and response headers
    def create_payment_service_with_http_info(xero_tenant_id, payment_services, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_payment_service ...'
      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 AccountingApi.create_payment_service"
      end
      # verify the required parameter 'payment_services' is set
      if @api_client.config.client_side_validation && payment_services.nil?
        fail ArgumentError, "Missing the required parameter 'payment_services' when calling AccountingApi.create_payment_service"
      end
      # resource path
      local_var_path = '/PaymentServices'

      # 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'
      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(payment_services) 

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

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

    # Allows you to create multiple payments for invoices or credit notes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param payments [Payments] Payments array with Payment object in body of request
    # @param [Hash] opts the optional parameters
    # @return [Payments]
    def create_payments(xero_tenant_id, payments, opts = {})
      data, _status_code, _headers = create_payments_with_http_info(xero_tenant_id, payments, opts)
      data
    end

    # Allows you to create multiple payments for invoices or credit notes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param payments [Payments] Payments array with Payment object in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers
    def create_payments_with_http_info(xero_tenant_id, payments, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_payments ...'
      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 AccountingApi.create_payments"
      end
      # verify the required parameter 'payments' is set
      if @api_client.config.client_side_validation && payments.nil?
        fail ArgumentError, "Missing the required parameter 'payments' when calling AccountingApi.create_payments"
      end
      # resource path
      local_var_path = '/Payments'

      # 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'
      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(payments) 

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

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

    # Allows you to create an Allocation for prepayments
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param prepayment_id [String] Unique identifier for Prepayment
    # @param allocations [Allocations] Allocations with an array of Allocation object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @return [Allocations]
    def create_prepayment_allocations(xero_tenant_id, prepayment_id, allocations, opts = {})
      data, _status_code, _headers = create_prepayment_allocations_with_http_info(xero_tenant_id, prepayment_id, allocations, opts)
      data
    end

    # Allows you to create an Allocation for prepayments
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param prepayment_id [String] Unique identifier for Prepayment
    # @param allocations [Allocations] Allocations with an array of Allocation object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @return [Array<(Allocations, Integer, Hash)>] Allocations data, response status code and response headers
    def create_prepayment_allocations_with_http_info(xero_tenant_id, prepayment_id, allocations, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_prepayment_allocations ...'
      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 AccountingApi.create_prepayment_allocations"
      end
      # verify the required parameter 'prepayment_id' is set
      if @api_client.config.client_side_validation && prepayment_id.nil?
        fail ArgumentError, "Missing the required parameter 'prepayment_id' when calling AccountingApi.create_prepayment_allocations"
      end
      # verify the required parameter 'allocations' is set
      if @api_client.config.client_side_validation && allocations.nil?
        fail ArgumentError, "Missing the required parameter 'allocations' when calling AccountingApi.create_prepayment_allocations"
      end
      # resource path
      local_var_path = '/Prepayments/{PrepaymentID}/Allocations'.sub('{' + 'PrepaymentID' + '}', prepayment_id.to_s)

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].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(allocations) 

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

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

    # Allows you to create a history record for an Prepayment
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param prepayment_id [String] Unique identifier for a PrePayment
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def create_prepayment_history(xero_tenant_id, prepayment_id, history_records, opts = {})
      data, _status_code, _headers = create_prepayment_history_with_http_info(xero_tenant_id, prepayment_id, history_records, opts)
      data
    end

    # Allows you to create a history record for an Prepayment
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param prepayment_id [String] Unique identifier for a PrePayment
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def create_prepayment_history_with_http_info(xero_tenant_id, prepayment_id, history_records, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_prepayment_history ...'
      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 AccountingApi.create_prepayment_history"
      end
      # verify the required parameter 'prepayment_id' is set
      if @api_client.config.client_side_validation && prepayment_id.nil?
        fail ArgumentError, "Missing the required parameter 'prepayment_id' when calling AccountingApi.create_prepayment_history"
      end
      # verify the required parameter 'history_records' is set
      if @api_client.config.client_side_validation && history_records.nil?
        fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_prepayment_history"
      end
      # resource path
      local_var_path = '/Prepayments/{PrepaymentID}/History'.sub('{' + 'PrepaymentID' + '}', prepayment_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'
      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(history_records) 

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

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

    # Allows you to create HistoryRecord for purchase orders
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param purchase_order_id [String] Unique identifier for a PurchaseOrder
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def create_purchase_order_history(xero_tenant_id, purchase_order_id, history_records, opts = {})
      data, _status_code, _headers = create_purchase_order_history_with_http_info(xero_tenant_id, purchase_order_id, history_records, opts)
      data
    end

    # Allows you to create HistoryRecord for purchase orders
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param purchase_order_id [String] Unique identifier for a PurchaseOrder
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def create_purchase_order_history_with_http_info(xero_tenant_id, purchase_order_id, history_records, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_purchase_order_history ...'
      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 AccountingApi.create_purchase_order_history"
      end
      # verify the required parameter 'purchase_order_id' is set
      if @api_client.config.client_side_validation && purchase_order_id.nil?
        fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.create_purchase_order_history"
      end
      # verify the required parameter 'history_records' is set
      if @api_client.config.client_side_validation && history_records.nil?
        fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_purchase_order_history"
      end
      # resource path
      local_var_path = '/PurchaseOrders/{PurchaseOrderID}/History'.sub('{' + 'PurchaseOrderID' + '}', purchase_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'
      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(history_records) 

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

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

    # Allows you to create one or more purchase orders
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param purchase_orders [PurchaseOrders] PurchaseOrders with an array of PurchaseOrder object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @return [PurchaseOrders]
    def create_purchase_orders(xero_tenant_id, purchase_orders, opts = {})
      data, _status_code, _headers = create_purchase_orders_with_http_info(xero_tenant_id, purchase_orders, opts)
      data
    end

    # Allows you to create one or more purchase orders
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param purchase_orders [PurchaseOrders] PurchaseOrders with an array of PurchaseOrder object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers
    def create_purchase_orders_with_http_info(xero_tenant_id, purchase_orders, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_purchase_orders ...'
      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 AccountingApi.create_purchase_orders"
      end
      # verify the required parameter 'purchase_orders' is set
      if @api_client.config.client_side_validation && purchase_orders.nil?
        fail ArgumentError, "Missing the required parameter 'purchase_orders' when calling AccountingApi.create_purchase_orders"
      end
      # resource path
      local_var_path = '/PurchaseOrders'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].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(purchase_orders) 

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

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

    # Allows you to create Attachment on Quote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for Quote object
    # @param file_name [String] Name of the attachment
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def create_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body, opts = {})
      data, _status_code, _headers = create_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, file_name, body, opts)
      data
    end

    # Allows you to create Attachment on Quote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for Quote object
    # @param file_name [String] Name of the attachment
    # @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
    def create_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_quote_attachment_by_file_name ...'
      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 AccountingApi.create_quote_attachment_by_file_name"
      end
      # verify the required parameter 'quote_id' is set
      if @api_client.config.client_side_validation && quote_id.nil?
        fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.create_quote_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_quote_attachment_by_file_name"
      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 AccountingApi.create_quote_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/Quotes/{QuoteID}/Attachments/{FileName}'.sub('{' + 'QuoteID' + '}', quote_id.to_s).sub('{' + 'FileName' + '}', file_name.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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(body) 

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

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

    # Allows you to retrieve a history records of an quote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for an Quote
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def create_quote_history(xero_tenant_id, quote_id, history_records, opts = {})
      data, _status_code, _headers = create_quote_history_with_http_info(xero_tenant_id, quote_id, history_records, opts)
      data
    end

    # Allows you to retrieve a history records of an quote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for an Quote
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def create_quote_history_with_http_info(xero_tenant_id, quote_id, history_records, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_quote_history ...'
      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 AccountingApi.create_quote_history"
      end
      # verify the required parameter 'quote_id' is set
      if @api_client.config.client_side_validation && quote_id.nil?
        fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.create_quote_history"
      end
      # verify the required parameter 'history_records' is set
      if @api_client.config.client_side_validation && history_records.nil?
        fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_quote_history"
      end
      # resource path
      local_var_path = '/Quotes/{QuoteID}/History'.sub('{' + 'QuoteID' + '}', quote_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'
      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(history_records) 

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

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

    # Allows you to create one or more quotes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quotes [Quotes] Quotes with an array of Quote object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @return [Quotes]
    def create_quotes(xero_tenant_id, quotes, opts = {})
      data, _status_code, _headers = create_quotes_with_http_info(xero_tenant_id, quotes, opts)
      data
    end

    # Allows you to create one or more quotes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quotes [Quotes] Quotes with an array of Quote object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @return [Array<(Quotes, Integer, Hash)>] Quotes data, response status code and response headers
    def create_quotes_with_http_info(xero_tenant_id, quotes, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_quotes ...'
      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 AccountingApi.create_quotes"
      end
      # verify the required parameter 'quotes' is set
      if @api_client.config.client_side_validation && quotes.nil?
        fail ArgumentError, "Missing the required parameter 'quotes' when calling AccountingApi.create_quotes"
      end
      # resource path
      local_var_path = '/Quotes'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].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(quotes) 

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

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

    # Allows you to create draft expense claim receipts for any user
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipts [Receipts] Receipts with an array of Receipt object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Receipts]
    def create_receipt(xero_tenant_id, receipts, opts = {})
      data, _status_code, _headers = create_receipt_with_http_info(xero_tenant_id, receipts, opts)
      data
    end

    # Allows you to create draft expense claim receipts for any user
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipts [Receipts] Receipts with an array of Receipt object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(Receipts, Integer, Hash)>] Receipts data, response status code and response headers
    def create_receipt_with_http_info(xero_tenant_id, receipts, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_receipt ...'
      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 AccountingApi.create_receipt"
      end
      # verify the required parameter 'receipts' is set
      if @api_client.config.client_side_validation && receipts.nil?
        fail ArgumentError, "Missing the required parameter 'receipts' when calling AccountingApi.create_receipt"
      end
      # resource path
      local_var_path = '/Receipts'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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(receipts) 

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

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

    # Allows you to create Attachment on expense claim receipts by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipt_id [String] Unique identifier for a Receipt
    # @param file_name [String] The name of the file being attached to the Receipt
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def create_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body, opts = {})
      data, _status_code, _headers = create_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_id, file_name, body, opts)
      data
    end

    # Allows you to create Attachment on expense claim receipts by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipt_id [String] Unique identifier for a Receipt
    # @param file_name [String] The name of the file being attached to the Receipt
    # @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
    def create_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_receipt_attachment_by_file_name ...'
      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 AccountingApi.create_receipt_attachment_by_file_name"
      end
      # verify the required parameter 'receipt_id' is set
      if @api_client.config.client_side_validation && receipt_id.nil?
        fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.create_receipt_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_receipt_attachment_by_file_name"
      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 AccountingApi.create_receipt_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/Receipts/{ReceiptID}/Attachments/{FileName}'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s).sub('{' + 'FileName' + '}', file_name.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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(body) 

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

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

    # Allows you to retrieve a history records of an Receipt
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipt_id [String] Unique identifier for a Receipt
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def create_receipt_history(xero_tenant_id, receipt_id, history_records, opts = {})
      data, _status_code, _headers = create_receipt_history_with_http_info(xero_tenant_id, receipt_id, history_records, opts)
      data
    end

    # Allows you to retrieve a history records of an Receipt
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipt_id [String] Unique identifier for a Receipt
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def create_receipt_history_with_http_info(xero_tenant_id, receipt_id, history_records, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_receipt_history ...'
      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 AccountingApi.create_receipt_history"
      end
      # verify the required parameter 'receipt_id' is set
      if @api_client.config.client_side_validation && receipt_id.nil?
        fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.create_receipt_history"
      end
      # verify the required parameter 'history_records' is set
      if @api_client.config.client_side_validation && history_records.nil?
        fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_receipt_history"
      end
      # resource path
      local_var_path = '/Receipts/{ReceiptID}/History'.sub('{' + 'ReceiptID' + '}', receipt_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'
      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(history_records) 

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

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

    # Allows you to create attachment on repeating invoices by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice
    # @param file_name [String] The name of the file being attached to a Repeating Invoice
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def create_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body, opts = {})
      data, _status_code, _headers = create_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, repeating_invoice_id, file_name, body, opts)
      data
    end

    # Allows you to create attachment on repeating invoices by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice
    # @param file_name [String] The name of the file being attached to a Repeating Invoice
    # @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
    def create_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, repeating_invoice_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_repeating_invoice_attachment_by_file_name ...'
      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 AccountingApi.create_repeating_invoice_attachment_by_file_name"
      end
      # verify the required parameter 'repeating_invoice_id' is set
      if @api_client.config.client_side_validation && repeating_invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.create_repeating_invoice_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_repeating_invoice_attachment_by_file_name"
      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 AccountingApi.create_repeating_invoice_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(body) 

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

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

    # Allows you to create history for a repeating invoice
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def create_repeating_invoice_history(xero_tenant_id, repeating_invoice_id, history_records, opts = {})
      data, _status_code, _headers = create_repeating_invoice_history_with_http_info(xero_tenant_id, repeating_invoice_id, history_records, opts)
      data
    end

    # Allows you to create history for a repeating invoice
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice
    # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def create_repeating_invoice_history_with_http_info(xero_tenant_id, repeating_invoice_id, history_records, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_repeating_invoice_history ...'
      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 AccountingApi.create_repeating_invoice_history"
      end
      # verify the required parameter 'repeating_invoice_id' is set
      if @api_client.config.client_side_validation && repeating_invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.create_repeating_invoice_history"
      end
      # verify the required parameter 'history_records' is set
      if @api_client.config.client_side_validation && history_records.nil?
        fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_repeating_invoice_history"
      end
      # resource path
      local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/History'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_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'
      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(history_records) 

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

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

    # Allows you to create one or more Tax Rates
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param tax_rates [TaxRates] TaxRates array with TaxRate object in body of request
    # @param [Hash] opts the optional parameters
    # @return [TaxRates]
    def create_tax_rates(xero_tenant_id, tax_rates, opts = {})
      data, _status_code, _headers = create_tax_rates_with_http_info(xero_tenant_id, tax_rates, opts)
      data
    end

    # Allows you to create one or more Tax Rates
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param tax_rates [TaxRates] TaxRates array with TaxRate object in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(TaxRates, Integer, Hash)>] TaxRates data, response status code and response headers
    def create_tax_rates_with_http_info(xero_tenant_id, tax_rates, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_tax_rates ...'
      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 AccountingApi.create_tax_rates"
      end
      # verify the required parameter 'tax_rates' is set
      if @api_client.config.client_side_validation && tax_rates.nil?
        fail ArgumentError, "Missing the required parameter 'tax_rates' when calling AccountingApi.create_tax_rates"
      end
      # resource path
      local_var_path = '/TaxRates'

      # 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'
      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(tax_rates) 

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

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

    # Allows you to create tracking categories
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param tracking_category [TrackingCategory] TrackingCategory object in body of request
    # @param [Hash] opts the optional parameters
    # @return [TrackingCategories]
    def create_tracking_category(xero_tenant_id, tracking_category, opts = {})
      data, _status_code, _headers = create_tracking_category_with_http_info(xero_tenant_id, tracking_category, opts)
      data
    end

    # Allows you to create tracking categories
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param tracking_category [TrackingCategory] TrackingCategory object in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(TrackingCategories, Integer, Hash)>] TrackingCategories data, response status code and response headers
    def create_tracking_category_with_http_info(xero_tenant_id, tracking_category, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_tracking_category ...'
      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 AccountingApi.create_tracking_category"
      end
      # verify the required parameter 'tracking_category' is set
      if @api_client.config.client_side_validation && tracking_category.nil?
        fail ArgumentError, "Missing the required parameter 'tracking_category' when calling AccountingApi.create_tracking_category"
      end
      # resource path
      local_var_path = '/TrackingCategories'

      # 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'
      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(tracking_category) 

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

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

    # Allows you to create options for a specified tracking category
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param tracking_category_id [String] Unique identifier for a TrackingCategory
    # @param tracking_option [TrackingOption] TrackingOption object in body of request
    # @param [Hash] opts the optional parameters
    # @return [TrackingOptions]
    def create_tracking_options(xero_tenant_id, tracking_category_id, tracking_option, opts = {})
      data, _status_code, _headers = create_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, tracking_option, opts)
      data
    end

    # Allows you to create options for a specified tracking category
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param tracking_category_id [String] Unique identifier for a TrackingCategory
    # @param tracking_option [TrackingOption] TrackingOption object in body of request
    # @param [Hash] opts the optional parameters
    # @return [Array<(TrackingOptions, Integer, Hash)>] TrackingOptions data, response status code and response headers
    def create_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, tracking_option, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.create_tracking_options ...'
      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 AccountingApi.create_tracking_options"
      end
      # verify the required parameter 'tracking_category_id' is set
      if @api_client.config.client_side_validation && tracking_category_id.nil?
        fail ArgumentError, "Missing the required parameter 'tracking_category_id' when calling AccountingApi.create_tracking_options"
      end
      # verify the required parameter 'tracking_option' is set
      if @api_client.config.client_side_validation && tracking_option.nil?
        fail ArgumentError, "Missing the required parameter 'tracking_option' when calling AccountingApi.create_tracking_options"
      end
      # resource path
      local_var_path = '/TrackingCategories/{TrackingCategoryID}/Options'.sub('{' + 'TrackingCategoryID' + '}', tracking_category_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'
      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(tracking_option) 

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

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

    # Allows you to delete a chart of accounts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param account_id [String] Unique identifier for retrieving single object
    # @param [Hash] opts the optional parameters
    # @return [Accounts]
    def delete_account(xero_tenant_id, account_id, opts = {})
      data, _status_code, _headers = delete_account_with_http_info(xero_tenant_id, account_id, opts)
      data
    end

    # Allows you to delete a chart of accounts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param account_id [String] Unique identifier for retrieving single object
    # @param [Hash] opts the optional parameters
    # @return [Array<(Accounts, Integer, Hash)>] Accounts data, response status code and response headers
    def delete_account_with_http_info(xero_tenant_id, account_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.delete_account ...'
      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 AccountingApi.delete_account"
      end
      # verify the required parameter 'account_id' is set
      if @api_client.config.client_side_validation && account_id.nil?
        fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.delete_account"
      end
      # resource path
      local_var_path = '/Accounts/{AccountID}'.sub('{' + 'AccountID' + '}', account_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'])
      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] || 'Accounts' 

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

    # Allows you to delete a specific Contact from a Contact Group
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_group_id [String] Unique identifier for a Contact Group
    # @param contact_id [String] Unique identifier for a Contact
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def delete_contact_group_contact(xero_tenant_id, contact_group_id, contact_id, opts = {})
      delete_contact_group_contact_with_http_info(xero_tenant_id, contact_group_id, contact_id, opts)
      nil
    end

    # Allows you to delete a specific Contact from a Contact Group
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_group_id [String] Unique identifier for a Contact Group
    # @param contact_id [String] Unique identifier for a Contact
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def delete_contact_group_contact_with_http_info(xero_tenant_id, contact_group_id, contact_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.delete_contact_group_contact ...'
      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 AccountingApi.delete_contact_group_contact"
      end
      # verify the required parameter 'contact_group_id' is set
      if @api_client.config.client_side_validation && contact_group_id.nil?
        fail ArgumentError, "Missing the required parameter 'contact_group_id' when calling AccountingApi.delete_contact_group_contact"
      end
      # verify the required parameter 'contact_id' is set
      if @api_client.config.client_side_validation && contact_id.nil?
        fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.delete_contact_group_contact"
      end
      # resource path
      local_var_path = '/ContactGroups/{ContactGroupID}/Contacts/{ContactID}'.sub('{' + 'ContactGroupID' + '}', contact_group_id.to_s).sub('{' + 'ContactID' + '}', contact_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'])
      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, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AccountingApi#delete_contact_group_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Allows you to delete  all Contacts from a Contact Group
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_group_id [String] Unique identifier for a Contact Group
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def delete_contact_group_contacts(xero_tenant_id, contact_group_id, opts = {})
      delete_contact_group_contacts_with_http_info(xero_tenant_id, contact_group_id, opts)
      nil
    end

    # Allows you to delete  all Contacts from a Contact Group
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_group_id [String] Unique identifier for a Contact Group
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def delete_contact_group_contacts_with_http_info(xero_tenant_id, contact_group_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.delete_contact_group_contacts ...'
      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 AccountingApi.delete_contact_group_contacts"
      end
      # verify the required parameter 'contact_group_id' is set
      if @api_client.config.client_side_validation && contact_group_id.nil?
        fail ArgumentError, "Missing the required parameter 'contact_group_id' when calling AccountingApi.delete_contact_group_contacts"
      end
      # resource path
      local_var_path = '/ContactGroups/{ContactGroupID}/Contacts'.sub('{' + 'ContactGroupID' + '}', contact_group_id.to_s)

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

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

    # Allows you to delete a specified item
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param item_id [String] Unique identifier for an Item
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def delete_item(xero_tenant_id, item_id, opts = {})
      delete_item_with_http_info(xero_tenant_id, item_id, opts)
      nil
    end

    # Allows you to delete a specified item
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param item_id [String] Unique identifier for an Item
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def delete_item_with_http_info(xero_tenant_id, item_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.delete_item ...'
      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 AccountingApi.delete_item"
      end
      # verify the required parameter 'item_id' is set
      if @api_client.config.client_side_validation && item_id.nil?
        fail ArgumentError, "Missing the required parameter 'item_id' when calling AccountingApi.delete_item"
      end
      # resource path
      local_var_path = '/Items/{ItemID}'.sub('{' + 'ItemID' + '}', item_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'])
      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, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AccountingApi#delete_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Allows you to delete a specified linked transactions (billable expenses)
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param linked_transaction_id [String] Unique identifier for a LinkedTransaction
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def delete_linked_transaction(xero_tenant_id, linked_transaction_id, opts = {})
      delete_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, opts)
      nil
    end

    # Allows you to delete a specified linked transactions (billable expenses)
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param linked_transaction_id [String] Unique identifier for a LinkedTransaction
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def delete_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.delete_linked_transaction ...'
      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 AccountingApi.delete_linked_transaction"
      end
      # verify the required parameter 'linked_transaction_id' is set
      if @api_client.config.client_side_validation && linked_transaction_id.nil?
        fail ArgumentError, "Missing the required parameter 'linked_transaction_id' when calling AccountingApi.delete_linked_transaction"
      end
      # resource path
      local_var_path = '/LinkedTransactions/{LinkedTransactionID}'.sub('{' + 'LinkedTransactionID' + '}', linked_transaction_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'])
      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, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AccountingApi#delete_linked_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Allows you to update a specified payment for invoices and credit notes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param payment_id [String] Unique identifier for a Payment
    # @param payment_delete [PaymentDelete] 
    # @param [Hash] opts the optional parameters
    # @return [Payments]
    def delete_payment(xero_tenant_id, payment_id, payment_delete, opts = {})
      data, _status_code, _headers = delete_payment_with_http_info(xero_tenant_id, payment_id, payment_delete, opts)
      data
    end

    # Allows you to update a specified payment for invoices and credit notes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param payment_id [String] Unique identifier for a Payment
    # @param payment_delete [PaymentDelete] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers
    def delete_payment_with_http_info(xero_tenant_id, payment_id, payment_delete, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.delete_payment ...'
      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 AccountingApi.delete_payment"
      end
      # verify the required parameter 'payment_id' is set
      if @api_client.config.client_side_validation && payment_id.nil?
        fail ArgumentError, "Missing the required parameter 'payment_id' when calling AccountingApi.delete_payment"
      end
      # verify the required parameter 'payment_delete' is set
      if @api_client.config.client_side_validation && payment_delete.nil?
        fail ArgumentError, "Missing the required parameter 'payment_delete' when calling AccountingApi.delete_payment"
      end
      # resource path
      local_var_path = '/Payments/{PaymentID}'.sub('{' + 'PaymentID' + '}', payment_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'
      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(payment_delete) 

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

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

    # Allows you to delete tracking categories
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param tracking_category_id [String] Unique identifier for a TrackingCategory
    # @param [Hash] opts the optional parameters
    # @return [TrackingCategories]
    def delete_tracking_category(xero_tenant_id, tracking_category_id, opts = {})
      data, _status_code, _headers = delete_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, opts)
      data
    end

    # Allows you to delete tracking categories
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param tracking_category_id [String] Unique identifier for a TrackingCategory
    # @param [Hash] opts the optional parameters
    # @return [Array<(TrackingCategories, Integer, Hash)>] TrackingCategories data, response status code and response headers
    def delete_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.delete_tracking_category ...'
      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 AccountingApi.delete_tracking_category"
      end
      # verify the required parameter 'tracking_category_id' is set
      if @api_client.config.client_side_validation && tracking_category_id.nil?
        fail ArgumentError, "Missing the required parameter 'tracking_category_id' when calling AccountingApi.delete_tracking_category"
      end
      # resource path
      local_var_path = '/TrackingCategories/{TrackingCategoryID}'.sub('{' + 'TrackingCategoryID' + '}', tracking_category_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'])
      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] || 'TrackingCategories' 

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

    # Allows you to delete a specified option for a specified tracking category
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param tracking_category_id [String] Unique identifier for a TrackingCategory
    # @param tracking_option_id [String] Unique identifier for a Tracking Option
    # @param [Hash] opts the optional parameters
    # @return [TrackingOptions]
    def delete_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id, opts = {})
      data, _status_code, _headers = delete_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, tracking_option_id, opts)
      data
    end

    # Allows you to delete a specified option for a specified tracking category
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param tracking_category_id [String] Unique identifier for a TrackingCategory
    # @param tracking_option_id [String] Unique identifier for a Tracking Option
    # @param [Hash] opts the optional parameters
    # @return [Array<(TrackingOptions, Integer, Hash)>] TrackingOptions data, response status code and response headers
    def delete_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, tracking_option_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.delete_tracking_options ...'
      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 AccountingApi.delete_tracking_options"
      end
      # verify the required parameter 'tracking_category_id' is set
      if @api_client.config.client_side_validation && tracking_category_id.nil?
        fail ArgumentError, "Missing the required parameter 'tracking_category_id' when calling AccountingApi.delete_tracking_options"
      end
      # verify the required parameter 'tracking_option_id' is set
      if @api_client.config.client_side_validation && tracking_option_id.nil?
        fail ArgumentError, "Missing the required parameter 'tracking_option_id' when calling AccountingApi.delete_tracking_options"
      end
      # resource path
      local_var_path = '/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}'.sub('{' + 'TrackingCategoryID' + '}', tracking_category_id.to_s).sub('{' + 'TrackingOptionID' + '}', tracking_option_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'])
      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] || 'TrackingOptions' 

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

    # Allows you to email a copy of invoice to related Contact
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param request_empty [RequestEmpty] 
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def email_invoice(xero_tenant_id, invoice_id, request_empty, opts = {})
      email_invoice_with_http_info(xero_tenant_id, invoice_id, request_empty, opts)
      nil
    end

    # Allows you to email a copy of invoice to related Contact
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param request_empty [RequestEmpty] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def email_invoice_with_http_info(xero_tenant_id, invoice_id, request_empty, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.email_invoice ...'
      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 AccountingApi.email_invoice"
      end
      # verify the required parameter 'invoice_id' is set
      if @api_client.config.client_side_validation && invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.email_invoice"
      end
      # verify the required parameter 'request_empty' is set
      if @api_client.config.client_side_validation && request_empty.nil?
        fail ArgumentError, "Missing the required parameter 'request_empty' when calling AccountingApi.email_invoice"
      end
      # resource path
      local_var_path = '/Invoices/{InvoiceID}/Email'.sub('{' + 'InvoiceID' + '}', invoice_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'
      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(request_empty) 

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

    # Allows you to retrieve a single chart of accounts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param account_id [String] Unique identifier for retrieving single object
    # @param [Hash] opts the optional parameters
    # @return [Accounts]
    def get_account(xero_tenant_id, account_id, opts = {})
      data, _status_code, _headers = get_account_with_http_info(xero_tenant_id, account_id, opts)
      data
    end

    # Allows you to retrieve a single chart of accounts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param account_id [String] Unique identifier for retrieving single object
    # @param [Hash] opts the optional parameters
    # @return [Array<(Accounts, Integer, Hash)>] Accounts data, response status code and response headers
    def get_account_with_http_info(xero_tenant_id, account_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_account ...'
      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 AccountingApi.get_account"
      end
      # verify the required parameter 'account_id' is set
      if @api_client.config.client_side_validation && account_id.nil?
        fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.get_account"
      end
      # resource path
      local_var_path = '/Accounts/{AccountID}'.sub('{' + 'AccountID' + '}', account_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'])
      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] || 'Accounts' 

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

    # Allows you to retrieve Attachment on Account by Filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param account_id [String] Unique identifier for Account object
    # @param file_name [String] Name of the attachment
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, content_type, opts = {})
      data, _status_code, _headers = get_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_id, file_name, content_type, opts)
      data
    end

    # Allows you to retrieve Attachment on Account by Filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param account_id [String] Unique identifier for Account object
    # @param file_name [String] Name of the attachment
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_id, file_name, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_account_attachment_by_file_name ...'
      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 AccountingApi.get_account_attachment_by_file_name"
      end
      # verify the required parameter 'account_id' is set
      if @api_client.config.client_side_validation && account_id.nil?
        fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.get_account_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_account_attachment_by_file_name"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_account_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/Accounts/{AccountID}/Attachments/{FileName}'.sub('{' + 'AccountID' + '}', account_id.to_s).sub('{' + 'FileName' + '}', file_name.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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve specific Attachment on Account
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param account_id [String] Unique identifier for Account object
    # @param attachment_id [String] Unique identifier for Attachment object
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_account_attachment_by_id(xero_tenant_id, account_id, attachment_id, content_type, opts = {})
      data, _status_code, _headers = get_account_attachment_by_id_with_http_info(xero_tenant_id, account_id, attachment_id, content_type, opts)
      data
    end

    # Allows you to retrieve specific Attachment on Account
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param account_id [String] Unique identifier for Account object
    # @param attachment_id [String] Unique identifier for Attachment object
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_account_attachment_by_id_with_http_info(xero_tenant_id, account_id, attachment_id, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_account_attachment_by_id ...'
      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 AccountingApi.get_account_attachment_by_id"
      end
      # verify the required parameter 'account_id' is set
      if @api_client.config.client_side_validation && account_id.nil?
        fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.get_account_attachment_by_id"
      end
      # verify the required parameter 'attachment_id' is set
      if @api_client.config.client_side_validation && attachment_id.nil?
        fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_account_attachment_by_id"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_account_attachment_by_id"
      end
      # resource path
      local_var_path = '/Accounts/{AccountID}/Attachments/{AttachmentID}'.sub('{' + 'AccountID' + '}', account_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve Attachments for accounts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param account_id [String] Unique identifier for Account object
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def get_account_attachments(xero_tenant_id, account_id, opts = {})
      data, _status_code, _headers = get_account_attachments_with_http_info(xero_tenant_id, account_id, opts)
      data
    end

    # Allows you to retrieve Attachments for accounts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param account_id [String] Unique identifier for Account object
    # @param [Hash] opts the optional parameters
    # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers
    def get_account_attachments_with_http_info(xero_tenant_id, account_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_account_attachments ...'
      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 AccountingApi.get_account_attachments"
      end
      # verify the required parameter 'account_id' is set
      if @api_client.config.client_side_validation && account_id.nil?
        fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.get_account_attachments"
      end
      # resource path
      local_var_path = '/Accounts/{AccountID}/Attachments'.sub('{' + 'AccountID' + '}', account_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'])
      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] || 'Attachments' 

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

    # Allows you to retrieve the full chart of accounts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [Accounts]
    def get_accounts(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_accounts_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve the full chart of accounts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [Array<(Accounts, Integer, Hash)>] Accounts data, response status code and response headers
    def get_accounts_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_accounts ...'
      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 AccountingApi.get_accounts"
      end
      # resource path
      local_var_path = '/Accounts'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to retrieve a single spend or receive money transaction
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [BankTransactions]
    def get_bank_transaction(xero_tenant_id, bank_transaction_id, opts = {})
      data, _status_code, _headers = get_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, opts)
      data
    end

    # Allows you to retrieve a single spend or receive money transaction
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers
    def get_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transaction ...'
      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 AccountingApi.get_bank_transaction"
      end
      # verify the required parameter 'bank_transaction_id' is set
      if @api_client.config.client_side_validation && bank_transaction_id.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.get_bank_transaction"
      end
      # resource path
      local_var_path = '/BankTransactions/{BankTransactionID}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s)

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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] || 'BankTransactions' 

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

    # Allows you to retrieve Attachments on BankTransaction by Filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
    # @param file_name [String] The name of the file being attached
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, content_type, opts = {})
      data, _status_code, _headers = get_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transaction_id, file_name, content_type, opts)
      data
    end

    # Allows you to retrieve Attachments on BankTransaction by Filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
    # @param file_name [String] The name of the file being attached
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transaction_id, file_name, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transaction_attachment_by_file_name ...'
      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 AccountingApi.get_bank_transaction_attachment_by_file_name"
      end
      # verify the required parameter 'bank_transaction_id' is set
      if @api_client.config.client_side_validation && bank_transaction_id.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.get_bank_transaction_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_bank_transaction_attachment_by_file_name"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_bank_transaction_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/BankTransactions/{BankTransactionID}/Attachments/{FileName}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s).sub('{' + 'FileName' + '}', file_name.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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve Attachments on a specific BankTransaction
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
    # @param attachment_id [String] Xero generated unique identifier for an attachment
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_bank_transaction_attachment_by_id(xero_tenant_id, bank_transaction_id, attachment_id, content_type, opts = {})
      data, _status_code, _headers = get_bank_transaction_attachment_by_id_with_http_info(xero_tenant_id, bank_transaction_id, attachment_id, content_type, opts)
      data
    end

    # Allows you to retrieve Attachments on a specific BankTransaction
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
    # @param attachment_id [String] Xero generated unique identifier for an attachment
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_bank_transaction_attachment_by_id_with_http_info(xero_tenant_id, bank_transaction_id, attachment_id, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transaction_attachment_by_id ...'
      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 AccountingApi.get_bank_transaction_attachment_by_id"
      end
      # verify the required parameter 'bank_transaction_id' is set
      if @api_client.config.client_side_validation && bank_transaction_id.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.get_bank_transaction_attachment_by_id"
      end
      # verify the required parameter 'attachment_id' is set
      if @api_client.config.client_side_validation && attachment_id.nil?
        fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_bank_transaction_attachment_by_id"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_bank_transaction_attachment_by_id"
      end
      # resource path
      local_var_path = '/BankTransactions/{BankTransactionID}/Attachments/{AttachmentID}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve any attachments to bank transactions
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def get_bank_transaction_attachments(xero_tenant_id, bank_transaction_id, opts = {})
      data, _status_code, _headers = get_bank_transaction_attachments_with_http_info(xero_tenant_id, bank_transaction_id, opts)
      data
    end

    # Allows you to retrieve any attachments to bank transactions
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
    # @param [Hash] opts the optional parameters
    # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers
    def get_bank_transaction_attachments_with_http_info(xero_tenant_id, bank_transaction_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transaction_attachments ...'
      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 AccountingApi.get_bank_transaction_attachments"
      end
      # verify the required parameter 'bank_transaction_id' is set
      if @api_client.config.client_side_validation && bank_transaction_id.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.get_bank_transaction_attachments"
      end
      # resource path
      local_var_path = '/BankTransactions/{BankTransactionID}/Attachments'.sub('{' + 'BankTransactionID' + '}', bank_transaction_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'])
      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] || 'Attachments' 

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

    # Allows you to retrieve any spend or receive money transactions
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Integer] :page Up to 100 bank transactions will be returned in a single API call with line items details
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [BankTransactions]
    def get_bank_transactions(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_bank_transactions_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve any spend or receive money transactions
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Integer] :page Up to 100 bank transactions will be returned in a single API call with line items details
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers
    def get_bank_transactions_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transactions ...'
      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 AccountingApi.get_bank_transactions"
      end
      # resource path
      local_var_path = '/BankTransactions'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
      query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to retrieve history from a bank transactions
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def get_bank_transactions_history(xero_tenant_id, bank_transaction_id, opts = {})
      data, _status_code, _headers = get_bank_transactions_history_with_http_info(xero_tenant_id, bank_transaction_id, opts)
      data
    end

    # Allows you to retrieve history from a bank transactions
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def get_bank_transactions_history_with_http_info(xero_tenant_id, bank_transaction_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transactions_history ...'
      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 AccountingApi.get_bank_transactions_history"
      end
      # verify the required parameter 'bank_transaction_id' is set
      if @api_client.config.client_side_validation && bank_transaction_id.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.get_bank_transactions_history"
      end
      # resource path
      local_var_path = '/BankTransactions/{BankTransactionID}/History'.sub('{' + 'BankTransactionID' + '}', bank_transaction_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'])
      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] || 'HistoryRecords' 

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

    # Allows you to retrieve any bank transfers
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer
    # @param [Hash] opts the optional parameters
    # @return [BankTransfers]
    def get_bank_transfer(xero_tenant_id, bank_transfer_id, opts = {})
      data, _status_code, _headers = get_bank_transfer_with_http_info(xero_tenant_id, bank_transfer_id, opts)
      data
    end

    # Allows you to retrieve any bank transfers
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer
    # @param [Hash] opts the optional parameters
    # @return [Array<(BankTransfers, Integer, Hash)>] BankTransfers data, response status code and response headers
    def get_bank_transfer_with_http_info(xero_tenant_id, bank_transfer_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transfer ...'
      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 AccountingApi.get_bank_transfer"
      end
      # verify the required parameter 'bank_transfer_id' is set
      if @api_client.config.client_side_validation && bank_transfer_id.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.get_bank_transfer"
      end
      # resource path
      local_var_path = '/BankTransfers/{BankTransferID}'.sub('{' + 'BankTransferID' + '}', bank_transfer_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'])
      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] || 'BankTransfers' 

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

    # Allows you to retrieve Attachments on BankTransfer by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer
    # @param file_name [String] The name of the file being attached to a Bank Transfer
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, content_type, opts = {})
      data, _status_code, _headers = get_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transfer_id, file_name, content_type, opts)
      data
    end

    # Allows you to retrieve Attachments on BankTransfer by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer
    # @param file_name [String] The name of the file being attached to a Bank Transfer
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transfer_id, file_name, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transfer_attachment_by_file_name ...'
      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 AccountingApi.get_bank_transfer_attachment_by_file_name"
      end
      # verify the required parameter 'bank_transfer_id' is set
      if @api_client.config.client_side_validation && bank_transfer_id.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.get_bank_transfer_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_bank_transfer_attachment_by_file_name"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_bank_transfer_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/BankTransfers/{BankTransferID}/Attachments/{FileName}'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s).sub('{' + 'FileName' + '}', file_name.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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve Attachments on BankTransfer
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer
    # @param attachment_id [String] Xero generated unique identifier for an Attachment to a bank transfer
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_bank_transfer_attachment_by_id(xero_tenant_id, bank_transfer_id, attachment_id, content_type, opts = {})
      data, _status_code, _headers = get_bank_transfer_attachment_by_id_with_http_info(xero_tenant_id, bank_transfer_id, attachment_id, content_type, opts)
      data
    end

    # Allows you to retrieve Attachments on BankTransfer
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer
    # @param attachment_id [String] Xero generated unique identifier for an Attachment to a bank transfer
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_bank_transfer_attachment_by_id_with_http_info(xero_tenant_id, bank_transfer_id, attachment_id, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transfer_attachment_by_id ...'
      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 AccountingApi.get_bank_transfer_attachment_by_id"
      end
      # verify the required parameter 'bank_transfer_id' is set
      if @api_client.config.client_side_validation && bank_transfer_id.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.get_bank_transfer_attachment_by_id"
      end
      # verify the required parameter 'attachment_id' is set
      if @api_client.config.client_side_validation && attachment_id.nil?
        fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_bank_transfer_attachment_by_id"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_bank_transfer_attachment_by_id"
      end
      # resource path
      local_var_path = '/BankTransfers/{BankTransferID}/Attachments/{AttachmentID}'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve Attachments from  bank transfers
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def get_bank_transfer_attachments(xero_tenant_id, bank_transfer_id, opts = {})
      data, _status_code, _headers = get_bank_transfer_attachments_with_http_info(xero_tenant_id, bank_transfer_id, opts)
      data
    end

    # Allows you to retrieve Attachments from  bank transfers
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer
    # @param [Hash] opts the optional parameters
    # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers
    def get_bank_transfer_attachments_with_http_info(xero_tenant_id, bank_transfer_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transfer_attachments ...'
      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 AccountingApi.get_bank_transfer_attachments"
      end
      # verify the required parameter 'bank_transfer_id' is set
      if @api_client.config.client_side_validation && bank_transfer_id.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.get_bank_transfer_attachments"
      end
      # resource path
      local_var_path = '/BankTransfers/{BankTransferID}/Attachments'.sub('{' + 'BankTransferID' + '}', bank_transfer_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'])
      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] || 'Attachments' 

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

    # Allows you to retrieve history from a bank transfers
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def get_bank_transfer_history(xero_tenant_id, bank_transfer_id, opts = {})
      data, _status_code, _headers = get_bank_transfer_history_with_http_info(xero_tenant_id, bank_transfer_id, opts)
      data
    end

    # Allows you to retrieve history from a bank transfers
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def get_bank_transfer_history_with_http_info(xero_tenant_id, bank_transfer_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transfer_history ...'
      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 AccountingApi.get_bank_transfer_history"
      end
      # verify the required parameter 'bank_transfer_id' is set
      if @api_client.config.client_side_validation && bank_transfer_id.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.get_bank_transfer_history"
      end
      # resource path
      local_var_path = '/BankTransfers/{BankTransferID}/History'.sub('{' + 'BankTransferID' + '}', bank_transfer_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'])
      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] || 'HistoryRecords' 

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

    # Allows you to retrieve all bank transfers
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [BankTransfers]
    def get_bank_transfers(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_bank_transfers_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve all bank transfers
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [Array<(BankTransfers, Integer, Hash)>] BankTransfers data, response status code and response headers
    def get_bank_transfers_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transfers ...'
      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 AccountingApi.get_bank_transfers"
      end
      # resource path
      local_var_path = '/BankTransfers'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to retrieve history from a Batch Payment
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param batch_payment_id [String] Unique identifier for BatchPayment
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def get_batch_payment_history(xero_tenant_id, batch_payment_id, opts = {})
      data, _status_code, _headers = get_batch_payment_history_with_http_info(xero_tenant_id, batch_payment_id, opts)
      data
    end

    # Allows you to retrieve history from a Batch Payment
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param batch_payment_id [String] Unique identifier for BatchPayment
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def get_batch_payment_history_with_http_info(xero_tenant_id, batch_payment_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_batch_payment_history ...'
      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 AccountingApi.get_batch_payment_history"
      end
      # verify the required parameter 'batch_payment_id' is set
      if @api_client.config.client_side_validation && batch_payment_id.nil?
        fail ArgumentError, "Missing the required parameter 'batch_payment_id' when calling AccountingApi.get_batch_payment_history"
      end
      # resource path
      local_var_path = '/BatchPayments/{BatchPaymentID}/History'.sub('{' + 'BatchPaymentID' + '}', batch_payment_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'])
      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] || 'HistoryRecords' 

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

    # Retrieve either one or many BatchPayments for invoices
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [BatchPayments]
    def get_batch_payments(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_batch_payments_with_http_info(xero_tenant_id, opts)
      data
    end

    # Retrieve either one or many BatchPayments for invoices
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [Array<(BatchPayments, Integer, Hash)>] BatchPayments data, response status code and response headers
    def get_batch_payments_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_batch_payments ...'
      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 AccountingApi.get_batch_payments"
      end
      # resource path
      local_var_path = '/BatchPayments'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to retrieve a specific BrandingThemes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param branding_theme_id [String] Unique identifier for a Branding Theme
    # @param [Hash] opts the optional parameters
    # @return [BrandingThemes]
    def get_branding_theme(xero_tenant_id, branding_theme_id, opts = {})
      data, _status_code, _headers = get_branding_theme_with_http_info(xero_tenant_id, branding_theme_id, opts)
      data
    end

    # Allows you to retrieve a specific BrandingThemes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param branding_theme_id [String] Unique identifier for a Branding Theme
    # @param [Hash] opts the optional parameters
    # @return [Array<(BrandingThemes, Integer, Hash)>] BrandingThemes data, response status code and response headers
    def get_branding_theme_with_http_info(xero_tenant_id, branding_theme_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_branding_theme ...'
      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 AccountingApi.get_branding_theme"
      end
      # verify the required parameter 'branding_theme_id' is set
      if @api_client.config.client_side_validation && branding_theme_id.nil?
        fail ArgumentError, "Missing the required parameter 'branding_theme_id' when calling AccountingApi.get_branding_theme"
      end
      # resource path
      local_var_path = '/BrandingThemes/{BrandingThemeID}'.sub('{' + 'BrandingThemeID' + '}', branding_theme_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'])
      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] || 'BrandingThemes' 

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

    # Allows you to retrieve the Payment services for a Branding Theme
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param branding_theme_id [String] Unique identifier for a Branding Theme
    # @param [Hash] opts the optional parameters
    # @return [PaymentServices]
    def get_branding_theme_payment_services(xero_tenant_id, branding_theme_id, opts = {})
      data, _status_code, _headers = get_branding_theme_payment_services_with_http_info(xero_tenant_id, branding_theme_id, opts)
      data
    end

    # Allows you to retrieve the Payment services for a Branding Theme
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param branding_theme_id [String] Unique identifier for a Branding Theme
    # @param [Hash] opts the optional parameters
    # @return [Array<(PaymentServices, Integer, Hash)>] PaymentServices data, response status code and response headers
    def get_branding_theme_payment_services_with_http_info(xero_tenant_id, branding_theme_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_branding_theme_payment_services ...'
      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 AccountingApi.get_branding_theme_payment_services"
      end
      # verify the required parameter 'branding_theme_id' is set
      if @api_client.config.client_side_validation && branding_theme_id.nil?
        fail ArgumentError, "Missing the required parameter 'branding_theme_id' when calling AccountingApi.get_branding_theme_payment_services"
      end
      # resource path
      local_var_path = '/BrandingThemes/{BrandingThemeID}/PaymentServices'.sub('{' + 'BrandingThemeID' + '}', branding_theme_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'])
      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] || 'PaymentServices' 

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

    # Allows you to retrieve all the BrandingThemes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @return [BrandingThemes]
    def get_branding_themes(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_branding_themes_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve all the BrandingThemes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @return [Array<(BrandingThemes, Integer, Hash)>] BrandingThemes data, response status code and response headers
    def get_branding_themes_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_branding_themes ...'
      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 AccountingApi.get_branding_themes"
      end
      # resource path
      local_var_path = '/BrandingThemes'

      # 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'])
      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] || 'BrandingThemes' 

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

    # Allows you to retrieve, add and update contacts in a Xero organisation
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param [Hash] opts the optional parameters
    # @return [Contacts]
    def get_contact(xero_tenant_id, contact_id, opts = {})
      data, _status_code, _headers = get_contact_with_http_info(xero_tenant_id, contact_id, opts)
      data
    end

    # Allows you to retrieve, add and update contacts in a Xero organisation
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param [Hash] opts the optional parameters
    # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers
    def get_contact_with_http_info(xero_tenant_id, contact_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact ...'
      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 AccountingApi.get_contact"
      end
      # verify the required parameter 'contact_id' is set
      if @api_client.config.client_side_validation && contact_id.nil?
        fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_contact"
      end
      # resource path
      local_var_path = '/Contacts/{ContactID}'.sub('{' + 'ContactID' + '}', contact_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'])
      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] || 'Contacts' 

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

    # Allows you to retrieve Attachments on Contacts by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param file_name [String] Name for the file you are attaching
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, content_type, opts = {})
      data, _status_code, _headers = get_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_id, file_name, content_type, opts)
      data
    end

    # Allows you to retrieve Attachments on Contacts by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param file_name [String] Name for the file you are attaching
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_id, file_name, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_attachment_by_file_name ...'
      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 AccountingApi.get_contact_attachment_by_file_name"
      end
      # verify the required parameter 'contact_id' is set
      if @api_client.config.client_side_validation && contact_id.nil?
        fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_contact_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_contact_attachment_by_file_name"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_contact_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/Contacts/{ContactID}/Attachments/{FileName}'.sub('{' + 'ContactID' + '}', contact_id.to_s).sub('{' + 'FileName' + '}', file_name.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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve Attachments on Contacts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param attachment_id [String] Unique identifier for a Attachment
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_contact_attachment_by_id(xero_tenant_id, contact_id, attachment_id, content_type, opts = {})
      data, _status_code, _headers = get_contact_attachment_by_id_with_http_info(xero_tenant_id, contact_id, attachment_id, content_type, opts)
      data
    end

    # Allows you to retrieve Attachments on Contacts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param attachment_id [String] Unique identifier for a Attachment
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_contact_attachment_by_id_with_http_info(xero_tenant_id, contact_id, attachment_id, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_attachment_by_id ...'
      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 AccountingApi.get_contact_attachment_by_id"
      end
      # verify the required parameter 'contact_id' is set
      if @api_client.config.client_side_validation && contact_id.nil?
        fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_contact_attachment_by_id"
      end
      # verify the required parameter 'attachment_id' is set
      if @api_client.config.client_side_validation && attachment_id.nil?
        fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_contact_attachment_by_id"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_contact_attachment_by_id"
      end
      # resource path
      local_var_path = '/Contacts/{ContactID}/Attachments/{AttachmentID}'.sub('{' + 'ContactID' + '}', contact_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve, add and update contacts in a Xero organisation
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def get_contact_attachments(xero_tenant_id, contact_id, opts = {})
      data, _status_code, _headers = get_contact_attachments_with_http_info(xero_tenant_id, contact_id, opts)
      data
    end

    # Allows you to retrieve, add and update contacts in a Xero organisation
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param [Hash] opts the optional parameters
    # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers
    def get_contact_attachments_with_http_info(xero_tenant_id, contact_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_attachments ...'
      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 AccountingApi.get_contact_attachments"
      end
      # verify the required parameter 'contact_id' is set
      if @api_client.config.client_side_validation && contact_id.nil?
        fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_contact_attachments"
      end
      # resource path
      local_var_path = '/Contacts/{ContactID}/Attachments'.sub('{' + 'ContactID' + '}', contact_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'])
      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] || 'Attachments' 

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

    # Allows you to retrieve CISSettings for a contact in a Xero organisation
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param [Hash] opts the optional parameters
    # @return [CISSettings]
    def get_contact_cis_settings(xero_tenant_id, contact_id, opts = {})
      data, _status_code, _headers = get_contact_cis_settings_with_http_info(xero_tenant_id, contact_id, opts)
      data
    end

    # Allows you to retrieve CISSettings for a contact in a Xero organisation
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param [Hash] opts the optional parameters
    # @return [Array<(CISSettings, Integer, Hash)>] CISSettings data, response status code and response headers
    def get_contact_cis_settings_with_http_info(xero_tenant_id, contact_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_cis_settings ...'
      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 AccountingApi.get_contact_cis_settings"
      end
      # verify the required parameter 'contact_id' is set
      if @api_client.config.client_side_validation && contact_id.nil?
        fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_contact_cis_settings"
      end
      # resource path
      local_var_path = '/Contacts/{ContactID}/CISSettings'.sub('{' + 'ContactID' + '}', contact_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'])
      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] || 'CISSettings' 

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

    # Allows you to retrieve a unique Contact Group by ID
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_group_id [String] Unique identifier for a Contact Group
    # @param [Hash] opts the optional parameters
    # @return [ContactGroups]
    def get_contact_group(xero_tenant_id, contact_group_id, opts = {})
      data, _status_code, _headers = get_contact_group_with_http_info(xero_tenant_id, contact_group_id, opts)
      data
    end

    # Allows you to retrieve a unique Contact Group by ID
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_group_id [String] Unique identifier for a Contact Group
    # @param [Hash] opts the optional parameters
    # @return [Array<(ContactGroups, Integer, Hash)>] ContactGroups data, response status code and response headers
    def get_contact_group_with_http_info(xero_tenant_id, contact_group_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_group ...'
      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 AccountingApi.get_contact_group"
      end
      # verify the required parameter 'contact_group_id' is set
      if @api_client.config.client_side_validation && contact_group_id.nil?
        fail ArgumentError, "Missing the required parameter 'contact_group_id' when calling AccountingApi.get_contact_group"
      end
      # resource path
      local_var_path = '/ContactGroups/{ContactGroupID}'.sub('{' + 'ContactGroupID' + '}', contact_group_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'])
      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] || 'ContactGroups' 

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

    # Allows you to retrieve the ContactID and Name of all the contacts in a contact group
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [ContactGroups]
    def get_contact_groups(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_contact_groups_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve the ContactID and Name of all the contacts in a contact group
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [Array<(ContactGroups, Integer, Hash)>] ContactGroups data, response status code and response headers
    def get_contact_groups_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_groups ...'
      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 AccountingApi.get_contact_groups"
      end
      # resource path
      local_var_path = '/ContactGroups'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].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] || 'ContactGroups' 

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

    # Allows you to retrieve a history records of an Contact
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def get_contact_history(xero_tenant_id, contact_id, opts = {})
      data, _status_code, _headers = get_contact_history_with_http_info(xero_tenant_id, contact_id, opts)
      data
    end

    # Allows you to retrieve a history records of an Contact
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def get_contact_history_with_http_info(xero_tenant_id, contact_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_history ...'
      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 AccountingApi.get_contact_history"
      end
      # verify the required parameter 'contact_id' is set
      if @api_client.config.client_side_validation && contact_id.nil?
        fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_contact_history"
      end
      # resource path
      local_var_path = '/Contacts/{ContactID}/History'.sub('{' + 'ContactID' + '}', contact_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'])
      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] || 'HistoryRecords' 

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

    # Allows you to retrieve, add and update contacts in a Xero organisation
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Array<String>] :i_ds Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call.
    # @option opts [Integer] :page e.g. page&#x3D;1 - Up to 100 contacts will be returned in a single API call.
    # @option opts [Boolean] :include_archived e.g. includeArchived&#x3D;true - Contacts with a status of ARCHIVED will be included in the response
    # @return [Contacts]
    def get_contacts(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_contacts_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve, add and update contacts in a Xero organisation
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Array<String>] :i_ds Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call.
    # @option opts [Integer] :page e.g. page&#x3D;1 - Up to 100 contacts will be returned in a single API call.
    # @option opts [Boolean] :include_archived e.g. includeArchived&#x3D;true - Contacts with a status of ARCHIVED will be included in the response
    # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers
    def get_contacts_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_contacts ...'
      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 AccountingApi.get_contacts"
      end
      # resource path
      local_var_path = '/Contacts'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
      query_params[:'IDs'] = @api_client.build_collection_param(opts[:'i_ds'], :csv) if !opts[:'i_ds'].nil?
      query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
      query_params[:'includeArchived'] = opts[:'include_archived'] if !opts[:'include_archived'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to retrieve a specific credit note
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_note_id [String] Unique identifier for a Credit Note
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [CreditNotes]
    def get_credit_note(xero_tenant_id, credit_note_id, opts = {})
      data, _status_code, _headers = get_credit_note_with_http_info(xero_tenant_id, credit_note_id, opts)
      data
    end

    # Allows you to retrieve a specific credit note
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_note_id [String] Unique identifier for a Credit Note
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(CreditNotes, Integer, Hash)>] CreditNotes data, response status code and response headers
    def get_credit_note_with_http_info(xero_tenant_id, credit_note_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_note ...'
      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 AccountingApi.get_credit_note"
      end
      # verify the required parameter 'credit_note_id' is set
      if @api_client.config.client_side_validation && credit_note_id.nil?
        fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.get_credit_note"
      end
      # resource path
      local_var_path = '/CreditNotes/{CreditNoteID}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s)

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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] || 'CreditNotes' 

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

    # Allows you to retrieve Credit Note as PDF files
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_note_id [String] Unique identifier for a Credit Note
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_credit_note_as_pdf(xero_tenant_id, credit_note_id, opts = {})
      data, _status_code, _headers = get_credit_note_as_pdf_with_http_info(xero_tenant_id, credit_note_id, opts)
      data
    end

    # Allows you to retrieve Credit Note as PDF files
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_note_id [String] Unique identifier for a Credit Note
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_credit_note_as_pdf_with_http_info(xero_tenant_id, credit_note_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_note_as_pdf ...'
      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 AccountingApi.get_credit_note_as_pdf"
      end
      # verify the required parameter 'credit_note_id' is set
      if @api_client.config.client_side_validation && credit_note_id.nil?
        fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.get_credit_note_as_pdf"
      end
      # resource path
      local_var_path = '/CreditNotes/{CreditNoteID}'.sub('{' + 'CreditNoteID' + '}', credit_note_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/pdf'])
      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, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AccountingApi#get_credit_note_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Allows you to retrieve 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 content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, content_type, opts = {})
      data, _status_code, _headers = get_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, content_type, opts)
      data
    end

    # Allows you to retrieve 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 content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_note_attachment_by_file_name ...'
      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 AccountingApi.get_credit_note_attachment_by_file_name"
      end
      # verify the required parameter 'credit_note_id' is set
      if @api_client.config.client_side_validation && credit_note_id.nil?
        fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.get_credit_note_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_credit_note_attachment_by_file_name"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_credit_note_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/CreditNotes/{CreditNoteID}/Attachments/{FileName}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s).sub('{' + 'FileName' + '}', file_name.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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

      # 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, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AccountingApi#get_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 retrieve Attachments on CreditNote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_note_id [String] Unique identifier for a Credit Note
    # @param attachment_id [String] Unique identifier for a Attachment
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_credit_note_attachment_by_id(xero_tenant_id, credit_note_id, attachment_id, content_type, opts = {})
      data, _status_code, _headers = get_credit_note_attachment_by_id_with_http_info(xero_tenant_id, credit_note_id, attachment_id, content_type, opts)
      data
    end

    # Allows you to retrieve Attachments on CreditNote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_note_id [String] Unique identifier for a Credit Note
    # @param attachment_id [String] Unique identifier for a Attachment
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_credit_note_attachment_by_id_with_http_info(xero_tenant_id, credit_note_id, attachment_id, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_note_attachment_by_id ...'
      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 AccountingApi.get_credit_note_attachment_by_id"
      end
      # verify the required parameter 'credit_note_id' is set
      if @api_client.config.client_side_validation && credit_note_id.nil?
        fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.get_credit_note_attachment_by_id"
      end
      # verify the required parameter 'attachment_id' is set
      if @api_client.config.client_side_validation && attachment_id.nil?
        fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_credit_note_attachment_by_id"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_credit_note_attachment_by_id"
      end
      # resource path
      local_var_path = '/CreditNotes/{CreditNoteID}/Attachments/{AttachmentID}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve Attachments for credit notes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_note_id [String] Unique identifier for a Credit Note
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def get_credit_note_attachments(xero_tenant_id, credit_note_id, opts = {})
      data, _status_code, _headers = get_credit_note_attachments_with_http_info(xero_tenant_id, credit_note_id, opts)
      data
    end

    # Allows you to retrieve Attachments for credit notes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_note_id [String] Unique identifier for a Credit Note
    # @param [Hash] opts the optional parameters
    # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers
    def get_credit_note_attachments_with_http_info(xero_tenant_id, credit_note_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_note_attachments ...'
      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 AccountingApi.get_credit_note_attachments"
      end
      # verify the required parameter 'credit_note_id' is set
      if @api_client.config.client_side_validation && credit_note_id.nil?
        fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.get_credit_note_attachments"
      end
      # resource path
      local_var_path = '/CreditNotes/{CreditNoteID}/Attachments'.sub('{' + 'CreditNoteID' + '}', credit_note_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'])
      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] || 'Attachments' 

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

    # Allows you to retrieve a history records of an CreditNote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_note_id [String] Unique identifier for a Credit Note
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def get_credit_note_history(xero_tenant_id, credit_note_id, opts = {})
      data, _status_code, _headers = get_credit_note_history_with_http_info(xero_tenant_id, credit_note_id, opts)
      data
    end

    # Allows you to retrieve a history records of an CreditNote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_note_id [String] Unique identifier for a Credit Note
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def get_credit_note_history_with_http_info(xero_tenant_id, credit_note_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_note_history ...'
      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 AccountingApi.get_credit_note_history"
      end
      # verify the required parameter 'credit_note_id' is set
      if @api_client.config.client_side_validation && credit_note_id.nil?
        fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.get_credit_note_history"
      end
      # resource path
      local_var_path = '/CreditNotes/{CreditNoteID}/History'.sub('{' + 'CreditNoteID' + '}', credit_note_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'])
      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] || 'HistoryRecords' 

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

    # Allows you to retrieve any credit notes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Integer] :page e.g. page&#x3D;1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [CreditNotes]
    def get_credit_notes(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_credit_notes_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve any credit notes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Integer] :page e.g. page&#x3D;1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(CreditNotes, Integer, Hash)>] CreditNotes data, response status code and response headers
    def get_credit_notes_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_notes ...'
      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 AccountingApi.get_credit_notes"
      end
      # resource path
      local_var_path = '/CreditNotes'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
      query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to retrieve currencies for your organisation
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [Currencies]
    def get_currencies(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_currencies_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve currencies for your organisation
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [Array<(Currencies, Integer, Hash)>] Currencies data, response status code and response headers
    def get_currencies_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_currencies ...'
      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 AccountingApi.get_currencies"
      end
      # resource path
      local_var_path = '/Currencies'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].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] || 'Currencies' 

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

    # Allows you to retrieve a specific employee used in Xero payrun
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param employee_id [String] Unique identifier for a Employee
    # @param [Hash] opts the optional parameters
    # @return [Employees]
    def get_employee(xero_tenant_id, employee_id, opts = {})
      data, _status_code, _headers = get_employee_with_http_info(xero_tenant_id, employee_id, opts)
      data
    end

    # Allows you to retrieve a specific employee used in Xero payrun
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param employee_id [String] Unique identifier for a Employee
    # @param [Hash] opts the optional parameters
    # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers
    def get_employee_with_http_info(xero_tenant_id, employee_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_employee ...'
      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 AccountingApi.get_employee"
      end
      # verify the required parameter 'employee_id' is set
      if @api_client.config.client_side_validation && employee_id.nil?
        fail ArgumentError, "Missing the required parameter 'employee_id' when calling AccountingApi.get_employee"
      end
      # resource path
      local_var_path = '/Employees/{EmployeeID}'.sub('{' + 'EmployeeID' + '}', employee_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'])
      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] || 'Employees' 

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

    # Allows you to retrieve employees used in Xero payrun
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [Employees]
    def get_employees(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_employees_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve employees used in Xero payrun
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers
    def get_employees_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_employees ...'
      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 AccountingApi.get_employees"
      end
      # resource path
      local_var_path = '/Employees'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to retrieve a specified expense claim
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param expense_claim_id [String] Unique identifier for a ExpenseClaim
    # @param [Hash] opts the optional parameters
    # @return [ExpenseClaims]
    def get_expense_claim(xero_tenant_id, expense_claim_id, opts = {})
      data, _status_code, _headers = get_expense_claim_with_http_info(xero_tenant_id, expense_claim_id, opts)
      data
    end

    # Allows you to retrieve a specified expense claim
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param expense_claim_id [String] Unique identifier for a ExpenseClaim
    # @param [Hash] opts the optional parameters
    # @return [Array<(ExpenseClaims, Integer, Hash)>] ExpenseClaims data, response status code and response headers
    def get_expense_claim_with_http_info(xero_tenant_id, expense_claim_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_expense_claim ...'
      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 AccountingApi.get_expense_claim"
      end
      # verify the required parameter 'expense_claim_id' is set
      if @api_client.config.client_side_validation && expense_claim_id.nil?
        fail ArgumentError, "Missing the required parameter 'expense_claim_id' when calling AccountingApi.get_expense_claim"
      end
      # resource path
      local_var_path = '/ExpenseClaims/{ExpenseClaimID}'.sub('{' + 'ExpenseClaimID' + '}', expense_claim_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'])
      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] || 'ExpenseClaims' 

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

    # Allows you to retrieve a history records of an ExpenseClaim
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param expense_claim_id [String] Unique identifier for a ExpenseClaim
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def get_expense_claim_history(xero_tenant_id, expense_claim_id, opts = {})
      data, _status_code, _headers = get_expense_claim_history_with_http_info(xero_tenant_id, expense_claim_id, opts)
      data
    end

    # Allows you to retrieve a history records of an ExpenseClaim
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param expense_claim_id [String] Unique identifier for a ExpenseClaim
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def get_expense_claim_history_with_http_info(xero_tenant_id, expense_claim_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_expense_claim_history ...'
      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 AccountingApi.get_expense_claim_history"
      end
      # verify the required parameter 'expense_claim_id' is set
      if @api_client.config.client_side_validation && expense_claim_id.nil?
        fail ArgumentError, "Missing the required parameter 'expense_claim_id' when calling AccountingApi.get_expense_claim_history"
      end
      # resource path
      local_var_path = '/ExpenseClaims/{ExpenseClaimID}/History'.sub('{' + 'ExpenseClaimID' + '}', expense_claim_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'])
      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] || 'HistoryRecords' 

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

    # Allows you to retrieve expense claims
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [ExpenseClaims]
    def get_expense_claims(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_expense_claims_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve expense claims
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [Array<(ExpenseClaims, Integer, Hash)>] ExpenseClaims data, response status code and response headers
    def get_expense_claims_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_expense_claims ...'
      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 AccountingApi.get_expense_claims"
      end
      # resource path
      local_var_path = '/ExpenseClaims'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to retrieve a specified sales invoice or purchase bill
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Invoices]
    def get_invoice(xero_tenant_id, invoice_id, opts = {})
      data, _status_code, _headers = get_invoice_with_http_info(xero_tenant_id, invoice_id, opts)
      data
    end

    # Allows you to retrieve a specified sales invoice or purchase bill
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(Invoices, Integer, Hash)>] Invoices data, response status code and response headers
    def get_invoice_with_http_info(xero_tenant_id, invoice_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice ...'
      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 AccountingApi.get_invoice"
      end
      # verify the required parameter 'invoice_id' is set
      if @api_client.config.client_side_validation && invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_invoice"
      end
      # resource path
      local_var_path = '/Invoices/{InvoiceID}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s)

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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] || 'Invoices' 

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

    # Allows you to retrieve invoices or purchase bills as PDF files
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_invoice_as_pdf(xero_tenant_id, invoice_id, opts = {})
      data, _status_code, _headers = get_invoice_as_pdf_with_http_info(xero_tenant_id, invoice_id, opts)
      data
    end

    # Allows you to retrieve invoices or purchase bills as PDF files
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_invoice_as_pdf_with_http_info(xero_tenant_id, invoice_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice_as_pdf ...'
      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 AccountingApi.get_invoice_as_pdf"
      end
      # verify the required parameter 'invoice_id' is set
      if @api_client.config.client_side_validation && invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_invoice_as_pdf"
      end
      # resource path
      local_var_path = '/Invoices/{InvoiceID}'.sub('{' + 'InvoiceID' + '}', invoice_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/pdf'])
      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, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AccountingApi#get_invoice_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Allows you to retrieve Attachment on invoices or purchase bills by it's filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param file_name [String] Name of the file you are attaching
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, content_type, opts = {})
      data, _status_code, _headers = get_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, content_type, opts)
      data
    end

    # Allows you to retrieve Attachment on invoices or purchase bills by it&#39;s filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param file_name [String] Name of the file you are attaching
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice_attachment_by_file_name ...'
      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 AccountingApi.get_invoice_attachment_by_file_name"
      end
      # verify the required parameter 'invoice_id' is set
      if @api_client.config.client_side_validation && invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_invoice_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_invoice_attachment_by_file_name"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_invoice_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/Invoices/{InvoiceID}/Attachments/{FileName}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param attachment_id [String] Unique identifier for an Attachment
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_invoice_attachment_by_id(xero_tenant_id, invoice_id, attachment_id, content_type, opts = {})
      data, _status_code, _headers = get_invoice_attachment_by_id_with_http_info(xero_tenant_id, invoice_id, attachment_id, content_type, opts)
      data
    end

    # Allows you to retrieve a specified Attachment on invoices or purchase bills by it&#39;s ID
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param attachment_id [String] Unique identifier for an Attachment
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_invoice_attachment_by_id_with_http_info(xero_tenant_id, invoice_id, attachment_id, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice_attachment_by_id ...'
      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 AccountingApi.get_invoice_attachment_by_id"
      end
      # verify the required parameter 'invoice_id' is set
      if @api_client.config.client_side_validation && invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_invoice_attachment_by_id"
      end
      # verify the required parameter 'attachment_id' is set
      if @api_client.config.client_side_validation && attachment_id.nil?
        fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_invoice_attachment_by_id"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_invoice_attachment_by_id"
      end
      # resource path
      local_var_path = '/Invoices/{InvoiceID}/Attachments/{AttachmentID}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve Attachments on invoices or purchase bills
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def get_invoice_attachments(xero_tenant_id, invoice_id, opts = {})
      data, _status_code, _headers = get_invoice_attachments_with_http_info(xero_tenant_id, invoice_id, opts)
      data
    end

    # Allows you to retrieve Attachments on invoices or purchase bills
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param [Hash] opts the optional parameters
    # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers
    def get_invoice_attachments_with_http_info(xero_tenant_id, invoice_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice_attachments ...'
      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 AccountingApi.get_invoice_attachments"
      end
      # verify the required parameter 'invoice_id' is set
      if @api_client.config.client_side_validation && invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_invoice_attachments"
      end
      # resource path
      local_var_path = '/Invoices/{InvoiceID}/Attachments'.sub('{' + 'InvoiceID' + '}', invoice_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'])
      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] || 'Attachments' 

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

    # Allows you to retrieve a history records of an invoice
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def get_invoice_history(xero_tenant_id, invoice_id, opts = {})
      data, _status_code, _headers = get_invoice_history_with_http_info(xero_tenant_id, invoice_id, opts)
      data
    end

    # Allows you to retrieve a history records of an invoice
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def get_invoice_history_with_http_info(xero_tenant_id, invoice_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice_history ...'
      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 AccountingApi.get_invoice_history"
      end
      # verify the required parameter 'invoice_id' is set
      if @api_client.config.client_side_validation && invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_invoice_history"
      end
      # resource path
      local_var_path = '/Invoices/{InvoiceID}/History'.sub('{' + 'InvoiceID' + '}', invoice_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'])
      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] || 'HistoryRecords' 

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

    # Allows you to retrieve invoice reminder settings
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @return [InvoiceReminders]
    def get_invoice_reminders(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_invoice_reminders_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve invoice reminder settings
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @return [Array<(InvoiceReminders, Integer, Hash)>] InvoiceReminders data, response status code and response headers
    def get_invoice_reminders_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice_reminders ...'
      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 AccountingApi.get_invoice_reminders"
      end
      # resource path
      local_var_path = '/InvoiceReminders/Settings'

      # 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'])
      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] || 'InvoiceReminders' 

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

    # Allows you to retrieve any sales invoices or purchase bills
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Array<String>] :i_ds Filter by a comma-separated list of InvoicesIDs.
    # @option opts [Array<String>] :invoice_numbers Filter by a comma-separated list of InvoiceNumbers.
    # @option opts [Array<String>] :contact_i_ds Filter by a comma-separated list of ContactIDs.
    # @option opts [Array<String>] :statuses Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter.
    # @option opts [Integer] :page e.g. page&#x3D;1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice
    # @option opts [Boolean] :include_archived e.g. includeArchived&#x3D;true - Contacts with a status of ARCHIVED will be included in the response
    # @option opts [Boolean] :created_by_my_app When set to true you&#39;ll only retrieve Invoices created by your app
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Invoices]
    def get_invoices(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_invoices_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve any sales invoices or purchase bills
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Array<String>] :i_ds Filter by a comma-separated list of InvoicesIDs.
    # @option opts [Array<String>] :invoice_numbers Filter by a comma-separated list of InvoiceNumbers.
    # @option opts [Array<String>] :contact_i_ds Filter by a comma-separated list of ContactIDs.
    # @option opts [Array<String>] :statuses Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter.
    # @option opts [Integer] :page e.g. page&#x3D;1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice
    # @option opts [Boolean] :include_archived e.g. includeArchived&#x3D;true - Contacts with a status of ARCHIVED will be included in the response
    # @option opts [Boolean] :created_by_my_app When set to true you&#39;ll only retrieve Invoices created by your app
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(Invoices, Integer, Hash)>] Invoices data, response status code and response headers
    def get_invoices_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoices ...'
      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 AccountingApi.get_invoices"
      end
      # resource path
      local_var_path = '/Invoices'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
      query_params[:'IDs'] = @api_client.build_collection_param(opts[:'i_ds'], :csv) if !opts[:'i_ds'].nil?
      query_params[:'InvoiceNumbers'] = @api_client.build_collection_param(opts[:'invoice_numbers'], :csv) if !opts[:'invoice_numbers'].nil?
      query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_i_ds'], :csv) if !opts[:'contact_i_ds'].nil?
      query_params[:'Statuses'] = @api_client.build_collection_param(opts[:'statuses'], :csv) if !opts[:'statuses'].nil?
      query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
      query_params[:'includeArchived'] = opts[:'include_archived'] if !opts[:'include_archived'].nil?
      query_params[:'createdByMyApp'] = opts[:'created_by_my_app'] if !opts[:'created_by_my_app'].nil?
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to retrieve a specified item
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param item_id [String] Unique identifier for an Item
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Items]
    def get_item(xero_tenant_id, item_id, opts = {})
      data, _status_code, _headers = get_item_with_http_info(xero_tenant_id, item_id, opts)
      data
    end

    # Allows you to retrieve a specified item
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param item_id [String] Unique identifier for an Item
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(Items, Integer, Hash)>] Items data, response status code and response headers
    def get_item_with_http_info(xero_tenant_id, item_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_item ...'
      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 AccountingApi.get_item"
      end
      # verify the required parameter 'item_id' is set
      if @api_client.config.client_side_validation && item_id.nil?
        fail ArgumentError, "Missing the required parameter 'item_id' when calling AccountingApi.get_item"
      end
      # resource path
      local_var_path = '/Items/{ItemID}'.sub('{' + 'ItemID' + '}', item_id.to_s)

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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] || 'Items' 

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

    # Allows you to retrieve history for items
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param item_id [String] Unique identifier for an Item
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def get_item_history(xero_tenant_id, item_id, opts = {})
      data, _status_code, _headers = get_item_history_with_http_info(xero_tenant_id, item_id, opts)
      data
    end

    # Allows you to retrieve history for items
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param item_id [String] Unique identifier for an Item
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def get_item_history_with_http_info(xero_tenant_id, item_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_item_history ...'
      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 AccountingApi.get_item_history"
      end
      # verify the required parameter 'item_id' is set
      if @api_client.config.client_side_validation && item_id.nil?
        fail ArgumentError, "Missing the required parameter 'item_id' when calling AccountingApi.get_item_history"
      end
      # resource path
      local_var_path = '/Items/{ItemID}/History'.sub('{' + 'ItemID' + '}', item_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'])
      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] || 'HistoryRecords' 

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

    # Allows you to retrieve any items
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Items]
    def get_items(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_items_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve any items
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(Items, Integer, Hash)>] Items data, response status code and response headers
    def get_items_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_items ...'
      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 AccountingApi.get_items"
      end
      # resource path
      local_var_path = '/Items'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to retrieve a specified journals.
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param journal_id [String] Unique identifier for a Journal
    # @param [Hash] opts the optional parameters
    # @return [Journals]
    def get_journal(xero_tenant_id, journal_id, opts = {})
      data, _status_code, _headers = get_journal_with_http_info(xero_tenant_id, journal_id, opts)
      data
    end

    # Allows you to retrieve a specified journals.
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param journal_id [String] Unique identifier for a Journal
    # @param [Hash] opts the optional parameters
    # @return [Array<(Journals, Integer, Hash)>] Journals data, response status code and response headers
    def get_journal_with_http_info(xero_tenant_id, journal_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_journal ...'
      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 AccountingApi.get_journal"
      end
      # verify the required parameter 'journal_id' is set
      if @api_client.config.client_side_validation && journal_id.nil?
        fail ArgumentError, "Missing the required parameter 'journal_id' when calling AccountingApi.get_journal"
      end
      # resource path
      local_var_path = '/Journals/{JournalID}'.sub('{' + 'JournalID' + '}', journal_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'])
      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] || 'Journals' 

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

    # Allows you to retrieve any journals.
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [Integer] :offset Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned
    # @option opts [Boolean] :payments_only Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default.
    # @return [Journals]
    def get_journals(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_journals_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve any journals.
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [Integer] :offset Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned
    # @option opts [Boolean] :payments_only Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default.
    # @return [Array<(Journals, Integer, Hash)>] Journals data, response status code and response headers
    def get_journals_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_journals ...'
      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 AccountingApi.get_journals"
      end
      # resource path
      local_var_path = '/Journals'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
      query_params[:'paymentsOnly'] = opts[:'payments_only'] if !opts[:'payments_only'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to retrieve a specified linked transactions (billable expenses)
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param linked_transaction_id [String] Unique identifier for a LinkedTransaction
    # @param [Hash] opts the optional parameters
    # @return [LinkedTransactions]
    def get_linked_transaction(xero_tenant_id, linked_transaction_id, opts = {})
      data, _status_code, _headers = get_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, opts)
      data
    end

    # Allows you to retrieve a specified linked transactions (billable expenses)
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param linked_transaction_id [String] Unique identifier for a LinkedTransaction
    # @param [Hash] opts the optional parameters
    # @return [Array<(LinkedTransactions, Integer, Hash)>] LinkedTransactions data, response status code and response headers
    def get_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_linked_transaction ...'
      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 AccountingApi.get_linked_transaction"
      end
      # verify the required parameter 'linked_transaction_id' is set
      if @api_client.config.client_side_validation && linked_transaction_id.nil?
        fail ArgumentError, "Missing the required parameter 'linked_transaction_id' when calling AccountingApi.get_linked_transaction"
      end
      # resource path
      local_var_path = '/LinkedTransactions/{LinkedTransactionID}'.sub('{' + 'LinkedTransactionID' + '}', linked_transaction_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'])
      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] || 'LinkedTransactions' 

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

    # Retrieve linked transactions (billable expenses)
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :page Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page&#x3D;1.
    # @option opts [String] :linked_transaction_id The Xero identifier for an Linked Transaction
    # @option opts [String] :source_transaction_id Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice
    # @option opts [String] :contact_id Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer.
    # @option opts [String] :status Filter by the combination of ContactID and Status. Get  the linked transactions associaed to a  customer and with a status
    # @option opts [String] :target_transaction_id Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice
    # @return [LinkedTransactions]
    def get_linked_transactions(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_linked_transactions_with_http_info(xero_tenant_id, opts)
      data
    end

    # Retrieve linked transactions (billable expenses)
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :page Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page&#x3D;1.
    # @option opts [String] :linked_transaction_id The Xero identifier for an Linked Transaction
    # @option opts [String] :source_transaction_id Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice
    # @option opts [String] :contact_id Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer.
    # @option opts [String] :status Filter by the combination of ContactID and Status. Get  the linked transactions associaed to a  customer and with a status
    # @option opts [String] :target_transaction_id Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice
    # @return [Array<(LinkedTransactions, Integer, Hash)>] LinkedTransactions data, response status code and response headers
    def get_linked_transactions_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_linked_transactions ...'
      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 AccountingApi.get_linked_transactions"
      end
      # resource path
      local_var_path = '/LinkedTransactions'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
      query_params[:'LinkedTransactionID'] = opts[:'linked_transaction_id'] if !opts[:'linked_transaction_id'].nil?
      query_params[:'SourceTransactionID'] = opts[:'source_transaction_id'] if !opts[:'source_transaction_id'].nil?
      query_params[:'ContactID'] = opts[:'contact_id'] if !opts[:'contact_id'].nil?
      query_params[:'Status'] = opts[:'status'] if !opts[:'status'].nil?
      query_params[:'TargetTransactionID'] = opts[:'target_transaction_id'] if !opts[:'target_transaction_id'].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] || 'LinkedTransactions' 

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

    # Allows you to retrieve a specified manual journals
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param manual_journal_id [String] Unique identifier for a ManualJournal
    # @param [Hash] opts the optional parameters
    # @return [ManualJournals]
    def get_manual_journal(xero_tenant_id, manual_journal_id, opts = {})
      data, _status_code, _headers = get_manual_journal_with_http_info(xero_tenant_id, manual_journal_id, opts)
      data
    end

    # Allows you to retrieve a specified manual journals
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param manual_journal_id [String] Unique identifier for a ManualJournal
    # @param [Hash] opts the optional parameters
    # @return [Array<(ManualJournals, Integer, Hash)>] ManualJournals data, response status code and response headers
    def get_manual_journal_with_http_info(xero_tenant_id, manual_journal_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_manual_journal ...'
      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 AccountingApi.get_manual_journal"
      end
      # verify the required parameter 'manual_journal_id' is set
      if @api_client.config.client_side_validation && manual_journal_id.nil?
        fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.get_manual_journal"
      end
      # resource path
      local_var_path = '/ManualJournals/{ManualJournalID}'.sub('{' + 'ManualJournalID' + '}', manual_journal_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'])
      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] || 'ManualJournals' 

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

    # Allows you to retrieve specified Attachment on ManualJournal by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param manual_journal_id [String] Unique identifier for a ManualJournal
    # @param file_name [String] The name of the file being attached to a ManualJournal
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, content_type, opts = {})
      data, _status_code, _headers = get_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, manual_journal_id, file_name, content_type, opts)
      data
    end

    # Allows you to retrieve specified Attachment on ManualJournal by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param manual_journal_id [String] Unique identifier for a ManualJournal
    # @param file_name [String] The name of the file being attached to a ManualJournal
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, manual_journal_id, file_name, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_manual_journal_attachment_by_file_name ...'
      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 AccountingApi.get_manual_journal_attachment_by_file_name"
      end
      # verify the required parameter 'manual_journal_id' is set
      if @api_client.config.client_side_validation && manual_journal_id.nil?
        fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.get_manual_journal_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_manual_journal_attachment_by_file_name"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_manual_journal_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/ManualJournals/{ManualJournalID}/Attachments/{FileName}'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s).sub('{' + 'FileName' + '}', file_name.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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve specified Attachment on ManualJournals
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param manual_journal_id [String] Unique identifier for a ManualJournal
    # @param attachment_id [String] Unique identifier for a Attachment
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_manual_journal_attachment_by_id(xero_tenant_id, manual_journal_id, attachment_id, content_type, opts = {})
      data, _status_code, _headers = get_manual_journal_attachment_by_id_with_http_info(xero_tenant_id, manual_journal_id, attachment_id, content_type, opts)
      data
    end

    # Allows you to retrieve specified Attachment on ManualJournals
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param manual_journal_id [String] Unique identifier for a ManualJournal
    # @param attachment_id [String] Unique identifier for a Attachment
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_manual_journal_attachment_by_id_with_http_info(xero_tenant_id, manual_journal_id, attachment_id, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_manual_journal_attachment_by_id ...'
      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 AccountingApi.get_manual_journal_attachment_by_id"
      end
      # verify the required parameter 'manual_journal_id' is set
      if @api_client.config.client_side_validation && manual_journal_id.nil?
        fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.get_manual_journal_attachment_by_id"
      end
      # verify the required parameter 'attachment_id' is set
      if @api_client.config.client_side_validation && attachment_id.nil?
        fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_manual_journal_attachment_by_id"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_manual_journal_attachment_by_id"
      end
      # resource path
      local_var_path = '/ManualJournals/{ManualJournalID}/Attachments/{AttachmentID}'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve Attachment for manual journals
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param manual_journal_id [String] Unique identifier for a ManualJournal
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def get_manual_journal_attachments(xero_tenant_id, manual_journal_id, opts = {})
      data, _status_code, _headers = get_manual_journal_attachments_with_http_info(xero_tenant_id, manual_journal_id, opts)
      data
    end

    # Allows you to retrieve Attachment for manual journals
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param manual_journal_id [String] Unique identifier for a ManualJournal
    # @param [Hash] opts the optional parameters
    # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers
    def get_manual_journal_attachments_with_http_info(xero_tenant_id, manual_journal_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_manual_journal_attachments ...'
      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 AccountingApi.get_manual_journal_attachments"
      end
      # verify the required parameter 'manual_journal_id' is set
      if @api_client.config.client_side_validation && manual_journal_id.nil?
        fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.get_manual_journal_attachments"
      end
      # resource path
      local_var_path = '/ManualJournals/{ManualJournalID}/Attachments'.sub('{' + 'ManualJournalID' + '}', manual_journal_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'])
      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] || 'Attachments' 

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

    # Allows you to retrieve any manual journals
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Integer] :page e.g. page&#x3D;1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment
    # @return [ManualJournals]
    def get_manual_journals(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_manual_journals_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve any manual journals
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Integer] :page e.g. page&#x3D;1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment
    # @return [Array<(ManualJournals, Integer, Hash)>] ManualJournals data, response status code and response headers
    def get_manual_journals_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_manual_journals ...'
      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 AccountingApi.get_manual_journals"
      end
      # resource path
      local_var_path = '/ManualJournals'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
      query_params[:'page'] = opts[:'page'] if !opts[:'page'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to retrieve a URL to an online invoice
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param [Hash] opts the optional parameters
    # @return [OnlineInvoices]
    def get_online_invoice(xero_tenant_id, invoice_id, opts = {})
      data, _status_code, _headers = get_online_invoice_with_http_info(xero_tenant_id, invoice_id, opts)
      data
    end

    # Allows you to retrieve a URL to an online invoice
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param [Hash] opts the optional parameters
    # @return [Array<(OnlineInvoices, Integer, Hash)>] OnlineInvoices data, response status code and response headers
    def get_online_invoice_with_http_info(xero_tenant_id, invoice_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_online_invoice ...'
      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 AccountingApi.get_online_invoice"
      end
      # verify the required parameter 'invoice_id' is set
      if @api_client.config.client_side_validation && invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_online_invoice"
      end
      # resource path
      local_var_path = '/Invoices/{InvoiceID}/OnlineInvoice'.sub('{' + 'InvoiceID' + '}', invoice_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'])
      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] || 'OnlineInvoices' 

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

    # Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion.
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param organisation_id [String] The unique Xero identifier for an organisation
    # @param [Hash] opts the optional parameters
    # @return [CISOrgSetting]
    def get_organisation_cis_settings(xero_tenant_id, organisation_id, opts = {})
      data, _status_code, _headers = get_organisation_cis_settings_with_http_info(xero_tenant_id, organisation_id, opts)
      data
    end

    # Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion.
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param organisation_id [String] The unique Xero identifier for an organisation
    # @param [Hash] opts the optional parameters
    # @return [Array<(CISOrgSetting, Integer, Hash)>] CISOrgSetting data, response status code and response headers
    def get_organisation_cis_settings_with_http_info(xero_tenant_id, organisation_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_organisation_cis_settings ...'
      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 AccountingApi.get_organisation_cis_settings"
      end
      # verify the required parameter 'organisation_id' is set
      if @api_client.config.client_side_validation && organisation_id.nil?
        fail ArgumentError, "Missing the required parameter 'organisation_id' when calling AccountingApi.get_organisation_cis_settings"
      end
      # resource path
      local_var_path = '/Organisation/{OrganisationID}/CISSettings'.sub('{' + 'OrganisationID' + '}', organisation_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'])
      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] || 'CISOrgSetting' 

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

    # Allows you to retrieve Organisation details
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @return [Organisations]
    def get_organisations(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_organisations_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve Organisation details
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @return [Array<(Organisations, Integer, Hash)>] Organisations data, response status code and response headers
    def get_organisations_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_organisations ...'
      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 AccountingApi.get_organisations"
      end
      # resource path
      local_var_path = '/Organisation'

      # 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'])
      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] || 'Organisations' 

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

    # Allows you to retrieve a specified overpayments
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param overpayment_id [String] Unique identifier for a Overpayment
    # @param [Hash] opts the optional parameters
    # @return [Overpayments]
    def get_overpayment(xero_tenant_id, overpayment_id, opts = {})
      data, _status_code, _headers = get_overpayment_with_http_info(xero_tenant_id, overpayment_id, opts)
      data
    end

    # Allows you to retrieve a specified overpayments
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param overpayment_id [String] Unique identifier for a Overpayment
    # @param [Hash] opts the optional parameters
    # @return [Array<(Overpayments, Integer, Hash)>] Overpayments data, response status code and response headers
    def get_overpayment_with_http_info(xero_tenant_id, overpayment_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_overpayment ...'
      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 AccountingApi.get_overpayment"
      end
      # verify the required parameter 'overpayment_id' is set
      if @api_client.config.client_side_validation && overpayment_id.nil?
        fail ArgumentError, "Missing the required parameter 'overpayment_id' when calling AccountingApi.get_overpayment"
      end
      # resource path
      local_var_path = '/Overpayments/{OverpaymentID}'.sub('{' + 'OverpaymentID' + '}', overpayment_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'])
      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] || 'Overpayments' 

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

    # Allows you to retrieve a history records of an Overpayment
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param overpayment_id [String] Unique identifier for a Overpayment
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def get_overpayment_history(xero_tenant_id, overpayment_id, opts = {})
      data, _status_code, _headers = get_overpayment_history_with_http_info(xero_tenant_id, overpayment_id, opts)
      data
    end

    # Allows you to retrieve a history records of an Overpayment
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param overpayment_id [String] Unique identifier for a Overpayment
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def get_overpayment_history_with_http_info(xero_tenant_id, overpayment_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_overpayment_history ...'
      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 AccountingApi.get_overpayment_history"
      end
      # verify the required parameter 'overpayment_id' is set
      if @api_client.config.client_side_validation && overpayment_id.nil?
        fail ArgumentError, "Missing the required parameter 'overpayment_id' when calling AccountingApi.get_overpayment_history"
      end
      # resource path
      local_var_path = '/Overpayments/{OverpaymentID}/History'.sub('{' + 'OverpaymentID' + '}', overpayment_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'])
      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] || 'HistoryRecords' 

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

    # Allows you to retrieve overpayments
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Integer] :page e.g. page&#x3D;1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Overpayments]
    def get_overpayments(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_overpayments_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve overpayments
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Integer] :page e.g. page&#x3D;1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(Overpayments, Integer, Hash)>] Overpayments data, response status code and response headers
    def get_overpayments_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_overpayments ...'
      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 AccountingApi.get_overpayments"
      end
      # resource path
      local_var_path = '/Overpayments'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
      query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to retrieve a specified payment for invoices and credit notes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param payment_id [String] Unique identifier for a Payment
    # @param [Hash] opts the optional parameters
    # @return [Payments]
    def get_payment(xero_tenant_id, payment_id, opts = {})
      data, _status_code, _headers = get_payment_with_http_info(xero_tenant_id, payment_id, opts)
      data
    end

    # Allows you to retrieve a specified payment for invoices and credit notes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param payment_id [String] Unique identifier for a Payment
    # @param [Hash] opts the optional parameters
    # @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers
    def get_payment_with_http_info(xero_tenant_id, payment_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_payment ...'
      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 AccountingApi.get_payment"
      end
      # verify the required parameter 'payment_id' is set
      if @api_client.config.client_side_validation && payment_id.nil?
        fail ArgumentError, "Missing the required parameter 'payment_id' when calling AccountingApi.get_payment"
      end
      # resource path
      local_var_path = '/Payments/{PaymentID}'.sub('{' + 'PaymentID' + '}', payment_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'])
      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] || 'Payments' 

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

    # Allows you to retrieve history records of a payment
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param payment_id [String] Unique identifier for a Payment
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def get_payment_history(xero_tenant_id, payment_id, opts = {})
      data, _status_code, _headers = get_payment_history_with_http_info(xero_tenant_id, payment_id, opts)
      data
    end

    # Allows you to retrieve history records of a payment
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param payment_id [String] Unique identifier for a Payment
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def get_payment_history_with_http_info(xero_tenant_id, payment_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_payment_history ...'
      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 AccountingApi.get_payment_history"
      end
      # verify the required parameter 'payment_id' is set
      if @api_client.config.client_side_validation && payment_id.nil?
        fail ArgumentError, "Missing the required parameter 'payment_id' when calling AccountingApi.get_payment_history"
      end
      # resource path
      local_var_path = '/Payments/{PaymentID}/History'.sub('{' + 'PaymentID' + '}', payment_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'])
      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] || 'HistoryRecords' 

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

    # Allows you to retrieve payment services
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @return [PaymentServices]
    def get_payment_services(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_payment_services_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve payment services
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @return [Array<(PaymentServices, Integer, Hash)>] PaymentServices data, response status code and response headers
    def get_payment_services_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_payment_services ...'
      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 AccountingApi.get_payment_services"
      end
      # resource path
      local_var_path = '/PaymentServices'

      # 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'])
      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] || 'PaymentServices' 

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

    # Allows you to retrieve payments for invoices and credit notes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [Payments]
    def get_payments(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_payments_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve payments for invoices and credit notes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers
    def get_payments_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_payments ...'
      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 AccountingApi.get_payments"
      end
      # resource path
      local_var_path = '/Payments'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to retrieve a specified prepayments
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param prepayment_id [String] Unique identifier for a PrePayment
    # @param [Hash] opts the optional parameters
    # @return [Prepayments]
    def get_prepayment(xero_tenant_id, prepayment_id, opts = {})
      data, _status_code, _headers = get_prepayment_with_http_info(xero_tenant_id, prepayment_id, opts)
      data
    end

    # Allows you to retrieve a specified prepayments
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param prepayment_id [String] Unique identifier for a PrePayment
    # @param [Hash] opts the optional parameters
    # @return [Array<(Prepayments, Integer, Hash)>] Prepayments data, response status code and response headers
    def get_prepayment_with_http_info(xero_tenant_id, prepayment_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_prepayment ...'
      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 AccountingApi.get_prepayment"
      end
      # verify the required parameter 'prepayment_id' is set
      if @api_client.config.client_side_validation && prepayment_id.nil?
        fail ArgumentError, "Missing the required parameter 'prepayment_id' when calling AccountingApi.get_prepayment"
      end
      # resource path
      local_var_path = '/Prepayments/{PrepaymentID}'.sub('{' + 'PrepaymentID' + '}', prepayment_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'])
      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] || 'Prepayments' 

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

    # Allows you to retrieve a history records of an Prepayment
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param prepayment_id [String] Unique identifier for a PrePayment
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def get_prepayment_history(xero_tenant_id, prepayment_id, opts = {})
      data, _status_code, _headers = get_prepayment_history_with_http_info(xero_tenant_id, prepayment_id, opts)
      data
    end

    # Allows you to retrieve a history records of an Prepayment
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param prepayment_id [String] Unique identifier for a PrePayment
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def get_prepayment_history_with_http_info(xero_tenant_id, prepayment_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_prepayment_history ...'
      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 AccountingApi.get_prepayment_history"
      end
      # verify the required parameter 'prepayment_id' is set
      if @api_client.config.client_side_validation && prepayment_id.nil?
        fail ArgumentError, "Missing the required parameter 'prepayment_id' when calling AccountingApi.get_prepayment_history"
      end
      # resource path
      local_var_path = '/Prepayments/{PrepaymentID}/History'.sub('{' + 'PrepaymentID' + '}', prepayment_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'])
      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] || 'HistoryRecords' 

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

    # Allows you to retrieve prepayments
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Integer] :page e.g. page&#x3D;1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Prepayments]
    def get_prepayments(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_prepayments_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve prepayments
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Integer] :page e.g. page&#x3D;1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(Prepayments, Integer, Hash)>] Prepayments data, response status code and response headers
    def get_prepayments_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_prepayments ...'
      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 AccountingApi.get_prepayments"
      end
      # resource path
      local_var_path = '/Prepayments'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
      query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to retrieve a specified purchase orders
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param purchase_order_id [String] Unique identifier for a PurchaseOrder
    # @param [Hash] opts the optional parameters
    # @return [PurchaseOrders]
    def get_purchase_order(xero_tenant_id, purchase_order_id, opts = {})
      data, _status_code, _headers = get_purchase_order_with_http_info(xero_tenant_id, purchase_order_id, opts)
      data
    end

    # Allows you to retrieve a specified purchase orders
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param purchase_order_id [String] Unique identifier for a PurchaseOrder
    # @param [Hash] opts the optional parameters
    # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers
    def get_purchase_order_with_http_info(xero_tenant_id, purchase_order_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_order ...'
      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 AccountingApi.get_purchase_order"
      end
      # verify the required parameter 'purchase_order_id' is set
      if @api_client.config.client_side_validation && purchase_order_id.nil?
        fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.get_purchase_order"
      end
      # resource path
      local_var_path = '/PurchaseOrders/{PurchaseOrderID}'.sub('{' + 'PurchaseOrderID' + '}', purchase_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'])
      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] || 'PurchaseOrders' 

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

    # Allows you to retrieve purchase orders as PDF files
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param purchase_order_id [String] Unique identifier for an Purchase Order
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_purchase_order_as_pdf(xero_tenant_id, purchase_order_id, opts = {})
      data, _status_code, _headers = get_purchase_order_as_pdf_with_http_info(xero_tenant_id, purchase_order_id, opts)
      data
    end

    # Allows you to retrieve purchase orders as PDF files
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param purchase_order_id [String] Unique identifier for an Purchase Order
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_purchase_order_as_pdf_with_http_info(xero_tenant_id, purchase_order_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_order_as_pdf ...'
      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 AccountingApi.get_purchase_order_as_pdf"
      end
      # verify the required parameter 'purchase_order_id' is set
      if @api_client.config.client_side_validation && purchase_order_id.nil?
        fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.get_purchase_order_as_pdf"
      end
      # resource path
      local_var_path = '/PurchaseOrders/{PurchaseOrderID}'.sub('{' + 'PurchaseOrderID' + '}', purchase_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/pdf'])
      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, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Allows you to retrieve a specified purchase orders
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param purchase_order_number [String] Unique identifier for a PurchaseOrder
    # @param [Hash] opts the optional parameters
    # @return [PurchaseOrders]
    def get_purchase_order_by_number(xero_tenant_id, purchase_order_number, opts = {})
      data, _status_code, _headers = get_purchase_order_by_number_with_http_info(xero_tenant_id, purchase_order_number, opts)
      data
    end

    # Allows you to retrieve a specified purchase orders
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param purchase_order_number [String] Unique identifier for a PurchaseOrder
    # @param [Hash] opts the optional parameters
    # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers
    def get_purchase_order_by_number_with_http_info(xero_tenant_id, purchase_order_number, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_order_by_number ...'
      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 AccountingApi.get_purchase_order_by_number"
      end
      # verify the required parameter 'purchase_order_number' is set
      if @api_client.config.client_side_validation && purchase_order_number.nil?
        fail ArgumentError, "Missing the required parameter 'purchase_order_number' when calling AccountingApi.get_purchase_order_by_number"
      end
      # resource path
      local_var_path = '/PurchaseOrders/{PurchaseOrderNumber}'.sub('{' + 'PurchaseOrderNumber' + '}', purchase_order_number.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'])
      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] || 'PurchaseOrders' 

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

    # Allows you to retrieve history for PurchaseOrder
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param purchase_order_id [String] Unique identifier for a PurchaseOrder
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def get_purchase_order_history(xero_tenant_id, purchase_order_id, opts = {})
      data, _status_code, _headers = get_purchase_order_history_with_http_info(xero_tenant_id, purchase_order_id, opts)
      data
    end

    # Allows you to retrieve history for PurchaseOrder
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param purchase_order_id [String] Unique identifier for a PurchaseOrder
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def get_purchase_order_history_with_http_info(xero_tenant_id, purchase_order_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_order_history ...'
      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 AccountingApi.get_purchase_order_history"
      end
      # verify the required parameter 'purchase_order_id' is set
      if @api_client.config.client_side_validation && purchase_order_id.nil?
        fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.get_purchase_order_history"
      end
      # resource path
      local_var_path = '/PurchaseOrders/{PurchaseOrderID}/History'.sub('{' + 'PurchaseOrderID' + '}', purchase_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'])
      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] || 'HistoryRecords' 

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

    # Allows you to retrieve purchase orders
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :status Filter by purchase order status
    # @option opts [String] :date_from Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom&#x3D;2015-12-01&amp;DateTo&#x3D;2015-12-31
    # @option opts [String] :date_to Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom&#x3D;2015-12-01&amp;DateTo&#x3D;2015-12-31
    # @option opts [String] :order Order by an any element
    # @option opts [Integer] :page To specify a page, append the page parameter to the URL e.g. ?page&#x3D;1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page&#x3D;2 and continuing this process until no more results are returned.
    # @return [PurchaseOrders]
    def get_purchase_orders(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_purchase_orders_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve purchase orders
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :status Filter by purchase order status
    # @option opts [String] :date_from Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom&#x3D;2015-12-01&amp;DateTo&#x3D;2015-12-31
    # @option opts [String] :date_to Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom&#x3D;2015-12-01&amp;DateTo&#x3D;2015-12-31
    # @option opts [String] :order Order by an any element
    # @option opts [Integer] :page To specify a page, append the page parameter to the URL e.g. ?page&#x3D;1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page&#x3D;2 and continuing this process until no more results are returned.
    # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers
    def get_purchase_orders_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_orders ...'
      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 AccountingApi.get_purchase_orders"
      end
      allowable_values = ["DRAFT", "SUBMITTED", "AUTHORISED", "BILLED", "DELETED"]
      if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
        fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
      end
      # resource path
      local_var_path = '/PurchaseOrders'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'Status'] = opts[:'status'] if !opts[:'status'].nil?
      query_params[:'DateFrom'] = opts[:'date_from'] if !opts[:'date_from'].nil?
      query_params[:'DateTo'] = opts[:'date_to'] if !opts[:'date_to'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
      query_params[:'page'] = opts[:'page'] if !opts[:'page'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to retrieve a specified quote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for an Quote
    # @param [Hash] opts the optional parameters
    # @return [Quotes]
    def get_quote(xero_tenant_id, quote_id, opts = {})
      data, _status_code, _headers = get_quote_with_http_info(xero_tenant_id, quote_id, opts)
      data
    end

    # Allows you to retrieve a specified quote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for an Quote
    # @param [Hash] opts the optional parameters
    # @return [Array<(Quotes, Integer, Hash)>] Quotes data, response status code and response headers
    def get_quote_with_http_info(xero_tenant_id, quote_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_quote ...'
      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 AccountingApi.get_quote"
      end
      # verify the required parameter 'quote_id' is set
      if @api_client.config.client_side_validation && quote_id.nil?
        fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.get_quote"
      end
      # resource path
      local_var_path = '/Quotes/{QuoteID}'.sub('{' + 'QuoteID' + '}', quote_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'])
      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] || 'Quotes' 

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

    # Allows you to retrieve quotes as PDF files
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for an Quote
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_quote_as_pdf(xero_tenant_id, quote_id, opts = {})
      data, _status_code, _headers = get_quote_as_pdf_with_http_info(xero_tenant_id, quote_id, opts)
      data
    end

    # Allows you to retrieve quotes as PDF files
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for an Quote
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_quote_as_pdf_with_http_info(xero_tenant_id, quote_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_quote_as_pdf ...'
      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 AccountingApi.get_quote_as_pdf"
      end
      # verify the required parameter 'quote_id' is set
      if @api_client.config.client_side_validation && quote_id.nil?
        fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.get_quote_as_pdf"
      end
      # resource path
      local_var_path = '/Quotes/{QuoteID}'.sub('{' + 'QuoteID' + '}', quote_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/pdf'])
      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, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AccountingApi#get_quote_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Allows you to retrieve Attachment on Quote by Filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for Quote object
    # @param file_name [String] Name of the attachment
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, content_type, opts = {})
      data, _status_code, _headers = get_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, file_name, content_type, opts)
      data
    end

    # Allows you to retrieve Attachment on Quote by Filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for Quote object
    # @param file_name [String] Name of the attachment
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, file_name, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_quote_attachment_by_file_name ...'
      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 AccountingApi.get_quote_attachment_by_file_name"
      end
      # verify the required parameter 'quote_id' is set
      if @api_client.config.client_side_validation && quote_id.nil?
        fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.get_quote_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_quote_attachment_by_file_name"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_quote_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/Quotes/{QuoteID}/Attachments/{FileName}'.sub('{' + 'QuoteID' + '}', quote_id.to_s).sub('{' + 'FileName' + '}', file_name.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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve specific Attachment on Quote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for Quote object
    # @param attachment_id [String] Unique identifier for Attachment object
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_quote_attachment_by_id(xero_tenant_id, quote_id, attachment_id, content_type, opts = {})
      data, _status_code, _headers = get_quote_attachment_by_id_with_http_info(xero_tenant_id, quote_id, attachment_id, content_type, opts)
      data
    end

    # Allows you to retrieve specific Attachment on Quote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for Quote object
    # @param attachment_id [String] Unique identifier for Attachment object
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_quote_attachment_by_id_with_http_info(xero_tenant_id, quote_id, attachment_id, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_quote_attachment_by_id ...'
      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 AccountingApi.get_quote_attachment_by_id"
      end
      # verify the required parameter 'quote_id' is set
      if @api_client.config.client_side_validation && quote_id.nil?
        fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.get_quote_attachment_by_id"
      end
      # verify the required parameter 'attachment_id' is set
      if @api_client.config.client_side_validation && attachment_id.nil?
        fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_quote_attachment_by_id"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_quote_attachment_by_id"
      end
      # resource path
      local_var_path = '/Quotes/{QuoteID}/Attachments/{AttachmentID}'.sub('{' + 'QuoteID' + '}', quote_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve Attachments for Quotes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for Quote object
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def get_quote_attachments(xero_tenant_id, quote_id, opts = {})
      data, _status_code, _headers = get_quote_attachments_with_http_info(xero_tenant_id, quote_id, opts)
      data
    end

    # Allows you to retrieve Attachments for Quotes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for Quote object
    # @param [Hash] opts the optional parameters
    # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers
    def get_quote_attachments_with_http_info(xero_tenant_id, quote_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_quote_attachments ...'
      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 AccountingApi.get_quote_attachments"
      end
      # verify the required parameter 'quote_id' is set
      if @api_client.config.client_side_validation && quote_id.nil?
        fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.get_quote_attachments"
      end
      # resource path
      local_var_path = '/Quotes/{QuoteID}/Attachments'.sub('{' + 'QuoteID' + '}', quote_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'])
      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] || 'Attachments' 

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

    # Allows you to retrieve a history records of an quote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for an Quote
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def get_quote_history(xero_tenant_id, quote_id, opts = {})
      data, _status_code, _headers = get_quote_history_with_http_info(xero_tenant_id, quote_id, opts)
      data
    end

    # Allows you to retrieve a history records of an quote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for an Quote
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def get_quote_history_with_http_info(xero_tenant_id, quote_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_quote_history ...'
      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 AccountingApi.get_quote_history"
      end
      # verify the required parameter 'quote_id' is set
      if @api_client.config.client_side_validation && quote_id.nil?
        fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.get_quote_history"
      end
      # resource path
      local_var_path = '/Quotes/{QuoteID}/History'.sub('{' + 'QuoteID' + '}', quote_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'])
      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] || 'HistoryRecords' 

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

    # Allows you to retrieve any sales quotes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [Date] :date_from Filter for quotes after a particular date
    # @option opts [Date] :date_to Filter for quotes before a particular date
    # @option opts [Date] :expiry_date_from Filter for quotes expiring after a particular date
    # @option opts [Date] :expiry_date_to Filter for quotes before a particular date
    # @option opts [String] :contact_id Filter for quotes belonging to a particular contact
    # @option opts [String] :status Filter for quotes of a particular Status
    # @option opts [Integer] :page e.g. page&#x3D;1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote
    # @option opts [String] :order Order by an any element
    # @return [Quotes]
    def get_quotes(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_quotes_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve any sales quotes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [Date] :date_from Filter for quotes after a particular date
    # @option opts [Date] :date_to Filter for quotes before a particular date
    # @option opts [Date] :expiry_date_from Filter for quotes expiring after a particular date
    # @option opts [Date] :expiry_date_to Filter for quotes before a particular date
    # @option opts [String] :contact_id Filter for quotes belonging to a particular contact
    # @option opts [String] :status Filter for quotes of a particular Status
    # @option opts [Integer] :page e.g. page&#x3D;1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote
    # @option opts [String] :order Order by an any element
    # @return [Array<(Quotes, Integer, Hash)>] Quotes data, response status code and response headers
    def get_quotes_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_quotes ...'
      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 AccountingApi.get_quotes"
      end
      # resource path
      local_var_path = '/Quotes'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'DateFrom'] = opts[:'date_from'] if !opts[:'date_from'].nil?
      query_params[:'DateTo'] = opts[:'date_to'] if !opts[:'date_to'].nil?
      query_params[:'ExpiryDateFrom'] = opts[:'expiry_date_from'] if !opts[:'expiry_date_from'].nil?
      query_params[:'ExpiryDateTo'] = opts[:'expiry_date_to'] if !opts[:'expiry_date_to'].nil?
      query_params[:'ContactID'] = opts[:'contact_id'] if !opts[:'contact_id'].nil?
      query_params[:'Status'] = opts[:'status'] if !opts[:'status'].nil?
      query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to retrieve a specified draft expense claim receipts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipt_id [String] Unique identifier for a Receipt
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Receipts]
    def get_receipt(xero_tenant_id, receipt_id, opts = {})
      data, _status_code, _headers = get_receipt_with_http_info(xero_tenant_id, receipt_id, opts)
      data
    end

    # Allows you to retrieve a specified draft expense claim receipts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipt_id [String] Unique identifier for a Receipt
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(Receipts, Integer, Hash)>] Receipts data, response status code and response headers
    def get_receipt_with_http_info(xero_tenant_id, receipt_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_receipt ...'
      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 AccountingApi.get_receipt"
      end
      # verify the required parameter 'receipt_id' is set
      if @api_client.config.client_side_validation && receipt_id.nil?
        fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.get_receipt"
      end
      # resource path
      local_var_path = '/Receipts/{ReceiptID}'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s)

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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] || 'Receipts' 

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

    # Allows you to retrieve Attachments on expense claim receipts by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipt_id [String] Unique identifier for a Receipt
    # @param file_name [String] The name of the file being attached to the Receipt
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, content_type, opts = {})
      data, _status_code, _headers = get_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_id, file_name, content_type, opts)
      data
    end

    # Allows you to retrieve Attachments on expense claim receipts by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipt_id [String] Unique identifier for a Receipt
    # @param file_name [String] The name of the file being attached to the Receipt
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_id, file_name, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_receipt_attachment_by_file_name ...'
      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 AccountingApi.get_receipt_attachment_by_file_name"
      end
      # verify the required parameter 'receipt_id' is set
      if @api_client.config.client_side_validation && receipt_id.nil?
        fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.get_receipt_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_receipt_attachment_by_file_name"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_receipt_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/Receipts/{ReceiptID}/Attachments/{FileName}'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s).sub('{' + 'FileName' + '}', file_name.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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve Attachments on expense claim receipts by ID
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipt_id [String] Unique identifier for a Receipt
    # @param attachment_id [String] Unique identifier for a Attachment
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_receipt_attachment_by_id(xero_tenant_id, receipt_id, attachment_id, content_type, opts = {})
      data, _status_code, _headers = get_receipt_attachment_by_id_with_http_info(xero_tenant_id, receipt_id, attachment_id, content_type, opts)
      data
    end

    # Allows you to retrieve Attachments on expense claim receipts by ID
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipt_id [String] Unique identifier for a Receipt
    # @param attachment_id [String] Unique identifier for a Attachment
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_receipt_attachment_by_id_with_http_info(xero_tenant_id, receipt_id, attachment_id, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_receipt_attachment_by_id ...'
      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 AccountingApi.get_receipt_attachment_by_id"
      end
      # verify the required parameter 'receipt_id' is set
      if @api_client.config.client_side_validation && receipt_id.nil?
        fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.get_receipt_attachment_by_id"
      end
      # verify the required parameter 'attachment_id' is set
      if @api_client.config.client_side_validation && attachment_id.nil?
        fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_receipt_attachment_by_id"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_receipt_attachment_by_id"
      end
      # resource path
      local_var_path = '/Receipts/{ReceiptID}/Attachments/{AttachmentID}'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve Attachments for expense claim receipts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipt_id [String] Unique identifier for a Receipt
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def get_receipt_attachments(xero_tenant_id, receipt_id, opts = {})
      data, _status_code, _headers = get_receipt_attachments_with_http_info(xero_tenant_id, receipt_id, opts)
      data
    end

    # Allows you to retrieve Attachments for expense claim receipts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipt_id [String] Unique identifier for a Receipt
    # @param [Hash] opts the optional parameters
    # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers
    def get_receipt_attachments_with_http_info(xero_tenant_id, receipt_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_receipt_attachments ...'
      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 AccountingApi.get_receipt_attachments"
      end
      # verify the required parameter 'receipt_id' is set
      if @api_client.config.client_side_validation && receipt_id.nil?
        fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.get_receipt_attachments"
      end
      # resource path
      local_var_path = '/Receipts/{ReceiptID}/Attachments'.sub('{' + 'ReceiptID' + '}', receipt_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'])
      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] || 'Attachments' 

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

    # Allows you to retrieve a history records of an Receipt
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipt_id [String] Unique identifier for a Receipt
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def get_receipt_history(xero_tenant_id, receipt_id, opts = {})
      data, _status_code, _headers = get_receipt_history_with_http_info(xero_tenant_id, receipt_id, opts)
      data
    end

    # Allows you to retrieve a history records of an Receipt
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipt_id [String] Unique identifier for a Receipt
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def get_receipt_history_with_http_info(xero_tenant_id, receipt_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_receipt_history ...'
      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 AccountingApi.get_receipt_history"
      end
      # verify the required parameter 'receipt_id' is set
      if @api_client.config.client_side_validation && receipt_id.nil?
        fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.get_receipt_history"
      end
      # resource path
      local_var_path = '/Receipts/{ReceiptID}/History'.sub('{' + 'ReceiptID' + '}', receipt_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'])
      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] || 'HistoryRecords' 

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

    # Allows you to retrieve draft expense claim receipts for any user
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Receipts]
    def get_receipts(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_receipts_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve draft expense claim receipts for any user
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(Receipts, Integer, Hash)>] Receipts data, response status code and response headers
    def get_receipts_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_receipts ...'
      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 AccountingApi.get_receipts"
      end
      # resource path
      local_var_path = '/Receipts'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to retrieve a specified repeating invoice
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice
    # @param [Hash] opts the optional parameters
    # @return [RepeatingInvoices]
    def get_repeating_invoice(xero_tenant_id, repeating_invoice_id, opts = {})
      data, _status_code, _headers = get_repeating_invoice_with_http_info(xero_tenant_id, repeating_invoice_id, opts)
      data
    end

    # Allows you to retrieve a specified repeating invoice
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice
    # @param [Hash] opts the optional parameters
    # @return [Array<(RepeatingInvoices, Integer, Hash)>] RepeatingInvoices data, response status code and response headers
    def get_repeating_invoice_with_http_info(xero_tenant_id, repeating_invoice_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_repeating_invoice ...'
      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 AccountingApi.get_repeating_invoice"
      end
      # verify the required parameter 'repeating_invoice_id' is set
      if @api_client.config.client_side_validation && repeating_invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.get_repeating_invoice"
      end
      # resource path
      local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_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'])
      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] || 'RepeatingInvoices' 

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

    # Allows you to retrieve specified attachment on repeating invoices by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice
    # @param file_name [String] The name of the file being attached to a Repeating Invoice
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, content_type, opts = {})
      data, _status_code, _headers = get_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, repeating_invoice_id, file_name, content_type, opts)
      data
    end

    # Allows you to retrieve specified attachment on repeating invoices by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice
    # @param file_name [String] The name of the file being attached to a Repeating Invoice
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, repeating_invoice_id, file_name, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_repeating_invoice_attachment_by_file_name ...'
      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 AccountingApi.get_repeating_invoice_attachment_by_file_name"
      end
      # verify the required parameter 'repeating_invoice_id' is set
      if @api_client.config.client_side_validation && repeating_invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.get_repeating_invoice_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_repeating_invoice_attachment_by_file_name"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_repeating_invoice_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve a specified Attachments on repeating invoices
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice
    # @param attachment_id [String] Unique identifier for a Attachment
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [File]
    def get_repeating_invoice_attachment_by_id(xero_tenant_id, repeating_invoice_id, attachment_id, content_type, opts = {})
      data, _status_code, _headers = get_repeating_invoice_attachment_by_id_with_http_info(xero_tenant_id, repeating_invoice_id, attachment_id, content_type, opts)
      data
    end

    # Allows you to retrieve a specified Attachments on repeating invoices
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice
    # @param attachment_id [String] Unique identifier for a Attachment
    # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
    # @param [Hash] opts the optional parameters
    # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
    def get_repeating_invoice_attachment_by_id_with_http_info(xero_tenant_id, repeating_invoice_id, attachment_id, content_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_repeating_invoice_attachment_by_id ...'
      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 AccountingApi.get_repeating_invoice_attachment_by_id"
      end
      # verify the required parameter 'repeating_invoice_id' is set
      if @api_client.config.client_side_validation && repeating_invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.get_repeating_invoice_attachment_by_id"
      end
      # verify the required parameter 'attachment_id' is set
      if @api_client.config.client_side_validation && attachment_id.nil?
        fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_repeating_invoice_attachment_by_id"
      end
      # verify the required parameter 'content_type' is set
      if @api_client.config.client_side_validation && content_type.nil?
        fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_repeating_invoice_attachment_by_id"
      end
      # resource path
      local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{AttachmentID}'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_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/octet-stream'])
      header_params[:'xero-tenant-id'] = xero_tenant_id
      header_params[:'contentType'] = content_type

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

    # Allows you to retrieve Attachments on repeating invoice
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def get_repeating_invoice_attachments(xero_tenant_id, repeating_invoice_id, opts = {})
      data, _status_code, _headers = get_repeating_invoice_attachments_with_http_info(xero_tenant_id, repeating_invoice_id, opts)
      data
    end

    # Allows you to retrieve Attachments on repeating invoice
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice
    # @param [Hash] opts the optional parameters
    # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers
    def get_repeating_invoice_attachments_with_http_info(xero_tenant_id, repeating_invoice_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_repeating_invoice_attachments ...'
      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 AccountingApi.get_repeating_invoice_attachments"
      end
      # verify the required parameter 'repeating_invoice_id' is set
      if @api_client.config.client_side_validation && repeating_invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.get_repeating_invoice_attachments"
      end
      # resource path
      local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/Attachments'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_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'])
      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] || 'Attachments' 

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

    # Allows you to retrieve history for a repeating invoice
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice
    # @param [Hash] opts the optional parameters
    # @return [HistoryRecords]
    def get_repeating_invoice_history(xero_tenant_id, repeating_invoice_id, opts = {})
      data, _status_code, _headers = get_repeating_invoice_history_with_http_info(xero_tenant_id, repeating_invoice_id, opts)
      data
    end

    # Allows you to retrieve history for a repeating invoice
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice
    # @param [Hash] opts the optional parameters
    # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers
    def get_repeating_invoice_history_with_http_info(xero_tenant_id, repeating_invoice_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_repeating_invoice_history ...'
      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 AccountingApi.get_repeating_invoice_history"
      end
      # verify the required parameter 'repeating_invoice_id' is set
      if @api_client.config.client_side_validation && repeating_invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.get_repeating_invoice_history"
      end
      # resource path
      local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/History'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_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'])
      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] || 'HistoryRecords' 

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

    # Allows you to retrieve any repeating invoices
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [RepeatingInvoices]
    def get_repeating_invoices(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_repeating_invoices_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve any repeating invoices
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [Array<(RepeatingInvoices, Integer, Hash)>] RepeatingInvoices data, response status code and response headers
    def get_repeating_invoices_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_repeating_invoices ...'
      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 AccountingApi.get_repeating_invoices"
      end
      # resource path
      local_var_path = '/RepeatingInvoices'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].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] || 'RepeatingInvoices' 

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

    # Allows you to retrieve report for AgedPayablesByContact
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param [Hash] opts the optional parameters
    # @option opts [Date] :date The date of the Aged Payables By Contact report
    # @option opts [Date] :from_date The from date of the Aged Payables By Contact report
    # @option opts [Date] :to_date The to date of the Aged Payables By Contact report
    # @return [ReportWithRows]
    def get_report_aged_payables_by_contact(xero_tenant_id, contact_id, opts = {})
      data, _status_code, _headers = get_report_aged_payables_by_contact_with_http_info(xero_tenant_id, contact_id, opts)
      data
    end

    # Allows you to retrieve report for AgedPayablesByContact
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param [Hash] opts the optional parameters
    # @option opts [Date] :date The date of the Aged Payables By Contact report
    # @option opts [Date] :from_date The from date of the Aged Payables By Contact report
    # @option opts [Date] :to_date The to date of the Aged Payables By Contact report
    # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers
    def get_report_aged_payables_by_contact_with_http_info(xero_tenant_id, contact_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_aged_payables_by_contact ...'
      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 AccountingApi.get_report_aged_payables_by_contact"
      end
      # verify the required parameter 'contact_id' is set
      if @api_client.config.client_side_validation && contact_id.nil?
        fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_report_aged_payables_by_contact"
      end
      # resource path
      local_var_path = '/Reports/AgedPayablesByContact'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'contactId'] = contact_id
      query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil?
      query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil?
      query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].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] || 'ReportWithRows' 

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

    # Allows you to retrieve report for AgedReceivablesByContact
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param [Hash] opts the optional parameters
    # @option opts [Date] :date The date of the Aged Receivables By Contact report
    # @option opts [Date] :from_date The from date of the Aged Receivables By Contact report
    # @option opts [Date] :to_date The to date of the Aged Receivables By Contact report
    # @return [ReportWithRows]
    def get_report_aged_receivables_by_contact(xero_tenant_id, contact_id, opts = {})
      data, _status_code, _headers = get_report_aged_receivables_by_contact_with_http_info(xero_tenant_id, contact_id, opts)
      data
    end

    # Allows you to retrieve report for AgedReceivablesByContact
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param [Hash] opts the optional parameters
    # @option opts [Date] :date The date of the Aged Receivables By Contact report
    # @option opts [Date] :from_date The from date of the Aged Receivables By Contact report
    # @option opts [Date] :to_date The to date of the Aged Receivables By Contact report
    # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers
    def get_report_aged_receivables_by_contact_with_http_info(xero_tenant_id, contact_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_aged_receivables_by_contact ...'
      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 AccountingApi.get_report_aged_receivables_by_contact"
      end
      # verify the required parameter 'contact_id' is set
      if @api_client.config.client_side_validation && contact_id.nil?
        fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_report_aged_receivables_by_contact"
      end
      # resource path
      local_var_path = '/Reports/AgedReceivablesByContact'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'contactId'] = contact_id
      query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil?
      query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil?
      query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].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] || 'ReportWithRows' 

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

    # Allows you to retrieve report for BAS only valid for AU orgs
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param report_id [String] Unique identifier for a Report
    # @param [Hash] opts the optional parameters
    # @return [ReportWithRows]
    def get_report_ba_sor_gst(xero_tenant_id, report_id, opts = {})
      data, _status_code, _headers = get_report_ba_sor_gst_with_http_info(xero_tenant_id, report_id, opts)
      data
    end

    # Allows you to retrieve report for BAS only valid for AU orgs
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param report_id [String] Unique identifier for a Report
    # @param [Hash] opts the optional parameters
    # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers
    def get_report_ba_sor_gst_with_http_info(xero_tenant_id, report_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_ba_sor_gst ...'
      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 AccountingApi.get_report_ba_sor_gst"
      end
      # verify the required parameter 'report_id' is set
      if @api_client.config.client_side_validation && report_id.nil?
        fail ArgumentError, "Missing the required parameter 'report_id' when calling AccountingApi.get_report_ba_sor_gst"
      end
      # resource path
      local_var_path = '/Reports/{ReportID}'.sub('{' + 'ReportID' + '}', report_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'])
      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] || 'ReportWithRows' 

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

    # Allows you to retrieve report for BAS only valid for AU orgs
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @return [ReportWithRows]
    def get_report_ba_sor_gst_list(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_report_ba_sor_gst_list_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve report for BAS only valid for AU orgs
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers
    def get_report_ba_sor_gst_list_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_ba_sor_gst_list ...'
      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 AccountingApi.get_report_ba_sor_gst_list"
      end
      # resource path
      local_var_path = '/Reports'

      # 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'])
      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] || 'ReportWithRows' 

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

    # Allows you to retrieve report for BalanceSheet
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [String] :date The date of the Balance Sheet report
    # @option opts [Integer] :periods The number of periods for the Balance Sheet report
    # @option opts [String] :timeframe The period size to compare to (MONTH, QUARTER, YEAR)
    # @option opts [String] :tracking_option_id1 The tracking option 1 for the Balance Sheet report
    # @option opts [String] :tracking_option_id2 The tracking option 2 for the Balance Sheet report
    # @option opts [Boolean] :standard_layout The standard layout boolean for the Balance Sheet report
    # @option opts [Boolean] :payments_only return a cash basis for the Balance Sheet report
    # @return [ReportWithRows]
    def get_report_balance_sheet(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_report_balance_sheet_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve report for BalanceSheet
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [String] :date The date of the Balance Sheet report
    # @option opts [Integer] :periods The number of periods for the Balance Sheet report
    # @option opts [String] :timeframe The period size to compare to (MONTH, QUARTER, YEAR)
    # @option opts [String] :tracking_option_id1 The tracking option 1 for the Balance Sheet report
    # @option opts [String] :tracking_option_id2 The tracking option 2 for the Balance Sheet report
    # @option opts [Boolean] :standard_layout The standard layout boolean for the Balance Sheet report
    # @option opts [Boolean] :payments_only return a cash basis for the Balance Sheet report
    # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers
    def get_report_balance_sheet_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_balance_sheet ...'
      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 AccountingApi.get_report_balance_sheet"
      end
      allowable_values = ["MONTH", "QUARTER", "YEAR"]
      if @api_client.config.client_side_validation && opts[:'timeframe'] && !allowable_values.include?(opts[:'timeframe'])
        fail ArgumentError, "invalid value for \"timeframe\", must be one of #{allowable_values}"
      end
      # resource path
      local_var_path = '/Reports/BalanceSheet'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil?
      query_params[:'periods'] = opts[:'periods'] if !opts[:'periods'].nil?
      query_params[:'timeframe'] = opts[:'timeframe'] if !opts[:'timeframe'].nil?
      query_params[:'trackingOptionID1'] = opts[:'tracking_option_id1'] if !opts[:'tracking_option_id1'].nil?
      query_params[:'trackingOptionID2'] = opts[:'tracking_option_id2'] if !opts[:'tracking_option_id2'].nil?
      query_params[:'standardLayout'] = opts[:'standard_layout'] if !opts[:'standard_layout'].nil?
      query_params[:'paymentsOnly'] = opts[:'payments_only'] if !opts[:'payments_only'].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] || 'ReportWithRows' 

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

    # Allows you to retrieve report for BankSummary
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [Date] :from_date The from date for the Bank Summary report e.g. 2018-03-31
    # @option opts [Date] :to_date The to date for the Bank Summary report e.g. 2018-03-31
    # @return [ReportWithRows]
    def get_report_bank_summary(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_report_bank_summary_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve report for BankSummary
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [Date] :from_date The from date for the Bank Summary report e.g. 2018-03-31
    # @option opts [Date] :to_date The to date for the Bank Summary report e.g. 2018-03-31
    # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers
    def get_report_bank_summary_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_bank_summary ...'
      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 AccountingApi.get_report_bank_summary"
      end
      # resource path
      local_var_path = '/Reports/BankSummary'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil?
      query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].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] || 'ReportWithRows' 

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

    # Allows you to retrieve report for Budget Summary
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [Date] :date The date for the Bank Summary report e.g. 2018-03-31
    # @option opts [Integer] :period The number of periods to compare (integer between 1 and 12)
    # @option opts [Integer] :timeframe The period size to compare to (1&#x3D;month, 3&#x3D;quarter, 12&#x3D;year)
    # @return [ReportWithRows]
    def get_report_budget_summary(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_report_budget_summary_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve report for Budget Summary
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [Date] :date The date for the Bank Summary report e.g. 2018-03-31
    # @option opts [Integer] :period The number of periods to compare (integer between 1 and 12)
    # @option opts [Integer] :timeframe The period size to compare to (1&#x3D;month, 3&#x3D;quarter, 12&#x3D;year)
    # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers
    def get_report_budget_summary_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_budget_summary ...'
      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 AccountingApi.get_report_budget_summary"
      end
      # resource path
      local_var_path = '/Reports/BudgetSummary'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil?
      query_params[:'period'] = opts[:'period'] if !opts[:'period'].nil?
      query_params[:'timeframe'] = opts[:'timeframe'] if !opts[:'timeframe'].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] || 'ReportWithRows' 

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

    # Allows you to retrieve report for ExecutiveSummary
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [Date] :date The date for the Bank Summary report e.g. 2018-03-31
    # @return [ReportWithRows]
    def get_report_executive_summary(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_report_executive_summary_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve report for ExecutiveSummary
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [Date] :date The date for the Bank Summary report e.g. 2018-03-31
    # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers
    def get_report_executive_summary_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_executive_summary ...'
      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 AccountingApi.get_report_executive_summary"
      end
      # resource path
      local_var_path = '/Reports/ExecutiveSummary'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'date'] = opts[:'date'] if !opts[:'date'].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] || 'ReportWithRows' 

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

    # Allows you to retrieve report for ProfitAndLoss
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [Date] :from_date The from date for the ProfitAndLoss report e.g. 2018-03-31
    # @option opts [Date] :to_date The to date for the ProfitAndLoss report e.g. 2018-03-31
    # @option opts [Integer] :periods The number of periods to compare (integer between 1 and 12)
    # @option opts [String] :timeframe The period size to compare to (MONTH, QUARTER, YEAR)
    # @option opts [String] :tracking_category_id The trackingCategory 1 for the ProfitAndLoss report
    # @option opts [String] :tracking_category_id2 The trackingCategory 2 for the ProfitAndLoss report
    # @option opts [String] :tracking_option_id The tracking option 1 for the ProfitAndLoss report
    # @option opts [String] :tracking_option_id2 The tracking option 2 for the ProfitAndLoss report
    # @option opts [Boolean] :standard_layout Return the standard layout for the ProfitAndLoss report
    # @option opts [Boolean] :payments_only Return cash only basis for the ProfitAndLoss report
    # @return [ReportWithRows]
    def get_report_profit_and_loss(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_report_profit_and_loss_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve report for ProfitAndLoss
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [Date] :from_date The from date for the ProfitAndLoss report e.g. 2018-03-31
    # @option opts [Date] :to_date The to date for the ProfitAndLoss report e.g. 2018-03-31
    # @option opts [Integer] :periods The number of periods to compare (integer between 1 and 12)
    # @option opts [String] :timeframe The period size to compare to (MONTH, QUARTER, YEAR)
    # @option opts [String] :tracking_category_id The trackingCategory 1 for the ProfitAndLoss report
    # @option opts [String] :tracking_category_id2 The trackingCategory 2 for the ProfitAndLoss report
    # @option opts [String] :tracking_option_id The tracking option 1 for the ProfitAndLoss report
    # @option opts [String] :tracking_option_id2 The tracking option 2 for the ProfitAndLoss report
    # @option opts [Boolean] :standard_layout Return the standard layout for the ProfitAndLoss report
    # @option opts [Boolean] :payments_only Return cash only basis for the ProfitAndLoss report
    # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers
    def get_report_profit_and_loss_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_profit_and_loss ...'
      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 AccountingApi.get_report_profit_and_loss"
      end
      allowable_values = ["MONTH", "QUARTER", "YEAR"]
      if @api_client.config.client_side_validation && opts[:'timeframe'] && !allowable_values.include?(opts[:'timeframe'])
        fail ArgumentError, "invalid value for \"timeframe\", must be one of #{allowable_values}"
      end
      # resource path
      local_var_path = '/Reports/ProfitAndLoss'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil?
      query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil?
      query_params[:'periods'] = opts[:'periods'] if !opts[:'periods'].nil?
      query_params[:'timeframe'] = opts[:'timeframe'] if !opts[:'timeframe'].nil?
      query_params[:'trackingCategoryID'] = opts[:'tracking_category_id'] if !opts[:'tracking_category_id'].nil?
      query_params[:'trackingCategoryID2'] = opts[:'tracking_category_id2'] if !opts[:'tracking_category_id2'].nil?
      query_params[:'trackingOptionID'] = opts[:'tracking_option_id'] if !opts[:'tracking_option_id'].nil?
      query_params[:'trackingOptionID2'] = opts[:'tracking_option_id2'] if !opts[:'tracking_option_id2'].nil?
      query_params[:'standardLayout'] = opts[:'standard_layout'] if !opts[:'standard_layout'].nil?
      query_params[:'paymentsOnly'] = opts[:'payments_only'] if !opts[:'payments_only'].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] || 'ReportWithRows' 

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

    # Allows you to retrieve report for TenNinetyNine
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [String] :report_year The year of the 1099 report
    # @return [Reports]
    def get_report_ten_ninety_nine(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_report_ten_ninety_nine_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve report for TenNinetyNine
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [String] :report_year The year of the 1099 report
    # @return [Array<(Reports, Integer, Hash)>] Reports data, response status code and response headers
    def get_report_ten_ninety_nine_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_ten_ninety_nine ...'
      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 AccountingApi.get_report_ten_ninety_nine"
      end
      # resource path
      local_var_path = '/Reports/TenNinetyNine'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'reportYear'] = opts[:'report_year'] if !opts[:'report_year'].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] || 'Reports' 

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

    # Allows you to retrieve report for TrialBalance
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [Date] :date The date for the Trial Balance report e.g. 2018-03-31
    # @option opts [Boolean] :payments_only Return cash only basis for the Trial Balance report
    # @return [ReportWithRows]
    def get_report_trial_balance(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_report_trial_balance_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve report for TrialBalance
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [Date] :date The date for the Trial Balance report e.g. 2018-03-31
    # @option opts [Boolean] :payments_only Return cash only basis for the Trial Balance report
    # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers
    def get_report_trial_balance_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_trial_balance ...'
      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 AccountingApi.get_report_trial_balance"
      end
      # resource path
      local_var_path = '/Reports/TrialBalance'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil?
      query_params[:'paymentsOnly'] = opts[:'payments_only'] if !opts[:'payments_only'].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] || 'ReportWithRows' 

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

    # Allows you to retrieve Tax Rates
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [String] :tax_type Filter by tax type
    # @return [TaxRates]
    def get_tax_rates(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_tax_rates_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve Tax Rates
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [String] :tax_type Filter by tax type
    # @return [Array<(TaxRates, Integer, Hash)>] TaxRates data, response status code and response headers
    def get_tax_rates_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_tax_rates ...'
      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 AccountingApi.get_tax_rates"
      end
      # resource path
      local_var_path = '/TaxRates'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
      query_params[:'TaxType'] = opts[:'tax_type'] if !opts[:'tax_type'].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] || 'TaxRates' 

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

    # Allows you to retrieve tracking categories and options
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Boolean] :include_archived e.g. includeArchived&#x3D;true - Categories and options with a status of ARCHIVED will be included in the response
    # @return [TrackingCategories]
    def get_tracking_categories(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_tracking_categories_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve tracking categories and options
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @option opts [Boolean] :include_archived e.g. includeArchived&#x3D;true - Categories and options with a status of ARCHIVED will be included in the response
    # @return [Array<(TrackingCategories, Integer, Hash)>] TrackingCategories data, response status code and response headers
    def get_tracking_categories_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_tracking_categories ...'
      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 AccountingApi.get_tracking_categories"
      end
      # resource path
      local_var_path = '/TrackingCategories'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
      query_params[:'includeArchived'] = opts[:'include_archived'] if !opts[:'include_archived'].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] || 'TrackingCategories' 

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

    # Allows you to retrieve tracking categories and options for specified category
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param tracking_category_id [String] Unique identifier for a TrackingCategory
    # @param [Hash] opts the optional parameters
    # @return [TrackingCategories]
    def get_tracking_category(xero_tenant_id, tracking_category_id, opts = {})
      data, _status_code, _headers = get_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, opts)
      data
    end

    # Allows you to retrieve tracking categories and options for specified category
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param tracking_category_id [String] Unique identifier for a TrackingCategory
    # @param [Hash] opts the optional parameters
    # @return [Array<(TrackingCategories, Integer, Hash)>] TrackingCategories data, response status code and response headers
    def get_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_tracking_category ...'
      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 AccountingApi.get_tracking_category"
      end
      # verify the required parameter 'tracking_category_id' is set
      if @api_client.config.client_side_validation && tracking_category_id.nil?
        fail ArgumentError, "Missing the required parameter 'tracking_category_id' when calling AccountingApi.get_tracking_category"
      end
      # resource path
      local_var_path = '/TrackingCategories/{TrackingCategoryID}'.sub('{' + 'TrackingCategoryID' + '}', tracking_category_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'])
      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] || 'TrackingCategories' 

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

    # Allows you to retrieve a specified user
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param user_id [String] Unique identifier for a User
    # @param [Hash] opts the optional parameters
    # @return [Users]
    def get_user(xero_tenant_id, user_id, opts = {})
      data, _status_code, _headers = get_user_with_http_info(xero_tenant_id, user_id, opts)
      data
    end

    # Allows you to retrieve a specified user
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param user_id [String] Unique identifier for a User
    # @param [Hash] opts the optional parameters
    # @return [Array<(Users, Integer, Hash)>] Users data, response status code and response headers
    def get_user_with_http_info(xero_tenant_id, user_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_user ...'
      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 AccountingApi.get_user"
      end
      # verify the required parameter 'user_id' is set
      if @api_client.config.client_side_validation && user_id.nil?
        fail ArgumentError, "Missing the required parameter 'user_id' when calling AccountingApi.get_user"
      end
      # resource path
      local_var_path = '/Users/{UserID}'.sub('{' + 'UserID' + '}', user_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'])
      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] || 'Users' 

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

    # Allows you to retrieve users
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [Users]
    def get_users(xero_tenant_id, opts = {})
      data, _status_code, _headers = get_users_with_http_info(xero_tenant_id, opts)
      data
    end

    # Allows you to retrieve users
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param [Hash] opts the optional parameters
    # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
    # @option opts [String] :where Filter by an any element
    # @option opts [String] :order Order by an any element
    # @return [Array<(Users, Integer, Hash)>] Users data, response status code and response headers
    def get_users_with_http_info(xero_tenant_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.get_users ...'
      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 AccountingApi.get_users"
      end
      # resource path
      local_var_path = '/Users'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
      query_params[:'order'] = opts[:'order'] if !opts[:'order'].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
      header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?

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

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

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

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

    # Allows you to update a chart of accounts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param account_id [String] Unique identifier for retrieving single object
    # @param accounts [Accounts] Request of type Accounts array with one Account
    # @param [Hash] opts the optional parameters
    # @return [Accounts]
    def update_account(xero_tenant_id, account_id, accounts, opts = {})
      data, _status_code, _headers = update_account_with_http_info(xero_tenant_id, account_id, accounts, opts)
      data
    end

    # Allows you to update a chart of accounts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param account_id [String] Unique identifier for retrieving single object
    # @param accounts [Accounts] Request of type Accounts array with one Account
    # @param [Hash] opts the optional parameters
    # @return [Array<(Accounts, Integer, Hash)>] Accounts data, response status code and response headers
    def update_account_with_http_info(xero_tenant_id, account_id, accounts, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_account ...'
      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 AccountingApi.update_account"
      end
      # verify the required parameter 'account_id' is set
      if @api_client.config.client_side_validation && account_id.nil?
        fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.update_account"
      end
      # verify the required parameter 'accounts' is set
      if @api_client.config.client_side_validation && accounts.nil?
        fail ArgumentError, "Missing the required parameter 'accounts' when calling AccountingApi.update_account"
      end
      # resource path
      local_var_path = '/Accounts/{AccountID}'.sub('{' + 'AccountID' + '}', account_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'
      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(accounts) 

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

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

    # Allows you to update Attachment on Account by Filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param account_id [String] Unique identifier for Account object
    # @param file_name [String] Name of the attachment
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def update_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body, opts = {})
      data, _status_code, _headers = update_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_id, file_name, body, opts)
      data
    end

    # Allows you to update Attachment on Account by Filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param account_id [String] Unique identifier for Account object
    # @param file_name [String] Name of the attachment
    # @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
    def update_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_account_attachment_by_file_name ...'
      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 AccountingApi.update_account_attachment_by_file_name"
      end
      # verify the required parameter 'account_id' is set
      if @api_client.config.client_side_validation && account_id.nil?
        fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.update_account_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_account_attachment_by_file_name"
      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 AccountingApi.update_account_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/Accounts/{AccountID}/Attachments/{FileName}'.sub('{' + 'AccountID' + '}', account_id.to_s).sub('{' + 'FileName' + '}', file_name.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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(body) 

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

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

    # Allows you to update a single spend or receive money transaction
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
    # @param bank_transactions [BankTransactions] 
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [BankTransactions]
    def update_bank_transaction(xero_tenant_id, bank_transaction_id, bank_transactions, opts = {})
      data, _status_code, _headers = update_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, bank_transactions, opts)
      data
    end

    # Allows you to update a single spend or receive money transaction
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
    # @param bank_transactions [BankTransactions] 
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers
    def update_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, bank_transactions, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_bank_transaction ...'
      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 AccountingApi.update_bank_transaction"
      end
      # verify the required parameter 'bank_transaction_id' is set
      if @api_client.config.client_side_validation && bank_transaction_id.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.update_bank_transaction"
      end
      # verify the required parameter 'bank_transactions' is set
      if @api_client.config.client_side_validation && bank_transactions.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transactions' when calling AccountingApi.update_bank_transaction"
      end
      # resource path
      local_var_path = '/BankTransactions/{BankTransactionID}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s)

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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(bank_transactions) 

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

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

    # Allows you to update an Attachment on BankTransaction by Filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
    # @param file_name [String] The name of the file being attached
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def update_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body, opts = {})
      data, _status_code, _headers = update_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transaction_id, file_name, body, opts)
      data
    end

    # Allows you to update an Attachment on BankTransaction by Filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
    # @param file_name [String] The name of the file being attached
    # @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
    def update_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transaction_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_bank_transaction_attachment_by_file_name ...'
      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 AccountingApi.update_bank_transaction_attachment_by_file_name"
      end
      # verify the required parameter 'bank_transaction_id' is set
      if @api_client.config.client_side_validation && bank_transaction_id.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.update_bank_transaction_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_bank_transaction_attachment_by_file_name"
      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 AccountingApi.update_bank_transaction_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/BankTransactions/{BankTransactionID}/Attachments/{FileName}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s).sub('{' + 'FileName' + '}', file_name.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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(body) 

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

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

    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer
    # @param file_name [String] The name of the file being attached to a Bank Transfer
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def update_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body, opts = {})
      data, _status_code, _headers = update_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transfer_id, file_name, body, opts)
      data
    end

    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer
    # @param file_name [String] The name of the file being attached to a Bank Transfer
    # @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
    def update_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transfer_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_bank_transfer_attachment_by_file_name ...'
      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 AccountingApi.update_bank_transfer_attachment_by_file_name"
      end
      # verify the required parameter 'bank_transfer_id' is set
      if @api_client.config.client_side_validation && bank_transfer_id.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.update_bank_transfer_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_bank_transfer_attachment_by_file_name"
      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 AccountingApi.update_bank_transfer_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/BankTransfers/{BankTransferID}/Attachments/{FileName}'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s).sub('{' + 'FileName' + '}', file_name.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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(body) 

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

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

    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param contacts [Contacts] an array of Contacts containing single Contact object with properties to update
    # @param [Hash] opts the optional parameters
    # @return [Contacts]
    def update_contact(xero_tenant_id, contact_id, contacts, opts = {})
      data, _status_code, _headers = update_contact_with_http_info(xero_tenant_id, contact_id, contacts, opts)
      data
    end

    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param contacts [Contacts] an array of Contacts containing single Contact object with properties to update
    # @param [Hash] opts the optional parameters
    # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers
    def update_contact_with_http_info(xero_tenant_id, contact_id, contacts, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_contact ...'
      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 AccountingApi.update_contact"
      end
      # verify the required parameter 'contact_id' is set
      if @api_client.config.client_side_validation && contact_id.nil?
        fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.update_contact"
      end
      # verify the required parameter 'contacts' is set
      if @api_client.config.client_side_validation && contacts.nil?
        fail ArgumentError, "Missing the required parameter 'contacts' when calling AccountingApi.update_contact"
      end
      # resource path
      local_var_path = '/Contacts/{ContactID}'.sub('{' + 'ContactID' + '}', contact_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'
      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(contacts) 

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

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

    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param file_name [String] Name for the file you are attaching
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def update_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body, opts = {})
      data, _status_code, _headers = update_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_id, file_name, body, opts)
      data
    end

    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_id [String] Unique identifier for a Contact
    # @param file_name [String] Name for the file you are attaching
    # @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
    def update_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_contact_attachment_by_file_name ...'
      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 AccountingApi.update_contact_attachment_by_file_name"
      end
      # verify the required parameter 'contact_id' is set
      if @api_client.config.client_side_validation && contact_id.nil?
        fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.update_contact_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_contact_attachment_by_file_name"
      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 AccountingApi.update_contact_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/Contacts/{ContactID}/Attachments/{FileName}'.sub('{' + 'ContactID' + '}', contact_id.to_s).sub('{' + 'FileName' + '}', file_name.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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(body) 

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

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

    # Allows you to update a Contact Group
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_group_id [String] Unique identifier for a Contact Group
    # @param contact_groups [ContactGroups] an array of Contact groups with Name of specific group to update
    # @param [Hash] opts the optional parameters
    # @return [ContactGroups]
    def update_contact_group(xero_tenant_id, contact_group_id, contact_groups, opts = {})
      data, _status_code, _headers = update_contact_group_with_http_info(xero_tenant_id, contact_group_id, contact_groups, opts)
      data
    end

    # Allows you to update a Contact Group
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contact_group_id [String] Unique identifier for a Contact Group
    # @param contact_groups [ContactGroups] an array of Contact groups with Name of specific group to update
    # @param [Hash] opts the optional parameters
    # @return [Array<(ContactGroups, Integer, Hash)>] ContactGroups data, response status code and response headers
    def update_contact_group_with_http_info(xero_tenant_id, contact_group_id, contact_groups, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_contact_group ...'
      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 AccountingApi.update_contact_group"
      end
      # verify the required parameter 'contact_group_id' is set
      if @api_client.config.client_side_validation && contact_group_id.nil?
        fail ArgumentError, "Missing the required parameter 'contact_group_id' when calling AccountingApi.update_contact_group"
      end
      # verify the required parameter 'contact_groups' is set
      if @api_client.config.client_side_validation && contact_groups.nil?
        fail ArgumentError, "Missing the required parameter 'contact_groups' when calling AccountingApi.update_contact_group"
      end
      # resource path
      local_var_path = '/ContactGroups/{ContactGroupID}'.sub('{' + 'ContactGroupID' + '}', contact_group_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'
      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(contact_groups) 

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

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

    # Allows you to update a specific credit note
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_note_id [String] Unique identifier for a Credit Note
    # @param credit_notes [CreditNotes] an array of Credit Notes containing credit note details to update
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [CreditNotes]
    def update_credit_note(xero_tenant_id, credit_note_id, credit_notes, opts = {})
      data, _status_code, _headers = update_credit_note_with_http_info(xero_tenant_id, credit_note_id, credit_notes, opts)
      data
    end

    # Allows you to update a specific credit note
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_note_id [String] Unique identifier for a Credit Note
    # @param credit_notes [CreditNotes] an array of Credit Notes containing credit note details to update
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(CreditNotes, Integer, Hash)>] CreditNotes data, response status code and response headers
    def update_credit_note_with_http_info(xero_tenant_id, credit_note_id, credit_notes, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_credit_note ...'
      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 AccountingApi.update_credit_note"
      end
      # verify the required parameter 'credit_note_id' is set
      if @api_client.config.client_side_validation && credit_note_id.nil?
        fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.update_credit_note"
      end
      # verify the required parameter 'credit_notes' is set
      if @api_client.config.client_side_validation && credit_notes.nil?
        fail ArgumentError, "Missing the required parameter 'credit_notes' when calling AccountingApi.update_credit_note"
      end
      # resource path
      local_var_path = '/CreditNotes/{CreditNoteID}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s)

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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(credit_notes) 

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

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

    # Allows you to update 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 [Attachments]
    def update_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body, opts = {})
      data, _status_code, _headers = update_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, body, opts)
      data
    end

    # Allows you to update 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
    def update_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.update_credit_note_attachment_by_file_name ...'
      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 AccountingApi.update_credit_note_attachment_by_file_name"
      end
      # verify the required parameter 'credit_note_id' is set
      if @api_client.config.client_side_validation && credit_note_id.nil?
        fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.update_credit_note_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_credit_note_attachment_by_file_name"
      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 AccountingApi.update_credit_note_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/CreditNotes/{CreditNoteID}/Attachments/{FileName}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s).sub('{' + 'FileName' + '}', file_name.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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(body) 

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

      # 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, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AccountingApi#update_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 update specified expense claims
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param expense_claim_id [String] Unique identifier for a ExpenseClaim
    # @param expense_claims [ExpenseClaims] 
    # @param [Hash] opts the optional parameters
    # @return [ExpenseClaims]
    def update_expense_claim(xero_tenant_id, expense_claim_id, expense_claims, opts = {})
      data, _status_code, _headers = update_expense_claim_with_http_info(xero_tenant_id, expense_claim_id, expense_claims, opts)
      data
    end

    # Allows you to update specified expense claims
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param expense_claim_id [String] Unique identifier for a ExpenseClaim
    # @param expense_claims [ExpenseClaims] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(ExpenseClaims, Integer, Hash)>] ExpenseClaims data, response status code and response headers
    def update_expense_claim_with_http_info(xero_tenant_id, expense_claim_id, expense_claims, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_expense_claim ...'
      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 AccountingApi.update_expense_claim"
      end
      # verify the required parameter 'expense_claim_id' is set
      if @api_client.config.client_side_validation && expense_claim_id.nil?
        fail ArgumentError, "Missing the required parameter 'expense_claim_id' when calling AccountingApi.update_expense_claim"
      end
      # verify the required parameter 'expense_claims' is set
      if @api_client.config.client_side_validation && expense_claims.nil?
        fail ArgumentError, "Missing the required parameter 'expense_claims' when calling AccountingApi.update_expense_claim"
      end
      # resource path
      local_var_path = '/ExpenseClaims/{ExpenseClaimID}'.sub('{' + 'ExpenseClaimID' + '}', expense_claim_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'
      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(expense_claims) 

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

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

    # Allows you to update a specified sales invoices or purchase bills
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param invoices [Invoices] 
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Invoices]
    def update_invoice(xero_tenant_id, invoice_id, invoices, opts = {})
      data, _status_code, _headers = update_invoice_with_http_info(xero_tenant_id, invoice_id, invoices, opts)
      data
    end

    # Allows you to update a specified sales invoices or purchase bills
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param invoices [Invoices] 
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(Invoices, Integer, Hash)>] Invoices data, response status code and response headers
    def update_invoice_with_http_info(xero_tenant_id, invoice_id, invoices, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_invoice ...'
      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 AccountingApi.update_invoice"
      end
      # verify the required parameter 'invoice_id' is set
      if @api_client.config.client_side_validation && invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.update_invoice"
      end
      # verify the required parameter 'invoices' is set
      if @api_client.config.client_side_validation && invoices.nil?
        fail ArgumentError, "Missing the required parameter 'invoices' when calling AccountingApi.update_invoice"
      end
      # resource path
      local_var_path = '/Invoices/{InvoiceID}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s)

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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(invoices) 

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

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

    # Allows you to update Attachment on invoices or purchase bills by it's filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param file_name [String] Name of the file you are attaching
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def update_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body, opts = {})
      data, _status_code, _headers = update_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, body, opts)
      data
    end

    # Allows you to update Attachment on invoices or purchase bills by it&#39;s filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoice_id [String] Unique identifier for an Invoice
    # @param file_name [String] Name of the file you are attaching
    # @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
    def update_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_invoice_attachment_by_file_name ...'
      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 AccountingApi.update_invoice_attachment_by_file_name"
      end
      # verify the required parameter 'invoice_id' is set
      if @api_client.config.client_side_validation && invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.update_invoice_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_invoice_attachment_by_file_name"
      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 AccountingApi.update_invoice_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/Invoices/{InvoiceID}/Attachments/{FileName}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(body) 

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

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

    # Allows you to update a specified item
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param item_id [String] Unique identifier for an Item
    # @param items [Items] 
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Items]
    def update_item(xero_tenant_id, item_id, items, opts = {})
      data, _status_code, _headers = update_item_with_http_info(xero_tenant_id, item_id, items, opts)
      data
    end

    # Allows you to update a specified item
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param item_id [String] Unique identifier for an Item
    # @param items [Items] 
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(Items, Integer, Hash)>] Items data, response status code and response headers
    def update_item_with_http_info(xero_tenant_id, item_id, items, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_item ...'
      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 AccountingApi.update_item"
      end
      # verify the required parameter 'item_id' is set
      if @api_client.config.client_side_validation && item_id.nil?
        fail ArgumentError, "Missing the required parameter 'item_id' when calling AccountingApi.update_item"
      end
      # verify the required parameter 'items' is set
      if @api_client.config.client_side_validation && items.nil?
        fail ArgumentError, "Missing the required parameter 'items' when calling AccountingApi.update_item"
      end
      # resource path
      local_var_path = '/Items/{ItemID}'.sub('{' + 'ItemID' + '}', item_id.to_s)

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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(items) 

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

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

    # Allows you to update a specified linked transactions (billable expenses)
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param linked_transaction_id [String] Unique identifier for a LinkedTransaction
    # @param linked_transactions [LinkedTransactions] 
    # @param [Hash] opts the optional parameters
    # @return [LinkedTransactions]
    def update_linked_transaction(xero_tenant_id, linked_transaction_id, linked_transactions, opts = {})
      data, _status_code, _headers = update_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, linked_transactions, opts)
      data
    end

    # Allows you to update a specified linked transactions (billable expenses)
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param linked_transaction_id [String] Unique identifier for a LinkedTransaction
    # @param linked_transactions [LinkedTransactions] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(LinkedTransactions, Integer, Hash)>] LinkedTransactions data, response status code and response headers
    def update_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, linked_transactions, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_linked_transaction ...'
      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 AccountingApi.update_linked_transaction"
      end
      # verify the required parameter 'linked_transaction_id' is set
      if @api_client.config.client_side_validation && linked_transaction_id.nil?
        fail ArgumentError, "Missing the required parameter 'linked_transaction_id' when calling AccountingApi.update_linked_transaction"
      end
      # verify the required parameter 'linked_transactions' is set
      if @api_client.config.client_side_validation && linked_transactions.nil?
        fail ArgumentError, "Missing the required parameter 'linked_transactions' when calling AccountingApi.update_linked_transaction"
      end
      # resource path
      local_var_path = '/LinkedTransactions/{LinkedTransactionID}'.sub('{' + 'LinkedTransactionID' + '}', linked_transaction_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'
      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(linked_transactions) 

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

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

    # Allows you to update a specified manual journal
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param manual_journal_id [String] Unique identifier for a ManualJournal
    # @param manual_journals [ManualJournals] 
    # @param [Hash] opts the optional parameters
    # @return [ManualJournals]
    def update_manual_journal(xero_tenant_id, manual_journal_id, manual_journals, opts = {})
      data, _status_code, _headers = update_manual_journal_with_http_info(xero_tenant_id, manual_journal_id, manual_journals, opts)
      data
    end

    # Allows you to update a specified manual journal
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param manual_journal_id [String] Unique identifier for a ManualJournal
    # @param manual_journals [ManualJournals] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(ManualJournals, Integer, Hash)>] ManualJournals data, response status code and response headers
    def update_manual_journal_with_http_info(xero_tenant_id, manual_journal_id, manual_journals, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_manual_journal ...'
      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 AccountingApi.update_manual_journal"
      end
      # verify the required parameter 'manual_journal_id' is set
      if @api_client.config.client_side_validation && manual_journal_id.nil?
        fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.update_manual_journal"
      end
      # verify the required parameter 'manual_journals' is set
      if @api_client.config.client_side_validation && manual_journals.nil?
        fail ArgumentError, "Missing the required parameter 'manual_journals' when calling AccountingApi.update_manual_journal"
      end
      # resource path
      local_var_path = '/ManualJournals/{ManualJournalID}'.sub('{' + 'ManualJournalID' + '}', manual_journal_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'
      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(manual_journals) 

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

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

    # Allows you to update a specified Attachment on ManualJournal by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param manual_journal_id [String] Unique identifier for a ManualJournal
    # @param file_name [String] The name of the file being attached to a ManualJournal
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def update_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body, opts = {})
      data, _status_code, _headers = update_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, manual_journal_id, file_name, body, opts)
      data
    end

    # Allows you to update a specified Attachment on ManualJournal by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param manual_journal_id [String] Unique identifier for a ManualJournal
    # @param file_name [String] The name of the file being attached to a ManualJournal
    # @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
    def update_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, manual_journal_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_manual_journal_attachment_by_file_name ...'
      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 AccountingApi.update_manual_journal_attachment_by_file_name"
      end
      # verify the required parameter 'manual_journal_id' is set
      if @api_client.config.client_side_validation && manual_journal_id.nil?
        fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.update_manual_journal_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_manual_journal_attachment_by_file_name"
      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 AccountingApi.update_manual_journal_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/ManualJournals/{ManualJournalID}/Attachments/{FileName}'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s).sub('{' + 'FileName' + '}', file_name.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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(body) 

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

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

    # Allows you to update or create one or more spend or receive money transaction
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transactions [BankTransactions] 
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [BankTransactions]
    def update_or_create_bank_transactions(xero_tenant_id, bank_transactions, opts = {})
      data, _status_code, _headers = update_or_create_bank_transactions_with_http_info(xero_tenant_id, bank_transactions, opts)
      data
    end

    # Allows you to update or create one or more spend or receive money transaction
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param bank_transactions [BankTransactions] 
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers
    def update_or_create_bank_transactions_with_http_info(xero_tenant_id, bank_transactions, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_bank_transactions ...'
      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 AccountingApi.update_or_create_bank_transactions"
      end
      # verify the required parameter 'bank_transactions' is set
      if @api_client.config.client_side_validation && bank_transactions.nil?
        fail ArgumentError, "Missing the required parameter 'bank_transactions' when calling AccountingApi.update_or_create_bank_transactions"
      end
      # resource path
      local_var_path = '/BankTransactions'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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(bank_transactions) 

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

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

    # Allows you to update OR create one or more contacts in a Xero organisation
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contacts [Contacts] 
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @return [Contacts]
    def update_or_create_contacts(xero_tenant_id, contacts, opts = {})
      data, _status_code, _headers = update_or_create_contacts_with_http_info(xero_tenant_id, contacts, opts)
      data
    end

    # Allows you to update OR create one or more contacts in a Xero organisation
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param contacts [Contacts] 
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers
    def update_or_create_contacts_with_http_info(xero_tenant_id, contacts, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_contacts ...'
      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 AccountingApi.update_or_create_contacts"
      end
      # verify the required parameter 'contacts' is set
      if @api_client.config.client_side_validation && contacts.nil?
        fail ArgumentError, "Missing the required parameter 'contacts' when calling AccountingApi.update_or_create_contacts"
      end
      # resource path
      local_var_path = '/Contacts'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].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(contacts) 

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

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

    # Allows you to update OR create one or more credit notes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_notes [CreditNotes] an array of Credit Notes with a single CreditNote object.
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [CreditNotes]
    def update_or_create_credit_notes(xero_tenant_id, credit_notes, opts = {})
      data, _status_code, _headers = update_or_create_credit_notes_with_http_info(xero_tenant_id, credit_notes, opts)
      data
    end

    # Allows you to update OR create one or more credit notes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param credit_notes [CreditNotes] an array of Credit Notes with a single CreditNote object.
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(CreditNotes, Integer, Hash)>] CreditNotes data, response status code and response headers
    def update_or_create_credit_notes_with_http_info(xero_tenant_id, credit_notes, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_credit_notes ...'
      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 AccountingApi.update_or_create_credit_notes"
      end
      # verify the required parameter 'credit_notes' is set
      if @api_client.config.client_side_validation && credit_notes.nil?
        fail ArgumentError, "Missing the required parameter 'credit_notes' when calling AccountingApi.update_or_create_credit_notes"
      end
      # resource path
      local_var_path = '/CreditNotes'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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(credit_notes) 

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

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

    # Allows you to create a single new employees used in Xero payrun
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param employees [Employees] Employees with array of Employee object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @return [Employees]
    def update_or_create_employees(xero_tenant_id, employees, opts = {})
      data, _status_code, _headers = update_or_create_employees_with_http_info(xero_tenant_id, employees, opts)
      data
    end

    # Allows you to create a single new employees used in Xero payrun
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param employees [Employees] Employees with array of Employee object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers
    def update_or_create_employees_with_http_info(xero_tenant_id, employees, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_employees ...'
      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 AccountingApi.update_or_create_employees"
      end
      # verify the required parameter 'employees' is set
      if @api_client.config.client_side_validation && employees.nil?
        fail ArgumentError, "Missing the required parameter 'employees' when calling AccountingApi.update_or_create_employees"
      end
      # resource path
      local_var_path = '/Employees'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].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(employees) 

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

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

    # Allows you to update OR create one or more sales invoices or purchase bills
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoices [Invoices] 
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Invoices]
    def update_or_create_invoices(xero_tenant_id, invoices, opts = {})
      data, _status_code, _headers = update_or_create_invoices_with_http_info(xero_tenant_id, invoices, opts)
      data
    end

    # Allows you to update OR create one or more sales invoices or purchase bills
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param invoices [Invoices] 
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(Invoices, Integer, Hash)>] Invoices data, response status code and response headers
    def update_or_create_invoices_with_http_info(xero_tenant_id, invoices, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_invoices ...'
      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 AccountingApi.update_or_create_invoices"
      end
      # verify the required parameter 'invoices' is set
      if @api_client.config.client_side_validation && invoices.nil?
        fail ArgumentError, "Missing the required parameter 'invoices' when calling AccountingApi.update_or_create_invoices"
      end
      # resource path
      local_var_path = '/Invoices'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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(invoices) 

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

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

    # Allows you to update or create one or more items
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param items [Items] 
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Items]
    def update_or_create_items(xero_tenant_id, items, opts = {})
      data, _status_code, _headers = update_or_create_items_with_http_info(xero_tenant_id, items, opts)
      data
    end

    # Allows you to update or create one or more items
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param items [Items] 
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(Items, Integer, Hash)>] Items data, response status code and response headers
    def update_or_create_items_with_http_info(xero_tenant_id, items, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_items ...'
      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 AccountingApi.update_or_create_items"
      end
      # verify the required parameter 'items' is set
      if @api_client.config.client_side_validation && items.nil?
        fail ArgumentError, "Missing the required parameter 'items' when calling AccountingApi.update_or_create_items"
      end
      # resource path
      local_var_path = '/Items'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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(items) 

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

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

    # Allows you to create a single manual journal
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param manual_journals [ManualJournals] ManualJournals array with ManualJournal object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @return [ManualJournals]
    def update_or_create_manual_journals(xero_tenant_id, manual_journals, opts = {})
      data, _status_code, _headers = update_or_create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts)
      data
    end

    # Allows you to create a single manual journal
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param manual_journals [ManualJournals] ManualJournals array with ManualJournal object in body of request
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @return [Array<(ManualJournals, Integer, Hash)>] ManualJournals data, response status code and response headers
    def update_or_create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_manual_journals ...'
      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 AccountingApi.update_or_create_manual_journals"
      end
      # verify the required parameter 'manual_journals' is set
      if @api_client.config.client_side_validation && manual_journals.nil?
        fail ArgumentError, "Missing the required parameter 'manual_journals' when calling AccountingApi.update_or_create_manual_journals"
      end
      # resource path
      local_var_path = '/ManualJournals'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].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(manual_journals) 

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

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

    # Allows you to update or create one or more purchase orders
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param purchase_orders [PurchaseOrders] 
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @return [PurchaseOrders]
    def update_or_create_purchase_orders(xero_tenant_id, purchase_orders, opts = {})
      data, _status_code, _headers = update_or_create_purchase_orders_with_http_info(xero_tenant_id, purchase_orders, opts)
      data
    end

    # Allows you to update or create one or more purchase orders
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param purchase_orders [PurchaseOrders] 
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers
    def update_or_create_purchase_orders_with_http_info(xero_tenant_id, purchase_orders, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_purchase_orders ...'
      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 AccountingApi.update_or_create_purchase_orders"
      end
      # verify the required parameter 'purchase_orders' is set
      if @api_client.config.client_side_validation && purchase_orders.nil?
        fail ArgumentError, "Missing the required parameter 'purchase_orders' when calling AccountingApi.update_or_create_purchase_orders"
      end
      # resource path
      local_var_path = '/PurchaseOrders'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].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(purchase_orders) 

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

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

    # Allows you to update OR create one or more quotes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quotes [Quotes] 
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
    # @return [Quotes]
    def update_or_create_quotes(xero_tenant_id, quotes, opts = {})
      data, _status_code, _headers = update_or_create_quotes_with_http_info(xero_tenant_id, quotes, opts)
      data
    end

    # Allows you to update OR create one or more quotes
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quotes [Quotes] 
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
    # @return [Array<(Quotes, Integer, Hash)>] Quotes data, response status code and response headers
    def update_or_create_quotes_with_http_info(xero_tenant_id, quotes, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_quotes ...'
      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 AccountingApi.update_or_create_quotes"
      end
      # verify the required parameter 'quotes' is set
      if @api_client.config.client_side_validation && quotes.nil?
        fail ArgumentError, "Missing the required parameter 'quotes' when calling AccountingApi.update_or_create_quotes"
      end
      # resource path
      local_var_path = '/Quotes'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].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(quotes) 

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

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

    # Allows you to update a specified purchase order
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param purchase_order_id [String] Unique identifier for a PurchaseOrder
    # @param purchase_orders [PurchaseOrders] 
    # @param [Hash] opts the optional parameters
    # @return [PurchaseOrders]
    def update_purchase_order(xero_tenant_id, purchase_order_id, purchase_orders, opts = {})
      data, _status_code, _headers = update_purchase_order_with_http_info(xero_tenant_id, purchase_order_id, purchase_orders, opts)
      data
    end

    # Allows you to update a specified purchase order
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param purchase_order_id [String] Unique identifier for a PurchaseOrder
    # @param purchase_orders [PurchaseOrders] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers
    def update_purchase_order_with_http_info(xero_tenant_id, purchase_order_id, purchase_orders, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_purchase_order ...'
      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 AccountingApi.update_purchase_order"
      end
      # verify the required parameter 'purchase_order_id' is set
      if @api_client.config.client_side_validation && purchase_order_id.nil?
        fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.update_purchase_order"
      end
      # verify the required parameter 'purchase_orders' is set
      if @api_client.config.client_side_validation && purchase_orders.nil?
        fail ArgumentError, "Missing the required parameter 'purchase_orders' when calling AccountingApi.update_purchase_order"
      end
      # resource path
      local_var_path = '/PurchaseOrders/{PurchaseOrderID}'.sub('{' + 'PurchaseOrderID' + '}', purchase_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'
      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(purchase_orders) 

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

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

    # Allows you to update a specified quote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for an Quote
    # @param quotes [Quotes] 
    # @param [Hash] opts the optional parameters
    # @return [Quotes]
    def update_quote(xero_tenant_id, quote_id, quotes, opts = {})
      data, _status_code, _headers = update_quote_with_http_info(xero_tenant_id, quote_id, quotes, opts)
      data
    end

    # Allows you to update a specified quote
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for an Quote
    # @param quotes [Quotes] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Quotes, Integer, Hash)>] Quotes data, response status code and response headers
    def update_quote_with_http_info(xero_tenant_id, quote_id, quotes, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_quote ...'
      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 AccountingApi.update_quote"
      end
      # verify the required parameter 'quote_id' is set
      if @api_client.config.client_side_validation && quote_id.nil?
        fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.update_quote"
      end
      # verify the required parameter 'quotes' is set
      if @api_client.config.client_side_validation && quotes.nil?
        fail ArgumentError, "Missing the required parameter 'quotes' when calling AccountingApi.update_quote"
      end
      # resource path
      local_var_path = '/Quotes/{QuoteID}'.sub('{' + 'QuoteID' + '}', quote_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'
      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(quotes) 

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

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

    # Allows you to update Attachment on Quote by Filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for Quote object
    # @param file_name [String] Name of the attachment
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def update_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body, opts = {})
      data, _status_code, _headers = update_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, file_name, body, opts)
      data
    end

    # Allows you to update Attachment on Quote by Filename
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param quote_id [String] Unique identifier for Quote object
    # @param file_name [String] Name of the attachment
    # @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
    def update_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_quote_attachment_by_file_name ...'
      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 AccountingApi.update_quote_attachment_by_file_name"
      end
      # verify the required parameter 'quote_id' is set
      if @api_client.config.client_side_validation && quote_id.nil?
        fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.update_quote_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_quote_attachment_by_file_name"
      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 AccountingApi.update_quote_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/Quotes/{QuoteID}/Attachments/{FileName}'.sub('{' + 'QuoteID' + '}', quote_id.to_s).sub('{' + 'FileName' + '}', file_name.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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(body) 

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

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

    # Allows you to retrieve a specified draft expense claim receipts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipt_id [String] Unique identifier for a Receipt
    # @param receipts [Receipts] 
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Receipts]
    def update_receipt(xero_tenant_id, receipt_id, receipts, opts = {})
      data, _status_code, _headers = update_receipt_with_http_info(xero_tenant_id, receipt_id, receipts, opts)
      data
    end

    # Allows you to retrieve a specified draft expense claim receipts
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipt_id [String] Unique identifier for a Receipt
    # @param receipts [Receipts] 
    # @param [Hash] opts the optional parameters
    # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
    # @return [Array<(Receipts, Integer, Hash)>] Receipts data, response status code and response headers
    def update_receipt_with_http_info(xero_tenant_id, receipt_id, receipts, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_receipt ...'
      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 AccountingApi.update_receipt"
      end
      # verify the required parameter 'receipt_id' is set
      if @api_client.config.client_side_validation && receipt_id.nil?
        fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.update_receipt"
      end
      # verify the required parameter 'receipts' is set
      if @api_client.config.client_side_validation && receipts.nil?
        fail ArgumentError, "Missing the required parameter 'receipts' when calling AccountingApi.update_receipt"
      end
      # resource path
      local_var_path = '/Receipts/{ReceiptID}'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s)

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].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(receipts) 

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

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

    # Allows you to update Attachment on expense claim receipts by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipt_id [String] Unique identifier for a Receipt
    # @param file_name [String] The name of the file being attached to the Receipt
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def update_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body, opts = {})
      data, _status_code, _headers = update_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_id, file_name, body, opts)
      data
    end

    # Allows you to update Attachment on expense claim receipts by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param receipt_id [String] Unique identifier for a Receipt
    # @param file_name [String] The name of the file being attached to the Receipt
    # @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
    def update_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_receipt_attachment_by_file_name ...'
      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 AccountingApi.update_receipt_attachment_by_file_name"
      end
      # verify the required parameter 'receipt_id' is set
      if @api_client.config.client_side_validation && receipt_id.nil?
        fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.update_receipt_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_receipt_attachment_by_file_name"
      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 AccountingApi.update_receipt_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/Receipts/{ReceiptID}/Attachments/{FileName}'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s).sub('{' + 'FileName' + '}', file_name.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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(body) 

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

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

    # Allows you to update specified attachment on repeating invoices by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice
    # @param file_name [String] The name of the file being attached to a Repeating Invoice
    # @param body [String] Byte array of file in body of request
    # @param [Hash] opts the optional parameters
    # @return [Attachments]
    def update_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body, opts = {})
      data, _status_code, _headers = update_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, repeating_invoice_id, file_name, body, opts)
      data
    end

    # Allows you to update specified attachment on repeating invoices by file name
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice
    # @param file_name [String] The name of the file being attached to a Repeating Invoice
    # @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
    def update_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, repeating_invoice_id, file_name, body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_repeating_invoice_attachment_by_file_name ...'
      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 AccountingApi.update_repeating_invoice_attachment_by_file_name"
      end
      # verify the required parameter 'repeating_invoice_id' is set
      if @api_client.config.client_side_validation && repeating_invoice_id.nil?
        fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.update_repeating_invoice_attachment_by_file_name"
      end
      # verify the required parameter 'file_name' is set
      if @api_client.config.client_side_validation && file_name.nil?
        fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_repeating_invoice_attachment_by_file_name"
      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 AccountingApi.update_repeating_invoice_attachment_by_file_name"
      end
      # resource path
      local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.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'
      header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(body) 

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

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

    # Allows you to update Tax Rates
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param tax_rates [TaxRates] 
    # @param [Hash] opts the optional parameters
    # @return [TaxRates]
    def update_tax_rate(xero_tenant_id, tax_rates, opts = {})
      data, _status_code, _headers = update_tax_rate_with_http_info(xero_tenant_id, tax_rates, opts)
      data
    end

    # Allows you to update Tax Rates
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param tax_rates [TaxRates] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(TaxRates, Integer, Hash)>] TaxRates data, response status code and response headers
    def update_tax_rate_with_http_info(xero_tenant_id, tax_rates, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_tax_rate ...'
      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 AccountingApi.update_tax_rate"
      end
      # verify the required parameter 'tax_rates' is set
      if @api_client.config.client_side_validation && tax_rates.nil?
        fail ArgumentError, "Missing the required parameter 'tax_rates' when calling AccountingApi.update_tax_rate"
      end
      # resource path
      local_var_path = '/TaxRates'

      # 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'
      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(tax_rates) 

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

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

    # Allows you to update tracking categories
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param tracking_category_id [String] Unique identifier for a TrackingCategory
    # @param tracking_category [TrackingCategory] 
    # @param [Hash] opts the optional parameters
    # @return [TrackingCategories]
    def update_tracking_category(xero_tenant_id, tracking_category_id, tracking_category, opts = {})
      data, _status_code, _headers = update_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, tracking_category, opts)
      data
    end

    # Allows you to update tracking categories
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param tracking_category_id [String] Unique identifier for a TrackingCategory
    # @param tracking_category [TrackingCategory] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(TrackingCategories, Integer, Hash)>] TrackingCategories data, response status code and response headers
    def update_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, tracking_category, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_tracking_category ...'
      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 AccountingApi.update_tracking_category"
      end
      # verify the required parameter 'tracking_category_id' is set
      if @api_client.config.client_side_validation && tracking_category_id.nil?
        fail ArgumentError, "Missing the required parameter 'tracking_category_id' when calling AccountingApi.update_tracking_category"
      end
      # verify the required parameter 'tracking_category' is set
      if @api_client.config.client_side_validation && tracking_category.nil?
        fail ArgumentError, "Missing the required parameter 'tracking_category' when calling AccountingApi.update_tracking_category"
      end
      # resource path
      local_var_path = '/TrackingCategories/{TrackingCategoryID}'.sub('{' + 'TrackingCategoryID' + '}', tracking_category_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'
      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(tracking_category) 

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

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

    # Allows you to update options for a specified tracking category
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param tracking_category_id [String] Unique identifier for a TrackingCategory
    # @param tracking_option_id [String] Unique identifier for a Tracking Option
    # @param tracking_option [TrackingOption] 
    # @param [Hash] opts the optional parameters
    # @return [TrackingOptions]
    def update_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id, tracking_option, opts = {})
      data, _status_code, _headers = update_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, tracking_option_id, tracking_option, opts)
      data
    end

    # Allows you to update options for a specified tracking category
    # @param xero_tenant_id [String] Xero identifier for Tenant
    # @param tracking_category_id [String] Unique identifier for a TrackingCategory
    # @param tracking_option_id [String] Unique identifier for a Tracking Option
    # @param tracking_option [TrackingOption] 
    # @param [Hash] opts the optional parameters
    # @return [Array<(TrackingOptions, Integer, Hash)>] TrackingOptions data, response status code and response headers
    def update_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, tracking_option_id, tracking_option, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AccountingApi.update_tracking_options ...'
      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 AccountingApi.update_tracking_options"
      end
      # verify the required parameter 'tracking_category_id' is set
      if @api_client.config.client_side_validation && tracking_category_id.nil?
        fail ArgumentError, "Missing the required parameter 'tracking_category_id' when calling AccountingApi.update_tracking_options"
      end
      # verify the required parameter 'tracking_option_id' is set
      if @api_client.config.client_side_validation && tracking_option_id.nil?
        fail ArgumentError, "Missing the required parameter 'tracking_option_id' when calling AccountingApi.update_tracking_options"
      end
      # verify the required parameter 'tracking_option' is set
      if @api_client.config.client_side_validation && tracking_option.nil?
        fail ArgumentError, "Missing the required parameter 'tracking_option' when calling AccountingApi.update_tracking_options"
      end
      # resource path
      local_var_path = '/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}'.sub('{' + 'TrackingCategoryID' + '}', tracking_category_id.to_s).sub('{' + 'TrackingOptionID' + '}', tracking_option_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'
      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(tracking_option) 

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

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