module documentation

Runtime wrappers for protobuf messages, maps, and repeated fields.

Class Map Wrapper for protobuf map fields with optional wrapping.
Class Message Base wrapper for protobuf message instances.
Class OneOf Marker base for oneof wrappers.
Class Repeated Wrapper for protobuf repeated fields.
Exception OneOfMatchError Raised when a oneof field name is unexpected.
Function has_method Return True if obj exposes a callable attribute named method.
Function repr_field Render a field value in a human-readable, multi-line form.
Function simple_wrapper Make a type wrapper for gRPC calls that ignores the first two arguments.
Function unwrap_type Unwrap SDK message wrappers into protobuf-native values.
Function wrap_type Wrap a value into an SDK message wrapper, if a wrapper is provided.
Type Variable CollectibleInner Type placeholder for values on the ProtoBuf side.
Type Variable CollectibleOuter Type placeholder for values on the SDK side.
Type Variable MapKey Type placeholder for map keys.
Type Variable R Return type placeholder for generic wrappers
Type Variable T Type placeholder for generic wrappers
Type Alias MaskFunction Function type that builds a reset mask for a field value.
Variable credentials_sanitizer Credentials TokenSanitizer singleton instance for sanitizing credential fields.
def has_method(obj: Any, method: str) -> bool: (source)

Return True if obj exposes a callable attribute named method.

Parameters
obj:AnyObject to inspect.
method:strMethod name to check.
Returns
boolTrue if the method exists and is callable.
def repr_field(key: str, attr: Any, indent: str = '') -> str: (source)

Render a field value in a human-readable, multi-line form.

Parameters
key:strField name.
attr:AnyField value.
indent:strIndentation prefix.
Returns
strFormatted string for inclusion in __repr__ output.
def simple_wrapper(wrap: Callable[[T], R]) -> Callable[[str, ClientChannelInterface, T], R]: (source)

Make a type wrapper for gRPC calls that ignores the first two arguments.

Parameters
wrap:Callable[[T], R]Callable applied to the third argument.
Returns
Callable[[str, ClientChannelInterface, T], R]Wrapper that ignores the first two arguments.
def unwrap_type(obj: Any, unwrap: Callable[[Any], Any] | None = None) -> Any: (source)

Unwrap SDK message wrappers into protobuf-native values.

Parameters
obj:AnyValue to unwrap.
unwrap:Callable[[Any], Any] | NoneOptional unwrapping function for leaf values.
Returns
AnyUnwrapped value suitable for protobuf assignment.
def wrap_type(obj: T, wrap: Callable[[T], R] | None = None) -> R | T: (source)

Wrap a value into an SDK message wrapper, if a wrapper is provided.

Parameters
obj:TValue to wrap.
wrap:Callable[[T], R] | NoneOptional wrapper function.
Returns
R | TWrapped value or the original object.
CollectibleInner = (source)

Type placeholder for values on the ProtoBuf side.

Value
TypeVar('CollectibleInner', int, str, float, bytes, bool, PMessage)
CollectibleOuter = (source)

Type placeholder for values on the SDK side.

Value
TypeVar('CollectibleOuter', int, str, float, bytes, bool, Enum, Message, PMessage
)

Type placeholder for map keys.

Value
TypeVar('MapKey', int, str, bool)

Return type placeholder for generic wrappers

Value
TypeVar('R')

Type placeholder for generic wrappers

Value
TypeVar('T')
MaskFunction = (source)

Function type that builds a reset mask for a field value.

Value
Callable[[Any], Mask]
credentials_sanitizer = (source)

Credentials TokenSanitizer singleton instance for sanitizing credential fields.