from typing import Dict
from typing import Any


def _create_response_status(event: Dict[str, Any],
                            error_code: str) -> Dict[Any, Any]:
  """Creates the API response for a given conversion event and error code."""
  status = {
      'kind':
          'dfareporting#conversionStatus',
      'conversion': event,
  }
  if error_code:
    status['errors'] = [{
        'kind': 'dfareporting#conversionError',
        'code': error_code,
        'message': 'Error raised for the event.'
    }]
  else:
    status['errors'] = []
  return status