#ifndef NET_DNS_PUBLIC_DNS_OVER_HTTPS_SERVER_CONFIG_H_
#define NET_DNS_PUBLIC_DNS_OVER_HTTPS_SERVER_CONFIG_H_
#include <optional>
#include <string>
#include <string_view>
#include "base/values.h"
#include "net/base/ip_address.h"
#include "net/base/net_export.h"
namespace net {
class NET_EXPORT DnsOverHttpsServerConfig {
public:
using Endpoints = std::vector<IPAddressList>;
DnsOverHttpsServerConfig();
DnsOverHttpsServerConfig(const DnsOverHttpsServerConfig& other);
DnsOverHttpsServerConfig& operator=(const DnsOverHttpsServerConfig& other);
DnsOverHttpsServerConfig(DnsOverHttpsServerConfig&& other);
DnsOverHttpsServerConfig& operator=(DnsOverHttpsServerConfig&& other);
~DnsOverHttpsServerConfig();
static std::optional<DnsOverHttpsServerConfig> FromString(
std::string doh_template,
Endpoints endpoints = {});
static std::optional<DnsOverHttpsServerConfig> FromValue(
base::Value::Dict value);
bool operator==(const DnsOverHttpsServerConfig& other) const;
bool operator<(const DnsOverHttpsServerConfig& other) const;
const std::string& server_template() const;
std::string_view server_template_piece() const;
bool use_post() const;
const Endpoints& endpoints() const;
bool IsSimple() const;
base::Value::Dict ToValue() const;
private:
DnsOverHttpsServerConfig(std::string server_template,
bool use_post,
Endpoints endpoints);
std::string server_template_;
bool use_post_;
Endpoints endpoints_;
};
}
#endif