#ifndef NET_DNS_PUBLIC_DNS_OVER_HTTPS_CONFIG_H_
#define NET_DNS_PUBLIC_DNS_OVER_HTTPS_CONFIG_H_
#include <optional>
#include <string>
#include <string_view>
#include <vector>
#include "base/values.h"
#include "net/base/net_export.h"
#include "net/dns/public/dns_over_https_server_config.h"
namespace net {
class NET_EXPORT DnsOverHttpsConfig {
public:
DnsOverHttpsConfig();
~DnsOverHttpsConfig();
DnsOverHttpsConfig(const DnsOverHttpsConfig& other);
DnsOverHttpsConfig& operator=(const DnsOverHttpsConfig& other);
DnsOverHttpsConfig(DnsOverHttpsConfig&& other);
DnsOverHttpsConfig& operator=(DnsOverHttpsConfig&& other);
explicit DnsOverHttpsConfig(std::vector<DnsOverHttpsServerConfig> servers);
static std::optional<DnsOverHttpsConfig> FromTemplatesForTesting(
std::vector<std::string> servers);
static std::optional<DnsOverHttpsConfig> FromString(
std::string_view doh_config);
static DnsOverHttpsConfig FromStringLax(std::string_view doh_config);
bool operator==(const DnsOverHttpsConfig& other) const;
const std::vector<DnsOverHttpsServerConfig>& servers() const {
return servers_;
}
std::string ToString() const;
base::Value::Dict ToValue() const;
private:
static std::optional<DnsOverHttpsConfig> FromTemplates(
std::vector<std::string> servers);
std::vector<DnsOverHttpsServerConfig> servers_;
};
}
#endif