/**
 * Jira Software Node - Version 1
 * Discriminator: resource=issue, operation=getAll
 */


interface Credentials {
  jiraSoftwareCloudApi: CredentialReference;
  jiraSoftwareServerApi: CredentialReference;
  jiraSoftwareServerPatApi: CredentialReference;
}

/** Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask */
export type JiraV1IssueGetAllParams = {
  resource: 'issue';
  operation: 'getAll';
  jiraVersion?: 'cloud' | 'server' | 'serverPat' | 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 50
 */
    limit?: number | Expression<number>;
/**
 * Options
 * @default {}
 */
    options?: {
    /** Use expand to include additional information about issues in the response
     * @default []
     */
    expand?: Array<'changelog' | 'editmeta' | 'names' | 'operations' | 'renderedFields' | 'schema' | 'transitions' | 'versionedRepresentations'>;
    /** A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a comma-separated list. Expand options include: &lt;code&gt;*all&lt;/code&gt; Returns all fields. &lt;code&gt;*navigable&lt;/code&gt; Returns navigable fields. Any issue field, prefixed with a minus to exclude.
     * @default *navigable
     */
    fields?: string | Expression<string> | PlaceholderValue;
    /** Whether fields in fields are referenced by keys rather than IDs. This parameter is useful where fields have been added by a connect app and a field's key may differ from its ID.
     * @default false
     */
    fieldsByKey?: boolean | Expression<boolean>;
    /** A JQL expression
     */
    jql?: string | Expression<string> | PlaceholderValue;
  };
};

export type JiraV1IssueGetAllOutput = {
  expand?: string;
  fields?: {
    aggregateprogress?: {
      progress?: number;
      total?: number;
    };
    assignee?: {
      accountId?: string;
      accountType?: string;
      active?: boolean;
      avatarUrls?: {
        '16x16'?: string;
        '24x24'?: string;
        '32x32'?: string;
        '48x48'?: string;
      };
      displayName?: string;
      emailAddress?: string;
      self?: string;
      timeZone?: string;
    };
    components?: Array<{
      description?: string;
      id?: string;
      name?: string;
      self?: string;
    }>;
    created?: string;
    creator?: {
      accountId?: string;
      accountType?: string;
      active?: boolean;
      avatarUrls?: {
        '16x16'?: string;
        '24x24'?: string;
        '32x32'?: string;
        '48x48'?: string;
      };
      displayName?: string;
      emailAddress?: string;
      self?: string;
      timeZone?: string;
    };
    customfield_10001?: null;
    customfield_10019?: string;
    customfield_10021?: null;
    fixVersions?: Array<{
      archived?: boolean;
      description?: string;
      id?: string;
      name?: string;
      released?: boolean;
      releaseDate?: string;
      self?: string;
    }>;
    issuelinks?: Array<{
      id?: string;
      inwardIssue?: {
        fields?: {
          issuetype?: {
            avatarId?: number;
            description?: string;
            entityId?: string;
            hierarchyLevel?: number;
            iconUrl?: string;
            id?: string;
            name?: string;
            self?: string;
            subtask?: boolean;
          };
          priority?: {
            iconUrl?: string;
            id?: string;
            name?: string;
            self?: string;
          };
          status?: {
            description?: string;
            iconUrl?: string;
            id?: string;
            name?: string;
            self?: string;
            statusCategory?: {
              colorName?: string;
              id?: number;
              key?: string;
              name?: string;
              self?: string;
            };
          };
          summary?: string;
        };
        id?: string;
        key?: string;
        self?: string;
      };
      outwardIssue?: {
        fields?: {
          issuetype?: {
            avatarId?: number;
            description?: string;
            entityId?: string;
            hierarchyLevel?: number;
            iconUrl?: string;
            id?: string;
            name?: string;
            self?: string;
            subtask?: boolean;
          };
          priority?: {
            iconUrl?: string;
            id?: string;
            name?: string;
            self?: string;
          };
          status?: {
            description?: string;
            iconUrl?: string;
            id?: string;
            name?: string;
            self?: string;
            statusCategory?: {
              colorName?: string;
              id?: number;
              key?: string;
              name?: string;
              self?: string;
            };
          };
          summary?: string;
        };
        id?: string;
        key?: string;
        self?: string;
      };
      self?: string;
      type?: {
        id?: string;
        inward?: string;
        name?: string;
        outward?: string;
        self?: string;
      };
    }>;
    issuetype?: {
      avatarId?: number;
      description?: string;
      entityId?: string;
      hierarchyLevel?: number;
      iconUrl?: string;
      id?: string;
      name?: string;
      self?: string;
      subtask?: boolean;
    };
    labels?: Array<string>;
    priority?: {
      iconUrl?: string;
      id?: string;
      name?: string;
      self?: string;
    };
    progress?: {
      progress?: number;
      total?: number;
    };
    project?: {
      avatarUrls?: {
        '16x16'?: string;
        '24x24'?: string;
        '32x32'?: string;
        '48x48'?: string;
      };
      id?: string;
      key?: string;
      name?: string;
      projectTypeKey?: string;
      self?: string;
      simplified?: boolean;
    };
    reporter?: {
      accountId?: string;
      accountType?: string;
      active?: boolean;
      avatarUrls?: {
        '16x16'?: string;
        '24x24'?: string;
        '32x32'?: string;
        '48x48'?: string;
      };
      displayName?: string;
      emailAddress?: string;
      self?: string;
      timeZone?: string;
    };
    security?: null;
    status?: {
      description?: string;
      iconUrl?: string;
      id?: string;
      name?: string;
      self?: string;
      statusCategory?: {
        colorName?: string;
        id?: number;
        key?: string;
        name?: string;
        self?: string;
      };
    };
    statusCategory?: {
      colorName?: string;
      id?: number;
      key?: string;
      name?: string;
      self?: string;
    };
    statuscategorychangedate?: string;
    subtasks?: Array<{
      fields?: {
        issuetype?: {
          avatarId?: number;
          description?: string;
          entityId?: string;
          hierarchyLevel?: number;
          iconUrl?: string;
          id?: string;
          name?: string;
          self?: string;
          subtask?: boolean;
        };
        priority?: {
          iconUrl?: string;
          id?: string;
          name?: string;
          self?: string;
        };
        status?: {
          description?: string;
          iconUrl?: string;
          id?: string;
          name?: string;
          self?: string;
          statusCategory?: {
            colorName?: string;
            id?: number;
            key?: string;
            name?: string;
            self?: string;
          };
        };
        summary?: string;
      };
      id?: string;
      key?: string;
      self?: string;
    }>;
    summary?: string;
    updated?: string;
    votes?: {
      hasVoted?: boolean;
      self?: string;
      votes?: number;
    };
    watches?: {
      isWatching?: boolean;
      self?: string;
      watchCount?: number;
    };
    workratio?: number;
  };
  id?: string;
  key?: string;
  self?: string;
};

export type JiraV1IssueGetAllNode = {
  type: 'n8n-nodes-base.jira';
  version: 1;
  credentials?: Credentials;
  config: NodeConfig<JiraV1IssueGetAllParams>;
  output?: Items<JiraV1IssueGetAllOutput>;
};