Status

Status Class

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

This class represents the status of an operation. It contains the status code and the message.

__init__(status: <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f93e240b3a0>, message: str)[source]

Construct a new Status object with the specified status code and message.

Parameters:
  • status (StatusCode) – the returnd code of the operation.

  • message (str) – the message returned by the operation.

static from_exception(exception: ApiException)[source]

Create a Status object from an ApiException.

static from_response(response: ApiResponse)[source]

Create a Status object from an ApiResponse.

get_code()[source]

Get the status code returned by the operation.

property get_message

Get the message returned by the operation.

is_error() bool[source]

Whether the operation is failed.

is_ok() bool[source]

Whether the operation is successful.

static ok()[source]

Create a successful status object.

static server_internal_error(message: str)[source]

Create a server internal error object with the specified message.