// @generated by protoc-gen-es v1.7.2 with parameter "target=ts"
// @generated from file flyteidl/admin/task.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 { TaskTemplate } from "../core/tasks_pb.js";
import { DescriptionEntity } from "./description_entity_pb.js";
import { CompiledTask } from "../core/compiler_pb.js";

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

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

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

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

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

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

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

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

/**
 * Represents a response structure if task creation succeeds.
 *
 * Purposefully empty, may be populated in the future.
 *
 * @generated from message flyteidl.admin.TaskCreateResponse
 */
export class TaskCreateResponse extends Message<TaskCreateResponse> {
  constructor(data?: PartialMessage<TaskCreateResponse>) {
    super();
    proto3.util.initPartial(data, this);
  }

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

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

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

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

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

/**
 * Flyte workflows are composed of many ordered tasks. That is small, reusable, self-contained logical blocks
 * arranged to process workflow inputs and produce a deterministic set of outputs.
 * Tasks can come in many varieties tuned for specialized behavior. 
 *
 * @generated from message flyteidl.admin.Task
 */
export class Task extends Message<Task> {
  /**
   * id represents the unique identifier of the task.
   *
   * @generated from field: flyteidl.core.Identifier id = 1;
   */
  id?: Identifier;

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

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

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

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

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

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

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

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

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

  /**
   * 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<TaskList>) {
    super();
    proto3.util.initPartial(data, this);
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

/**
 * Compute task attributes which include values derived from the TaskSpec, as well as plugin-specific data
 * and task metadata.
 *
 * @generated from message flyteidl.admin.TaskClosure
 */
export class TaskClosure extends Message<TaskClosure> {
  /**
   * Represents the compiled representation of the task from the specification provided.
   *
   * @generated from field: flyteidl.core.CompiledTask compiled_task = 1;
   */
  compiledTask?: CompiledTask;

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

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

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

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

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

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

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

