/**
 * Xero Node - Version 1
 * Discriminator: resource=invoice, operation=getAll
 */


interface Credentials {
  xeroOAuth2Api: CredentialReference;
}

/** Get many contacts */
export type XeroV1InvoiceGetAllParams = {
  resource: 'invoice';
  operation: 'getAll';
/**
 * Choose from the list, or specify an ID using an &lt;a href="https://docs.n8n.io/code/expressions/"&gt;expression&lt;/a&gt;
 */
    organizationId?: string | Expression<string>;
/**
 * Whether to return all results or only up to a given limit
 * @default false
 */
    returnAll?: boolean | Expression<boolean>;
/**
 * Max number of results to return
 * @displayOptions.show { returnAll: [false] }
 * @default 100
 */
    limit?: number | Expression<number>;
/**
 * Options
 * @default {}
 */
    options?: {
    /** Whether you'll only retrieve Invoices created by your app
     * @default false
     */
    createdByMyApp?: boolean | Expression<boolean>;
    /** Order by any element returned
     */
    orderBy?: string | Expression<string> | PlaceholderValue;
    /** Sort Order
     */
    sortOrder?: 'ASC' | 'DESC' | Expression<string>;
    /** Statuses
     * @default []
     */
    statuses?: Array<'DRAFT' | 'SUBMITTED' | 'AUTHORISED'>;
    /** The where parameter allows you to filter on endpoints and elements that don't have explicit parameters. &lt;a href="https://developer.xero.com/documentation/api/requests-and-responses#get-modified"&gt;Examples Here&lt;/a&gt;.
     */
    where?: string | Expression<string> | PlaceholderValue;
  };
};

export type XeroV1InvoiceGetAllOutput = {
  BrandingThemeID?: string;
  Contact?: {
    ContactID?: string;
    HasValidationErrors?: boolean;
    Name?: string;
  };
  CreditNotes?: Array<{
    CreditNoteID?: string;
    CreditNoteNumber?: string;
    Date?: string;
    DateString?: string;
    HasErrors?: boolean;
    ID?: string;
  }>;
  CurrencyCode?: string;
  Date?: string;
  DateString?: string;
  DueDate?: string;
  DueDateString?: string;
  HasAttachments?: boolean;
  HasErrors?: boolean;
  InvoiceID?: string;
  InvoiceNumber?: string;
  IsDiscounted?: boolean;
  LineAmountTypes?: string;
  LineItems?: Array<{
    AccountCode?: string;
    AccountID?: string;
    Description?: string;
    Item?: {
      Code?: string;
      ItemID?: string;
      Name?: string;
    };
    ItemCode?: string;
    LineItemID?: string;
    TaxType?: string;
    Tracking?: Array<{
      Name?: string;
      Option?: string;
      TrackingCategoryID?: string;
    }>;
  }>;
  Overpayments?: Array<{
    AppliedAmount?: number;
    Date?: string;
    DateString?: string;
    OverpaymentID?: string;
    Total?: number;
  }>;
  Payments?: Array<{
    Date?: string;
    HasAccount?: boolean;
    HasValidationErrors?: boolean;
    Reference?: string;
  }>;
  Reference?: string;
  SentToContact?: boolean;
  Status?: string;
  Type?: string;
  UpdatedDateUTC?: string;
};

export type XeroV1InvoiceGetAllNode = {
  type: 'n8n-nodes-base.xero';
  version: 1;
  credentials?: Credentials;
  config: NodeConfig<XeroV1InvoiceGetAllParams>;
  output?: Items<XeroV1InvoiceGetAllOutput>;
};