// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
//   protoc-gen-ts_proto  v1.174.0
//   protoc               v3.12.4
// source: Magma.proto

/* eslint-disable */
import { type IdentifiersMappingConfigDto } from './Identifiers';

export const protobufPackage = 'Magma';

export enum TableStatusDto {
  CLOSED = 'CLOSED',
  LOADING = 'LOADING',
  READY = 'READY',
  ERROR = 'ERROR',
  UNRECOGNIZED = 'UNRECOGNIZED',
}

export interface DatasourceIncrementalConfigDto {
  incremental?: boolean | undefined;
  incrementalDestinationName?: string | undefined;
}

export interface DatasourceBatchConfigDto {
  limit: number;
}

export interface DatasourceFactoryDto {
  name?: string | undefined;
  incrementalConfig?: DatasourceIncrementalConfigDto | undefined;
  batchConfig?: DatasourceBatchConfigDto | undefined;
  idConfig?: IdentifiersMappingConfigDto | undefined;
}

export interface ExcelDatasourceFactoryDto {
  file: string;
  readOnly?: boolean | undefined;
}

export interface CsvDatasourceFactoryDto {
  bundle?: string | undefined;
  tables: CsvDatasourceTableBundleDto[];
  characterSet?: string | undefined;
  separator?: string | undefined;
  quote?: string | undefined;
  firstRow?: number | undefined;
  multilines?: boolean | undefined;
  defaultValueType?: string | undefined;
}

export interface CsvDatasourceTableBundleDto {
  name: string;
  variables?: string | undefined;
  data?: string | undefined;
  refTable?: string | undefined;
  entityType?: string | undefined;
}

export interface FsDatasourceFactoryDto {
  file: string;
  /** required to read correctly old onyx versions are until 1.6 included */
  onyxWrapper?: boolean | undefined;
}

export interface JdbcDatasourceFactoryDto {
  database: string;
}

export interface JdbcDatasourceSettingsDto {
  defaultEntityType: string;
  useMetadataTables: boolean;
  mappedTables: string[];
  tableSettings: JdbcValueTableSettingsDto[];
  defaultCreatedTimestampColumnName?: string | undefined;
  defaultUpdatedTimestampColumnName?: string | undefined;
  defaultEntityIdColumnName?: string | undefined;
  multipleDatasources?: boolean | undefined;
  batchSize?: number | undefined;
  multilines?: boolean | undefined;
  tableSettingsFactories: JdbcValueTableSettingsFactoryDto[];
}

export interface JdbcValueTableSettingsDto {
  sqlTable: string;
  opalTable?: string | undefined;
  entityType: string;
  entityIdentifierColumn?: string | undefined;
  createdTimestampColumn?: string | undefined;
  updatedTimestampColumn?: string | undefined;
  entityIdentifiersWhere?: string | undefined;
  excludedColumns?: string | undefined;
  includedColumns?: string | undefined;
  multilines?: boolean | undefined;
}

export interface JdbcValueTableSettingsFactoryDto {
  sqlTable: string;
  opalTable?: string | undefined;
  entityType: string;
  entityIdentifierColumn?: string | undefined;
  createdTimestampColumn?: string | undefined;
  updatedTimestampColumn?: string | undefined;
  entityIdentifiersWhere?: string | undefined;
  tablePartitionColumn: string;
  excludedColumns?: string | undefined;
  includedColumns?: string | undefined;
  multilines?: boolean | undefined;
}

export interface HibernateDatasourceFactoryDto {
  key?: boolean | undefined;
  database?: string | undefined;
}

export interface StaticDatasourceFactoryDto {
  tables: TableDto[];
  views: ViewDto[];
}

export interface RestDatasourceFactoryDto {
  url: string;
  username?: string | undefined;
  password?: string | undefined;
  token?: string | undefined;
  remoteDatasource: string;
}

export interface IncrementalDatasourceFactoryDto {
  datasourceFactoryDto: DatasourceFactoryDto | undefined;
  isIncremental: boolean;
  destinationTable: TableDto | undefined;
}

export interface SpssDatasourceFactoryDto {
  file: string;
  characterSet?: string | undefined;
  entityType?: string | undefined;
  locale?: string | undefined;
  idVariable?: string | undefined;
}

export interface HCDatasourceFactoryDto {}

export interface GNPostalCodesDatasourceFactoryDto {}

export interface MongoDBDatasourceFactoryDto {
  database?: string | undefined;
}

export interface RSessionDatasourceFactoryDto {
  session: string;
  symbol: string;
  entityType?: string | undefined;
  idColumn?: string | undefined;
}

export interface RHavenDatasourceFactoryDto {
  file: string;
  symbol: string;
  entityType?: string | undefined;
  idColumn?: string | undefined;
  catFile?: string | undefined;
  locale?: string | undefined;
}

export interface PluginDatasourceFactoryDto {
  /** plugin name */
  name: string;
  /** user parameters */
  parameters?: string | undefined;
}

export interface DatasourceParsingErrorDto {
  defaultMessage: string;
  key: string;
  arguments: string[];
}

