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

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3, Timestamp } from "@bufbuild/protobuf";
import { Identifier } from "../core/identifier_pb.js";
import { WorkflowTemplate } from "../core/workflow_pb.js";
import { DescriptionEntity } from "./description_entity_pb.js";
import { CompiledWorkflowClosure } from "../core/compiler_pb.js";

/**
 * Represents a request structure to create a revision of a workflow.
 * See :ref:`ref_flyteidl.admin.Workflow` for more details
 *
 * @generated from message flyteidl.admin.WorkflowCreateRequest
 */
export class WorkflowCreateRequest extends Message<WorkflowCreateRequest> {
  /**
   * id represents the unique identifier of the workflow.
   * +required
   *
   * @generated from field: flyteidl.core.Identifier id = 1;
   */
  id?: Identifier;

  /**
   * Represents the specification for workflow.
   * +required
   *
   * @generated from field: flyteidl.admin.WorkflowSpec spec = 2;
   */
  spec?: WorkflowSpec;

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

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.admin.WorkflowCreateRequest";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "id", kind: "message", T: Identifier },
    { no: 2, name: "spec", kind: "message", T: WorkflowSpec },
  ]);

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

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

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

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

/**
 * Purposefully empty, may be populated in the future. 
 *
 * @generated from message flyteidl.admin.WorkflowCreateResponse
 */
export class WorkflowCreateResponse extends Message<WorkflowCreateResponse> {
  constructor(data?: PartialMessage<WorkflowCreateResponse>) {
    super();
    proto3.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.admin.WorkflowCreateResponse";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
  ]);

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

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

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

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

/**
 * Represents the workflow structure stored in the Admin
 * A workflow is created by ordering tasks and associating outputs to inputs
 * in order to produce a directed-acyclic execution graph.
 *
 * @generated from message flyteidl.admin.Workflow
 */
export class Workflow extends Message<Workflow> {
  /**
   * id represents the unique identifier of the workflow.
   *
   * @generated from field: flyteidl.core.Identifier id = 1;
   */
  id?: Identifier;

  /**
   * closure encapsulates all the fields that maps to a compiled version of the workflow.
   *
   * @generated from field: flyteidl.admin.WorkflowClosure closure = 2;
   */
  closure?: WorkflowClosure;

  /**
   * One-liner overview of the entity.
   *
   * @generated from field: string short_description = 3;
   */
  shortDescription = "";

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

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.admin.Workflow";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "id", kind: "message", T: Identifier },
    { no: 2, name: "closure", kind: "message", T: WorkflowClosure },
    { no: 3, name: "short_description", kind: "scalar", T: 9 /* ScalarType.STRING */ },
  ]);

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

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

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

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

/**
 * Represents a list of workflows returned from the admin.
 * See :ref:`ref_flyteidl.admin.Workflow` for more details
 *
 * @generated from message flyteidl.admin.WorkflowList
 */
export class WorkflowList extends Message<WorkflowList> {
  /**
   * A list of workflows returned based on the request.
   *
   * @generated from field: repeated flyteidl.admin.Workflow workflows = 1;
   */
  workflows: Workflow[] = [];

  /**
   * In the case of multiple pages of results, the server-provided token can be used to fetch the next page
   * in a query. If there are no more results, this value will be empty.
   *
   * @generated from field: string token = 2;
   */
  token = "";

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

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.admin.WorkflowList";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "workflows", kind: "message", T: Workflow, repeated: true },
    { no: 2, name: "token", kind: "scalar", T: 9 /* ScalarType.STRING */ },
  ]);

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

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

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

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

/**
 * Represents a structure that encapsulates the specification of the workflow.
 *
 * @generated from message flyteidl.admin.WorkflowSpec
 */
export class WorkflowSpec extends Message<WorkflowSpec> {
  /**
   * Template of the task that encapsulates all the metadata of the workflow.
   *
   * @generated from field: flyteidl.core.WorkflowTemplate template = 1;
   */
  template?: WorkflowTemplate;

