// components/policy/resources/webui/mojom/policy.mojom.h is auto generated by mojom_bindings_generator.py, do not edit

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

#ifndef COMPONENTS_POLICY_RESOURCES_WEBUI_MOJOM_POLICY_MOJOM_H_
#define COMPONENTS_POLICY_RESOURCES_WEBUI_MOJOM_POLICY_MOJOM_H_

#include <stdint.h>

#include <limits>
#include <optional>
#include <type_traits>
#include <utility>
#include "mojo/public/cpp/bindings/clone_traits.h"
#include "mojo/public/cpp/bindings/equals_traits.h"
#include "mojo/public/cpp/bindings/struct_ptr.h"
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "mojo/public/cpp/bindings/union_traits.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"

#include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h"

#include "components/policy/resources/webui/mojom/policy.mojom-features.h"  // IWYU pragma: export
#include "components/policy/resources/webui/mojom/policy.mojom-shared.h"  // IWYU pragma: export
#include "components/policy/resources/webui/mojom/policy.mojom-forward.h"  // IWYU pragma: export
#include "mojo/public/mojom/base/values.mojom.h"
#include <string>
#include <vector>

#include "mojo/public/cpp/bindings/lib/control_message_handler.h"
#include "mojo/public/cpp/bindings/raw_ptr_impl_ref_traits.h"






namespace policy::mojom {

class PolicyPageHandlerProxy;

template <typename ImplRefTraits>
class PolicyPageHandlerStub;

class PolicyPageHandlerRequestValidator;
class PolicyPageHandlerResponseValidator;


class PolicyPageHandler
    : public PolicyPageHandlerInterfaceBase {
 public:
  using IPCStableHashFunction = uint32_t(*)();
  static constexpr const char* Name_ = "policy.mojom.PolicyPageHandler";
  static IPCStableHashFunction MessageToMethodInfo_(mojo::Message& message);
  static const char* MessageToMethodName_(mojo::Message& message);
  static constexpr uint32_t Version_ = 0;
  static constexpr bool PassesAssociatedKinds_ = false;
  static constexpr bool HasUninterruptableMethods_ = false;

  using Base_ = PolicyPageHandlerInterfaceBase;
  using Proxy_ = PolicyPageHandlerProxy;

  template <typename ImplRefTraits>
  using Stub_ = PolicyPageHandlerStub<ImplRefTraits>;

  using RequestValidator_ = PolicyPageHandlerRequestValidator;
  using ResponseValidator_ = PolicyPageHandlerResponseValidator;
  enum MethodMinVersions : uint32_t {
    kGetDebugStringMinVersion = 0,
    kRestartBrowserMinVersion = 0,
    kSetUserAffiliatedMinVersion = 0,
    kGetAppliedTestPoliciesMinVersion = 0,
    kRevertLocalTestPoliciesMinVersion = 0,
    kSetLocalTestPoliciesMinVersion = 0,
    kGetPolicyLogsMinVersion = 0,
    kGetPoliciesJsonMinVersion = 0,
  };

// crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK
// with not having this data in traces there.
#if !BUILDFLAG(IS_FUCHSIA)
  struct GetDebugString_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct RestartBrowser_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct SetUserAffiliated_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct GetAppliedTestPolicies_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct RevertLocalTestPolicies_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct SetLocalTestPolicies_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct GetPolicyLogs_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct GetPoliciesJson_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
#endif // !BUILDFLAG(IS_FUCHSIA)
  virtual ~PolicyPageHandler() = default;

  using GetDebugStringCallback = base::OnceCallback<void(const std::string&)>;
  using GetDebugStringMojoCallback = base::OnceCallback<void(const std::string&)>;

  virtual void GetDebugString(GetDebugStringCallback callback) = 0;

  virtual void RestartBrowser(const std::string& policies) = 0;

  using SetUserAffiliatedCallback = base::OnceCallback<void()>;
  using SetUserAffiliatedMojoCallback = base::OnceCallback<void()>;

  virtual void SetUserAffiliated(bool affiliated, SetUserAffiliatedCallback callback) = 0;

  using GetAppliedTestPoliciesCallback = base::OnceCallback<void(const std::string&)>;
  using GetAppliedTestPoliciesMojoCallback = base::OnceCallback<void(const std::string&)>;

  virtual void GetAppliedTestPolicies(GetAppliedTestPoliciesCallback callback) = 0;

  virtual void RevertLocalTestPolicies() = 0;

  using SetLocalTestPoliciesCallback = base::OnceCallback<void()>;
  using SetLocalTestPoliciesMojoCallback = base::OnceCallback<void()>;

  virtual void SetLocalTestPolicies(const std::string& policies, const std::string& profile_separation_response, SetLocalTestPoliciesCallback callback) = 0;

  using GetPolicyLogsCallback = base::OnceCallback<void(std::vector<LogPtr>)>;
  using GetPolicyLogsMojoCallback = base::OnceCallback<void(std::vector<LogPtr>)>;

  virtual void GetPolicyLogs(GetPolicyLogsCallback callback) = 0;

  using GetPoliciesJsonCallback = base::OnceCallback<void(const std::string&)>;
  using GetPoliciesJsonMojoCallback = base::OnceCallback<void(const std::string&)>;

  virtual void GetPoliciesJson(GetPoliciesReason reason, GetPoliciesJsonCallback callback) = 0;
};

class PolicyPageClientProxy;

template <typename ImplRefTraits>
class PolicyPageClientStub;

class PolicyPageClientRequestValidator;


class PolicyPageClient
    : public PolicyPageClientInterfaceBase {
 public:
  using IPCStableHashFunction = uint32_t(*)();
  static constexpr const char* Name_ = "policy.mojom.PolicyPageClient";
  static IPCStableHashFunction MessageToMethodInfo_(mojo::Message& message);
  static const char* MessageToMethodName_(mojo::Message& message);
  static constexpr uint32_t Version_ = 0;
  static constexpr bool PassesAssociatedKinds_ = false;
  static constexpr bool HasUninterruptableMethods_ = false;

  using Base_ = PolicyPageClientInterfaceBase;
  using Proxy_ = PolicyPageClientProxy;

  template <typename ImplRefTraits>
  using Stub_ = PolicyPageClientStub<ImplRefTraits>;

  using RequestValidator_ = PolicyPageClientRequestValidator;
  using ResponseValidator_ = mojo::PassThroughFilter;
  enum MethodMinVersions : uint32_t {
    kStatusUpdatedMinVersion = 0,
  };

// crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK
// with not having this data in traces there.
#if !BUILDFLAG(IS_FUCHSIA)
  struct StatusUpdated_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
#endif // !BUILDFLAG(IS_FUCHSIA)
  virtual ~PolicyPageClient() = default;

  virtual void StatusUpdated(base::flat_map<std::string, StatusPtr> status) = 0;
};

class PolicyPageHandlerFactoryProxy;

template <typename ImplRefTraits>
class PolicyPageHandlerFactoryStub;

class PolicyPageHandlerFactoryRequestValidator;


class PolicyPageHandlerFactory
    : public PolicyPageHandlerFactoryInterfaceBase {
 public:
  using IPCStableHashFunction = uint32_t(*)();
  static constexpr const char* Name_ = "policy.mojom.PolicyPageHandlerFactory";
  static IPCStableHashFunction MessageToMethodInfo_(mojo::Message& message);
  static const char* MessageToMethodName_(mojo::Message& message);
  static constexpr uint32_t Version_ = 0;
  static constexpr bool PassesAssociatedKinds_ = false;
  static constexpr bool HasUninterruptableMethods_ = false;

  using Base_ = PolicyPageHandlerFactoryInterfaceBase;
  using Proxy_ = PolicyPageHandlerFactoryProxy;

  template <typename ImplRefTraits>
  using Stub_ = PolicyPageHandlerFactoryStub<ImplRefTraits>;

  using RequestValidator_ = PolicyPageHandlerFactoryRequestValidator;
  using ResponseValidator_ = mojo::PassThroughFilter;
  enum MethodMinVersions : uint32_t {
    kCreateHandlerMinVersion = 0,
  };

// crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK
// with not having this data in traces there.
#if !BUILDFLAG(IS_FUCHSIA)
  struct CreateHandler_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
#endif // !BUILDFLAG(IS_FUCHSIA)
  virtual ~PolicyPageHandlerFactory() = default;

  virtual void CreateHandler(::mojo::PendingReceiver<PolicyPageHandler> handler, ::mojo::PendingRemote<PolicyPageClient> client) = 0;
};



class  PolicyPageHandlerProxy
    : public PolicyPageHandler {
 public:
  using InterfaceType = PolicyPageHandler;

  explicit PolicyPageHandlerProxy(mojo::MessageReceiverWithResponder* receiver);
  
  void GetDebugString(GetDebugStringCallback callback) final;
  
  void RestartBrowser(const std::string& policies) final;
  
  void SetUserAffiliated(bool affiliated, SetUserAffiliatedCallback callback) final;
  
  void GetAppliedTestPolicies(GetAppliedTestPoliciesCallback callback) final;
  
  void RevertLocalTestPolicies() final;
  
  void SetLocalTestPolicies(const std::string& policies, const std::string& profile_separation_response, SetLocalTestPoliciesCallback callback) final;
  
  void GetPolicyLogs(GetPolicyLogsCallback callback) final;
  
  void GetPoliciesJson(GetPoliciesReason reason, GetPoliciesJsonCallback callback) final;

 private:
  mojo::MessageReceiverWithResponder* receiver_;
};



class  PolicyPageClientProxy
    : public PolicyPageClient {
 public:
  using InterfaceType = PolicyPageClient;

  explicit PolicyPageClientProxy(mojo::MessageReceiverWithResponder* receiver);
  
  void StatusUpdated(base::flat_map<std::string, StatusPtr> status) final;

 private:
  mojo::MessageReceiverWithResponder* receiver_;
};



class  PolicyPageHandlerFactoryProxy
    : public PolicyPageHandlerFactory {
 public:
  using InterfaceType = PolicyPageHandlerFactory;

  explicit PolicyPageHandlerFactoryProxy(mojo::MessageReceiverWithResponder* receiver);
  
  void CreateHandler(::mojo::PendingReceiver<PolicyPageHandler> handler, ::mojo::PendingRemote<PolicyPageClient> client) final;

 private:
  mojo::MessageReceiverWithResponder* receiver_;
};
class  PolicyPageHandlerStubDispatch {
 public:
  static bool Accept(PolicyPageHandler* impl, mojo::Message* message);
  static bool AcceptWithResponder(
      PolicyPageHandler* impl,
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder);
};

template <typename ImplRefTraits =
              mojo::RawPtrImplRefTraits<PolicyPageHandler>>
class PolicyPageHandlerStub
    : public mojo::MessageReceiverWithResponderStatus {
 public:
  using ImplPointerType = typename ImplRefTraits::PointerType;

  PolicyPageHandlerStub() = default;
  ~PolicyPageHandlerStub() override = default;

  void set_sink(ImplPointerType sink) { sink_ = std::move(sink); }
  ImplPointerType& sink() { return sink_; }

  bool Accept(mojo::Message* message) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return PolicyPageHandlerStubDispatch::Accept(
        ImplRefTraits::GetRawPointer(&sink_), message);
  }

