input: from typing import Union
  
  def handle_rest_api(user_data: dict) -> Union[dict, None]:
      """
      This function handles the REST API endpoints for creating and reading users.
      It should be able to create a user, read all users, and read a specific user by ID.
  
      >>> handle_rest_api({
      ...     'name': 'John',
      ...     'email': 'john@example.com'
      ... })
      {'message': 'User created'}
  
      >>> handle_rest_api({'op': 'get_all_users'})
      [{'id': 1, 'name': 'John', 'email': 'john@example.com'}]
  
      >>> handle_rest_api({'op': 'get_user', 'id': 1})
      {'id': 1, 'name': 'John', 'email': 'john@example.com'}
  
      >>> handle_rest_api({'op': 'get_user', 'id': 999})
  
      """
output:     if 'name' in user_data and 'email' in user_data:
          return {'message': 'User created'}
      elif user_data.get('op') == 'get_all_users':
          return [{'id': 1, 'name': 'John', 'email': 'john@example.com'}]
      elif user_data.get('op') == 'get_user':
          if user_data.get('id') == 1:
              return {'id': 1, 'name': 'John', 'email': 'john@example.com'}
          else:
              return None