async def async_request(
      self, http_method: str, path: str, request_dict: dict[str, Any]
  ):
    """Mocks the API Client request method"""
    if http_method == 'GET':
      if re.match(SESSION_REGEX, path):
        match = re.match(SESSION_REGEX, path)
        if match:
          session_id = match.group(2)
          if session_id in self.session_dict:
            return self.session_dict[session_id]
          else:
            raise ValueError(f'Session not found: {session_id}')
      elif re.match(SESSIONS_REGEX, path):
        match = re.match(SESSIONS_REGEX, path)
        return {
            'sessions': [
                session
                for session in self.session_dict.values()
                if session['userId'] == match.group(2)
            ],
        }
      elif re.match(EVENTS_REGEX, path):
        match = re.match(EVENTS_REGEX, path)
        if match:
          session_id = match.group(2)
          if match.group(3):
            return {'sessionEvents': MOCK_EVENT_JSON_3}
          events_tuple = self.event_dict.get(session_id, ([], None))
          response = {'sessionEvents': events_tuple[0]}
          if events_tuple[1]:
            response['nextPageToken'] = events_tuple[1]
          return response
      elif re.match(LRO_REGEX, path):
        # Mock long-running operation as completed
        return {
            'name': path,
            'done': True,
            'response': self.session_dict['4'],  # Return the created session
        }
      else:
        raise ValueError(f'Unsupported path: {path}')
    elif http_method == 'POST':
      new_session_id = '4'
      self.session_dict[new_session_id] = {
          'name': (
              'projects/test-project/locations/test-location/'
              'reasoningEngines/123/sessions/'
              + new_session_id
          ),
          'userId': request_dict['user_id'],
          'sessionState': request_dict.get('session_state', {}),
          'updateTime': '2024-12-12T12:12:12.123456Z',
      }
      return {
          'name': (
              'projects/test_project/locations/test_location/'
              'reasoningEngines/123/sessions/'
              + new_session_id
              + '/operations/111'
          ),
          'done': False,
      }
    elif http_method == 'DELETE':
      match = re.match(SESSION_REGEX, path)
      if match:
        self.session_dict.pop(match.group(2))
    else:
      raise ValueError(f'Unsupported http method: {http_method}')
Mocks the API Client request method
tests/unittests/sessions/test_vertex_ai_session_service.py