  bool AcceptWithResponder(
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return PolicyPageHandlerStubDispatch::AcceptWithResponder(
        ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder));
  }

 private:
  ImplPointerType sink_;
};
class  PolicyPageClientStubDispatch {
 public:
  static bool Accept(PolicyPageClient* impl, mojo::Message* message);
  static bool AcceptWithResponder(
      PolicyPageClient* impl,
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder);
};

template <typename ImplRefTraits =
              mojo::RawPtrImplRefTraits<PolicyPageClient>>
class PolicyPageClientStub
    : public mojo::MessageReceiverWithResponderStatus {
 public:
  using ImplPointerType = typename ImplRefTraits::PointerType;

  PolicyPageClientStub() = default;
  ~PolicyPageClientStub() override = default;

  void set_sink(ImplPointerType sink) { sink_ = std::move(sink); }
  ImplPointerType& sink() { return sink_; }

  bool Accept(mojo::Message* message) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return PolicyPageClientStubDispatch::Accept(
        ImplRefTraits::GetRawPointer(&sink_), message);
  }

  bool AcceptWithResponder(
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return PolicyPageClientStubDispatch::AcceptWithResponder(
        ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder));
  }

 private:
  ImplPointerType sink_;
};
class  PolicyPageHandlerFactoryStubDispatch {
 public:
  static bool Accept(PolicyPageHandlerFactory* impl, mojo::Message* message);
  static bool AcceptWithResponder(
      PolicyPageHandlerFactory* impl,
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder);
};

template <typename ImplRefTraits =
              mojo::RawPtrImplRefTraits<PolicyPageHandlerFactory>>
class PolicyPageHandlerFactoryStub
    : public mojo::MessageReceiverWithResponderStatus {
 public:
  using ImplPointerType = typename ImplRefTraits::PointerType;

  PolicyPageHandlerFactoryStub() = default;
  ~PolicyPageHandlerFactoryStub() override = default;

  void set_sink(ImplPointerType sink) { sink_ = std::move(sink); }
  ImplPointerType& sink() { return sink_; }

  bool Accept(mojo::Message* message) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return PolicyPageHandlerFactoryStubDispatch::Accept(
        ImplRefTraits::GetRawPointer(&sink_), message);
  }

  bool AcceptWithResponder(
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return PolicyPageHandlerFactoryStubDispatch::AcceptWithResponder(
        ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder));
  }

 private:
  ImplPointerType sink_;
};
class  PolicyPageHandlerRequestValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};
class  PolicyPageClientRequestValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};
class  PolicyPageHandlerFactoryRequestValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};
class  PolicyPageHandlerResponseValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};













