def _CredentialFrom(messages, credential_data):
  """Translate a dict of credential data into a message object.

  Args:
    messages: The API message to use.
    credential_data: A dict containing credential data.
  Returns:
    An Credential message object derived from credential_data.
  """
  basic_auth = messages.BasicAuth(
      password=credential_data['basicAuth']['password'],
      user=credential_data['basicAuth']['user'])
  return messages.Credential(basicAuth=basic_auth)