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

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";
import { NodeExecutionEvent, TaskExecutionEvent, WorkflowExecutionEvent } from "./event_pb.js";
import { TypedInterface } from "../core/interface_pb.js";
import { ArtifactID } from "../core/artifact_id_pb.js";
import { Identifier, TaskExecutionIdentifier, WorkflowExecutionIdentifier } from "../core/identifier_pb.js";

/**
 * This is the cloud event parallel to the raw WorkflowExecutionEvent message. It's filled in with additional
 * information that downstream consumers may find useful.
 *
 * @generated from message flyteidl.event.CloudEventWorkflowExecution
 */
export class CloudEventWorkflowExecution extends Message<CloudEventWorkflowExecution> {
  /**
   * @generated from field: flyteidl.event.WorkflowExecutionEvent raw_event = 1;
   */
  rawEvent?: WorkflowExecutionEvent;

  /**
   * @generated from field: flyteidl.core.TypedInterface output_interface = 2;
   */
  outputInterface?: TypedInterface;

  /**
   * The following are ExecutionMetadata fields
   * We can't have the ExecutionMetadata object directly because of import cycle
   *
   * @generated from field: repeated flyteidl.core.ArtifactID artifact_ids = 3;
   */
  artifactIds: ArtifactID[] = [];

  /**
   * @generated from field: flyteidl.core.WorkflowExecutionIdentifier reference_execution = 4;
   */
  referenceExecution?: WorkflowExecutionIdentifier;

  /**
   * @generated from field: string principal = 5;
   */
  principal = "";

  /**
   * The ID of the LP that generated the execution that generated the Artifact.
   * Here for provenance information.
   * Launch plan IDs are easier to get than workflow IDs so we'll use these for now.
   *
   * @generated from field: flyteidl.core.Identifier launch_plan_id = 6;
   */
  launchPlanId?: Identifier;

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

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.event.CloudEventWorkflowExecution";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "raw_event", kind: "message", T: WorkflowExecutionEvent },
    { no: 2, name: "output_interface", kind: "message", T: TypedInterface },
    { no: 3, name: "artifact_ids", kind: "message", T: ArtifactID, repeated: true },
    { no: 4, name: "reference_execution", kind: "message", T: WorkflowExecutionIdentifier },
    { no: 5, name: "principal", kind: "scalar", T: 9 /* ScalarType.STRING */ },
    { no: 6, name: "launch_plan_id", kind: "message", T: Identifier },
  ]);

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

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

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

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

/**
 * @generated from message flyteidl.event.CloudEventNodeExecution
 */
export class CloudEventNodeExecution extends Message<CloudEventNodeExecution> {
  /**
   * @generated from field: flyteidl.event.NodeExecutionEvent raw_event = 1;
   */
  rawEvent?: NodeExecutionEvent;

  /**
   * The relevant task execution if applicable
   *
   * @generated from field: flyteidl.core.TaskExecutionIdentifier task_exec_id = 2;
   */
  taskExecId?: TaskExecutionIdentifier;

  /**
   * The typed interface for the task that produced the event.
   *
   * @generated from field: flyteidl.core.TypedInterface output_interface = 3;
   */
  outputInterface?: TypedInterface;

  /**
   * The following are ExecutionMetadata fields
   * We can't have the ExecutionMetadata object directly because of import cycle
   *
   * @generated from field: repeated flyteidl.core.ArtifactID artifact_ids = 4;
   */
  artifactIds: ArtifactID[] = [];

  /**
   * @generated from field: string principal = 5;
   */
  principal = "";

  /**
   * The ID of the LP that generated the execution that generated the Artifact.
   * Here for provenance information.
   * Launch plan IDs are easier to get than workflow IDs so we'll use these for now.
   *
   * @generated from field: flyteidl.core.Identifier launch_plan_id = 6;
   */
  launchPlanId?: Identifier;

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

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.event.CloudEventNodeExecution";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "raw_event", kind: "message", T: NodeExecutionEvent },
    { no: 2, name: "task_exec_id", kind: "message", T: TaskExecutionIdentifier },
    { no: 3, name: "output_interface", kind: "message", T: TypedInterface },
    { no: 4, name: "artifact_ids", kind: "message", T: ArtifactID, repeated: true },
    { no: 5, name: "principal", kind: "scalar", T: 9 /* ScalarType.STRING */ },
    { no: 6, name: "launch_plan_id", kind: "message", T: Identifier },
  ]);

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

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

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

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

/**
 * @generated from message flyteidl.event.CloudEventTaskExecution
 */
export class CloudEventTaskExecution extends Message<CloudEventTaskExecution> {
  /**
   * @generated from field: flyteidl.event.TaskExecutionEvent raw_event = 1;
   */
  rawEvent?: TaskExecutionEvent;

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

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.event.CloudEventTaskExecution";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "raw_event", kind: "message", T: TaskExecutionEvent },
  ]);

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

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

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

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

/**
 * This event is to be sent by Admin after it creates an execution.
 *
 * @generated from message flyteidl.event.CloudEventExecutionStart
 */
export class CloudEventExecutionStart extends Message<CloudEventExecutionStart> {
  /**
   * The execution created.
   *
   * @generated from field: flyteidl.core.WorkflowExecutionIdentifier execution_id = 1;
   */
  executionId?: WorkflowExecutionIdentifier;

  /**
   * The launch plan used.
   *
   * @generated from field: flyteidl.core.Identifier launch_plan_id = 2;
   */
  launchPlanId?: Identifier;

  /**
   * @generated from field: flyteidl.core.Identifier workflow_id = 3;
   */
  workflowId?: Identifier;

  /**
   * Artifact inputs to the workflow execution for which we have the full Artifact ID. These are likely the result of artifact queries that are run.
   *
   * @generated from field: repeated flyteidl.core.ArtifactID artifact_ids = 4;
   */
  artifactIds: ArtifactID[] = [];

  /**
   * Artifact inputs to the workflow execution for which we only have the tracking bit that's installed into the Literal's metadata by the Artifact service.
   *
   * @generated from field: repeated string artifact_trackers = 5;
   */
  artifactTrackers: string[] = [];

  /**
   * @generated from field: string principal = 6;
   */
  principal = "";

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

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.event.CloudEventExecutionStart";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "execution_id", kind: "message", T: WorkflowExecutionIdentifier },
    { no: 2, name: "launch_plan_id", kind: "message", T: Identifier },
    { no: 3, name: "workflow_id", kind: "message", T: Identifier },
    { no: 4, name: "artifact_ids", kind: "message", T: ArtifactID, repeated: true },
    { no: 5, name: "artifact_trackers", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
    { no: 6, name: "principal", kind: "scalar", T: 9 /* ScalarType.STRING */ },
  ]);

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

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

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

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

