grpc_classes
drunc.utils.grpc_classes
Classes
DecodedResponse(name, token, flag, data=None, children=None)
Decoded response object.
Warning: This should be kept in sync with druncschema/request_response.proto/Response class
Initialize a DecodedResponse.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the response. |
required |
token
|
Token
|
The token associated with the response. |
required |
flag
|
object
|
The response flag. |
required |
data
|
object | None
|
The response data. Defaults to None. |
None
|
children
|
list[DecodedResponse] | None
|
Child responses. Defaults to None. |
None
|
Source code in drunc/utils/grpc_classes.py
Methods:
__str__()
Return string representation of the DecodedResponse.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The string representation. |
to_string(obj, prefix='')
staticmethod
Convert a DecodedResponse to a string representation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
DecodedResponse
|
The DecodedResponse to convert. |
required |
prefix
|
str
|
A prefix to add to the string. Defaults to empty string. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The string representation of the response. |