django_socio_grpc.protobuf.message_name_constructor
Module Contents
Classes
API
- class django_socio_grpc.protobuf.message_name_constructor.MessageNameConstructor
Bases:
abc.ABC- action_request: str | type[rest_framework.serializers.BaseSerializer] | list[django_socio_grpc.protobuf.proto_classes.FieldDict] | None
None
- action_response: str | type[rest_framework.serializers.BaseSerializer] | list[django_socio_grpc.protobuf.proto_classes.FieldDict] | None
None
- __post_init__()
- classmethod get_base_name_from_serializer(serializer: type[rest_framework.serializers.BaseSerializer]) str
Get the name that will be displayed for the message in a .proto file for a specific Serializer. It is the name of the serializer class without “ProtoSerializer” or “Serializer” at the end if any.
- classmethod get_base_name_from_serializer_with_suffix(serializer: type[rest_framework.serializers.BaseSerializer], suffix: str = '') str
Add the correct suffix (“REQUEST”, “RESPONSE”, “”) to the name from the serializer (see get_base_name_from_serializer)
- abstract construct_request_list_name()
Inherit from this method to get the name of the request list message as displayed in the proto file
- abstract construct_response_list_name()
Inherit from this method to get the name of the response list message as displayed in the proto file
- class django_socio_grpc.protobuf.message_name_constructor.DefaultMessageNameConstructor
Bases:
django_socio_grpc.protobuf.message_name_constructor.MessageNameConstructor- __post_init__()
- construct_name(is_request: bool = True, before_suffix: str = '')
Construct the ProtoMessage name from the message and potentialy the name the user specified
- construct_request_list_name()
Get the name of the request list message as displayed in the proto file
- construct_response_list_name()
Get the name of the response list message as displayed in the proto file