#include "components/account_manager_core/account.h"
#include "base/check.h"
#include "base/check_op.h"
#include "google_apis/gaia/gaia_id.h"
namespace account_manager {
AccountKey AccountKey::FromGaiaId(const GaiaId& gaia_id) {
return AccountKey(gaia_id.ToString(), AccountType::kGaia);
}
AccountKey::AccountKey(const std::string& id, AccountType type)
: id_(id), account_type_(type) {
DCHECK(!id_.empty());
}
COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE)
std::ostream& operator<<(std::ostream& os, const AccountType& account_type) {
CHECK_EQ(account_type, account_manager::AccountType::kGaia);
os << "Gaia";
return os;
}
COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE)
std::ostream& operator<<(std::ostream& os, const AccountKey& account_key) {
os << "{ id: " << account_key.id()
<< ", account_type: " << account_key.account_type() << " }";
return os;
}
}