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

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";

/**
 * @generated from enum flyteidl.plugins.kubeflow.RestartPolicy
 */
export enum RestartPolicy {
  /**
   * @generated from enum value: RESTART_POLICY_NEVER = 0;
   */
  NEVER = 0,

  /**
   * @generated from enum value: RESTART_POLICY_ON_FAILURE = 1;
   */
  ON_FAILURE = 1,

  /**
   * @generated from enum value: RESTART_POLICY_ALWAYS = 2;
   */
  ALWAYS = 2,
}
// Retrieve enum metadata with: proto3.getEnumType(RestartPolicy)
proto3.util.setEnumType(RestartPolicy, "flyteidl.plugins.kubeflow.RestartPolicy", [
  { no: 0, name: "RESTART_POLICY_NEVER" },
  { no: 1, name: "RESTART_POLICY_ON_FAILURE" },
  { no: 2, name: "RESTART_POLICY_ALWAYS" },
]);

/**
 * @generated from enum flyteidl.plugins.kubeflow.CleanPodPolicy
 */
export enum CleanPodPolicy {
  /**
   * @generated from enum value: CLEANPOD_POLICY_NONE = 0;
   */
  CLEANPOD_POLICY_NONE = 0,

  /**
   * @generated from enum value: CLEANPOD_POLICY_RUNNING = 1;
   */
  CLEANPOD_POLICY_RUNNING = 1,

  /**
   * @generated from enum value: CLEANPOD_POLICY_ALL = 2;
   */
  CLEANPOD_POLICY_ALL = 2,
}
// Retrieve enum metadata with: proto3.getEnumType(CleanPodPolicy)
proto3.util.setEnumType(CleanPodPolicy, "flyteidl.plugins.kubeflow.CleanPodPolicy", [
  { no: 0, name: "CLEANPOD_POLICY_NONE" },
  { no: 1, name: "CLEANPOD_POLICY_RUNNING" },
  { no: 2, name: "CLEANPOD_POLICY_ALL" },
]);

/**
 * @generated from message flyteidl.plugins.kubeflow.RunPolicy
 */
export class RunPolicy extends Message<RunPolicy> {
  /**
   * Defines the policy to kill pods after the job completes. Default to None.
   *
   * @generated from field: flyteidl.plugins.kubeflow.CleanPodPolicy clean_pod_policy = 1;
   */
  cleanPodPolicy = CleanPodPolicy.CLEANPOD_POLICY_NONE;

  /**
   * TTL to clean up jobs. Default to infinite.
   *
   * @generated from field: int32 ttl_seconds_after_finished = 2;
   */
  ttlSecondsAfterFinished = 0;

  /**
   * Specifies the duration in seconds relative to the startTime that the job may be active
   * before the system tries to terminate it; value must be positive integer.
   *
   * @generated from field: int32 active_deadline_seconds = 3;
   */
  activeDeadlineSeconds = 0;

  /**
   * Number of retries before marking this job failed.
   *
   * @generated from field: int32 backoff_limit = 4;
   */
  backoffLimit = 0;

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

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.plugins.kubeflow.RunPolicy";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "clean_pod_policy", kind: "enum", T: proto3.getEnumType(CleanPodPolicy) },
    { no: 2, name: "ttl_seconds_after_finished", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
    { no: 3, name: "active_deadline_seconds", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
    { no: 4, name: "backoff_limit", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
  ]);

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

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

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

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

