diff --git a/django_socio_grpc/mixins.py b/django_socio_grpc/mixins.py index 19e408f9..99ea74e7 100644 --- a/django_socio_grpc/mixins.py +++ b/django_socio_grpc/mixins.py @@ -17,9 +17,8 @@ StrTemplatePlaceholder, ) from .grpc_actions.utils import get_serializer_base_name -from .protobuf.json_format import message_to_dict from .settings import grpc_settings -from .utils.constants import DEFAULT_LIST_FIELD_NAME, REQUEST_SUFFIX +from .utils.constants import DEFAULT_LIST_FIELD_NAME, PARTIAL_UPDATE_FIELD_NAME, REQUEST_SUFFIX ############################################################ @@ -253,9 +252,23 @@ def get_default_message(model_name, fields="__all__"): def _get_partial_update_request(service): serializer_class = service.get_serializer_class() - class PartialUpdateRequest(serializer_class): + class PartialUpdateMetaClass(serializers.SerializerMetaclass): + """ + This metaclass exists so we can set the PARTIAL_UPDATE_FIELD_NAME variable as an attribute name of PartialUpdateRequest. + This can be replaced by just declaring in PartialUpdateRequest: _partial_update_fields = serializers.ListField(child=serializers.CharField()) + but this would not be dynamic if a constant changes or if we want it to be configurable in settings in the future. + This metaclass should inherit from DRF SerializerMetaclass as serializer has it's own metaclass to add _declared_fields attribute + Using PartialUpdateRequest.setattr is not enough as _declared_fields is done in metaclass so all fields should be declared before + """ + def __new__(cls, name, bases, attrs): + attrs[PARTIAL_UPDATE_FIELD_NAME] = serializers.ListField( + child=serializers.CharField() + ) + return super().__new__(cls, name, bases, attrs) + + class PartialUpdateRequest(serializer_class, metaclass=PartialUpdateMetaClass): class Meta(serializer_class.Meta): ... @@ -264,7 +277,7 @@ class Meta(serializer_class.Meta): if (fields := getattr(PartialUpdateRequest.Meta, "fields", None)) and not isinstance( fields, str ): - PartialUpdateRequest.Meta.fields = (*fields, "_partial_update_fields") + PartialUpdateRequest.Meta.fields = (*fields, PARTIAL_UPDATE_FIELD_NAME) return PartialUpdateRequest @@ -281,18 +294,14 @@ def PartialUpdate(self, request, context): """ Partial update a model instance. - Performs a partial update on the given `_partial_update_fields`. + Performs a partial update on the given PARTIAL_UPDATE_FIELD_NAME(`_partial_update_fields`). """ - content = message_to_dict(request) - - data = {k: v for k, v in content.items() if k in request._partial_update_fields} - instance = self.get_object() # INFO - L.G. - 11/07/2022 - We use the data parameter instead of message # because we handle a dict not a grpc message. - serializer = self.get_serializer(instance, data=data, partial=True) + serializer = self.get_serializer(instance, message=request, partial=True) serializer.is_valid(raise_exception=True) self.perform_partial_update(serializer) @@ -483,18 +492,14 @@ async def PartialUpdate(self, request, context): """ Partial update a model instance. - Performs a partial update on the given `_partial_update_fields`. + Performs a partial update on the given PARTIAL_UPDATE_FIELD_NAME(`_partial_update_fields`). """ - content = message_to_dict(request) - - data = {k: v for k, v in content.items() if k in request._partial_update_fields} - instance = await self.aget_object() # INFO - L.G. - 11/07/2022 - We use the data parameter instead of message # because we handle a dict not a grpc message. - serializer = await self.aget_serializer(instance, data=data, partial=True) + serializer = await self.aget_serializer(instance, message=request, partial=True) await sync_to_async(serializer.is_valid)(raise_exception=True) await self.aperform_partial_update(serializer) diff --git a/django_socio_grpc/proto_serializers.py b/django_socio_grpc/proto_serializers.py index 0ae04b8f..5ce04503 100644 --- a/django_socio_grpc/proto_serializers.py +++ b/django_socio_grpc/proto_serializers.py @@ -2,8 +2,10 @@ from asgiref.sync import sync_to_async from django.core.validators import MaxLengthValidator +from django.db.models.fields import NOT_PROVIDED from django.utils.translation import gettext as _ from rest_framework.exceptions import ValidationError +from rest_framework.fields import empty from rest_framework.relations import SlugRelatedField from rest_framework.serializers import ( LIST_SERIALIZER_KWARGS, @@ -17,16 +19,29 @@ from rest_framework.utils.formatting import lazy_format from django_socio_grpc.protobuf.json_format import message_to_dict, parse_dict -from django_socio_grpc.utils.constants import DEFAULT_LIST_FIELD_NAME, LIST_ATTR_MESSAGE_NAME +from django_socio_grpc.utils.constants import ( + DEFAULT_LIST_FIELD_NAME, + LIST_ATTR_MESSAGE_NAME, + PARTIAL_UPDATE_FIELD_NAME, +) LIST_PROTO_SERIALIZER_KWARGS = (*LIST_SERIALIZER_KWARGS, LIST_ATTR_MESSAGE_NAME, "message") +def get_default_value(field_default): + if callable(field_default): + return field_default() + else: + return field_default + + class BaseProtoSerializer(BaseSerializer): def __init__(self, *args, **kwargs): message = kwargs.pop("message", None) self.stream = kwargs.pop("stream", None) self.message_list_attr = kwargs.pop(LIST_ATTR_MESSAGE_NAME, DEFAULT_LIST_FIELD_NAME) + # INFO - AM - 04/01/2023 - Need to manually define partial before the super().__init__ as it's used in populate_dict_with_none_if_not_required that is used in message_to_data that is call before the super init + self.partial = kwargs.get("partial", False) if message is not None: self.initial_message = message kwargs["data"] = self.message_to_data(message) @@ -34,7 +49,86 @@ def __init__(self, *args, **kwargs): def message_to_data(self, message): """Protobuf message -> Dict of python primitive datatypes.""" - return message_to_dict(message) + data_dict = message_to_dict(message) + data_dict = self.populate_dict_with_none_if_not_required(data_dict, message=message) + return data_dict + + def populate_dict_with_none_if_not_required(self, data_dict, message=None): + """ + This method allow to populate the data dictionary with None for optional field that allow_null and not send in the request. + It's also allow to deal with partial update correctly. + This is mandatory for having null value received in request as DRF expect to have None value for field that are required. + We can't rely only on required True/False as in DSG if a field is required it will have the default value of it's type (empty string for string type) and not None + + When refactoring serializer to only use message we will be able to determine the default value of the field depending of the same logic followed here + + set default value for field except if optional or partial update + """ + # INFO - AM - 04/01/2024 - If we are in a partial serializer with a message we need to have the PARTIAL_UPDATE_FIELD_NAME in the data_dict. If not we raise an exception + if self.partial and PARTIAL_UPDATE_FIELD_NAME not in data_dict: + raise ValidationError( + { + PARTIAL_UPDATE_FIELD_NAME: [ + f"Field {PARTIAL_UPDATE_FIELD_NAME} not set in message when using partial=True" + ] + }, + code="missing_partial_message_attribute", + ) + + is_update_process = ( + hasattr(self.Meta, "model") and self.Meta.model._meta.pk.name in data_dict + ) + for field in self.fields.values(): + # INFO - AM - 04/01/2024 - If we are in a partial serializer we only need to have field specified in PARTIAL_UPDATE_FIELD_NAME attribute in the data. Meaning deleting fields that should not be here and not adding None to allow_null field that are not specified + if self.partial and field.field_name not in data_dict.get( + PARTIAL_UPDATE_FIELD_NAME, {} + ): + if field.field_name in data_dict: + del data_dict[field.field_name] + continue + # INFO - AM - 04/01/2024 - if field already existing in the data_dict we do not need to do something else + if field.field_name in data_dict: + continue + + # INFO - AM - 04/01/2024 - if field is not in the data_dict but in PARTIAL_UPDATE_FIELD_NAME we need to set the default value if existing or raise exception to avoid having default grpc value by mistake + if self.partial and field.field_name in data_dict.get( + PARTIAL_UPDATE_FIELD_NAME, {} + ): + if field.allow_null: + data_dict[field.field_name] = None + continue + if field.default not in [None, empty]: + data_dict[field.field_name] = get_default_value(field.default) + continue + + # INFO - AM - 11/03/2024 - Here we set the default value especially for the blank authorized data. We debated about raising a ValidaitonError but prefered this behavior. Can be changed if it create issue with users + data_dict[field.field_name] = message.DESCRIPTOR.fields_by_name[ + field.field_name + ].default_value + + if field.allow_null or (field.default in [None, empty] and field.required is True): + if is_update_process: + data_dict[field.field_name] = None + continue + + if field.default not in [None, empty]: + data_dict[field.field_name] = None + continue + + if ( + hasattr(self, "Meta") + and hasattr(self.Meta, "model") + and hasattr(self.Meta.model, field.field_name) + ): + deferred_attribute = getattr(self.Meta.model, field.field_name) + if deferred_attribute.field.default != NOT_PROVIDED: + data_dict[field.field_name] = get_default_value( + deferred_attribute.field.default + ) + continue + + data_dict[field.field_name] = None + return data_dict def data_to_message(self, data): """Protobuf message <- Dict of python primitive datatypes.""" diff --git a/django_socio_grpc/protobuf/json_format.py b/django_socio_grpc/protobuf/json_format.py index 08120018..535c7714 100644 --- a/django_socio_grpc/protobuf/json_format.py +++ b/django_socio_grpc/protobuf/json_format.py @@ -4,36 +4,16 @@ from google.protobuf.json_format import MessageToDict, ParseDict -def _is_field_optional(field): - """ - Checks if a field is optional. - - Under the hood, Optional fields are OneOf fields with only one field with the name of the OneOf - prefixed with an underscore. - """ - - if not (co := field.containing_oneof): - return False - - return len(co.fields) == 1 and co.name == f"_{field.name}" - - def message_to_dict(message, **kwargs): """ Converts a protobuf message to a dictionary. Uses the default `google.protobuf.json_format.MessageToDict` function. Adds None values for optional fields that are not set. """ - kwargs.setdefault("including_default_value_fields", True) kwargs.setdefault("preserving_proto_field_name", True) - result_dict = MessageToDict(message, **kwargs) - optional_fields = { - field.name: None for field in message.DESCRIPTOR.fields if _is_field_optional(field) - } - - return {**optional_fields, **result_dict} + return MessageToDict(message, **kwargs) def parse_dict(js_dict, message, **kwargs): diff --git a/django_socio_grpc/protobuf/proto_classes.py b/django_socio_grpc/protobuf/proto_classes.py index 7f12ffd7..747f8471 100644 --- a/django_socio_grpc/protobuf/proto_classes.py +++ b/django_socio_grpc/protobuf/proto_classes.py @@ -20,7 +20,7 @@ from django.core.exceptions import FieldDoesNotExist from django.db import models from rest_framework import serializers -from rest_framework.fields import HiddenField +from rest_framework.fields import HiddenField, empty from rest_framework.utils.model_meta import RelationInfo, get_field_info from django_socio_grpc.protobuf.message_name_constructor import MessageNameConstructor @@ -89,7 +89,18 @@ def field_line(self) -> str: @classmethod def _get_cardinality(self, field: serializers.Field): - return FieldCardinality.OPTIONAL if field.allow_null else FieldCardinality.NONE + ProtoGeneratorPrintHelper.print("field.default: ", field.default) + """ + INFO - AM - 04/01/2023 + If field can be null -> optional + if field is not required -> optional. Since DRF 3.0 When using model default, only required is set to False. The model default is not set into the field as just passing None will result in model default. https://github.com/encode/django-rest-framework/issues/2683 + if field.default is set (meaning not None or empty) -> optional + + Not dealing with field.allow_blank now as it doesn't seem to be related to OPTIONAl and more about validation and only exist for charfield + """ + if field.allow_null or not field.required or field.default not in [None, empty]: + return FieldCardinality.OPTIONAL + return FieldCardinality.NONE @classmethod def from_field_dict(cls, field_dict: FieldDict) -> "ProtoField": diff --git a/django_socio_grpc/tests/assets/generated_protobuf_files_old_way.py b/django_socio_grpc/tests/assets/generated_protobuf_files_old_way.py index 7e8bc6a3..045018f7 100644 --- a/django_socio_grpc/tests/assets/generated_protobuf_files_old_way.py +++ b/django_socio_grpc/tests/assets/generated_protobuf_files_old_way.py @@ -141,6 +141,14 @@ rpc Destroy(RecursiveTestModelDestroyRequest) returns (google.protobuf.Empty) {} } +service DefaultValueModelController { + rpc List(DefaultValueModelListRequest) returns (DefaultValueModelListResponse) {} + rpc Create(DefaultValueModel) returns (DefaultValueModel) {} + rpc Retrieve(DefaultValueModelRetrieveRequest) returns (DefaultValueModel) {} + rpc Update(DefaultValueModel) returns (DefaultValueModel) {} + rpc Destroy(DefaultValueModelDestroyRequest) returns (google.protobuf.Empty) {} +} + message UnitTestModel { int32 id = 1; string title = 2; @@ -278,6 +286,44 @@ string uuid = 1; } +message DefaultValueModel { + string id = 1; + string string_required = 2; + string string_blank = 3; + string string_nullable = 4; + string string_default = 5; + string string_default_and_blank = 6; + string string_null_default_and_blank = 7; + string string_required_but_serializer_default = 8; + string string_default_but_serializer_default = 9; + string string_nullable_default_but_serializer_default = 10; + int32 int_required = 11; + int32 int_nullable = 12; + int32 int_default = 13; + int32 int_required_but_serializer_default = 14; + bool boolean_required = 15; + bool boolean_nullable = 16; + bool boolean_default_false = 17; + bool boolean_default_true = 18; + bool boolean_required_but_serializer_default = 19; +} + +message DefaultValueModelListRequest { +} + +message DefaultValueModelListResponse { + repeated DefaultValueModel results = 1; + int32 count = 2; +} + +message DefaultValueModelRetrieveRequest { + string id = 1; +} + +message DefaultValueModelDestroyRequest { + string id = 1; +} + """ CUSTOM_APP_MODEL_GENERATED = """syntax = "proto3"; diff --git a/django_socio_grpc/tests/fakeapp/grpc/fakeapp.proto b/django_socio_grpc/tests/fakeapp/grpc/fakeapp.proto index 4b8e9896..52c137d0 100644 --- a/django_socio_grpc/tests/fakeapp/grpc/fakeapp.proto +++ b/django_socio_grpc/tests/fakeapp/grpc/fakeapp.proto @@ -20,6 +20,15 @@ service BasicController { rpc TestEmptyMethod(google.protobuf.Empty) returns (google.protobuf.Empty) {} } +service DefaultValueController { + rpc Create(DefaultValueRequest) returns (DefaultValueResponse) {} + rpc Destroy(DefaultValueDestroyRequest) returns (google.protobuf.Empty) {} + rpc List(DefaultValueListRequest) returns (DefaultValueListResponse) {} + rpc PartialUpdate(DefaultValuePartialUpdateRequest) returns (DefaultValueResponse) {} + rpc Retrieve(DefaultValueRetrieveRequest) returns (DefaultValueResponse) {} + rpc Update(DefaultValueRequest) returns (DefaultValueResponse) {} +} + service ExceptionController { rpc APIException(google.protobuf.Empty) returns (google.protobuf.Empty) {} rpc GRPCException(google.protobuf.Empty) returns (google.protobuf.Empty) {} @@ -184,13 +193,13 @@ message BasicProtoListChildListResponse { } message BasicProtoListChildRequest { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } message BasicProtoListChildResponse { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } @@ -241,11 +250,94 @@ message CustomNameForResponse { // Test comment for whole message message CustomRetrieveResponseSpecialFieldsModelResponse { - string uuid = 1; - int32 default_method_field = 2; + optional string uuid = 1; + optional int32 default_method_field = 2; repeated google.protobuf.Struct custom_method_field = 3; } +message DefaultValueDestroyRequest { + int32 id = 1; +} + +message DefaultValueListRequest { +} + +message DefaultValueListResponse { + repeated DefaultValueResponse results = 1; + int32 count = 2; +} + +message DefaultValuePartialUpdateRequest { + optional int32 id = 1; + optional string string_required_but_serializer_default = 2; + optional int32 int_required_but_serializer_default = 3; + optional bool boolean_required_but_serializer_default = 4; + optional string string_default_but_serializer_default = 5; + optional string string_nullable_default_but_serializer_default = 6; + repeated string _partial_update_fields = 7; + string string_required = 8; + optional string string_blank = 9; + optional string string_nullable = 10; + optional string string_default = 11; + optional string string_default_and_blank = 12; + optional string string_null_default_and_blank = 13; + int32 int_required = 14; + optional int32 int_nullable = 15; + optional int32 int_default = 16; + bool boolean_required = 17; + optional bool boolean_nullable = 18; + optional bool boolean_default_false = 19; + optional bool boolean_default_true = 20; +} + +message DefaultValueRequest { + optional int32 id = 1; + optional string string_required_but_serializer_default = 2; + optional int32 int_required_but_serializer_default = 3; + optional bool boolean_required_but_serializer_default = 4; + optional string string_default_but_serializer_default = 5; + optional string string_nullable_default_but_serializer_default = 6; + string string_required = 7; + optional string string_blank = 8; + optional string string_nullable = 9; + optional string string_default = 10; + optional string string_default_and_blank = 11; + optional string string_null_default_and_blank = 12; + int32 int_required = 13; + optional int32 int_nullable = 14; + optional int32 int_default = 15; + bool boolean_required = 16; + optional bool boolean_nullable = 17; + optional bool boolean_default_false = 18; + optional bool boolean_default_true = 19; +} + +message DefaultValueResponse { + optional int32 id = 1; + optional string string_required_but_serializer_default = 2; + optional int32 int_required_but_serializer_default = 3; + optional bool boolean_required_but_serializer_default = 4; + optional string string_default_but_serializer_default = 5; + optional string string_nullable_default_but_serializer_default = 6; + string string_required = 7; + optional string string_blank = 8; + optional string string_nullable = 9; + optional string string_default = 10; + optional string string_default_and_blank = 11; + optional string string_null_default_and_blank = 12; + int32 int_required = 13; + optional int32 int_nullable = 14; + optional int32 int_default = 15; + bool boolean_required = 16; + optional bool boolean_nullable = 17; + optional bool boolean_default_false = 18; + optional bool boolean_default_true = 19; +} + +message DefaultValueRetrieveRequest { + int32 id = 1; +} + message ExceptionStreamRaiseExceptionResponse { string id = 1; } @@ -259,13 +351,13 @@ message ForeignModelListResponse { } message ForeignModelResponse { - string uuid = 1; + optional string uuid = 1; string name = 2; } message ForeignModelRetrieveCustomResponse { string name = 1; - string custom = 2; + optional string custom = 2; } message ForeignModelRetrieveCustomRetrieveRequest { @@ -273,23 +365,23 @@ message ForeignModelRetrieveCustomRetrieveRequest { } message ImportStructEvenInArrayModelRequest { - string uuid = 1; + optional string uuid = 1; repeated google.protobuf.Struct this_is_crazy = 2; } message ImportStructEvenInArrayModelResponse { - string uuid = 1; + optional string uuid = 1; repeated google.protobuf.Struct this_is_crazy = 2; } message ManyManyModelRequest { - string uuid = 1; + optional string uuid = 1; string name = 2; string test_write_only_on_nested = 3; } message ManyManyModelResponse { - string uuid = 1; + optional string uuid = 1; string name = 2; } @@ -306,21 +398,21 @@ message RecursiveTestModelListResponse { } message RecursiveTestModelPartialUpdateRequest { - string uuid = 1; + optional string uuid = 1; repeated string _partial_update_fields = 2; - RecursiveTestModelRequest parent = 3; + optional RecursiveTestModelRequest parent = 3; repeated RecursiveTestModelRequest children = 4; } message RecursiveTestModelRequest { - string uuid = 1; - RecursiveTestModelRequest parent = 2; + optional string uuid = 1; + optional RecursiveTestModelRequest parent = 2; repeated RecursiveTestModelRequest children = 3; } message RecursiveTestModelResponse { - string uuid = 1; - RecursiveTestModelResponse parent = 2; + optional string uuid = 1; + optional RecursiveTestModelResponse parent = 2; repeated RecursiveTestModelResponse children = 3; } @@ -341,7 +433,7 @@ message RelatedFieldModelListResponse { } message RelatedFieldModelPartialUpdateRequest { - string uuid = 1; + optional string uuid = 1; repeated ManyManyModelRequest many_many = 2; string custom_field_name = 3; repeated string _partial_update_fields = 4; @@ -349,20 +441,20 @@ message RelatedFieldModelPartialUpdateRequest { } message RelatedFieldModelRequest { - string uuid = 1; + optional string uuid = 1; repeated ManyManyModelRequest many_many = 2; string custom_field_name = 3; repeated string many_many_foreigns = 4; } message RelatedFieldModelResponse { - string uuid = 1; - ForeignModelResponse foreign = 2; + optional string uuid = 1; + optional ForeignModelResponse foreign = 2; repeated ManyManyModelResponse many_many = 3; - int32 slug_test_model = 4; + optional int32 slug_test_model = 4; repeated bool slug_reverse_test_model = 5; repeated string slug_many_many = 6; - string proto_slug_related_field = 7; + optional string proto_slug_related_field = 7; string custom_field_name = 8; repeated string many_many_foreigns = 9; } @@ -384,7 +476,7 @@ message SimpleRelatedFieldModelListResponse { } message SimpleRelatedFieldModelPartialUpdateRequest { - string uuid = 1; + optional string uuid = 1; repeated string _partial_update_fields = 2; optional string foreign = 3; optional string slug_test_model = 4; @@ -394,7 +486,7 @@ message SimpleRelatedFieldModelPartialUpdateRequest { } message SimpleRelatedFieldModelRequest { - string uuid = 1; + optional string uuid = 1; optional string foreign = 2; optional string slug_test_model = 3; repeated string many_many = 4; @@ -403,7 +495,7 @@ message SimpleRelatedFieldModelRequest { } message SimpleRelatedFieldModelResponse { - string uuid = 1; + optional string uuid = 1; optional string foreign = 2; optional string slug_test_model = 3; repeated string many_many = 4; @@ -430,27 +522,27 @@ message SpecialFieldsModelListResponse { // Special Fields Model // with two lines comment message SpecialFieldsModelPartialUpdateRequest { - string uuid = 1; + optional string uuid = 1; repeated string _partial_update_fields = 2; - google.protobuf.Struct meta_datas = 3; + optional google.protobuf.Struct meta_datas = 3; repeated int32 list_datas = 4; } // Special Fields Model // with two lines comment message SpecialFieldsModelRequest { - string uuid = 1; - google.protobuf.Struct meta_datas = 2; + optional string uuid = 1; + optional google.protobuf.Struct meta_datas = 2; repeated int32 list_datas = 3; } // Special Fields Model // with two lines comment message SpecialFieldsModelResponse { - string uuid = 1; - google.protobuf.Struct meta_datas = 2; + optional string uuid = 1; + optional google.protobuf.Struct meta_datas = 2; repeated int32 list_datas = 3; - bytes binary = 4; + optional bytes binary = 4; } message SpecialFieldsModelRetrieveRequest { @@ -505,20 +597,20 @@ message UnitTestModelListWithExtraArgsRequest { } message UnitTestModelPartialUpdateRequest { - int32 id = 1; - string title = 2; - optional string text = 3; - repeated string _partial_update_fields = 4; + optional int32 id = 1; + repeated string _partial_update_fields = 2; + string title = 3; + optional string text = 4; } message UnitTestModelRequest { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } message UnitTestModelResponse { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } @@ -550,20 +642,20 @@ message UnitTestModelWithStructFilterListResponse { } message UnitTestModelWithStructFilterPartialUpdateRequest { - int32 id = 1; - string title = 2; - optional string text = 3; - repeated string _partial_update_fields = 4; + optional int32 id = 1; + repeated string _partial_update_fields = 2; + string title = 3; + optional string text = 4; } message UnitTestModelWithStructFilterRequest { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } message UnitTestModelWithStructFilterResponse { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } diff --git a/django_socio_grpc/tests/fakeapp/grpc/fakeapp_pb2.py b/django_socio_grpc/tests/fakeapp/grpc/fakeapp_pb2.py index 83e3d059..787fc967 100644 --- a/django_socio_grpc/tests/fakeapp/grpc/fakeapp_pb2.py +++ b/django_socio_grpc/tests/fakeapp/grpc/fakeapp_pb2.py @@ -16,7 +16,7 @@ from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n2django_socio_grpc/tests/fakeapp/grpc/fakeapp.proto\x12\x11myproject.fakeapp\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1cgoogle/protobuf/struct.proto\"k\n\x1c\x42\x61seProtoExampleListResponse\x12<\n\x07results\x18\x01 \x03(\x0b\x32+.myproject.fakeapp.BaseProtoExampleResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"X\n\x17\x42\x61seProtoExampleRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x1a\n\x12number_of_elements\x18\x02 \x01(\x05\x12\x13\n\x0bis_archived\x18\x03 \x01(\x08\"Y\n\x18\x42\x61seProtoExampleResponse\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x1a\n\x12number_of_elements\x18\x02 \x01(\x05\x12\x13\n\x0bis_archived\x18\x03 \x01(\x08\"1\n\x1c\x42\x61sicFetchDataForUserRequest\x12\x11\n\tuser_name\x18\x01 \x01(\t\"/\n\x1f\x42\x61sicFetchTranslatedKeyResponse\x12\x0c\n\x04text\x18\x01 \x01(\t\"#\n\x14\x42\x61sicListIdsResponse\x12\x0b\n\x03ids\x18\x01 \x03(\x05\"%\n\x15\x42\x61sicListNameResponse\x12\x0c\n\x04name\x18\x01 \x03(\t\"e\n\x19\x42\x61sicMixParamListResponse\x12\x39\n\x07results\x18\x01 \x03(\x0b\x32(.myproject.fakeapp.BasicMixParamResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"*\n\x15\x42\x61sicMixParamResponse\x12\x11\n\tuser_name\x18\x01 \x01(\t\"b\n\'BasicMixParamWithSerializerListResponse\x12(\n\x07results\x18\x01 \x03(\x0b\x32\x17.google.protobuf.Struct\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"y\n#BasicParamWithSerializerListRequest\x12\x43\n\x07results\x18\x01 \x03(\x0b\x32\x32.myproject.fakeapp.BasicParamWithSerializerRequest\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\xbd\x01\n\x1f\x42\x61sicParamWithSerializerRequest\x12\x11\n\tuser_name\x18\x01 \x01(\t\x12*\n\tuser_data\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x15\n\ruser_password\x18\x03 \x01(\t\x12\x15\n\rbytes_example\x18\x04 \x01(\x0c\x12-\n\x0clist_of_dict\x18\x05 \x03(\x0b\x32\x17.google.protobuf.Struct\"o\n\x1e\x42\x61sicProtoListChildListRequest\x12>\n\x07results\x18\x01 \x03(\x0b\x32-.myproject.fakeapp.BasicProtoListChildRequest\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"q\n\x1f\x42\x61sicProtoListChildListResponse\x12?\n\x07results\x18\x01 \x03(\x0b\x32..myproject.fakeapp.BasicProtoListChildResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"S\n\x1a\x42\x61sicProtoListChildRequest\x12\n\n\x02id\x18\x01 \x01(\x05\x12\r\n\x05title\x18\x02 \x01(\t\x12\x11\n\x04text\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x07\n\x05_text\"T\n\x1b\x42\x61sicProtoListChildResponse\x12\n\n\x02id\x18\x01 \x01(\x05\x12\r\n\x05title\x18\x02 \x01(\t\x12\x11\n\x04text\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x07\n\x05_text\"c\n\x18\x42\x61sicServiceListResponse\x12\x38\n\x07results\x18\x01 \x03(\x0b\x32\'.myproject.fakeapp.BasicServiceResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\xb1\x01\n\x13\x42\x61sicServiceRequest\x12\x11\n\tuser_name\x18\x01 \x01(\t\x12*\n\tuser_data\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x15\n\ruser_password\x18\x03 \x01(\t\x12\x15\n\rbytes_example\x18\x04 \x01(\x0c\x12-\n\x0clist_of_dict\x18\x05 \x03(\x0b\x32\x17.google.protobuf.Struct\"\x9b\x01\n\x14\x42\x61sicServiceResponse\x12\x11\n\tuser_name\x18\x01 \x01(\t\x12*\n\tuser_data\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x15\n\rbytes_example\x18\x03 \x01(\x0c\x12-\n\x0clist_of_dict\x18\x04 \x03(\x0b\x32\x17.google.protobuf.Struct\"k\n\x1c\x43ustomMixParamForListRequest\x12<\n\x07results\x18\x01 \x03(\x0b\x32+.myproject.fakeapp.CustomMixParamForRequest\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"-\n\x18\x43ustomMixParamForRequest\x12\x11\n\tuser_name\x18\x01 \x01(\t\")\n\x14\x43ustomNameForRequest\x12\x11\n\tuser_name\x18\x01 \x01(\t\"*\n\x15\x43ustomNameForResponse\x12\x11\n\tuser_name\x18\x01 \x01(\t\"\x94\x01\n0CustomRetrieveResponseSpecialFieldsModelResponse\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x1c\n\x14\x64\x65\x66\x61ult_method_field\x18\x02 \x01(\x05\x12\x34\n\x13\x63ustom_method_field\x18\x03 \x03(\x0b\x32\x17.google.protobuf.Struct\"3\n%ExceptionStreamRaiseExceptionResponse\x12\n\n\x02id\x18\x01 \x01(\t\"\x19\n\x17\x46oreignModelListRequest\"c\n\x18\x46oreignModelListResponse\x12\x38\n\x07results\x18\x01 \x03(\x0b\x32\'.myproject.fakeapp.ForeignModelResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"2\n\x14\x46oreignModelResponse\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\"B\n\"ForeignModelRetrieveCustomResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06\x63ustom\x18\x02 \x01(\t\"9\n)ForeignModelRetrieveCustomRetrieveRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"c\n#ImportStructEvenInArrayModelRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12.\n\rthis_is_crazy\x18\x02 \x03(\x0b\x32\x17.google.protobuf.Struct\"d\n$ImportStructEvenInArrayModelResponse\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12.\n\rthis_is_crazy\x18\x02 \x03(\x0b\x32\x17.google.protobuf.Struct\"U\n\x14ManyManyModelRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12!\n\x19test_write_only_on_nested\x18\x03 \x01(\t\"3\n\x15ManyManyModelResponse\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\"0\n RecursiveTestModelDestroyRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"\x1f\n\x1dRecursiveTestModelListRequest\"o\n\x1eRecursiveTestModelListResponse\x12>\n\x07results\x18\x01 \x03(\x0b\x32-.myproject.fakeapp.RecursiveTestModelResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\xd4\x01\n&RecursiveTestModelPartialUpdateRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x1e\n\x16_partial_update_fields\x18\x02 \x03(\t\x12<\n\x06parent\x18\x03 \x01(\x0b\x32,.myproject.fakeapp.RecursiveTestModelRequest\x12>\n\x08\x63hildren\x18\x04 \x03(\x0b\x32,.myproject.fakeapp.RecursiveTestModelRequest\"\xa7\x01\n\x19RecursiveTestModelRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12<\n\x06parent\x18\x02 \x01(\x0b\x32,.myproject.fakeapp.RecursiveTestModelRequest\x12>\n\x08\x63hildren\x18\x03 \x03(\x0b\x32,.myproject.fakeapp.RecursiveTestModelRequest\"\xaa\x01\n\x1aRecursiveTestModelResponse\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12=\n\x06parent\x18\x02 \x01(\x0b\x32-.myproject.fakeapp.RecursiveTestModelResponse\x12?\n\x08\x63hildren\x18\x03 \x03(\x0b\x32-.myproject.fakeapp.RecursiveTestModelResponse\"1\n!RecursiveTestModelRetrieveRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"/\n\x1fRelatedFieldModelDestroyRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"\x1e\n\x1cRelatedFieldModelListRequest\"|\n\x1dRelatedFieldModelListResponse\x12L\n\x16list_custom_field_name\x18\x01 \x03(\x0b\x32,.myproject.fakeapp.RelatedFieldModelResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\xc8\x01\n%RelatedFieldModelPartialUpdateRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12:\n\tmany_many\x18\x02 \x03(\x0b\x32\'.myproject.fakeapp.ManyManyModelRequest\x12\x19\n\x11\x63ustom_field_name\x18\x03 \x01(\t\x12\x1e\n\x16_partial_update_fields\x18\x04 \x03(\t\x12\x1a\n\x12many_many_foreigns\x18\x05 \x03(\t\"\x9b\x01\n\x18RelatedFieldModelRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12:\n\tmany_many\x18\x02 \x03(\x0b\x32\'.myproject.fakeapp.ManyManyModelRequest\x12\x19\n\x11\x63ustom_field_name\x18\x03 \x01(\t\x12\x1a\n\x12many_many_foreigns\x18\x04 \x03(\t\"\xcb\x02\n\x19RelatedFieldModelResponse\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x38\n\x07\x66oreign\x18\x02 \x01(\x0b\x32\'.myproject.fakeapp.ForeignModelResponse\x12;\n\tmany_many\x18\x03 \x03(\x0b\x32(.myproject.fakeapp.ManyManyModelResponse\x12\x17\n\x0fslug_test_model\x18\x04 \x01(\x05\x12\x1f\n\x17slug_reverse_test_model\x18\x05 \x03(\x08\x12\x16\n\x0eslug_many_many\x18\x06 \x03(\t\x12 \n\x18proto_slug_related_field\x18\x07 \x01(\t\x12\x19\n\x11\x63ustom_field_name\x18\x08 \x01(\t\x12\x1a\n\x12many_many_foreigns\x18\t \x03(\t\"0\n RelatedFieldModelRetrieveRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"5\n%SimpleRelatedFieldModelDestroyRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"$\n\"SimpleRelatedFieldModelListRequest\"y\n#SimpleRelatedFieldModelListResponse\x12\x43\n\x07results\x18\x01 \x03(\x0b\x32\x32.myproject.fakeapp.SimpleRelatedFieldModelResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\xf6\x01\n+SimpleRelatedFieldModelPartialUpdateRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x1e\n\x16_partial_update_fields\x18\x02 \x03(\t\x12\x14\n\x07\x66oreign\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1c\n\x0fslug_test_model\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x11\n\tmany_many\x18\x05 \x03(\t\x12\x16\n\x0eslug_many_many\x18\x06 \x03(\t\x12\x1a\n\x12many_many_foreigns\x18\x07 \x03(\tB\n\n\x08_foreignB\x12\n\x10_slug_test_model\"\xc9\x01\n\x1eSimpleRelatedFieldModelRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x14\n\x07\x66oreign\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x1c\n\x0fslug_test_model\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x11\n\tmany_many\x18\x04 \x03(\t\x12\x16\n\x0eslug_many_many\x18\x05 \x03(\t\x12\x1a\n\x12many_many_foreigns\x18\x06 \x03(\tB\n\n\x08_foreignB\x12\n\x10_slug_test_model\"\xca\x01\n\x1fSimpleRelatedFieldModelResponse\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x14\n\x07\x66oreign\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x1c\n\x0fslug_test_model\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x11\n\tmany_many\x18\x04 \x03(\t\x12\x16\n\x0eslug_many_many\x18\x05 \x03(\t\x12\x1a\n\x12many_many_foreigns\x18\x06 \x03(\tB\n\n\x08_foreignB\x12\n\x10_slug_test_model\"6\n&SimpleRelatedFieldModelRetrieveRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"0\n SpecialFieldsModelDestroyRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"\x1f\n\x1dSpecialFieldsModelListRequest\"o\n\x1eSpecialFieldsModelListResponse\x12>\n\x07results\x18\x01 \x03(\x0b\x32-.myproject.fakeapp.SpecialFieldsModelResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\x97\x01\n&SpecialFieldsModelPartialUpdateRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x1e\n\x16_partial_update_fields\x18\x02 \x03(\t\x12+\n\nmeta_datas\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x12\n\nlist_datas\x18\x04 \x03(\x05\"j\n\x19SpecialFieldsModelRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12+\n\nmeta_datas\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x12\n\nlist_datas\x18\x03 \x03(\x05\"{\n\x1aSpecialFieldsModelResponse\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12+\n\nmeta_datas\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x12\n\nlist_datas\x18\x03 \x03(\x05\x12\x0e\n\x06\x62inary\x18\x04 \x01(\x0c\"1\n!SpecialFieldsModelRetrieveRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"k\n\x1cStreamInStreamInListResponse\x12<\n\x07results\x18\x01 \x03(\x0b\x32+.myproject.fakeapp.StreamInStreamInResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\'\n\x17StreamInStreamInRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\")\n\x18StreamInStreamInResponse\x12\r\n\x05\x63ount\x18\x01 \x01(\x05\"-\n\x1dStreamInStreamToStreamRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\".\n\x1eStreamInStreamToStreamResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\"=\n)SyncUnitTestModelListWithExtraArgsRequest\x12\x10\n\x08\x61rchived\x18\x01 \x01(\x08\")\n\x1bUnitTestModelDestroyRequest\x12\n\n\x02id\x18\x01 \x01(\x05\"\x8e\x01\n\"UnitTestModelListExtraArgsResponse\x12\r\n\x05\x63ount\x18\x01 \x01(\x05\x12\x1e\n\x16query_fetched_datetime\x18\x02 \x01(\t\x12\x39\n\x07results\x18\x03 \x03(\x0b\x32(.myproject.fakeapp.UnitTestModelResponse\"\x1a\n\x18UnitTestModelListRequest\"e\n\x19UnitTestModelListResponse\x12\x39\n\x07results\x18\x01 \x03(\x0b\x32(.myproject.fakeapp.UnitTestModelResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"9\n%UnitTestModelListWithExtraArgsRequest\x12\x10\n\x08\x61rchived\x18\x01 \x01(\x08\"z\n!UnitTestModelPartialUpdateRequest\x12\n\n\x02id\x18\x01 \x01(\x05\x12\r\n\x05title\x18\x02 \x01(\t\x12\x11\n\x04text\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1e\n\x16_partial_update_fields\x18\x04 \x03(\tB\x07\n\x05_text\"M\n\x14UnitTestModelRequest\x12\n\n\x02id\x18\x01 \x01(\x05\x12\r\n\x05title\x18\x02 \x01(\t\x12\x11\n\x04text\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x07\n\x05_text\"N\n\x15UnitTestModelResponse\x12\n\n\x02id\x18\x01 \x01(\x05\x12\r\n\x05title\x18\x02 \x01(\t\x12\x11\n\x04text\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x07\n\x05_text\"*\n\x1cUnitTestModelRetrieveRequest\x12\n\n\x02id\x18\x01 \x01(\x05\"\x1c\n\x1aUnitTestModelStreamRequest\"9\n+UnitTestModelWithStructFilterDestroyRequest\x12\n\n\x02id\x18\x01 \x01(\x05\"\xb5\x01\n3UnitTestModelWithStructFilterEmptyWithFilterRequest\x12.\n\x08_filters\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x88\x01\x01\x12\x31\n\x0b_pagination\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructH\x01\x88\x01\x01\x42\x0b\n\tX_filtersB\x0e\n\x0cX_pagination\"\xaa\x01\n(UnitTestModelWithStructFilterListRequest\x12.\n\x08_filters\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x88\x01\x01\x12\x31\n\x0b_pagination\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructH\x01\x88\x01\x01\x42\x0b\n\tX_filtersB\x0e\n\x0cX_pagination\"\x85\x01\n)UnitTestModelWithStructFilterListResponse\x12I\n\x07results\x18\x01 \x03(\x0b\x32\x38.myproject.fakeapp.UnitTestModelWithStructFilterResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\x8a\x01\n1UnitTestModelWithStructFilterPartialUpdateRequest\x12\n\n\x02id\x18\x01 \x01(\x05\x12\r\n\x05title\x18\x02 \x01(\t\x12\x11\n\x04text\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1e\n\x16_partial_update_fields\x18\x04 \x03(\tB\x07\n\x05_text\"]\n$UnitTestModelWithStructFilterRequest\x12\n\n\x02id\x18\x01 \x01(\x05\x12\r\n\x05title\x18\x02 \x01(\t\x12\x11\n\x04text\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x07\n\x05_text\"^\n%UnitTestModelWithStructFilterResponse\x12\n\n\x02id\x18\x01 \x01(\x05\x12\r\n\x05title\x18\x02 \x01(\t\x12\x11\n\x04text\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x07\n\x05_text\":\n,UnitTestModelWithStructFilterRetrieveRequest\x12\n\n\x02id\x18\x01 \x01(\x05\",\n*UnitTestModelWithStructFilterStreamRequest2\xca\t\n\x0f\x42\x61sicController\x12t\n\tBasicList\x12\x31.myproject.fakeapp.BasicProtoListChildListRequest\x1a\x32.myproject.fakeapp.BasicProtoListChildListResponse\"\x00\x12[\n\x06\x43reate\x12&.myproject.fakeapp.BasicServiceRequest\x1a\'.myproject.fakeapp.BasicServiceResponse\"\x00\x12n\n\x10\x46\x65tchDataForUser\x12/.myproject.fakeapp.BasicFetchDataForUserRequest\x1a\'.myproject.fakeapp.BasicServiceResponse\"\x00\x12\x62\n\x12\x46\x65tchTranslatedKey\x12\x16.google.protobuf.Empty\x1a\x32.myproject.fakeapp.BasicFetchTranslatedKeyResponse\"\x00\x12T\n\x0bGetMultiple\x12\x16.google.protobuf.Empty\x1a+.myproject.fakeapp.BasicServiceListResponse\"\x00\x12L\n\x07ListIds\x12\x16.google.protobuf.Empty\x1a\'.myproject.fakeapp.BasicListIdsResponse\"\x00\x12N\n\x08ListName\x12\x16.google.protobuf.Empty\x1a(.myproject.fakeapp.BasicListNameResponse\"\x00\x12k\n\x08MixParam\x12/.myproject.fakeapp.CustomMixParamForListRequest\x1a,.myproject.fakeapp.BasicMixParamListResponse\"\x00\x12\x8e\x01\n\x16MixParamWithSerializer\x12\x36.myproject.fakeapp.BasicParamWithSerializerListRequest\x1a:.myproject.fakeapp.BasicMixParamWithSerializerListResponse\"\x00\x12_\n\x08MyMethod\x12\'.myproject.fakeapp.CustomNameForRequest\x1a(.myproject.fakeapp.CustomNameForResponse\"\x00\x12x\n\x17TestBaseProtoSerializer\x12*.myproject.fakeapp.BaseProtoExampleRequest\x1a/.myproject.fakeapp.BaseProtoExampleListResponse\"\x00\x12\x43\n\x0fTestEmptyMethod\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x32\xd1\x02\n\x13\x45xceptionController\x12@\n\x0c\x41PIException\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12\x41\n\rGRPCException\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12l\n\x14StreamRaiseException\x12\x16.google.protobuf.Empty\x1a\x38.myproject.fakeapp.ExceptionStreamRaiseExceptionResponse\"\x00\x30\x01\x12G\n\x13UnaryRaiseException\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x32\xff\x01\n\x16\x46oreignModelController\x12\x61\n\x04List\x12*.myproject.fakeapp.ForeignModelListRequest\x1a+.myproject.fakeapp.ForeignModelListResponse\"\x00\x12\x81\x01\n\x08Retrieve\x12<.myproject.fakeapp.ForeignModelRetrieveCustomRetrieveRequest\x1a\x35.myproject.fakeapp.ForeignModelRetrieveCustomResponse\"\x00\x32\xa5\x01\n&ImportStructEvenInArrayModelController\x12{\n\x06\x43reate\x12\x36.myproject.fakeapp.ImportStructEvenInArrayModelRequest\x1a\x37.myproject.fakeapp.ImportStructEvenInArrayModelResponse\"\x00\x32\xa9\x05\n\x1cRecursiveTestModelController\x12g\n\x06\x43reate\x12,.myproject.fakeapp.RecursiveTestModelRequest\x1a-.myproject.fakeapp.RecursiveTestModelResponse\"\x00\x12X\n\x07\x44\x65stroy\x12\x33.myproject.fakeapp.RecursiveTestModelDestroyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12m\n\x04List\x12\x30.myproject.fakeapp.RecursiveTestModelListRequest\x1a\x31.myproject.fakeapp.RecursiveTestModelListResponse\"\x00\x12{\n\rPartialUpdate\x12\x39.myproject.fakeapp.RecursiveTestModelPartialUpdateRequest\x1a-.myproject.fakeapp.RecursiveTestModelResponse\"\x00\x12q\n\x08Retrieve\x12\x34.myproject.fakeapp.RecursiveTestModelRetrieveRequest\x1a-.myproject.fakeapp.RecursiveTestModelResponse\"\x00\x12g\n\x06Update\x12,.myproject.fakeapp.RecursiveTestModelRequest\x1a-.myproject.fakeapp.RecursiveTestModelResponse\"\x00\x32\x9d\x05\n\x1bRelatedFieldModelController\x12\x65\n\x06\x43reate\x12+.myproject.fakeapp.RelatedFieldModelRequest\x1a,.myproject.fakeapp.RelatedFieldModelResponse\"\x00\x12W\n\x07\x44\x65stroy\x12\x32.myproject.fakeapp.RelatedFieldModelDestroyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12k\n\x04List\x12/.myproject.fakeapp.RelatedFieldModelListRequest\x1a\x30.myproject.fakeapp.RelatedFieldModelListResponse\"\x00\x12y\n\rPartialUpdate\x12\x38.myproject.fakeapp.RelatedFieldModelPartialUpdateRequest\x1a,.myproject.fakeapp.RelatedFieldModelResponse\"\x00\x12o\n\x08Retrieve\x12\x33.myproject.fakeapp.RelatedFieldModelRetrieveRequest\x1a,.myproject.fakeapp.RelatedFieldModelResponse\"\x00\x12\x65\n\x06Update\x12+.myproject.fakeapp.RelatedFieldModelRequest\x1a,.myproject.fakeapp.RelatedFieldModelResponse\"\x00\x32\xe6\x05\n!SimpleRelatedFieldModelController\x12q\n\x06\x43reate\x12\x31.myproject.fakeapp.SimpleRelatedFieldModelRequest\x1a\x32.myproject.fakeapp.SimpleRelatedFieldModelResponse\"\x00\x12]\n\x07\x44\x65stroy\x12\x38.myproject.fakeapp.SimpleRelatedFieldModelDestroyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12w\n\x04List\x12\x35.myproject.fakeapp.SimpleRelatedFieldModelListRequest\x1a\x36.myproject.fakeapp.SimpleRelatedFieldModelListResponse\"\x00\x12\x85\x01\n\rPartialUpdate\x12>.myproject.fakeapp.SimpleRelatedFieldModelPartialUpdateRequest\x1a\x32.myproject.fakeapp.SimpleRelatedFieldModelResponse\"\x00\x12{\n\x08Retrieve\x12\x39.myproject.fakeapp.SimpleRelatedFieldModelRetrieveRequest\x1a\x32.myproject.fakeapp.SimpleRelatedFieldModelResponse\"\x00\x12q\n\x06Update\x12\x31.myproject.fakeapp.SimpleRelatedFieldModelRequest\x1a\x32.myproject.fakeapp.SimpleRelatedFieldModelResponse\"\x00\x32\xc0\x05\n\x1cSpecialFieldsModelController\x12g\n\x06\x43reate\x12,.myproject.fakeapp.SpecialFieldsModelRequest\x1a-.myproject.fakeapp.SpecialFieldsModelResponse\"\x00\x12X\n\x07\x44\x65stroy\x12\x33.myproject.fakeapp.SpecialFieldsModelDestroyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12m\n\x04List\x12\x30.myproject.fakeapp.SpecialFieldsModelListRequest\x1a\x31.myproject.fakeapp.SpecialFieldsModelListResponse\"\x00\x12{\n\rPartialUpdate\x12\x39.myproject.fakeapp.SpecialFieldsModelPartialUpdateRequest\x1a-.myproject.fakeapp.SpecialFieldsModelResponse\"\x00\x12\x87\x01\n\x08Retrieve\x12\x34.myproject.fakeapp.SpecialFieldsModelRetrieveRequest\x1a\x43.myproject.fakeapp.CustomRetrieveResponseSpecialFieldsModelResponse\"\x00\x12g\n\x06Update\x12,.myproject.fakeapp.SpecialFieldsModelRequest\x1a-.myproject.fakeapp.SpecialFieldsModelResponse\"\x00\x32\xfe\x01\n\x12StreamInController\x12k\n\x08StreamIn\x12*.myproject.fakeapp.StreamInStreamInRequest\x1a/.myproject.fakeapp.StreamInStreamInListResponse\"\x00(\x01\x12{\n\x0eStreamToStream\x12\x30.myproject.fakeapp.StreamInStreamToStreamRequest\x1a\x31.myproject.fakeapp.StreamInStreamToStreamResponse\"\x00(\x01\x30\x01\x32\xe5\x06\n\x1bSyncUnitTestModelController\x12]\n\x06\x43reate\x12\'.myproject.fakeapp.UnitTestModelRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x12S\n\x07\x44\x65stroy\x12..myproject.fakeapp.UnitTestModelDestroyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x63\n\x04List\x12+.myproject.fakeapp.UnitTestModelListRequest\x1a,.myproject.fakeapp.UnitTestModelListResponse\"\x00\x12\x8a\x01\n\x11ListWithExtraArgs\x12<.myproject.fakeapp.SyncUnitTestModelListWithExtraArgsRequest\x1a\x35.myproject.fakeapp.UnitTestModelListExtraArgsResponse\"\x00\x12q\n\rPartialUpdate\x12\x34.myproject.fakeapp.UnitTestModelPartialUpdateRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x12g\n\x08Retrieve\x12/.myproject.fakeapp.UnitTestModelRetrieveRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x12\x65\n\x06Stream\x12-.myproject.fakeapp.UnitTestModelStreamRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x30\x01\x12]\n\x06Update\x12\'.myproject.fakeapp.UnitTestModelRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x32\xdd\x06\n\x17UnitTestModelController\x12]\n\x06\x43reate\x12\'.myproject.fakeapp.UnitTestModelRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x12S\n\x07\x44\x65stroy\x12..myproject.fakeapp.UnitTestModelDestroyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x63\n\x04List\x12+.myproject.fakeapp.UnitTestModelListRequest\x1a,.myproject.fakeapp.UnitTestModelListResponse\"\x00\x12\x86\x01\n\x11ListWithExtraArgs\x12\x38.myproject.fakeapp.UnitTestModelListWithExtraArgsRequest\x1a\x35.myproject.fakeapp.UnitTestModelListExtraArgsResponse\"\x00\x12q\n\rPartialUpdate\x12\x34.myproject.fakeapp.UnitTestModelPartialUpdateRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x12g\n\x08Retrieve\x12/.myproject.fakeapp.UnitTestModelRetrieveRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x12\x65\n\x06Stream\x12-.myproject.fakeapp.UnitTestModelStreamRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x30\x01\x12]\n\x06Update\x12\'.myproject.fakeapp.UnitTestModelRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x32\xad\x08\n\'UnitTestModelWithStructFilterController\x12}\n\x06\x43reate\x12\x37.myproject.fakeapp.UnitTestModelWithStructFilterRequest\x1a\x38.myproject.fakeapp.UnitTestModelWithStructFilterResponse\"\x00\x12\x63\n\x07\x44\x65stroy\x12>.myproject.fakeapp.UnitTestModelWithStructFilterDestroyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12s\n\x0f\x45mptyWithFilter\x12\x46.myproject.fakeapp.UnitTestModelWithStructFilterEmptyWithFilterRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x83\x01\n\x04List\x12;.myproject.fakeapp.UnitTestModelWithStructFilterListRequest\x1a<.myproject.fakeapp.UnitTestModelWithStructFilterListResponse\"\x00\x12\x91\x01\n\rPartialUpdate\x12\x44.myproject.fakeapp.UnitTestModelWithStructFilterPartialUpdateRequest\x1a\x38.myproject.fakeapp.UnitTestModelWithStructFilterResponse\"\x00\x12\x87\x01\n\x08Retrieve\x12?.myproject.fakeapp.UnitTestModelWithStructFilterRetrieveRequest\x1a\x38.myproject.fakeapp.UnitTestModelWithStructFilterResponse\"\x00\x12\x85\x01\n\x06Stream\x12=.myproject.fakeapp.UnitTestModelWithStructFilterStreamRequest\x1a\x38.myproject.fakeapp.UnitTestModelWithStructFilterResponse\"\x00\x30\x01\x12}\n\x06Update\x12\x37.myproject.fakeapp.UnitTestModelWithStructFilterRequest\x1a\x38.myproject.fakeapp.UnitTestModelWithStructFilterResponse\"\x00\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n2django_socio_grpc/tests/fakeapp/grpc/fakeapp.proto\x12\x11myproject.fakeapp\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1cgoogle/protobuf/struct.proto\"k\n\x1c\x42\x61seProtoExampleListResponse\x12<\n\x07results\x18\x01 \x03(\x0b\x32+.myproject.fakeapp.BaseProtoExampleResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"X\n\x17\x42\x61seProtoExampleRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x1a\n\x12number_of_elements\x18\x02 \x01(\x05\x12\x13\n\x0bis_archived\x18\x03 \x01(\x08\"Y\n\x18\x42\x61seProtoExampleResponse\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x1a\n\x12number_of_elements\x18\x02 \x01(\x05\x12\x13\n\x0bis_archived\x18\x03 \x01(\x08\"1\n\x1c\x42\x61sicFetchDataForUserRequest\x12\x11\n\tuser_name\x18\x01 \x01(\t\"/\n\x1f\x42\x61sicFetchTranslatedKeyResponse\x12\x0c\n\x04text\x18\x01 \x01(\t\"#\n\x14\x42\x61sicListIdsResponse\x12\x0b\n\x03ids\x18\x01 \x03(\x05\"%\n\x15\x42\x61sicListNameResponse\x12\x0c\n\x04name\x18\x01 \x03(\t\"e\n\x19\x42\x61sicMixParamListResponse\x12\x39\n\x07results\x18\x01 \x03(\x0b\x32(.myproject.fakeapp.BasicMixParamResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"*\n\x15\x42\x61sicMixParamResponse\x12\x11\n\tuser_name\x18\x01 \x01(\t\"b\n\'BasicMixParamWithSerializerListResponse\x12(\n\x07results\x18\x01 \x03(\x0b\x32\x17.google.protobuf.Struct\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"y\n#BasicParamWithSerializerListRequest\x12\x43\n\x07results\x18\x01 \x03(\x0b\x32\x32.myproject.fakeapp.BasicParamWithSerializerRequest\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\xbd\x01\n\x1f\x42\x61sicParamWithSerializerRequest\x12\x11\n\tuser_name\x18\x01 \x01(\t\x12*\n\tuser_data\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x15\n\ruser_password\x18\x03 \x01(\t\x12\x15\n\rbytes_example\x18\x04 \x01(\x0c\x12-\n\x0clist_of_dict\x18\x05 \x03(\x0b\x32\x17.google.protobuf.Struct\"o\n\x1e\x42\x61sicProtoListChildListRequest\x12>\n\x07results\x18\x01 \x03(\x0b\x32-.myproject.fakeapp.BasicProtoListChildRequest\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"q\n\x1f\x42\x61sicProtoListChildListResponse\x12?\n\x07results\x18\x01 \x03(\x0b\x32..myproject.fakeapp.BasicProtoListChildResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"_\n\x1a\x42\x61sicProtoListChildRequest\x12\x0f\n\x02id\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\r\n\x05title\x18\x02 \x01(\t\x12\x11\n\x04text\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x05\n\x03_idB\x07\n\x05_text\"`\n\x1b\x42\x61sicProtoListChildResponse\x12\x0f\n\x02id\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\r\n\x05title\x18\x02 \x01(\t\x12\x11\n\x04text\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x05\n\x03_idB\x07\n\x05_text\"c\n\x18\x42\x61sicServiceListResponse\x12\x38\n\x07results\x18\x01 \x03(\x0b\x32\'.myproject.fakeapp.BasicServiceResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\xb1\x01\n\x13\x42\x61sicServiceRequest\x12\x11\n\tuser_name\x18\x01 \x01(\t\x12*\n\tuser_data\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x15\n\ruser_password\x18\x03 \x01(\t\x12\x15\n\rbytes_example\x18\x04 \x01(\x0c\x12-\n\x0clist_of_dict\x18\x05 \x03(\x0b\x32\x17.google.protobuf.Struct\"\x9b\x01\n\x14\x42\x61sicServiceResponse\x12\x11\n\tuser_name\x18\x01 \x01(\t\x12*\n\tuser_data\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x15\n\rbytes_example\x18\x03 \x01(\x0c\x12-\n\x0clist_of_dict\x18\x04 \x03(\x0b\x32\x17.google.protobuf.Struct\"k\n\x1c\x43ustomMixParamForListRequest\x12<\n\x07results\x18\x01 \x03(\x0b\x32+.myproject.fakeapp.CustomMixParamForRequest\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"-\n\x18\x43ustomMixParamForRequest\x12\x11\n\tuser_name\x18\x01 \x01(\t\")\n\x14\x43ustomNameForRequest\x12\x11\n\tuser_name\x18\x01 \x01(\t\"*\n\x15\x43ustomNameForResponse\x12\x11\n\tuser_name\x18\x01 \x01(\t\"\xc0\x01\n0CustomRetrieveResponseSpecialFieldsModelResponse\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12!\n\x14\x64\x65\x66\x61ult_method_field\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12\x34\n\x13\x63ustom_method_field\x18\x03 \x03(\x0b\x32\x17.google.protobuf.StructB\x07\n\x05_uuidB\x17\n\x15_default_method_field\"(\n\x1a\x44\x65\x66\x61ultValueDestroyRequest\x12\n\n\x02id\x18\x01 \x01(\x05\"\x19\n\x17\x44\x65\x66\x61ultValueListRequest\"c\n\x18\x44\x65\x66\x61ultValueListResponse\x12\x38\n\x07results\x18\x01 \x03(\x0b\x32\'.myproject.fakeapp.DefaultValueResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\xb1\t\n DefaultValuePartialUpdateRequest\x12\x0f\n\x02id\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\x33\n&string_required_but_serializer_default\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x30\n#int_required_but_serializer_default\x18\x03 \x01(\x05H\x02\x88\x01\x01\x12\x34\n\'boolean_required_but_serializer_default\x18\x04 \x01(\x08H\x03\x88\x01\x01\x12\x32\n%string_default_but_serializer_default\x18\x05 \x01(\tH\x04\x88\x01\x01\x12;\n.string_nullable_default_but_serializer_default\x18\x06 \x01(\tH\x05\x88\x01\x01\x12\x1e\n\x16_partial_update_fields\x18\x07 \x03(\t\x12\x17\n\x0fstring_required\x18\x08 \x01(\t\x12\x19\n\x0cstring_blank\x18\t \x01(\tH\x06\x88\x01\x01\x12\x1c\n\x0fstring_nullable\x18\n \x01(\tH\x07\x88\x01\x01\x12\x1b\n\x0estring_default\x18\x0b \x01(\tH\x08\x88\x01\x01\x12%\n\x18string_default_and_blank\x18\x0c \x01(\tH\t\x88\x01\x01\x12*\n\x1dstring_null_default_and_blank\x18\r \x01(\tH\n\x88\x01\x01\x12\x14\n\x0cint_required\x18\x0e \x01(\x05\x12\x19\n\x0cint_nullable\x18\x0f \x01(\x05H\x0b\x88\x01\x01\x12\x18\n\x0bint_default\x18\x10 \x01(\x05H\x0c\x88\x01\x01\x12\x18\n\x10\x62oolean_required\x18\x11 \x01(\x08\x12\x1d\n\x10\x62oolean_nullable\x18\x12 \x01(\x08H\r\x88\x01\x01\x12\"\n\x15\x62oolean_default_false\x18\x13 \x01(\x08H\x0e\x88\x01\x01\x12!\n\x14\x62oolean_default_true\x18\x14 \x01(\x08H\x0f\x88\x01\x01\x42\x05\n\x03_idB)\n\'_string_required_but_serializer_defaultB&\n$_int_required_but_serializer_defaultB*\n(_boolean_required_but_serializer_defaultB(\n&_string_default_but_serializer_defaultB1\n/_string_nullable_default_but_serializer_defaultB\x0f\n\r_string_blankB\x12\n\x10_string_nullableB\x11\n\x0f_string_defaultB\x1b\n\x19_string_default_and_blankB \n\x1e_string_null_default_and_blankB\x0f\n\r_int_nullableB\x0e\n\x0c_int_defaultB\x13\n\x11_boolean_nullableB\x18\n\x16_boolean_default_falseB\x17\n\x15_boolean_default_true\"\x84\t\n\x13\x44\x65\x66\x61ultValueRequest\x12\x0f\n\x02id\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\x33\n&string_required_but_serializer_default\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x30\n#int_required_but_serializer_default\x18\x03 \x01(\x05H\x02\x88\x01\x01\x12\x34\n\'boolean_required_but_serializer_default\x18\x04 \x01(\x08H\x03\x88\x01\x01\x12\x32\n%string_default_but_serializer_default\x18\x05 \x01(\tH\x04\x88\x01\x01\x12;\n.string_nullable_default_but_serializer_default\x18\x06 \x01(\tH\x05\x88\x01\x01\x12\x17\n\x0fstring_required\x18\x07 \x01(\t\x12\x19\n\x0cstring_blank\x18\x08 \x01(\tH\x06\x88\x01\x01\x12\x1c\n\x0fstring_nullable\x18\t \x01(\tH\x07\x88\x01\x01\x12\x1b\n\x0estring_default\x18\n \x01(\tH\x08\x88\x01\x01\x12%\n\x18string_default_and_blank\x18\x0b \x01(\tH\t\x88\x01\x01\x12*\n\x1dstring_null_default_and_blank\x18\x0c \x01(\tH\n\x88\x01\x01\x12\x14\n\x0cint_required\x18\r \x01(\x05\x12\x19\n\x0cint_nullable\x18\x0e \x01(\x05H\x0b\x88\x01\x01\x12\x18\n\x0bint_default\x18\x0f \x01(\x05H\x0c\x88\x01\x01\x12\x18\n\x10\x62oolean_required\x18\x10 \x01(\x08\x12\x1d\n\x10\x62oolean_nullable\x18\x11 \x01(\x08H\r\x88\x01\x01\x12\"\n\x15\x62oolean_default_false\x18\x12 \x01(\x08H\x0e\x88\x01\x01\x12!\n\x14\x62oolean_default_true\x18\x13 \x01(\x08H\x0f\x88\x01\x01\x42\x05\n\x03_idB)\n\'_string_required_but_serializer_defaultB&\n$_int_required_but_serializer_defaultB*\n(_boolean_required_but_serializer_defaultB(\n&_string_default_but_serializer_defaultB1\n/_string_nullable_default_but_serializer_defaultB\x0f\n\r_string_blankB\x12\n\x10_string_nullableB\x11\n\x0f_string_defaultB\x1b\n\x19_string_default_and_blankB \n\x1e_string_null_default_and_blankB\x0f\n\r_int_nullableB\x0e\n\x0c_int_defaultB\x13\n\x11_boolean_nullableB\x18\n\x16_boolean_default_falseB\x17\n\x15_boolean_default_true\"\x85\t\n\x14\x44\x65\x66\x61ultValueResponse\x12\x0f\n\x02id\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\x33\n&string_required_but_serializer_default\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x30\n#int_required_but_serializer_default\x18\x03 \x01(\x05H\x02\x88\x01\x01\x12\x34\n\'boolean_required_but_serializer_default\x18\x04 \x01(\x08H\x03\x88\x01\x01\x12\x32\n%string_default_but_serializer_default\x18\x05 \x01(\tH\x04\x88\x01\x01\x12;\n.string_nullable_default_but_serializer_default\x18\x06 \x01(\tH\x05\x88\x01\x01\x12\x17\n\x0fstring_required\x18\x07 \x01(\t\x12\x19\n\x0cstring_blank\x18\x08 \x01(\tH\x06\x88\x01\x01\x12\x1c\n\x0fstring_nullable\x18\t \x01(\tH\x07\x88\x01\x01\x12\x1b\n\x0estring_default\x18\n \x01(\tH\x08\x88\x01\x01\x12%\n\x18string_default_and_blank\x18\x0b \x01(\tH\t\x88\x01\x01\x12*\n\x1dstring_null_default_and_blank\x18\x0c \x01(\tH\n\x88\x01\x01\x12\x14\n\x0cint_required\x18\r \x01(\x05\x12\x19\n\x0cint_nullable\x18\x0e \x01(\x05H\x0b\x88\x01\x01\x12\x18\n\x0bint_default\x18\x0f \x01(\x05H\x0c\x88\x01\x01\x12\x18\n\x10\x62oolean_required\x18\x10 \x01(\x08\x12\x1d\n\x10\x62oolean_nullable\x18\x11 \x01(\x08H\r\x88\x01\x01\x12\"\n\x15\x62oolean_default_false\x18\x12 \x01(\x08H\x0e\x88\x01\x01\x12!\n\x14\x62oolean_default_true\x18\x13 \x01(\x08H\x0f\x88\x01\x01\x42\x05\n\x03_idB)\n\'_string_required_but_serializer_defaultB&\n$_int_required_but_serializer_defaultB*\n(_boolean_required_but_serializer_defaultB(\n&_string_default_but_serializer_defaultB1\n/_string_nullable_default_but_serializer_defaultB\x0f\n\r_string_blankB\x12\n\x10_string_nullableB\x11\n\x0f_string_defaultB\x1b\n\x19_string_default_and_blankB \n\x1e_string_null_default_and_blankB\x0f\n\r_int_nullableB\x0e\n\x0c_int_defaultB\x13\n\x11_boolean_nullableB\x18\n\x16_boolean_default_falseB\x17\n\x15_boolean_default_true\")\n\x1b\x44\x65\x66\x61ultValueRetrieveRequest\x12\n\n\x02id\x18\x01 \x01(\x05\"3\n%ExceptionStreamRaiseExceptionResponse\x12\n\n\x02id\x18\x01 \x01(\t\"\x19\n\x17\x46oreignModelListRequest\"c\n\x18\x46oreignModelListResponse\x12\x38\n\x07results\x18\x01 \x03(\x0b\x32\'.myproject.fakeapp.ForeignModelResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"@\n\x14\x46oreignModelResponse\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x0c\n\x04name\x18\x02 \x01(\tB\x07\n\x05_uuid\"R\n\"ForeignModelRetrieveCustomResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x06\x63ustom\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\t\n\x07_custom\"9\n)ForeignModelRetrieveCustomRetrieveRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"q\n#ImportStructEvenInArrayModelRequest\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12.\n\rthis_is_crazy\x18\x02 \x03(\x0b\x32\x17.google.protobuf.StructB\x07\n\x05_uuid\"r\n$ImportStructEvenInArrayModelResponse\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12.\n\rthis_is_crazy\x18\x02 \x03(\x0b\x32\x17.google.protobuf.StructB\x07\n\x05_uuid\"c\n\x14ManyManyModelRequest\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x0c\n\x04name\x18\x02 \x01(\t\x12!\n\x19test_write_only_on_nested\x18\x03 \x01(\tB\x07\n\x05_uuid\"A\n\x15ManyManyModelResponse\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x0c\n\x04name\x18\x02 \x01(\tB\x07\n\x05_uuid\"0\n RecursiveTestModelDestroyRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"\x1f\n\x1dRecursiveTestModelListRequest\"o\n\x1eRecursiveTestModelListResponse\x12>\n\x07results\x18\x01 \x03(\x0b\x32-.myproject.fakeapp.RecursiveTestModelResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\xf2\x01\n&RecursiveTestModelPartialUpdateRequest\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x1e\n\x16_partial_update_fields\x18\x02 \x03(\t\x12\x41\n\x06parent\x18\x03 \x01(\x0b\x32,.myproject.fakeapp.RecursiveTestModelRequestH\x01\x88\x01\x01\x12>\n\x08\x63hildren\x18\x04 \x03(\x0b\x32,.myproject.fakeapp.RecursiveTestModelRequestB\x07\n\x05_uuidB\t\n\x07_parent\"\xc5\x01\n\x19RecursiveTestModelRequest\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x41\n\x06parent\x18\x02 \x01(\x0b\x32,.myproject.fakeapp.RecursiveTestModelRequestH\x01\x88\x01\x01\x12>\n\x08\x63hildren\x18\x03 \x03(\x0b\x32,.myproject.fakeapp.RecursiveTestModelRequestB\x07\n\x05_uuidB\t\n\x07_parent\"\xc8\x01\n\x1aRecursiveTestModelResponse\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x42\n\x06parent\x18\x02 \x01(\x0b\x32-.myproject.fakeapp.RecursiveTestModelResponseH\x01\x88\x01\x01\x12?\n\x08\x63hildren\x18\x03 \x03(\x0b\x32-.myproject.fakeapp.RecursiveTestModelResponseB\x07\n\x05_uuidB\t\n\x07_parent\"1\n!RecursiveTestModelRetrieveRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"/\n\x1fRelatedFieldModelDestroyRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"\x1e\n\x1cRelatedFieldModelListRequest\"|\n\x1dRelatedFieldModelListResponse\x12L\n\x16list_custom_field_name\x18\x01 \x03(\x0b\x32,.myproject.fakeapp.RelatedFieldModelResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\xd6\x01\n%RelatedFieldModelPartialUpdateRequest\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12:\n\tmany_many\x18\x02 \x03(\x0b\x32\'.myproject.fakeapp.ManyManyModelRequest\x12\x19\n\x11\x63ustom_field_name\x18\x03 \x01(\t\x12\x1e\n\x16_partial_update_fields\x18\x04 \x03(\t\x12\x1a\n\x12many_many_foreigns\x18\x05 \x03(\tB\x07\n\x05_uuid\"\xa9\x01\n\x18RelatedFieldModelRequest\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12:\n\tmany_many\x18\x02 \x03(\x0b\x32\'.myproject.fakeapp.ManyManyModelRequest\x12\x19\n\x11\x63ustom_field_name\x18\x03 \x01(\t\x12\x1a\n\x12many_many_foreigns\x18\x04 \x03(\tB\x07\n\x05_uuid\"\xa5\x03\n\x19RelatedFieldModelResponse\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12=\n\x07\x66oreign\x18\x02 \x01(\x0b\x32\'.myproject.fakeapp.ForeignModelResponseH\x01\x88\x01\x01\x12;\n\tmany_many\x18\x03 \x03(\x0b\x32(.myproject.fakeapp.ManyManyModelResponse\x12\x1c\n\x0fslug_test_model\x18\x04 \x01(\x05H\x02\x88\x01\x01\x12\x1f\n\x17slug_reverse_test_model\x18\x05 \x03(\x08\x12\x16\n\x0eslug_many_many\x18\x06 \x03(\t\x12%\n\x18proto_slug_related_field\x18\x07 \x01(\tH\x03\x88\x01\x01\x12\x19\n\x11\x63ustom_field_name\x18\x08 \x01(\t\x12\x1a\n\x12many_many_foreigns\x18\t \x03(\tB\x07\n\x05_uuidB\n\n\x08_foreignB\x12\n\x10_slug_test_modelB\x1b\n\x19_proto_slug_related_field\"0\n RelatedFieldModelRetrieveRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"5\n%SimpleRelatedFieldModelDestroyRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"$\n\"SimpleRelatedFieldModelListRequest\"y\n#SimpleRelatedFieldModelListResponse\x12\x43\n\x07results\x18\x01 \x03(\x0b\x32\x32.myproject.fakeapp.SimpleRelatedFieldModelResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\x84\x02\n+SimpleRelatedFieldModelPartialUpdateRequest\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x1e\n\x16_partial_update_fields\x18\x02 \x03(\t\x12\x14\n\x07\x66oreign\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x1c\n\x0fslug_test_model\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x11\n\tmany_many\x18\x05 \x03(\t\x12\x16\n\x0eslug_many_many\x18\x06 \x03(\t\x12\x1a\n\x12many_many_foreigns\x18\x07 \x03(\tB\x07\n\x05_uuidB\n\n\x08_foreignB\x12\n\x10_slug_test_model\"\xd7\x01\n\x1eSimpleRelatedFieldModelRequest\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07\x66oreign\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x1c\n\x0fslug_test_model\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x11\n\tmany_many\x18\x04 \x03(\t\x12\x16\n\x0eslug_many_many\x18\x05 \x03(\t\x12\x1a\n\x12many_many_foreigns\x18\x06 \x03(\tB\x07\n\x05_uuidB\n\n\x08_foreignB\x12\n\x10_slug_test_model\"\xd8\x01\n\x1fSimpleRelatedFieldModelResponse\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07\x66oreign\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x1c\n\x0fslug_test_model\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x11\n\tmany_many\x18\x04 \x03(\t\x12\x16\n\x0eslug_many_many\x18\x05 \x03(\t\x12\x1a\n\x12many_many_foreigns\x18\x06 \x03(\tB\x07\n\x05_uuidB\n\n\x08_foreignB\x12\n\x10_slug_test_model\"6\n&SimpleRelatedFieldModelRetrieveRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"0\n SpecialFieldsModelDestroyRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"\x1f\n\x1dSpecialFieldsModelListRequest\"o\n\x1eSpecialFieldsModelListResponse\x12>\n\x07results\x18\x01 \x03(\x0b\x32-.myproject.fakeapp.SpecialFieldsModelResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\xb9\x01\n&SpecialFieldsModelPartialUpdateRequest\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x1e\n\x16_partial_update_fields\x18\x02 \x03(\t\x12\x30\n\nmeta_datas\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructH\x01\x88\x01\x01\x12\x12\n\nlist_datas\x18\x04 \x03(\x05\x42\x07\n\x05_uuidB\r\n\x0b_meta_datas\"\x8c\x01\n\x19SpecialFieldsModelRequest\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x30\n\nmeta_datas\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructH\x01\x88\x01\x01\x12\x12\n\nlist_datas\x18\x03 \x03(\x05\x42\x07\n\x05_uuidB\r\n\x0b_meta_datas\"\xad\x01\n\x1aSpecialFieldsModelResponse\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x30\n\nmeta_datas\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructH\x01\x88\x01\x01\x12\x12\n\nlist_datas\x18\x03 \x03(\x05\x12\x13\n\x06\x62inary\x18\x04 \x01(\x0cH\x02\x88\x01\x01\x42\x07\n\x05_uuidB\r\n\x0b_meta_datasB\t\n\x07_binary\"1\n!SpecialFieldsModelRetrieveRequest\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"k\n\x1cStreamInStreamInListResponse\x12<\n\x07results\x18\x01 \x03(\x0b\x32+.myproject.fakeapp.StreamInStreamInResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\'\n\x17StreamInStreamInRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\")\n\x18StreamInStreamInResponse\x12\r\n\x05\x63ount\x18\x01 \x01(\x05\"-\n\x1dStreamInStreamToStreamRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\".\n\x1eStreamInStreamToStreamResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\"=\n)SyncUnitTestModelListWithExtraArgsRequest\x12\x10\n\x08\x61rchived\x18\x01 \x01(\x08\")\n\x1bUnitTestModelDestroyRequest\x12\n\n\x02id\x18\x01 \x01(\x05\"\x8e\x01\n\"UnitTestModelListExtraArgsResponse\x12\r\n\x05\x63ount\x18\x01 \x01(\x05\x12\x1e\n\x16query_fetched_datetime\x18\x02 \x01(\t\x12\x39\n\x07results\x18\x03 \x03(\x0b\x32(.myproject.fakeapp.UnitTestModelResponse\"\x1a\n\x18UnitTestModelListRequest\"e\n\x19UnitTestModelListResponse\x12\x39\n\x07results\x18\x01 \x03(\x0b\x32(.myproject.fakeapp.UnitTestModelResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"9\n%UnitTestModelListWithExtraArgsRequest\x12\x10\n\x08\x61rchived\x18\x01 \x01(\x08\"\x86\x01\n!UnitTestModelPartialUpdateRequest\x12\x0f\n\x02id\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\x1e\n\x16_partial_update_fields\x18\x02 \x03(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12\x11\n\x04text\x18\x04 \x01(\tH\x01\x88\x01\x01\x42\x05\n\x03_idB\x07\n\x05_text\"Y\n\x14UnitTestModelRequest\x12\x0f\n\x02id\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\r\n\x05title\x18\x02 \x01(\t\x12\x11\n\x04text\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x05\n\x03_idB\x07\n\x05_text\"Z\n\x15UnitTestModelResponse\x12\x0f\n\x02id\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\r\n\x05title\x18\x02 \x01(\t\x12\x11\n\x04text\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x05\n\x03_idB\x07\n\x05_text\"*\n\x1cUnitTestModelRetrieveRequest\x12\n\n\x02id\x18\x01 \x01(\x05\"\x1c\n\x1aUnitTestModelStreamRequest\"9\n+UnitTestModelWithStructFilterDestroyRequest\x12\n\n\x02id\x18\x01 \x01(\x05\"\xb5\x01\n3UnitTestModelWithStructFilterEmptyWithFilterRequest\x12.\n\x08_filters\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x88\x01\x01\x12\x31\n\x0b_pagination\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructH\x01\x88\x01\x01\x42\x0b\n\tX_filtersB\x0e\n\x0cX_pagination\"\xaa\x01\n(UnitTestModelWithStructFilterListRequest\x12.\n\x08_filters\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x88\x01\x01\x12\x31\n\x0b_pagination\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructH\x01\x88\x01\x01\x42\x0b\n\tX_filtersB\x0e\n\x0cX_pagination\"\x85\x01\n)UnitTestModelWithStructFilterListResponse\x12I\n\x07results\x18\x01 \x03(\x0b\x32\x38.myproject.fakeapp.UnitTestModelWithStructFilterResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\x96\x01\n1UnitTestModelWithStructFilterPartialUpdateRequest\x12\x0f\n\x02id\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\x1e\n\x16_partial_update_fields\x18\x02 \x03(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12\x11\n\x04text\x18\x04 \x01(\tH\x01\x88\x01\x01\x42\x05\n\x03_idB\x07\n\x05_text\"i\n$UnitTestModelWithStructFilterRequest\x12\x0f\n\x02id\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\r\n\x05title\x18\x02 \x01(\t\x12\x11\n\x04text\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x05\n\x03_idB\x07\n\x05_text\"j\n%UnitTestModelWithStructFilterResponse\x12\x0f\n\x02id\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\r\n\x05title\x18\x02 \x01(\t\x12\x11\n\x04text\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x05\n\x03_idB\x07\n\x05_text\":\n,UnitTestModelWithStructFilterRetrieveRequest\x12\n\n\x02id\x18\x01 \x01(\x05\",\n*UnitTestModelWithStructFilterStreamRequest2\xca\t\n\x0f\x42\x61sicController\x12t\n\tBasicList\x12\x31.myproject.fakeapp.BasicProtoListChildListRequest\x1a\x32.myproject.fakeapp.BasicProtoListChildListResponse\"\x00\x12[\n\x06\x43reate\x12&.myproject.fakeapp.BasicServiceRequest\x1a\'.myproject.fakeapp.BasicServiceResponse\"\x00\x12n\n\x10\x46\x65tchDataForUser\x12/.myproject.fakeapp.BasicFetchDataForUserRequest\x1a\'.myproject.fakeapp.BasicServiceResponse\"\x00\x12\x62\n\x12\x46\x65tchTranslatedKey\x12\x16.google.protobuf.Empty\x1a\x32.myproject.fakeapp.BasicFetchTranslatedKeyResponse\"\x00\x12T\n\x0bGetMultiple\x12\x16.google.protobuf.Empty\x1a+.myproject.fakeapp.BasicServiceListResponse\"\x00\x12L\n\x07ListIds\x12\x16.google.protobuf.Empty\x1a\'.myproject.fakeapp.BasicListIdsResponse\"\x00\x12N\n\x08ListName\x12\x16.google.protobuf.Empty\x1a(.myproject.fakeapp.BasicListNameResponse\"\x00\x12k\n\x08MixParam\x12/.myproject.fakeapp.CustomMixParamForListRequest\x1a,.myproject.fakeapp.BasicMixParamListResponse\"\x00\x12\x8e\x01\n\x16MixParamWithSerializer\x12\x36.myproject.fakeapp.BasicParamWithSerializerListRequest\x1a:.myproject.fakeapp.BasicMixParamWithSerializerListResponse\"\x00\x12_\n\x08MyMethod\x12\'.myproject.fakeapp.CustomNameForRequest\x1a(.myproject.fakeapp.CustomNameForResponse\"\x00\x12x\n\x17TestBaseProtoSerializer\x12*.myproject.fakeapp.BaseProtoExampleRequest\x1a/.myproject.fakeapp.BaseProtoExampleListResponse\"\x00\x12\x43\n\x0fTestEmptyMethod\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x32\xe1\x04\n\x16\x44\x65\x66\x61ultValueController\x12[\n\x06\x43reate\x12&.myproject.fakeapp.DefaultValueRequest\x1a\'.myproject.fakeapp.DefaultValueResponse\"\x00\x12R\n\x07\x44\x65stroy\x12-.myproject.fakeapp.DefaultValueDestroyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x61\n\x04List\x12*.myproject.fakeapp.DefaultValueListRequest\x1a+.myproject.fakeapp.DefaultValueListResponse\"\x00\x12o\n\rPartialUpdate\x12\x33.myproject.fakeapp.DefaultValuePartialUpdateRequest\x1a\'.myproject.fakeapp.DefaultValueResponse\"\x00\x12\x65\n\x08Retrieve\x12..myproject.fakeapp.DefaultValueRetrieveRequest\x1a\'.myproject.fakeapp.DefaultValueResponse\"\x00\x12[\n\x06Update\x12&.myproject.fakeapp.DefaultValueRequest\x1a\'.myproject.fakeapp.DefaultValueResponse\"\x00\x32\xd1\x02\n\x13\x45xceptionController\x12@\n\x0c\x41PIException\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12\x41\n\rGRPCException\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12l\n\x14StreamRaiseException\x12\x16.google.protobuf.Empty\x1a\x38.myproject.fakeapp.ExceptionStreamRaiseExceptionResponse\"\x00\x30\x01\x12G\n\x13UnaryRaiseException\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x32\xff\x01\n\x16\x46oreignModelController\x12\x61\n\x04List\x12*.myproject.fakeapp.ForeignModelListRequest\x1a+.myproject.fakeapp.ForeignModelListResponse\"\x00\x12\x81\x01\n\x08Retrieve\x12<.myproject.fakeapp.ForeignModelRetrieveCustomRetrieveRequest\x1a\x35.myproject.fakeapp.ForeignModelRetrieveCustomResponse\"\x00\x32\xa5\x01\n&ImportStructEvenInArrayModelController\x12{\n\x06\x43reate\x12\x36.myproject.fakeapp.ImportStructEvenInArrayModelRequest\x1a\x37.myproject.fakeapp.ImportStructEvenInArrayModelResponse\"\x00\x32\xa9\x05\n\x1cRecursiveTestModelController\x12g\n\x06\x43reate\x12,.myproject.fakeapp.RecursiveTestModelRequest\x1a-.myproject.fakeapp.RecursiveTestModelResponse\"\x00\x12X\n\x07\x44\x65stroy\x12\x33.myproject.fakeapp.RecursiveTestModelDestroyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12m\n\x04List\x12\x30.myproject.fakeapp.RecursiveTestModelListRequest\x1a\x31.myproject.fakeapp.RecursiveTestModelListResponse\"\x00\x12{\n\rPartialUpdate\x12\x39.myproject.fakeapp.RecursiveTestModelPartialUpdateRequest\x1a-.myproject.fakeapp.RecursiveTestModelResponse\"\x00\x12q\n\x08Retrieve\x12\x34.myproject.fakeapp.RecursiveTestModelRetrieveRequest\x1a-.myproject.fakeapp.RecursiveTestModelResponse\"\x00\x12g\n\x06Update\x12,.myproject.fakeapp.RecursiveTestModelRequest\x1a-.myproject.fakeapp.RecursiveTestModelResponse\"\x00\x32\x9d\x05\n\x1bRelatedFieldModelController\x12\x65\n\x06\x43reate\x12+.myproject.fakeapp.RelatedFieldModelRequest\x1a,.myproject.fakeapp.RelatedFieldModelResponse\"\x00\x12W\n\x07\x44\x65stroy\x12\x32.myproject.fakeapp.RelatedFieldModelDestroyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12k\n\x04List\x12/.myproject.fakeapp.RelatedFieldModelListRequest\x1a\x30.myproject.fakeapp.RelatedFieldModelListResponse\"\x00\x12y\n\rPartialUpdate\x12\x38.myproject.fakeapp.RelatedFieldModelPartialUpdateRequest\x1a,.myproject.fakeapp.RelatedFieldModelResponse\"\x00\x12o\n\x08Retrieve\x12\x33.myproject.fakeapp.RelatedFieldModelRetrieveRequest\x1a,.myproject.fakeapp.RelatedFieldModelResponse\"\x00\x12\x65\n\x06Update\x12+.myproject.fakeapp.RelatedFieldModelRequest\x1a,.myproject.fakeapp.RelatedFieldModelResponse\"\x00\x32\xe6\x05\n!SimpleRelatedFieldModelController\x12q\n\x06\x43reate\x12\x31.myproject.fakeapp.SimpleRelatedFieldModelRequest\x1a\x32.myproject.fakeapp.SimpleRelatedFieldModelResponse\"\x00\x12]\n\x07\x44\x65stroy\x12\x38.myproject.fakeapp.SimpleRelatedFieldModelDestroyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12w\n\x04List\x12\x35.myproject.fakeapp.SimpleRelatedFieldModelListRequest\x1a\x36.myproject.fakeapp.SimpleRelatedFieldModelListResponse\"\x00\x12\x85\x01\n\rPartialUpdate\x12>.myproject.fakeapp.SimpleRelatedFieldModelPartialUpdateRequest\x1a\x32.myproject.fakeapp.SimpleRelatedFieldModelResponse\"\x00\x12{\n\x08Retrieve\x12\x39.myproject.fakeapp.SimpleRelatedFieldModelRetrieveRequest\x1a\x32.myproject.fakeapp.SimpleRelatedFieldModelResponse\"\x00\x12q\n\x06Update\x12\x31.myproject.fakeapp.SimpleRelatedFieldModelRequest\x1a\x32.myproject.fakeapp.SimpleRelatedFieldModelResponse\"\x00\x32\xc0\x05\n\x1cSpecialFieldsModelController\x12g\n\x06\x43reate\x12,.myproject.fakeapp.SpecialFieldsModelRequest\x1a-.myproject.fakeapp.SpecialFieldsModelResponse\"\x00\x12X\n\x07\x44\x65stroy\x12\x33.myproject.fakeapp.SpecialFieldsModelDestroyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12m\n\x04List\x12\x30.myproject.fakeapp.SpecialFieldsModelListRequest\x1a\x31.myproject.fakeapp.SpecialFieldsModelListResponse\"\x00\x12{\n\rPartialUpdate\x12\x39.myproject.fakeapp.SpecialFieldsModelPartialUpdateRequest\x1a-.myproject.fakeapp.SpecialFieldsModelResponse\"\x00\x12\x87\x01\n\x08Retrieve\x12\x34.myproject.fakeapp.SpecialFieldsModelRetrieveRequest\x1a\x43.myproject.fakeapp.CustomRetrieveResponseSpecialFieldsModelResponse\"\x00\x12g\n\x06Update\x12,.myproject.fakeapp.SpecialFieldsModelRequest\x1a-.myproject.fakeapp.SpecialFieldsModelResponse\"\x00\x32\xfe\x01\n\x12StreamInController\x12k\n\x08StreamIn\x12*.myproject.fakeapp.StreamInStreamInRequest\x1a/.myproject.fakeapp.StreamInStreamInListResponse\"\x00(\x01\x12{\n\x0eStreamToStream\x12\x30.myproject.fakeapp.StreamInStreamToStreamRequest\x1a\x31.myproject.fakeapp.StreamInStreamToStreamResponse\"\x00(\x01\x30\x01\x32\xe5\x06\n\x1bSyncUnitTestModelController\x12]\n\x06\x43reate\x12\'.myproject.fakeapp.UnitTestModelRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x12S\n\x07\x44\x65stroy\x12..myproject.fakeapp.UnitTestModelDestroyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x63\n\x04List\x12+.myproject.fakeapp.UnitTestModelListRequest\x1a,.myproject.fakeapp.UnitTestModelListResponse\"\x00\x12\x8a\x01\n\x11ListWithExtraArgs\x12<.myproject.fakeapp.SyncUnitTestModelListWithExtraArgsRequest\x1a\x35.myproject.fakeapp.UnitTestModelListExtraArgsResponse\"\x00\x12q\n\rPartialUpdate\x12\x34.myproject.fakeapp.UnitTestModelPartialUpdateRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x12g\n\x08Retrieve\x12/.myproject.fakeapp.UnitTestModelRetrieveRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x12\x65\n\x06Stream\x12-.myproject.fakeapp.UnitTestModelStreamRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x30\x01\x12]\n\x06Update\x12\'.myproject.fakeapp.UnitTestModelRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x32\xdd\x06\n\x17UnitTestModelController\x12]\n\x06\x43reate\x12\'.myproject.fakeapp.UnitTestModelRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x12S\n\x07\x44\x65stroy\x12..myproject.fakeapp.UnitTestModelDestroyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x63\n\x04List\x12+.myproject.fakeapp.UnitTestModelListRequest\x1a,.myproject.fakeapp.UnitTestModelListResponse\"\x00\x12\x86\x01\n\x11ListWithExtraArgs\x12\x38.myproject.fakeapp.UnitTestModelListWithExtraArgsRequest\x1a\x35.myproject.fakeapp.UnitTestModelListExtraArgsResponse\"\x00\x12q\n\rPartialUpdate\x12\x34.myproject.fakeapp.UnitTestModelPartialUpdateRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x12g\n\x08Retrieve\x12/.myproject.fakeapp.UnitTestModelRetrieveRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x12\x65\n\x06Stream\x12-.myproject.fakeapp.UnitTestModelStreamRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x30\x01\x12]\n\x06Update\x12\'.myproject.fakeapp.UnitTestModelRequest\x1a(.myproject.fakeapp.UnitTestModelResponse\"\x00\x32\xad\x08\n\'UnitTestModelWithStructFilterController\x12}\n\x06\x43reate\x12\x37.myproject.fakeapp.UnitTestModelWithStructFilterRequest\x1a\x38.myproject.fakeapp.UnitTestModelWithStructFilterResponse\"\x00\x12\x63\n\x07\x44\x65stroy\x12>.myproject.fakeapp.UnitTestModelWithStructFilterDestroyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12s\n\x0f\x45mptyWithFilter\x12\x46.myproject.fakeapp.UnitTestModelWithStructFilterEmptyWithFilterRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x83\x01\n\x04List\x12;.myproject.fakeapp.UnitTestModelWithStructFilterListRequest\x1a<.myproject.fakeapp.UnitTestModelWithStructFilterListResponse\"\x00\x12\x91\x01\n\rPartialUpdate\x12\x44.myproject.fakeapp.UnitTestModelWithStructFilterPartialUpdateRequest\x1a\x38.myproject.fakeapp.UnitTestModelWithStructFilterResponse\"\x00\x12\x87\x01\n\x08Retrieve\x12?.myproject.fakeapp.UnitTestModelWithStructFilterRetrieveRequest\x1a\x38.myproject.fakeapp.UnitTestModelWithStructFilterResponse\"\x00\x12\x85\x01\n\x06Stream\x12=.myproject.fakeapp.UnitTestModelWithStructFilterStreamRequest\x1a\x38.myproject.fakeapp.UnitTestModelWithStructFilterResponse\"\x00\x30\x01\x12}\n\x06Update\x12\x37.myproject.fakeapp.UnitTestModelWithStructFilterRequest\x1a\x38.myproject.fakeapp.UnitTestModelWithStructFilterResponse\"\x00\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -52,173 +52,189 @@ _globals['_BASICPROTOLISTCHILDLISTRESPONSE']._serialized_start=1273 _globals['_BASICPROTOLISTCHILDLISTRESPONSE']._serialized_end=1386 _globals['_BASICPROTOLISTCHILDREQUEST']._serialized_start=1388 - _globals['_BASICPROTOLISTCHILDREQUEST']._serialized_end=1471 - _globals['_BASICPROTOLISTCHILDRESPONSE']._serialized_start=1473 - _globals['_BASICPROTOLISTCHILDRESPONSE']._serialized_end=1557 - _globals['_BASICSERVICELISTRESPONSE']._serialized_start=1559 - _globals['_BASICSERVICELISTRESPONSE']._serialized_end=1658 - _globals['_BASICSERVICEREQUEST']._serialized_start=1661 - _globals['_BASICSERVICEREQUEST']._serialized_end=1838 - _globals['_BASICSERVICERESPONSE']._serialized_start=1841 - _globals['_BASICSERVICERESPONSE']._serialized_end=1996 - _globals['_CUSTOMMIXPARAMFORLISTREQUEST']._serialized_start=1998 - _globals['_CUSTOMMIXPARAMFORLISTREQUEST']._serialized_end=2105 - _globals['_CUSTOMMIXPARAMFORREQUEST']._serialized_start=2107 - _globals['_CUSTOMMIXPARAMFORREQUEST']._serialized_end=2152 - _globals['_CUSTOMNAMEFORREQUEST']._serialized_start=2154 - _globals['_CUSTOMNAMEFORREQUEST']._serialized_end=2195 - _globals['_CUSTOMNAMEFORRESPONSE']._serialized_start=2197 - _globals['_CUSTOMNAMEFORRESPONSE']._serialized_end=2239 - _globals['_CUSTOMRETRIEVERESPONSESPECIALFIELDSMODELRESPONSE']._serialized_start=2242 - _globals['_CUSTOMRETRIEVERESPONSESPECIALFIELDSMODELRESPONSE']._serialized_end=2390 - _globals['_EXCEPTIONSTREAMRAISEEXCEPTIONRESPONSE']._serialized_start=2392 - _globals['_EXCEPTIONSTREAMRAISEEXCEPTIONRESPONSE']._serialized_end=2443 - _globals['_FOREIGNMODELLISTREQUEST']._serialized_start=2445 - _globals['_FOREIGNMODELLISTREQUEST']._serialized_end=2470 - _globals['_FOREIGNMODELLISTRESPONSE']._serialized_start=2472 - _globals['_FOREIGNMODELLISTRESPONSE']._serialized_end=2571 - _globals['_FOREIGNMODELRESPONSE']._serialized_start=2573 - _globals['_FOREIGNMODELRESPONSE']._serialized_end=2623 - _globals['_FOREIGNMODELRETRIEVECUSTOMRESPONSE']._serialized_start=2625 - _globals['_FOREIGNMODELRETRIEVECUSTOMRESPONSE']._serialized_end=2691 - _globals['_FOREIGNMODELRETRIEVECUSTOMRETRIEVEREQUEST']._serialized_start=2693 - _globals['_FOREIGNMODELRETRIEVECUSTOMRETRIEVEREQUEST']._serialized_end=2750 - _globals['_IMPORTSTRUCTEVENINARRAYMODELREQUEST']._serialized_start=2752 - _globals['_IMPORTSTRUCTEVENINARRAYMODELREQUEST']._serialized_end=2851 - _globals['_IMPORTSTRUCTEVENINARRAYMODELRESPONSE']._serialized_start=2853 - _globals['_IMPORTSTRUCTEVENINARRAYMODELRESPONSE']._serialized_end=2953 - _globals['_MANYMANYMODELREQUEST']._serialized_start=2955 - _globals['_MANYMANYMODELREQUEST']._serialized_end=3040 - _globals['_MANYMANYMODELRESPONSE']._serialized_start=3042 - _globals['_MANYMANYMODELRESPONSE']._serialized_end=3093 - _globals['_RECURSIVETESTMODELDESTROYREQUEST']._serialized_start=3095 - _globals['_RECURSIVETESTMODELDESTROYREQUEST']._serialized_end=3143 - _globals['_RECURSIVETESTMODELLISTREQUEST']._serialized_start=3145 - _globals['_RECURSIVETESTMODELLISTREQUEST']._serialized_end=3176 - _globals['_RECURSIVETESTMODELLISTRESPONSE']._serialized_start=3178 - _globals['_RECURSIVETESTMODELLISTRESPONSE']._serialized_end=3289 - _globals['_RECURSIVETESTMODELPARTIALUPDATEREQUEST']._serialized_start=3292 - _globals['_RECURSIVETESTMODELPARTIALUPDATEREQUEST']._serialized_end=3504 - _globals['_RECURSIVETESTMODELREQUEST']._serialized_start=3507 - _globals['_RECURSIVETESTMODELREQUEST']._serialized_end=3674 - _globals['_RECURSIVETESTMODELRESPONSE']._serialized_start=3677 - _globals['_RECURSIVETESTMODELRESPONSE']._serialized_end=3847 - _globals['_RECURSIVETESTMODELRETRIEVEREQUEST']._serialized_start=3849 - _globals['_RECURSIVETESTMODELRETRIEVEREQUEST']._serialized_end=3898 - _globals['_RELATEDFIELDMODELDESTROYREQUEST']._serialized_start=3900 - _globals['_RELATEDFIELDMODELDESTROYREQUEST']._serialized_end=3947 - _globals['_RELATEDFIELDMODELLISTREQUEST']._serialized_start=3949 - _globals['_RELATEDFIELDMODELLISTREQUEST']._serialized_end=3979 - _globals['_RELATEDFIELDMODELLISTRESPONSE']._serialized_start=3981 - _globals['_RELATEDFIELDMODELLISTRESPONSE']._serialized_end=4105 - _globals['_RELATEDFIELDMODELPARTIALUPDATEREQUEST']._serialized_start=4108 - _globals['_RELATEDFIELDMODELPARTIALUPDATEREQUEST']._serialized_end=4308 - _globals['_RELATEDFIELDMODELREQUEST']._serialized_start=4311 - _globals['_RELATEDFIELDMODELREQUEST']._serialized_end=4466 - _globals['_RELATEDFIELDMODELRESPONSE']._serialized_start=4469 - _globals['_RELATEDFIELDMODELRESPONSE']._serialized_end=4800 - _globals['_RELATEDFIELDMODELRETRIEVEREQUEST']._serialized_start=4802 - _globals['_RELATEDFIELDMODELRETRIEVEREQUEST']._serialized_end=4850 - _globals['_SIMPLERELATEDFIELDMODELDESTROYREQUEST']._serialized_start=4852 - _globals['_SIMPLERELATEDFIELDMODELDESTROYREQUEST']._serialized_end=4905 - _globals['_SIMPLERELATEDFIELDMODELLISTREQUEST']._serialized_start=4907 - _globals['_SIMPLERELATEDFIELDMODELLISTREQUEST']._serialized_end=4943 - _globals['_SIMPLERELATEDFIELDMODELLISTRESPONSE']._serialized_start=4945 - _globals['_SIMPLERELATEDFIELDMODELLISTRESPONSE']._serialized_end=5066 - _globals['_SIMPLERELATEDFIELDMODELPARTIALUPDATEREQUEST']._serialized_start=5069 - _globals['_SIMPLERELATEDFIELDMODELPARTIALUPDATEREQUEST']._serialized_end=5315 - _globals['_SIMPLERELATEDFIELDMODELREQUEST']._serialized_start=5318 - _globals['_SIMPLERELATEDFIELDMODELREQUEST']._serialized_end=5519 - _globals['_SIMPLERELATEDFIELDMODELRESPONSE']._serialized_start=5522 - _globals['_SIMPLERELATEDFIELDMODELRESPONSE']._serialized_end=5724 - _globals['_SIMPLERELATEDFIELDMODELRETRIEVEREQUEST']._serialized_start=5726 - _globals['_SIMPLERELATEDFIELDMODELRETRIEVEREQUEST']._serialized_end=5780 - _globals['_SPECIALFIELDSMODELDESTROYREQUEST']._serialized_start=5782 - _globals['_SPECIALFIELDSMODELDESTROYREQUEST']._serialized_end=5830 - _globals['_SPECIALFIELDSMODELLISTREQUEST']._serialized_start=5832 - _globals['_SPECIALFIELDSMODELLISTREQUEST']._serialized_end=5863 - _globals['_SPECIALFIELDSMODELLISTRESPONSE']._serialized_start=5865 - _globals['_SPECIALFIELDSMODELLISTRESPONSE']._serialized_end=5976 - _globals['_SPECIALFIELDSMODELPARTIALUPDATEREQUEST']._serialized_start=5979 - _globals['_SPECIALFIELDSMODELPARTIALUPDATEREQUEST']._serialized_end=6130 - _globals['_SPECIALFIELDSMODELREQUEST']._serialized_start=6132 - _globals['_SPECIALFIELDSMODELREQUEST']._serialized_end=6238 - _globals['_SPECIALFIELDSMODELRESPONSE']._serialized_start=6240 - _globals['_SPECIALFIELDSMODELRESPONSE']._serialized_end=6363 - _globals['_SPECIALFIELDSMODELRETRIEVEREQUEST']._serialized_start=6365 - _globals['_SPECIALFIELDSMODELRETRIEVEREQUEST']._serialized_end=6414 - _globals['_STREAMINSTREAMINLISTRESPONSE']._serialized_start=6416 - _globals['_STREAMINSTREAMINLISTRESPONSE']._serialized_end=6523 - _globals['_STREAMINSTREAMINREQUEST']._serialized_start=6525 - _globals['_STREAMINSTREAMINREQUEST']._serialized_end=6564 - _globals['_STREAMINSTREAMINRESPONSE']._serialized_start=6566 - _globals['_STREAMINSTREAMINRESPONSE']._serialized_end=6607 - _globals['_STREAMINSTREAMTOSTREAMREQUEST']._serialized_start=6609 - _globals['_STREAMINSTREAMTOSTREAMREQUEST']._serialized_end=6654 - _globals['_STREAMINSTREAMTOSTREAMRESPONSE']._serialized_start=6656 - _globals['_STREAMINSTREAMTOSTREAMRESPONSE']._serialized_end=6702 - _globals['_SYNCUNITTESTMODELLISTWITHEXTRAARGSREQUEST']._serialized_start=6704 - _globals['_SYNCUNITTESTMODELLISTWITHEXTRAARGSREQUEST']._serialized_end=6765 - _globals['_UNITTESTMODELDESTROYREQUEST']._serialized_start=6767 - _globals['_UNITTESTMODELDESTROYREQUEST']._serialized_end=6808 - _globals['_UNITTESTMODELLISTEXTRAARGSRESPONSE']._serialized_start=6811 - _globals['_UNITTESTMODELLISTEXTRAARGSRESPONSE']._serialized_end=6953 - _globals['_UNITTESTMODELLISTREQUEST']._serialized_start=6955 - _globals['_UNITTESTMODELLISTREQUEST']._serialized_end=6981 - _globals['_UNITTESTMODELLISTRESPONSE']._serialized_start=6983 - _globals['_UNITTESTMODELLISTRESPONSE']._serialized_end=7084 - _globals['_UNITTESTMODELLISTWITHEXTRAARGSREQUEST']._serialized_start=7086 - _globals['_UNITTESTMODELLISTWITHEXTRAARGSREQUEST']._serialized_end=7143 - _globals['_UNITTESTMODELPARTIALUPDATEREQUEST']._serialized_start=7145 - _globals['_UNITTESTMODELPARTIALUPDATEREQUEST']._serialized_end=7267 - _globals['_UNITTESTMODELREQUEST']._serialized_start=7269 - _globals['_UNITTESTMODELREQUEST']._serialized_end=7346 - _globals['_UNITTESTMODELRESPONSE']._serialized_start=7348 - _globals['_UNITTESTMODELRESPONSE']._serialized_end=7426 - _globals['_UNITTESTMODELRETRIEVEREQUEST']._serialized_start=7428 - _globals['_UNITTESTMODELRETRIEVEREQUEST']._serialized_end=7470 - _globals['_UNITTESTMODELSTREAMREQUEST']._serialized_start=7472 - _globals['_UNITTESTMODELSTREAMREQUEST']._serialized_end=7500 - _globals['_UNITTESTMODELWITHSTRUCTFILTERDESTROYREQUEST']._serialized_start=7502 - _globals['_UNITTESTMODELWITHSTRUCTFILTERDESTROYREQUEST']._serialized_end=7559 - _globals['_UNITTESTMODELWITHSTRUCTFILTEREMPTYWITHFILTERREQUEST']._serialized_start=7562 - _globals['_UNITTESTMODELWITHSTRUCTFILTEREMPTYWITHFILTERREQUEST']._serialized_end=7743 - _globals['_UNITTESTMODELWITHSTRUCTFILTERLISTREQUEST']._serialized_start=7746 - _globals['_UNITTESTMODELWITHSTRUCTFILTERLISTREQUEST']._serialized_end=7916 - _globals['_UNITTESTMODELWITHSTRUCTFILTERLISTRESPONSE']._serialized_start=7919 - _globals['_UNITTESTMODELWITHSTRUCTFILTERLISTRESPONSE']._serialized_end=8052 - _globals['_UNITTESTMODELWITHSTRUCTFILTERPARTIALUPDATEREQUEST']._serialized_start=8055 - _globals['_UNITTESTMODELWITHSTRUCTFILTERPARTIALUPDATEREQUEST']._serialized_end=8193 - _globals['_UNITTESTMODELWITHSTRUCTFILTERREQUEST']._serialized_start=8195 - _globals['_UNITTESTMODELWITHSTRUCTFILTERREQUEST']._serialized_end=8288 - _globals['_UNITTESTMODELWITHSTRUCTFILTERRESPONSE']._serialized_start=8290 - _globals['_UNITTESTMODELWITHSTRUCTFILTERRESPONSE']._serialized_end=8384 - _globals['_UNITTESTMODELWITHSTRUCTFILTERRETRIEVEREQUEST']._serialized_start=8386 - _globals['_UNITTESTMODELWITHSTRUCTFILTERRETRIEVEREQUEST']._serialized_end=8444 - _globals['_UNITTESTMODELWITHSTRUCTFILTERSTREAMREQUEST']._serialized_start=8446 - _globals['_UNITTESTMODELWITHSTRUCTFILTERSTREAMREQUEST']._serialized_end=8490 - _globals['_BASICCONTROLLER']._serialized_start=8493 - _globals['_BASICCONTROLLER']._serialized_end=9719 - _globals['_EXCEPTIONCONTROLLER']._serialized_start=9722 - _globals['_EXCEPTIONCONTROLLER']._serialized_end=10059 - _globals['_FOREIGNMODELCONTROLLER']._serialized_start=10062 - _globals['_FOREIGNMODELCONTROLLER']._serialized_end=10317 - _globals['_IMPORTSTRUCTEVENINARRAYMODELCONTROLLER']._serialized_start=10320 - _globals['_IMPORTSTRUCTEVENINARRAYMODELCONTROLLER']._serialized_end=10485 - _globals['_RECURSIVETESTMODELCONTROLLER']._serialized_start=10488 - _globals['_RECURSIVETESTMODELCONTROLLER']._serialized_end=11169 - _globals['_RELATEDFIELDMODELCONTROLLER']._serialized_start=11172 - _globals['_RELATEDFIELDMODELCONTROLLER']._serialized_end=11841 - _globals['_SIMPLERELATEDFIELDMODELCONTROLLER']._serialized_start=11844 - _globals['_SIMPLERELATEDFIELDMODELCONTROLLER']._serialized_end=12586 - _globals['_SPECIALFIELDSMODELCONTROLLER']._serialized_start=12589 - _globals['_SPECIALFIELDSMODELCONTROLLER']._serialized_end=13293 - _globals['_STREAMINCONTROLLER']._serialized_start=13296 - _globals['_STREAMINCONTROLLER']._serialized_end=13550 - _globals['_SYNCUNITTESTMODELCONTROLLER']._serialized_start=13553 - _globals['_SYNCUNITTESTMODELCONTROLLER']._serialized_end=14422 - _globals['_UNITTESTMODELCONTROLLER']._serialized_start=14425 - _globals['_UNITTESTMODELCONTROLLER']._serialized_end=15286 - _globals['_UNITTESTMODELWITHSTRUCTFILTERCONTROLLER']._serialized_start=15289 - _globals['_UNITTESTMODELWITHSTRUCTFILTERCONTROLLER']._serialized_end=16358 + _globals['_BASICPROTOLISTCHILDREQUEST']._serialized_end=1483 + _globals['_BASICPROTOLISTCHILDRESPONSE']._serialized_start=1485 + _globals['_BASICPROTOLISTCHILDRESPONSE']._serialized_end=1581 + _globals['_BASICSERVICELISTRESPONSE']._serialized_start=1583 + _globals['_BASICSERVICELISTRESPONSE']._serialized_end=1682 + _globals['_BASICSERVICEREQUEST']._serialized_start=1685 + _globals['_BASICSERVICEREQUEST']._serialized_end=1862 + _globals['_BASICSERVICERESPONSE']._serialized_start=1865 + _globals['_BASICSERVICERESPONSE']._serialized_end=2020 + _globals['_CUSTOMMIXPARAMFORLISTREQUEST']._serialized_start=2022 + _globals['_CUSTOMMIXPARAMFORLISTREQUEST']._serialized_end=2129 + _globals['_CUSTOMMIXPARAMFORREQUEST']._serialized_start=2131 + _globals['_CUSTOMMIXPARAMFORREQUEST']._serialized_end=2176 + _globals['_CUSTOMNAMEFORREQUEST']._serialized_start=2178 + _globals['_CUSTOMNAMEFORREQUEST']._serialized_end=2219 + _globals['_CUSTOMNAMEFORRESPONSE']._serialized_start=2221 + _globals['_CUSTOMNAMEFORRESPONSE']._serialized_end=2263 + _globals['_CUSTOMRETRIEVERESPONSESPECIALFIELDSMODELRESPONSE']._serialized_start=2266 + _globals['_CUSTOMRETRIEVERESPONSESPECIALFIELDSMODELRESPONSE']._serialized_end=2458 + _globals['_DEFAULTVALUEDESTROYREQUEST']._serialized_start=2460 + _globals['_DEFAULTVALUEDESTROYREQUEST']._serialized_end=2500 + _globals['_DEFAULTVALUELISTREQUEST']._serialized_start=2502 + _globals['_DEFAULTVALUELISTREQUEST']._serialized_end=2527 + _globals['_DEFAULTVALUELISTRESPONSE']._serialized_start=2529 + _globals['_DEFAULTVALUELISTRESPONSE']._serialized_end=2628 + _globals['_DEFAULTVALUEPARTIALUPDATEREQUEST']._serialized_start=2631 + _globals['_DEFAULTVALUEPARTIALUPDATEREQUEST']._serialized_end=3832 + _globals['_DEFAULTVALUEREQUEST']._serialized_start=3835 + _globals['_DEFAULTVALUEREQUEST']._serialized_end=4991 + _globals['_DEFAULTVALUERESPONSE']._serialized_start=4994 + _globals['_DEFAULTVALUERESPONSE']._serialized_end=6151 + _globals['_DEFAULTVALUERETRIEVEREQUEST']._serialized_start=6153 + _globals['_DEFAULTVALUERETRIEVEREQUEST']._serialized_end=6194 + _globals['_EXCEPTIONSTREAMRAISEEXCEPTIONRESPONSE']._serialized_start=6196 + _globals['_EXCEPTIONSTREAMRAISEEXCEPTIONRESPONSE']._serialized_end=6247 + _globals['_FOREIGNMODELLISTREQUEST']._serialized_start=6249 + _globals['_FOREIGNMODELLISTREQUEST']._serialized_end=6274 + _globals['_FOREIGNMODELLISTRESPONSE']._serialized_start=6276 + _globals['_FOREIGNMODELLISTRESPONSE']._serialized_end=6375 + _globals['_FOREIGNMODELRESPONSE']._serialized_start=6377 + _globals['_FOREIGNMODELRESPONSE']._serialized_end=6441 + _globals['_FOREIGNMODELRETRIEVECUSTOMRESPONSE']._serialized_start=6443 + _globals['_FOREIGNMODELRETRIEVECUSTOMRESPONSE']._serialized_end=6525 + _globals['_FOREIGNMODELRETRIEVECUSTOMRETRIEVEREQUEST']._serialized_start=6527 + _globals['_FOREIGNMODELRETRIEVECUSTOMRETRIEVEREQUEST']._serialized_end=6584 + _globals['_IMPORTSTRUCTEVENINARRAYMODELREQUEST']._serialized_start=6586 + _globals['_IMPORTSTRUCTEVENINARRAYMODELREQUEST']._serialized_end=6699 + _globals['_IMPORTSTRUCTEVENINARRAYMODELRESPONSE']._serialized_start=6701 + _globals['_IMPORTSTRUCTEVENINARRAYMODELRESPONSE']._serialized_end=6815 + _globals['_MANYMANYMODELREQUEST']._serialized_start=6817 + _globals['_MANYMANYMODELREQUEST']._serialized_end=6916 + _globals['_MANYMANYMODELRESPONSE']._serialized_start=6918 + _globals['_MANYMANYMODELRESPONSE']._serialized_end=6983 + _globals['_RECURSIVETESTMODELDESTROYREQUEST']._serialized_start=6985 + _globals['_RECURSIVETESTMODELDESTROYREQUEST']._serialized_end=7033 + _globals['_RECURSIVETESTMODELLISTREQUEST']._serialized_start=7035 + _globals['_RECURSIVETESTMODELLISTREQUEST']._serialized_end=7066 + _globals['_RECURSIVETESTMODELLISTRESPONSE']._serialized_start=7068 + _globals['_RECURSIVETESTMODELLISTRESPONSE']._serialized_end=7179 + _globals['_RECURSIVETESTMODELPARTIALUPDATEREQUEST']._serialized_start=7182 + _globals['_RECURSIVETESTMODELPARTIALUPDATEREQUEST']._serialized_end=7424 + _globals['_RECURSIVETESTMODELREQUEST']._serialized_start=7427 + _globals['_RECURSIVETESTMODELREQUEST']._serialized_end=7624 + _globals['_RECURSIVETESTMODELRESPONSE']._serialized_start=7627 + _globals['_RECURSIVETESTMODELRESPONSE']._serialized_end=7827 + _globals['_RECURSIVETESTMODELRETRIEVEREQUEST']._serialized_start=7829 + _globals['_RECURSIVETESTMODELRETRIEVEREQUEST']._serialized_end=7878 + _globals['_RELATEDFIELDMODELDESTROYREQUEST']._serialized_start=7880 + _globals['_RELATEDFIELDMODELDESTROYREQUEST']._serialized_end=7927 + _globals['_RELATEDFIELDMODELLISTREQUEST']._serialized_start=7929 + _globals['_RELATEDFIELDMODELLISTREQUEST']._serialized_end=7959 + _globals['_RELATEDFIELDMODELLISTRESPONSE']._serialized_start=7961 + _globals['_RELATEDFIELDMODELLISTRESPONSE']._serialized_end=8085 + _globals['_RELATEDFIELDMODELPARTIALUPDATEREQUEST']._serialized_start=8088 + _globals['_RELATEDFIELDMODELPARTIALUPDATEREQUEST']._serialized_end=8302 + _globals['_RELATEDFIELDMODELREQUEST']._serialized_start=8305 + _globals['_RELATEDFIELDMODELREQUEST']._serialized_end=8474 + _globals['_RELATEDFIELDMODELRESPONSE']._serialized_start=8477 + _globals['_RELATEDFIELDMODELRESPONSE']._serialized_end=8898 + _globals['_RELATEDFIELDMODELRETRIEVEREQUEST']._serialized_start=8900 + _globals['_RELATEDFIELDMODELRETRIEVEREQUEST']._serialized_end=8948 + _globals['_SIMPLERELATEDFIELDMODELDESTROYREQUEST']._serialized_start=8950 + _globals['_SIMPLERELATEDFIELDMODELDESTROYREQUEST']._serialized_end=9003 + _globals['_SIMPLERELATEDFIELDMODELLISTREQUEST']._serialized_start=9005 + _globals['_SIMPLERELATEDFIELDMODELLISTREQUEST']._serialized_end=9041 + _globals['_SIMPLERELATEDFIELDMODELLISTRESPONSE']._serialized_start=9043 + _globals['_SIMPLERELATEDFIELDMODELLISTRESPONSE']._serialized_end=9164 + _globals['_SIMPLERELATEDFIELDMODELPARTIALUPDATEREQUEST']._serialized_start=9167 + _globals['_SIMPLERELATEDFIELDMODELPARTIALUPDATEREQUEST']._serialized_end=9427 + _globals['_SIMPLERELATEDFIELDMODELREQUEST']._serialized_start=9430 + _globals['_SIMPLERELATEDFIELDMODELREQUEST']._serialized_end=9645 + _globals['_SIMPLERELATEDFIELDMODELRESPONSE']._serialized_start=9648 + _globals['_SIMPLERELATEDFIELDMODELRESPONSE']._serialized_end=9864 + _globals['_SIMPLERELATEDFIELDMODELRETRIEVEREQUEST']._serialized_start=9866 + _globals['_SIMPLERELATEDFIELDMODELRETRIEVEREQUEST']._serialized_end=9920 + _globals['_SPECIALFIELDSMODELDESTROYREQUEST']._serialized_start=9922 + _globals['_SPECIALFIELDSMODELDESTROYREQUEST']._serialized_end=9970 + _globals['_SPECIALFIELDSMODELLISTREQUEST']._serialized_start=9972 + _globals['_SPECIALFIELDSMODELLISTREQUEST']._serialized_end=10003 + _globals['_SPECIALFIELDSMODELLISTRESPONSE']._serialized_start=10005 + _globals['_SPECIALFIELDSMODELLISTRESPONSE']._serialized_end=10116 + _globals['_SPECIALFIELDSMODELPARTIALUPDATEREQUEST']._serialized_start=10119 + _globals['_SPECIALFIELDSMODELPARTIALUPDATEREQUEST']._serialized_end=10304 + _globals['_SPECIALFIELDSMODELREQUEST']._serialized_start=10307 + _globals['_SPECIALFIELDSMODELREQUEST']._serialized_end=10447 + _globals['_SPECIALFIELDSMODELRESPONSE']._serialized_start=10450 + _globals['_SPECIALFIELDSMODELRESPONSE']._serialized_end=10623 + _globals['_SPECIALFIELDSMODELRETRIEVEREQUEST']._serialized_start=10625 + _globals['_SPECIALFIELDSMODELRETRIEVEREQUEST']._serialized_end=10674 + _globals['_STREAMINSTREAMINLISTRESPONSE']._serialized_start=10676 + _globals['_STREAMINSTREAMINLISTRESPONSE']._serialized_end=10783 + _globals['_STREAMINSTREAMINREQUEST']._serialized_start=10785 + _globals['_STREAMINSTREAMINREQUEST']._serialized_end=10824 + _globals['_STREAMINSTREAMINRESPONSE']._serialized_start=10826 + _globals['_STREAMINSTREAMINRESPONSE']._serialized_end=10867 + _globals['_STREAMINSTREAMTOSTREAMREQUEST']._serialized_start=10869 + _globals['_STREAMINSTREAMTOSTREAMREQUEST']._serialized_end=10914 + _globals['_STREAMINSTREAMTOSTREAMRESPONSE']._serialized_start=10916 + _globals['_STREAMINSTREAMTOSTREAMRESPONSE']._serialized_end=10962 + _globals['_SYNCUNITTESTMODELLISTWITHEXTRAARGSREQUEST']._serialized_start=10964 + _globals['_SYNCUNITTESTMODELLISTWITHEXTRAARGSREQUEST']._serialized_end=11025 + _globals['_UNITTESTMODELDESTROYREQUEST']._serialized_start=11027 + _globals['_UNITTESTMODELDESTROYREQUEST']._serialized_end=11068 + _globals['_UNITTESTMODELLISTEXTRAARGSRESPONSE']._serialized_start=11071 + _globals['_UNITTESTMODELLISTEXTRAARGSRESPONSE']._serialized_end=11213 + _globals['_UNITTESTMODELLISTREQUEST']._serialized_start=11215 + _globals['_UNITTESTMODELLISTREQUEST']._serialized_end=11241 + _globals['_UNITTESTMODELLISTRESPONSE']._serialized_start=11243 + _globals['_UNITTESTMODELLISTRESPONSE']._serialized_end=11344 + _globals['_UNITTESTMODELLISTWITHEXTRAARGSREQUEST']._serialized_start=11346 + _globals['_UNITTESTMODELLISTWITHEXTRAARGSREQUEST']._serialized_end=11403 + _globals['_UNITTESTMODELPARTIALUPDATEREQUEST']._serialized_start=11406 + _globals['_UNITTESTMODELPARTIALUPDATEREQUEST']._serialized_end=11540 + _globals['_UNITTESTMODELREQUEST']._serialized_start=11542 + _globals['_UNITTESTMODELREQUEST']._serialized_end=11631 + _globals['_UNITTESTMODELRESPONSE']._serialized_start=11633 + _globals['_UNITTESTMODELRESPONSE']._serialized_end=11723 + _globals['_UNITTESTMODELRETRIEVEREQUEST']._serialized_start=11725 + _globals['_UNITTESTMODELRETRIEVEREQUEST']._serialized_end=11767 + _globals['_UNITTESTMODELSTREAMREQUEST']._serialized_start=11769 + _globals['_UNITTESTMODELSTREAMREQUEST']._serialized_end=11797 + _globals['_UNITTESTMODELWITHSTRUCTFILTERDESTROYREQUEST']._serialized_start=11799 + _globals['_UNITTESTMODELWITHSTRUCTFILTERDESTROYREQUEST']._serialized_end=11856 + _globals['_UNITTESTMODELWITHSTRUCTFILTEREMPTYWITHFILTERREQUEST']._serialized_start=11859 + _globals['_UNITTESTMODELWITHSTRUCTFILTEREMPTYWITHFILTERREQUEST']._serialized_end=12040 + _globals['_UNITTESTMODELWITHSTRUCTFILTERLISTREQUEST']._serialized_start=12043 + _globals['_UNITTESTMODELWITHSTRUCTFILTERLISTREQUEST']._serialized_end=12213 + _globals['_UNITTESTMODELWITHSTRUCTFILTERLISTRESPONSE']._serialized_start=12216 + _globals['_UNITTESTMODELWITHSTRUCTFILTERLISTRESPONSE']._serialized_end=12349 + _globals['_UNITTESTMODELWITHSTRUCTFILTERPARTIALUPDATEREQUEST']._serialized_start=12352 + _globals['_UNITTESTMODELWITHSTRUCTFILTERPARTIALUPDATEREQUEST']._serialized_end=12502 + _globals['_UNITTESTMODELWITHSTRUCTFILTERREQUEST']._serialized_start=12504 + _globals['_UNITTESTMODELWITHSTRUCTFILTERREQUEST']._serialized_end=12609 + _globals['_UNITTESTMODELWITHSTRUCTFILTERRESPONSE']._serialized_start=12611 + _globals['_UNITTESTMODELWITHSTRUCTFILTERRESPONSE']._serialized_end=12717 + _globals['_UNITTESTMODELWITHSTRUCTFILTERRETRIEVEREQUEST']._serialized_start=12719 + _globals['_UNITTESTMODELWITHSTRUCTFILTERRETRIEVEREQUEST']._serialized_end=12777 + _globals['_UNITTESTMODELWITHSTRUCTFILTERSTREAMREQUEST']._serialized_start=12779 + _globals['_UNITTESTMODELWITHSTRUCTFILTERSTREAMREQUEST']._serialized_end=12823 + _globals['_BASICCONTROLLER']._serialized_start=12826 + _globals['_BASICCONTROLLER']._serialized_end=14052 + _globals['_DEFAULTVALUECONTROLLER']._serialized_start=14055 + _globals['_DEFAULTVALUECONTROLLER']._serialized_end=14664 + _globals['_EXCEPTIONCONTROLLER']._serialized_start=14667 + _globals['_EXCEPTIONCONTROLLER']._serialized_end=15004 + _globals['_FOREIGNMODELCONTROLLER']._serialized_start=15007 + _globals['_FOREIGNMODELCONTROLLER']._serialized_end=15262 + _globals['_IMPORTSTRUCTEVENINARRAYMODELCONTROLLER']._serialized_start=15265 + _globals['_IMPORTSTRUCTEVENINARRAYMODELCONTROLLER']._serialized_end=15430 + _globals['_RECURSIVETESTMODELCONTROLLER']._serialized_start=15433 + _globals['_RECURSIVETESTMODELCONTROLLER']._serialized_end=16114 + _globals['_RELATEDFIELDMODELCONTROLLER']._serialized_start=16117 + _globals['_RELATEDFIELDMODELCONTROLLER']._serialized_end=16786 + _globals['_SIMPLERELATEDFIELDMODELCONTROLLER']._serialized_start=16789 + _globals['_SIMPLERELATEDFIELDMODELCONTROLLER']._serialized_end=17531 + _globals['_SPECIALFIELDSMODELCONTROLLER']._serialized_start=17534 + _globals['_SPECIALFIELDSMODELCONTROLLER']._serialized_end=18238 + _globals['_STREAMINCONTROLLER']._serialized_start=18241 + _globals['_STREAMINCONTROLLER']._serialized_end=18495 + _globals['_SYNCUNITTESTMODELCONTROLLER']._serialized_start=18498 + _globals['_SYNCUNITTESTMODELCONTROLLER']._serialized_end=19367 + _globals['_UNITTESTMODELCONTROLLER']._serialized_start=19370 + _globals['_UNITTESTMODELCONTROLLER']._serialized_end=20231 + _globals['_UNITTESTMODELWITHSTRUCTFILTERCONTROLLER']._serialized_start=20234 + _globals['_UNITTESTMODELWITHSTRUCTFILTERCONTROLLER']._serialized_end=21303 # @@protoc_insertion_point(module_scope) diff --git a/django_socio_grpc/tests/fakeapp/grpc/fakeapp_pb2_grpc.py b/django_socio_grpc/tests/fakeapp/grpc/fakeapp_pb2_grpc.py index 26a626ed..80645e83 100644 --- a/django_socio_grpc/tests/fakeapp/grpc/fakeapp_pb2_grpc.py +++ b/django_socio_grpc/tests/fakeapp/grpc/fakeapp_pb2_grpc.py @@ -430,6 +430,232 @@ def TestEmptyMethod(request, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) +class DefaultValueControllerStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Create = channel.unary_unary( + '/myproject.fakeapp.DefaultValueController/Create', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueResponse.FromString, + ) + self.Destroy = channel.unary_unary( + '/myproject.fakeapp.DefaultValueController/Destroy', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueDestroyRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + self.List = channel.unary_unary( + '/myproject.fakeapp.DefaultValueController/List', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueListRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueListResponse.FromString, + ) + self.PartialUpdate = channel.unary_unary( + '/myproject.fakeapp.DefaultValueController/PartialUpdate', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValuePartialUpdateRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueResponse.FromString, + ) + self.Retrieve = channel.unary_unary( + '/myproject.fakeapp.DefaultValueController/Retrieve', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueRetrieveRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueResponse.FromString, + ) + self.Update = channel.unary_unary( + '/myproject.fakeapp.DefaultValueController/Update', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueResponse.FromString, + ) + + +class DefaultValueControllerServicer(object): + """Missing associated documentation comment in .proto file.""" + + def Create(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Destroy(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def List(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def PartialUpdate(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Retrieve(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Update(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_DefaultValueControllerServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Create': grpc.unary_unary_rpc_method_handler( + servicer.Create, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueResponse.SerializeToString, + ), + 'Destroy': grpc.unary_unary_rpc_method_handler( + servicer.Destroy, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueDestroyRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'List': grpc.unary_unary_rpc_method_handler( + servicer.List, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueListRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueListResponse.SerializeToString, + ), + 'PartialUpdate': grpc.unary_unary_rpc_method_handler( + servicer.PartialUpdate, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValuePartialUpdateRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueResponse.SerializeToString, + ), + 'Retrieve': grpc.unary_unary_rpc_method_handler( + servicer.Retrieve, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueRetrieveRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueResponse.SerializeToString, + ), + 'Update': grpc.unary_unary_rpc_method_handler( + servicer.Update, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'myproject.fakeapp.DefaultValueController', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class DefaultValueController(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def Create(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.DefaultValueController/Create', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Destroy(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.DefaultValueController/Destroy', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueDestroyRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def List(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.DefaultValueController/List', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueListRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueListResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def PartialUpdate(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.DefaultValueController/PartialUpdate', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValuePartialUpdateRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Retrieve(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.DefaultValueController/Retrieve', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueRetrieveRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Update(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.DefaultValueController/Update', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.DefaultValueResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + class ExceptionControllerStub(object): """Missing associated documentation comment in .proto file.""" diff --git a/django_socio_grpc/tests/fakeapp/handlers.py b/django_socio_grpc/tests/fakeapp/handlers.py index 48a2ce11..35b629c0 100644 --- a/django_socio_grpc/tests/fakeapp/handlers.py +++ b/django_socio_grpc/tests/fakeapp/handlers.py @@ -1,4 +1,5 @@ from fakeapp.services.basic_service import BasicService +from fakeapp.services.default_value_service import DefaultValueService from fakeapp.services.exception_service import ExceptionService from fakeapp.services.foreign_model_service import ForeignModelService from fakeapp.services.import_struct_even_in_array_model_service import ( @@ -37,6 +38,7 @@ def grpc_handlers(server): app_registry.register(ExceptionService) app_registry.register(RecursiveTestModelService) app_registry.register(UnitTestModelWithStructFilterService) + app_registry.register(DefaultValueService) services = ( diff --git a/django_socio_grpc/tests/fakeapp/migrations/0013_defaultvaluemodel.py b/django_socio_grpc/tests/fakeapp/migrations/0013_defaultvaluemodel.py new file mode 100644 index 00000000..d7a34f02 --- /dev/null +++ b/django_socio_grpc/tests/fakeapp/migrations/0013_defaultvaluemodel.py @@ -0,0 +1,37 @@ +# Generated by Django 4.2.8 on 2024-01-18 11:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('fakeapp', '0012_recursivetestmodel'), + ] + + operations = [ + migrations.CreateModel( + name='DefaultValueModel', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('string_required', models.CharField(max_length=20)), + ('string_blank', models.CharField(blank=True, max_length=20)), + ('string_nullable', models.CharField(max_length=20, null=True)), + ('string_default', models.CharField(default='default', max_length=20)), + ('string_default_and_blank', models.CharField(blank=True, default='default_and_blank', max_length=60)), + ('string_null_default_and_blank', models.CharField(blank=True, default='null_default_and_blank', max_length=60, null=True)), + ('string_required_but_serializer_default', models.CharField(max_length=20)), + ('string_default_but_serializer_default', models.CharField(default='default', max_length=60)), + ('string_nullable_default_but_serializer_default', models.CharField(default='default', max_length=60)), + ('int_required', models.IntegerField()), + ('int_nullable', models.IntegerField(null=True)), + ('int_default', models.IntegerField(default=5)), + ('int_required_but_serializer_default', models.IntegerField()), + ('boolean_required', models.BooleanField()), + ('boolean_nullable', models.BooleanField(null=True)), + ('boolean_default_false', models.BooleanField(default=False)), + ('boolean_default_true', models.BooleanField(default=True)), + ('boolean_required_but_serializer_default', models.BooleanField()), + ], + ), + ] diff --git a/django_socio_grpc/tests/fakeapp/models.py b/django_socio_grpc/tests/fakeapp/models.py index e138a2b0..1419ea5e 100644 --- a/django_socio_grpc/tests/fakeapp/models.py +++ b/django_socio_grpc/tests/fakeapp/models.py @@ -189,3 +189,30 @@ class RecursiveTestModel(models.Model): parent = models.ForeignKey( "self", blank=True, null=True, on_delete=models.CASCADE, related_name="children" ) + + +class DefaultValueModel(models.Model): + string_required = models.CharField(max_length=20) + string_blank = models.CharField(max_length=20, blank=True) + string_nullable = models.CharField(max_length=20, null=True) + string_default = models.CharField(max_length=20, default="default") + string_default_and_blank = models.CharField( + max_length=60, default="default_and_blank", blank=True + ) + string_null_default_and_blank = models.CharField( + max_length=60, default="null_default_and_blank", blank=True, null=True + ) + string_required_but_serializer_default = models.CharField(max_length=20) + string_default_but_serializer_default = models.CharField(max_length=60, default="default") + string_nullable_default_but_serializer_default = models.CharField( + max_length=60, default="default" + ) + int_required = models.IntegerField() + int_nullable = models.IntegerField(null=True) + int_default = models.IntegerField(default=5) + int_required_but_serializer_default = models.IntegerField() + boolean_required = models.BooleanField() + boolean_nullable = models.BooleanField(null=True) + boolean_default_false = models.BooleanField(default=False) + boolean_default_true = models.BooleanField(default=True) + boolean_required_but_serializer_default = models.BooleanField() diff --git a/django_socio_grpc/tests/fakeapp/serializers.py b/django_socio_grpc/tests/fakeapp/serializers.py index 13f6136e..b55eda30 100644 --- a/django_socio_grpc/tests/fakeapp/serializers.py +++ b/django_socio_grpc/tests/fakeapp/serializers.py @@ -7,6 +7,7 @@ from django_socio_grpc.protobuf import ProtoComment from .models import ( + DefaultValueModel, ForeignModel, ImportStructEvenInArrayModel, ManyManyModel, @@ -43,7 +44,7 @@ class Meta: model = UnitTestModel proto_class = fakeapp_pb2.UnitTestModelResponse proto_class_list = fakeapp_pb2.UnitTestModelListResponse - fields = ("id", "title", "text") + fields = "__all__" # INFO - AM - 14/02/2024 - This serializer exist just to be sure we do not override UnitTestModelSerializer in the proto @@ -202,3 +203,24 @@ class Meta: # proto_class = fakeapp_pb2.BasicProtoListChildResponse # proto_class_list = fakeapp_pb2.BasicProtoListChildListResponse fields = "__all__" + + +class DefaultValueSerializer(proto_serializers.ModelProtoSerializer): + string_required_but_serializer_default = serializers.CharField( + default="default_serializer" + ) + int_required_but_serializer_default = serializers.IntegerField(default=10) + boolean_required_but_serializer_default = serializers.BooleanField(default=False) + + string_default_but_serializer_default = serializers.CharField( + default="default_serializer_override" + ) + string_nullable_default_but_serializer_default = serializers.CharField( + default="default_serializer_override" + ) + + class Meta: + model = DefaultValueModel + proto_class = fakeapp_pb2.DefaultValueResponse + proto_class_list = fakeapp_pb2.DefaultValueListResponse + fields = "__all__" diff --git a/django_socio_grpc/tests/fakeapp/services/default_value_service.py b/django_socio_grpc/tests/fakeapp/services/default_value_service.py new file mode 100644 index 00000000..f2f29abe --- /dev/null +++ b/django_socio_grpc/tests/fakeapp/services/default_value_service.py @@ -0,0 +1,9 @@ +from fakeapp.models import DefaultValueModel +from fakeapp.serializers import DefaultValueSerializer + +from django_socio_grpc import generics + + +class DefaultValueService(generics.AsyncModelService): + queryset = DefaultValueModel.objects.all().order_by("id") + serializer_class = DefaultValueSerializer diff --git a/django_socio_grpc/tests/protos/ALL_APP_GENERATED_NO_SEPARATE/fakeapp.proto b/django_socio_grpc/tests/protos/ALL_APP_GENERATED_NO_SEPARATE/fakeapp.proto index 3bc19449..648c296b 100644 --- a/django_socio_grpc/tests/protos/ALL_APP_GENERATED_NO_SEPARATE/fakeapp.proto +++ b/django_socio_grpc/tests/protos/ALL_APP_GENERATED_NO_SEPARATE/fakeapp.proto @@ -161,7 +161,7 @@ message BasicParamWithSerializerRequestList { } message BasicProtoListChild { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } @@ -207,13 +207,13 @@ message CustomNameForResponse { // Test comment for whole message message CustomRetrieveResponseSpecialFieldsModel { - string uuid = 1; - int32 default_method_field = 2; + optional string uuid = 1; + optional int32 default_method_field = 2; repeated google.protobuf.Struct custom_method_field = 3; } message ForeignModel { - string uuid = 1; + optional string uuid = 1; string name = 2; } @@ -227,7 +227,7 @@ message ForeignModelListRequest { message ForeignModelRetrieveCustom { string name = 1; - string custom = 2; + optional string custom = 2; } message ForeignModelRetrieveCustomRetrieveRequest { @@ -235,19 +235,19 @@ message ForeignModelRetrieveCustomRetrieveRequest { } message ImportStructEvenInArrayModel { - string uuid = 1; + optional string uuid = 1; repeated google.protobuf.Struct this_is_crazy = 2; } message ManyManyModel { - string uuid = 1; + optional string uuid = 1; string name = 2; string test_write_only_on_nested = 3; } message RecursiveTestModel { - string uuid = 1; - RecursiveTestModel parent = 2; + optional string uuid = 1; + optional RecursiveTestModel parent = 2; repeated RecursiveTestModel children = 3; } @@ -264,9 +264,9 @@ message RecursiveTestModelListRequest { } message RecursiveTestModelPartialUpdateRequest { - string uuid = 1; + optional string uuid = 1; repeated string _partial_update_fields = 2; - RecursiveTestModel parent = 3; + optional RecursiveTestModel parent = 3; repeated RecursiveTestModel children = 4; } @@ -275,13 +275,13 @@ message RecursiveTestModelRetrieveRequest { } message RelatedFieldModel { - string uuid = 1; - ForeignModel foreign = 2; + optional string uuid = 1; + optional ForeignModel foreign = 2; repeated ManyManyModel many_many = 3; - int32 slug_test_model = 4; + optional int32 slug_test_model = 4; repeated bool slug_reverse_test_model = 5; repeated string slug_many_many = 6; - string proto_slug_related_field = 7; + optional string proto_slug_related_field = 7; string custom_field_name = 8; repeated string many_many_foreigns = 9; } @@ -299,13 +299,13 @@ message RelatedFieldModelListRequest { } message RelatedFieldModelPartialUpdateRequest { - string uuid = 1; - ForeignModel foreign = 2; + optional string uuid = 1; + optional ForeignModel foreign = 2; repeated ManyManyModel many_many = 3; - int32 slug_test_model = 4; + optional int32 slug_test_model = 4; repeated bool slug_reverse_test_model = 5; repeated string slug_many_many = 6; - string proto_slug_related_field = 7; + optional string proto_slug_related_field = 7; string custom_field_name = 8; repeated string _partial_update_fields = 9; repeated string many_many_foreigns = 10; @@ -316,7 +316,7 @@ message RelatedFieldModelRetrieveRequest { } message SimpleRelatedFieldModel { - string uuid = 1; + optional string uuid = 1; optional string foreign = 2; optional string slug_test_model = 3; repeated string many_many = 4; @@ -337,7 +337,7 @@ message SimpleRelatedFieldModelListRequest { } message SimpleRelatedFieldModelPartialUpdateRequest { - string uuid = 1; + optional string uuid = 1; repeated string _partial_update_fields = 2; optional string foreign = 3; optional string slug_test_model = 4; @@ -353,10 +353,10 @@ message SimpleRelatedFieldModelRetrieveRequest { // Special Fields Model // with two lines comment message SpecialFieldsModel { - string uuid = 1; - google.protobuf.Struct meta_datas = 2; + optional string uuid = 1; + optional google.protobuf.Struct meta_datas = 2; repeated int32 list_datas = 3; - bytes binary = 4; + optional bytes binary = 4; } message SpecialFieldsModelDestroyRequest { @@ -374,11 +374,11 @@ message SpecialFieldsModelListRequest { // Special Fields Model // with two lines comment message SpecialFieldsModelPartialUpdateRequest { - string uuid = 1; + optional string uuid = 1; repeated string _partial_update_fields = 2; - google.protobuf.Struct meta_datas = 3; + optional google.protobuf.Struct meta_datas = 3; repeated int32 list_datas = 4; - bytes binary = 5; + optional bytes binary = 5; } message SpecialFieldsModelRetrieve { @@ -403,7 +403,7 @@ message SyncUnitTestModelListWithExtraArgs { } message UnitTestModel { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } @@ -431,10 +431,10 @@ message UnitTestModelListWithExtraArgs { } message UnitTestModelPartialUpdateRequest { - int32 id = 1; - string title = 2; - optional string text = 3; - repeated string _partial_update_fields = 4; + optional int32 id = 1; + repeated string _partial_update_fields = 2; + string title = 3; + optional string text = 4; } message UnitTestModelRetrieveRequest { @@ -445,7 +445,7 @@ message UnitTestModelStreamRequest { } message UnitTestModelWithStructFilter { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } @@ -465,10 +465,10 @@ message UnitTestModelWithStructFilterList { } message UnitTestModelWithStructFilterPartialUpdateRequest { - int32 id = 1; - string title = 2; - optional string text = 3; - repeated string _partial_update_fields = 4; + optional int32 id = 1; + repeated string _partial_update_fields = 2; + string title = 3; + optional string text = 4; } message UnitTestModelWithStructFilterRetrieveRequest { diff --git a/django_socio_grpc/tests/protos/ALL_APP_GENERATED_SEPARATE/fakeapp.proto b/django_socio_grpc/tests/protos/ALL_APP_GENERATED_SEPARATE/fakeapp.proto index 4b8e9896..52c137d0 100644 --- a/django_socio_grpc/tests/protos/ALL_APP_GENERATED_SEPARATE/fakeapp.proto +++ b/django_socio_grpc/tests/protos/ALL_APP_GENERATED_SEPARATE/fakeapp.proto @@ -20,6 +20,15 @@ service BasicController { rpc TestEmptyMethod(google.protobuf.Empty) returns (google.protobuf.Empty) {} } +service DefaultValueController { + rpc Create(DefaultValueRequest) returns (DefaultValueResponse) {} + rpc Destroy(DefaultValueDestroyRequest) returns (google.protobuf.Empty) {} + rpc List(DefaultValueListRequest) returns (DefaultValueListResponse) {} + rpc PartialUpdate(DefaultValuePartialUpdateRequest) returns (DefaultValueResponse) {} + rpc Retrieve(DefaultValueRetrieveRequest) returns (DefaultValueResponse) {} + rpc Update(DefaultValueRequest) returns (DefaultValueResponse) {} +} + service ExceptionController { rpc APIException(google.protobuf.Empty) returns (google.protobuf.Empty) {} rpc GRPCException(google.protobuf.Empty) returns (google.protobuf.Empty) {} @@ -184,13 +193,13 @@ message BasicProtoListChildListResponse { } message BasicProtoListChildRequest { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } message BasicProtoListChildResponse { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } @@ -241,11 +250,94 @@ message CustomNameForResponse { // Test comment for whole message message CustomRetrieveResponseSpecialFieldsModelResponse { - string uuid = 1; - int32 default_method_field = 2; + optional string uuid = 1; + optional int32 default_method_field = 2; repeated google.protobuf.Struct custom_method_field = 3; } +message DefaultValueDestroyRequest { + int32 id = 1; +} + +message DefaultValueListRequest { +} + +message DefaultValueListResponse { + repeated DefaultValueResponse results = 1; + int32 count = 2; +} + +message DefaultValuePartialUpdateRequest { + optional int32 id = 1; + optional string string_required_but_serializer_default = 2; + optional int32 int_required_but_serializer_default = 3; + optional bool boolean_required_but_serializer_default = 4; + optional string string_default_but_serializer_default = 5; + optional string string_nullable_default_but_serializer_default = 6; + repeated string _partial_update_fields = 7; + string string_required = 8; + optional string string_blank = 9; + optional string string_nullable = 10; + optional string string_default = 11; + optional string string_default_and_blank = 12; + optional string string_null_default_and_blank = 13; + int32 int_required = 14; + optional int32 int_nullable = 15; + optional int32 int_default = 16; + bool boolean_required = 17; + optional bool boolean_nullable = 18; + optional bool boolean_default_false = 19; + optional bool boolean_default_true = 20; +} + +message DefaultValueRequest { + optional int32 id = 1; + optional string string_required_but_serializer_default = 2; + optional int32 int_required_but_serializer_default = 3; + optional bool boolean_required_but_serializer_default = 4; + optional string string_default_but_serializer_default = 5; + optional string string_nullable_default_but_serializer_default = 6; + string string_required = 7; + optional string string_blank = 8; + optional string string_nullable = 9; + optional string string_default = 10; + optional string string_default_and_blank = 11; + optional string string_null_default_and_blank = 12; + int32 int_required = 13; + optional int32 int_nullable = 14; + optional int32 int_default = 15; + bool boolean_required = 16; + optional bool boolean_nullable = 17; + optional bool boolean_default_false = 18; + optional bool boolean_default_true = 19; +} + +message DefaultValueResponse { + optional int32 id = 1; + optional string string_required_but_serializer_default = 2; + optional int32 int_required_but_serializer_default = 3; + optional bool boolean_required_but_serializer_default = 4; + optional string string_default_but_serializer_default = 5; + optional string string_nullable_default_but_serializer_default = 6; + string string_required = 7; + optional string string_blank = 8; + optional string string_nullable = 9; + optional string string_default = 10; + optional string string_default_and_blank = 11; + optional string string_null_default_and_blank = 12; + int32 int_required = 13; + optional int32 int_nullable = 14; + optional int32 int_default = 15; + bool boolean_required = 16; + optional bool boolean_nullable = 17; + optional bool boolean_default_false = 18; + optional bool boolean_default_true = 19; +} + +message DefaultValueRetrieveRequest { + int32 id = 1; +} + message ExceptionStreamRaiseExceptionResponse { string id = 1; } @@ -259,13 +351,13 @@ message ForeignModelListResponse { } message ForeignModelResponse { - string uuid = 1; + optional string uuid = 1; string name = 2; } message ForeignModelRetrieveCustomResponse { string name = 1; - string custom = 2; + optional string custom = 2; } message ForeignModelRetrieveCustomRetrieveRequest { @@ -273,23 +365,23 @@ message ForeignModelRetrieveCustomRetrieveRequest { } message ImportStructEvenInArrayModelRequest { - string uuid = 1; + optional string uuid = 1; repeated google.protobuf.Struct this_is_crazy = 2; } message ImportStructEvenInArrayModelResponse { - string uuid = 1; + optional string uuid = 1; repeated google.protobuf.Struct this_is_crazy = 2; } message ManyManyModelRequest { - string uuid = 1; + optional string uuid = 1; string name = 2; string test_write_only_on_nested = 3; } message ManyManyModelResponse { - string uuid = 1; + optional string uuid = 1; string name = 2; } @@ -306,21 +398,21 @@ message RecursiveTestModelListResponse { } message RecursiveTestModelPartialUpdateRequest { - string uuid = 1; + optional string uuid = 1; repeated string _partial_update_fields = 2; - RecursiveTestModelRequest parent = 3; + optional RecursiveTestModelRequest parent = 3; repeated RecursiveTestModelRequest children = 4; } message RecursiveTestModelRequest { - string uuid = 1; - RecursiveTestModelRequest parent = 2; + optional string uuid = 1; + optional RecursiveTestModelRequest parent = 2; repeated RecursiveTestModelRequest children = 3; } message RecursiveTestModelResponse { - string uuid = 1; - RecursiveTestModelResponse parent = 2; + optional string uuid = 1; + optional RecursiveTestModelResponse parent = 2; repeated RecursiveTestModelResponse children = 3; } @@ -341,7 +433,7 @@ message RelatedFieldModelListResponse { } message RelatedFieldModelPartialUpdateRequest { - string uuid = 1; + optional string uuid = 1; repeated ManyManyModelRequest many_many = 2; string custom_field_name = 3; repeated string _partial_update_fields = 4; @@ -349,20 +441,20 @@ message RelatedFieldModelPartialUpdateRequest { } message RelatedFieldModelRequest { - string uuid = 1; + optional string uuid = 1; repeated ManyManyModelRequest many_many = 2; string custom_field_name = 3; repeated string many_many_foreigns = 4; } message RelatedFieldModelResponse { - string uuid = 1; - ForeignModelResponse foreign = 2; + optional string uuid = 1; + optional ForeignModelResponse foreign = 2; repeated ManyManyModelResponse many_many = 3; - int32 slug_test_model = 4; + optional int32 slug_test_model = 4; repeated bool slug_reverse_test_model = 5; repeated string slug_many_many = 6; - string proto_slug_related_field = 7; + optional string proto_slug_related_field = 7; string custom_field_name = 8; repeated string many_many_foreigns = 9; } @@ -384,7 +476,7 @@ message SimpleRelatedFieldModelListResponse { } message SimpleRelatedFieldModelPartialUpdateRequest { - string uuid = 1; + optional string uuid = 1; repeated string _partial_update_fields = 2; optional string foreign = 3; optional string slug_test_model = 4; @@ -394,7 +486,7 @@ message SimpleRelatedFieldModelPartialUpdateRequest { } message SimpleRelatedFieldModelRequest { - string uuid = 1; + optional string uuid = 1; optional string foreign = 2; optional string slug_test_model = 3; repeated string many_many = 4; @@ -403,7 +495,7 @@ message SimpleRelatedFieldModelRequest { } message SimpleRelatedFieldModelResponse { - string uuid = 1; + optional string uuid = 1; optional string foreign = 2; optional string slug_test_model = 3; repeated string many_many = 4; @@ -430,27 +522,27 @@ message SpecialFieldsModelListResponse { // Special Fields Model // with two lines comment message SpecialFieldsModelPartialUpdateRequest { - string uuid = 1; + optional string uuid = 1; repeated string _partial_update_fields = 2; - google.protobuf.Struct meta_datas = 3; + optional google.protobuf.Struct meta_datas = 3; repeated int32 list_datas = 4; } // Special Fields Model // with two lines comment message SpecialFieldsModelRequest { - string uuid = 1; - google.protobuf.Struct meta_datas = 2; + optional string uuid = 1; + optional google.protobuf.Struct meta_datas = 2; repeated int32 list_datas = 3; } // Special Fields Model // with two lines comment message SpecialFieldsModelResponse { - string uuid = 1; - google.protobuf.Struct meta_datas = 2; + optional string uuid = 1; + optional google.protobuf.Struct meta_datas = 2; repeated int32 list_datas = 3; - bytes binary = 4; + optional bytes binary = 4; } message SpecialFieldsModelRetrieveRequest { @@ -505,20 +597,20 @@ message UnitTestModelListWithExtraArgsRequest { } message UnitTestModelPartialUpdateRequest { - int32 id = 1; - string title = 2; - optional string text = 3; - repeated string _partial_update_fields = 4; + optional int32 id = 1; + repeated string _partial_update_fields = 2; + string title = 3; + optional string text = 4; } message UnitTestModelRequest { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } message UnitTestModelResponse { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } @@ -550,20 +642,20 @@ message UnitTestModelWithStructFilterListResponse { } message UnitTestModelWithStructFilterPartialUpdateRequest { - int32 id = 1; - string title = 2; - optional string text = 3; - repeated string _partial_update_fields = 4; + optional int32 id = 1; + repeated string _partial_update_fields = 2; + string title = 3; + optional string text = 4; } message UnitTestModelWithStructFilterRequest { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } message UnitTestModelWithStructFilterResponse { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } diff --git a/django_socio_grpc/tests/protos/CUSTOM_APP_MODEL_GENERATED/fakeapp.proto b/django_socio_grpc/tests/protos/CUSTOM_APP_MODEL_GENERATED/fakeapp.proto index 26c09b6c..e48c0042 100644 --- a/django_socio_grpc/tests/protos/CUSTOM_APP_MODEL_GENERATED/fakeapp.proto +++ b/django_socio_grpc/tests/protos/CUSTOM_APP_MODEL_GENERATED/fakeapp.proto @@ -16,13 +16,13 @@ message ForeignModelListResponse { } message ForeignModelResponse { - string uuid = 1; + optional string uuid = 1; string name = 2; } message ForeignModelRetrieveCustomResponse { string name = 1; - string custom = 2; + optional string custom = 2; } message ForeignModelRetrieveCustomRetrieveRequest { diff --git a/django_socio_grpc/tests/protos/MODEL_WITH_KNOWN_METHOD_OVERRIDEN_GENERATED/fakeapp.proto b/django_socio_grpc/tests/protos/MODEL_WITH_KNOWN_METHOD_OVERRIDEN_GENERATED/fakeapp.proto index 8b93112d..3d094fc2 100644 --- a/django_socio_grpc/tests/protos/MODEL_WITH_KNOWN_METHOD_OVERRIDEN_GENERATED/fakeapp.proto +++ b/django_socio_grpc/tests/protos/MODEL_WITH_KNOWN_METHOD_OVERRIDEN_GENERATED/fakeapp.proto @@ -16,8 +16,8 @@ service SpecialFieldsModelController { // Test comment for whole message message CustomRetrieveResponseSpecialFieldsModelResponse { - string uuid = 1; - int32 default_method_field = 2; + optional string uuid = 1; + optional int32 default_method_field = 2; repeated google.protobuf.Struct custom_method_field = 3; } @@ -36,27 +36,27 @@ message SpecialFieldsModelListResponse { // Special Fields Model // with two lines comment message SpecialFieldsModelPartialUpdateRequest { - string uuid = 1; + optional string uuid = 1; repeated string _partial_update_fields = 2; - google.protobuf.Struct meta_datas = 3; + optional google.protobuf.Struct meta_datas = 3; repeated int32 list_datas = 4; } // Special Fields Model // with two lines comment message SpecialFieldsModelRequest { - string uuid = 1; - google.protobuf.Struct meta_datas = 2; + optional string uuid = 1; + optional google.protobuf.Struct meta_datas = 2; repeated int32 list_datas = 3; } // Special Fields Model // with two lines comment message SpecialFieldsModelResponse { - string uuid = 1; - google.protobuf.Struct meta_datas = 2; + optional string uuid = 1; + optional google.protobuf.Struct meta_datas = 2; repeated int32 list_datas = 3; - bytes binary = 4; + optional bytes binary = 4; } message SpecialFieldsModelRetrieveRequest { diff --git a/django_socio_grpc/tests/protos/MODEL_WITH_M2M_GENERATED/fakeapp.proto b/django_socio_grpc/tests/protos/MODEL_WITH_M2M_GENERATED/fakeapp.proto index e53ad0ae..c440748c 100644 --- a/django_socio_grpc/tests/protos/MODEL_WITH_M2M_GENERATED/fakeapp.proto +++ b/django_socio_grpc/tests/protos/MODEL_WITH_M2M_GENERATED/fakeapp.proto @@ -14,18 +14,18 @@ service RelatedFieldModelController { } message ForeignModelResponse { - string uuid = 1; + optional string uuid = 1; string name = 2; } message ManyManyModelRequest { - string uuid = 1; + optional string uuid = 1; string name = 2; string test_write_only_on_nested = 3; } message ManyManyModelResponse { - string uuid = 1; + optional string uuid = 1; string name = 2; } @@ -42,7 +42,7 @@ message RelatedFieldModelListResponse { } message RelatedFieldModelPartialUpdateRequest { - string uuid = 1; + optional string uuid = 1; repeated ManyManyModelRequest many_many = 2; string custom_field_name = 3; repeated string _partial_update_fields = 4; @@ -50,20 +50,20 @@ message RelatedFieldModelPartialUpdateRequest { } message RelatedFieldModelRequest { - string uuid = 1; + optional string uuid = 1; repeated ManyManyModelRequest many_many = 2; string custom_field_name = 3; repeated string many_many_foreigns = 4; } message RelatedFieldModelResponse { - string uuid = 1; - ForeignModelResponse foreign = 2; + optional string uuid = 1; + optional ForeignModelResponse foreign = 2; repeated ManyManyModelResponse many_many = 3; - int32 slug_test_model = 4; + optional int32 slug_test_model = 4; repeated bool slug_reverse_test_model = 5; repeated string slug_many_many = 6; - string proto_slug_related_field = 7; + optional string proto_slug_related_field = 7; string custom_field_name = 8; repeated string many_many_foreigns = 9; } diff --git a/django_socio_grpc/tests/protos/MODEL_WITH_STRUCT_IMORT_IN_ARRAY/fakeapp.proto b/django_socio_grpc/tests/protos/MODEL_WITH_STRUCT_IMORT_IN_ARRAY/fakeapp.proto index 910e1183..8ae6aecd 100644 --- a/django_socio_grpc/tests/protos/MODEL_WITH_STRUCT_IMORT_IN_ARRAY/fakeapp.proto +++ b/django_socio_grpc/tests/protos/MODEL_WITH_STRUCT_IMORT_IN_ARRAY/fakeapp.proto @@ -9,12 +9,12 @@ service ImportStructEvenInArrayModelController { } message ImportStructEvenInArrayModelRequest { - string uuid = 1; + optional string uuid = 1; repeated google.protobuf.Struct this_is_crazy = 2; } message ImportStructEvenInArrayModelResponse { - string uuid = 1; + optional string uuid = 1; repeated google.protobuf.Struct this_is_crazy = 2; } diff --git a/django_socio_grpc/tests/protos/NO_MODEL_GENERATED/fakeapp.proto b/django_socio_grpc/tests/protos/NO_MODEL_GENERATED/fakeapp.proto index 06928a74..37fc3322 100644 --- a/django_socio_grpc/tests/protos/NO_MODEL_GENERATED/fakeapp.proto +++ b/django_socio_grpc/tests/protos/NO_MODEL_GENERATED/fakeapp.proto @@ -94,13 +94,13 @@ message BasicProtoListChildListResponse { } message BasicProtoListChildRequest { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } message BasicProtoListChildResponse { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } diff --git a/django_socio_grpc/tests/protos/RECURSIVE_MODEL_GENERATED/fakeapp.proto b/django_socio_grpc/tests/protos/RECURSIVE_MODEL_GENERATED/fakeapp.proto index b9f6f16c..893609e1 100644 --- a/django_socio_grpc/tests/protos/RECURSIVE_MODEL_GENERATED/fakeapp.proto +++ b/django_socio_grpc/tests/protos/RECURSIVE_MODEL_GENERATED/fakeapp.proto @@ -26,21 +26,21 @@ message RecursiveTestModelListResponse { } message RecursiveTestModelPartialUpdateRequest { - string uuid = 1; + optional string uuid = 1; repeated string _partial_update_fields = 2; - RecursiveTestModelRequest parent = 3; + optional RecursiveTestModelRequest parent = 3; repeated RecursiveTestModelRequest children = 4; } message RecursiveTestModelRequest { - string uuid = 1; - RecursiveTestModelRequest parent = 2; + optional string uuid = 1; + optional RecursiveTestModelRequest parent = 2; repeated RecursiveTestModelRequest children = 3; } message RecursiveTestModelResponse { - string uuid = 1; - RecursiveTestModelResponse parent = 2; + optional string uuid = 1; + optional RecursiveTestModelResponse parent = 2; repeated RecursiveTestModelResponse children = 3; } diff --git a/django_socio_grpc/tests/protos/SIMPLE_APP_MODEL_GENERATED_FROM_OLD_ORDER/fakeapp.proto b/django_socio_grpc/tests/protos/SIMPLE_APP_MODEL_GENERATED_FROM_OLD_ORDER/fakeapp.proto index 6e7fe436..9d2d782a 100644 --- a/django_socio_grpc/tests/protos/SIMPLE_APP_MODEL_GENERATED_FROM_OLD_ORDER/fakeapp.proto +++ b/django_socio_grpc/tests/protos/SIMPLE_APP_MODEL_GENERATED_FROM_OLD_ORDER/fakeapp.proto @@ -38,20 +38,20 @@ message UnitTestModelListWithExtraArgsRequest { } message UnitTestModelPartialUpdateRequest { - int32 id = 1; - string title = 2; - optional string text = 3; - repeated string _partial_update_fields = 4; + optional int32 id = 1; + repeated string _partial_update_fields = 2; + string title = 3; + optional string text = 4; } message UnitTestModelRequest { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } message UnitTestModelResponse { - int32 id = 1; + optional int32 id = 1; optional string text = 2; string title = 3; } diff --git a/django_socio_grpc/tests/protos/SIMPLE_MODEL_GENERATED/fakeapp.proto b/django_socio_grpc/tests/protos/SIMPLE_MODEL_GENERATED/fakeapp.proto index c921d2e6..7fc26a02 100644 --- a/django_socio_grpc/tests/protos/SIMPLE_MODEL_GENERATED/fakeapp.proto +++ b/django_socio_grpc/tests/protos/SIMPLE_MODEL_GENERATED/fakeapp.proto @@ -38,20 +38,20 @@ message UnitTestModelListWithExtraArgsRequest { } message UnitTestModelPartialUpdateRequest { - int32 id = 1; - string title = 2; - optional string text = 3; - repeated string _partial_update_fields = 4; + optional int32 id = 1; + repeated string _partial_update_fields = 2; + string title = 3; + optional string text = 4; } message UnitTestModelRequest { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } message UnitTestModelResponse { - int32 id = 1; + optional int32 id = 1; string title = 2; optional string text = 3; } diff --git a/django_socio_grpc/tests/test_async_model_service.py b/django_socio_grpc/tests/test_async_model_service.py index 78360e5f..563cde7d 100644 --- a/django_socio_grpc/tests/test_async_model_service.py +++ b/django_socio_grpc/tests/test_async_model_service.py @@ -19,6 +19,7 @@ RelatedFieldModelService, SimpleRelatedFieldModelService, ) +from django_socio_grpc.utils.constants import PARTIAL_UPDATE_FIELD_NAME from .grpc_test_utils.fake_grpc import FakeFullAIOGRPC @@ -133,7 +134,7 @@ async def test_async_partial_update(self): grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelControllerStub) request = fakeapp_pb2.UnitTestModelPartialUpdateRequest( - id=instance.id, _partial_update_fields=["title"], title="newTitle" + id=instance.id, title="newTitle", **{PARTIAL_UPDATE_FIELD_NAME: ["title"]} ) response = await grpc_stub.PartialUpdate(request=request) @@ -145,11 +146,13 @@ async def test_optional_field(self): request = fakeapp_pb2.UnitTestModelRequest(title="fake") response = await grpc_stub.Create(request=request) + # INFO - AM - 03/01/2023 - text is optional and can be null and is null so it's not send self.assertFalse(response.HasField("text")) request = fakeapp_pb2.UnitTestModelRetrieveRequest(id=response.id) response = await grpc_stub.Retrieve(request=request) + # INFO - AM - 03/01/2023 - text is optional and can be null and is null so it's not send self.assertFalse(response.HasField("text")) instance = await UnitTestModel.objects.aget(id=response.id) diff --git a/django_socio_grpc/tests/test_default_value.py b/django_socio_grpc/tests/test_default_value.py new file mode 100644 index 00000000..a6991e9e --- /dev/null +++ b/django_socio_grpc/tests/test_default_value.py @@ -0,0 +1,631 @@ +import grpc +from django.test import TestCase, override_settings +from fakeapp.grpc import fakeapp_pb2 +from fakeapp.grpc.fakeapp_pb2_grpc import ( + DefaultValueControllerStub, + add_DefaultValueControllerServicer_to_server, +) +from fakeapp.models import DefaultValueModel +from fakeapp.serializers import DefaultValueSerializer +from fakeapp.services.default_value_service import DefaultValueService + +from django_socio_grpc.protobuf.proto_classes import FieldCardinality, ProtoField +from django_socio_grpc.utils.constants import PARTIAL_UPDATE_FIELD_NAME + +from .grpc_test_utils.fake_grpc import FakeFullAIOGRPC + + +class TestDefaultValueField: + # FROM_FIELD + def test_from_field_string(self): + ser = DefaultValueSerializer() + field = ser.fields["string_required"] + + proto_field = ProtoField.from_field(field) + + assert proto_field.name == "string_required" + assert proto_field.field_type == "string" + assert proto_field.cardinality == FieldCardinality.NONE + + # --------------------------------- + + ser = DefaultValueSerializer() + field = ser.fields["string_blank"] + + proto_field = ProtoField.from_field(field) + + assert proto_field.name == "string_blank" + assert proto_field.field_type == "string" + assert proto_field.cardinality == FieldCardinality.OPTIONAL + + # --------------------------------- + + ser = DefaultValueSerializer() + field = ser.fields["string_nullable"] + + proto_field = ProtoField.from_field(field) + + assert proto_field.name == "string_nullable" + assert proto_field.field_type == "string" + assert proto_field.cardinality == FieldCardinality.OPTIONAL + + # --------------------------------- + + ser = DefaultValueSerializer() + field = ser.fields["string_default"] + + proto_field = ProtoField.from_field(field) + + assert proto_field.name == "string_default" + assert proto_field.field_type == "string" + assert proto_field.cardinality == FieldCardinality.OPTIONAL + + # --------------------------------- + + ser = DefaultValueSerializer() + field = ser.fields["string_required_but_serializer_default"] + + proto_field = ProtoField.from_field(field) + + assert proto_field.name == "string_required_but_serializer_default" + assert proto_field.field_type == "string" + assert proto_field.cardinality == FieldCardinality.OPTIONAL + + def test_from_field_integer(self): + ser = DefaultValueSerializer() + field = ser.fields["int_required"] + + proto_field = ProtoField.from_field(field) + + assert proto_field.name == "int_required" + assert proto_field.field_type == "int32" + assert proto_field.cardinality == FieldCardinality.NONE + + # --------------------------------- + + ser = DefaultValueSerializer() + field = ser.fields["int_nullable"] + + proto_field = ProtoField.from_field(field) + + assert proto_field.name == "int_nullable" + assert proto_field.field_type == "int32" + assert proto_field.cardinality == FieldCardinality.OPTIONAL + + # --------------------------------- + + ser = DefaultValueSerializer() + field = ser.fields["int_default"] + + proto_field = ProtoField.from_field(field) + + assert proto_field.name == "int_default" + assert proto_field.field_type == "int32" + assert proto_field.cardinality == FieldCardinality.OPTIONAL + + # --------------------------------- + + ser = DefaultValueSerializer() + field = ser.fields["int_required_but_serializer_default"] + + proto_field = ProtoField.from_field(field) + + assert proto_field.name == "int_required_but_serializer_default" + assert proto_field.field_type == "int32" + assert proto_field.cardinality == FieldCardinality.OPTIONAL + + def test_from_field_boolean(self): + ser = DefaultValueSerializer() + field = ser.fields["boolean_required"] + + proto_field = ProtoField.from_field(field) + + assert proto_field.name == "boolean_required" + assert proto_field.field_type == "bool" + assert proto_field.cardinality == FieldCardinality.NONE + + # --------------------------------- + + ser = DefaultValueSerializer() + field = ser.fields["boolean_nullable"] + + proto_field = ProtoField.from_field(field) + + assert proto_field.name == "boolean_nullable" + assert proto_field.field_type == "bool" + assert proto_field.cardinality == FieldCardinality.OPTIONAL + + # --------------------------------- + + ser = DefaultValueSerializer() + field = ser.fields["boolean_default_true"] + + proto_field = ProtoField.from_field(field) + + assert proto_field.name == "boolean_default_true" + assert proto_field.field_type == "bool" + assert proto_field.cardinality == FieldCardinality.OPTIONAL + + # --------------------------------- + + ser = DefaultValueSerializer() + field = ser.fields["boolean_default_false"] + + proto_field = ProtoField.from_field(field) + + assert proto_field.name == "boolean_default_false" + assert proto_field.field_type == "bool" + assert proto_field.cardinality == FieldCardinality.OPTIONAL + + # --------------------------------- + + ser = DefaultValueSerializer() + field = ser.fields["boolean_required_but_serializer_default"] + + proto_field = ProtoField.from_field(field) + + assert proto_field.name == "boolean_required_but_serializer_default" + assert proto_field.field_type == "bool" + assert proto_field.cardinality == FieldCardinality.OPTIONAL + + +@override_settings(GRPC_FRAMEWORK={"GRPC_ASYNC": True}) +class TestDefaultValueService(TestCase): + def setUp(self): + self.fake_grpc = FakeFullAIOGRPC( + add_DefaultValueControllerServicer_to_server, DefaultValueService.as_servicer() + ) + + self.setup_instance = DefaultValueModel.objects.create( + string_required="setUp", + string_required_but_serializer_default="setup_serializer", + int_required=50, + int_required_but_serializer_default=60, + boolean_required=True, + boolean_required_but_serializer_default=False, + ) + + async def test_retrieve_all_default_value(self): + grpc_stub = self.fake_grpc.get_fake_stub(DefaultValueControllerStub) + request = fakeapp_pb2.DefaultValueRequest(id=self.setup_instance.id) + response = await grpc_stub.Retrieve(request=request) + + # STRING ################## + + # INFO - AM - 12/01/2024 - check presence / not presence depending if element is None or empty + self.assertTrue(response.HasField("string_blank")) + self.assertFalse(response.HasField("string_nullable")) + self.assertTrue(response.HasField("string_default_and_blank")) + self.assertTrue(response.HasField("string_null_default_and_blank")) + + # INFO - AM - 12/01/2024 - check value event if grpc default because we check presence before + self.assertEqual(response.string_required, "setUp") + self.assertEqual(response.string_blank, "") + self.assertEqual(response.string_nullable, "") + self.assertEqual(response.string_default_and_blank, "default_and_blank") + self.assertEqual(response.string_null_default_and_blank, "null_default_and_blank") + self.assertEqual(response.string_default, "default") + self.assertEqual( + response.string_required_but_serializer_default, "setup_serializer" + ) # created in setup not serializer so default value != than value in instance because required. See create test for testing default serializer value + self.assertEqual( + response.string_default_but_serializer_default, "default" + ) # created in setup not serializer so default value != than value in serializer. See create test for testing default serializer value + self.assertEqual( + response.string_nullable_default_but_serializer_default, "default" + ) # created in setup not serializer so default value != than value in serializer. See create test for testing default serializer value + # INTEGER ################## + + # INFO - AM - 12/01/2024 - check presence / not presence depending if element is None or empty + self.assertFalse(response.HasField("int_nullable")) + + # INFO - AM - 12/01/2024 - check value event if grpc default because we check presence before + self.assertEqual(response.int_required, 50) + self.assertEqual(response.int_nullable, 0) + self.assertEqual(response.int_default, 5) + self.assertEqual( + response.int_required_but_serializer_default, 60 + ) # created in setup not serializer so default value != than value in instance. See create test for testung default serializer value + + # BOOLEAN ################## + + # INFO - AM - 12/01/2024 - check presence / not presence depending if element is None or empty + self.assertFalse(response.HasField("boolean_nullable")) + self.assertTrue(response.HasField("boolean_default_false")) + self.assertTrue(response.HasField("boolean_default_true")) + + # INFO - AM - 12/01/2024 - check value event if grpc default because we check presence before + self.assertEqual(response.boolean_required, True) + self.assertEqual(response.boolean_nullable, False) + self.assertEqual(response.boolean_default_false, False) + self.assertEqual(response.boolean_default_true, True) + self.assertEqual( + response.boolean_required_but_serializer_default, False + ) # created in setup not serializer so default value != than value in instance. See create test for testung default serializer value + + async def test_create_all_default_value(self): + grpc_stub = self.fake_grpc.get_fake_stub(DefaultValueControllerStub) + request = fakeapp_pb2.DefaultValueRequest( + string_required="create", int_required=100, boolean_required=True + ) + response = await grpc_stub.Create(request=request) + + # STRING ################## + + # INFO - AM - 12/01/2024 - check presence / not presence depending if element is None or empty + self.assertTrue(response.HasField("string_blank")) + self.assertFalse(response.HasField("string_nullable")) + self.assertTrue(response.HasField("string_default_and_blank")) + self.assertTrue(response.HasField("string_null_default_and_blank")) + + # INFO - AM - 12/01/2024 - check value event if grpc default because we check presence before + self.assertEqual(response.string_required, "create") + self.assertEqual(response.string_blank, "") + self.assertEqual(response.string_nullable, "") + self.assertEqual(response.string_default_and_blank, "default_and_blank") + self.assertEqual(response.string_null_default_and_blank, "null_default_and_blank") + self.assertEqual(response.string_default, "default") + self.assertEqual(response.string_required_but_serializer_default, "default_serializer") + self.assertEqual( + response.string_default_but_serializer_default, "default_serializer_override" + ) + self.assertEqual( + response.string_nullable_default_but_serializer_default, + "default_serializer_override", + ) + + # INTEGER ################## + + # INFO - AM - 12/01/2024 - check presence / not presence depending if element is None or empty + self.assertFalse(response.HasField("int_nullable")) + + # INFO - AM - 12/01/2024 - check value event if grpc default because we check presence before + self.assertEqual(response.int_required, 100) + self.assertEqual(response.int_nullable, 0) + self.assertEqual(response.int_default, 5) + self.assertEqual(response.int_required_but_serializer_default, 10) + + # BOOLEAN ################## + + # INFO - AM - 12/01/2024 - check presence / not presence depending if element is None or empty + self.assertFalse(response.HasField("boolean_nullable")) + self.assertTrue(response.HasField("boolean_default_false")) + self.assertTrue(response.HasField("boolean_default_true")) + + # INFO - AM - 12/01/2024 - check value event if grpc default because we check presence before + self.assertEqual(response.boolean_required, True) + self.assertEqual(response.boolean_nullable, False) + self.assertEqual(response.boolean_default_false, False) + self.assertEqual(response.boolean_default_true, True) + self.assertEqual(response.boolean_required_but_serializer_default, False) + + async def test_update_all_default_value(self): + all_setted_instance = await DefaultValueModel.objects.acreate( + string_required="update_required", + string_blank="update_blank", + string_nullable="update_nullable", + string_default="update_default", + string_default_and_blank="update_default_and_blank", + string_null_default_and_blank="update_null_default_and_blank", + string_required_but_serializer_default="update_serializer", + string_default_but_serializer_default="update_serializer_override", + string_nullable_default_but_serializer_default="update_serializer_override", + int_required=200, + int_nullable=201, + int_default=202, + int_required_but_serializer_default=60, + boolean_required=True, + boolean_nullable=True, + boolean_default_false=True, + boolean_default_true=False, + boolean_required_but_serializer_default=True, + ) + + grpc_stub = self.fake_grpc.get_fake_stub(DefaultValueControllerStub) + request = fakeapp_pb2.DefaultValueRequest( + id=all_setted_instance.id, + string_required="update_required2", + string_blank="", + string_default_and_blank="", + int_required=0, + boolean_required=False, + ) + response = await grpc_stub.Update(request=request) + + # STRING ################## + + # INFO - AM - 12/01/2024 - check presence / not presence depending if element is None or empty + self.assertTrue(response.HasField("string_blank")) + self.assertFalse(response.HasField("string_nullable")) + self.assertTrue(response.HasField("string_default_and_blank")) + self.assertFalse(response.HasField("string_null_default_and_blank")) + + # INFO - AM - 12/01/2024 - check value event if grpc default because we check presence before + self.assertEqual(response.string_required, "update_required2") + self.assertEqual(response.string_blank, "") + self.assertEqual(response.string_nullable, "") + self.assertEqual(response.string_default_and_blank, "") + self.assertEqual(response.string_null_default_and_blank, "") + self.assertEqual( + response.string_default, "update_default" + ) # This field not updated because model default only apply on creation + self.assertEqual(response.string_required_but_serializer_default, "default_serializer") + self.assertEqual( + response.string_default_but_serializer_default, "default_serializer_override" + ) + self.assertEqual( + response.string_nullable_default_but_serializer_default, + "default_serializer_override", + ) + + await all_setted_instance.arefresh_from_db() + self.assertEqual(all_setted_instance.string_blank, "") + self.assertEqual(all_setted_instance.string_nullable, None) + self.assertEqual(all_setted_instance.string_default_and_blank, "") + self.assertEqual(all_setted_instance.string_null_default_and_blank, None) + + # INTEGER ################## + + # INFO - AM - 12/01/2024 - check presence / not presence depending if element is None or empty + self.assertFalse(response.HasField("int_nullable")) + + # INFO - AM - 12/01/2024 - check value event if grpc default because we check presence before + self.assertEqual(response.int_required, 0) + self.assertEqual(response.int_nullable, 0) + self.assertEqual( + response.int_default, 202 + ) # This field not updated because model default only apply on creation + self.assertEqual(response.int_required_but_serializer_default, 10) + + self.assertEqual(all_setted_instance.int_nullable, None) + + # BOOLEAN ################## + + # INFO - AM - 12/01/2024 - check presence / not presence depending if element is None or empty + self.assertFalse(response.HasField("boolean_nullable")) + self.assertTrue(response.HasField("boolean_default_false")) + self.assertTrue(response.HasField("boolean_default_true")) + + # INFO - AM - 12/01/2024 - check value event if grpc default because we check presence before + self.assertEqual(response.boolean_required, False) + self.assertEqual(response.boolean_nullable, False) + self.assertEqual( + response.boolean_default_false, True + ) # This field not updated because model default only apply on creation + self.assertEqual( + response.boolean_default_true, False + ) # This field not updated because model default only apply on creation + self.assertEqual(response.boolean_required_but_serializer_default, False) + + self.assertEqual(all_setted_instance.boolean_nullable, None) + + async def test_update_string_not_setted_and_blank_not_allowed_raise_error(self): + grpc_stub = self.fake_grpc.get_fake_stub(DefaultValueControllerStub) + request = fakeapp_pb2.DefaultValueRequest( + id=self.setup_instance.id, + string_required="update_required2", + string_default="", + int_required=0, + boolean_required=False, + ) + + with self.assertRaises(grpc.RpcError) as error: + await grpc_stub.Update(request=request) + + self.assertEqual(error.exception.code(), grpc.StatusCode.INVALID_ARGUMENT) + + self.assertEqual( + '{"string_default": [{"message": "This field may not be blank.", "code": "blank"}]}', + error.exception.details(), + ) + + async def test_partial_update_specifying_optional_but_not_set_them(self): + all_setted_instance = await DefaultValueModel.objects.acreate( + string_required="update_required", + string_blank="update_blank", + string_nullable="update_nullable", + string_default="update_default", + string_default_and_blank="update_default_and_blank", + string_null_default_and_blank="update_null_default_and_blank", + string_required_but_serializer_default="update_serializer", + string_default_but_serializer_default="update_serializer_override", + string_nullable_default_but_serializer_default="update_serializer_override", + int_required=200, + int_nullable=201, + int_default=202, + int_required_but_serializer_default=60, + boolean_required=True, + boolean_nullable=True, + boolean_default_false=True, + boolean_default_true=False, + boolean_required_but_serializer_default=True, + ) + + grpc_stub = self.fake_grpc.get_fake_stub(DefaultValueControllerStub) + + # Notice abscence of "string_default" as it is a required field and default grpc value (empty string) is not valid if blank not True + request = fakeapp_pb2.DefaultValuePartialUpdateRequest( + id=all_setted_instance.id, + **{ + PARTIAL_UPDATE_FIELD_NAME: [ + "string_blank", + "string_nullable", + "string_default_and_blank", + "string_null_default_and_blank", + "string_required_but_serializer_default", + "string_default_but_serializer_default", + "string_nullable_default_but_serializer_default", + "int_nullable", + "int_default", + "int_required_but_serializer_default", + "boolean_nullable", + "boolean_default_false", + "boolean_default_true", + "boolean_required_but_serializer_default", + ] + } + ) + response = await grpc_stub.PartialUpdate(request=request) + + # STRING ################## + + # INFO - AM - 12/01/2024 - check presence / not presence depending if element is None or empty + self.assertTrue(response.HasField("string_blank")) + self.assertFalse(response.HasField("string_nullable")) + self.assertTrue(response.HasField("string_default_and_blank")) + self.assertFalse(response.HasField("string_null_default_and_blank")) + + # INFO - AM - 12/01/2024 - check value event if grpc default because we check presence before + self.assertEqual( + response.string_required, "update_required" + ) # Field not updated because not specified in PARTIAL_UPDATE_FIELD_NAME + self.assertEqual(response.string_blank, "") + self.assertEqual(response.string_nullable, "") + self.assertEqual(response.string_default_and_blank, "") + self.assertEqual( + response.string_default, "update_default" + ) # Field not updated because not specified in PARTIAL_UPDATE_FIELD_NAME + self.assertEqual(response.string_required_but_serializer_default, "default_serializer") + self.assertEqual( + response.string_default_but_serializer_default, "default_serializer_override" + ) + self.assertEqual( + response.string_nullable_default_but_serializer_default, + "default_serializer_override", + ) + + await all_setted_instance.arefresh_from_db() + self.assertEqual(all_setted_instance.string_blank, "") + self.assertEqual(all_setted_instance.string_nullable, None) + self.assertEqual(all_setted_instance.string_default_and_blank, "") + self.assertEqual(all_setted_instance.string_null_default_and_blank, None) + + # INTEGER ################## + + # INFO - AM - 12/01/2024 - check presence / not presence depending if element is None or empty + self.assertFalse(response.HasField("int_nullable")) + + # INFO - AM - 12/01/2024 - check value event if grpc default because we check presence before + self.assertEqual( + response.int_required, 200 + ) # Field not updated because not specified in PARTIAL_UPDATE_FIELD_NAME + self.assertEqual(response.int_nullable, 0) + self.assertEqual( + response.int_default, 0 + ) # This field is updated because the default value (0) is authorized by the serializer + self.assertEqual(response.int_required_but_serializer_default, 10) + + # BOOLEAN ################## + + # INFO - AM - 12/01/2024 - check presence / not presence depending if element is None or empty + self.assertFalse(response.HasField("boolean_nullable")) + self.assertTrue(response.HasField("boolean_default_false")) + self.assertTrue(response.HasField("boolean_default_true")) + + # INFO - AM - 12/01/2024 - check value event if grpc default because we check presence before + self.assertEqual( + response.boolean_required, True + ) # Field not updated because not specified in PARTIAL_UPDATE_FIELD_NAME + self.assertEqual(response.boolean_nullable, False) + self.assertEqual( + response.boolean_default_false, False + ) # This field is set to false because it's the default value of bool in gRPC as not specified + self.assertEqual( + response.boolean_default_true, False + ) # This field is set to false because it's the default value of bool in gRPC as not specified + self.assertEqual(response.boolean_required_but_serializer_default, False) + + async def test_partial_update_choosing_a_required_without_setting_it_raise_error(self): + all_setted_instance = await DefaultValueModel.objects.acreate( + string_required="update_required", + string_blank="update_blank", + string_nullable="update_nullable", + string_default="update_default", + string_default_and_blank="update_default_and_blank", + string_null_default_and_blank="update_null_default_and_blank", + string_required_but_serializer_default="update_serializer", + int_required=200, + int_nullable=201, + int_default=202, + int_required_but_serializer_default=60, + boolean_required=True, + boolean_nullable=True, + boolean_default_false=True, + boolean_default_true=False, + boolean_required_but_serializer_default=True, + ) + + grpc_stub = self.fake_grpc.get_fake_stub(DefaultValueControllerStub) + + request = fakeapp_pb2.DefaultValuePartialUpdateRequest( + id=all_setted_instance.id, + **{ + PARTIAL_UPDATE_FIELD_NAME: [ + "string_default", + ] + } + ) + + with self.assertRaises(grpc.RpcError) as error: + await grpc_stub.PartialUpdate(request=request) + + self.assertEqual(error.exception.code(), grpc.StatusCode.INVALID_ARGUMENT) + + self.assertEqual( + '{"string_default": [{"message": "This field may not be blank.", "code": "blank"}]}', + error.exception.details(), + ) + + async def test_partial_update_choosing_default_grpc_value_for_nullable_field(self): + # set "" for string_null_default_and_blank + # set 0 for int_nullable + # set False for boolean_nullable + all_setted_instance = await DefaultValueModel.objects.acreate( + string_required="update_required", + string_blank="update_blank", + string_nullable="update_nullable", + string_default="update_default", + string_default_and_blank="update_default_and_blank", + string_null_default_and_blank="update_null_default_and_blank", + string_required_but_serializer_default="update_serializer", + int_required=200, + int_nullable=201, + int_default=202, + int_required_but_serializer_default=60, + boolean_required=True, + boolean_nullable=True, + boolean_default_false=True, + boolean_default_true=False, + boolean_required_but_serializer_default=True, + ) + + grpc_stub = self.fake_grpc.get_fake_stub(DefaultValueControllerStub) + + # Notice abscence of "string_default" as it is a required field and default grpc value (empty string) is not valid if blank not True + request = fakeapp_pb2.DefaultValuePartialUpdateRequest( + id=all_setted_instance.id, + string_null_default_and_blank="", + int_nullable=0, + boolean_nullable=False, + **{ + PARTIAL_UPDATE_FIELD_NAME: [ + "string_null_default_and_blank", + "int_nullable", + "boolean_nullable", + ] + } + ) + response = await grpc_stub.PartialUpdate(request=request) + + self.assertTrue(response.HasField("string_null_default_and_blank")) + self.assertTrue(response.HasField("int_nullable")) + self.assertTrue(response.HasField("boolean_nullable")) + + self.assertEqual(response.string_null_default_and_blank, "") + self.assertEqual(response.int_nullable, 0) + self.assertEqual(response.boolean_nullable, False) + + await all_setted_instance.arefresh_from_db() + self.assertEqual(all_setted_instance.string_null_default_and_blank, "") + self.assertEqual(all_setted_instance.int_nullable, 0) + self.assertEqual(all_setted_instance.boolean_nullable, False) diff --git a/django_socio_grpc/tests/test_protobuf_registration.py b/django_socio_grpc/tests/test_protobuf_registration.py index 8b1cb76b..c00d466d 100644 --- a/django_socio_grpc/tests/test_protobuf_registration.py +++ b/django_socio_grpc/tests/test_protobuf_registration.py @@ -83,6 +83,7 @@ class MySerializer(proto_serializers.ProtoSerializer): user_name = MyIntField(help_text=ProtoComment(["@test=comment1", "@test2=comment2"])) title = serializers.CharField() optional_field = serializers.CharField(allow_null=True) + default_char = serializers.CharField(default="value") list_field = serializers.ListField(child=serializers.CharField()) list_field_with_serializer = serializers.ListField(child=MyOtherSerializer()) @@ -184,7 +185,8 @@ def test_from_field_slug_related_field(self): assert proto_field.name == "slug_test_model" assert proto_field.field_type == "int32" - assert proto_field.cardinality == FieldCardinality.NONE + # INFO - AM - 04/01/2024 - OPTIONAL because slug_test_model can be null in RelatedFieldModel + assert proto_field.cardinality == FieldCardinality.OPTIONAL assert proto_field.comments is None def test_from_field_related_field_source(self): @@ -194,7 +196,8 @@ def test_from_field_related_field_source(self): assert proto_field.name == "pk_related_source_field" assert proto_field.field_type == "string" - assert proto_field.cardinality == FieldCardinality.NONE + # INFO - AM - 04/01/2024 - OPTIONAL because foreign can be null in RelatedFieldModel + assert proto_field.cardinality == FieldCardinality.OPTIONAL assert proto_field.comments is None field = ser.fields["many_related_field"] @@ -259,7 +262,18 @@ def test_from_field_serializer_choice_field(self): assert proto_field.name == "choice_field" assert proto_field.field_type == "int32" - assert proto_field.cardinality == FieldCardinality.NONE + # INFO - AM - 04/01/2024 - OPTIONAL because a default is specified in the model + assert proto_field.cardinality == FieldCardinality.OPTIONAL + + def test_from_field_default(self): + ser = MySerializer() + field_char = ser.fields["default_char"] + + proto_field_char = ProtoField.from_field(field_char) + + assert proto_field_char.name == "default_char" + assert proto_field_char.field_type == "string" + assert proto_field_char.cardinality == FieldCardinality.OPTIONAL # FROM_SERIALIZER @@ -395,26 +409,26 @@ def test_from_serializer(self): proto_message = ProtoMessage.from_serializer(MySerializer, name="My") assert proto_message.name == "My" - assert len(proto_message.fields) == 11 + assert len(proto_message.fields) == 12 def test_from_serializer_request(self): proto_message = RequestProtoMessage.from_serializer(MySerializer, name="MyRequest") assert proto_message.name == "MyRequest" - assert len(proto_message.fields) == 6 + assert len(proto_message.fields) == 7 assert "write_only_field" in proto_message proto_message = RequestProtoMessage.from_serializer(MySerializer, "CustomName") assert proto_message.name == "CustomName" - assert len(proto_message.fields) == 6 + assert len(proto_message.fields) == 7 def test_from_serializer_response(self): proto_message = ResponseProtoMessage.from_serializer(MySerializer, name="MyResponse") assert proto_message.name == "MyResponse" - assert len(proto_message.fields) == 10 + assert len(proto_message.fields) == 11 def test_from_serializer_nested(self): proto_message = ResponseProtoMessage.from_serializer( @@ -426,7 +440,7 @@ def test_from_serializer_nested(self): assert proto_message.comments == ["serializer comment"] assert proto_message.fields[0].name == "serializer" - assert len(proto_message.fields[0].field_type.fields) == 10 + assert len(proto_message.fields[0].field_type.fields) == 11 class TestGrpcActionProto(TestCase): diff --git a/django_socio_grpc/tests/test_sync_model_service.py b/django_socio_grpc/tests/test_sync_model_service.py index 09b179f0..cbccd832 100644 --- a/django_socio_grpc/tests/test_sync_model_service.py +++ b/django_socio_grpc/tests/test_sync_model_service.py @@ -11,6 +11,7 @@ from freezegun import freeze_time from django_socio_grpc.settings import grpc_settings +from django_socio_grpc.utils.constants import PARTIAL_UPDATE_FIELD_NAME from .grpc_test_utils.fake_grpc import FakeGRPC @@ -99,22 +100,50 @@ def test_partial_update(self): # Test partial update does not update fields not specified request = fakeapp_pb2.UnitTestModelPartialUpdateRequest( - id=instance.id, _partial_update_fields=["title"], title="newTitle" + id=instance.id, title="newTitle", **{PARTIAL_UPDATE_FIELD_NAME: ["title"]} ) response = grpc_stub.PartialUpdate(request=request) self.assertEqual(response.title, "newTitle") self.assertEqual(response.text, old_text) + # Test partial update does not update fields not specified even if passed in request + request = fakeapp_pb2.UnitTestModelPartialUpdateRequest( + id=instance.id, + text="notUpdated", + title="newTitle", + **{PARTIAL_UPDATE_FIELD_NAME: ["title"]} + ) + response = grpc_stub.PartialUpdate(request=request) + + self.assertEqual(response.title, "newTitle") + self.assertEqual(response.text, old_text) + + # Test partial update takes into account None value for allow_null field + request = fakeapp_pb2.UnitTestModelPartialUpdateRequest( + id=instance.id, text=None, **{PARTIAL_UPDATE_FIELD_NAME: ["text"]} + ) + response = grpc_stub.PartialUpdate(request=request) + + self.assertEqual(response.title, "newTitle") + + # https://www.django-rest-framework.org/api-guide/fields/#default + # Note that, without an explicit default, setting this argument to True will imply a default value of null for serialization output, but does not imply a default for input deserialization. + self.assertFalse(response.HasField("text")) + instance.refresh_from_db() + self.assertIsNone(instance.text) + # Test partial update takes into account empty optional fields + instance.text = old_text + instance.save() request = fakeapp_pb2.UnitTestModelPartialUpdateRequest( - id=instance.id, _partial_update_fields=["text"] + id=instance.id, **{PARTIAL_UPDATE_FIELD_NAME: ["text"]} ) response = grpc_stub.PartialUpdate(request=request) self.assertEqual(response.title, "newTitle") - # Directly getting `text` would return default value, which is empty string + # Note that, without an explicit default, setting this argument to True will imply a default value of null for serialization output, but does not imply a default for input deserialization. self.assertFalse(response.HasField("text")) def test_async_list_custom_action(self): diff --git a/django_socio_grpc/utils/constants.py b/django_socio_grpc/utils/constants.py index 0735e632..aa002513 100644 --- a/django_socio_grpc/utils/constants.py +++ b/django_socio_grpc/utils/constants.py @@ -2,3 +2,4 @@ LIST_ATTR_MESSAGE_NAME = "message_list_attr" REQUEST_SUFFIX = "Request" RESPONSE_SUFFIX = "Response" +PARTIAL_UPDATE_FIELD_NAME = "_partial_update_fields" diff --git a/docs/features/proto-serializers.rst b/docs/features/proto-serializers.rst index a29f9461..1ff20a21 100644 --- a/docs/features/proto-serializers.rst +++ b/docs/features/proto-serializers.rst @@ -194,31 +194,56 @@ Use Cases .. _proto-serializers-nullable-fields: -=========================== -Nullable fieds (`optional`) -=========================== +============================================================= +Required, Nullable and default values for fields (`optional`) +============================================================= In gRPC, all fields have a default value. For example, if you have a field of type `int32` and you don't set a value, the default value will be `0`. To know if this field was set (so its value is actually `0`) or not, the field needs to be declared as `optional` (see `proto3 `_ documentation). -.. warning:: +To work with this different behavior between REST and gRPC we use the combination of +`required `_, +`allow_null `_ and +`default `_ field parameters to find the adapted behavior. - There is no way to differentiate between a field that was not set and a field that was set to `None`. - Therefore ``{}`` and ``{"field": None}`` will be converted to the same gRPC message. - By default, we decided to interpret no presence of a field as ``None`` to have an intuitive way to use nullable fields which - are extensively used in Django (``null=True``) and DRF (``allow_null=True``) options. - This behavior has an unintended consequence with default values in ``ModelProtoSerializer``, because - the value will be `None` instead of being absent. - There is an `open issue `_ on the subject, with a workaround. There are multiple ways to have proto fields with ``optional``: -- In ``ProtoSerializer``, you can use ``allow_null=True`` in the field kwargs. +- In ``ProtoSerializer``, you can use ``allow_null=True``, ``required=False`` or ``default=`` in the field kwargs. Note that default should not be ``None`` or ``rest_framework.fields.empty``. If default is None just set ``allow_null`` to ``True`` - In ``SerializerMethodField``, you can use the return annotation ``Optional[...]`` or ``... | None`` for Python 3.10+. - In ``ModelProtoSerializer``, model fields with ``null=True`` will be converted to ``optional`` fields. - In ``GRPCAction`` you can set ``cardinality`` to ``optional`` in the `request` or `response` :func:`FieldDict `. +How the values are choosen by DSG when **values are not set in the message** (this behavior is possible only if field is optional and should be automatic depending of what you specified in your model or serializer but can be customized depending on your need): + +- If create or update, and the field has ``required=True``: Set to the default grpc value for the type ("" for string, 0 for int, False for boolean, ...) +- If create or update, and the field has ``required=True`` and a **default in the serializer field** : Set to None + +------ + +- If update, and the field has ``allow_null=True``: Set to None +- If create, and the field has ``allow_null=True`` and the field have a **default in the model**: Set to the model field default +- If create, and the field has ``allow_null=True`` and the field have a **default in the serializer**: Set to serializer field default +- If create, and the field has ``allow_null=True`` and the field haven't a **default in the model or the serializer**: Set to None + +------ + +- If partial update, and the field is **not in the list of field to update**: delete the field +- If partial update, and the field is **in the list of field to update** and ``allow_null=True``: Set to None +- If partial update, and the field is **in the list of field to update** and the field have a ``default in the serializer``: Set to serializer field default +- If partial update, and the field is **in the list of field to update** and none of the above option: Set to the default grpc value for the type + + +How the values are choosen by DSG when **values are set to default gRPC values**: + +- If create or update, and the field has ``required=True``: Use the default grpc value +- Else use same logic than value not set. + +.. note:: + + To see real examples of this behavior please see `Model `_, `Serializer `_ and `Tests `_ + ============================== Read-Only and Write-Only Props ============================== @@ -227,6 +252,7 @@ Read-Only and Write-Only Props If the setting `SEPARATE_READ_WRITE_MODEL` is `True`, DSG will automatically use `read_only` and `write_only` field kwargs to generate fields only in the request or response message. This is also true for Django fields with specific values (e.g., ``editable=False``). .. warning:: + This setting is deprecated. See :ref:`setting documentation` @@ -348,8 +374,6 @@ To circumvent this problem, DSG introduces function introspection where we are l class ExampleSerializer(proto_serializers.ProtoSerializer): - :TODO: module "serializers" does not exist, please add the correct import - default_method_field = serializers.SerializerMethodField() custom_method_field = serializers.SerializerMethodField(method_name="custom_method") diff --git a/test_utils/generateproto.py b/test_utils/generateproto.py index bb73fe14..b7e9a46b 100644 --- a/test_utils/generateproto.py +++ b/test_utils/generateproto.py @@ -18,18 +18,18 @@ call_command("generateproto", *args, **opts) # INFO - AM - 29/12/2023 - This for loop is used to generate proto file used in proto tests to avoid changing them by hand -# for name, grpc_settings in OVERRIDEN_SETTINGS.items(): -# RegistrySingleton.clean_all() -# settings = {} -# if grpc_settings: -# settings = { -# "GRPC_FRAMEWORK": grpc_settings, -# } -# with override_settings(**settings): -# call_command( -# "generateproto", -# no_generate_pb2=True, -# directory=f"./django_socio_grpc/tests/protos/{name}", -# project="myproject", -# override_fields_number=override_fields_number, -# ) +for name, grpc_settings in OVERRIDEN_SETTINGS.items(): + RegistrySingleton.clean_all() + settings = {} + if grpc_settings: + settings = { + "GRPC_FRAMEWORK": grpc_settings, + } + with override_settings(**settings): + call_command( + "generateproto", + no_generate_pb2=True, + directory=f"./django_socio_grpc/tests/protos/{name}", + project="myproject", + override_fields_number=override_fields_number, + )