状态

状态类

class gs_interactive.client.status.Status(status: <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f43155afaf0>, message: str)[源代码]

该类表示操作的状态,包含状态码和消息。

__init__(status: <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f43155afaf0>, message: str)[源代码]

使用指定的状态码和消息构造一个新的Status对象。

Parameters:
  • status (StatusCode) – 操作返回的状态码。

  • message (str) – 操作返回的消息。

static from_exception(exception: ApiException)[源代码]

从ApiException创建一个Status对象。

static from_response(response: ApiResponse)[源代码]

从ApiResponse创建一个Status对象。

get_code()[源代码]

获取操作返回的状态码。

property get_message

获取操作返回的消息。

is_error() bool[源代码]

操作是否失败。

is_ok() bool[源代码]

操作是否成功。

static ok()[源代码]

创建一个成功的状态对象。

static server_internal_error(message: str)[源代码]

使用指定消息创建一个服务器内部错误对象。