|
3 | 3 | import typing |
4 | 4 |
|
5 | 5 | import pydantic |
6 | | -import typing_extensions |
7 | 6 | from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel |
8 | | -from ..core.serialization import FieldMetadata |
| 7 | +from .google_protobuf_any import GoogleProtobufAny |
9 | 8 |
|
10 | 9 |
|
11 | 10 | class Status(UniversalBaseModel): |
12 | 11 | """ |
13 | | - Contains status of entities. |
| 12 | + 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). |
14 | 13 | """ |
15 | 14 |
|
16 | | - platform_activity: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="platformActivity")] = ( |
17 | | - pydantic.Field(default=None) |
18 | | - ) |
| 15 | + code: typing.Optional[int] = pydantic.Field(default=None) |
19 | 16 | """ |
20 | | - A string that describes the activity that the entity is performing. |
21 | | - Examples include "RECONNAISSANCE", "INTERDICTION", "RETURN TO BASE (RTB)", "PREPARING FOR LAUNCH". |
| 17 | + The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. |
22 | 18 | """ |
23 | 19 |
|
24 | | - role: typing.Optional[str] = pydantic.Field(default=None) |
| 20 | + message: typing.Optional[str] = pydantic.Field(default=None) |
25 | 21 | """ |
26 | | - A human-readable string that describes the role the entity is currently performing. E.g. "Team Member", "Commander". |
| 22 | + 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. |
| 23 | + """ |
| 24 | + |
| 25 | + details: typing.Optional[typing.List[GoogleProtobufAny]] = pydantic.Field(default=None) |
| 26 | + """ |
| 27 | + A list of messages that carry the error details. There is a common set of message types for APIs to use. |
27 | 28 | """ |
28 | 29 |
|
29 | 30 | if IS_PYDANTIC_V2: |
|
0 commit comments