class  Log {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<Log, T>::value>;
  using DataView = LogDataView;
  using Data_ = internal::Log_Data;

  template <typename... Args>
  static LogPtr New(Args&&... args) {
    return LogPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static LogPtr From(const U& u) {
    return mojo::TypeConverter<LogPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, Log>::Convert(*this);
  }


  Log();

  Log(
      const std::string& message,
      const std::string& log_severity,
      const std::string& log_source,
      const std::string& file_and_line,
      const std::string& location,
      const std::string& timestamp);


  ~Log();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = LogPtr>
  LogPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, Log::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, Log::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, Log::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }
  size_t Hash(size_t seed) const;

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        Log::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        Log::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        Log::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::Log_UnserializedMessageContext<
            UserType, Log::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<Log::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return Log::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::Log_UnserializedMessageContext<
            UserType, Log::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<Log::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::string message;
  
  std::string log_severity;
  
  std::string log_source;
  
  std::string file_and_line;
  
  std::string location;
  
  std::string timestamp;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, Log::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, Log::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, Log::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, Log::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class  Status {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<Status, T>::value>;
  using DataView = StatusDataView;
  using Data_ = internal::Status_Data;

  template <typename... Args>
  static StatusPtr New(Args&&... args) {
    return StatusPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static StatusPtr From(const U& u) {
    return mojo::TypeConverter<StatusPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, Status>::Convert(*this);
  }


  Status();

  Status(
      const std::string& policy_description_key,
      bool flex_org_warning,
      const std::optional<std::string>& asset_id,
      const std::optional<std::string>& location,
      const std::optional<std::string>& directory_api_id,
      const std::string& client_id,
      std::optional<bool> is_off_hours_active,
      const std::string& device_id,
      const std::string& enrollment_token,
      const std::string& domain,
      const std::optional<std::string>& machine,
      const std::optional<std::string>& version,
      const std::optional<std::string>& username,
      const std::optional<std::string>& gaia_id,
      const std::optional<std::string>& profile_id,
      const std::string& status,
      const std::string& extension_install_status,
      const std::optional<std::string>& refresh_interval,
      const std::optional<std::string>& time_since_last_refresh,
      const std::optional<std::string>& time_since_last_fetch_attempt,
      const std::optional<std::string>& extension_install_time_since_last_refresh,
      const std::optional<std::string>& extension_install_time_since_last_fetch_attempt,
      const std::optional<std::string>& last_cloud_report_sent_timestamp,
      const std::optional<std::string>& time_since_last_cloud_report_sent,
      const std::optional<std::string>& enterprise_domain_manager,
      std::optional<bool> is_affiliated,
      bool policies_push_available,
      bool error,
      bool extension_install_error);


  ~Status();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = StatusPtr>
  StatusPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, Status::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, Status::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, Status::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        Status::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        Status::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        Status::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::Status_UnserializedMessageContext<
            UserType, Status::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<Status::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return Status::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::Status_UnserializedMessageContext<
            UserType, Status::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<Status::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::string policy_description_key;
  
  bool flex_org_warning;
  
  std::optional<std::string> asset_id;
  
  std::optional<std::string> location;
  
  std::optional<std::string> directory_api_id;
  
  std::string client_id;
  
  std::optional<bool> is_off_hours_active;
  
  std::string device_id;
  
  std::string enrollment_token;
  
  std::string domain;
  
  std::optional<std::string> machine;
  
  std::optional<std::string> version;
  
  std::optional<std::string> username;
  
  std::optional<std::string> gaia_id;
  
  std::optional<std::string> profile_id;
  
  std::string status;
  
  std::string extension_install_status;
  
  std::optional<std::string> refresh_interval;
  
  std::optional<std::string> time_since_last_refresh;
  
  std::optional<std::string> time_since_last_fetch_attempt;
  
  std::optional<std::string> extension_install_time_since_last_refresh;
  
  std::optional<std::string> extension_install_time_since_last_fetch_attempt;
  
  std::optional<std::string> last_cloud_report_sent_timestamp;
  
  std::optional<std::string> time_since_last_cloud_report_sent;
  
  std::optional<std::string> enterprise_domain_manager;
  
  std::optional<bool> is_affiliated;
  
  bool policies_push_available;
  
  bool error;
  
  bool extension_install_error;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, Status::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, Status::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, Status::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, Status::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class  Conflict {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<Conflict, T>::value>;
  using DataView = ConflictDataView;
  using Data_ = internal::Conflict_Data;

  template <typename... Args>
  static ConflictPtr New(Args&&... args) {
    return ConflictPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static ConflictPtr From(const U& u) {
    return mojo::TypeConverter<ConflictPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, Conflict>::Convert(*this);
  }


  Conflict();

  Conflict(
      const std::string& level,
      const std::string& scope,
      const std::string& source,
      std::optional<::base::Value> value);

Conflict(const Conflict&) = delete;
Conflict& operator=(const Conflict&) = delete;

  ~Conflict();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = ConflictPtr>
  ConflictPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, Conflict::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, Conflict::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, Conflict::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        Conflict::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        Conflict::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        Conflict::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::Conflict_UnserializedMessageContext<
            UserType, Conflict::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<Conflict::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return Conflict::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::Conflict_UnserializedMessageContext<
            UserType, Conflict::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<Conflict::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::string level;
  
  std::string scope;
  
  std::string source;
  
  std::optional<::base::Value> value;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, Conflict::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, Conflict::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, Conflict::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, Conflict::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class  Policy {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<Policy, T>::value>;
  using DataView = PolicyDataView;
  using Data_ = internal::Policy_Data;

  template <typename... Args>
  static PolicyPtr New(Args&&... args) {
    return PolicyPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static PolicyPtr From(const U& u) {
    return mojo::TypeConverter<PolicyPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, Policy>::Convert(*this);
  }


  Policy();

  Policy(
      bool ignored,
      const std::string& name,
      const std::string& level,
      const std::string& scope,
      const std::string& source,
      ::base::Value value,
      bool restart_required,
      bool deprecated,
      bool future,
      std::optional<bool> all_sources_merged,
      std::vector<ConflictPtr> conflicts,
      std::vector<ConflictPtr> superseded,
      const std::string& error,
      const std::string& warning,
      const std::string& info);

Policy(const Policy&) = delete;
Policy& operator=(const Policy&) = delete;

  ~Policy();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = PolicyPtr>
  PolicyPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, Policy::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, Policy::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, Policy::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        Policy::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        Policy::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        Policy::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::Policy_UnserializedMessageContext<
            UserType, Policy::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<Policy::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return Policy::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::Policy_UnserializedMessageContext<
            UserType, Policy::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<Policy::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  bool ignored;
  
  std::string name;
  
  std::string level;
  
  std::string scope;
  
  std::string source;
  
  ::base::Value value;
  
  bool restart_required;
  
  bool deprecated;
  
  bool future;
  
  std::optional<bool> all_sources_merged;
  
  std::vector<ConflictPtr> conflicts;
  
  std::vector<ConflictPtr> superseded;
  
  std::string error;
  
  std::string warning;
  
  std::string info;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, Policy::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, Policy::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, Policy::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, Policy::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class  PolicyGroup {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<PolicyGroup, T>::value>;
  using DataView = PolicyGroupDataView;
  using Data_ = internal::PolicyGroup_Data;

  template <typename... Args>
  static PolicyGroupPtr New(Args&&... args) {
    return PolicyGroupPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static PolicyGroupPtr From(const U& u) {
    return mojo::TypeConverter<PolicyGroupPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, PolicyGroup>::Convert(*this);
  }


  PolicyGroup();

  PolicyGroup(
      const std::string& name,
      base::flat_map<std::string, PolicyPtr> policies,
      std::optional<std::vector<std::string>> precedence_order,
      bool is_extension,
      bool for_signin_screen);

PolicyGroup(const PolicyGroup&) = delete;
PolicyGroup& operator=(const PolicyGroup&) = delete;

  ~PolicyGroup();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = PolicyGroupPtr>
  PolicyGroupPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, PolicyGroup::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, PolicyGroup::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, PolicyGroup::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        PolicyGroup::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        PolicyGroup::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        PolicyGroup::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::PolicyGroup_UnserializedMessageContext<
            UserType, PolicyGroup::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<PolicyGroup::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return PolicyGroup::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::PolicyGroup_UnserializedMessageContext<
            UserType, PolicyGroup::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<PolicyGroup::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::string name;
  
  base::flat_map<std::string, PolicyPtr> policies;
  
  std::optional<std::vector<std::string>> precedence_order;
  
  bool is_extension;
  
  bool for_signin_screen;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, PolicyGroup::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, PolicyGroup::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, PolicyGroup::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, PolicyGroup::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class  PolicyGroupsResponse {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<PolicyGroupsResponse, T>::value>;
  using DataView = PolicyGroupsResponseDataView;
  using Data_ = internal::PolicyGroupsResponse_Data;

  template <typename... Args>
  static PolicyGroupsResponsePtr New(Args&&... args) {
    return PolicyGroupsResponsePtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static PolicyGroupsResponsePtr From(const U& u) {
    return mojo::TypeConverter<PolicyGroupsResponsePtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, PolicyGroupsResponse>::Convert(*this);
  }


  PolicyGroupsResponse();

  PolicyGroupsResponse(
      std::vector<std::string> policy_ids_presentation_order,
      base::flat_map<std::string, PolicyGroupPtr> policy_groups);

PolicyGroupsResponse(const PolicyGroupsResponse&) = delete;
PolicyGroupsResponse& operator=(const PolicyGroupsResponse&) = delete;

  ~PolicyGroupsResponse();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = PolicyGroupsResponsePtr>
  PolicyGroupsResponsePtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, PolicyGroupsResponse::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, PolicyGroupsResponse::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, PolicyGroupsResponse::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        PolicyGroupsResponse::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        PolicyGroupsResponse::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        PolicyGroupsResponse::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::PolicyGroupsResponse_UnserializedMessageContext<
            UserType, PolicyGroupsResponse::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<PolicyGroupsResponse::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return PolicyGroupsResponse::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::PolicyGroupsResponse_UnserializedMessageContext<
            UserType, PolicyGroupsResponse::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<PolicyGroupsResponse::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::vector<std::string> policy_ids_presentation_order;
  
  base::flat_map<std::string, PolicyGroupPtr> policy_groups;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, PolicyGroupsResponse::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, PolicyGroupsResponse::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, PolicyGroupsResponse::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, PolicyGroupsResponse::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}

template <typename StructPtrType>
LogPtr Log::Clone() const {
  return New(
      mojo::Clone(message),
      mojo::Clone(log_severity),
      mojo::Clone(log_source),
      mojo::Clone(file_and_line),
      mojo::Clone(location),
      mojo::Clone(timestamp)
  );
}

template <typename T, Log::EnableIfSame<T>*>
bool Log::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->message, other_struct.message))
    return false;
  if (!mojo::Equals(this->log_severity, other_struct.log_severity))
    return false;
  if (!mojo::Equals(this->log_source, other_struct.log_source))
    return false;
  if (!mojo::Equals(this->file_and_line, other_struct.file_and_line))
    return false;
  if (!mojo::Equals(this->location, other_struct.location))
    return false;
  if (!mojo::Equals(this->timestamp, other_struct.timestamp))
    return false;
  return true;
}

template <typename T, Log::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.message < rhs.message)
    return true;
  if (rhs.message < lhs.message)
    return false;
  if (lhs.log_severity < rhs.log_severity)
    return true;
  if (rhs.log_severity < lhs.log_severity)
    return false;
  if (lhs.log_source < rhs.log_source)
    return true;
  if (rhs.log_source < lhs.log_source)
    return false;
  if (lhs.file_and_line < rhs.file_and_line)
    return true;
  if (rhs.file_and_line < lhs.file_and_line)
    return false;
  if (lhs.location < rhs.location)
    return true;
  if (rhs.location < lhs.location)
    return false;
  if (lhs.timestamp < rhs.timestamp)
    return true;
  if (rhs.timestamp < lhs.timestamp)
    return false;
  return false;
}
template <typename StructPtrType>
StatusPtr Status::Clone() const {
  return New(
      mojo::Clone(policy_description_key),
      mojo::Clone(flex_org_warning),
      mojo::Clone(asset_id),
      mojo::Clone(location),
      mojo::Clone(directory_api_id),
      mojo::Clone(client_id),
      mojo::Clone(is_off_hours_active),
      mojo::Clone(device_id),
      mojo::Clone(enrollment_token),
      mojo::Clone(domain),
      mojo::Clone(machine),
      mojo::Clone(version),
      mojo::Clone(username),
      mojo::Clone(gaia_id),
      mojo::Clone(profile_id),
      mojo::Clone(status),
      mojo::Clone(extension_install_status),
      mojo::Clone(refresh_interval),
      mojo::Clone(time_since_last_refresh),
      mojo::Clone(time_since_last_fetch_attempt),
      mojo::Clone(extension_install_time_since_last_refresh),
      mojo::Clone(extension_install_time_since_last_fetch_attempt),
      mojo::Clone(last_cloud_report_sent_timestamp),
      mojo::Clone(time_since_last_cloud_report_sent),
      mojo::Clone(enterprise_domain_manager),
      mojo::Clone(is_affiliated),
      mojo::Clone(policies_push_available),
      mojo::Clone(error),
      mojo::Clone(extension_install_error)
  );
}

template <typename T, Status::EnableIfSame<T>*>
bool Status::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->policy_description_key, other_struct.policy_description_key))
    return false;
  if (!mojo::Equals(this->flex_org_warning, other_struct.flex_org_warning))
    return false;
  if (!mojo::Equals(this->asset_id, other_struct.asset_id))
    return false;
  if (!mojo::Equals(this->location, other_struct.location))
    return false;
  if (!mojo::Equals(this->directory_api_id, other_struct.directory_api_id))
    return false;
  if (!mojo::Equals(this->client_id, other_struct.client_id))
    return false;
  if (!mojo::Equals(this->is_off_hours_active, other_struct.is_off_hours_active))
    return false;
  if (!mojo::Equals(this->device_id, other_struct.device_id))
    return false;
  if (!mojo::Equals(this->enrollment_token, other_struct.enrollment_token))
    return false;
  if (!mojo::Equals(this->domain, other_struct.domain))
    return false;
  if (!mojo::Equals(this->machine, other_struct.machine))
    return false;
  if (!mojo::Equals(this->version, other_struct.version))
    return false;
  if (!mojo::Equals(this->username, other_struct.username))
    return false;
  if (!mojo::Equals(this->gaia_id, other_struct.gaia_id))
    return false;
  if (!mojo::Equals(this->profile_id, other_struct.profile_id))
    return false;
  if (!mojo::Equals(this->status, other_struct.status))
    return false;
  if (!mojo::Equals(this->extension_install_status, other_struct.extension_install_status))
    return false;
  if (!mojo::Equals(this->refresh_interval, other_struct.refresh_interval))
    return false;
  if (!mojo::Equals(this->time_since_last_refresh, other_struct.time_since_last_refresh))
    return false;
  if (!mojo::Equals(this->time_since_last_fetch_attempt, other_struct.time_since_last_fetch_attempt))
    return false;
  if (!mojo::Equals(this->extension_install_time_since_last_refresh, other_struct.extension_install_time_since_last_refresh))
    return false;
  if (!mojo::Equals(this->extension_install_time_since_last_fetch_attempt, other_struct.extension_install_time_since_last_fetch_attempt))
    return false;
  if (!mojo::Equals(this->last_cloud_report_sent_timestamp, other_struct.last_cloud_report_sent_timestamp))
    return false;
  if (!mojo::Equals(this->time_since_last_cloud_report_sent, other_struct.time_since_last_cloud_report_sent))
    return false;
  if (!mojo::Equals(this->enterprise_domain_manager, other_struct.enterprise_domain_manager))
    return false;
  if (!mojo::Equals(this->is_affiliated, other_struct.is_affiliated))
    return false;
  if (!mojo::Equals(this->policies_push_available, other_struct.policies_push_available))
    return false;
  if (!mojo::Equals(this->error, other_struct.error))
    return false;
  if (!mojo::Equals(this->extension_install_error, other_struct.extension_install_error))
    return false;
  return true;
}

template <typename T, Status::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.policy_description_key < rhs.policy_description_key)
    return true;
  if (rhs.policy_description_key < lhs.policy_description_key)
    return false;
  if (lhs.flex_org_warning < rhs.flex_org_warning)
    return true;
  if (rhs.flex_org_warning < lhs.flex_org_warning)
    return false;
  if (lhs.asset_id < rhs.asset_id)
    return true;
  if (rhs.asset_id < lhs.asset_id)
    return false;
  if (lhs.location < rhs.location)
    return true;
  if (rhs.location < lhs.location)
    return false;
  if (lhs.directory_api_id < rhs.directory_api_id)
    return true;
  if (rhs.directory_api_id < lhs.directory_api_id)
    return false;
  if (lhs.client_id < rhs.client_id)
    return true;
  if (rhs.client_id < lhs.client_id)
    return false;
  if (lhs.is_off_hours_active < rhs.is_off_hours_active)
    return true;
  if (rhs.is_off_hours_active < lhs.is_off_hours_active)
    return false;
  if (lhs.device_id < rhs.device_id)
    return true;
  if (rhs.device_id < lhs.device_id)
    return false;
  if (lhs.enrollment_token < rhs.enrollment_token)
    return true;
  if (rhs.enrollment_token < lhs.enrollment_token)
    return false;
  if (lhs.domain < rhs.domain)
    return true;
  if (rhs.domain < lhs.domain)
    return false;
  if (lhs.machine < rhs.machine)
    return true;
  if (rhs.machine < lhs.machine)
    return false;
  if (lhs.version < rhs.version)
    return true;
  if (rhs.version < lhs.version)
    return false;
  if (lhs.username < rhs.username)
    return true;
  if (rhs.username < lhs.username)
    return false;
  if (lhs.gaia_id < rhs.gaia_id)
    return true;
  if (rhs.gaia_id < lhs.gaia_id)
    return false;
  if (lhs.profile_id < rhs.profile_id)
    return true;
  if (rhs.profile_id < lhs.profile_id)
    return false;
  if (lhs.status < rhs.status)
    return true;
  if (rhs.status < lhs.status)
    return false;
  if (lhs.extension_install_status < rhs.extension_install_status)
    return true;
  if (rhs.extension_install_status < lhs.extension_install_status)
    return false;
  if (lhs.refresh_interval < rhs.refresh_interval)
    return true;
  if (rhs.refresh_interval < lhs.refresh_interval)
    return false;
  if (lhs.time_since_last_refresh < rhs.time_since_last_refresh)
    return true;
  if (rhs.time_since_last_refresh < lhs.time_since_last_refresh)
    return false;
  if (lhs.time_since_last_fetch_attempt < rhs.time_since_last_fetch_attempt)
    return true;
  if (rhs.time_since_last_fetch_attempt < lhs.time_since_last_fetch_attempt)
    return false;
  if (lhs.extension_install_time_since_last_refresh < rhs.extension_install_time_since_last_refresh)
    return true;
  if (rhs.extension_install_time_since_last_refresh < lhs.extension_install_time_since_last_refresh)
    return false;
  if (lhs.extension_install_time_since_last_fetch_attempt < rhs.extension_install_time_since_last_fetch_attempt)
    return true;
  if (rhs.extension_install_time_since_last_fetch_attempt < lhs.extension_install_time_since_last_fetch_attempt)
    return false;
  if (lhs.last_cloud_report_sent_timestamp < rhs.last_cloud_report_sent_timestamp)
    return true;
  if (rhs.last_cloud_report_sent_timestamp < lhs.last_cloud_report_sent_timestamp)
    return false;
  if (lhs.time_since_last_cloud_report_sent < rhs.time_since_last_cloud_report_sent)
    return true;
  if (rhs.time_since_last_cloud_report_sent < lhs.time_since_last_cloud_report_sent)
    return false;
  if (lhs.enterprise_domain_manager < rhs.enterprise_domain_manager)
    return true;
  if (rhs.enterprise_domain_manager < lhs.enterprise_domain_manager)
    return false;
  if (lhs.is_affiliated < rhs.is_affiliated)
    return true;
  if (rhs.is_affiliated < lhs.is_affiliated)
    return false;
  if (lhs.policies_push_available < rhs.policies_push_available)
    return true;
  if (rhs.policies_push_available < lhs.policies_push_available)
    return false;
  if (lhs.error < rhs.error)
    return true;
  if (rhs.error < lhs.error)
    return false;
  if (lhs.extension_install_error < rhs.extension_install_error)
    return true;
  if (rhs.extension_install_error < lhs.extension_install_error)
    return false;
  return false;
}
template <typename StructPtrType>
ConflictPtr Conflict::Clone() const {
  return New(
      mojo::Clone(level),
      mojo::Clone(scope),
      mojo::Clone(source),
      mojo::Clone(value)
  );
}

