def TableResourceToReference(bigquery_messages, resource):
  """Converts a Resource for a table to a TableReference message.

  Args:
    bigquery_messages: The messages module for the Bigquery API.
    resource: the Resource

  Returns:
    the message
  """
  return bigquery_messages.TableReference(
      projectId=resource.projectId,
      datasetId=resource.datasetId,
      tableId=resource.tableId)