class_docstr: Represents a DataRequest used for exchanging :class:`docarray.DocumentArray` with and within a Flow.
  
  When calling :meth:`~jina.clients.mixin.PostMixin.post` on any Jina client,
  the provided input :class:`docarray.DocumentArray` will be
  converted to a :class:`DataRequest` before being sent to a Flow.
code: def __init__(
      self,
      request: Optional[RequestSourceType] = None,
  ):
      self.buffer = None
      self._pb_body = None
      self._document_array_cls = DocumentArray
      self._data = None
  
      try:
          if isinstance(request, jina_pb2.DataRequestProto):
              self._pb_body = request
          elif isinstance(request, dict):
              self._pb_body = jina_pb2.DataRequestProto()
              json_format.ParseDict(request, self._pb_body)
          elif isinstance(request, str):
              self._pb_body = jina_pb2.DataRequestProto()
              json_format.Parse(request, self._pb_body)
          elif isinstance(request, bytes):
              self.buffer = request
          elif request is not None:
              # note ``None`` is not considered as a bad type
              raise ValueError(
                  f"{typename(request)} is not recognizable"
              )
          else:
              self._pb_body = jina_pb2.DataRequestProto()
              self._pb_body.header.request_id = random_identity()
      except Exception as ex:
          raise BadRequestType(
              f"fail to construct a {self.__class__} object from {request}"
          ) from ex
  
imports: import copy
  from typing import Dict, Optional, Type, TypeVar, Union
  from google.protobuf import json_format
  from jina._docarray import DocumentArray, Document, docarray_v2
  from jina.excepts import BadRequestType
  from jina.helper import random_identity, typename
  from jina.proto import jina_pb2
  from jina.types.request import Request
label_desc: Use image node_id 1 to create a new DataRequest object from inherited base classes: Request with example: obj = DataRequest(request)