export interface DatasourceDto {
  name: string;
  link?: string | undefined;
  table: string[];
  view: string[];
  type: string;
  timestamps?: TimestampsDto | undefined;
}

export interface TableDto {
  name: string;
  entityType: string;
  link?: string | undefined;
  variableCount?: number | undefined;
  valueSetCount?: number | undefined;
  datasourceName?: string | undefined;
  variables: VariableDto[];
  viewLink?: string | undefined;
  timestamps?: TimestampsDto | undefined;
  viewType?: string | undefined;
  status?: TableStatusDto | undefined;
}

export interface VariableDto {
  name: string;
  entityType: string;
  valueType: string;
  mimeType?: string | undefined;
  isRepeatable: boolean;
  occurrenceGroup?: string | undefined;
  link?: string | undefined;
  attributes: AttributeDto[];
  categories: CategoryDto[];
  unit?: string | undefined;
  parentLink?: LinkDto | undefined;
  isNewVariable?: boolean | undefined;
  index?: number | undefined;
  referencedEntityType?: string | undefined;
}

export interface CategoryDto {
  name: string;
  isMissing: boolean;
  attributes: AttributeDto[];
}

export interface AttributeDto {
  name: string;
  value: string;
  locale?: string | undefined;
  namespace?: string | undefined;
}

export interface VariableAttributeDto {
  datasource?: string | undefined;
  table?: string | undefined;
  variable: string;
  name: string;
  namespace?: string | undefined;
  locale?: string | undefined;
  /** if missing: update is a deletion */
  value?: string | undefined;
}

export interface ValueSetsDto {
  variables: string[];
  valueSets: ValueSetsDto_ValueSetDto[];
  entityType: string;
}

export interface ValueSetsDto_ValueSetDto {
  identifier: string;
  values: ValueSetsDto_ValueDto[];
  timestamps?: TimestampsDto | undefined;
}

export interface ValueSetsDto_ValueDto {
  value?: string | undefined;
  /** link to the value */
  link?: string | undefined;
  /** value sequence */
  values: ValueSetsDto_ValueDto[];
  /** length of the value */
  length?: number | undefined;
}

export interface VariableEntityDto {
  identifier: string;
  entityType?: string | undefined;
}

export interface VariableEntitySummaryDto {
  entityType: string;
  tableCount: number;
}

export interface TimestampsDto {
  created?: string | undefined;
  lastUpdate?: string | undefined;
}

export interface LinkDto {
  rel: string;
  link: string;
}

export interface ViewDto {
  from: string[];
  name?: string | undefined;
  datasourceName?: string | undefined;
  where?: string | undefined;
  innerFrom: string[];
  status?: TableStatusDto | undefined;
}

export interface JavaScriptViewDto {
  select?: string | undefined;
}

export interface VariableListViewDto {
  variables: VariableDto[];
}

export interface OutlierRemovingViewDto {
  stdDevMultiplier: number;
  valueForOutlier?: string | undefined;
}

export interface FileViewDto {
  filename: string;
  type?: FileViewDto_FileViewType | undefined;
}

export enum FileViewDto_FileViewType {
  SERIALIZED_XML = 'SERIALIZED_XML',
  EXCEL = 'EXCEL',
  UNRECOGNIZED = 'UNRECOGNIZED',
}

export interface ResourceViewDto {
  variables: VariableDto[];
  idColumn?: string | undefined;
  entityType?: string | undefined;
  profile?: string | undefined;
  allColumns?: boolean | undefined;
}

export interface JavaScriptErrorDto {
  /** RhinoException.details() */
  message: string;
  /** RhinoException.sourceName() */
  sourceName: string;
  /** RhinoException.lineNumber() */
  lineNumber: number;
  /** RhinoException.lineSource() */
  lineSource?: string | undefined;
  /** RhinoException.columnNumber() */
  columnNumber?: number | undefined;
}

export interface TableCompareDto {
  compared: TableDto | undefined;
  /** optional because this is absent when the destination table does not exist */
  withTable?: TableDto | undefined;
  /** list of all variables present in "compared" but not in "with" */
  newVariables: VariableDto[];
  /** list of all variables present in both and whose definitions are compatible and are not modified */
  unmodifiedVariables: VariableDto[];
  /** list of all variables present in "with" but not in "compared" */
  missingVariables: VariableDto[];
  /** list of all variables present in both and whose definitions are incompatible */
  conflicts: ConflictDto[];
  /** list of all variables present in both and whose definitions are compatible but are modified */
  modifiedVariables: VariableDto[];
}

export interface ConflictDto {
  variable: VariableDto | undefined;
  code: string;
  arguments: string[];
}

export interface DatasourceCompareDto {
  compared: DatasourceDto | undefined;
  withDatasource: DatasourceDto | undefined;
  tableComparisons: TableCompareDto[];
}

export interface TableIdentifiersSync {
  datasource: string;
  table: string;
  entityType: string;
  /** count of entities in table */
  total: number;
  /** count of entity identifiers to be imported */
  count: number;
}
