/**
 * Generated by @openapi-codegen
 *
 * @version 0.0.1
 */
export type FirmwareSource = {
  version: string;
  source: string;
  branch?: string;
  official: boolean;
  prerelease: boolean;
  availableBoards: string[];
};

export type FirmwareBoardDefaults = {
  schema: void;
  data: DefaultsFile;
};

export type DefaultsFile = {
  toolchain: 'platformio';
  defaults: {
    [key: string]: BoardDefaults;
  };
};

export type BoardDefaults = {
  values: void;
  flashingRules: {
    applicationOffset: number;
    needBootPress: boolean;
    needManualReboot: boolean;
    shouldOnlyUseDefaults: boolean;
  };
};

export type BoardDefaultsQuery = {
  source: string;
  board: string;
  version: string;
};

export type BuildStatusBasic = {
  id: string;
  status:
    | 'QUEUED'
    | 'CREATING_BUILD_FOLDER'
    | 'DOWNLOADING_SOURCE'
    | 'EXTRACTING_SOURCE'
    | 'BUILDING'
    | 'SAVING'
    | 'ERROR';
};

export type BuildStatusDone = {
  id: string;
  status: 'DONE';
  files: {
    filePath: string;
    offset: number;
    digest: string;
    isFirmware: boolean;
    firmwareId: string;
  }[];
};

export type BuildFirmwareBody = {
  source: string;
  board: string;
  version: string;
  values: BoardDefaults;
};

export type FirmwareWithFiles = {
  id: string;
  release_id: string;
  status:
    | 'QUEUED'
    | 'CREATING_BUILD_FOLDER'
    | 'DOWNLOADING_SOURCE'
    | 'EXTRACTING_SOURCE'
    | 'BUILDING'
    | 'SAVING'
    | 'DONE'
    | 'ERROR';
  /**
   * @format date-time
   */
  createdAt: string;
  /**
   * @format date-time
   */
  updatedAt: string;
  files: {
    filePath: string;
    offset: number;
    digest: string;
    isFirmware: boolean;
    firmwareId: string;
  }[];
};

export type FirmwareBoardDefaultsNullable = {
  schema: void;
  data: DefaultsFile;
} | null;
