// @generated by protoc-gen-es v1.7.2 with parameter "target=ts"
// @generated from file flyteidl/core/workflow_closure.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";

/**
 * Defines an enclosed package of workflow and tasks it references.
 *
 * @generated from message flyteidl.core.WorkflowClosure
 */
export class WorkflowClosure extends Message<WorkflowClosure> {
  /**
   * required. Workflow template.
   *
   * @generated from field: flyteidl.core.WorkflowTemplate workflow = 1;
   */
  workflow?: WorkflowTemplate;

  /**
   * optional. A collection of tasks referenced by the workflow. Only needed if the workflow
   * references tasks.
   *
   * @generated from field: repeated flyteidl.core.TaskTemplate tasks = 2;
   */
  tasks: TaskTemplate[] = [];

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

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.core.WorkflowClosure";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "workflow", kind: "message", T: WorkflowTemplate },
    { no: 2, name: "tasks", kind: "message", T: TaskTemplate, repeated: true },
  ]);

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

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

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

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