template <typename T, Conflict::EnableIfSame<T>*>
bool Conflict::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->level, other_struct.level))
    return false;
  if (!mojo::Equals(this->scope, other_struct.scope))
    return false;
  if (!mojo::Equals(this->source, other_struct.source))
    return false;
  if (!mojo::Equals(this->value, other_struct.value))
    return false;
  return true;
}

template <typename T, Conflict::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.level < rhs.level)
    return true;
  if (rhs.level < lhs.level)
    return false;
  if (lhs.scope < rhs.scope)
    return true;
  if (rhs.scope < lhs.scope)
    return false;
  if (lhs.source < rhs.source)
    return true;
  if (rhs.source < lhs.source)
    return false;
  if (lhs.value < rhs.value)
    return true;
  if (rhs.value < lhs.value)
    return false;
  return false;
}
template <typename StructPtrType>
PolicyPtr Policy::Clone() const {
  return New(
      mojo::Clone(ignored),
      mojo::Clone(name),
      mojo::Clone(level),
      mojo::Clone(scope),
      mojo::Clone(source),
      mojo::Clone(value),
      mojo::Clone(restart_required),
      mojo::Clone(deprecated),
      mojo::Clone(future),
      mojo::Clone(all_sources_merged),
      mojo::Clone(conflicts),
      mojo::Clone(superseded),
      mojo::Clone(error),
      mojo::Clone(warning),
      mojo::Clone(info)
  );
}

