// @generated by protoc-gen-es v1.7.2 with parameter "target=ts"
// @generated from file flyteidl/core/compiler.proto (package flyteidl.core, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";
import { WorkflowTemplate } from "./workflow_pb.js";
import { TaskTemplate } from "./tasks_pb.js";

/**
 * Adjacency list for the workflow. This is created as part of the compilation process. Every process after the compilation
 * step uses this created ConnectionSet
 *
 * @generated from message flyteidl.core.ConnectionSet
 */
export class ConnectionSet extends Message<ConnectionSet> {
  /**
   * A list of all the node ids that are downstream from a given node id
   *
   * @generated from field: map<string, flyteidl.core.ConnectionSet.IdList> downstream = 7;
   */
  downstream: { [key: string]: ConnectionSet_IdList } = {};

  /**
   * A list of all the node ids, that are upstream of this node id
   *
   * @generated from field: map<string, flyteidl.core.ConnectionSet.IdList> upstream = 8;
   */
  upstream: { [key: string]: ConnectionSet_IdList } = {};

  constructor(data?: PartialMessage<ConnectionSet>) {
    super();
    proto3.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.core.ConnectionSet";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 7, name: "downstream", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: ConnectionSet_IdList} },
    { no: 8, name: "upstream", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: ConnectionSet_IdList} },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ConnectionSet {
    return new ConnectionSet().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ConnectionSet {
    return new ConnectionSet().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ConnectionSet {
    return new ConnectionSet().fromJsonString(jsonString, options);
  }

  static equals(a: ConnectionSet | PlainMessage<ConnectionSet> | undefined, b: ConnectionSet | PlainMessage<ConnectionSet> | undefined): boolean {
    return proto3.util.equals(ConnectionSet, a, b);
  }
}

/**
 * @generated from message flyteidl.core.ConnectionSet.IdList
 */
export class ConnectionSet_IdList extends Message<ConnectionSet_IdList> {
  /**
   * @generated from field: repeated string ids = 1;
   */
  ids: string[] = [];

  constructor(data?: PartialMessage<ConnectionSet_IdList>) {
    super();
    proto3.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.core.ConnectionSet.IdList";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "ids", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ConnectionSet_IdList {
    return new ConnectionSet_IdList().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ConnectionSet_IdList {
    return new ConnectionSet_IdList().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ConnectionSet_IdList {
    return new ConnectionSet_IdList().fromJsonString(jsonString, options);
  }

  static equals(a: ConnectionSet_IdList | PlainMessage<ConnectionSet_IdList> | undefined, b: ConnectionSet_IdList | PlainMessage<ConnectionSet_IdList> | undefined): boolean {
    return proto3.util.equals(ConnectionSet_IdList, a, b);
  }
}

/**
 * Output of the compilation Step. This object represents one workflow. We store more metadata at this layer
 *
 * @generated from message flyteidl.core.CompiledWorkflow
 */
export class CompiledWorkflow extends Message<CompiledWorkflow> {
  /**
   * Completely contained Workflow Template
   *
   * @generated from field: flyteidl.core.WorkflowTemplate template = 1;
   */
  template?: WorkflowTemplate;

  /**
   * For internal use only! This field is used by the system and must not be filled in. Any values set will be ignored.
   *
   * @generated from field: flyteidl.core.ConnectionSet connections = 2;
   */
  connections?: ConnectionSet;

  constructor(data?: PartialMessage<CompiledWorkflow>) {
    super();
    proto3.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.core.CompiledWorkflow";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "template", kind: "message", T: WorkflowTemplate },
    { no: 2, name: "connections", kind: "message", T: ConnectionSet },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CompiledWorkflow {
    return new CompiledWorkflow().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): CompiledWorkflow {
    return new CompiledWorkflow().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CompiledWorkflow {
    return new CompiledWorkflow().fromJsonString(jsonString, options);
  }

  static equals(a: CompiledWorkflow | PlainMessage<CompiledWorkflow> | undefined, b: CompiledWorkflow | PlainMessage<CompiledWorkflow> | undefined): boolean {
    return proto3.util.equals(CompiledWorkflow, a, b);
  }
}

/**
 * Output of the Compilation step. This object represent one Task. We store more metadata at this layer
 *
 * @generated from message flyteidl.core.CompiledTask
 */
export class CompiledTask extends Message<CompiledTask> {
  /**
   * Completely contained TaskTemplate
   *
   * @generated from field: flyteidl.core.TaskTemplate template = 1;
   */
  template?: TaskTemplate;

  constructor(data?: PartialMessage<CompiledTask>) {
    super();
    proto3.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.core.CompiledTask";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "template", kind: "message", T: TaskTemplate },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CompiledTask {
    return new CompiledTask().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): CompiledTask {
    return new CompiledTask().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CompiledTask {
    return new CompiledTask().fromJsonString(jsonString, options);
  }

  static equals(a: CompiledTask | PlainMessage<CompiledTask> | undefined, b: CompiledTask | PlainMessage<CompiledTask> | undefined): boolean {
    return proto3.util.equals(CompiledTask, a, b);
  }
}

/**
 * A Compiled Workflow Closure contains all the information required to start a new execution, or to visualize a workflow
 * and its details. The CompiledWorkflowClosure should always contain a primary workflow, that is the main workflow that
 * will being the execution. All subworkflows are denormalized. WorkflowNodes refer to the workflow identifiers of
 * compiled subworkflows.
 *
 * @generated from message flyteidl.core.CompiledWorkflowClosure
 */
export class CompiledWorkflowClosure extends Message<CompiledWorkflowClosure> {
  /**
   * +required
   *
   * @generated from field: flyteidl.core.CompiledWorkflow primary = 1;
   */
  primary?: CompiledWorkflow;

  /**
   * Guaranteed that there will only exist one and only one workflow with a given id, i.e., every sub workflow has a
   * unique identifier. Also every enclosed subworkflow is used either by a primary workflow or by a subworkflow
   * as an inlined workflow
   * +optional
   *
   * @generated from field: repeated flyteidl.core.CompiledWorkflow sub_workflows = 2;
   */
  subWorkflows: CompiledWorkflow[] = [];

  /**
   * Guaranteed that there will only exist one and only one task with a given id, i.e., every task has a unique id
   * +required (at least 1)
   *
   * @generated from field: repeated flyteidl.core.CompiledTask tasks = 3;
   */
  tasks: CompiledTask[] = [];

  constructor(data?: PartialMessage<CompiledWorkflowClosure>) {
    super();
    proto3.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.core.CompiledWorkflowClosure";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "primary", kind: "message", T: CompiledWorkflow },
    { no: 2, name: "sub_workflows", kind: "message", T: CompiledWorkflow, repeated: true },
    { no: 3, name: "tasks", kind: "message", T: CompiledTask, repeated: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CompiledWorkflowClosure {
    return new CompiledWorkflowClosure().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): CompiledWorkflowClosure {
    return new CompiledWorkflowClosure().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CompiledWorkflowClosure {
    return new CompiledWorkflowClosure().fromJsonString(jsonString, options);
  }

  static equals(a: CompiledWorkflowClosure | PlainMessage<CompiledWorkflowClosure> | undefined, b: CompiledWorkflowClosure | PlainMessage<CompiledWorkflowClosure> | undefined): boolean {
    return proto3.util.equals(CompiledWorkflowClosure, a, b);
  }
}

