"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
Copyright (C) 2024 Bloomberg LP

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 <http://www.apache.org/licenses/LICENSE-2.0>

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import buildgrid._protos.build.bazel.remote.execution.v2.remote_execution_pb2
import builtins
import collections.abc
import buildgrid._protos.google.devtools.remoteworkers.v1test2.bots_pb2
import google.protobuf.descriptor
import google.protobuf.internal.containers
import google.protobuf.message
import google.protobuf.timestamp_pb2
import sys

if sys.version_info >= (3, 8):
    import typing as typing_extensions
else:
    import typing_extensions

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

@typing_extensions.final
class ListWorkersRequest(google.protobuf.message.Message):
    """Request specifying which worker(s) to list"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    INSTANCE_NAME_FIELD_NUMBER: builtins.int
    PAGE_SIZE_FIELD_NUMBER: builtins.int
    PAGE_FIELD_NUMBER: builtins.int
    WORKER_NAME_FIELD_NUMBER: builtins.int
    instance_name: builtins.str
    """The name of the BuildGrid instance to query workers in"""
    page_size: builtins.int
    """The maximum number of workers to return in a single response"""
    page: builtins.int
    """The page number to return when paginating"""
    worker_name: builtins.str
    """A string which is matched against worker names and IDs"""
    def __init__(
        self,
        *,
        instance_name: builtins.str = ...,
        page_size: builtins.int = ...,
        page: builtins.int = ...,
        worker_name: builtins.str = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["instance_name", b"instance_name", "page", b"page", "page_size", b"page_size", "worker_name", b"worker_name"]) -> None: ...

global___ListWorkersRequest = ListWorkersRequest

@typing_extensions.final
class WorkerOperation(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    OPERATION_NAME_FIELD_NUMBER: builtins.int
    operation_name: builtins.str
    """The name of an operation being addressed by a worker"""
    def __init__(
        self,
        *,
        operation_name: builtins.str = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["operation_name", b"operation_name"]) -> None: ...

global___WorkerOperation = WorkerOperation

@typing_extensions.final
class RegisteredWorker(google.protobuf.message.Message):
    """A Worker message defines the internal tracked state for a bot connected
    via the Remote Workers API.
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    SESSION_NAME_FIELD_NUMBER: builtins.int
    WORKER_NAME_FIELD_NUMBER: builtins.int
    LAST_UPDATED_FIELD_NUMBER: builtins.int
    BOT_STATUS_FIELD_NUMBER: builtins.int
    EXPIRY_TIME_FIELD_NUMBER: builtins.int
    OPERATIONS_FIELD_NUMBER: builtins.int
    ACTION_DIGEST_FIELD_NUMBER: builtins.int
    session_name: builtins.str
    """The name of the worker's BotSession, generated by BuildGrid when the
    worker's session starts
    """
    worker_name: builtins.str
    """The ID of the worker's BotSession, specified by the worker client. This
    should be the is the same worker name that ends up in the
    ExecuteOperationMetadata
    """
    @property
    def last_updated(self) -> google.protobuf.timestamp_pb2.Timestamp:
        """The time at which the worker last connected to BuildGrid"""
    bot_status: buildgrid._protos.google.devtools.remoteworkers.v1test2.bots_pb2.BotStatus.ValueType
    """The status of the worker when it last communicated"""
    @property
    def expiry_time(self) -> google.protobuf.timestamp_pb2.Timestamp:
        """The time at which this worker will expire and any assigned work be retried"""
    @property
    def operations(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___WorkerOperation]:
        """The list of operations assigned to this worker"""
    @property
    def action_digest(self) -> buildgrid._protos.build.bazel.remote.execution.v2.remote_execution_pb2.Digest:
        """The Action Digest for the assigned job, if any"""
    def __init__(
        self,
        *,
        session_name: builtins.str = ...,
        worker_name: builtins.str = ...,
        last_updated: google.protobuf.timestamp_pb2.Timestamp | None = ...,
        bot_status: buildgrid._protos.google.devtools.remoteworkers.v1test2.bots_pb2.BotStatus.ValueType = ...,
        expiry_time: google.protobuf.timestamp_pb2.Timestamp | None = ...,
        operations: collections.abc.Iterable[global___WorkerOperation] | None = ...,
        action_digest: buildgrid._protos.build.bazel.remote.execution.v2.remote_execution_pb2.Digest | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing_extensions.Literal["action_digest", b"action_digest", "expiry_time", b"expiry_time", "last_updated", b"last_updated"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing_extensions.Literal["action_digest", b"action_digest", "bot_status", b"bot_status", "expiry_time", b"expiry_time", "last_updated", b"last_updated", "operations", b"operations", "session_name", b"session_name", "worker_name", b"worker_name"]) -> None: ...

global___RegisteredWorker = RegisteredWorker

@typing_extensions.final
class ListWorkersResponse(google.protobuf.message.Message):
    """Response to a ListWorkers request, containing the matching list of Workers"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    PAGE_FIELD_NUMBER: builtins.int
    PAGE_SIZE_FIELD_NUMBER: builtins.int
    TOTAL_FIELD_NUMBER: builtins.int
    WORKERS_FIELD_NUMBER: builtins.int
    page: builtins.int
    """The page number this response contains when using the specified page_size"""
    page_size: builtins.int
    """The requested page size"""
    total: builtins.int
    """The total number of workers which matched the requested `worker_name`"""
    @property
    def workers(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___RegisteredWorker]:
        """A list of Workers which match the requested `worker_name`"""
    def __init__(
        self,
        *,
        page: builtins.int = ...,
        page_size: builtins.int = ...,
        total: builtins.int = ...,
        workers: collections.abc.Iterable[global___RegisteredWorker] | None = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["page", b"page", "page_size", b"page_size", "total", b"total", "workers", b"workers"]) -> None: ...

global___ListWorkersResponse = ListWorkersResponse

@typing_extensions.final
class GetOperationFiltersRequest(google.protobuf.message.Message):
    """Request specifying an instance to get OperationFilters for"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    INSTANCE_NAME_FIELD_NUMBER: builtins.int
    instance_name: builtins.str
    """The name of the BuildGrid instance to get OperationFilters for"""
    def __init__(
        self,
        *,
        instance_name: builtins.str = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["instance_name", b"instance_name"]) -> None: ...

global___GetOperationFiltersRequest = GetOperationFiltersRequest

@typing_extensions.final
class OperationFilter(google.protobuf.message.Message):
    """Specification for a key to filter Operations by in ListOperations requests

    The filters are in the form `KEY COMPARATOR VALUE`, where the value may or
    may not come from the `values` field of this message. The other fields are
    metadata to help describe the format of the filter.
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    KEY_FIELD_NUMBER: builtins.int
    NAME_FIELD_NUMBER: builtins.int
    TYPE_FIELD_NUMBER: builtins.int
    DESCRIPTION_FIELD_NUMBER: builtins.int
    COMPARATORS_FIELD_NUMBER: builtins.int
    VALUES_FIELD_NUMBER: builtins.int
    key: builtins.str
    """The filter key, used in the ListOperations filter string"""
    name: builtins.str
    """The filter name, used just for readability"""
    type: builtins.str
    """The type of values this filter accepts; either `text` or `datetime`"""
    description: builtins.str
    """Description of this filter key"""
    @property
    def comparators(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """List of valid comparators/operators to use with this filter key"""
    @property
    def values(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """Optional list of values that are valid for this filter. If empty, the
        filter is assumed to accept any values of the specified type.
        """
    def __init__(
        self,
        *,
        key: builtins.str = ...,
        name: builtins.str = ...,
        type: builtins.str = ...,
        description: builtins.str = ...,
        comparators: collections.abc.Iterable[builtins.str] | None = ...,
        values: collections.abc.Iterable[builtins.str] | None = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["comparators", b"comparators", "description", b"description", "key", b"key", "name", b"name", "type", b"type", "values", b"values"]) -> None: ...

global___OperationFilter = OperationFilter

@typing_extensions.final
class OperationFilters(google.protobuf.message.Message):
    """Response containing a list of OperationFilter specs"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    FILTERS_FIELD_NUMBER: builtins.int
    @property
    def filters(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___OperationFilter]:
        """A list of OperationFilter messages describing all available filter keys for
        ListOperations on the requested instance
        """
    def __init__(
        self,
        *,
        filters: collections.abc.Iterable[global___OperationFilter] | None = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["filters", b"filters"]) -> None: ...

global___OperationFilters = OperationFilters
