code: async def list_statuses(self, request):
          
          error_traps = [error_handlers.StatusResponseMissing]
  
          # Parse batch ids from POST body, or query paramaters
          if request.method == 'POST':
              if request.headers['Content-Type'] != 'application/json':
                  LOGGER.debug(
                      'Request headers had wrong Content-Type: %s',
                      request.headers['Content-Type'])
                  raise errors.StatusWrongContentType()
  
              ids = await request.json()
  
              if (not ids
                      or not isinstance(ids, list)
                      or not all(isinstance(i, str) for i in ids)):
                  LOGGER.debug('Request body was invalid: %s', ids)
                  raise errors.StatusBodyInvalid()
              for i in ids:
                  self._validate_id(i)
  
          else:
              ids = self._get_filter_ids(request)
              if not ids:
                  LOGGER.debug('Request for statuses missing id query')
                  raise errors.StatusIdQueryInvalid()
  
          # Query validator
          validator_query = \
              client_batch_submit_pb2.ClientBatchStatusRequest(
                  batch_ids=ids)
          self._set_wait(request, validator_query)
  
          response = await self._query_validator(
              Message.CLIENT_BATCH_STATUS_REQUEST,
              client_batch_submit_pb2.ClientBatchStatusResponse,
              validator_query,
              error_traps)
  
          # Send response
          if request.method != 'POST':
              metadata = self._get_metadata(request, response)
          else:
              metadata = None
  
          data = self._drop_id_prefixes(
              self._drop_empty_props(response['batch_statuses']))
  
          return self._wrap_response(request, data=data, metadata=metadata)
docs: Fetches the committed status of batches by either a POST or GET.
  
          Request:
              body: A JSON array of one or more id strings (if POST)
              query:
                  - id: A comma separated list of up to 15 ids (if GET)
                  - wait: Request should not return until all batches committed
  
          Response:
              data: A JSON object, with batch ids as keys, and statuses as values
              link: The /batch_statuses link queried (if GET)