code: def view_as_consumer(
          wrapped_view: typing.Callable[[HttpRequest], HttpResponse],
          mapped_actions: typing.Optional[
              typing.Dict[str, str]
          ]=None) -> Type[AsyncConsumer]:
      
      if mapped_actions is None:
          mapped_actions = {
              'create': 'PUT',
              'update': 'PATCH',
              'list': 'GET',
              'retrieve': 'GET'
          }
  
      class DjangoViewWrapper(DjangoViewAsConsumer):
          view = wrapped_view
          actions = mapped_actions
  
      return DjangoViewWrapper
docs: Wrap a django View so that it will be triggered by actions over this json
       websocket consumer.