template <typename T, Policy::EnableIfSame<T>*>
bool Policy::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->ignored, other_struct.ignored))
    return false;
  if (!mojo::Equals(this->name, other_struct.name))
    return false;
  if (!mojo::Equals(this->level, other_struct.level))
    return false;
  if (!mojo::Equals(this->scope, other_struct.scope))
    return false;
  if (!mojo::Equals(this->source, other_struct.source))
    return false;
  if (!mojo::Equals(this->value, other_struct.value))
    return false;
  if (!mojo::Equals(this->restart_required, other_struct.restart_required))
    return false;
  if (!mojo::Equals(this->deprecated, other_struct.deprecated))
    return false;
  if (!mojo::Equals(this->future, other_struct.future))
    return false;
  if (!mojo::Equals(this->all_sources_merged, other_struct.all_sources_merged))
    return false;
  if (!mojo::Equals(this->conflicts, other_struct.conflicts))
    return false;
  if (!mojo::Equals(this->superseded, other_struct.superseded))
    return false;
  if (!mojo::Equals(this->error, other_struct.error))
    return false;
  if (!mojo::Equals(this->warning, other_struct.warning))
    return false;
  if (!mojo::Equals(this->info, other_struct.info))
    return false;
  return true;
}

template <typename T, Policy::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.ignored < rhs.ignored)
    return true;
  if (rhs.ignored < lhs.ignored)
    return false;
  if (lhs.name < rhs.name)
    return true;
  if (rhs.name < lhs.name)
    return false;
  if (lhs.level < rhs.level)
    return true;
  if (rhs.level < lhs.level)
    return false;
  if (lhs.scope < rhs.scope)
    return true;
  if (rhs.scope < lhs.scope)
    return false;
  if (lhs.source < rhs.source)
    return true;
  if (rhs.source < lhs.source)
    return false;
  if (lhs.value < rhs.value)
    return true;
  if (rhs.value < lhs.value)
    return false;
  if (lhs.restart_required < rhs.restart_required)
    return true;
  if (rhs.restart_required < lhs.restart_required)
    return false;
  if (lhs.deprecated < rhs.deprecated)
    return true;
  if (rhs.deprecated < lhs.deprecated)
    return false;
  if (lhs.future < rhs.future)
    return true;
  if (rhs.future < lhs.future)
    return false;
  if (lhs.all_sources_merged < rhs.all_sources_merged)
    return true;
  if (rhs.all_sources_merged < lhs.all_sources_merged)
    return false;
  if (lhs.conflicts < rhs.conflicts)
    return true;
  if (rhs.conflicts < lhs.conflicts)
    return false;
  if (lhs.superseded < rhs.superseded)
    return true;
  if (rhs.superseded < lhs.superseded)
    return false;
  if (lhs.error < rhs.error)
    return true;
  if (rhs.error < lhs.error)
    return false;
  if (lhs.warning < rhs.warning)
    return true;
  if (rhs.warning < lhs.warning)
    return false;
  if (lhs.info < rhs.info)
    return true;
  if (rhs.info < lhs.info)
    return false;
  return false;
}
template <typename StructPtrType>
PolicyGroupPtr PolicyGroup::Clone() const {
  return New(
      mojo::Clone(name),
      mojo::Clone(policies),
      mojo::Clone(precedence_order),
      mojo::Clone(is_extension),
      mojo::Clone(for_signin_screen)
  );
}

