From 954fb561f8a580aff39ddddb5ab40eae341fa9e8 Mon Sep 17 00:00:00 2001 From: AMontagu Date: Fri, 27 Sep 2024 09:42:11 +0200 Subject: [PATCH] Feature/add cache decorator (#313) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - [x] Test on real app - [x] Clean code - [x] Write forgotten test about change default settings value for cache - [x] Test automatique wrapper around django decorator - [x] Implement an auto clean cache decorator from django signals - [x] Write documentation* - [x] Make changelog. Put inside the inheritance of django request/response. The headers proxy, the http_to_grpc_decorator, cache feature and the fact that metadata in test should match real grpc convention, drop support of django version and python versions --------- Co-authored-by: Léni --- .github/workflows/lint-test.yml | 2 +- CHANGELOG.md | 5 + django_socio_grpc/apps.py | 4 + django_socio_grpc/decorators.py | 295 ++ django_socio_grpc/grpc_actions/actions.py | 8 +- .../management/commands/grpcrunaioserver.py | 2 + django_socio_grpc/middlewares.py | 2 +- .../grpc_internal_proxy.py | 172 +- .../socio_internal_request.py | 179 +- .../socio_internal_response.py | 19 +- django_socio_grpc/services/servicer_proxy.py | 20 +- django_socio_grpc/settings.py | 12 +- django_socio_grpc/signals.py | 4 + .../tests/fakeapp/grpc/fakeapp.proto | 75 + .../tests/fakeapp/grpc/fakeapp_pb2.py | 118 +- .../tests/fakeapp/grpc/fakeapp_pb2_grpc.py | 2560 ++++++++++++++--- django_socio_grpc/tests/fakeapp/handlers.py | 7 + .../tests/fakeapp/serializers.py | 14 + .../unit_test_model_with_cache_service.py | 133 + .../tests/grpc_test_utils/fake_grpc.py | 85 +- .../fakeapp.proto | 52 + .../ALL_APP_GENERATED_SEPARATE/fakeapp.proto | 75 + .../tests/test_authentication.py | 4 +- django_socio_grpc/tests/test_cache.py | 660 +++++ .../tests/test_filtering_metadata.py | 25 + .../tests/test_legacy_django_middlewares.py | 14 +- .../tests/test_locale_middleware.py | 14 +- .../tests/test_pagination_metadata.py | 4 +- .../tests/test_pagination_request_struct.py | 14 +- docs/features/cache.rst | 168 ++ docs/features/filters.rst | 2 +- docs/features/grpc-action.rst | 2 +- docs/features/index.rst | 1 + docs/features/pagination.rst | 3 +- docs/how-to/index.rst | 1 + docs/how-to/use-django-decorators-in-dsg.rst | 54 + .../request-and-response-proxy.rst | 6 + docs/settings.rst | 28 +- poetry.lock | 6 +- test_utils/boot_django.py | 22 + 40 files changed, 4269 insertions(+), 602 deletions(-) create mode 100644 django_socio_grpc/signals.py create mode 100644 django_socio_grpc/tests/fakeapp/services/unit_test_model_with_cache_service.py create mode 100644 django_socio_grpc/tests/test_cache.py create mode 100644 docs/features/cache.rst create mode 100644 docs/how-to/use-django-decorators-in-dsg.rst create mode 100644 docs/inner-workings/request-and-response-proxy.rst diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index 58d4e4a5..24dfe4f2 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -60,11 +60,11 @@ jobs: if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: | poetry install - poetry add django@^${{ matrix.django-version }} - name: Run pre-commit hooks run: | poetry run pre-commit run --all-files --show-diff-on-failure - name: Run tests run: | + poetry add django@^${{ matrix.django-version }} poetry run tests diff --git a/CHANGELOG.md b/CHANGELOG.md index e5b927f7..8c116936 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ - Dropping not working support for Django < 4 - Dropping support for python < 3.10 - Add Django version into the CI to assure that supporting version still works +- Made Internal Proxy Request/Response inherit from django Request/Response +- Create Request Meta and Response Headers interceptor/proxy to be able to get/set correctly headers for both request and response +- Create the http_to_grpc decorator to provide a way to use django decorator in DSG +- Add cache_enpoint, cache_endpoint_with_deleter, vary_on_metadata decorator +- Stop allowing metadata that doesn't have lower case key and metadata values that are not str or bytes in FakeGrpc testing tool ## 0.22.9 diff --git a/django_socio_grpc/apps.py b/django_socio_grpc/apps.py index 410ada12..32702d2a 100644 --- a/django_socio_grpc/apps.py +++ b/django_socio_grpc/apps.py @@ -8,3 +8,7 @@ class DjangoSocioGrpcConfig(AppConfig): name = "django_socio_grpc" verbose_name = "Django Socio gRPC" + + def ready(self): + # Import signals module to connect the signals + pass diff --git a/django_socio_grpc/decorators.py b/django_socio_grpc/decorators.py index f9d153cd..8df95b96 100644 --- a/django_socio_grpc/decorators.py +++ b/django_socio_grpc/decorators.py @@ -1,14 +1,41 @@ +import asyncio +import functools import logging +from collections.abc import Callable, Iterable +from typing import TYPE_CHECKING + +import django +from asgiref.sync import async_to_sync, sync_to_async +from django.core.cache import cache as default_cache +from django.core.cache import caches +from django.db.models import Model +from django.db.models.signals import post_delete, post_save +from django.dispatch import receiver +from django.utils.decorators import method_decorator +from django.views.decorators.cache import cache_page +from django.views.decorators.vary import vary_on_headers +from google.protobuf.message import Message from django_socio_grpc.protobuf.generation_plugin import ( BaseGenerationPlugin, ListGenerationPlugin, ) from django_socio_grpc.protobuf.message_name_constructor import MessageNameConstructor +from django_socio_grpc.request_transformer import ( + GRPCInternalProxyResponse, +) from django_socio_grpc.settings import grpc_settings +from django_socio_grpc.signals import grpc_action_register +from django_socio_grpc.utils.utils import isgeneratorfunction from .grpc_actions.actions import GRPCAction +if TYPE_CHECKING: + from django_socio_grpc.request_transformer.grpc_internal_proxy import ( + GRPCInternalProxyContext, + ) + from django_socio_grpc.services import Service + logger = logging.getLogger("django_socio_grpc.generation") @@ -79,3 +106,271 @@ def wrapper(function): ) return wrapper + + +def http_to_grpc( + decorator_to_wrap: Callable, + request_setter: dict = None, + response_setter: dict = None, + support_async: bool = False, +) -> Callable: + """ + Allow to use Django decorators on grpc endpoint. + As the working behavior will depend on the grpc support and/or DSG support of the feature it may not work as expected. + If it's not working as expected, first look at the documentation if the decorators is not listed as one of the unsupported decorator. + If not, please open an issue and we will look if possible to support it. + + :param decorator_to_wrap: The decorator to wrap. It can be a method or a function decorator. + :param request_setter: A dict of attribute to set on the request object before calling the HTTP decorator. + :param response_setter: A dict of attribute to set on the response object before returning it to the HTTP decorator. + :param support_async: If the decorator to wrap is async or not. If not, it will be wrapped in a sync function. Refer to https://docs.djangoproject.com/en/5.0/topics/async/#decorators + """ + + def decorator(func: GRPCAction | Callable, *args, **kwargs) -> Callable: + # INFO - AM - 21/08/2024 - Depending of the decorator order we may have a GRPCAction or a function so we need to get the actual function + grpc_action_method = func.function if isinstance(func, GRPCAction) else func + if isgeneratorfunction(grpc_action_method): + raise ValueError( + "You are using http_to_grpc decorator or an other decorator that use http_to_grpc on a gRPC stream endpoint. This is not supported and will not work as expected. If you meet a specific use case that you think is still relevant on a stream endpoint, please open an issue." + ) + + if asyncio.iscoroutinefunction(grpc_action_method): + + async def _simulate_function( + service_instance: "Service", context: "GRPCInternalProxyContext" + ) -> "GRPCInternalProxyResponse": + """ + This async method is a wrapper to pass to the Django/HTTP1 decorator a method that only + take an object that can proxy a django.http.request as param + and return an object that can proxy a django.http.response. + """ + # INFO - AM - 01/08/2024 - As a django decorator take only one request argument and grpc 2 we are passing an instance of GRPCInternalProxyContext so we can get the context back from the request and make the actual call + request = context.grpc_request + # INFO - AM - 01/08/2024 - Call the actual grpc endpoint + endpoint_result = await func(service_instance, request, context) + # INFO - AM - 01/08/2024 - Transform the grpc Response to a proxyfied one to let the http decorator work + response_proxy = GRPCInternalProxyResponse(endpoint_result, context) + # INFO - AM - 01/08/2024 - This allow developer to customize some response behavior + if response_setter: + for key, value in response_setter.items(): + setattr(response_proxy, key, value) + return response_proxy + + @functools.wraps(grpc_action_method) + async def _view_wrapper( + service_instance: "Service", + request: Message, + context: "GRPCInternalProxyContext", + ) -> Message: + # INFO - AM - 01/08/2024 - This allow developer to customize some request behavior. For exemple all grpc request are POST but the cache behavior need GET request so we transform that here. + if request_setter: + for key, value in request_setter.items(): + setattr(context, key, value) + # INFO - AM - 30/07/2024 - Before django 5, all django decorator didn't support async function. + # Since django 5 some decorator accept it but not all. + # We need to wrap them in a sync function. + if django.VERSION < (5, 0, 0) or not support_async: + response_proxy = await sync_to_async( + decorator_to_wrap(async_to_sync(_simulate_function)) + )(service_instance, context) + else: + # INFO - AM - 01/08/2024 - Give the HTTP decorator a wrapper around the endpoint that match what a django endpoint should expect as param and return type + response_proxy = await decorator_to_wrap(_simulate_function)( + service_instance, context + ) + # INFO - AM - 30/07/2024 - Remember to put the grpc context in case the response come from cache + if not response_proxy.grpc_context: + response_proxy.set_current_context(context.grpc_context) + return response_proxy.grpc_response + + else: + + def _simulate_function( + service_instance: "Service", context: "GRPCInternalProxyContext" + ) -> "GRPCInternalProxyResponse": + """ + This sync method is a wrapper to pass to the Django/HTTP1 decorator a method that only + take an object that can proxy a django.http.request as param + and return an object that can proxy a django.http.response. + """ + # INFO - AM - 01/08/2024 - As a django decorator take only one request argument and grpc 2 we are passing an instance of GRPCInternalProxyContext so we can get the context back from the request and make the actual call + request = context.grpc_request + # INFO - AM - 01/08/2024 - Call the actual grpc endpoint + endpoint_result = func(service_instance, request, context) + # INFO - AM - 01/08/2024 - Transform the grpc Response to a proxyfied one to let the http decorator work + response_proxy = GRPCInternalProxyResponse(endpoint_result, context) + # INFO - AM - 01/08/2024 - This allow developer to customize some response behavior + if response_setter: + for key, value in response_setter.items(): + setattr(response_proxy, key, value) + return response_proxy + + @functools.wraps(grpc_action_method) + def _view_wrapper( + service_instance: "Service", + request: Message, + context: "GRPCInternalProxyContext", + ) -> Message: + # INFO - AM - 01/08/2024 - This allow developer to customize some request behavior. For exemple all grpc request are POST but the cache behavior need GET request so we transform that here. + if request_setter: + for key, value in request_setter.items(): + setattr(context, key, value) + # INFO - AM - 01/08/2024 - Give the HTTP decorator a wrapper around the endpoint that match what a django endpoint should expect as param and return type + response_proxy = decorator_to_wrap(_simulate_function)( + service_instance, request, context + ) + # INFO - AM - 30/07/2024 - Remember to put the grpc context in case the response come from cache + if not response_proxy.grpc_context: + response_proxy.set_current_context(context.grpc_context) + return response_proxy.grpc_response + + # INFO - AM - 21/08/2024 - If the http_to_grpc is called on top of the grpc decorator we need to return a copy of GRPCAction to let DSG working normally as it expect a GRPCAction + return ( + func.clone(function=_view_wrapper) + if isinstance(func, GRPCAction) + else _view_wrapper + ) + + return decorator + + +def vary_on_metadata(*headers) -> Callable: + """ + Same as https://docs.djangoproject.com/fr/5.0/topics/http/decorators/#django.views.decorators.vary.vary_on_headers + but need to wrap the response in a GRPCInternalProxyResponse. + A view decorator that adds the specified metadatas to the Vary metadata of the + response. Usage: + + @vary_on_metadata('Cookie', 'Accept-language') + def index(request): + ... + + Note that the metadata names are not case-sensitive. + """ + return http_to_grpc(vary_on_headers(*headers), support_async=True) + + +@functools.wraps(cache_page) +def cache_endpoint(*args, **kwargs): + """ + A decorator for caching gRPC endpoints using Django's cache_page functionality. + This decorator adapts Django's cache_page for use with gRPC endpoints. It performs the following steps: + 1. Converts cache_page to a method decorator, see: + https://docs.djangoproject.com/en/5.0/topics/class-based-views/intro/#decorating-the-class + 2. Transforms the method decorator to be gRPC-compatible. + 3. Forces the request method to be GET. + + Do not use this decorator on Create, Update, or Delete endpoints, as it will cache the response and return the same result to all users, potentially leading to data inconsistencies. + """ + return http_to_grpc( + method_decorator(cache_page(*args, **kwargs)), + request_setter={"method": "GET"}, + support_async=False, + ) + + +def cache_endpoint_with_deleter( + timeout: int, + key_prefix: str = "", + senders: Iterable[Model] | None = None, + cache: str = None, + invalidator_signals: Iterable[Callable] = None, +): + """ + This decorator does all the same as cache_endpoint but with the addition of a cache deleter. + The cache deleter will delete the cache when a signal is triggered. + This is useful when you want to delete the cache when a model is updated or deleted. + Be warned that this can add little overhead at server start as it will listen to signals. + + :param timeout: The timeout of the cache + :param key_prefix: The key prefix of the cache + :param cache: The cache alias to use. If None, it will use the default cache. It is named cache and not cache_alias to keep compatibility with Django cache_page decorator + :param senders: The senders to listen to the signal + :param invalidator_signals: The django signals to listen to delete the cache + """ + if cache is None and not hasattr(default_cache, "delete_pattern"): + cache_deleter_logger = logging.getLogger(__name__) + cache_deleter_logger.warning( + "You are using cache_endpoint_with_deleter with the default cache engine that is not a redis cache engine." + "Only Redis cache engine support cache pattern deletion." + "You still continue to use it but it will delete all the endpoint cache when signal will trigger." + "Please use a specific cache config per service or use redis cache engine to avoid this behavior." + "If this is the expected behavior, you can disable this warning by muting django_socio_grpc.cache_deleter logger in your logging settings." + ) + + if invalidator_signals is None: + invalidator_signals = (post_save, post_delete) + + def decorator(func: Callable, *args, **kwargs): + # INFO - AM - 21/08/2024 - We connect to the grpc action set signal to have access to the owner of the function and the name of the function as we used a decorated with parameter we don't have access to the service class to get default senders and model to use + @receiver(grpc_action_register, weak=False) + def register_invalidate_cache_signal(sender, owner, name, **kwargs): + # INFO - AM - 21/08/2024 - The decorator can be put before or after the grpc_action decorator so we need to check if the function is a grpc action or not + func_qual_name = ( + func.function.__qualname__ + if isinstance(func, GRPCAction) + else func.__qualname__ + ) + + # INFO - AM - 05/09/2024 - the func_qual_name is the name of the service_name.function_name of the method we decorate. But in an inheritance context the service_name is the parent name not the owner name. + # So to be able to known if the function currently being registered is the one that is decorated with the cache deleter we need to check if the function is in the owner mro + func_registered_is_func_decorated = any( + [f"{mro_class.__name__}.{name}" == func_qual_name for mro_class in owner.mro()] + ) + + # INFO - AM - 05/09/2024 - We verify that the function registered is the one we wen to use the cache with deleter and it's exist the owner registry. + if not func_registered_is_func_decorated: + return + + # INFO - AM - 22/08/2024 - Set the default value for key_prefix, senders, invalidator_signals is not set + # INFO - AM - 05/09/2024 - We need a _key_prefix to avoid having only one key for all inherited model + _key_prefix = key_prefix + if not _key_prefix: + _key_prefix = f"{owner.__name__}-{name}" + + # INFO - AM - 05/09/2024 - It's safe to assign directly senders to locale_senders as we assign a value only if None and None is passed by value and not reference so no risk of assigning the same senders to all inherites class + locale_senders = senders + if locale_senders is None and hasattr(owner, "queryset"): + locale_senders = owner.queryset.model + + # INFO - AM - 22/08/2024 - If no sender are specified and the service do not have a queryset we can't use the cache deleter. There is a warning displayed to the user + if locale_senders is not None: + if not isinstance(locale_senders, Iterable): + locale_senders = [locale_senders] + + # INFO - AM - 21/08/2024 - Once we have all the value we need we can connect the Model signals to the cache deleter + @receiver(invalidator_signals, weak=False) + def invalidate_cache(*args, **kwargs): + if kwargs.get("sender") in locale_senders: + # INFO - AM - 01/08/2024 - To follow django cache_page signature cache is a string and not a cache instance. In this behavior we need the cache instance so we get it + cache_instance = caches[cache] if cache else default_cache + # INFO - AM - 01/08/2024 - For now this is only for Redis cache but this is important to support as it simplify the cache architecture to create if used + # Has cache_instance is a django.utils.connection.ConnectionProxy, hasattr will not work so we need to use try except + try: + cache_instance.delete_pattern( + f"views.decorators.cache.cache_header.{_key_prefix}.*" + ) + cache_instance.delete_pattern( + f"views.decorators.cache.cache_page.{_key_prefix}.*" + ) + except AttributeError: + cache_instance.clear() + else: + logger.warning( + "You are using cache_endpoint_with_deleter without senders. If you don't need the auto deleter just use cache_endpoint decorator." + ) + + # INFO - AM - 22/08/2024 - http_to_grpc is a decorator so we pass the function to wrap in argument of it's return value + sender.function = http_to_grpc( + method_decorator( + cache_page(timeout, key_prefix=_key_prefix, cache=cache), + name="cache_page", + ), + request_setter={"method": "GET"}, + support_async=False, + )(sender.function) + + # INFO - AM - 05/09/2024 - We return the function directly because the patching of the function is done in the signal receiver + return func + + return decorator diff --git a/django_socio_grpc/grpc_actions/actions.py b/django_socio_grpc/grpc_actions/actions.py index 71a0a2d0..b243383e 100644 --- a/django_socio_grpc/grpc_actions/actions.py +++ b/django_socio_grpc/grpc_actions/actions.py @@ -62,6 +62,7 @@ ) from django_socio_grpc.request_transformer.grpc_internal_proxy import GRPCInternalProxyContext from django_socio_grpc.settings import grpc_settings +from django_socio_grpc.signals import grpc_action_register from django_socio_grpc.utils.debug import ProtoGeneratorPrintHelper from django_socio_grpc.utils.utils import _is_generator, isgeneratorfunction @@ -124,6 +125,9 @@ def __set_name__(self, owner, name): owner._decorated_grpc_action_registry = {} owner._decorated_grpc_action_registry.update({name: self.get_action_params()}) + def __hash__(self): + return hash(self.function) + def __get__(self, obj, type=None): return self.clone(function=self.function.__get__(obj, type)) @@ -224,7 +228,6 @@ def register(self, owner: type["Service"], action_name: str): ProtoGeneratorPrintHelper.set_service_and_action( service_name=owner.__name__, action_name=action_name ) - ProtoGeneratorPrintHelper.print("register ", owner.__name__, action_name) try: self.resolve_placeholders(owner, action_name) @@ -242,6 +245,9 @@ def register(self, owner: type["Service"], action_name: str): setattr(owner, action_name, self) + # INFO - AM - 22/08/2024 - Send a signal to notify that a grpc action has been created. Used for now in cache deleter + grpc_action_register.send(sender=self, owner=owner, name=action_name) + def resolve_placeholders(self, service_class: type["Service"], action: str): """ Iterate over the `GRPCAction` attributes and resolve all the placeholder instances diff --git a/django_socio_grpc/management/commands/grpcrunaioserver.py b/django_socio_grpc/management/commands/grpcrunaioserver.py index d608d04f..1bd983e4 100644 --- a/django_socio_grpc/management/commands/grpcrunaioserver.py +++ b/django_socio_grpc/management/commands/grpcrunaioserver.py @@ -55,6 +55,8 @@ def handle(self, *args, **options): # set GRPC_ASYNC to "true" in order to start server asynchronously grpc_settings.GRPC_ASYNC = True + # INFO - AM - 25/07/2025 - Make sure that the port in the settings is the correct one + grpc_settings.GRPC_CHANNEL_PORT = self.address.split(":")[-1] asyncio.run(self.run(**options)) diff --git a/django_socio_grpc/middlewares.py b/django_socio_grpc/middlewares.py index 668ebfcc..c0dea391 100644 --- a/django_socio_grpc/middlewares.py +++ b/django_socio_grpc/middlewares.py @@ -99,7 +99,7 @@ def locale_middleware(get_response: Callable): """ Middleware to activate i18n language in django. It will look for an Accept-Language formated metadata in the headers key. - metadata = ('headers', ('Accept-Language', 'fr-CH, fr;q=0.9, en;q=0.8, de;')) + metadata = ('headers', ('accept-language', 'fr-CH, fr;q=0.9, en;q=0.8, de;')) """ if asyncio.iscoroutinefunction(get_response): diff --git a/django_socio_grpc/request_transformer/grpc_internal_proxy.py b/django_socio_grpc/request_transformer/grpc_internal_proxy.py index 1e8ef8bd..624b7f21 100644 --- a/django_socio_grpc/request_transformer/grpc_internal_proxy.py +++ b/django_socio_grpc/request_transformer/grpc_internal_proxy.py @@ -1,8 +1,11 @@ from dataclasses import dataclass +from typing import Optional +from django.utils.datastructures import ( + CaseInsensitiveMapping, +) from google.protobuf.message import Message from grpc.aio import ServicerContext -from grpc.aio._typing import ResponseType from .socio_internal_request import InternalHttpRequest from .socio_internal_response import InternalHttpResponse @@ -19,10 +22,13 @@ class GRPCInternalProxyContext: # INFO - AM - 14/02/2024 - grpc_request is used to get filter and pagination from the request. It is not acessible in GRPCInternalProxyContext. grpc_request: Message grpc_action: str + service_class_name: str http_request: InternalHttpRequest = None def __post_init__(self): - self.http_request = InternalHttpRequest(self, self.grpc_request, self.grpc_action) + self.http_request = InternalHttpRequest( + self, self.grpc_request, self.grpc_action, self.service_class_name + ) def __getattr__(self, attr): if hasattr(self.grpc_context, attr): @@ -38,17 +44,104 @@ class GRPCInternalProxyResponse: Need to be improved if some specific behavior needed, for example injecting some data in the reponse metadata. """ - grpc_response: ResponseType - http_response: InternalHttpResponse = None + grpc_response: Message + # INFO - AM - 25/07/2024 - grpc context is used to pass response header to client + grpc_context: ServicerContext + # INFO - AM - 01/08/2024 - http_response is created in post_init signals. Don't need to pass it in the constructor if defautl behavior wanted. + http_response: InternalHttpResponse | None = None + # INFO - AM - 01/08/2024 - headers is created in post_init signals. Don't need to pass it in the constructor if defautl behavior wanted. + headers: Optional["ResponseHeadersProxy"] = None def __post_init__(self): self.http_response = InternalHttpResponse() + self.headers = ResponseHeadersProxy(self.grpc_context, self.http_response) def __getattr__(self, attr): + """ + This private method is used to correctly distribute the attribute access between the proxy, th grpc_response and the http_response + """ + if attr in self.__annotations__: + return super().__getattribute__(attr) if hasattr(self.grpc_response, attr): return getattr(self.grpc_response, attr) return getattr(self.http_response, attr) + def __delitem__(self, header): + """ + Allow to treat GRPCInternalProxyResponse as a dict of headers as django.http.HttpResponse does + """ + return self.headers.__delitem__(header) + + def __setitem__(self, key, value): + """ + Allow to treat GRPCInternalProxyResponse as a dict of headers as django.http.HttpResponse does + """ + return self.headers.__setitem__(key, value) + + def __getitem__(self, header): + """ + Allow to treat GRPCInternalProxyResponse as a dict of headers as django.http.HttpResponse does + """ + return self.headers.__getitem__(header) + + def has_header(self, header): + """Case-insensitive check for a header.""" + return header in self.headers + + __contains__ = has_header + + def get(self, key, default=None): + """ + Allow to treat GRPCInternalProxyResponse as a dict of headers as django.http.HttpResponse does + """ + return self.headers.get(key, default) + + def items(self): + """ + Allow to treat GRPCInternalProxyResponse as a dict of headers as django.http.HttpResponse does + """ + return self.headers.items() + + def setdefault(self, key, value): + """ + Allow to treat GRPCInternalProxyResponse as a dict of headers as django.http.HttpResponse does + Set a header unless it has already been set. + """ + self.headers.setdefault(key, value) + + def __getstate__(self): + """ + Allow to serialize the object mainly for cache purpose + """ + return { + "grpc_response": self.grpc_response, + "http_response": self.http_response, + "response_metadata": dict(self.grpc_context.trailing_metadata()), + } + + def __repr__(self): + return f"GRPCInternalProxyResponse<{self.grpc_response.__repr__()}, {self.http_response.__repr__()}>" + + def __setstate__(self, state): + """ + Allow to deserialize the object mainly for cache purpose. + When used in cache, the grpc_context is not set. To be correctly use set_current_context method should be called + """ + self.grpc_response = state["grpc_response"] + self.http_response = state["http_response"] + self.headers = ResponseHeadersProxy( + None, self.http_response, metadata=state["response_metadata"] + ) + self.grpc_context = None + + def set_current_context(self, grpc_context: ServicerContext): + """ + This method is used to set the current context to the response object when fetched from cache + It also enable the copy of the cache metdata + """ + self.grpc_context = grpc_context + self.headers.set_grpc_context(grpc_context) + def __aiter__(self): return self @@ -57,7 +150,7 @@ async def __anext__(self): Used to iterate over the proxy to the grpc_response as the http response can't be iterate over """ next_item = await self.grpc_response.__anext__() - return GRPCInternalProxyResponse(next_item) + return GRPCInternalProxyResponse(next_item, self.grpc_context) def __iter__(self): return self @@ -67,4 +160,71 @@ def __next__(self): Used to iterate over the proxy to the grpc_response as the http response can't be iterate over """ next_item = self.grpc_response.__next__() - return GRPCInternalProxyResponse(next_item) + return GRPCInternalProxyResponse(next_item, self.grpc_context) + + +@dataclass +class ResponseHeadersProxy(CaseInsensitiveMapping): + """ + Class that allow us to write headers both in grpc metadata and http response to keep compatibility with django system + See https://github.com/django/django/blob/main/django/http/response.py#L32 for inspiration + """ + + grpc_context: ServicerContext | None + http_response: InternalHttpResponse + # INFO - AM - 31/07/2024 - Only used when restoring from cache. Do not use it directly. + metadata: dict | None = None + + def __post_init__(self): + if self.grpc_context is None and self.metadata is None: + raise ValueError("grpc_context or metadata must be set for ResponseHeadersProxy") + if self.grpc_context is not None: + metadata_as_dict = dict(self.grpc_context.trailing_metadata()) + else: + metadata_as_dict = self.metadata + self.http_response.headers = metadata_as_dict + super().__init__(data=metadata_as_dict) + + def set_grpc_context(self, grpc_context: ServicerContext): + """ + When GRPCInternalProxyResponse is created from cache it doesn't have a grpc_context. + This method is used to set it after the object is created and merge their current metadata with the one cached + """ + self.grpc_context = grpc_context + existing_metadata = dict(grpc_context.trailing_metadata()) + + trailing_metadata_dict = {**existing_metadata, **self.http_response.headers} + # INFO - AM - 01/08/2024 - We need to convert all the values to string if not bytes as grpc metadata only accept string and bytes + # We also need to convert all the keys to lower case as grpc metadata expect lower metadata keys + trailing_metadata = [ + (key.lower(), str(value) if not isinstance(value, bytes) else value) + for key, value in trailing_metadata_dict.items() + ] + self.grpc_context.set_trailing_metadata(trailing_metadata) + + def setdefault(self, key, value): + if key not in self: + self[key] = value + + def __setitem__(self, key, value): + if self.grpc_context: + trailing_metadata = self.grpc_context.trailing_metadata() + self.grpc_context.set_trailing_metadata( + trailing_metadata + ((key.lower(), str(value)),) + ) + self.http_response[key] = value + self._store[key.lower()] = (key, value) + + def __delitem__(self, header): + if self.grpc_context: + new_metadata = [ + (k, v) + for k, v in self.grpc_context.trailing_metadata() + if k.lower() != header.lower() + ] + self.grpc_context.set_trailing_metadata(new_metadata) + del self.http_response[header] + super().__delitem__(header) + + def __repr__(self): + return super().__repr__() diff --git a/django_socio_grpc/request_transformer/socio_internal_request.py b/django_socio_grpc/request_transformer/socio_internal_request.py index 4b5f1da6..2d152886 100644 --- a/django_socio_grpc/request_transformer/socio_internal_request.py +++ b/django_socio_grpc/request_transformer/socio_internal_request.py @@ -1,9 +1,13 @@ import json +import logging +import urllib.parse from typing import TYPE_CHECKING -from django.conf import settings -from django.core.exceptions import ImproperlyConfigured -from django.utils.encoding import escape_uri_path, iri_to_uri +from django.http.request import HttpHeaders, HttpRequest +from django.utils.datastructures import ( + CaseInsensitiveMapping, +) +from django.utils.functional import cached_property from google.protobuf.message import Message from django_socio_grpc.protobuf.json_format import message_to_dict @@ -15,19 +19,17 @@ ) -class InternalHttpRequest: +logger = logging.getLogger(__name__) + + +class InternalHttpRequest(HttpRequest): """ Class mocking django.http.HttpRequest to make some django behavior like middleware, filtering, authentication, ... still work. - TODO - AM - Inherit this directly from django.http.HttpRequest ? """ - HEADERS_KEY = "HEADERS" - MAP_HEADERS = { - "AUTHORIZATION": "HTTP_AUTHORIZATION", - "ACCEPT-LANGUAGE": "HTTP_ACCEPT_LANGUAGE", - } - FILTERS_KEY = "FILTERS" - PAGINATION_KEY = "PAGINATION" + HEADERS_KEY = "headers" + FILTERS_KEY = "filters" + PAGINATION_KEY = "pagination" FILTERS_KEY_IN_REQUEST = "_filters" PAGINATION_KEY_IN_REQUEST = "_pagination" @@ -42,7 +44,11 @@ class InternalHttpRequest: } def __init__( - self, grpc_context: "GRPCInternalProxyContext", grpc_request: Message, grpc_action: str + self, + grpc_context: "GRPCInternalProxyContext", + grpc_request: Message, + grpc_action: str, + service_class_name: str, ): """ grpc_context is used to get all the headers and other informations @@ -52,14 +58,14 @@ def __init__( self.user = None self.auth = None + # INFO - AM - 23/07/2024 - We need to pass the service class name to be able to construct the request path to use cache for example + self.service_class_name = service_class_name + self.grpc_request_metadata = self.convert_metadata_to_dict( grpc_context.invocation_metadata() ) - self.headers = self.get_from_metadata(self.HEADERS_KEY) - self.META = { - self.MAP_HEADERS.get(key.upper(), key.upper()): value - for key, value in self.headers.items() - } + meta_from_metadata = self.get_from_metadata(self.HEADERS_KEY) + self.META = RequestMeta(meta_from_metadata.items()) # INFO - A.D.B - 04/01/2021 - Not implemented for now self.POST = {} @@ -71,26 +77,64 @@ def __init__( # Computed params | grpc_request is passed as argument and not class element because we don't want developer to access to the request from the context proxy self.query_params = self.get_query_params(grpc_request) + + # INFO - AM - 23/07/2024 - Allow to use cache system based on filter and pagination metadata or request fields + # See https://github.com/django/django/blob/main/django/http/request.py#L175 + self.META["QUERY_STRING"] = urllib.parse.urlencode(self.query_params, doseq=True) + + # INFO - AM - 25/07/2024 - We need to set the server name to be able to use the cache system. + # In Django if there is no HTTP_X_FORWARDED_HOST or HTTP_HOST, it will use the SERVER_NAME set by the ASGI handler + # As we do not use an ASGI server and grpc does not seem to support an access to the server name we default it to unknown if not specified directly into the metadata + # If requirements change in futur it will be easily possible to use the ip address or a setting to set it + # See https://github.com/django/django/blob/0e94f292cda632153f2b3d9a9037eb0141ae9c2e/django/http/request.py#L113 + # And https://github.com/django/django/blob/0e94f292cda632153f2b3d9a9037eb0141ae9c2e/django/core/handlers/asgi.py#L80 + if "SERVER_NAME" not in self.META: + self.META["SERVER_NAME"] = "unknown" + if "SERVER_PORT" not in self.META: + self.META["SERVER_PORT"] = grpc_settings.GRPC_CHANNEL_PORT + # INFO - AM - 10/02/2021 - Only implementing GET because it's easier as we have metadata here. For post we will have to pass the request and transform it to python dict. # It's possible but it will be slow the all thing so we hava to param this behavior with settings. # So we are waiting for the need to implement it self.GET = self.query_params - # TODO - AM - 26/04/2023 - Find a way to populate this from context or request ? It is really needed ? - self.path = "" - self.path_info = "" + self.path = f"{self.service_class_name}/{grpc_action}" + self.path_info = grpc_action + + self.resolver_match = None + self.content_type = None + self.content_params = None + + @cached_property + def headers(self): + # INFO - AM - 26/07/2024 - As grpc not follow the HTTP headers from env specification, we manually match it + # Maybe this should be restricted to only know HTTP headers ? + add_http_to_metadata = {f"HTTP_{key}": value for key, value in self.META.items()} + return HttpHeaders(add_http_to_metadata) - def get_from_metadata(self, metadata_key): - metadata_key = grpc_settings.MAP_METADATA_KEYS.get(metadata_key, None) + def get_from_metadata(self, metadata_key: str) -> dict[str, str | bytes]: + """ + Allow to: + - Customise the metadata key used for pagination, filter and headers + - override default metadata with some passed in HEADERS metadata key to have custom advanced behavior + """ + metadata_key = grpc_settings.MAP_METADATA_KEYS.get(metadata_key.lower(), None) if not metadata_key: return self.grpc_request_metadata - user_custom_headers = self.grpc_request_metadata.pop(metadata_key, "{}") + user_custom_headers = self.grpc_request_metadata.pop(metadata_key.lower(), "{}") return { **self.grpc_request_metadata, **json.loads(user_custom_headers), } - def get_from_request_struct(self, grpc_request, struct_field_name): + def parse_specific_key_from_metadata(self, metadata_key: str) -> dict[str, str | bytes]: + """ + Allow to Customise the metadata key used for pagination, filter and headers + """ + metadata_key = grpc_settings.MAP_METADATA_KEYS.get(metadata_key.lower(), None) + return json.loads(self.grpc_request_metadata.get(metadata_key.lower(), "{}")) + + def get_from_request_struct(self, grpc_request: Message, struct_field_name: str) -> dict: # INFO - AM - 14/02/2024 - Need to check both if the request have a _filters key and if this optional _filters is filled if hasattr(grpc_request, struct_field_name) and grpc_request.HasField( struct_field_name @@ -99,13 +143,13 @@ def get_from_request_struct(self, grpc_request, struct_field_name): return {} - def convert_metadata_to_dict(self, invocation_metadata): + def convert_metadata_to_dict(self, invocation_metadata: tuple) -> dict[str, str | bytes]: grpc_request_metadata = {} for key, value in dict(invocation_metadata).items(): - grpc_request_metadata[key.upper()] = value + grpc_request_metadata[key.lower()] = value return grpc_request_metadata - def get_query_params(self, grpc_request: Message): + def get_query_params(self, grpc_request: Message) -> dict[str, str]: """ Method that transform specific metadata and/or request fields (depending on FILTER_BEHAVIOR and PAGINATION_BEHAVIOR settings) into a dict as if it was some query params passed in simple HTTP/1 calls @@ -117,7 +161,7 @@ def get_query_params(self, grpc_request: Message): ]: query_params = { **query_params, - **self.get_from_metadata(self.FILTERS_KEY), + **self.parse_specific_key_from_metadata(self.FILTERS_KEY), } if grpc_settings.FILTER_BEHAVIOR in [ @@ -135,7 +179,7 @@ def get_query_params(self, grpc_request: Message): ]: query_params = { **query_params, - **self.get_from_metadata(self.PAGINATION_KEY), + **self.parse_specific_key_from_metadata(self.PAGINATION_KEY), } if grpc_settings.PAGINATION_BEHAVIOR in [ @@ -149,50 +193,37 @@ def get_query_params(self, grpc_request: Message): return query_params - def build_absolute_uri(self): - return "NYI" - - def grpc_action_to_http_method_name(self, grpc_action): - return self.METHOD_MAP.get(grpc_action, None) - - def get_full_path(self, force_append_slash=False): - return self._get_full_path(self.path, force_append_slash) - - def _get_full_path(self, path, force_append_slash): - # RFC 3986 requires query string arguments to be in the ASCII range. - # Rather than crash if this doesn't happen, we encode defensively. - return "{}{}{}".format( - escape_uri_path(path), - "/" if force_append_slash and not path.endswith("/") else "", - ( - ("?" + iri_to_uri(self.META.get("QUERY_STRING", ""))) - if self.META.get("QUERY_STRING", "") - else "" - ), - ) + def grpc_action_to_http_method_name(self, grpc_action: str) -> str: + """ + Allow to match known grpc action to method type. In the futur we may need/want to use a specific decorator that inject the correct mapping into the grpc context and parse it + + Example: + - List -> GET + - Update -> PUT + """ + return self.METHOD_MAP.get(grpc_action, "POST") + + +class RequestMeta(CaseInsensitiveMapping): + """ + Class allowing specific automatic transformation/matching behavior between HTTP headers format expected by django and gRPC metadata format + """ + + HTTP_PREFIX = HttpHeaders.HTTP_PREFIX # = HTTP_ - def _get_scheme(self): + def __getitem__(self, key): """ - Hook for subclasses like WSGIRequest to implement. Return 'http' by - default. + As HTTP headers are prefixed by HTTP_ by proxy server or CGI, Django store and retrieve headers with HTTP_ prefix + As there is no same rule/restriction in gRPC, we need to check if the key is in the dict without HTTP_ prefix if not existing with """ - return "http" - - @property - def scheme(self): - if settings.SECURE_PROXY_SSL_HEADER: - try: - header, secure_value = settings.SECURE_PROXY_SSL_HEADER - except ValueError as e: - raise ImproperlyConfigured( - "The SECURE_PROXY_SSL_HEADER setting must be a tuple containing " - "two values." - ) from e - header_value = self.META.get(header) - if header_value is not None: - header_value, *_ = header_value.split(",", 1) - return "https" if header_value.strip() == secure_value else "http" - return self._get_scheme() - - def is_secure(self): - return self.scheme == "https" + # INFO - AM - 27/07/2024 - First we detect that the key is not existing and that it's a HTTP header + if key.lower() not in self._store and key.startswith(self.HTTP_PREFIX): + key = key[len(self.HTTP_PREFIX) :] + # INFO - AM - 27/07/2024 - Then we check if maybe the key exist but with hypen instead of underscore + if key.lower() not in self._store and key.replace("_", "-").lower() in self._store: + key = key.replace("_", "-") + return super().__getitem__(key=key) + + def __setitem__(self, key, value): + """See: https://github.com/django/django/blob/main/django/utils/datastructures.py#L305""" + self._store[key.lower()] = (key, value) diff --git a/django_socio_grpc/request_transformer/socio_internal_response.py b/django_socio_grpc/request_transformer/socio_internal_response.py index 0cd65d5f..b275cc91 100644 --- a/django_socio_grpc/request_transformer/socio_internal_response.py +++ b/django_socio_grpc/request_transformer/socio_internal_response.py @@ -1,20 +1,7 @@ -from dataclasses import dataclass, field +from django.http import HttpResponse -@dataclass -class InternalHttpResponse: +class InternalHttpResponse(HttpResponse): """ - Class mocking django.http.HttpResponse to make some django behavior like middleware still work. - TODO - AM - Inherit this directly from django.http.HttpResponse ? + Class mocking django.http.HttpResponse to make some django behavior like middleware and cache still work. """ - - # INFO - AM - 26/04/2023 - This is used by session middleware - headers: dict[str, str] = field(default_factory=dict) - - # INFO - AM - 26/04/2023 - This is used by local middleware - # TODO - AM - 26/04/2023 - Adapt this code from the grpc_response abort details ? Not needed for now. - status_code: str = "200" - - # INFO - AM - 26/04/2023 - This is used by session middleware - def has_header(self, header_name): - return False diff --git a/django_socio_grpc/services/servicer_proxy.py b/django_socio_grpc/services/servicer_proxy.py index d220ebb8..af2c6161 100644 --- a/django_socio_grpc/services/servicer_proxy.py +++ b/django_socio_grpc/services/servicer_proxy.py @@ -151,7 +151,7 @@ def _get_response(self, request_container: GRPCRequestContainer) -> GRPCResponse try: request_container.service.before_action() response = action(request_container.grpc_request, request_container.context) - socio_response = GRPCInternalProxyResponse(response) + socio_response = GRPCInternalProxyResponse(response, request_container.context) response_container = GRPCResponseContainer(socio_response) return response_container finally: @@ -168,7 +168,7 @@ def wrapped_action(request_container: GRPCRequestContainer): try: await request_container.service.before_action() response = await safe_async_response(wrapped_action, request_container) - socio_response = GRPCInternalProxyResponse(response) + socio_response = GRPCInternalProxyResponse(response, request_container.context) response_container = GRPCResponseContainer(socio_response) return response_container finally: @@ -176,7 +176,9 @@ def wrapped_action(request_container: GRPCRequestContainer): def _get_async_stream_handler(self, action: str) -> Awaitable[Callable]: async def handler(request: Message, context) -> AsyncIterable[Message]: - proxy_context = GRPCInternalProxyContext(context, request, action) + proxy_context = GRPCInternalProxyContext( + context, request, action, self.service_class.__name__ + ) service_instance = self.create_service( request=request, context=proxy_context, action=action ) @@ -199,7 +201,9 @@ async def handler(request: Message, context) -> AsyncIterable[Message]: def _get_async_handler(self, action: str) -> Awaitable[Callable]: async def handler(request: Message, context) -> Awaitable[Message]: - proxy_context = GRPCInternalProxyContext(context, request, action) + proxy_context = GRPCInternalProxyContext( + context, request, action, self.service_class.__name__ + ) service_instance = self.create_service( request=request, context=proxy_context, action=action ) @@ -220,7 +224,9 @@ async def handler(request: Message, context) -> Awaitable[Message]: def _get_handler(self, action: str) -> Callable: def handler(request: Message, context) -> Message: - proxy_context = GRPCInternalProxyContext(context, request, action) + proxy_context = GRPCInternalProxyContext( + context, request, action, self.service_class.__name__ + ) service_instance = self.create_service( request=request, context=proxy_context, action=action ) @@ -241,7 +247,9 @@ def handler(request: Message, context) -> Message: def _get_stream_handler(self, action: str) -> Callable: def handler(request: Message, context) -> AsyncIterable[Message]: - proxy_context = GRPCInternalProxyContext(context, request, action) + proxy_context = GRPCInternalProxyContext( + context, request, action, self.service_class.__name__ + ) service_instance = self.create_service( request=request, context=proxy_context, action=action ) diff --git a/django_socio_grpc/settings.py b/django_socio_grpc/settings.py index 2f47c045..496f1405 100644 --- a/django_socio_grpc/settings.py +++ b/django_socio_grpc/settings.py @@ -84,9 +84,9 @@ class FilterAndPaginationBehaviorOptions(str, Enum): "ROOT_GRPC_FOLDER": "grpc_folder", # Default places where to search headers, pagination and filter data "MAP_METADATA_KEYS": { - "HEADERS": "HEADERS", - "PAGINATION": "PAGINATION", - "FILTERS": "FILTERS", + "headers": "headers", + "pagination": "pagination", + "filters": "filters", }, # [DEPRECATED]. See https://django-socio-grpc.readthedocs.io/en/latest/how-to/add-extra-context-to-logging.html. Get extra data from service when using log middleware or processing exception in django-socio-grpc "LOG_EXTRA_CONTEXT_FUNCTION": "django_socio_grpc.log.default_get_log_extra_context", @@ -127,6 +127,8 @@ class FilterAndPaginationBehaviorOptions(str, Enum): "DEFAULT_MESSAGE_NAME_CONSTRUCTOR", ] +MERGE_DEFAULTS = ["MAP_METADATA_KEYS"] + def perform_import(val, setting_name): """ @@ -199,6 +201,10 @@ def __getattr__(self, attr): if attr in self.import_strings: val = perform_import(val, attr) + # Merge default values for some settings + if attr in MERGE_DEFAULTS: + val = {**self.defaults[attr], **val} + # Cache the result self._cached_attrs.add(attr) setattr(self, attr, val) diff --git a/django_socio_grpc/signals.py b/django_socio_grpc/signals.py new file mode 100644 index 00000000..6d04325d --- /dev/null +++ b/django_socio_grpc/signals.py @@ -0,0 +1,4 @@ +from django.dispatch import Signal + +# INFO - AM - 22/08/2024 - grpc_action_register is a signal send for each grpc action when the grpc action is registered. Each grpc action need to be registered to generate proto. It allow us to make action as registration or cache deleter signals as this features need the name of the service +grpc_action_register = Signal() diff --git a/django_socio_grpc/tests/fakeapp/grpc/fakeapp.proto b/django_socio_grpc/tests/fakeapp/grpc/fakeapp.proto index 3e3cacfb..fba5ff97 100644 --- a/django_socio_grpc/tests/fakeapp/grpc/fakeapp.proto +++ b/django_socio_grpc/tests/fakeapp/grpc/fakeapp.proto @@ -110,6 +110,34 @@ service UnitTestModelController { rpc Update(UnitTestModelRequest) returns (UnitTestModelResponse) {} } +service UnitTestModelWithCacheController { + rpc Create(UnitTestModelWithCacheRequest) returns (UnitTestModelWithCacheResponse) {} + rpc Destroy(UnitTestModelWithCacheDestroyRequest) returns (google.protobuf.Empty) {} + rpc List(google.protobuf.Empty) returns (UnitTestModelWithCacheListResponse) {} + rpc ListWithAutoCacheCleanOnSaveAndDelete(google.protobuf.Empty) returns (UnitTestModelWithCacheListResponse) {} + rpc ListWithAutoCacheCleanOnSaveAndDeleteRedis(google.protobuf.Empty) returns (UnitTestModelWithCacheListResponse) {} + rpc ListWithPossibilityMaxAge(google.protobuf.Empty) returns (UnitTestModelWithCacheListResponse) {} + rpc ListWithStructFilter(UnitTestModelWithCacheListWithStructFilterRequest) returns (UnitTestModelWithCacheListResponse) {} + rpc PartialUpdate(UnitTestModelWithCachePartialUpdateRequest) returns (UnitTestModelWithCacheResponse) {} + rpc Retrieve(UnitTestModelWithCacheRetrieveRequest) returns (UnitTestModelWithCacheResponse) {} + rpc Stream(UnitTestModelWithCacheStreamRequest) returns (stream UnitTestModelWithCacheResponse) {} + rpc Update(UnitTestModelWithCacheRequest) returns (UnitTestModelWithCacheResponse) {} +} + +service UnitTestModelWithCacheInheritController { + rpc Create(UnitTestModelWithCacheRequest) returns (UnitTestModelWithCacheResponse) {} + rpc Destroy(UnitTestModelWithCacheDestroyRequest) returns (google.protobuf.Empty) {} + rpc List(google.protobuf.Empty) returns (UnitTestModelWithCacheListResponse) {} + rpc ListWithAutoCacheCleanOnSaveAndDelete(google.protobuf.Empty) returns (UnitTestModelWithCacheListResponse) {} + rpc ListWithAutoCacheCleanOnSaveAndDeleteRedis(google.protobuf.Empty) returns (UnitTestModelWithCacheListResponse) {} + rpc ListWithPossibilityMaxAge(google.protobuf.Empty) returns (UnitTestModelWithCacheListResponse) {} + rpc ListWithStructFilter(UnitTestModelWithCacheInheritListWithStructFilterRequest) returns (UnitTestModelWithCacheListResponse) {} + rpc PartialUpdate(UnitTestModelWithCachePartialUpdateRequest) returns (UnitTestModelWithCacheResponse) {} + rpc Retrieve(UnitTestModelWithCacheRetrieveRequest) returns (UnitTestModelWithCacheResponse) {} + rpc Stream(UnitTestModelWithCacheStreamRequest) returns (stream UnitTestModelWithCacheResponse) {} + rpc Update(UnitTestModelWithCacheRequest) returns (UnitTestModelWithCacheResponse) {} +} + service UnitTestModelWithStructFilterController { rpc Create(UnitTestModelWithStructFilterRequest) returns (UnitTestModelWithStructFilterResponse) {} rpc Destroy(UnitTestModelWithStructFilterDestroyRequest) returns (google.protobuf.Empty) {} @@ -633,6 +661,53 @@ message UnitTestModelRetrieveRequest { message UnitTestModelStreamRequest { } +message UnitTestModelWithCacheDestroyRequest { + int32 id = 1; +} + +message UnitTestModelWithCacheInheritListWithStructFilterRequest { + optional google.protobuf.Struct _filters = 1; + optional google.protobuf.Struct _pagination = 2; +} + +message UnitTestModelWithCacheListResponse { + repeated UnitTestModelWithCacheResponse results = 1; + int32 count = 2; +} + +message UnitTestModelWithCacheListWithStructFilterRequest { + optional google.protobuf.Struct _filters = 1; + optional google.protobuf.Struct _pagination = 2; +} + +message UnitTestModelWithCachePartialUpdateRequest { + optional int32 id = 1; + string title = 2; + optional string text = 3; + repeated string _partial_update_fields = 4; +} + +message UnitTestModelWithCacheRequest { + optional int32 id = 1; + string title = 2; + optional string text = 3; +} + +message UnitTestModelWithCacheResponse { + optional int32 id = 1; + string title = 2; + optional string text = 3; + int32 model_property = 4; + string verify_custom_header = 5; +} + +message UnitTestModelWithCacheRetrieveRequest { + int32 id = 1; +} + +message UnitTestModelWithCacheStreamRequest { +} + message UnitTestModelWithStructFilterDestroyRequest { int32 id = 1; } diff --git a/django_socio_grpc/tests/fakeapp/grpc/fakeapp_pb2.py b/django_socio_grpc/tests/fakeapp/grpc/fakeapp_pb2.py index 9e0cfc55..432ce8e4 100644 --- a/django_socio_grpc/tests/fakeapp/grpc/fakeapp_pb2.py +++ b/django_socio_grpc/tests/fakeapp/grpc/fakeapp_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: django_socio_grpc/tests/fakeapp/grpc/fakeapp.proto -# Protobuf Python Version: 4.25.1 +# Protobuf Python Version: 5.26.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -16,13 +16,13 @@ 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\"_\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\"2\n!BasicTestNoMetaSerializerResponse\x12\r\n\x05value\x18\x01 \x01(\t\"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\"\xa2\x01\n0CustomRetrieveResponseSpecialFieldsModelResponse\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\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.StructB\x07\n\x05_uuid\"(\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\"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\"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\"!\n\rNoMetaRequest\x12\x10\n\x08my_field\x18\x01 \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\"\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\r\n\x05title\x18\x02 \x01(\t\x12\x11\n\x04text\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x1e\n\x16_partial_update_fields\x18\x04 \x03(\tB\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\"r\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\x12\x16\n\x0emodel_property\x18\x04 \x01(\x05\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\r\n\x05title\x18\x02 \x01(\t\x12\x11\n\x04text\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x1e\n\x16_partial_update_fields\x18\x04 \x03(\tB\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\"\x82\x01\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\x12\x16\n\x0emodel_property\x18\x04 \x01(\x05\x42\x05\n\x03_idB\x07\n\x05_text\":\n,UnitTestModelWithStructFilterRetrieveRequest\x12\n\n\x02id\x18\x01 \x01(\x05\",\n*UnitTestModelWithStructFilterStreamRequest2\xbc\n\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\x12p\n\x14TestNoMetaSerializer\x12 .myproject.fakeapp.NoMetaRequest\x1a\x34.myproject.fakeapp.BasicTestNoMetaSerializerResponse\"\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\x84\x03\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\x12\x83\x01\n\x17StreamToStreamReadWrite\x12\x30.myproject.fakeapp.StreamInStreamToStreamRequest\x1a\x30.myproject.fakeapp.StreamInStreamToStreamRequest\"\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\"2\n!BasicTestNoMetaSerializerResponse\x12\r\n\x05value\x18\x01 \x01(\t\"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\"\xa2\x01\n0CustomRetrieveResponseSpecialFieldsModelResponse\x12\x11\n\x04uuid\x18\x01 \x01(\tH\x00\x88\x01\x01\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.StructB\x07\n\x05_uuid\"(\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\"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\"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\"!\n\rNoMetaRequest\x12\x10\n\x08my_field\x18\x01 \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\"\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\r\n\x05title\x18\x02 \x01(\t\x12\x11\n\x04text\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x1e\n\x16_partial_update_fields\x18\x04 \x03(\tB\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\"r\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\x12\x16\n\x0emodel_property\x18\x04 \x01(\x05\x42\x05\n\x03_idB\x07\n\x05_text\"*\n\x1cUnitTestModelRetrieveRequest\x12\n\n\x02id\x18\x01 \x01(\x05\"\x1c\n\x1aUnitTestModelStreamRequest\"2\n$UnitTestModelWithCacheDestroyRequest\x12\n\n\x02id\x18\x01 \x01(\x05\"\xba\x01\n8UnitTestModelWithCacheInheritListWithStructFilterRequest\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\"w\n\"UnitTestModelWithCacheListResponse\x12\x42\n\x07results\x18\x01 \x03(\x0b\x32\x31.myproject.fakeapp.UnitTestModelWithCacheResponse\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\"\xb3\x01\n1UnitTestModelWithCacheListWithStructFilterRequest\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\"\x8f\x01\n*UnitTestModelWithCachePartialUpdateRequest\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\x12\x1e\n\x16_partial_update_fields\x18\x04 \x03(\tB\x05\n\x03_idB\x07\n\x05_text\"b\n\x1dUnitTestModelWithCacheRequest\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\"\x99\x01\n\x1eUnitTestModelWithCacheResponse\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\x12\x16\n\x0emodel_property\x18\x04 \x01(\x05\x12\x1c\n\x14verify_custom_header\x18\x05 \x01(\tB\x05\n\x03_idB\x07\n\x05_text\"3\n%UnitTestModelWithCacheRetrieveRequest\x12\n\n\x02id\x18\x01 \x01(\x05\"%\n#UnitTestModelWithCacheStreamRequest\"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\r\n\x05title\x18\x02 \x01(\t\x12\x11\n\x04text\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x1e\n\x16_partial_update_fields\x18\x04 \x03(\tB\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\"\x82\x01\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\x12\x16\n\x0emodel_property\x18\x04 \x01(\x05\x42\x05\n\x03_idB\x07\n\x05_text\":\n,UnitTestModelWithStructFilterRetrieveRequest\x12\n\n\x02id\x18\x01 \x01(\x05\",\n*UnitTestModelWithStructFilterStreamRequest2\xbc\n\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\x12p\n\x14TestNoMetaSerializer\x12 .myproject.fakeapp.NoMetaRequest\x1a\x34.myproject.fakeapp.BasicTestNoMetaSerializerResponse\"\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\x84\x03\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\x12\x83\x01\n\x17StreamToStreamReadWrite\x12\x30.myproject.fakeapp.StreamInStreamToStreamRequest\x1a\x30.myproject.fakeapp.StreamInStreamToStreamRequest\"\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\xb4\n\n UnitTestModelWithCacheController\x12o\n\x06\x43reate\x12\x30.myproject.fakeapp.UnitTestModelWithCacheRequest\x1a\x31.myproject.fakeapp.UnitTestModelWithCacheResponse\"\x00\x12\\\n\x07\x44\x65stroy\x12\x37.myproject.fakeapp.UnitTestModelWithCacheDestroyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12W\n\x04List\x12\x16.google.protobuf.Empty\x1a\x35.myproject.fakeapp.UnitTestModelWithCacheListResponse\"\x00\x12x\n%ListWithAutoCacheCleanOnSaveAndDelete\x12\x16.google.protobuf.Empty\x1a\x35.myproject.fakeapp.UnitTestModelWithCacheListResponse\"\x00\x12}\n*ListWithAutoCacheCleanOnSaveAndDeleteRedis\x12\x16.google.protobuf.Empty\x1a\x35.myproject.fakeapp.UnitTestModelWithCacheListResponse\"\x00\x12l\n\x19ListWithPossibilityMaxAge\x12\x16.google.protobuf.Empty\x1a\x35.myproject.fakeapp.UnitTestModelWithCacheListResponse\"\x00\x12\x95\x01\n\x14ListWithStructFilter\x12\x44.myproject.fakeapp.UnitTestModelWithCacheListWithStructFilterRequest\x1a\x35.myproject.fakeapp.UnitTestModelWithCacheListResponse\"\x00\x12\x83\x01\n\rPartialUpdate\x12=.myproject.fakeapp.UnitTestModelWithCachePartialUpdateRequest\x1a\x31.myproject.fakeapp.UnitTestModelWithCacheResponse\"\x00\x12y\n\x08Retrieve\x12\x38.myproject.fakeapp.UnitTestModelWithCacheRetrieveRequest\x1a\x31.myproject.fakeapp.UnitTestModelWithCacheResponse\"\x00\x12w\n\x06Stream\x12\x36.myproject.fakeapp.UnitTestModelWithCacheStreamRequest\x1a\x31.myproject.fakeapp.UnitTestModelWithCacheResponse\"\x00\x30\x01\x12o\n\x06Update\x12\x30.myproject.fakeapp.UnitTestModelWithCacheRequest\x1a\x31.myproject.fakeapp.UnitTestModelWithCacheResponse\"\x00\x32\xc2\n\n\'UnitTestModelWithCacheInheritController\x12o\n\x06\x43reate\x12\x30.myproject.fakeapp.UnitTestModelWithCacheRequest\x1a\x31.myproject.fakeapp.UnitTestModelWithCacheResponse\"\x00\x12\\\n\x07\x44\x65stroy\x12\x37.myproject.fakeapp.UnitTestModelWithCacheDestroyRequest\x1a\x16.google.protobuf.Empty\"\x00\x12W\n\x04List\x12\x16.google.protobuf.Empty\x1a\x35.myproject.fakeapp.UnitTestModelWithCacheListResponse\"\x00\x12x\n%ListWithAutoCacheCleanOnSaveAndDelete\x12\x16.google.protobuf.Empty\x1a\x35.myproject.fakeapp.UnitTestModelWithCacheListResponse\"\x00\x12}\n*ListWithAutoCacheCleanOnSaveAndDeleteRedis\x12\x16.google.protobuf.Empty\x1a\x35.myproject.fakeapp.UnitTestModelWithCacheListResponse\"\x00\x12l\n\x19ListWithPossibilityMaxAge\x12\x16.google.protobuf.Empty\x1a\x35.myproject.fakeapp.UnitTestModelWithCacheListResponse\"\x00\x12\x9c\x01\n\x14ListWithStructFilter\x12K.myproject.fakeapp.UnitTestModelWithCacheInheritListWithStructFilterRequest\x1a\x35.myproject.fakeapp.UnitTestModelWithCacheListResponse\"\x00\x12\x83\x01\n\rPartialUpdate\x12=.myproject.fakeapp.UnitTestModelWithCachePartialUpdateRequest\x1a\x31.myproject.fakeapp.UnitTestModelWithCacheResponse\"\x00\x12y\n\x08Retrieve\x12\x38.myproject.fakeapp.UnitTestModelWithCacheRetrieveRequest\x1a\x31.myproject.fakeapp.UnitTestModelWithCacheResponse\"\x00\x12w\n\x06Stream\x12\x36.myproject.fakeapp.UnitTestModelWithCacheStreamRequest\x1a\x31.myproject.fakeapp.UnitTestModelWithCacheResponse\"\x00\x30\x01\x12o\n\x06Update\x12\x30.myproject.fakeapp.UnitTestModelWithCacheRequest\x1a\x31.myproject.fakeapp.UnitTestModelWithCacheResponse\"\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) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'django_socio_grpc.tests.fakeapp.grpc.fakeapp_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None _globals['_BASEPROTOEXAMPLELISTRESPONSE']._serialized_start=132 _globals['_BASEPROTOEXAMPLELISTRESPONSE']._serialized_end=239 _globals['_BASEPROTOEXAMPLEREQUEST']._serialized_start=241 @@ -197,48 +197,70 @@ _globals['_UNITTESTMODELRETRIEVEREQUEST']._serialized_end=11832 _globals['_UNITTESTMODELSTREAMREQUEST']._serialized_start=11834 _globals['_UNITTESTMODELSTREAMREQUEST']._serialized_end=11862 - _globals['_UNITTESTMODELWITHSTRUCTFILTERDESTROYREQUEST']._serialized_start=11864 - _globals['_UNITTESTMODELWITHSTRUCTFILTERDESTROYREQUEST']._serialized_end=11921 - _globals['_UNITTESTMODELWITHSTRUCTFILTEREMPTYWITHFILTERREQUEST']._serialized_start=11924 - _globals['_UNITTESTMODELWITHSTRUCTFILTEREMPTYWITHFILTERREQUEST']._serialized_end=12105 - _globals['_UNITTESTMODELWITHSTRUCTFILTERLISTREQUEST']._serialized_start=12108 - _globals['_UNITTESTMODELWITHSTRUCTFILTERLISTREQUEST']._serialized_end=12278 - _globals['_UNITTESTMODELWITHSTRUCTFILTERLISTRESPONSE']._serialized_start=12281 - _globals['_UNITTESTMODELWITHSTRUCTFILTERLISTRESPONSE']._serialized_end=12414 - _globals['_UNITTESTMODELWITHSTRUCTFILTERPARTIALUPDATEREQUEST']._serialized_start=12417 - _globals['_UNITTESTMODELWITHSTRUCTFILTERPARTIALUPDATEREQUEST']._serialized_end=12567 - _globals['_UNITTESTMODELWITHSTRUCTFILTERREQUEST']._serialized_start=12569 - _globals['_UNITTESTMODELWITHSTRUCTFILTERREQUEST']._serialized_end=12674 - _globals['_UNITTESTMODELWITHSTRUCTFILTERRESPONSE']._serialized_start=12677 - _globals['_UNITTESTMODELWITHSTRUCTFILTERRESPONSE']._serialized_end=12807 - _globals['_UNITTESTMODELWITHSTRUCTFILTERRETRIEVEREQUEST']._serialized_start=12809 - _globals['_UNITTESTMODELWITHSTRUCTFILTERRETRIEVEREQUEST']._serialized_end=12867 - _globals['_UNITTESTMODELWITHSTRUCTFILTERSTREAMREQUEST']._serialized_start=12869 - _globals['_UNITTESTMODELWITHSTRUCTFILTERSTREAMREQUEST']._serialized_end=12913 - _globals['_BASICCONTROLLER']._serialized_start=12916 - _globals['_BASICCONTROLLER']._serialized_end=14256 - _globals['_DEFAULTVALUECONTROLLER']._serialized_start=14259 - _globals['_DEFAULTVALUECONTROLLER']._serialized_end=14868 - _globals['_EXCEPTIONCONTROLLER']._serialized_start=14871 - _globals['_EXCEPTIONCONTROLLER']._serialized_end=15208 - _globals['_FOREIGNMODELCONTROLLER']._serialized_start=15211 - _globals['_FOREIGNMODELCONTROLLER']._serialized_end=15466 - _globals['_IMPORTSTRUCTEVENINARRAYMODELCONTROLLER']._serialized_start=15469 - _globals['_IMPORTSTRUCTEVENINARRAYMODELCONTROLLER']._serialized_end=15634 - _globals['_RECURSIVETESTMODELCONTROLLER']._serialized_start=15637 - _globals['_RECURSIVETESTMODELCONTROLLER']._serialized_end=16318 - _globals['_RELATEDFIELDMODELCONTROLLER']._serialized_start=16321 - _globals['_RELATEDFIELDMODELCONTROLLER']._serialized_end=16990 - _globals['_SIMPLERELATEDFIELDMODELCONTROLLER']._serialized_start=16993 - _globals['_SIMPLERELATEDFIELDMODELCONTROLLER']._serialized_end=17735 - _globals['_SPECIALFIELDSMODELCONTROLLER']._serialized_start=17738 - _globals['_SPECIALFIELDSMODELCONTROLLER']._serialized_end=18442 - _globals['_STREAMINCONTROLLER']._serialized_start=18445 - _globals['_STREAMINCONTROLLER']._serialized_end=18833 - _globals['_SYNCUNITTESTMODELCONTROLLER']._serialized_start=18836 - _globals['_SYNCUNITTESTMODELCONTROLLER']._serialized_end=19705 - _globals['_UNITTESTMODELCONTROLLER']._serialized_start=19708 - _globals['_UNITTESTMODELCONTROLLER']._serialized_end=20569 - _globals['_UNITTESTMODELWITHSTRUCTFILTERCONTROLLER']._serialized_start=20572 - _globals['_UNITTESTMODELWITHSTRUCTFILTERCONTROLLER']._serialized_end=21641 + _globals['_UNITTESTMODELWITHCACHEDESTROYREQUEST']._serialized_start=11864 + _globals['_UNITTESTMODELWITHCACHEDESTROYREQUEST']._serialized_end=11914 + _globals['_UNITTESTMODELWITHCACHEINHERITLISTWITHSTRUCTFILTERREQUEST']._serialized_start=11917 + _globals['_UNITTESTMODELWITHCACHEINHERITLISTWITHSTRUCTFILTERREQUEST']._serialized_end=12103 + _globals['_UNITTESTMODELWITHCACHELISTRESPONSE']._serialized_start=12105 + _globals['_UNITTESTMODELWITHCACHELISTRESPONSE']._serialized_end=12224 + _globals['_UNITTESTMODELWITHCACHELISTWITHSTRUCTFILTERREQUEST']._serialized_start=12227 + _globals['_UNITTESTMODELWITHCACHELISTWITHSTRUCTFILTERREQUEST']._serialized_end=12406 + _globals['_UNITTESTMODELWITHCACHEPARTIALUPDATEREQUEST']._serialized_start=12409 + _globals['_UNITTESTMODELWITHCACHEPARTIALUPDATEREQUEST']._serialized_end=12552 + _globals['_UNITTESTMODELWITHCACHEREQUEST']._serialized_start=12554 + _globals['_UNITTESTMODELWITHCACHEREQUEST']._serialized_end=12652 + _globals['_UNITTESTMODELWITHCACHERESPONSE']._serialized_start=12655 + _globals['_UNITTESTMODELWITHCACHERESPONSE']._serialized_end=12808 + _globals['_UNITTESTMODELWITHCACHERETRIEVEREQUEST']._serialized_start=12810 + _globals['_UNITTESTMODELWITHCACHERETRIEVEREQUEST']._serialized_end=12861 + _globals['_UNITTESTMODELWITHCACHESTREAMREQUEST']._serialized_start=12863 + _globals['_UNITTESTMODELWITHCACHESTREAMREQUEST']._serialized_end=12900 + _globals['_UNITTESTMODELWITHSTRUCTFILTERDESTROYREQUEST']._serialized_start=12902 + _globals['_UNITTESTMODELWITHSTRUCTFILTERDESTROYREQUEST']._serialized_end=12959 + _globals['_UNITTESTMODELWITHSTRUCTFILTEREMPTYWITHFILTERREQUEST']._serialized_start=12962 + _globals['_UNITTESTMODELWITHSTRUCTFILTEREMPTYWITHFILTERREQUEST']._serialized_end=13143 + _globals['_UNITTESTMODELWITHSTRUCTFILTERLISTREQUEST']._serialized_start=13146 + _globals['_UNITTESTMODELWITHSTRUCTFILTERLISTREQUEST']._serialized_end=13316 + _globals['_UNITTESTMODELWITHSTRUCTFILTERLISTRESPONSE']._serialized_start=13319 + _globals['_UNITTESTMODELWITHSTRUCTFILTERLISTRESPONSE']._serialized_end=13452 + _globals['_UNITTESTMODELWITHSTRUCTFILTERPARTIALUPDATEREQUEST']._serialized_start=13455 + _globals['_UNITTESTMODELWITHSTRUCTFILTERPARTIALUPDATEREQUEST']._serialized_end=13605 + _globals['_UNITTESTMODELWITHSTRUCTFILTERREQUEST']._serialized_start=13607 + _globals['_UNITTESTMODELWITHSTRUCTFILTERREQUEST']._serialized_end=13712 + _globals['_UNITTESTMODELWITHSTRUCTFILTERRESPONSE']._serialized_start=13715 + _globals['_UNITTESTMODELWITHSTRUCTFILTERRESPONSE']._serialized_end=13845 + _globals['_UNITTESTMODELWITHSTRUCTFILTERRETRIEVEREQUEST']._serialized_start=13847 + _globals['_UNITTESTMODELWITHSTRUCTFILTERRETRIEVEREQUEST']._serialized_end=13905 + _globals['_UNITTESTMODELWITHSTRUCTFILTERSTREAMREQUEST']._serialized_start=13907 + _globals['_UNITTESTMODELWITHSTRUCTFILTERSTREAMREQUEST']._serialized_end=13951 + _globals['_BASICCONTROLLER']._serialized_start=13954 + _globals['_BASICCONTROLLER']._serialized_end=15294 + _globals['_DEFAULTVALUECONTROLLER']._serialized_start=15297 + _globals['_DEFAULTVALUECONTROLLER']._serialized_end=15906 + _globals['_EXCEPTIONCONTROLLER']._serialized_start=15909 + _globals['_EXCEPTIONCONTROLLER']._serialized_end=16246 + _globals['_FOREIGNMODELCONTROLLER']._serialized_start=16249 + _globals['_FOREIGNMODELCONTROLLER']._serialized_end=16504 + _globals['_IMPORTSTRUCTEVENINARRAYMODELCONTROLLER']._serialized_start=16507 + _globals['_IMPORTSTRUCTEVENINARRAYMODELCONTROLLER']._serialized_end=16672 + _globals['_RECURSIVETESTMODELCONTROLLER']._serialized_start=16675 + _globals['_RECURSIVETESTMODELCONTROLLER']._serialized_end=17356 + _globals['_RELATEDFIELDMODELCONTROLLER']._serialized_start=17359 + _globals['_RELATEDFIELDMODELCONTROLLER']._serialized_end=18028 + _globals['_SIMPLERELATEDFIELDMODELCONTROLLER']._serialized_start=18031 + _globals['_SIMPLERELATEDFIELDMODELCONTROLLER']._serialized_end=18773 + _globals['_SPECIALFIELDSMODELCONTROLLER']._serialized_start=18776 + _globals['_SPECIALFIELDSMODELCONTROLLER']._serialized_end=19480 + _globals['_STREAMINCONTROLLER']._serialized_start=19483 + _globals['_STREAMINCONTROLLER']._serialized_end=19871 + _globals['_SYNCUNITTESTMODELCONTROLLER']._serialized_start=19874 + _globals['_SYNCUNITTESTMODELCONTROLLER']._serialized_end=20743 + _globals['_UNITTESTMODELCONTROLLER']._serialized_start=20746 + _globals['_UNITTESTMODELCONTROLLER']._serialized_end=21607 + _globals['_UNITTESTMODELWITHCACHECONTROLLER']._serialized_start=21610 + _globals['_UNITTESTMODELWITHCACHECONTROLLER']._serialized_end=22942 + _globals['_UNITTESTMODELWITHCACHEINHERITCONTROLLER']._serialized_start=22945 + _globals['_UNITTESTMODELWITHCACHEINHERITCONTROLLER']._serialized_end=24291 + _globals['_UNITTESTMODELWITHSTRUCTFILTERCONTROLLER']._serialized_start=24294 + _globals['_UNITTESTMODELWITHSTRUCTFILTERCONTROLLER']._serialized_end=25363 # @@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 09a32ad1..4e003488 100644 --- a/django_socio_grpc/tests/fakeapp/grpc/fakeapp_pb2_grpc.py +++ b/django_socio_grpc/tests/fakeapp/grpc/fakeapp_pb2_grpc.py @@ -1,10 +1,35 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc +import warnings from django_socio_grpc.tests.fakeapp.grpc import fakeapp_pb2 as django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2 from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +GRPC_GENERATED_VERSION = '1.65.2' +GRPC_VERSION = grpc.__version__ +EXPECTED_ERROR_RELEASE = '1.66.0' +SCHEDULED_RELEASE_DATE = 'August 6, 2024' +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + warnings.warn( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in django_socio_grpc/tests/fakeapp/grpc/fakeapp_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + + f' This warning will become an error in {EXPECTED_ERROR_RELEASE},' + + f' scheduled for release on {SCHEDULED_RELEASE_DATE}.', + RuntimeWarning + ) + class BasicControllerStub(object): """Missing associated documentation comment in .proto file.""" @@ -19,67 +44,67 @@ def __init__(self, channel): '/myproject.fakeapp.BasicController/BasicList', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicProtoListChildListRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicProtoListChildListResponse.FromString, - ) + _registered_method=True) self.Create = channel.unary_unary( '/myproject.fakeapp.BasicController/Create', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicServiceRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicServiceResponse.FromString, - ) + _registered_method=True) self.FetchDataForUser = channel.unary_unary( '/myproject.fakeapp.BasicController/FetchDataForUser', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicFetchDataForUserRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicServiceResponse.FromString, - ) + _registered_method=True) self.FetchTranslatedKey = channel.unary_unary( '/myproject.fakeapp.BasicController/FetchTranslatedKey', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicFetchTranslatedKeyResponse.FromString, - ) + _registered_method=True) self.GetMultiple = channel.unary_unary( '/myproject.fakeapp.BasicController/GetMultiple', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicServiceListResponse.FromString, - ) + _registered_method=True) self.ListIds = channel.unary_unary( '/myproject.fakeapp.BasicController/ListIds', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicListIdsResponse.FromString, - ) + _registered_method=True) self.ListName = channel.unary_unary( '/myproject.fakeapp.BasicController/ListName', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicListNameResponse.FromString, - ) + _registered_method=True) self.MixParam = channel.unary_unary( '/myproject.fakeapp.BasicController/MixParam', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.CustomMixParamForListRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicMixParamListResponse.FromString, - ) + _registered_method=True) self.MixParamWithSerializer = channel.unary_unary( '/myproject.fakeapp.BasicController/MixParamWithSerializer', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicParamWithSerializerListRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicMixParamWithSerializerListResponse.FromString, - ) + _registered_method=True) self.MyMethod = channel.unary_unary( '/myproject.fakeapp.BasicController/MyMethod', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.CustomNameForRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.CustomNameForResponse.FromString, - ) + _registered_method=True) self.TestBaseProtoSerializer = channel.unary_unary( '/myproject.fakeapp.BasicController/TestBaseProtoSerializer', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BaseProtoExampleRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BaseProtoExampleListResponse.FromString, - ) + _registered_method=True) self.TestEmptyMethod = channel.unary_unary( '/myproject.fakeapp.BasicController/TestEmptyMethod', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) + _registered_method=True) self.TestNoMetaSerializer = channel.unary_unary( '/myproject.fakeapp.BasicController/TestNoMetaSerializer', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.NoMetaRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicTestNoMetaSerializerResponse.FromString, - ) + _registered_method=True) class BasicControllerServicer(object): @@ -235,6 +260,7 @@ def add_BasicControllerServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'myproject.fakeapp.BasicController', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('myproject.fakeapp.BasicController', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -252,11 +278,21 @@ def BasicList(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.BasicController/BasicList', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.BasicController/BasicList', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicProtoListChildListRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicProtoListChildListResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Create(request, @@ -269,11 +305,21 @@ def Create(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.BasicController/Create', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.BasicController/Create', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicServiceRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicServiceResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def FetchDataForUser(request, @@ -286,11 +332,21 @@ def FetchDataForUser(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.BasicController/FetchDataForUser', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.BasicController/FetchDataForUser', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicFetchDataForUserRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicServiceResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def FetchTranslatedKey(request, @@ -303,11 +359,21 @@ def FetchTranslatedKey(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.BasicController/FetchTranslatedKey', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.BasicController/FetchTranslatedKey', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicFetchTranslatedKeyResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def GetMultiple(request, @@ -320,11 +386,21 @@ def GetMultiple(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.BasicController/GetMultiple', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.BasicController/GetMultiple', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicServiceListResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def ListIds(request, @@ -337,11 +413,21 @@ def ListIds(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.BasicController/ListIds', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.BasicController/ListIds', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicListIdsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def ListName(request, @@ -354,11 +440,21 @@ def ListName(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.BasicController/ListName', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.BasicController/ListName', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicListNameResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def MixParam(request, @@ -371,11 +467,21 @@ def MixParam(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.BasicController/MixParam', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.BasicController/MixParam', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.CustomMixParamForListRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicMixParamListResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def MixParamWithSerializer(request, @@ -388,11 +494,21 @@ def MixParamWithSerializer(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.BasicController/MixParamWithSerializer', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.BasicController/MixParamWithSerializer', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicParamWithSerializerListRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicMixParamWithSerializerListResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def MyMethod(request, @@ -405,11 +521,21 @@ def MyMethod(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.BasicController/MyMethod', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.BasicController/MyMethod', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.CustomNameForRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.CustomNameForResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def TestBaseProtoSerializer(request, @@ -422,11 +548,21 @@ def TestBaseProtoSerializer(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.BasicController/TestBaseProtoSerializer', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.BasicController/TestBaseProtoSerializer', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BaseProtoExampleRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BaseProtoExampleListResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def TestEmptyMethod(request, @@ -439,11 +575,21 @@ def TestEmptyMethod(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.BasicController/TestEmptyMethod', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.BasicController/TestEmptyMethod', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def TestNoMetaSerializer(request, @@ -456,11 +602,21 @@ def TestNoMetaSerializer(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.BasicController/TestNoMetaSerializer', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.BasicController/TestNoMetaSerializer', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.NoMetaRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.BasicTestNoMetaSerializerResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) class DefaultValueControllerStub(object): @@ -476,32 +632,32 @@ def __init__(self, channel): '/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, - ) + _registered_method=True) 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, - ) + _registered_method=True) 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, - ) + _registered_method=True) 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, - ) + _registered_method=True) 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, - ) + _registered_method=True) 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, - ) + _registered_method=True) class DefaultValueControllerServicer(object): @@ -580,6 +736,7 @@ def add_DefaultValueControllerServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'myproject.fakeapp.DefaultValueController', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('myproject.fakeapp.DefaultValueController', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -597,11 +754,21 @@ def Create(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.DefaultValueController/Create', + 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) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Destroy(request, @@ -614,11 +781,21 @@ def Destroy(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.DefaultValueController/Destroy', + 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) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def List(request, @@ -631,11 +808,21 @@ def List(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.DefaultValueController/List', + 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) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def PartialUpdate(request, @@ -648,11 +835,21 @@ def PartialUpdate(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.DefaultValueController/PartialUpdate', + 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) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Retrieve(request, @@ -665,11 +862,21 @@ def Retrieve(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.DefaultValueController/Retrieve', + 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) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Update(request, @@ -682,11 +889,21 @@ def Update(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.DefaultValueController/Update', + 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) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) class ExceptionControllerStub(object): @@ -702,22 +919,22 @@ def __init__(self, channel): '/myproject.fakeapp.ExceptionController/APIException', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) + _registered_method=True) self.GRPCException = channel.unary_unary( '/myproject.fakeapp.ExceptionController/GRPCException', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) + _registered_method=True) self.StreamRaiseException = channel.unary_stream( '/myproject.fakeapp.ExceptionController/StreamRaiseException', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.ExceptionStreamRaiseExceptionResponse.FromString, - ) + _registered_method=True) self.UnaryRaiseException = channel.unary_unary( '/myproject.fakeapp.ExceptionController/UnaryRaiseException', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) + _registered_method=True) class ExceptionControllerServicer(object): @@ -774,6 +991,7 @@ def add_ExceptionControllerServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'myproject.fakeapp.ExceptionController', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('myproject.fakeapp.ExceptionController', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -791,11 +1009,21 @@ def APIException(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.ExceptionController/APIException', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.ExceptionController/APIException', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def GRPCException(request, @@ -808,11 +1036,21 @@ def GRPCException(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.ExceptionController/GRPCException', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.ExceptionController/GRPCException', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def StreamRaiseException(request, @@ -825,11 +1063,21 @@ def StreamRaiseException(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_stream(request, target, '/myproject.fakeapp.ExceptionController/StreamRaiseException', + return grpc.experimental.unary_stream( + request, + target, + '/myproject.fakeapp.ExceptionController/StreamRaiseException', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.ExceptionStreamRaiseExceptionResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def UnaryRaiseException(request, @@ -842,11 +1090,21 @@ def UnaryRaiseException(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.ExceptionController/UnaryRaiseException', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.ExceptionController/UnaryRaiseException', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) class ForeignModelControllerStub(object): @@ -862,12 +1120,12 @@ def __init__(self, channel): '/myproject.fakeapp.ForeignModelController/List', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.ForeignModelListRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.ForeignModelListResponse.FromString, - ) + _registered_method=True) self.Retrieve = channel.unary_unary( '/myproject.fakeapp.ForeignModelController/Retrieve', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.ForeignModelRetrieveCustomRetrieveRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.ForeignModelRetrieveCustomResponse.FromString, - ) + _registered_method=True) class ForeignModelControllerServicer(object): @@ -902,6 +1160,7 @@ def add_ForeignModelControllerServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'myproject.fakeapp.ForeignModelController', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('myproject.fakeapp.ForeignModelController', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -919,11 +1178,21 @@ def List(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.ForeignModelController/List', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.ForeignModelController/List', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.ForeignModelListRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.ForeignModelListResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Retrieve(request, @@ -936,11 +1205,21 @@ def Retrieve(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.ForeignModelController/Retrieve', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.ForeignModelController/Retrieve', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.ForeignModelRetrieveCustomRetrieveRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.ForeignModelRetrieveCustomResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) class ImportStructEvenInArrayModelControllerStub(object): @@ -956,7 +1235,7 @@ def __init__(self, channel): '/myproject.fakeapp.ImportStructEvenInArrayModelController/Create', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.ImportStructEvenInArrayModelRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.ImportStructEvenInArrayModelResponse.FromString, - ) + _registered_method=True) class ImportStructEvenInArrayModelControllerServicer(object): @@ -980,6 +1259,7 @@ def add_ImportStructEvenInArrayModelControllerServicer_to_server(servicer, serve generic_handler = grpc.method_handlers_generic_handler( 'myproject.fakeapp.ImportStructEvenInArrayModelController', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('myproject.fakeapp.ImportStructEvenInArrayModelController', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -997,11 +1277,21 @@ def Create(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.ImportStructEvenInArrayModelController/Create', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.ImportStructEvenInArrayModelController/Create', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.ImportStructEvenInArrayModelRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.ImportStructEvenInArrayModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) class RecursiveTestModelControllerStub(object): @@ -1017,32 +1307,32 @@ def __init__(self, channel): '/myproject.fakeapp.RecursiveTestModelController/Create', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelResponse.FromString, - ) + _registered_method=True) self.Destroy = channel.unary_unary( '/myproject.fakeapp.RecursiveTestModelController/Destroy', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelDestroyRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) + _registered_method=True) self.List = channel.unary_unary( '/myproject.fakeapp.RecursiveTestModelController/List', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelListRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelListResponse.FromString, - ) + _registered_method=True) self.PartialUpdate = channel.unary_unary( '/myproject.fakeapp.RecursiveTestModelController/PartialUpdate', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelPartialUpdateRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelResponse.FromString, - ) + _registered_method=True) self.Retrieve = channel.unary_unary( '/myproject.fakeapp.RecursiveTestModelController/Retrieve', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelRetrieveRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelResponse.FromString, - ) + _registered_method=True) self.Update = channel.unary_unary( '/myproject.fakeapp.RecursiveTestModelController/Update', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelResponse.FromString, - ) + _registered_method=True) class RecursiveTestModelControllerServicer(object): @@ -1121,6 +1411,7 @@ def add_RecursiveTestModelControllerServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'myproject.fakeapp.RecursiveTestModelController', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('myproject.fakeapp.RecursiveTestModelController', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -1138,11 +1429,21 @@ def Create(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.RecursiveTestModelController/Create', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.RecursiveTestModelController/Create', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Destroy(request, @@ -1155,11 +1456,21 @@ def Destroy(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.RecursiveTestModelController/Destroy', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.RecursiveTestModelController/Destroy', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelDestroyRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def List(request, @@ -1172,11 +1483,21 @@ def List(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.RecursiveTestModelController/List', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.RecursiveTestModelController/List', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelListRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelListResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def PartialUpdate(request, @@ -1189,11 +1510,21 @@ def PartialUpdate(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.RecursiveTestModelController/PartialUpdate', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.RecursiveTestModelController/PartialUpdate', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelPartialUpdateRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Retrieve(request, @@ -1206,11 +1537,21 @@ def Retrieve(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.RecursiveTestModelController/Retrieve', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.RecursiveTestModelController/Retrieve', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelRetrieveRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Update(request, @@ -1223,11 +1564,21 @@ def Update(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.RecursiveTestModelController/Update', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.RecursiveTestModelController/Update', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RecursiveTestModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) class RelatedFieldModelControllerStub(object): @@ -1243,32 +1594,32 @@ def __init__(self, channel): '/myproject.fakeapp.RelatedFieldModelController/Create', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelResponse.FromString, - ) + _registered_method=True) self.Destroy = channel.unary_unary( '/myproject.fakeapp.RelatedFieldModelController/Destroy', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelDestroyRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) + _registered_method=True) self.List = channel.unary_unary( '/myproject.fakeapp.RelatedFieldModelController/List', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelListRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelListResponse.FromString, - ) + _registered_method=True) self.PartialUpdate = channel.unary_unary( '/myproject.fakeapp.RelatedFieldModelController/PartialUpdate', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelPartialUpdateRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelResponse.FromString, - ) + _registered_method=True) self.Retrieve = channel.unary_unary( '/myproject.fakeapp.RelatedFieldModelController/Retrieve', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelRetrieveRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelResponse.FromString, - ) + _registered_method=True) self.Update = channel.unary_unary( '/myproject.fakeapp.RelatedFieldModelController/Update', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelResponse.FromString, - ) + _registered_method=True) class RelatedFieldModelControllerServicer(object): @@ -1347,6 +1698,7 @@ def add_RelatedFieldModelControllerServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'myproject.fakeapp.RelatedFieldModelController', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('myproject.fakeapp.RelatedFieldModelController', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -1364,11 +1716,21 @@ def Create(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.RelatedFieldModelController/Create', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.RelatedFieldModelController/Create', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Destroy(request, @@ -1381,11 +1743,21 @@ def Destroy(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.RelatedFieldModelController/Destroy', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.RelatedFieldModelController/Destroy', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelDestroyRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def List(request, @@ -1398,11 +1770,21 @@ def List(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.RelatedFieldModelController/List', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.RelatedFieldModelController/List', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelListRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelListResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def PartialUpdate(request, @@ -1415,11 +1797,21 @@ def PartialUpdate(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.RelatedFieldModelController/PartialUpdate', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.RelatedFieldModelController/PartialUpdate', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelPartialUpdateRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Retrieve(request, @@ -1432,11 +1824,21 @@ def Retrieve(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.RelatedFieldModelController/Retrieve', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.RelatedFieldModelController/Retrieve', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelRetrieveRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Update(request, @@ -1449,11 +1851,21 @@ def Update(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.RelatedFieldModelController/Update', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.RelatedFieldModelController/Update', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.RelatedFieldModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) class SimpleRelatedFieldModelControllerStub(object): @@ -1469,32 +1881,32 @@ def __init__(self, channel): '/myproject.fakeapp.SimpleRelatedFieldModelController/Create', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelResponse.FromString, - ) + _registered_method=True) self.Destroy = channel.unary_unary( '/myproject.fakeapp.SimpleRelatedFieldModelController/Destroy', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelDestroyRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) + _registered_method=True) self.List = channel.unary_unary( '/myproject.fakeapp.SimpleRelatedFieldModelController/List', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelListRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelListResponse.FromString, - ) + _registered_method=True) self.PartialUpdate = channel.unary_unary( '/myproject.fakeapp.SimpleRelatedFieldModelController/PartialUpdate', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelPartialUpdateRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelResponse.FromString, - ) + _registered_method=True) self.Retrieve = channel.unary_unary( '/myproject.fakeapp.SimpleRelatedFieldModelController/Retrieve', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelRetrieveRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelResponse.FromString, - ) + _registered_method=True) self.Update = channel.unary_unary( '/myproject.fakeapp.SimpleRelatedFieldModelController/Update', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelResponse.FromString, - ) + _registered_method=True) class SimpleRelatedFieldModelControllerServicer(object): @@ -1573,6 +1985,7 @@ def add_SimpleRelatedFieldModelControllerServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'myproject.fakeapp.SimpleRelatedFieldModelController', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('myproject.fakeapp.SimpleRelatedFieldModelController', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -1590,11 +2003,21 @@ def Create(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SimpleRelatedFieldModelController/Create', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SimpleRelatedFieldModelController/Create', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Destroy(request, @@ -1607,11 +2030,21 @@ def Destroy(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SimpleRelatedFieldModelController/Destroy', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SimpleRelatedFieldModelController/Destroy', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelDestroyRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def List(request, @@ -1624,11 +2057,21 @@ def List(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SimpleRelatedFieldModelController/List', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SimpleRelatedFieldModelController/List', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelListRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelListResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def PartialUpdate(request, @@ -1641,11 +2084,21 @@ def PartialUpdate(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SimpleRelatedFieldModelController/PartialUpdate', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SimpleRelatedFieldModelController/PartialUpdate', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelPartialUpdateRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Retrieve(request, @@ -1658,11 +2111,21 @@ def Retrieve(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SimpleRelatedFieldModelController/Retrieve', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SimpleRelatedFieldModelController/Retrieve', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelRetrieveRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Update(request, @@ -1675,11 +2138,21 @@ def Update(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SimpleRelatedFieldModelController/Update', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SimpleRelatedFieldModelController/Update', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SimpleRelatedFieldModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) class SpecialFieldsModelControllerStub(object): @@ -1695,32 +2168,32 @@ def __init__(self, channel): '/myproject.fakeapp.SpecialFieldsModelController/Create', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelResponse.FromString, - ) + _registered_method=True) self.Destroy = channel.unary_unary( '/myproject.fakeapp.SpecialFieldsModelController/Destroy', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelDestroyRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) + _registered_method=True) self.List = channel.unary_unary( '/myproject.fakeapp.SpecialFieldsModelController/List', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelListRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelListResponse.FromString, - ) + _registered_method=True) self.PartialUpdate = channel.unary_unary( '/myproject.fakeapp.SpecialFieldsModelController/PartialUpdate', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelPartialUpdateRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelResponse.FromString, - ) + _registered_method=True) self.Retrieve = channel.unary_unary( '/myproject.fakeapp.SpecialFieldsModelController/Retrieve', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelRetrieveRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.CustomRetrieveResponseSpecialFieldsModelResponse.FromString, - ) + _registered_method=True) self.Update = channel.unary_unary( '/myproject.fakeapp.SpecialFieldsModelController/Update', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelResponse.FromString, - ) + _registered_method=True) class SpecialFieldsModelControllerServicer(object): @@ -1799,6 +2272,7 @@ def add_SpecialFieldsModelControllerServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'myproject.fakeapp.SpecialFieldsModelController', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('myproject.fakeapp.SpecialFieldsModelController', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -1816,11 +2290,21 @@ def Create(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SpecialFieldsModelController/Create', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SpecialFieldsModelController/Create', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Destroy(request, @@ -1833,11 +2317,21 @@ def Destroy(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SpecialFieldsModelController/Destroy', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SpecialFieldsModelController/Destroy', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelDestroyRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def List(request, @@ -1850,11 +2344,21 @@ def List(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SpecialFieldsModelController/List', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SpecialFieldsModelController/List', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelListRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelListResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def PartialUpdate(request, @@ -1867,11 +2371,21 @@ def PartialUpdate(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SpecialFieldsModelController/PartialUpdate', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SpecialFieldsModelController/PartialUpdate', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelPartialUpdateRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Retrieve(request, @@ -1884,11 +2398,21 @@ def Retrieve(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SpecialFieldsModelController/Retrieve', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SpecialFieldsModelController/Retrieve', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelRetrieveRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.CustomRetrieveResponseSpecialFieldsModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Update(request, @@ -1901,11 +2425,21 @@ def Update(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SpecialFieldsModelController/Update', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SpecialFieldsModelController/Update', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SpecialFieldsModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) class StreamInControllerStub(object): @@ -1921,17 +2455,17 @@ def __init__(self, channel): '/myproject.fakeapp.StreamInController/StreamIn', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.StreamInStreamInRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.StreamInStreamInListResponse.FromString, - ) + _registered_method=True) self.StreamToStream = channel.stream_stream( '/myproject.fakeapp.StreamInController/StreamToStream', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.StreamInStreamToStreamRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.StreamInStreamToStreamResponse.FromString, - ) + _registered_method=True) self.StreamToStreamReadWrite = channel.stream_stream( '/myproject.fakeapp.StreamInController/StreamToStreamReadWrite', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.StreamInStreamToStreamRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.StreamInStreamToStreamRequest.FromString, - ) + _registered_method=True) class StreamInControllerServicer(object): @@ -1977,6 +2511,7 @@ def add_StreamInControllerServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'myproject.fakeapp.StreamInController', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('myproject.fakeapp.StreamInController', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -1994,11 +2529,21 @@ def StreamIn(request_iterator, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.stream_unary(request_iterator, target, '/myproject.fakeapp.StreamInController/StreamIn', + return grpc.experimental.stream_unary( + request_iterator, + target, + '/myproject.fakeapp.StreamInController/StreamIn', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.StreamInStreamInRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.StreamInStreamInListResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def StreamToStream(request_iterator, @@ -2011,11 +2556,21 @@ def StreamToStream(request_iterator, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.stream_stream(request_iterator, target, '/myproject.fakeapp.StreamInController/StreamToStream', + return grpc.experimental.stream_stream( + request_iterator, + target, + '/myproject.fakeapp.StreamInController/StreamToStream', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.StreamInStreamToStreamRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.StreamInStreamToStreamResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def StreamToStreamReadWrite(request_iterator, @@ -2028,11 +2583,21 @@ def StreamToStreamReadWrite(request_iterator, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.stream_stream(request_iterator, target, '/myproject.fakeapp.StreamInController/StreamToStreamReadWrite', + return grpc.experimental.stream_stream( + request_iterator, + target, + '/myproject.fakeapp.StreamInController/StreamToStreamReadWrite', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.StreamInStreamToStreamRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.StreamInStreamToStreamRequest.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) class SyncUnitTestModelControllerStub(object): @@ -2048,42 +2613,42 @@ def __init__(self, channel): '/myproject.fakeapp.SyncUnitTestModelController/Create', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - ) + _registered_method=True) self.Destroy = channel.unary_unary( '/myproject.fakeapp.SyncUnitTestModelController/Destroy', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelDestroyRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) + _registered_method=True) self.List = channel.unary_unary( '/myproject.fakeapp.SyncUnitTestModelController/List', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelListRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelListResponse.FromString, - ) + _registered_method=True) self.ListWithExtraArgs = channel.unary_unary( '/myproject.fakeapp.SyncUnitTestModelController/ListWithExtraArgs', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SyncUnitTestModelListWithExtraArgsRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelListExtraArgsResponse.FromString, - ) + _registered_method=True) self.PartialUpdate = channel.unary_unary( '/myproject.fakeapp.SyncUnitTestModelController/PartialUpdate', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelPartialUpdateRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - ) + _registered_method=True) self.Retrieve = channel.unary_unary( '/myproject.fakeapp.SyncUnitTestModelController/Retrieve', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelRetrieveRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - ) + _registered_method=True) self.Stream = channel.unary_stream( '/myproject.fakeapp.SyncUnitTestModelController/Stream', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelStreamRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - ) + _registered_method=True) self.Update = channel.unary_unary( '/myproject.fakeapp.SyncUnitTestModelController/Update', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - ) + _registered_method=True) class SyncUnitTestModelControllerServicer(object): @@ -2184,6 +2749,7 @@ def add_SyncUnitTestModelControllerServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'myproject.fakeapp.SyncUnitTestModelController', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('myproject.fakeapp.SyncUnitTestModelController', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -2201,11 +2767,21 @@ def Create(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SyncUnitTestModelController/Create', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SyncUnitTestModelController/Create', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Destroy(request, @@ -2218,11 +2794,21 @@ def Destroy(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SyncUnitTestModelController/Destroy', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SyncUnitTestModelController/Destroy', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelDestroyRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def List(request, @@ -2235,11 +2821,21 @@ def List(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SyncUnitTestModelController/List', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SyncUnitTestModelController/List', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelListRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelListResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def ListWithExtraArgs(request, @@ -2252,11 +2848,21 @@ def ListWithExtraArgs(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SyncUnitTestModelController/ListWithExtraArgs', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SyncUnitTestModelController/ListWithExtraArgs', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.SyncUnitTestModelListWithExtraArgsRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelListExtraArgsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def PartialUpdate(request, @@ -2269,11 +2875,21 @@ def PartialUpdate(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SyncUnitTestModelController/PartialUpdate', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SyncUnitTestModelController/PartialUpdate', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelPartialUpdateRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Retrieve(request, @@ -2286,11 +2902,21 @@ def Retrieve(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SyncUnitTestModelController/Retrieve', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SyncUnitTestModelController/Retrieve', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelRetrieveRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Stream(request, @@ -2303,11 +2929,21 @@ def Stream(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_stream(request, target, '/myproject.fakeapp.SyncUnitTestModelController/Stream', + return grpc.experimental.unary_stream( + request, + target, + '/myproject.fakeapp.SyncUnitTestModelController/Stream', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelStreamRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Update(request, @@ -2320,11 +2956,21 @@ def Update(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.SyncUnitTestModelController/Update', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.SyncUnitTestModelController/Update', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) class UnitTestModelControllerStub(object): @@ -2340,42 +2986,42 @@ def __init__(self, channel): '/myproject.fakeapp.UnitTestModelController/Create', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - ) + _registered_method=True) self.Destroy = channel.unary_unary( '/myproject.fakeapp.UnitTestModelController/Destroy', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelDestroyRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) + _registered_method=True) self.List = channel.unary_unary( '/myproject.fakeapp.UnitTestModelController/List', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelListRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelListResponse.FromString, - ) + _registered_method=True) self.ListWithExtraArgs = channel.unary_unary( '/myproject.fakeapp.UnitTestModelController/ListWithExtraArgs', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelListWithExtraArgsRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelListExtraArgsResponse.FromString, - ) + _registered_method=True) self.PartialUpdate = channel.unary_unary( '/myproject.fakeapp.UnitTestModelController/PartialUpdate', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelPartialUpdateRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - ) + _registered_method=True) self.Retrieve = channel.unary_unary( '/myproject.fakeapp.UnitTestModelController/Retrieve', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelRetrieveRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - ) + _registered_method=True) self.Stream = channel.unary_stream( '/myproject.fakeapp.UnitTestModelController/Stream', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelStreamRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - ) + _registered_method=True) self.Update = channel.unary_unary( '/myproject.fakeapp.UnitTestModelController/Update', request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelRequest.SerializeToString, response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - ) + _registered_method=True) class UnitTestModelControllerServicer(object): @@ -2476,6 +3122,7 @@ def add_UnitTestModelControllerServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'myproject.fakeapp.UnitTestModelController', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('myproject.fakeapp.UnitTestModelController', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -2493,11 +3140,21 @@ def Create(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.UnitTestModelController/Create', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.UnitTestModelController/Create', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Destroy(request, @@ -2510,11 +3167,21 @@ def Destroy(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.UnitTestModelController/Destroy', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.UnitTestModelController/Destroy', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelDestroyRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def List(request, @@ -2527,11 +3194,21 @@ def List(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.UnitTestModelController/List', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.UnitTestModelController/List', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelListRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelListResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def ListWithExtraArgs(request, @@ -2544,11 +3221,21 @@ def ListWithExtraArgs(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.UnitTestModelController/ListWithExtraArgs', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.UnitTestModelController/ListWithExtraArgs', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelListWithExtraArgsRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelListExtraArgsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def PartialUpdate(request, @@ -2561,11 +3248,21 @@ def PartialUpdate(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.UnitTestModelController/PartialUpdate', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.UnitTestModelController/PartialUpdate', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelPartialUpdateRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Retrieve(request, @@ -2578,11 +3275,21 @@ def Retrieve(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.UnitTestModelController/Retrieve', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.UnitTestModelController/Retrieve', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelRetrieveRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Stream(request, @@ -2595,11 +3302,21 @@ def Stream(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_stream(request, target, '/myproject.fakeapp.UnitTestModelController/Stream', + return grpc.experimental.unary_stream( + request, + target, + '/myproject.fakeapp.UnitTestModelController/Stream', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelStreamRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Update(request, @@ -2612,14 +3329,24 @@ def Update(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.UnitTestModelController/Update', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.UnitTestModelController/Update', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - -class UnitTestModelWithStructFilterControllerStub(object): + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + +class UnitTestModelWithCacheControllerStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): @@ -2629,48 +3356,63 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.Create = channel.unary_unary( - '/myproject.fakeapp.UnitTestModelWithStructFilterController/Create', - request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterRequest.SerializeToString, - response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, - ) + '/myproject.fakeapp.UnitTestModelWithCacheController/Create', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + _registered_method=True) self.Destroy = channel.unary_unary( - '/myproject.fakeapp.UnitTestModelWithStructFilterController/Destroy', - request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterDestroyRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.EmptyWithFilter = channel.unary_unary( - '/myproject.fakeapp.UnitTestModelWithStructFilterController/EmptyWithFilter', - request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterEmptyWithFilterRequest.SerializeToString, + '/myproject.fakeapp.UnitTestModelWithCacheController/Destroy', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheDestroyRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) + _registered_method=True) self.List = channel.unary_unary( - '/myproject.fakeapp.UnitTestModelWithStructFilterController/List', - request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterListRequest.SerializeToString, - response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterListResponse.FromString, - ) + '/myproject.fakeapp.UnitTestModelWithCacheController/List', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + _registered_method=True) + self.ListWithAutoCacheCleanOnSaveAndDelete = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithCacheController/ListWithAutoCacheCleanOnSaveAndDelete', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + _registered_method=True) + self.ListWithAutoCacheCleanOnSaveAndDeleteRedis = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithCacheController/ListWithAutoCacheCleanOnSaveAndDeleteRedis', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + _registered_method=True) + self.ListWithPossibilityMaxAge = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithCacheController/ListWithPossibilityMaxAge', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + _registered_method=True) + self.ListWithStructFilter = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithCacheController/ListWithStructFilter', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListWithStructFilterRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + _registered_method=True) self.PartialUpdate = channel.unary_unary( - '/myproject.fakeapp.UnitTestModelWithStructFilterController/PartialUpdate', - request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterPartialUpdateRequest.SerializeToString, - response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, - ) + '/myproject.fakeapp.UnitTestModelWithCacheController/PartialUpdate', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCachePartialUpdateRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + _registered_method=True) self.Retrieve = channel.unary_unary( - '/myproject.fakeapp.UnitTestModelWithStructFilterController/Retrieve', - request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterRetrieveRequest.SerializeToString, - response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, - ) + '/myproject.fakeapp.UnitTestModelWithCacheController/Retrieve', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheRetrieveRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + _registered_method=True) self.Stream = channel.unary_stream( - '/myproject.fakeapp.UnitTestModelWithStructFilterController/Stream', - request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterStreamRequest.SerializeToString, - response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, - ) + '/myproject.fakeapp.UnitTestModelWithCacheController/Stream', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheStreamRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + _registered_method=True) self.Update = channel.unary_unary( - '/myproject.fakeapp.UnitTestModelWithStructFilterController/Update', - request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterRequest.SerializeToString, - response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, - ) + '/myproject.fakeapp.UnitTestModelWithCacheController/Update', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + _registered_method=True) -class UnitTestModelWithStructFilterControllerServicer(object): +class UnitTestModelWithCacheControllerServicer(object): """Missing associated documentation comment in .proto file.""" def Create(self, request, context): @@ -2685,13 +3427,31 @@ def Destroy(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def EmptyWithFilter(self, request, context): + 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 List(self, request, context): + def ListWithAutoCacheCleanOnSaveAndDelete(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 ListWithAutoCacheCleanOnSaveAndDeleteRedis(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 ListWithPossibilityMaxAge(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 ListWithStructFilter(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') @@ -2722,56 +3482,72 @@ def Update(self, request, context): raise NotImplementedError('Method not implemented!') -def add_UnitTestModelWithStructFilterControllerServicer_to_server(servicer, server): +def add_UnitTestModelWithCacheControllerServicer_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.UnitTestModelWithStructFilterRequest.FromString, - response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.SerializeToString, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.SerializeToString, ), 'Destroy': grpc.unary_unary_rpc_method_handler( servicer.Destroy, - request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterDestroyRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'EmptyWithFilter': grpc.unary_unary_rpc_method_handler( - servicer.EmptyWithFilter, - request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterEmptyWithFilterRequest.FromString, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheDestroyRequest.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.UnitTestModelWithStructFilterListRequest.FromString, - response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterListResponse.SerializeToString, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.SerializeToString, + ), + 'ListWithAutoCacheCleanOnSaveAndDelete': grpc.unary_unary_rpc_method_handler( + servicer.ListWithAutoCacheCleanOnSaveAndDelete, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.SerializeToString, + ), + 'ListWithAutoCacheCleanOnSaveAndDeleteRedis': grpc.unary_unary_rpc_method_handler( + servicer.ListWithAutoCacheCleanOnSaveAndDeleteRedis, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.SerializeToString, + ), + 'ListWithPossibilityMaxAge': grpc.unary_unary_rpc_method_handler( + servicer.ListWithPossibilityMaxAge, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.SerializeToString, + ), + 'ListWithStructFilter': grpc.unary_unary_rpc_method_handler( + servicer.ListWithStructFilter, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListWithStructFilterRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.SerializeToString, ), 'PartialUpdate': grpc.unary_unary_rpc_method_handler( servicer.PartialUpdate, - request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterPartialUpdateRequest.FromString, - response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.SerializeToString, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCachePartialUpdateRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.SerializeToString, ), 'Retrieve': grpc.unary_unary_rpc_method_handler( servicer.Retrieve, - request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterRetrieveRequest.FromString, - response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.SerializeToString, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheRetrieveRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.SerializeToString, ), 'Stream': grpc.unary_stream_rpc_method_handler( servicer.Stream, - request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterStreamRequest.FromString, - response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.SerializeToString, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheStreamRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.SerializeToString, ), 'Update': grpc.unary_unary_rpc_method_handler( servicer.Update, - request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterRequest.FromString, - response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.SerializeToString, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( - 'myproject.fakeapp.UnitTestModelWithStructFilterController', rpc_method_handlers) + 'myproject.fakeapp.UnitTestModelWithCacheController', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('myproject.fakeapp.UnitTestModelWithCacheController', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. -class UnitTestModelWithStructFilterController(object): +class UnitTestModelWithCacheController(object): """Missing associated documentation comment in .proto file.""" @staticmethod @@ -2785,11 +3561,21 @@ def Create(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.UnitTestModelWithStructFilterController/Create', - django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterRequest.SerializeToString, - django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.UnitTestModelWithCacheController/Create', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Destroy(request, @@ -2802,14 +3588,24 @@ def Destroy(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.UnitTestModelWithStructFilterController/Destroy', - django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterDestroyRequest.SerializeToString, + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.UnitTestModelWithCacheController/Destroy', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheDestroyRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod - def EmptyWithFilter(request, + def List(request, target, options=(), channel_credentials=None, @@ -2819,14 +3615,24 @@ def EmptyWithFilter(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.UnitTestModelWithStructFilterController/EmptyWithFilter', - django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterEmptyWithFilterRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.UnitTestModelWithCacheController/List', + google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod - def List(request, + def ListWithAutoCacheCleanOnSaveAndDelete(request, target, options=(), channel_credentials=None, @@ -2836,11 +3642,102 @@ def List(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.UnitTestModelWithStructFilterController/List', - django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterListRequest.SerializeToString, - django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterListResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.UnitTestModelWithCacheController/ListWithAutoCacheCleanOnSaveAndDelete', + google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListWithAutoCacheCleanOnSaveAndDeleteRedis(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.UnitTestModelWithCacheController/ListWithAutoCacheCleanOnSaveAndDeleteRedis', + google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListWithPossibilityMaxAge(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.UnitTestModelWithCacheController/ListWithPossibilityMaxAge', + google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListWithStructFilter(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.UnitTestModelWithCacheController/ListWithStructFilter', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListWithStructFilterRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def PartialUpdate(request, @@ -2853,11 +3750,21 @@ def PartialUpdate(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.UnitTestModelWithStructFilterController/PartialUpdate', - django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterPartialUpdateRequest.SerializeToString, - django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.UnitTestModelWithCacheController/PartialUpdate', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCachePartialUpdateRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Retrieve(request, @@ -2870,11 +3777,21 @@ def Retrieve(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.UnitTestModelWithStructFilterController/Retrieve', - django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterRetrieveRequest.SerializeToString, - django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.UnitTestModelWithCacheController/Retrieve', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheRetrieveRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Stream(request, @@ -2887,11 +3804,21 @@ def Stream(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_stream(request, target, '/myproject.fakeapp.UnitTestModelWithStructFilterController/Stream', - django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterStreamRequest.SerializeToString, - django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_stream( + request, + target, + '/myproject.fakeapp.UnitTestModelWithCacheController/Stream', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheStreamRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Update(request, @@ -2904,8 +3831,893 @@ def Update(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/myproject.fakeapp.UnitTestModelWithStructFilterController/Update', + return grpc.experimental.unary_unary( + request, + target, + '/myproject.fakeapp.UnitTestModelWithCacheController/Update', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + +class UnitTestModelWithCacheInheritControllerStub(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.UnitTestModelWithCacheInheritController/Create', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + _registered_method=True) + self.Destroy = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithCacheInheritController/Destroy', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheDestroyRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + self.List = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithCacheInheritController/List', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + _registered_method=True) + self.ListWithAutoCacheCleanOnSaveAndDelete = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithCacheInheritController/ListWithAutoCacheCleanOnSaveAndDelete', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + _registered_method=True) + self.ListWithAutoCacheCleanOnSaveAndDeleteRedis = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithCacheInheritController/ListWithAutoCacheCleanOnSaveAndDeleteRedis', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + _registered_method=True) + self.ListWithPossibilityMaxAge = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithCacheInheritController/ListWithPossibilityMaxAge', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + _registered_method=True) + self.ListWithStructFilter = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithCacheInheritController/ListWithStructFilter', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheInheritListWithStructFilterRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + _registered_method=True) + self.PartialUpdate = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithCacheInheritController/PartialUpdate', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCachePartialUpdateRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + _registered_method=True) + self.Retrieve = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithCacheInheritController/Retrieve', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheRetrieveRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + _registered_method=True) + self.Stream = channel.unary_stream( + '/myproject.fakeapp.UnitTestModelWithCacheInheritController/Stream', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheStreamRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + _registered_method=True) + self.Update = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithCacheInheritController/Update', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + _registered_method=True) + + +class UnitTestModelWithCacheInheritControllerServicer(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 ListWithAutoCacheCleanOnSaveAndDelete(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 ListWithAutoCacheCleanOnSaveAndDeleteRedis(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 ListWithPossibilityMaxAge(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 ListWithStructFilter(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 Stream(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_UnitTestModelWithCacheInheritControllerServicer_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.UnitTestModelWithCacheRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.SerializeToString, + ), + 'Destroy': grpc.unary_unary_rpc_method_handler( + servicer.Destroy, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheDestroyRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'List': grpc.unary_unary_rpc_method_handler( + servicer.List, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.SerializeToString, + ), + 'ListWithAutoCacheCleanOnSaveAndDelete': grpc.unary_unary_rpc_method_handler( + servicer.ListWithAutoCacheCleanOnSaveAndDelete, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.SerializeToString, + ), + 'ListWithAutoCacheCleanOnSaveAndDeleteRedis': grpc.unary_unary_rpc_method_handler( + servicer.ListWithAutoCacheCleanOnSaveAndDeleteRedis, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.SerializeToString, + ), + 'ListWithPossibilityMaxAge': grpc.unary_unary_rpc_method_handler( + servicer.ListWithPossibilityMaxAge, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.SerializeToString, + ), + 'ListWithStructFilter': grpc.unary_unary_rpc_method_handler( + servicer.ListWithStructFilter, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheInheritListWithStructFilterRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.SerializeToString, + ), + 'PartialUpdate': grpc.unary_unary_rpc_method_handler( + servicer.PartialUpdate, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCachePartialUpdateRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.SerializeToString, + ), + 'Retrieve': grpc.unary_unary_rpc_method_handler( + servicer.Retrieve, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheRetrieveRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.SerializeToString, + ), + 'Stream': grpc.unary_stream_rpc_method_handler( + servicer.Stream, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheStreamRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.SerializeToString, + ), + 'Update': grpc.unary_unary_rpc_method_handler( + servicer.Update, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'myproject.fakeapp.UnitTestModelWithCacheInheritController', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('myproject.fakeapp.UnitTestModelWithCacheInheritController', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class UnitTestModelWithCacheInheritController(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.UnitTestModelWithCacheInheritController/Create', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @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.UnitTestModelWithCacheInheritController/Destroy', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheDestroyRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @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.UnitTestModelWithCacheInheritController/List', + google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListWithAutoCacheCleanOnSaveAndDelete(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.UnitTestModelWithCacheInheritController/ListWithAutoCacheCleanOnSaveAndDelete', + google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListWithAutoCacheCleanOnSaveAndDeleteRedis(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.UnitTestModelWithCacheInheritController/ListWithAutoCacheCleanOnSaveAndDeleteRedis', + google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListWithPossibilityMaxAge(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.UnitTestModelWithCacheInheritController/ListWithPossibilityMaxAge', + google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListWithStructFilter(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.UnitTestModelWithCacheInheritController/ListWithStructFilter', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheInheritListWithStructFilterRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheListResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @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.UnitTestModelWithCacheInheritController/PartialUpdate', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCachePartialUpdateRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @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.UnitTestModelWithCacheInheritController/Retrieve', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheRetrieveRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Stream(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_stream( + request, + target, + '/myproject.fakeapp.UnitTestModelWithCacheInheritController/Stream', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheStreamRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @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.UnitTestModelWithCacheInheritController/Update', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithCacheResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + +class UnitTestModelWithStructFilterControllerStub(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.UnitTestModelWithStructFilterController/Create', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, + _registered_method=True) + self.Destroy = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithStructFilterController/Destroy', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterDestroyRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + self.EmptyWithFilter = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithStructFilterController/EmptyWithFilter', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterEmptyWithFilterRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + self.List = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithStructFilterController/List', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterListRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterListResponse.FromString, + _registered_method=True) + self.PartialUpdate = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithStructFilterController/PartialUpdate', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterPartialUpdateRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, + _registered_method=True) + self.Retrieve = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithStructFilterController/Retrieve', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterRetrieveRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, + _registered_method=True) + self.Stream = channel.unary_stream( + '/myproject.fakeapp.UnitTestModelWithStructFilterController/Stream', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterStreamRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, + _registered_method=True) + self.Update = channel.unary_unary( + '/myproject.fakeapp.UnitTestModelWithStructFilterController/Update', + request_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterRequest.SerializeToString, + response_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, + _registered_method=True) + + +class UnitTestModelWithStructFilterControllerServicer(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 EmptyWithFilter(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 Stream(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_UnitTestModelWithStructFilterControllerServicer_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.UnitTestModelWithStructFilterRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.SerializeToString, + ), + 'Destroy': grpc.unary_unary_rpc_method_handler( + servicer.Destroy, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterDestroyRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'EmptyWithFilter': grpc.unary_unary_rpc_method_handler( + servicer.EmptyWithFilter, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterEmptyWithFilterRequest.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.UnitTestModelWithStructFilterListRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterListResponse.SerializeToString, + ), + 'PartialUpdate': grpc.unary_unary_rpc_method_handler( + servicer.PartialUpdate, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterPartialUpdateRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.SerializeToString, + ), + 'Retrieve': grpc.unary_unary_rpc_method_handler( + servicer.Retrieve, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterRetrieveRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.SerializeToString, + ), + 'Stream': grpc.unary_stream_rpc_method_handler( + servicer.Stream, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterStreamRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.SerializeToString, + ), + 'Update': grpc.unary_unary_rpc_method_handler( + servicer.Update, + request_deserializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterRequest.FromString, + response_serializer=django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'myproject.fakeapp.UnitTestModelWithStructFilterController', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('myproject.fakeapp.UnitTestModelWithStructFilterController', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class UnitTestModelWithStructFilterController(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.UnitTestModelWithStructFilterController/Create', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @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.UnitTestModelWithStructFilterController/Destroy', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterDestroyRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def EmptyWithFilter(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.UnitTestModelWithStructFilterController/EmptyWithFilter', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterEmptyWithFilterRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @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.UnitTestModelWithStructFilterController/List', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterListRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterListResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @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.UnitTestModelWithStructFilterController/PartialUpdate', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterPartialUpdateRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @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.UnitTestModelWithStructFilterController/Retrieve', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterRetrieveRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Stream(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_stream( + request, + target, + '/myproject.fakeapp.UnitTestModelWithStructFilterController/Stream', + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterStreamRequest.SerializeToString, + django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @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.UnitTestModelWithStructFilterController/Update', django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterRequest.SerializeToString, django__socio__grpc_dot_tests_dot_fakeapp_dot_grpc_dot_fakeapp__pb2.UnitTestModelWithStructFilterResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/django_socio_grpc/tests/fakeapp/handlers.py b/django_socio_grpc/tests/fakeapp/handlers.py index 35b629c0..f63ba05d 100644 --- a/django_socio_grpc/tests/fakeapp/handlers.py +++ b/django_socio_grpc/tests/fakeapp/handlers.py @@ -14,6 +14,10 @@ from fakeapp.services.stream_in_service import StreamInService from fakeapp.services.sync_unit_test_model_service import SyncUnitTestModelService from fakeapp.services.unit_test_model_service import UnitTestModelService +from fakeapp.services.unit_test_model_with_cache_service import ( + UnitTestModelWithCacheInheritService, + UnitTestModelWithCacheService, +) from django_socio_grpc.services.app_handler_registry import AppHandlerRegistry from django_socio_grpc.tests.fakeapp.services.unit_test_model_with_struct_filter_service import ( @@ -39,6 +43,8 @@ def grpc_handlers(server): app_registry.register(RecursiveTestModelService) app_registry.register(UnitTestModelWithStructFilterService) app_registry.register(DefaultValueService) + app_registry.register(UnitTestModelWithCacheService) + app_registry.register(UnitTestModelWithCacheInheritService) services = ( @@ -53,4 +59,5 @@ def grpc_handlers(server): StreamInService, RecursiveTestModelService, UnitTestModelWithStructFilterService, + UnitTestModelWithCacheService, ) diff --git a/django_socio_grpc/tests/fakeapp/serializers.py b/django_socio_grpc/tests/fakeapp/serializers.py index cbb1d2c9..7d7a3325 100644 --- a/django_socio_grpc/tests/fakeapp/serializers.py +++ b/django_socio_grpc/tests/fakeapp/serializers.py @@ -49,6 +49,20 @@ class Meta: class UnitTestModelWithStructFilterSerializer(UnitTestModelSerializer): ... +# INFO - AM - 14/02/2024 - This serializer exist just to be sure we do not override UnitTestModelSerializer in the proto +class UnitTestModelWithCacheSerializer(UnitTestModelSerializer): + verify_custom_header = serializers.SerializerMethodField() + + def get_verify_custom_header(self, _) -> str: + return self.context["grpc_context"].META.get("CUSTOM_HEADER", "") + + class Meta: + model = UnitTestModel + proto_class = fakeapp_pb2.UnitTestModelWithCacheResponse + proto_class_list = fakeapp_pb2.UnitTestModelWithCacheListResponse + fields = UnitTestModelSerializer.Meta.fields + ["verify_custom_header"] + + class UnitTestModelListExtraArgsSerializer(proto_serializers.ProtoSerializer): count = serializers.IntegerField() query_fetched_datetime = serializers.DateTimeField() diff --git a/django_socio_grpc/tests/fakeapp/services/unit_test_model_with_cache_service.py b/django_socio_grpc/tests/fakeapp/services/unit_test_model_with_cache_service.py new file mode 100644 index 00000000..49079eff --- /dev/null +++ b/django_socio_grpc/tests/fakeapp/services/unit_test_model_with_cache_service.py @@ -0,0 +1,133 @@ +from django.core.cache import caches +from django_filters.rest_framework import DjangoFilterBackend +from fakeapp.models import UnitTestModel +from fakeapp.serializers import UnitTestModelWithCacheSerializer +from rest_framework.pagination import PageNumberPagination + +from django_socio_grpc import generics, mixins +from django_socio_grpc.decorators import ( + cache_endpoint, + cache_endpoint_with_deleter, + grpc_action, + vary_on_metadata, +) +from django_socio_grpc.protobuf.generation_plugin import ( + FilterGenerationPlugin, + ListGenerationPlugin, + PaginationGenerationPlugin, +) + +second_cache = caches["second"] + + +class StandardResultsSetPagination(PageNumberPagination): + page_size = 3 + page_size_query_param = "page_size" + max_page_size = 100 + + +# INFO - AM - 20/02/2024 - This is just for testing the override of FilterGenerationPlugin in proto generation. This filter will not work if FILTER_BEHAVIOR settings not correctly set. +class FilterGenerationPluginForce(FilterGenerationPlugin): + def check_condition(self, *args, **kwargs) -> bool: + return True + + +# INFO - AM - 20/02/2024 - This is just for testing the override of PaginationGenerationPlugin in proto generation. This pagination will not work if PAGINATION_BEHAVIOR settings not correctly set. +class PaginationGenerationPluginForce(PaginationGenerationPlugin): + def check_condition(self, *args, **kwargs) -> bool: + return True + + +class UnitTestModelWithCacheService(generics.AsyncModelService, mixins.AsyncStreamModelMixin): + queryset = UnitTestModel.objects.all().order_by("id") + serializer_class = UnitTestModelWithCacheSerializer + pagination_class = StandardResultsSetPagination + filter_backends = [DjangoFilterBackend] + filterset_fields = ["title", "text"] + + def custom_function_not_called_when_cached(self, *args, **kwargs): + pass + + @grpc_action( + request=[], + response=UnitTestModelWithCacheSerializer, + use_generation_plugins=[ + ListGenerationPlugin(response=True), + ], + ) + @cache_endpoint(300) + @vary_on_metadata("CUSTOM_HEADER") + async def List(self, request, context): + self.custom_function_not_called_when_cached(self) + return await super().List(request, context) + + @grpc_action( + request=[{"name": "id", "type": "int32"}], + response=UnitTestModelWithCacheSerializer, + request_name="UnitTestModelWithCacheRetrieveRequest", + ) + @cache_endpoint(1000, key_prefix="second", cache="second") + async def Retrieve(self, request, context): + return await super().Retrieve(request, context) + + @grpc_action( + request=[], + response=UnitTestModelWithCacheSerializer, + use_generation_plugins=[ + ListGenerationPlugin(response=True), + FilterGenerationPluginForce(), + PaginationGenerationPluginForce(), + ], + ) + @cache_endpoint(300) + async def ListWithStructFilter(self, request, context): + return await super().List(request, context) + + @grpc_action( + request=[], + response=UnitTestModelWithCacheSerializer, + use_generation_plugins=[ + ListGenerationPlugin(response=True), + ], + ) + @cache_endpoint(None) + async def ListWithPossibilityMaxAge(self, request, context): + """ + Test that if timeout default setting max-age=0 disable cache + """ + self.custom_function_not_called_when_cached(self) + return await super().List(request, context) + + @cache_endpoint_with_deleter(300, cache="second") + @grpc_action( + request=[], + response=UnitTestModelWithCacheSerializer, + use_generation_plugins=[ + ListGenerationPlugin(response=True), + ], + ) + async def ListWithAutoCacheCleanOnSaveAndDelete(self, request, context): + """ + Test the cache_endpoint_with_deleter work well + """ + self.custom_function_not_called_when_cached(self) + return await super().List(request, context) + + @cache_endpoint_with_deleter(300, cache="fake_redis") + @grpc_action( + request=[], + response=UnitTestModelWithCacheSerializer, + use_generation_plugins=[ + ListGenerationPlugin(response=True), + ], + ) + async def ListWithAutoCacheCleanOnSaveAndDeleteRedis(self, request, context): + """ + Test the cache_endpoint_with_deleter work well + """ + self.custom_function_not_called_when_cached(self) + return await super().List(request, context) + + +class UnitTestModelWithCacheInheritService(UnitTestModelWithCacheService): + pass diff --git a/django_socio_grpc/tests/grpc_test_utils/fake_grpc.py b/django_socio_grpc/tests/grpc_test_utils/fake_grpc.py index e3cc7487..a4ed9b5b 100644 --- a/django_socio_grpc/tests/grpc_test_utils/fake_grpc.py +++ b/django_socio_grpc/tests/grpc_test_utils/fake_grpc.py @@ -66,7 +66,8 @@ def __init__(self): # The stream_pipe_server, in which server writes responses and reads by the client self.stream_pipe_server = queue.Queue() - self._invocation_metadata = [] + self._invocation_metadata = () + self._trailing_metadata = () self._code = grpc.StatusCode.OK self._details = None @@ -80,6 +81,33 @@ def __next__(self): else: return response + def invocation_metadata(self): + return self._invocation_metadata + + def _check_metadata(self, metadata): + """ + Custom method of _BaseFakeContext to be sure tests match reality because grpc metadata should be a tuple of tuple with first element a lower case string and the second a str or bytes value type + """ + for k, value in metadata: + if not k.islower(): + raise ValueError("Metadata keys must be lower case ", k) + if not isinstance(value, str) and not isinstance(value, bytes): + raise ValueError( + f"Metadata values must be str or bytes . Exception for key {k}.", + value, + ) + + def set_invocation_metadata(self, metadata): + self._check_metadata(metadata) + self._invocation_metadata = tuple(_Metadatum(k, v) for k, v in metadata) + + def trailing_metadata(self): + return self._trailing_metadata + + def set_trailing_metadata(self, metadata): + self._check_metadata(metadata) + self._trailing_metadata = tuple(_Metadatum(k, v) for k, v in metadata) + def set_code(self, code): self._code = code @@ -91,9 +119,6 @@ def abort(self, code, details): self.set_details(details) raise _InactiveRpcError(code=code, details=details) - def invocation_metadata(self): - return self._invocation_metadata - def write(self, data): self._write_server(data) @@ -195,9 +220,10 @@ def fake_handler(request=None, metadata=None): self.context = FakeAsyncContext() if metadata: - self.context._invocation_metadata.extend( - (_Metadatum(k, v) for k, v in metadata) + metadata = self.context.invocation_metadata() + tuple( + _Metadatum(k, v) for k, v in metadata ) + self.context.set_invocation_metadata(metadata) return real_method(request, self.context) @@ -249,34 +275,34 @@ def get_fake_stub(self, grpc_stub_cls): class FakeBaseCall(grpc.aio.Call): - def add_done_callback(*args, **kwargs): + def add_done_callback(self, *args, **kwargs): pass - def cancel(*args, **kwargs): + def cancel(self, *args, **kwargs): pass - def cancelled(*args, **kwargs): + def cancelled(self, *args, **kwargs): pass - def code(*args, **kwargs): + def code(self, *args, **kwargs): pass - def details(*args, **kwargs): + def details(self, *args, **kwargs): pass - def done(*args, **kwargs): + def done(self, *args, **kwargs): pass - def initial_metadata(*args, **kwargs): - pass + def initial_metadata(self, *args, **kwargs): + return self._context._invocation_metadata - def time_remaining(*args, **kwargs): + def time_remaining(self, *args, **kwargs): pass - def trailing_metadata(*args, **kwargs): - pass + def trailing_metadata(self, *args, **kwargs): + return self._context._trailing_metadata - def wait_for_connection(*args, **kwargs): + def wait_for_connection(self, *args, **kwargs): pass @@ -293,7 +319,10 @@ def __init__(self, context=None, call_type=None, real_method=None, metadata=None if metadata: self._metadata = metadata - self._context._invocation_metadata.extend((_Metadatum(k, v) for k, v in metadata)) + metadata = self._context.invocation_metadata() + tuple( + _Metadatum(k, v) for k, v in metadata + ) + self._context.set_invocation_metadata(metadata) def __call__(self, request=None, metadata=None): # INFO - AM - 28/07/2022 - request is not None at first call but then at each read is transformed to None. So we only assign it if not None @@ -301,7 +330,10 @@ def __call__(self, request=None, metadata=None): self._request = request if metadata is not None: self._metadata = metadata - self._context._invocation_metadata.extend((_Metadatum(k, v) for k, v in metadata)) + metadata = self._context.invocation_metadata() + tuple( + _Metadatum(k, v) for k, v in metadata + ) + self._context.set_invocation_metadata(metadata) # INFO - AM - 18/02/2022 - Use FakeFullAioCall for stream testing self.method_awaitable = self._real_method(request=self._request, context=self._context) return self @@ -316,6 +348,9 @@ def write(self, data): def read(self): return async_to_sync(self._context.read)() + def with_call(self, request=None, metadata=None): + return self.__call__(request, metadata), self + # INFO - AM - 10/08/2022 - FakeFullAioCall use async function where FakeFullAioCall use async_to_sync class FakeFullAioCall(FakeBaseCall): @@ -329,7 +364,10 @@ def __init__(self, context=None, call_type=None, real_method=None, metadata=None if metadata: self._metadata = metadata - self._context._invocation_metadata.extend((_Metadatum(k, v) for k, v in metadata)) + metadata = self._context.invocation_metadata() + tuple( + _Metadatum(k, v) for k, v in metadata + ) + self._context.set_invocation_metadata(metadata) def __call__(self, request=None, metadata=None): # INFO - AM - 28/07/2022 - request is not None at first call but then at each read is transformed to None. So we only assign it if not None @@ -337,7 +375,10 @@ def __call__(self, request=None, metadata=None): self._request = request if metadata is not None: self._metadata = metadata - self._context._invocation_metadata.extend((_Metadatum(k, v) for k, v in metadata)) + metadata = self._context.invocation_metadata() + tuple( + _Metadatum(k, v) for k, v in metadata + ) + self._context.set_invocation_metadata(metadata) async def wrapped(*args, **kwargs): method = self._real_method(request=self._request, context=self._context) 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 ba26278f..b29e220f 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 @@ -94,6 +94,20 @@ service UnitTestModelController { rpc Update(UnitTestModel) returns (UnitTestModel) {} } +service UnitTestModelWithCacheController { + rpc Create(UnitTestModelWithCache) returns (UnitTestModelWithCache) {} + rpc Destroy(UnitTestModelWithCacheDestroyRequest) returns (google.protobuf.Empty) {} + rpc List(google.protobuf.Empty) returns (UnitTestModelWithCacheList) {} + rpc ListWithAutoCacheCleanOnSaveAndDelete(google.protobuf.Empty) returns (UnitTestModelWithCacheList) {} + rpc ListWithAutoCacheCleanOnSaveAndDeleteRedis(google.protobuf.Empty) returns (UnitTestModelWithCacheList) {} + rpc ListWithPossibilityMaxAge(google.protobuf.Empty) returns (UnitTestModelWithCacheList) {} + rpc ListWithStructFilter(UnitTestModelWithCacheListWithStructFilter) returns (UnitTestModelWithCacheList) {} + rpc PartialUpdate(UnitTestModelWithCachePartialUpdateRequest) returns (UnitTestModelWithCache) {} + rpc Retrieve(UnitTestModelWithCacheRetrieveRequest) returns (UnitTestModelWithCache) {} + rpc Stream(UnitTestModelWithCacheStreamRequest) returns (stream UnitTestModelWithCache) {} + rpc Update(UnitTestModelWithCache) returns (UnitTestModelWithCache) {} +} + service UnitTestModelWithStructFilterController { rpc Create(UnitTestModelWithStructFilter) returns (UnitTestModelWithStructFilter) {} rpc Destroy(UnitTestModelWithStructFilterDestroyRequest) returns (google.protobuf.Empty) {} @@ -456,6 +470,44 @@ message UnitTestModelRetrieveRequest { message UnitTestModelStreamRequest { } +message UnitTestModelWithCache { + optional int32 id = 1; + string title = 2; + optional string text = 3; + int32 model_property = 4; + string verify_custom_header = 5; +} + +message UnitTestModelWithCacheDestroyRequest { + int32 id = 1; +} + +message UnitTestModelWithCacheList { + repeated UnitTestModelWithCache results = 1; + int32 count = 2; +} + +message UnitTestModelWithCacheListWithStructFilter { + optional google.protobuf.Struct _filters = 1; + optional google.protobuf.Struct _pagination = 2; +} + +message UnitTestModelWithCachePartialUpdateRequest { + optional int32 id = 1; + string title = 2; + optional string text = 3; + int32 model_property = 4; + string verify_custom_header = 5; + repeated string _partial_update_fields = 6; +} + +message UnitTestModelWithCacheRetrieveRequest { + int32 id = 1; +} + +message UnitTestModelWithCacheStreamRequest { +} + message UnitTestModelWithStructFilter { optional int32 id = 1; string title = 2; 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 3e3cacfb..fba5ff97 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 @@ -110,6 +110,34 @@ service UnitTestModelController { rpc Update(UnitTestModelRequest) returns (UnitTestModelResponse) {} } +service UnitTestModelWithCacheController { + rpc Create(UnitTestModelWithCacheRequest) returns (UnitTestModelWithCacheResponse) {} + rpc Destroy(UnitTestModelWithCacheDestroyRequest) returns (google.protobuf.Empty) {} + rpc List(google.protobuf.Empty) returns (UnitTestModelWithCacheListResponse) {} + rpc ListWithAutoCacheCleanOnSaveAndDelete(google.protobuf.Empty) returns (UnitTestModelWithCacheListResponse) {} + rpc ListWithAutoCacheCleanOnSaveAndDeleteRedis(google.protobuf.Empty) returns (UnitTestModelWithCacheListResponse) {} + rpc ListWithPossibilityMaxAge(google.protobuf.Empty) returns (UnitTestModelWithCacheListResponse) {} + rpc ListWithStructFilter(UnitTestModelWithCacheListWithStructFilterRequest) returns (UnitTestModelWithCacheListResponse) {} + rpc PartialUpdate(UnitTestModelWithCachePartialUpdateRequest) returns (UnitTestModelWithCacheResponse) {} + rpc Retrieve(UnitTestModelWithCacheRetrieveRequest) returns (UnitTestModelWithCacheResponse) {} + rpc Stream(UnitTestModelWithCacheStreamRequest) returns (stream UnitTestModelWithCacheResponse) {} + rpc Update(UnitTestModelWithCacheRequest) returns (UnitTestModelWithCacheResponse) {} +} + +service UnitTestModelWithCacheInheritController { + rpc Create(UnitTestModelWithCacheRequest) returns (UnitTestModelWithCacheResponse) {} + rpc Destroy(UnitTestModelWithCacheDestroyRequest) returns (google.protobuf.Empty) {} + rpc List(google.protobuf.Empty) returns (UnitTestModelWithCacheListResponse) {} + rpc ListWithAutoCacheCleanOnSaveAndDelete(google.protobuf.Empty) returns (UnitTestModelWithCacheListResponse) {} + rpc ListWithAutoCacheCleanOnSaveAndDeleteRedis(google.protobuf.Empty) returns (UnitTestModelWithCacheListResponse) {} + rpc ListWithPossibilityMaxAge(google.protobuf.Empty) returns (UnitTestModelWithCacheListResponse) {} + rpc ListWithStructFilter(UnitTestModelWithCacheInheritListWithStructFilterRequest) returns (UnitTestModelWithCacheListResponse) {} + rpc PartialUpdate(UnitTestModelWithCachePartialUpdateRequest) returns (UnitTestModelWithCacheResponse) {} + rpc Retrieve(UnitTestModelWithCacheRetrieveRequest) returns (UnitTestModelWithCacheResponse) {} + rpc Stream(UnitTestModelWithCacheStreamRequest) returns (stream UnitTestModelWithCacheResponse) {} + rpc Update(UnitTestModelWithCacheRequest) returns (UnitTestModelWithCacheResponse) {} +} + service UnitTestModelWithStructFilterController { rpc Create(UnitTestModelWithStructFilterRequest) returns (UnitTestModelWithStructFilterResponse) {} rpc Destroy(UnitTestModelWithStructFilterDestroyRequest) returns (google.protobuf.Empty) {} @@ -633,6 +661,53 @@ message UnitTestModelRetrieveRequest { message UnitTestModelStreamRequest { } +message UnitTestModelWithCacheDestroyRequest { + int32 id = 1; +} + +message UnitTestModelWithCacheInheritListWithStructFilterRequest { + optional google.protobuf.Struct _filters = 1; + optional google.protobuf.Struct _pagination = 2; +} + +message UnitTestModelWithCacheListResponse { + repeated UnitTestModelWithCacheResponse results = 1; + int32 count = 2; +} + +message UnitTestModelWithCacheListWithStructFilterRequest { + optional google.protobuf.Struct _filters = 1; + optional google.protobuf.Struct _pagination = 2; +} + +message UnitTestModelWithCachePartialUpdateRequest { + optional int32 id = 1; + string title = 2; + optional string text = 3; + repeated string _partial_update_fields = 4; +} + +message UnitTestModelWithCacheRequest { + optional int32 id = 1; + string title = 2; + optional string text = 3; +} + +message UnitTestModelWithCacheResponse { + optional int32 id = 1; + string title = 2; + optional string text = 3; + int32 model_property = 4; + string verify_custom_header = 5; +} + +message UnitTestModelWithCacheRetrieveRequest { + int32 id = 1; +} + +message UnitTestModelWithCacheStreamRequest { +} + message UnitTestModelWithStructFilterDestroyRequest { int32 id = 1; } diff --git a/django_socio_grpc/tests/test_authentication.py b/django_socio_grpc/tests/test_authentication.py index 4b07d6f3..249f0bc3 100644 --- a/django_socio_grpc/tests/test_authentication.py +++ b/django_socio_grpc/tests/test_authentication.py @@ -82,13 +82,13 @@ def test_user_and_token_none_if_no_auth_class(self): def test_user_and_token_set(self): DummyService.authentication_classes = [FakeAuthentication] metadata = (("headers", json.dumps({"Authorization": "faketoken"})),) - self.fake_context._invocation_metadata.extend((_Metadatum(k, v) for k, v in metadata)) + self.fake_context._invocation_metadata += tuple(_Metadatum(k, v) for k, v in metadata) self.servicer.DummyMethod(None, self.fake_context) servicer_context = get_servicer_context() self.assertEqual( - servicer_context.service.context.META, {"HTTP_AUTHORIZATION": "faketoken"} + servicer_context.service.context.META["HTTP_AUTHORIZATION"], "faketoken" ) self.assertEqual( servicer_context.service.context.user, {"email": "john.doe@johndoe.com"} diff --git a/django_socio_grpc/tests/test_cache.py b/django_socio_grpc/tests/test_cache.py new file mode 100644 index 00000000..8944d64a --- /dev/null +++ b/django_socio_grpc/tests/test_cache.py @@ -0,0 +1,660 @@ +import json +from datetime import datetime, timezone +from unittest import mock + +import django +import grpc +from django.core.cache import DEFAULT_CACHE_ALIAS, caches +from django.test import TestCase, override_settings +from fakeapp.grpc.fakeapp_pb2 import ( + UnitTestModelWithCacheListResponse, + UnitTestModelWithCacheListWithStructFilterRequest, + UnitTestModelWithCacheResponse, + UnitTestModelWithCacheRetrieveRequest, +) +from fakeapp.grpc.fakeapp_pb2_grpc import ( + UnitTestModelWithCacheControllerStub, + UnitTestModelWithCacheInheritControllerStub, + add_UnitTestModelWithCacheControllerServicer_to_server, + add_UnitTestModelWithCacheInheritControllerServicer_to_server, +) +from fakeapp.models import UnitTestModel +from fakeapp.services.unit_test_model_with_cache_service import ( + UnitTestModelWithCacheInheritService, + UnitTestModelWithCacheService, +) +from freezegun import freeze_time +from google.protobuf import empty_pb2, struct_pb2 + +from django_socio_grpc.request_transformer import ( + GRPCInternalProxyResponse, +) +from django_socio_grpc.settings import FilterAndPaginationBehaviorOptions + +from .grpc_test_utils.fake_grpc import FakeAsyncContext, FakeFullAIOGRPC + + +@override_settings(GRPC_FRAMEWORK={"GRPC_ASYNC": True}) +class TestCacheService(TestCase): + def setUp(self): + for idx in range(10): + title = "z" * (idx + 1) + text = chr(idx + ord("a")) + chr(idx + ord("b")) + chr(idx + ord("c")) + UnitTestModel(title=title, text=text).save() + + self.fake_grpc = FakeFullAIOGRPC( + add_UnitTestModelWithCacheControllerServicer_to_server, + UnitTestModelWithCacheService.as_servicer(), + ) + UnitTestModelWithCacheService.register_actions() + + self.fake_grpc_inherit = FakeFullAIOGRPC( + add_UnitTestModelWithCacheInheritControllerServicer_to_server, + UnitTestModelWithCacheInheritService.as_servicer(), + ) + UnitTestModelWithCacheInheritService.register_actions() + + def tearDown(self): + self.fake_grpc.close() + # INFO - AM - 26/07/2024 - Clear all cache after each test to be sure none conflict + for cache in caches.all(): + cache.clear() + + @mock.patch("django.middleware.cache.get_cache_key") + @mock.patch("django.middleware.cache.learn_cache_key") + async def test_verify_that_response_in_cache( + self, mock_learn_cache_key, mock_get_cache_key + ): + """ + Just verify that the response is in cache with the key returned by learn_cache_key + """ + cache_test_key = "test_cache_key" + mock_learn_cache_key.return_value = cache_test_key + mock_get_cache_key.return_value = None + + self.assertEqual(await UnitTestModel.objects.acount(), 10) + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + response = await grpc_stub.List(request=request) + + self.assertEqual(len(response.results), 3) + + cache = caches[DEFAULT_CACHE_ALIAS] + self.assertEqual(cache.get(cache_test_key).grpc_response, response) + + mock_learn_cache_key.assert_called_with( + mock.ANY, + mock.ANY, + 300, + "", + cache=cache, + ) + mock_get_cache_key.assert_called_with( + mock.ANY, + "", + "GET", + cache=cache, + ) + + @mock.patch("django.middleware.cache.get_cache_key") + async def test_verify_that_if_response_in_cache_it_return_it(self, mock_get_cache_key): + """ + Just verify that is a repsonse already exist in cache with the key returned by get_cache_key it return it + """ + cache_test_key = "test_cache_key" + mock_get_cache_key.return_value = cache_test_key + + results = [ + UnitTestModelWithCacheResponse(title="test_manual_1", text="test_manual_1"), + UnitTestModelWithCacheResponse(title="test_manual_2", text="test_manual_2"), + ] + grpc_response = UnitTestModelWithCacheListResponse(results=results, count=2) + + fake_socio_response = GRPCInternalProxyResponse(grpc_response, FakeAsyncContext()) + + cache = caches[DEFAULT_CACHE_ALIAS] + cache.set( + cache_test_key, + fake_socio_response, + ) + + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + response = await grpc_stub.List(request=request) + + self.assertEqual(len(response.results), 2) + self.assertEqual(response.count, 2) + self.assertEqual(response.results[0].title, "test_manual_1") + + @mock.patch("django.middleware.cache.get_cache_key") + @mock.patch("django.middleware.cache.learn_cache_key") + async def test_cache_decorators_paremeters_correctly_working( + self, mock_learn_cache_key, mock_get_cache_key + ): + """ + Verify that django get_cache_key and learn_cache_key are correctly called with the decorators parameters + """ + cache_test_key = "test_cache_key" + mock_learn_cache_key.return_value = cache_test_key + mock_get_cache_key.return_value = None + + second_cache = caches["second"] + + self.assertEqual(await UnitTestModel.objects.acount(), 10) + first_unit_test_model = await UnitTestModel.objects.afirst() + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = UnitTestModelWithCacheRetrieveRequest(id=first_unit_test_model.id) + await grpc_stub.Retrieve(request=request) + + mock_learn_cache_key.assert_called_with( + mock.ANY, mock.ANY, 1000, "second", cache=second_cache + ) + mock_get_cache_key.assert_called_with( + mock.ANY, + "second", + "GET", + cache=second_cache, + ) + + @override_settings( + GRPC_FRAMEWORK={ + "GRPC_ASYNC": True, + "PAGINATION_BEHAVIOR": FilterAndPaginationBehaviorOptions.REQUEST_STRUCT_STRICT, + } + ) + async def test_when_page_change_in_struct_cache_not_used( + self, + ): + self.assertEqual(await UnitTestModel.objects.acount(), 10) + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + response = await grpc_stub.List(request=request) + + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "z") + + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + pagination_as_dict = {"page": 2} + pagination_as_struct = struct_pb2.Struct() + pagination_as_struct.update(pagination_as_dict) + request = UnitTestModelWithCacheListWithStructFilterRequest( + _pagination=pagination_as_struct + ) + response = await grpc_stub.ListWithStructFilter(request=request) + + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "zzzz") + + async def test_when_page_change_in_metadata_cache_not_used( + self, + ): + self.assertEqual(await UnitTestModel.objects.acount(), 10) + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + response = await grpc_stub.List(request=request) + + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "z") + + pagination_as_dict = {"page": 2} + metadata = (("pagination", json.dumps(pagination_as_dict)),) + + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + response = await grpc_stub.List(request=request, metadata=metadata) + + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "zzzz") + + @override_settings( + GRPC_FRAMEWORK={ + "GRPC_ASYNC": True, + "FILTER_BEHAVIOR": FilterAndPaginationBehaviorOptions.REQUEST_STRUCT_STRICT, + } + ) + async def test_when_filter_change_in_struct_cache_not_used( + self, + ): + self.assertEqual(await UnitTestModel.objects.acount(), 10) + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + response = await grpc_stub.List(request=request) + + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "z") + + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + filter_as_dict = {"title": "zzzzzzz"} + filter_as_struct = struct_pb2.Struct() + filter_as_struct.update(filter_as_dict) + request = UnitTestModelWithCacheListWithStructFilterRequest(_filters=filter_as_struct) + response = await grpc_stub.ListWithStructFilter(request=request) + + self.assertEqual(len(response.results), 1) + self.assertEqual(response.results[0].title, "zzzzzzz") + + async def test_when_filter_change_in_metadata_cache_not_used( + self, + ): + self.assertEqual(await UnitTestModel.objects.acount(), 10) + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + response = await grpc_stub.List(request=request) + + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "z") + + pagination_as_dict = {"title": "zzzzzzz"} + metadata = (("filters", json.dumps(pagination_as_dict)),) + + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + response = await grpc_stub.List(request=request, metadata=metadata) + + self.assertEqual(len(response.results), 1) + self.assertEqual(response.results[0].title, "zzzzzzz") + + async def test_when_headers_vary_route_not_cached( + self, + ): + """ + In this test we verify that by setting different value on the custom_header metadata the cache is not used + This is done by the vary_on_metadata decorator used in the service + """ + self.assertEqual(await UnitTestModel.objects.acount(), 10) + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + + metadata_1 = (("custom_header", "test1"),) + response = await grpc_stub.List(request=request, metadata=metadata_1) + + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "z") + self.assertEqual(response.results[0].verify_custom_header, "test1") + + await UnitTestModel.objects.filter(title="z").aupdate(title="a") + + metadata_2 = (("custom_header", "test2"),) + response = await grpc_stub.List(request=request, metadata=metadata_2) + + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "a") + self.assertEqual(response.results[0].verify_custom_header, "test2") + + async def test_when_headers_vary_but_not_specified_in_decorator_route_is_cached( + self, + ): + """ + In this test we verify that by setting different value on the custom_header metadata the cache is not used + This is done by the vary_on_metadata decorator used in the service + """ + self.assertEqual(await UnitTestModel.objects.acount(), 10) + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + + metadata_1 = (("metdata_not_specified", "test1"),) + response = await grpc_stub.List(request=request, metadata=metadata_1) + + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "z") + + await UnitTestModel.objects.filter(title="z").aupdate(title="a") + + metadata_2 = (("metdata_not_specified", "test2"),) + response = await grpc_stub.List(request=request, metadata=metadata_2) + + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "z") + + @mock.patch( + "fakeapp.services.unit_test_model_with_cache_service.UnitTestModelWithCacheService.custom_function_not_called_when_cached" + ) + async def test_cache_working_really(self, mock_custom_function_not_called_when_cached): + self.assertEqual(await UnitTestModel.objects.acount(), 10) + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + + response = await grpc_stub.List(request=request) + + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "z") + + mock_custom_function_not_called_when_cached.assert_called_once() + + response = await grpc_stub.List(request=request) + + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "z") + + mock_custom_function_not_called_when_cached.assert_called_once() + + @mock.patch( + "fakeapp.services.unit_test_model_with_cache_service.UnitTestModelWithCacheInheritService.custom_function_not_called_when_cached" + ) + async def test_cache_working_really_in_inheritance( + self, mock_custom_function_not_called_when_cached + ): + self.assertEqual(await UnitTestModel.objects.acount(), 10) + grpc_stub = self.fake_grpc_inherit.get_fake_stub( + UnitTestModelWithCacheInheritControllerStub + ) + request = empty_pb2.Empty() + + response = await grpc_stub.List(request=request) + + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "z") + + mock_custom_function_not_called_when_cached.assert_called_once() + + response = await grpc_stub.List(request=request) + + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "z") + + mock_custom_function_not_called_when_cached.assert_called_once() + + async def test_cache_control_and_expires_metadata_correctly_set(self): + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + + list_call = grpc_stub.List + with freeze_time(datetime(2024, 7, 26, 14, 0, 0, tzinfo=timezone.utc)): + await list_call(request=request) + + metadata_to_dict = dict(list_call.trailing_metadata()) + + self.assertEqual(metadata_to_dict["expires"], "Fri, 26 Jul 2024 14:05:00 GMT") + self.assertEqual(metadata_to_dict["cache-control"], "max-age=300") + + async def test_age_metadata_set_when_expires_metadata_set(self): + """ + If a response is returned from cache there is an "age" metadata set explaining how old is the cached response + """ + # INFO - AM - 01/08/2024 - The Age response header is not supported before Django 5.0 + if django.VERSION < (5, 1, 0): + return True + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + + list_call = grpc_stub.List + with freeze_time(datetime(2024, 7, 26, 14, 0, 0, tzinfo=timezone.utc)): + await list_call(request=request) + + metadata_before_cache = dict(list_call.trailing_metadata()) + + self.assertEqual(metadata_before_cache["expires"], "Fri, 26 Jul 2024 14:05:00 GMT") + self.assertEqual(metadata_before_cache["cache-control"], "max-age=300") + self.assertNotIn("age", metadata_before_cache) + + list_call = grpc_stub.List + with freeze_time(datetime(2024, 7, 26, 14, 2, 0, tzinfo=timezone.utc)): + await list_call(request=request) + + metadata_to_dict = dict(list_call.trailing_metadata()) + + self.assertEqual(metadata_to_dict["expires"], "Fri, 26 Jul 2024 14:05:00 GMT") + self.assertEqual(metadata_to_dict["cache-control"], "max-age=300") + self.assertEqual(metadata_to_dict["age"], "120") + + @mock.patch( + "fakeapp.services.unit_test_model_with_cache_service.UnitTestModelWithCacheService.custom_function_not_called_when_cached" + ) + async def test_cache_not_set_when_max_age_0_in_cache_control_in_the_response( + self, mock_custom_function_not_called_when_cached + ): + # INFO - AM - 26/07/2024 - This mock the server action of setting max-age=0 to the response cache control metadata + def set_max_age_to_0(unit_test_model_with_cache_service, *args, **kwargs): + metadata = (("cache-control", "max-age=0"),) + unit_test_model_with_cache_service.context.set_trailing_metadata(metadata) + + mock_custom_function_not_called_when_cached.side_effect = set_max_age_to_0 + + self.assertEqual(await UnitTestModel.objects.acount(), 10) + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + + response = await grpc_stub.ListWithPossibilityMaxAge(request=request) + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "z") + + mock_custom_function_not_called_when_cached.assert_called_once() + + await UnitTestModel.objects.filter(title="z").aupdate(title="a") + + response = await grpc_stub.List(request=request) + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "a") + + self.assertEqual(mock_custom_function_not_called_when_cached.call_count, 2) + + @mock.patch( + "fakeapp.services.unit_test_model_with_cache_service.UnitTestModelWithCacheService.custom_function_not_called_when_cached" + ) + async def test_cache_not_set_when_not_successfull_request( + self, mock_custom_function_not_called_when_cached + ): + # INFO - AM - 26/07/2024 - This mock the server action of raising an exception + def raise_exception(unit_test_model_with_cache_service, *args, **kwargs): + raise Exception("Error") + + mock_custom_function_not_called_when_cached.side_effect = raise_exception + + self.assertEqual(await UnitTestModel.objects.acount(), 10) + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + + with self.assertRaises(grpc.RpcError): + response = await grpc_stub.List(request=request) + + mock_custom_function_not_called_when_cached.side_effect = None + + await UnitTestModel.objects.filter(title="z").aupdate(title="a") + + response = await grpc_stub.List(request=request) + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "a") + + self.assertEqual(mock_custom_function_not_called_when_cached.call_count, 2) + + @mock.patch( + "fakeapp.services.unit_test_model_with_cache_service.UnitTestModelWithCacheService.custom_function_not_called_when_cached" + ) + async def test_cache_not_set_when_private_in_cache_control( + self, mock_custom_function_not_called_when_cached + ): + # INFO - AM - 26/07/2024 - This mock the server action of setting private to the response cache control metadata + def set_cache_control_private(unit_test_model_with_cache_service, *args, **kwargs): + metadata = (("cache-control", "private"),) + unit_test_model_with_cache_service.context.set_trailing_metadata(metadata) + + mock_custom_function_not_called_when_cached.side_effect = set_cache_control_private + + self.assertEqual(await UnitTestModel.objects.acount(), 10) + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + + response = await grpc_stub.List(request=request) + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "z") + + mock_custom_function_not_called_when_cached.assert_called_once() + + await UnitTestModel.objects.filter(title="z").aupdate(title="a") + + response = await grpc_stub.List(request=request) + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "a") + + self.assertEqual(mock_custom_function_not_called_when_cached.call_count, 2) + + async def test_vary_metadata_correctly_set_when_using_decorator(self): + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + + list_call = grpc_stub.List + await list_call(request=request) + + metadata_to_dict = dict(list_call.trailing_metadata()) + + self.assertEqual(metadata_to_dict["vary"], "CUSTOM_HEADER") + + @mock.patch( + "fakeapp.services.unit_test_model_with_cache_service.UnitTestModelWithCacheService.custom_function_not_called_when_cached" + ) + async def test_cache_deleted_when_updating_value_with_cache_deletor( + self, mock_custom_function_not_called_when_cached + ): + self.assertEqual(await UnitTestModel.objects.acount(), 10) + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + + response = await grpc_stub.ListWithAutoCacheCleanOnSaveAndDelete(request=request) + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "z") + + mock_custom_function_not_called_when_cached.assert_called_once() + + test = await UnitTestModel.objects.filter(title="z").afirst() + test.title = "a" + await test.asave() + + response = await grpc_stub.ListWithAutoCacheCleanOnSaveAndDelete(request=request) + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "a") + + self.assertEqual(mock_custom_function_not_called_when_cached.call_count, 2) + + @mock.patch( + "fakeapp.services.unit_test_model_with_cache_service.UnitTestModelWithCacheService.custom_function_not_called_when_cached" + ) + async def test_cache_deleted_whith_delete_pattern_compatible_cache( + self, mock_custom_function_not_called_when_cached + ): + fake_redis_cache = caches["fake_redis"] + fake_redis_cache.delete_pattern.reset_mock() + fake_redis_cache.set.reset_mock() + + self.assertEqual(await UnitTestModel.objects.acount(), 10) + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithCacheControllerStub) + request = empty_pb2.Empty() + + response = await grpc_stub.ListWithAutoCacheCleanOnSaveAndDeleteRedis(request=request) + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "z") + + calls_set = [ + mock.call( + "views.decorators.cache.cache_header.UnitTestModelWithCacheService-ListWithAutoCacheCleanOnSaveAndDeleteRedis.0a70f42054a5c115b2334096f6f22ed1.en-us.UTC", + [], + 300, + ), + mock.call( + "views.decorators.cache.cache_page.UnitTestModelWithCacheService-ListWithAutoCacheCleanOnSaveAndDeleteRedis.GET.0a70f42054a5c115b2334096f6f22ed1.d41d8cd98f00b204e9800998ecf8427e.en-us.UTC", + mock.ANY, + 300, + ), + ] + fake_redis_cache.set.assert_has_calls(calls_set) + + mock_custom_function_not_called_when_cached.assert_called_once() + + fake_redis_cache.delete_pattern.reset_mock() + fake_redis_cache.set.reset_mock() + + test = await UnitTestModel.objects.filter(title="z").afirst() + test.title = "a" + await test.asave() + + calls = [ + mock.call( + "views.decorators.cache.cache_header.UnitTestModelWithCacheService-ListWithAutoCacheCleanOnSaveAndDeleteRedis.*" + ), + mock.call( + "views.decorators.cache.cache_page.UnitTestModelWithCacheService-ListWithAutoCacheCleanOnSaveAndDeleteRedis.*" + ), + ] + + fake_redis_cache.delete_pattern.assert_has_calls(calls) + + @mock.patch( + "fakeapp.services.unit_test_model_with_cache_service.UnitTestModelWithCacheInheritService.custom_function_not_called_when_cached" + ) + async def test_cache_deleted_when_updating_value_with_cache_deletor_inherit( + self, mock_custom_function_not_called_when_cached + ): + self.assertEqual(await UnitTestModel.objects.acount(), 10) + grpc_stub = self.fake_grpc_inherit.get_fake_stub( + UnitTestModelWithCacheInheritControllerStub + ) + request = empty_pb2.Empty() + + response = await grpc_stub.ListWithAutoCacheCleanOnSaveAndDelete(request=request) + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "z") + + mock_custom_function_not_called_when_cached.assert_called_once() + + test = await UnitTestModel.objects.filter(title="z").afirst() + test.title = "a" + await test.asave() + + response = await grpc_stub.ListWithAutoCacheCleanOnSaveAndDelete(request=request) + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "a") + + self.assertEqual(mock_custom_function_not_called_when_cached.call_count, 2) + + @mock.patch( + "fakeapp.services.unit_test_model_with_cache_service.UnitTestModelWithCacheInheritService.custom_function_not_called_when_cached" + ) + async def test_cache_deleted_whith_delete_pattern_compatible_cache_inherit( + self, mock_custom_function_not_called_when_cached + ): + fake_redis_cache = caches["fake_redis"] + fake_redis_cache.delete_pattern.reset_mock() + fake_redis_cache.set.reset_mock() + + self.assertEqual(await UnitTestModel.objects.acount(), 10) + grpc_stub = self.fake_grpc_inherit.get_fake_stub( + UnitTestModelWithCacheInheritControllerStub + ) + request = empty_pb2.Empty() + + response = await grpc_stub.ListWithAutoCacheCleanOnSaveAndDeleteRedis(request=request) + self.assertEqual(len(response.results), 3) + self.assertEqual(response.results[0].title, "z") + + calls_set = [ + mock.call( + "views.decorators.cache.cache_header.UnitTestModelWithCacheInheritService-ListWithAutoCacheCleanOnSaveAndDeleteRedis.27a2694843c346088c5e956eb29c375d.en-us.UTC", + [], + 300, + ), + mock.call( + "views.decorators.cache.cache_page.UnitTestModelWithCacheInheritService-ListWithAutoCacheCleanOnSaveAndDeleteRedis.GET.27a2694843c346088c5e956eb29c375d.d41d8cd98f00b204e9800998ecf8427e.en-us.UTC", + mock.ANY, + 300, + ), + ] + fake_redis_cache.set.assert_has_calls(calls_set) + + mock_custom_function_not_called_when_cached.assert_called_once() + + fake_redis_cache.delete_pattern.reset_mock() + fake_redis_cache.set.reset_mock() + + test = await UnitTestModel.objects.filter(title="z").afirst() + test.title = "a" + await test.asave() + + calls = [ + mock.call( + "views.decorators.cache.cache_header.UnitTestModelWithCacheInheritService-ListWithAutoCacheCleanOnSaveAndDeleteRedis.*" + ), + mock.call( + "views.decorators.cache.cache_page.UnitTestModelWithCacheInheritService-ListWithAutoCacheCleanOnSaveAndDeleteRedis.*" + ), + ] + + fake_redis_cache.delete_pattern.assert_has_calls(calls) diff --git a/django_socio_grpc/tests/test_filtering_metadata.py b/django_socio_grpc/tests/test_filtering_metadata.py index 9f2f9a0f..4d566dcf 100644 --- a/django_socio_grpc/tests/test_filtering_metadata.py +++ b/django_socio_grpc/tests/test_filtering_metadata.py @@ -49,3 +49,28 @@ async def test_django_filter_with_metadata(self): self.assertEqual(len(response.results), 2) # responses_as_list[0] is type of django_socio_grpc.tests.grpc_test_utils.unittest_pb2.Test self.assertEqual(response.results[0].title, "zzzz") + + @override_settings( + GRPC_FRAMEWORK={"GRPC_ASYNC": True, "MAP_METADATA_KEYS": {"filters": "custom"}} + ) + async def test_django_filter_with_metadata_customizing_the_filters_key(self): + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelControllerStub) + request = UnitTestModelListRequest() + filter_as_dict = {"title": "zzzzzzz"} + metadata = (("custom", (json.dumps(filter_as_dict))),) + response = await grpc_stub.List(request=request, metadata=metadata) + + self.assertEqual(len(response.results), 1) + # responses_as_list[0] is type of django_socio_grpc.tests.grpc_test_utils.unittest_pb2.Test + self.assertEqual(response.results[0].title, "zzzzzzz") + + # INFO - AM - 05/02/2023 - This test verify that metadata are well overiden in unit test + grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelControllerStub) + request = UnitTestModelListRequest() + filter_as_dict = {"title": "zzzz"} + metadata = (("custom", (json.dumps(filter_as_dict))),) + response = await grpc_stub.List(request=request, metadata=metadata) + + self.assertEqual(len(response.results), 2) + # responses_as_list[0] is type of django_socio_grpc.tests.grpc_test_utils.unittest_pb2.Test + self.assertEqual(response.results[0].title, "zzzz") diff --git a/django_socio_grpc/tests/test_legacy_django_middlewares.py b/django_socio_grpc/tests/test_legacy_django_middlewares.py index 5c18d3f0..610db2b0 100644 --- a/django_socio_grpc/tests/test_legacy_django_middlewares.py +++ b/django_socio_grpc/tests/test_legacy_django_middlewares.py @@ -91,7 +91,7 @@ async def test_locale_middleware(self): # TEST accept language in header key -- simple french_accept_language = {"Accept-Language": "fr"} - metadata = (("HEADERS", (json.dumps(french_accept_language))),) + metadata = (("headers", (json.dumps(french_accept_language))),) response = await grpc_stub.FetchTranslatedKey( request=empty_pb2.Empty(), metadata=metadata ) @@ -101,7 +101,7 @@ async def test_locale_middleware(self): # TEST accept language in header key -- complex french_accept_language = {"Accept-Language": "fr,en-US;q=0.9,en;q=0.8"} - metadata = (("HEADERS", (json.dumps(french_accept_language))),) + metadata = (("headers", (json.dumps(french_accept_language))),) response = await grpc_stub.FetchTranslatedKey( request=empty_pb2.Empty(), metadata=metadata ) @@ -109,15 +109,7 @@ async def test_locale_middleware(self): self.assertEqual(response.text, "Test traduction français") # TEST accept language directly in metadata -- simple - metadata = (("Accept-Language", "fr"),) - response = await grpc_stub.FetchTranslatedKey( - request=empty_pb2.Empty(), metadata=metadata - ) - - self.assertEqual(response.text, "Test traduction français") - - # TEST accept language directly in metadata in maj -- simple - metadata = (("ACCEPT-LANGUAGE", "fr"),) + metadata = (("accept-language", "fr"),) response = await grpc_stub.FetchTranslatedKey( request=empty_pb2.Empty(), metadata=metadata ) diff --git a/django_socio_grpc/tests/test_locale_middleware.py b/django_socio_grpc/tests/test_locale_middleware.py index c3e1a342..d1d6880c 100644 --- a/django_socio_grpc/tests/test_locale_middleware.py +++ b/django_socio_grpc/tests/test_locale_middleware.py @@ -36,7 +36,7 @@ async def test_locale_middleware(self): # TEST accept language in header key -- simple french_accept_language = {"Accept-Language": "fr"} - metadata = (("HEADERS", (json.dumps(french_accept_language))),) + metadata = (("headers", (json.dumps(french_accept_language))),) response = await grpc_stub.FetchTranslatedKey( request=empty_pb2.Empty(), metadata=metadata ) @@ -46,7 +46,7 @@ async def test_locale_middleware(self): # TEST accept language in header key -- complex french_accept_language = {"Accept-Language": "fr,en-US;q=0.9,en;q=0.8"} - metadata = (("HEADERS", (json.dumps(french_accept_language))),) + metadata = (("headers", (json.dumps(french_accept_language))),) response = await grpc_stub.FetchTranslatedKey( request=empty_pb2.Empty(), metadata=metadata ) @@ -54,15 +54,7 @@ async def test_locale_middleware(self): self.assertEqual(response.text, "Test traduction français") # TEST accept language directly in metadata -- simple - metadata = (("Accept-Language", "fr"),) - response = await grpc_stub.FetchTranslatedKey( - request=empty_pb2.Empty(), metadata=metadata - ) - - self.assertEqual(response.text, "Test traduction français") - - # TEST accept language directly in metadata in maj -- simple - metadata = (("ACCEPT-LANGUAGE", "fr"),) + metadata = (("accept-language", "fr"),) response = await grpc_stub.FetchTranslatedKey( request=empty_pb2.Empty(), metadata=metadata ) diff --git a/django_socio_grpc/tests/test_pagination_metadata.py b/django_socio_grpc/tests/test_pagination_metadata.py index 28b32609..1f776395 100644 --- a/django_socio_grpc/tests/test_pagination_metadata.py +++ b/django_socio_grpc/tests/test_pagination_metadata.py @@ -52,8 +52,8 @@ async def test_page_number_pagination(self): async def test_another_page_number_pagination(self): grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelControllerStub) request = UnitTestModelListRequest() - pagination_as_dict = {"page_size": 6} - metadata = (("PAGINATION", (json.dumps(pagination_as_dict))),) + pagination_as_dict = {"page_size": "6"} + metadata = (("pagination", (json.dumps(pagination_as_dict))),) response = await grpc_stub.List(request=request, metadata=metadata) self.assertEqual(response.count, 10) diff --git a/django_socio_grpc/tests/test_pagination_request_struct.py b/django_socio_grpc/tests/test_pagination_request_struct.py index 1596e68a..048586db 100644 --- a/django_socio_grpc/tests/test_pagination_request_struct.py +++ b/django_socio_grpc/tests/test_pagination_request_struct.py @@ -37,7 +37,7 @@ async def test_page_number_pagination_with_struct_request_not_working_because_me self, ): grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithStructFilterControllerStub) - pagination_as_dict = {"page_size": 6} + pagination_as_dict = {"page_size": "6"} pagination_as_struct = struct_pb2.Struct() pagination_as_struct.update(pagination_as_dict) request = UnitTestModelWithStructFilterListRequest(_pagination=pagination_as_struct) @@ -54,7 +54,7 @@ async def test_page_number_pagination_with_struct_request_not_working_because_me ) async def test_page_number_pagination_with_struct_request_only(self): grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithStructFilterControllerStub) - pagination_as_dict = {"page_size": 6} + pagination_as_dict = {"page_size": "6"} pagination_as_struct = struct_pb2.Struct() pagination_as_struct.update(pagination_as_dict) request = UnitTestModelWithStructFilterListRequest(_pagination=pagination_as_struct) @@ -66,8 +66,8 @@ async def test_page_number_pagination_with_struct_request_only(self): # Testing metadata pagination not working grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithStructFilterControllerStub) request = UnitTestModelWithStructFilterListRequest() - pagination_as_dict = {"page_size": 6} - metadata = (("PAGINATION", (json.dumps(pagination_as_dict))),) + pagination_as_dict = {"page_size": "6"} + metadata = (("pagination", (json.dumps(pagination_as_dict))),) response = await grpc_stub.List(request=request, metadata=metadata) self.assertEqual(response.count, 10) @@ -81,7 +81,7 @@ async def test_page_number_pagination_with_struct_request_only(self): ) async def test_page_number_pagination_with_struct_request_and_metadata(self): grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithStructFilterControllerStub) - pagination_as_dict = {"page_size": 6} + pagination_as_dict = {"page_size": "6"} pagination_as_struct = struct_pb2.Struct() pagination_as_struct.update(pagination_as_dict) request = UnitTestModelWithStructFilterListRequest(_pagination=pagination_as_struct) @@ -93,8 +93,8 @@ async def test_page_number_pagination_with_struct_request_and_metadata(self): # Testing metadata pagination also working grpc_stub = self.fake_grpc.get_fake_stub(UnitTestModelWithStructFilterControllerStub) request = UnitTestModelWithStructFilterListRequest() - pagination_as_dict = {"page_size": 6} - metadata = (("PAGINATION", (json.dumps(pagination_as_dict))),) + pagination_as_dict = {"page_size": "6"} + metadata = (("pagination", (json.dumps(pagination_as_dict))),) response = await grpc_stub.List(request=request, metadata=metadata) self.assertEqual(response.count, 10) diff --git a/docs/features/cache.rst b/docs/features/cache.rst new file mode 100644 index 00000000..1434ab86 --- /dev/null +++ b/docs/features/cache.rst @@ -0,0 +1,168 @@ +.. _cache: + +Cache +===== + +Description +----------- + +Usually django cache is used to cache page or basic ``GET`` request. However, in the context of gRPC, we use ``POST`` request and there is no `native cache system in gRPC in Python `_. + +Fortunately, DSG bring a layer of abstraction between gRPC request and Django request allowing us to use Django cache system. + +To enable it follow the `Django instructions `_ then use the :ref:`cache_endpoint ` decorator or the :ref:`cache_endpoint_with_deleter ` to cache your endpoint. + +.. _cache-endpoint: + +cache_endpoint +-------------- + +Th :func:`cache_endpoint ` decorator is used to adapt the `cache_page `_ decorator to work with grpc. + +It took the same parameters and do the exact same things. See :ref:`Use Django decorators in DSG ` for more informations. + +This decorator will cache response depending on: + +* :ref:`Filters ` +* :ref:`Pagination ` + +Meaning that if you have a filter in your request, the cache will be different for each filter. + +.. warning:: + + If you have request parameters that are not considered as filters or pagination, the cache will not be different for each request. + + +Example: + +.. code-block:: python + + from django_socio_grpc.decorators import cache_endpoint + ... + + class UnitTestModelWithCacheService(generics.AsyncModelService, mixins.AsyncStreamModelMixin): + queryset = UnitTestModel.objects.all().order_by("id") + serializer_class = UnitTestModelWithCacheSerializer + + @grpc_action( + request=[], + response=UnitTestModelWithCacheSerializer, + use_generation_plugins=[ + ListGenerationPlugin(response=True), + ], + ) + @cache_endpoint(300) + async def List(self, request, context): + return await super().List(request, context) + +.. _cache-endpoint-with-deleter: + +cache_endpoint_with_deleter +--------------------------- + +The :func:`cache_endpoint_with_deleter ` decorator work the same :ref:`cache_endpoint ` but allow to automatically delete the cache when a django signals is called from the models passed in parameters or the one used for the queryset if not specified. + +As DSG is an API framework it's logic to add utils to invalidate cache if data is created, updated or deleted. + +.. warning:: + + The cache will not be deleted if using bulk operations. This also integrate the usage of filter(...).update() method. + See `caveats of each meathod you wish to use to be sure of the behavior `_ + + The cache will also not be deleted if modifying date in an other process that is not gRPC (Django commands, admin, shell, ...). + You can make your own decorator to handle this case if needed by registering decorator parameter in a global context and then listen to all django event to see if one matching. + We decide to not integrate it because listening all django events and making check on signals and senders may add an unwanted request overhead. + +There is also caveats to understand when usings cache-endpoint-with-deleter. As only Redis cache allow a pattern like deleter, if not using redis cache each specified signals on the specified models of the deleter will delete the entire cache. + +To address this issue, you can: + +* Use a `redis cache `_ +* Use a cache per model + +.. note:: + + If you do not follow above advice a warning will show up everytimes you start the server. You can mute the logger by muting the django_socio_grpc.cache_deleter logger in your logging settings. + + +Example: + +.. code-block:: python + + + # SETTINGS + CACHES = { + "UnitTestModelCache": { + "BACKEND": "django.core.cache.backends.db.DatabaseCache", + "LOCATION": "unit_test_model_cache_table", + } + } + + # SERVICES + from django_socio_grpc.decorators import cache_endpoint_with_deleter + ... + + class UnitTestModelWithCacheService(generics.AsyncModelService, mixins.AsyncStreamModelMixin): + queryset = UnitTestModel.objects.all().order_by("id") + serializer_class = UnitTestModelWithCacheSerializer + + @grpc_action( + request=[], + response=UnitTestModelWithCacheSerializer, + use_generation_plugins=[ + ListGenerationPlugin(response=True), + ], + ) + @cache_endpoint_with_deleter( + 300, + cache="UnitTestModelCache", # Cache is not mandatory. But it is for working as expecting is using any other cache system than redis. + # key_prefix="UnitTestModel-List", # You can specify a key prefix if needed. It will allow you to use a specific pattern for cache action. Default is - + # senders=(UnitTestModel,), # You can specify a list of models to listen to. Default is the queryset model. + # signals=(signals.post_save, signals.post_delete), # You can specify a list of signals to listen to. Default is (signals.post_save, signals.post_delete) + ) + async def List(self, request, context): + return await super().List(request, context) + + +.. _vary-on-metadata: + +vary_on_metadata +---------------- + +Working like django `vary_on_headers `_ it's just a convenient renaming using :ref:`Use Django decorators in DSG `. + +It allow the cache to also `vary on metadata `_ and not only filters and paginations. + +Example: + + +.. code-block:: python + + from django_socio_grpc.decorators import cache_endpoint, vary_on_metadata + ... + + class UnitTestModelWithCacheService(generics.AsyncModelService, mixins.AsyncStreamModelMixin): + queryset = UnitTestModel.objects.all().order_by("id") + serializer_class = UnitTestModelWithCacheSerializer + + @grpc_action( + request=[], + response=UnitTestModelWithCacheSerializer, + use_generation_plugins=[ + ListGenerationPlugin(response=True), + ], + ) + @cache_endpoint(300) + @vary_on_metadata("custom-metadata", "another-metadata") + async def List(self, request, context): + return await super().List(request, context) + + +.. _any-other-decorator: + +Any other decorator +------------------- + +As you can use :ref:`Django decorators in DSG `. You can try to use any django decorators as long as they are wrapped into :func:`http_to_grpc decorator `. + +If the one you are trying to use is not working as expected and it's not listed in the documentation page please fill an issue. diff --git a/docs/features/filters.rst b/docs/features/filters.rst index e447dbec..9a77eaee 100644 --- a/docs/features/filters.rst +++ b/docs/features/filters.rst @@ -115,7 +115,7 @@ The main inconveniences are: This view should return a list of all the posts for the currently authenticated user. """ - user = self.context.grpc_request_metadata["FILTERS"]["user"] + user = self.context.grpc_request_metadata["filters"]["user"] # Next line also working to make REST library working # user = self.context.query_params["user"] return Post.objects.filter(user=user) diff --git a/docs/features/grpc-action.rst b/docs/features/grpc-action.rst index d64b0322..ad8e84ab 100644 --- a/docs/features/grpc-action.rst +++ b/docs/features/grpc-action.rst @@ -135,7 +135,7 @@ For more information, please read :ref:`the specified documentation ` -.. _grpc-action-request-response: +.. _grpc-action-use-generation-plugins: ========================== ``use_generation_plugins`` diff --git a/docs/features/index.rst b/docs/features/index.rst index 61284903..bcf76438 100644 --- a/docs/features/index.rst +++ b/docs/features/index.rst @@ -18,4 +18,5 @@ Features logging streaming commands + cache health-check diff --git a/docs/features/pagination.rst b/docs/features/pagination.rst index 728f542a..90f20cb1 100644 --- a/docs/features/pagination.rst +++ b/docs/features/pagination.rst @@ -131,7 +131,8 @@ For more example you can see the `client in DSG example repo `_ as its first argument and return a `django.http.HttpResponse `_. + +In DSG, decorators expect to decorate a class method that take 2 arguments: a `grpc Message`_ as request and the `grpc context `_, and return a `grpc Message `_ as response. + +Both are based on HTTP protocol. So it's possible to find similar concept and usage. + +By using :ref:`DSG proxy request and proxy response ` it is possible to simulate django behavior and apply it to gRPC calls. + +See :func:`http_to_grpc decorator ` for more detailsa and parameters. + +.. _simple-example: + +Simple example +-------------- + + +.. code-block:: python + + from django_socio_grpc.decorators import http_to_grpc + from django.views.decorators.vary import vary_on_headers + + def vary_on_metadata(*headers): + return http_to_grpc(vary_on_headers(*headers)) + +.. _example-with-method-decorator-and-data-variance: + +Example with method decorator and data variance +------------------------------------------------ + +In the following example we are transforming a function decorator into a method decorator. +Then we are transforming it to a grpc decorator. +In the same time we specify that for each simulate Django request we want to set the ``method`` attribute to the value ``GET`` (this is because grpc only use POST request and Django only cache GET request) +Also cache_page is not fully supporting async for now if you are using DB cache backend so we disable async support. Feel free to set it to True in you own decorator if using an async compatible cache backend. + +The ``functools.wraps`` is optional and is used to keep the original function name and docstring. + +.. code-block:: python + + from django_socio_grpc.decorators import http_to_grpc + from django.views.decorators.cache import cache_page + + + @functools.wraps(cache_page) + def cache_endpoint(*args, **kwargs): + return http_to_grpc( + method_decorator(cache_page(*args, **kwargs)), + request_setter={"method": "GET"}, + support_async=False + ) diff --git a/docs/inner-workings/request-and-response-proxy.rst b/docs/inner-workings/request-and-response-proxy.rst new file mode 100644 index 00000000..0ce6c598 --- /dev/null +++ b/docs/inner-workings/request-and-response-proxy.rst @@ -0,0 +1,6 @@ +.. _request-and-response-proxy: + +Request and Response proxy +========================== + +Coming soon diff --git a/docs/settings.rst b/docs/settings.rst index f928cd49..19e29e67 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -30,15 +30,19 @@ See the documentation on django settings if your not familiar with it: `Django s ], "ROOT_GRPC_FOLDER": "grpc_folder", "MAP_METADATA_KEYS": { - "HEADERS": "HEADERS", - "PAGINATION": "PAGINATION", - "FILTERS": "FILTERS", + "headers": "headers", + "pagination": "pagination", + "filters": "filters", }, "LOG_OK_RESPONSE": False, "IGNORE_LOG_FOR_ACTION": [], + "ROOT_CERTIFICATES_PATH": None, + "PRIVATE_KEY_CERTIFICATE_CHAIN_PAIRS_PATH": [], + "REQUIRE_CLIENT_AUTH": False, "FILTER_BEHAVIOR": "METADATA_STRICT", "PAGINATION_BEHAVIOR": "METADATA_STRICT", "DEFAULT_MESSAGE_NAME_CONSTRUCTOR": "django_socio_grpc.protobuf.message_name_constructor.DefaultMessageNameConstructor", + "DEFAULT_GENERATION_PLUGINS": [], "ENABLE_HEALTH_CHECK": False, } @@ -257,27 +261,29 @@ This setting defines where the framework should look within the metadata for specific pieces of information like headers, pagination data, and filters. Essentially, it provides mapping keys that indicate where to extract certain types of metadata. +This setting can be partially overriden. If some keys are not provided the default ones are used + For a standard configuration, you might have: .. code-block:: python "MAP_METADATA_KEYS": { - "HEADERS": "HEADERS", - "PAGINATION": "PAGINATION", - "FILTERS": "FILTERS", + "headers": "headers", + "pagination": "pagination", + "filters": "filters", } -This means that when the framework encounters metadata, it knows to look for a ``HEADERS`` -key to retrieve headers, a ``PAGINATION`` key to fetch pagination data, and a ``FILTERS`` key +This means that when the framework encounters metadata, it knows to look for a ``headers`` +key to retrieve headers, a ``pagination`` key to fetch pagination data, and a ``filters`` key for filtering details. .. note:: See specific documentation for each: - - HEADERS : :ref:`Authentication` - - FILTERS: :ref:`Filters` - - PAGINATION: Coming soon + - headers : :ref:`Authentication` + - filters: :ref:`Filters` + - pagination: :ref:`Pagination` .. _settings-log-ok-response: diff --git a/poetry.lock b/poetry.lock index bd560ab3..a38d9898 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1492,13 +1492,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "uvicorn" -version = "0.30.4" +version = "0.30.5" description = "The lightning-fast ASGI server." optional = false python-versions = ">=3.8" files = [ - {file = "uvicorn-0.30.4-py3-none-any.whl", hash = "sha256:06b00e3087e58c6865c284143c0c42f810b32ff4f265ab19d08c566f74a08728"}, - {file = "uvicorn-0.30.4.tar.gz", hash = "sha256:00db9a9e3711a5fa59866e2b02fac69d8dc70ce0814aaec9a66d1d9e5c832a30"}, + {file = "uvicorn-0.30.5-py3-none-any.whl", hash = "sha256:b2d86de274726e9878188fa07576c9ceeff90a839e2b6e25c917fe05f5a6c835"}, + {file = "uvicorn-0.30.5.tar.gz", hash = "sha256:ac6fdbd4425c5fd17a9fe39daf4d4d075da6fdc80f653e5894cdc2fd98752bee"}, ] [package.dependencies] diff --git a/test_utils/boot_django.py b/test_utils/boot_django.py index a604718d..2328fcab 100644 --- a/test_utils/boot_django.py +++ b/test_utils/boot_django.py @@ -2,9 +2,11 @@ # execute in django land import os import sys +from unittest import mock import django from django.conf import settings +from django.core.cache.backends.locmem import LocMemCache BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) FAKE_APP_DIR = os.path.join(BASE_DIR, "django_socio_grpc", "tests") @@ -15,6 +17,11 @@ os.environ["DJANGO_SETTINGS_MODULE"] = "myproject.settings" +class FakeRedisCache(LocMemCache): + set = mock.MagicMock() + delete_pattern = mock.MagicMock() + + def boot_django(): os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings") settings.configure( @@ -34,6 +41,7 @@ def boot_django(): "PORT": os.environ.get("DB_PORT", 5432), } }, + ALLOWED_HOSTS=["*"], INSTALLED_APPS=( "django.contrib.auth", # INFO - AM - 26/04/2023 - Needed for some test on Auth "rest_framework", @@ -42,6 +50,20 @@ def boot_django(): "django_socio_grpc", "fakeapp", ), + CACHES={ + "default": { + "BACKEND": "django.core.cache.backends.locmem.LocMemCache", + "LOCATION": "default", + }, + "second": { + "BACKEND": "django.core.cache.backends.locmem.LocMemCache", + "LOCATION": "second", + }, + "fake_redis": { + "BACKEND": "test_utils.boot_django.FakeRedisCache", + "LOCATION": "redis", + }, + }, TIME_ZONE="UTC", USE_TZ=True, LOCALE_PATHS=[os.path.join(FAKE_APP_DIR, "fakeapp", "locale")],