| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- # Generated from google/rpc/status.proto. DO NOT EDIT.
- # Generated by protoc-gen-py v0.1.1 with parameter "".
- # ruff: noqa: PGH004
- # ruff: noqa
- # fmt: off
- from __future__ import annotations
- from typing import Literal, TYPE_CHECKING, TypeAlias
- from protobuf import Message
- from protobuf._codegen import file_desc
- from protobuf.wkt import any_pb
- if TYPE_CHECKING:
- from protobuf import DescFile
- from protobuf.wkt import Any
- _StatusFields: TypeAlias = Literal["code", "message", "details"]
- class Status(Message[_StatusFields]):
- """
- The `Status` type defines a logical error model that is suitable for
- different programming environments, including REST APIs and RPC APIs. It is
- used by [gRPC](https://github.com/grpc). Each `Status` message contains
- three pieces of data: error code, error message, and error details.
- You can find out more about this error model and how to work with it in the
- [API Design Guide](https://cloud.google.com/apis/design/errors).
- ```proto
- message google.rpc.Status
- ```
- Attributes:
- code:
- The status code, which should be an enum value of
- [google.rpc.Code][google.rpc.Code].
- ```proto
- int32 code = 1;
- ```
- message:
- A developer-facing error message, which should be in English. Any
- user-facing error message should be localized and sent in the
- [google.rpc.Status.details][google.rpc.Status.details] field, or localized
- by the client.
- ```proto
- string message = 2;
- ```
- details:
- A list of messages that carry the error details. There is a common set of
- message types for APIs to use.
- ```proto
- repeated google.protobuf.Any details = 3;
- ```
- """
- __slots__ = ("code", "message", "details")
- if TYPE_CHECKING:
- def __init__(
- self,
- *,
- code: int = 0,
- message: str = "",
- details: list[Any] | None = None,
- ) -> None:
- pass
- code: int
- message: str
- details: list[Any]
- _DESC = file_desc(
- b'\n\x17google/rpc/status.proto\x12\ngoogle.rpc\x1a\x19google/protobuf/any.proto"f\n\x06Status\x12\x12\n\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n\x07message\x18\x02 \x01(\tR\x07message\x12.\n\x07details\x18\x03 \x03(\x0b2\x14.google.protobuf.AnyR\x07detailsB^\n\x0ecom.google.rpcB\x0bStatusProtoP\x01Z7google.golang.org/genproto/googleapis/rpc/status;status\xa2\x02\x03RPCb\x06proto3',
- [
- any_pb.desc(),
- ],
- {
- "Status": Status,
- },
- )
- def desc() -> DescFile:
- """Returns the descriptor for the file `google/rpc/status.proto`."""
- return _DESC
|