template <typename T, PolicyGroup::EnableIfSame<T>*>
bool PolicyGroup::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->name, other_struct.name))
    return false;
  if (!mojo::Equals(this->policies, other_struct.policies))
    return false;
  if (!mojo::Equals(this->precedence_order, other_struct.precedence_order))
    return false;
  if (!mojo::Equals(this->is_extension, other_struct.is_extension))
    return false;
  if (!mojo::Equals(this->for_signin_screen, other_struct.for_signin_screen))
    return false;
  return true;
}

template <typename T, PolicyGroup::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.name < rhs.name)
    return true;
  if (rhs.name < lhs.name)
    return false;
  if (lhs.policies < rhs.policies)
    return true;
  if (rhs.policies < lhs.policies)
    return false;
  if (lhs.precedence_order < rhs.precedence_order)
    return true;
  if (rhs.precedence_order < lhs.precedence_order)
    return false;
  if (lhs.is_extension < rhs.is_extension)
    return true;
  if (rhs.is_extension < lhs.is_extension)
    return false;
  if (lhs.for_signin_screen < rhs.for_signin_screen)
    return true;
  if (rhs.for_signin_screen < lhs.for_signin_screen)
    return false;
  return false;
}
template <typename StructPtrType>
PolicyGroupsResponsePtr PolicyGroupsResponse::Clone() const {
  return New(
      mojo::Clone(policy_ids_presentation_order),
      mojo::Clone(policy_groups)
  );
}