  /**
   * Workflows that are embedded into other workflows need to be passed alongside the parent workflow to the
   * propeller compiler (since the compiler doesn't have any knowledge of other workflows - ie, it doesn't reach out
   * to Admin to see other registered workflows).  In fact, subworkflows do not even need to be registered.
   *
   * @generated from field: repeated flyteidl.core.WorkflowTemplate sub_workflows = 2;
   */
  subWorkflows: WorkflowTemplate[] = [];

  /**
   * Represents the specification for description entity.
   *
   * @generated from field: flyteidl.admin.DescriptionEntity description = 3;
   */
  description?: DescriptionEntity;

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

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.admin.WorkflowSpec";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "template", kind: "message", T: WorkflowTemplate },
    { no: 2, name: "sub_workflows", kind: "message", T: WorkflowTemplate, repeated: true },
    { no: 3, name: "description", kind: "message", T: DescriptionEntity },
  ]);

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

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

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

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

/**
 * A container holding the compiled workflow produced from the WorkflowSpec and additional metadata.
 *
 * @generated from message flyteidl.admin.WorkflowClosure
 */
export class WorkflowClosure extends Message<WorkflowClosure> {
  /**
   * Represents the compiled representation of the workflow from the specification provided.
   *
   * @generated from field: flyteidl.core.CompiledWorkflowClosure compiled_workflow = 1;
   */
  compiledWorkflow?: CompiledWorkflowClosure;

  /**
   * Time at which the workflow was created.
   *
   * @generated from field: google.protobuf.Timestamp created_at = 2;
   */
  createdAt?: Timestamp;

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

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.admin.WorkflowClosure";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "compiled_workflow", kind: "message", T: CompiledWorkflowClosure },
    { no: 2, name: "created_at", kind: "message", T: Timestamp },
  ]);

  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);
  }
}

/**
 * The workflow id is already used and the structure is different
 *
 * @generated from message flyteidl.admin.WorkflowErrorExistsDifferentStructure
 */
export class WorkflowErrorExistsDifferentStructure extends Message<WorkflowErrorExistsDifferentStructure> {
  /**
   * @generated from field: flyteidl.core.Identifier id = 1;
   */
  id?: Identifier;

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

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.admin.WorkflowErrorExistsDifferentStructure";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "id", kind: "message", T: Identifier },
  ]);

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

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

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

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

/**
 * The workflow id is already used with an identical sctructure
 *
 * @generated from message flyteidl.admin.WorkflowErrorExistsIdenticalStructure
 */
export class WorkflowErrorExistsIdenticalStructure extends Message<WorkflowErrorExistsIdenticalStructure> {
  /**
   * @generated from field: flyteidl.core.Identifier id = 1;
   */
  id?: Identifier;

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

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.admin.WorkflowErrorExistsIdenticalStructure";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "id", kind: "message", T: Identifier },
  ]);

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

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

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

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

/**
 * When a CreateWorkflowRequest fails due to matching id
 *
 * @generated from message flyteidl.admin.CreateWorkflowFailureReason
 */
export class CreateWorkflowFailureReason extends Message<CreateWorkflowFailureReason> {
  /**
   * @generated from oneof flyteidl.admin.CreateWorkflowFailureReason.reason
   */
  reason: {
    /**
     * @generated from field: flyteidl.admin.WorkflowErrorExistsDifferentStructure exists_different_structure = 1;
     */
    value: WorkflowErrorExistsDifferentStructure;
    case: "existsDifferentStructure";
  } | {
    /**
     * @generated from field: flyteidl.admin.WorkflowErrorExistsIdenticalStructure exists_identical_structure = 2;
     */
    value: WorkflowErrorExistsIdenticalStructure;
    case: "existsIdenticalStructure";
  } | { case: undefined; value?: undefined } = { case: undefined };

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

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.admin.CreateWorkflowFailureReason";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "exists_different_structure", kind: "message", T: WorkflowErrorExistsDifferentStructure, oneof: "reason" },
    { no: 2, name: "exists_identical_structure", kind: "message", T: WorkflowErrorExistsIdenticalStructure, oneof: "reason" },
  ]);

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

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

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

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

