Skip to content

Protobuf Definitions

Read more about the protobuf definitions here.

proto ¤

Helper functions for the gRPC+protobuf protocol. For more information, see: https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md

Modules:

Name Description
headers

Classes:

Name Description
SupportsToProto
GrpcError

When an application or runtime error occurs during an RPC a

ProtoParseError

Functions:

Name Description
to_proto
encode_message

Encode to a length-prefixed message.

parse_data

Decode a DATA frame (optionally, with Trailers) into a protobuf message.

Attributes:

Name Type Description
T_co
T
ProtoError

T_co module-attribute ¤

T_co = TypeVar('T_co', bound=Message, covariant=True)

T module-attribute ¤

T = TypeVar('T', bound=Message)

ProtoError module-attribute ¤

SupportsToProto ¤

Bases: Protocol[T_co]

Methods:

Name Description
to_proto

Converts the object into a protobuf message.

to_proto ¤

to_proto() -> T_co

Converts the object into a protobuf message.

GrpcError ¤

GrpcError(
    message: str,
    raw_data: bytes | None = None,
    *,
    status: int | None = None,
    status_message: bytes | None = None,
    status_details: bytes | None = None,
)

Bases: Exception

When an application or runtime error occurs during an RPC a Status and Status-Message are delivered in Trailers.

Methods:

Name Description
from_trailers

Attributes:

Name Type Description
raw_data

Length-prefixed message

status

1*DIGIT ; 0-9

status_message

Percent-Encoded

status_details

google.rpc.Status proto message

raw_data instance-attribute ¤

raw_data = raw_data

Length-prefixed message

status instance-attribute ¤

status = status

1*DIGIT ; 0-9

status_message instance-attribute ¤

status_message = status_message

Percent-Encoded

status_details instance-attribute ¤

status_details = status_details

google.rpc.Status proto message

from_trailers classmethod ¤

from_trailers(data: bytes) -> GrpcError

ProtoParseError ¤

ProtoParseError(
    message: str, raw_data: bytes | None = None
)

Bases: Exception

Attributes:

Name Type Description
raw_data

raw_data instance-attribute ¤

raw_data = raw_data

to_proto ¤

to_proto(message_like: SupportsToProto[T] | T) -> T

encode_message ¤

encode_message(msg: T) -> bytes

Encode to a length-prefixed message.

parse_data ¤

parse_data(
    data: bytes, msg_type: Type[T]
) -> Result[T, ProtoError]

Decode a DATA frame (optionally, with Trailers) into a protobuf message.

headers ¤

Functions:

Name Description
get_headers

Attributes:

Name Type Description
PLATFORM_VERSION
DEFAULT_HEADERS_GRPC

PLATFORM_VERSION module-attribute ¤

PLATFORM_VERSION = '25.062.1136'

DEFAULT_HEADERS_GRPC module-attribute ¤

DEFAULT_HEADERS_GRPC = {
    None: DEFAULT_HEADERS,
    "Accept": "*/*",
    "fr24-device-id": "web-000000000-000000000000000000000",
    "fr24-platform": f"web-{PLATFORM_VERSION}",
    "x-envoy-retry-grpc-on": "unavailable",
    "Content-Type": "application/grpc-web+proto",
    "X-User-Agent": "grpc-web-javascript/0.1",
    "X-Grpc-Web": "1",
    "DNT": "1",
}

get_headers ¤

get_headers(
    auth: Authentication | None,
    *,
    device_id: None | str = None,
) -> dict[str, str]

v1_pb2 ¤

Generated protocol buffer code.