template <typename T, PolicyGroupsResponse::EnableIfSame<T>*>
bool PolicyGroupsResponse::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->policy_ids_presentation_order, other_struct.policy_ids_presentation_order))
    return false;
  if (!mojo::Equals(this->policy_groups, other_struct.policy_groups))
    return false;
  return true;
}

template <typename T, PolicyGroupsResponse::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.policy_ids_presentation_order < rhs.policy_ids_presentation_order)
    return true;
  if (rhs.policy_ids_presentation_order < lhs.policy_ids_presentation_order)
    return false;
  if (lhs.policy_groups < rhs.policy_groups)
    return true;
  if (rhs.policy_groups < lhs.policy_groups)
    return false;
  return false;
}


}  // policy::mojom

namespace mojo {


template <>
struct  StructTraits<::policy::mojom::Log::DataView,
                                         ::policy::mojom::LogPtr> {
  static bool IsNull(const ::policy::mojom::LogPtr& input) { return !input; }
  static void SetToNull(::policy::mojom::LogPtr* output) { output->reset(); }

  static const decltype(::policy::mojom::Log::message)& message(
      const ::policy::mojom::LogPtr& input) {
    return input->message;
  }

  static const decltype(::policy::mojom::Log::log_severity)& log_severity(
      const ::policy::mojom::LogPtr& input) {
    return input->log_severity;
  }

  static const decltype(::policy::mojom::Log::log_source)& log_source(
      const ::policy::mojom::LogPtr& input) {
    return input->log_source;
  }

  static const decltype(::policy::mojom::Log::file_and_line)& file_and_line(
      const ::policy::mojom::LogPtr& input) {
    return input->file_and_line;
  }

  static const decltype(::policy::mojom::Log::location)& location(
      const ::policy::mojom::LogPtr& input) {
    return input->location;
  }

  static const decltype(::policy::mojom::Log::timestamp)& timestamp(
      const ::policy::mojom::LogPtr& input) {
    return input->timestamp;
  }

  static bool Read(::policy::mojom::Log::DataView input, ::policy::mojom::LogPtr* output);
};


template <>
struct  StructTraits<::policy::mojom::Status::DataView,
                                         ::policy::mojom::StatusPtr> {
  static bool IsNull(const ::policy::mojom::StatusPtr& input) { return !input; }
  static void SetToNull(::policy::mojom::StatusPtr* output) { output->reset(); }

  static const decltype(::policy::mojom::Status::policy_description_key)& policy_description_key(
      const ::policy::mojom::StatusPtr& input) {
    return input->policy_description_key;
  }

  static decltype(::policy::mojom::Status::flex_org_warning) flex_org_warning(
      const ::policy::mojom::StatusPtr& input) {
    return input->flex_org_warning;
  }

  static const decltype(::policy::mojom::Status::asset_id)& asset_id(
      const ::policy::mojom::StatusPtr& input) {
    return input->asset_id;
  }

  static const decltype(::policy::mojom::Status::location)& location(
      const ::policy::mojom::StatusPtr& input) {
    return input->location;
  }

  static const decltype(::policy::mojom::Status::directory_api_id)& directory_api_id(
      const ::policy::mojom::StatusPtr& input) {
    return input->directory_api_id;
  }

  static const decltype(::policy::mojom::Status::client_id)& client_id(
      const ::policy::mojom::StatusPtr& input) {
    return input->client_id;
  }

  static decltype(::policy::mojom::Status::is_off_hours_active) is_off_hours_active(
      const ::policy::mojom::StatusPtr& input) {
    return input->is_off_hours_active;
  }

  static const decltype(::policy::mojom::Status::device_id)& device_id(
      const ::policy::mojom::StatusPtr& input) {
    return input->device_id;
  }

  static const decltype(::policy::mojom::Status::enrollment_token)& enrollment_token(
      const ::policy::mojom::StatusPtr& input) {
    return input->enrollment_token;
  }

  static const decltype(::policy::mojom::Status::domain)& domain(
      const ::policy::mojom::StatusPtr& input) {
    return input->domain;
  }

  static const decltype(::policy::mojom::Status::machine)& machine(
      const ::policy::mojom::StatusPtr& input) {
    return input->machine;
  }

  static const decltype(::policy::mojom::Status::version)& version(
      const ::policy::mojom::StatusPtr& input) {
    return input->version;
  }

  static const decltype(::policy::mojom::Status::username)& username(
      const ::policy::mojom::StatusPtr& input) {
    return input->username;
  }

  static const decltype(::policy::mojom::Status::gaia_id)& gaia_id(
      const ::policy::mojom::StatusPtr& input) {
    return input->gaia_id;
  }

  static const decltype(::policy::mojom::Status::profile_id)& profile_id(
      const ::policy::mojom::StatusPtr& input) {
    return input->profile_id;
  }

  static const decltype(::policy::mojom::Status::status)& status(
      const ::policy::mojom::StatusPtr& input) {
    return input->status;
  }

  static const decltype(::policy::mojom::Status::extension_install_status)& extension_install_status(
      const ::policy::mojom::StatusPtr& input) {
    return input->extension_install_status;
  }

  static const decltype(::policy::mojom::Status::refresh_interval)& refresh_interval(
      const ::policy::mojom::StatusPtr& input) {
    return input->refresh_interval;
  }

  static const decltype(::policy::mojom::Status::time_since_last_refresh)& time_since_last_refresh(
      const ::policy::mojom::StatusPtr& input) {
    return input->time_since_last_refresh;
  }

  static const decltype(::policy::mojom::Status::time_since_last_fetch_attempt)& time_since_last_fetch_attempt(
      const ::policy::mojom::StatusPtr& input) {
    return input->time_since_last_fetch_attempt;
  }

  static const decltype(::policy::mojom::Status::extension_install_time_since_last_refresh)& extension_install_time_since_last_refresh(
      const ::policy::mojom::StatusPtr& input) {
    return input->extension_install_time_since_last_refresh;
  }

  static const decltype(::policy::mojom::Status::extension_install_time_since_last_fetch_attempt)& extension_install_time_since_last_fetch_attempt(
      const ::policy::mojom::StatusPtr& input) {
    return input->extension_install_time_since_last_fetch_attempt;
  }

  static const decltype(::policy::mojom::Status::last_cloud_report_sent_timestamp)& last_cloud_report_sent_timestamp(
      const ::policy::mojom::StatusPtr& input) {
    return input->last_cloud_report_sent_timestamp;
  }

  static const decltype(::policy::mojom::Status::time_since_last_cloud_report_sent)& time_since_last_cloud_report_sent(
      const ::policy::mojom::StatusPtr& input) {
    return input->time_since_last_cloud_report_sent;
  }

  static const decltype(::policy::mojom::Status::enterprise_domain_manager)& enterprise_domain_manager(
      const ::policy::mojom::StatusPtr& input) {
    return input->enterprise_domain_manager;
  }

  static decltype(::policy::mojom::Status::is_affiliated) is_affiliated(
      const ::policy::mojom::StatusPtr& input) {
    return input->is_affiliated;
  }

  static decltype(::policy::mojom::Status::policies_push_available) policies_push_available(
      const ::policy::mojom::StatusPtr& input) {
    return input->policies_push_available;
  }

  static decltype(::policy::mojom::Status::error) error(
      const ::policy::mojom::StatusPtr& input) {
    return input->error;
  }

  static decltype(::policy::mojom::Status::extension_install_error) extension_install_error(
      const ::policy::mojom::StatusPtr& input) {
    return input->extension_install_error;
  }

  static bool Read(::policy::mojom::Status::DataView input, ::policy::mojom::StatusPtr* output);
};


template <>
struct  StructTraits<::policy::mojom::Conflict::DataView,
                                         ::policy::mojom::ConflictPtr> {
  static bool IsNull(const ::policy::mojom::ConflictPtr& input) { return !input; }
  static void SetToNull(::policy::mojom::ConflictPtr* output) { output->reset(); }

  static const decltype(::policy::mojom::Conflict::level)& level(
      const ::policy::mojom::ConflictPtr& input) {
    return input->level;
  }

  static const decltype(::policy::mojom::Conflict::scope)& scope(
      const ::policy::mojom::ConflictPtr& input) {
    return input->scope;
  }

  static const decltype(::policy::mojom::Conflict::source)& source(
      const ::policy::mojom::ConflictPtr& input) {
    return input->source;
  }

  static const decltype(::policy::mojom::Conflict::value)& value(
      const ::policy::mojom::ConflictPtr& input) {
    return input->value;
  }

  static bool Read(::policy::mojom::Conflict::DataView input, ::policy::mojom::ConflictPtr* output);
};


template <>
struct  StructTraits<::policy::mojom::Policy::DataView,
                                         ::policy::mojom::PolicyPtr> {
  static bool IsNull(const ::policy::mojom::PolicyPtr& input) { return !input; }
  static void SetToNull(::policy::mojom::PolicyPtr* output) { output->reset(); }

  static decltype(::policy::mojom::Policy::ignored) ignored(
      const ::policy::mojom::PolicyPtr& input) {
    return input->ignored;
  }

  static const decltype(::policy::mojom::Policy::name)& name(
      const ::policy::mojom::PolicyPtr& input) {
    return input->name;
  }

  static const decltype(::policy::mojom::Policy::level)& level(
      const ::policy::mojom::PolicyPtr& input) {
    return input->level;
  }

  static const decltype(::policy::mojom::Policy::scope)& scope(
      const ::policy::mojom::PolicyPtr& input) {
    return input->scope;
  }

  static const decltype(::policy::mojom::Policy::source)& source(
      const ::policy::mojom::PolicyPtr& input) {
    return input->source;
  }

  static const decltype(::policy::mojom::Policy::value)& value(
      const ::policy::mojom::PolicyPtr& input) {
    return input->value;
  }

  static decltype(::policy::mojom::Policy::restart_required) restart_required(
      const ::policy::mojom::PolicyPtr& input) {
    return input->restart_required;
  }

  static decltype(::policy::mojom::Policy::deprecated) deprecated(
      const ::policy::mojom::PolicyPtr& input) {
    return input->deprecated;
  }

  static decltype(::policy::mojom::Policy::future) future(
      const ::policy::mojom::PolicyPtr& input) {
    return input->future;
  }

  static decltype(::policy::mojom::Policy::all_sources_merged) all_sources_merged(
      const ::policy::mojom::PolicyPtr& input) {
    return input->all_sources_merged;
  }

  static const decltype(::policy::mojom::Policy::conflicts)& conflicts(
      const ::policy::mojom::PolicyPtr& input) {
    return input->conflicts;
  }

  static const decltype(::policy::mojom::Policy::superseded)& superseded(
      const ::policy::mojom::PolicyPtr& input) {
    return input->superseded;
  }

  static const decltype(::policy::mojom::Policy::error)& error(
      const ::policy::mojom::PolicyPtr& input) {
    return input->error;
  }

  static const decltype(::policy::mojom::Policy::warning)& warning(
      const ::policy::mojom::PolicyPtr& input) {
    return input->warning;
  }

  static const decltype(::policy::mojom::Policy::info)& info(
      const ::policy::mojom::PolicyPtr& input) {
    return input->info;
  }

  static bool Read(::policy::mojom::Policy::DataView input, ::policy::mojom::PolicyPtr* output);
};


template <>
struct  StructTraits<::policy::mojom::PolicyGroup::DataView,
                                         ::policy::mojom::PolicyGroupPtr> {
  static bool IsNull(const ::policy::mojom::PolicyGroupPtr& input) { return !input; }
  static void SetToNull(::policy::mojom::PolicyGroupPtr* output) { output->reset(); }

  static const decltype(::policy::mojom::PolicyGroup::name)& name(
      const ::policy::mojom::PolicyGroupPtr& input) {
    return input->name;
  }

  static const decltype(::policy::mojom::PolicyGroup::policies)& policies(
      const ::policy::mojom::PolicyGroupPtr& input) {
    return input->policies;
  }

  static const decltype(::policy::mojom::PolicyGroup::precedence_order)& precedence_order(
      const ::policy::mojom::PolicyGroupPtr& input) {
    return input->precedence_order;
  }

  static decltype(::policy::mojom::PolicyGroup::is_extension) is_extension(
      const ::policy::mojom::PolicyGroupPtr& input) {
    return input->is_extension;
  }

  static decltype(::policy::mojom::PolicyGroup::for_signin_screen) for_signin_screen(
      const ::policy::mojom::PolicyGroupPtr& input) {
    return input->for_signin_screen;
  }

  static bool Read(::policy::mojom::PolicyGroup::DataView input, ::policy::mojom::PolicyGroupPtr* output);
};


template <>
struct  StructTraits<::policy::mojom::PolicyGroupsResponse::DataView,
                                         ::policy::mojom::PolicyGroupsResponsePtr> {
  static bool IsNull(const ::policy::mojom::PolicyGroupsResponsePtr& input) { return !input; }
  static void SetToNull(::policy::mojom::PolicyGroupsResponsePtr* output) { output->reset(); }

  static const decltype(::policy::mojom::PolicyGroupsResponse::policy_ids_presentation_order)& policy_ids_presentation_order(
      const ::policy::mojom::PolicyGroupsResponsePtr& input) {
    return input->policy_ids_presentation_order;
  }

  static const decltype(::policy::mojom::PolicyGroupsResponse::policy_groups)& policy_groups(
      const ::policy::mojom::PolicyGroupsResponsePtr& input) {
    return input->policy_groups;
  }

  static bool Read(::policy::mojom::PolicyGroupsResponse::DataView input, ::policy::mojom::PolicyGroupsResponsePtr* output);
};

}  // namespace mojo

#endif  // COMPONENTS_POLICY_RESOURCES_WEBUI_MOJOM_POLICY_MOJOM_H_