"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
"""
import builtins
import google.protobuf.descriptor
import google.protobuf.internal.containers
import google.protobuf.internal.enum_type_wrapper
import google.protobuf.message
import google.protobuf.timestamp_pb2
import typing
import typing_extensions

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...

class ErrorCode(_ErrorCode, metaclass=_ErrorCodeEnumTypeWrapper):
    pass
class _ErrorCode:
    V = typing.NewType('V', builtins.int)
class _ErrorCodeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ErrorCode.V], builtins.type):
    DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor = ...
    UNKNOWN = ErrorCode.V(0)
    # HTTP 5xx error code
    RUNTIME = ErrorCode.V(100)
    # HTTP 4xx error code
    APPLICATION = ErrorCode.V(200)

UNKNOWN = ErrorCode.V(0)
# HTTP 5xx error code
RUNTIME = ErrorCode.V(100)
# HTTP 4xx error code
APPLICATION = ErrorCode.V(200)
global___ErrorCode = ErrorCode


# TODO: the CronJob and timing messages below were copied over from
# the non-open source //models/runtime/cronjob.proto. It might make
# sense to merge these in the future, and, even if unmerged, to move
# these definitions to another file for better organization.
class Unit(_Unit, metaclass=_UnitEnumTypeWrapper):
    pass
class _Unit:
    V = typing.NewType('V', builtins.int)
class _UnitEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Unit.V], builtins.type):
    DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor = ...
    # Sort by unit size so we can use > and < in code.
    UNKNOWN_UNIT = Unit.V(0)
    # k8s cronjobs does not support seconds, but schedule does. Keep just in case
    SECONDS = Unit.V(1)
    MINUTES = Unit.V(2)
    HOURS = Unit.V(3)
    DAYS = Unit.V(4)
    # python schedule module does not support months/years
    WEEKS = Unit.V(5)

# Sort by unit size so we can use > and < in code.
UNKNOWN_UNIT = Unit.V(0)
# k8s cronjobs does not support seconds, but schedule does. Keep just in case
SECONDS = Unit.V(1)
MINUTES = Unit.V(2)
HOURS = Unit.V(3)
DAYS = Unit.V(4)
# python schedule module does not support months/years
WEEKS = Unit.V(5)
global___Unit = Unit


class DayOfWeek(_DayOfWeek, metaclass=_DayOfWeekEnumTypeWrapper):
    pass
class _DayOfWeek:
    V = typing.NewType('V', builtins.int)
class _DayOfWeekEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_DayOfWeek.V], builtins.type):
    DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor = ...
    UNKNOWN_DAY = DayOfWeek.V(0)
    # Start on Sunday to match crontab order. We need zero to be default but we don't
    # want to default to Sunday. So in code we can do (enumValue - 1) to determine
    # crontab value.
    SUNDAY = DayOfWeek.V(1)
    MONDAY = DayOfWeek.V(2)
    TUESDAY = DayOfWeek.V(3)
    WEDNESDAY = DayOfWeek.V(4)
    THURSDAY = DayOfWeek.V(5)
    FRIDAY = DayOfWeek.V(6)
    SATURDAY = DayOfWeek.V(7)

UNKNOWN_DAY = DayOfWeek.V(0)
# Start on Sunday to match crontab order. We need zero to be default but we don't
# want to default to Sunday. So in code we can do (enumValue - 1) to determine
# crontab value.
SUNDAY = DayOfWeek.V(1)
MONDAY = DayOfWeek.V(2)
TUESDAY = DayOfWeek.V(3)
WEDNESDAY = DayOfWeek.V(4)
THURSDAY = DayOfWeek.V(5)
FRIDAY = DayOfWeek.V(6)
SATURDAY = DayOfWeek.V(7)
global___DayOfWeek = DayOfWeek


class RemoteCallRequest(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    QUALIFIED_SYMBOL_FIELD_NUMBER: builtins.int
    JSON_ARGS_FIELD_NUMBER: builtins.int
    qualified_symbol: typing.Text = ...
    # TODO: encode as protobuf instead
    json_args: typing.Text = ...
    def __init__(self,
        *,
        qualified_symbol : typing.Text = ...,
        json_args : typing.Text = ...,
        ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"json_args",b"json_args",u"qualified_symbol",b"qualified_symbol"]) -> None: ...
global___RemoteCallRequest = RemoteCallRequest

class RemoteCallResponse(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    JSON_RESULTS_FIELD_NUMBER: builtins.int
    # TODO: encode as protobuf instead
    json_results: typing.Text = ...
    def __init__(self,
        *,
        json_results : typing.Text = ...,
        ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"json_results",b"json_results"]) -> None: ...
global___RemoteCallResponse = RemoteCallResponse

class CreateTaskRequest(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    TASK_FIELD_NUMBER: builtins.int
    SDK_VERSION_FIELD_NUMBER: builtins.int
    @property
    def task(self) -> global___Task: ...
    sdk_version: typing.Text = ...
    def __init__(self,
        *,
        task : typing.Optional[global___Task] = ...,
        sdk_version : typing.Text = ...,
        ) -> None: ...
    def HasField(self, field_name: typing_extensions.Literal[u"task",b"task"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"sdk_version",b"sdk_version",u"task",b"task"]) -> None: ...
global___CreateTaskRequest = CreateTaskRequest

class CreateTaskResponse(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    TASK_ID_FIELD_NUMBER: builtins.int
    task_id: typing.Text = ...
    def __init__(self,
        *,
        task_id : typing.Text = ...,
        ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"task_id",b"task_id"]) -> None: ...
global___CreateTaskResponse = CreateTaskResponse

class CancelTaskRequest(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    TASK_ID_FIELD_NUMBER: builtins.int
    task_id: typing.Text = ...
    def __init__(self,
        *,
        task_id : typing.Text = ...,
        ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"task_id",b"task_id"]) -> None: ...
global___CancelTaskRequest = CancelTaskRequest

class CancelTaskResponse(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    SUCCESS_FIELD_NUMBER: builtins.int
    success: builtins.bool = ...
    def __init__(self,
        *,
        success : builtins.bool = ...,
        ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"success",b"success"]) -> None: ...
global___CancelTaskResponse = CancelTaskResponse

class PostResultRequest(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    EXEC_ID_FIELD_NUMBER: builtins.int
    RESULT_FIELD_NUMBER: builtins.int
    # An id that identifies an instance of a Task execution.
    exec_id: typing.Text = ...
    @property
    def result(self) -> global___Result: ...
    def __init__(self,
        *,
        exec_id : typing.Text = ...,
        result : typing.Optional[global___Result] = ...,
        ) -> None: ...
    def HasField(self, field_name: typing_extensions.Literal[u"result",b"result"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"exec_id",b"exec_id",u"result",b"result"]) -> None: ...
global___PostResultRequest = PostResultRequest

class PostResultResponse(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    def __init__(self,
        ) -> None: ...
global___PostResultResponse = PostResultResponse

class Task(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    NAMESPACE_FIELD_NUMBER: builtins.int
    HOSTNAME_FIELD_NUMBER: builtins.int
    APP_NAME_FIELD_NUMBER: builtins.int
    CHART_REVISION_FIELD_NUMBER: builtins.int
    QUALIFIED_SYMBOL_FIELD_NUMBER: builtins.int
    ENCODED_ARGS_FIELD_NUMBER: builtins.int
    PARENT_TASK_ID_FIELD_NUMBER: builtins.int
    TARGET_TIME_FIELD_NUMBER: builtins.int
    WITH_CHECKPOINTING_FIELD_NUMBER: builtins.int
    TASK_ID_FIELD_NUMBER: builtins.int
    # unused for now, but keeping for when we have cross-namespace calls
    namespace: typing.Text = ...
    # The hostname of the pod that will be used as a "base" for this
    # task. The base pod's environment/image will be used to run the task.
    hostname: typing.Text = ...
    app_name: typing.Text = ...
    chart_revision: typing.Text = ...
    qualified_symbol: typing.Text = ...
    encoded_args: builtins.bytes = ...
    parent_task_id: typing.Text = ...
    @property
    def target_time(self) -> google.protobuf.timestamp_pb2.Timestamp: ...
    with_checkpointing: builtins.bool = ...
    # TODO: this is a clutch, only used server-side for now. Remove after
    # we a separate Task definition for the server-side.
    task_id: typing.Text = ...
    def __init__(self,
        *,
        namespace : typing.Text = ...,
        hostname : typing.Text = ...,
        app_name : typing.Text = ...,
        chart_revision : typing.Text = ...,
        qualified_symbol : typing.Text = ...,
        encoded_args : builtins.bytes = ...,
        parent_task_id : typing.Text = ...,
        target_time : typing.Optional[google.protobuf.timestamp_pb2.Timestamp] = ...,
        with_checkpointing : builtins.bool = ...,
        task_id : typing.Text = ...,
        ) -> None: ...
    def HasField(self, field_name: typing_extensions.Literal[u"target_time",b"target_time"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"app_name",b"app_name",u"chart_revision",b"chart_revision",u"encoded_args",b"encoded_args",u"hostname",b"hostname",u"namespace",b"namespace",u"parent_task_id",b"parent_task_id",u"qualified_symbol",b"qualified_symbol",u"target_time",b"target_time",u"task_id",b"task_id",u"with_checkpointing",b"with_checkpointing"]) -> None: ...
global___Task = Task

# Result should always have either `value` OR `error` set, and both should
# not be set.
class Result(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    VALUE_FIELD_NUMBER: builtins.int
    ERROR_FIELD_NUMBER: builtins.int
    @property
    def value(self) -> global___Value: ...
    @property
    def error(self) -> global___Error: ...
    def __init__(self,
        *,
        value : typing.Optional[global___Value] = ...,
        error : typing.Optional[global___Error] = ...,
        ) -> None: ...
    def HasField(self, field_name: typing_extensions.Literal[u"error",b"error",u"value",b"value"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"error",b"error",u"value",b"value"]) -> None: ...
global___Result = Result

class Error(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    CODE_FIELD_NUMBER: builtins.int
    MESSAGE_FIELD_NUMBER: builtins.int
    ENCODED_ERROR_FIELD_NUMBER: builtins.int
    code: global___ErrorCode.V = ...
    # Human readable error message.
    message: typing.Text = ...
    # For now, we use a generic bytes type. This lets us use jsonpickle
    # for python-to-python service calls, specifically an Error object
    # returned from an python-application running via jetpack.
    #
    # Long term:
    # We'll likely want this to be `repeated google.protobuf.Any` type.
    # This will let us encode specific details for different error codes
    # that correspond to specific protobuf-message kinds, and stack traces.
    # However, we'd need to implement a python type to protobuf converter
    # ("protopickle") and so we can punt on that for now.
    #
    # Consider using pkg cockroachdb/errors in runtime and storing that error's
    # protobuf message here.
    encoded_error: builtins.bytes = ...
    def __init__(self,
        *,
        code : global___ErrorCode.V = ...,
        message : typing.Text = ...,
        encoded_error : builtins.bytes = ...,
        ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"code",b"code",u"encoded_error",b"encoded_error",u"message",b"message"]) -> None: ...
global___Error = Error

class Value(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    ENCODED_VALUE_FIELD_NUMBER: builtins.int
    # This should contain the json-pickled value being returned
    encoded_value: builtins.bytes = ...
    def __init__(self,
        *,
        encoded_value : builtins.bytes = ...,
        ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"encoded_value",b"encoded_value"]) -> None: ...
global___Value = Value

class SetCronJobsRequest(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    NAMESPACE_FIELD_NUMBER: builtins.int
    HOSTNAME_FIELD_NUMBER: builtins.int
    APP_ID_FIELD_NUMBER: builtins.int
    CRON_JOBS_FIELD_NUMBER: builtins.int
    # Namespace and hostname (pod name) of the app. Used to locate the
    # app pod and copy over its spec into the k8s cron jobs.
    namespace: typing.Text = ...
    hostname: typing.Text = ...
    app_id: typing.Text = ...
    @property
    def cron_jobs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CronJob]: ...
    def __init__(self,
        *,
        namespace : typing.Text = ...,
        hostname : typing.Text = ...,
        app_id : typing.Text = ...,
        cron_jobs : typing.Optional[typing.Iterable[global___CronJob]] = ...,
        ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"app_id",b"app_id",u"cron_jobs",b"cron_jobs",u"hostname",b"hostname",u"namespace",b"namespace"]) -> None: ...
global___SetCronJobsRequest = SetCronJobsRequest

class SetCronJobsResponse(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    def __init__(self,
        ) -> None: ...
global___SetCronJobsResponse = SetCronJobsResponse

class RegisterAppRequest(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    NAMESPACE_FIELD_NUMBER: builtins.int
    HOSTNAME_FIELD_NUMBER: builtins.int
    CRON_JOBS_FIELD_NUMBER: builtins.int
    # Namespace and hostname (pod name) of the app. Used to locate the
    # app pod and copy over its spec into the k8s cron jobs.
    namespace: typing.Text = ...
    hostname: typing.Text = ...
    @property
    def cron_jobs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CronJob]: ...
    def __init__(self,
        *,
        namespace : typing.Text = ...,
        hostname : typing.Text = ...,
        cron_jobs : typing.Optional[typing.Iterable[global___CronJob]] = ...,
        ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"cron_jobs",b"cron_jobs",u"hostname",b"hostname",u"namespace",b"namespace"]) -> None: ...
global___RegisterAppRequest = RegisterAppRequest

class RegisterAppResponse(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    def __init__(self,
        ) -> None: ...
global___RegisterAppResponse = RegisterAppResponse

class WaitForResultRequest(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    TASK_ID_FIELD_NUMBER: builtins.int
    task_id: typing.Text = ...
    def __init__(self,
        *,
        task_id : typing.Text = ...,
        ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"task_id",b"task_id"]) -> None: ...
global___WaitForResultRequest = WaitForResultRequest

class WaitForResultResponse(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    RESULT_FIELD_NUMBER: builtins.int
    @property
    def result(self) -> global___Result: ...
    def __init__(self,
        *,
        result : typing.Optional[global___Result] = ...,
        ) -> None: ...
    def HasField(self, field_name: typing_extensions.Literal[u"result",b"result"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"result",b"result"]) -> None: ...
global___WaitForResultResponse = WaitForResultResponse

class CronJob(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    QUALIFIED_SYMBOL_FIELD_NUMBER: builtins.int
    TARGET_TIME_FIELD_NUMBER: builtins.int
    TARGET_DAY_OF_WEEK_FIELD_NUMBER: builtins.int
    UNIT_FIELD_NUMBER: builtins.int
    INTERVAL_FIELD_NUMBER: builtins.int
    # Fully-qualified name of the function to run. Cannot be empty.
    qualified_symbol: typing.Text = ...
    # Timing information

    # Target time, e.g. 10:22:00 - k8s cronjobs does not support seconds
    # Schedule uses a datetime.time without any timezone. So we should default
    # to UTC and maybe in the future modify schedule to include timezone.
    # We convert it by using datetime.time.isoformat()
    target_time: typing.Text = ...
    target_day_of_week: global___DayOfWeek.V = ...
    unit: global___Unit.V = ...
    # e.g. 10 [unit = minutes] means every 10 minutes
    interval: builtins.int = ...
    def __init__(self,
        *,
        qualified_symbol : typing.Text = ...,
        target_time : typing.Text = ...,
        target_day_of_week : global___DayOfWeek.V = ...,
        unit : global___Unit.V = ...,
        interval : builtins.int = ...,
        ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"interval",b"interval",u"qualified_symbol",b"qualified_symbol",u"target_day_of_week",b"target_day_of_week",u"target_time",b"target_time",u"unit",b"unit"]) -> None: ...
global___CronJob = CronJob

class GetTaskRequest(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    TASK_ID_FIELD_NUMBER: builtins.int
    task_id: typing.Text = ...
    def __init__(self,
        *,
        task_id : typing.Text = ...,
        ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"task_id",b"task_id"]) -> None: ...
global___GetTaskRequest = GetTaskRequest

class GetTaskResponse(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    ID_FIELD_NUMBER: builtins.int
    ENCODED_ARGS_FIELD_NUMBER: builtins.int
    id: typing.Text = ...
    encoded_args: builtins.bytes = ...
    def __init__(self,
        *,
        id : typing.Text = ...,
        encoded_args : builtins.bytes = ...,
        ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"encoded_args",b"encoded_args",u"id",b"id"]) -> None: ...
global___GetTaskResponse = GetTaskResponse
