// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef REMOTING_HOST_SESSION_POLICIES_FROM_DICT_H_
#define REMOTING_HOST_SESSION_POLICIES_FROM_DICT_H_

#include <optional>

#include "base/values.h"
#include "remoting/base/session_policies.h"

namespace remoting {

// Create SessionPolicies from the policy dictionary. Returns `std::nullopt`
// if any policy in `dict` is malformed or violates validation rules.
// Note: When using PolicyWatcher, please pass the dictionary returned by
// GetPlatformPolicies(). The dictionary passed to the PolicyUpdatedCallback is
// a delta, but this function takes the full policy dictionary.
std::optional<SessionPolicies> SessionPoliciesFromDict(
    const base::DictValue& dict);

}  // namespace remoting

#endif  // REMOTING_HOST_SESSION_POLICIES_FROM_DICT_H_
