// services/network/public/mojom/device_bound_sessions.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 SERVICES_NETWORK_PUBLIC_MOJOM_DEVICE_BOUND_SESSIONS_MOJOM_H_
#define SERVICES_NETWORK_PUBLIC_MOJOM_DEVICE_BOUND_SESSIONS_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 "services/network/public/mojom/device_bound_sessions.mojom-features.h"  // IWYU pragma: export
#include "services/network/public/mojom/device_bound_sessions.mojom-shared.h"  // IWYU pragma: export
#include "services/network/public/mojom/device_bound_sessions.mojom-forward.h"  // IWYU pragma: export
#include "mojo/public/mojom/base/time.mojom.h"
#include "mojo/public/mojom/base/unguessable_token.mojom.h"
#include "sandbox/policy/mojom/context.mojom-forward.h"
#include "services/network/public/mojom/clear_data_filter.mojom-forward.h"
#include "services/network/public/mojom/cookie_manager.mojom.h"
#include "services/network/public/mojom/schemeful_site.mojom.h"
#include "url/mojom/url.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"


#include "services/network/public/cpp/device_bound_sessions_mojom_traits.h"




namespace network::mojom {

class DeviceBoundSessionManagerProxy;

template <typename ImplRefTraits>
class DeviceBoundSessionManagerStub;

class DeviceBoundSessionManagerRequestValidator;
class DeviceBoundSessionManagerResponseValidator;


class DeviceBoundSessionManager
    : public DeviceBoundSessionManagerInterfaceBase {
 public:
  using IPCStableHashFunction = uint32_t(*)();
  static constexpr const char* Name_ = "network.mojom.DeviceBoundSessionManager";
  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_ = DeviceBoundSessionManagerInterfaceBase;
  using Proxy_ = DeviceBoundSessionManagerProxy;

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

  using RequestValidator_ = DeviceBoundSessionManagerRequestValidator;
  using ResponseValidator_ = DeviceBoundSessionManagerResponseValidator;
  enum MethodMinVersions : uint32_t {
    kGetAllSessionsMinVersion = 0,
    kDeleteSessionMinVersion = 0,
    kDeleteAllSessionsMinVersion = 0,
    kAddObserverMinVersion = 0,
    kAddEventObserverMinVersion = 0,
    kCreateBoundSessionsMinVersion = 0,
    kPrewarmSessionsForUrlMinVersion = 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 GetAllSessions_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct DeleteSession_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct DeleteAllSessions_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct AddObserver_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct AddEventObserver_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct CreateBoundSessions_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct PrewarmSessionsForUrl_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
#endif // !BUILDFLAG(IS_FUCHSIA)
  virtual ~DeviceBoundSessionManager() = default;

  using GetAllSessionsCallback = base::OnceCallback<void(const std::vector<::net::device_bound_sessions::SessionKey>&)>;
  using GetAllSessionsMojoCallback = base::OnceCallback<void(const std::vector<::net::device_bound_sessions::SessionKey>&)>;

  virtual void GetAllSessions(GetAllSessionsCallback callback) = 0;

  virtual void DeleteSession(::net::device_bound_sessions::DeletionReason reason, const ::net::device_bound_sessions::SessionKey& session) = 0;

  using DeleteAllSessionsCallback = base::OnceCallback<void()>;
  using DeleteAllSessionsMojoCallback = base::OnceCallback<void()>;

  virtual void DeleteAllSessions(::net::device_bound_sessions::DeletionReason reason, std::optional<::base::Time> created_after_time, std::optional<::base::Time> created_before_time, ::network::mojom::ClearDataFilterPtr filter, DeleteAllSessionsCallback callback) = 0;

  virtual void AddObserver(const ::GURL& url, ::mojo::PendingRemote<DeviceBoundSessionAccessObserver> observer) = 0;

  virtual void AddEventObserver(::mojo::PendingRemote<DeviceBoundSessionEventObserver> observer) = 0;

  using CreateBoundSessionsCallback = base::OnceCallback<void(const std::vector<::net::device_bound_sessions::SessionError::ErrorType>&, std::vector<::net::CookieInclusionStatus>)>;
  using CreateBoundSessionsMojoCallback = base::OnceCallback<void(const std::vector<::net::device_bound_sessions::SessionError::ErrorType>&, std::vector<::net::CookieInclusionStatus>)>;

  virtual void CreateBoundSessions(std::vector<::net::device_bound_sessions::SessionParams> params, const std::vector<uint8_t>& wrapped_key, const std::vector<::net::CanonicalCookie>& cookies_to_set, const ::net::CookieOptions& cookie_options, CreateBoundSessionsCallback callback) = 0;

  using PrewarmSessionsForUrlCallback = base::OnceCallback<void(const std::vector<::net::device_bound_sessions::RefreshResult>&, std::optional<::base::Time>)>;
  using PrewarmSessionsForUrlMojoCallback = base::OnceCallback<void(const std::vector<::net::device_bound_sessions::RefreshResult>&, std::optional<::base::Time>)>;

  virtual void PrewarmSessionsForUrl(const ::GURL& url, PrewarmSessionsForUrlCallback callback) = 0;
};

class DeviceBoundSessionAccessObserverProxy;

template <typename ImplRefTraits>
class DeviceBoundSessionAccessObserverStub;

class DeviceBoundSessionAccessObserverRequestValidator;


class DeviceBoundSessionAccessObserver
    : public DeviceBoundSessionAccessObserverInterfaceBase {
 public:
  using IPCStableHashFunction = uint32_t(*)();
  static constexpr const char* Name_ = "network.mojom.DeviceBoundSessionAccessObserver";
  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_ = DeviceBoundSessionAccessObserverInterfaceBase;
  using Proxy_ = DeviceBoundSessionAccessObserverProxy;

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

  using RequestValidator_ = DeviceBoundSessionAccessObserverRequestValidator;
  using ResponseValidator_ = mojo::PassThroughFilter;
  enum MethodMinVersions : uint32_t {
    kOnDeviceBoundSessionAccessedMinVersion = 0,
    kCloneMinVersion = 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 OnDeviceBoundSessionAccessed_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct Clone_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
#endif // !BUILDFLAG(IS_FUCHSIA)
  virtual ~DeviceBoundSessionAccessObserver() = default;

  virtual void OnDeviceBoundSessionAccessed(const ::net::device_bound_sessions::SessionAccess& access) = 0;

  virtual void Clone(::mojo::PendingReceiver<DeviceBoundSessionAccessObserver> observer) = 0;
};

class DeviceBoundSessionEventObserverProxy;

template <typename ImplRefTraits>
class DeviceBoundSessionEventObserverStub;

class DeviceBoundSessionEventObserverRequestValidator;


class DeviceBoundSessionEventObserver
    : public DeviceBoundSessionEventObserverInterfaceBase {
 public:
  using IPCStableHashFunction = uint32_t(*)();
  static constexpr const char* Name_ = "network.mojom.DeviceBoundSessionEventObserver";
  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_ = DeviceBoundSessionEventObserverInterfaceBase;
  using Proxy_ = DeviceBoundSessionEventObserverProxy;

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

  using RequestValidator_ = DeviceBoundSessionEventObserverRequestValidator;
  using ResponseValidator_ = mojo::PassThroughFilter;
  enum MethodMinVersions : uint32_t {
    kOnDeviceBoundSessionEventReceivedMinVersion = 0,
    kAddDeviceBoundSessionDisplaysMinVersion = 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 OnDeviceBoundSessionEventReceived_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct AddDeviceBoundSessionDisplays_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
#endif // !BUILDFLAG(IS_FUCHSIA)
  virtual ~DeviceBoundSessionEventObserver() = default;

  virtual void OnDeviceBoundSessionEventReceived(const ::net::device_bound_sessions::SessionEvent& event) = 0;

  virtual void AddDeviceBoundSessionDisplays(const std::vector<::net::device_bound_sessions::SessionDisplay>& session_displays) = 0;
};



class  DeviceBoundSessionManagerProxy
    : public DeviceBoundSessionManager {
 public:
  using InterfaceType = DeviceBoundSessionManager;

  explicit DeviceBoundSessionManagerProxy(mojo::MessageReceiverWithResponder* receiver);
  
  void GetAllSessions(GetAllSessionsCallback callback) final;
  
  void DeleteSession(::net::device_bound_sessions::DeletionReason reason, const ::net::device_bound_sessions::SessionKey& session) final;
  
  void DeleteAllSessions(::net::device_bound_sessions::DeletionReason reason, std::optional<::base::Time> created_after_time, std::optional<::base::Time> created_before_time, ::network::mojom::ClearDataFilterPtr filter, DeleteAllSessionsCallback callback) final;
  
  void AddObserver(const ::GURL& url, ::mojo::PendingRemote<DeviceBoundSessionAccessObserver> observer) final;
  
  void AddEventObserver(::mojo::PendingRemote<DeviceBoundSessionEventObserver> observer) final;
  
  void CreateBoundSessions(std::vector<::net::device_bound_sessions::SessionParams> params, const std::vector<uint8_t>& wrapped_key, const std::vector<::net::CanonicalCookie>& cookies_to_set, const ::net::CookieOptions& cookie_options, CreateBoundSessionsCallback callback) final;
  
  void PrewarmSessionsForUrl(const ::GURL& url, PrewarmSessionsForUrlCallback callback) final;

 private:
  mojo::MessageReceiverWithResponder* receiver_;
};



class  DeviceBoundSessionAccessObserverProxy
    : public DeviceBoundSessionAccessObserver {
 public:
  using InterfaceType = DeviceBoundSessionAccessObserver;

  explicit DeviceBoundSessionAccessObserverProxy(mojo::MessageReceiverWithResponder* receiver);
  
  void OnDeviceBoundSessionAccessed(const ::net::device_bound_sessions::SessionAccess& access) final;
  
  void Clone(::mojo::PendingReceiver<DeviceBoundSessionAccessObserver> observer) final;

 private:
  mojo::MessageReceiverWithResponder* receiver_;
};



class  DeviceBoundSessionEventObserverProxy
    : public DeviceBoundSessionEventObserver {
 public:
  using InterfaceType = DeviceBoundSessionEventObserver;

  explicit DeviceBoundSessionEventObserverProxy(mojo::MessageReceiverWithResponder* receiver);
  
  void OnDeviceBoundSessionEventReceived(const ::net::device_bound_sessions::SessionEvent& event) final;
  
  void AddDeviceBoundSessionDisplays(const std::vector<::net::device_bound_sessions::SessionDisplay>& session_displays) final;

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

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

  DeviceBoundSessionManagerStub() = default;
  ~DeviceBoundSessionManagerStub() 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 DeviceBoundSessionManagerStubDispatch::Accept(
        ImplRefTraits::GetRawPointer(&sink_), message);
  }

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

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

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

  DeviceBoundSessionAccessObserverStub() = default;
  ~DeviceBoundSessionAccessObserverStub() 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 DeviceBoundSessionAccessObserverStubDispatch::Accept(
        ImplRefTraits::GetRawPointer(&sink_), message);
  }

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

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

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

  DeviceBoundSessionEventObserverStub() = default;
  ~DeviceBoundSessionEventObserverStub() 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 DeviceBoundSessionEventObserverStubDispatch::Accept(
        ImplRefTraits::GetRawPointer(&sink_), message);
  }

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

 private:
  ImplPointerType sink_;
};
class  DeviceBoundSessionManagerRequestValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};
class  DeviceBoundSessionAccessObserverRequestValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};
class  DeviceBoundSessionEventObserverRequestValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};
class  DeviceBoundSessionManagerResponseValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};








class  DeviceBoundSessionScopeSpecification {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<DeviceBoundSessionScopeSpecification, T>::value>;
  using DataView = DeviceBoundSessionScopeSpecificationDataView;
  using Data_ = internal::DeviceBoundSessionScopeSpecification_Data;

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

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

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


  DeviceBoundSessionScopeSpecification();

  DeviceBoundSessionScopeSpecification(
      DeviceBoundSessionScopeSpecificationType type,
      const std::string& domain,
      const std::string& path);


  ~DeviceBoundSessionScopeSpecification();

  // 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 = DeviceBoundSessionScopeSpecificationPtr>
  DeviceBoundSessionScopeSpecificationPtr 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, DeviceBoundSessionScopeSpecification::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, DeviceBoundSessionScopeSpecification::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<
        DeviceBoundSessionScopeSpecification::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        DeviceBoundSessionScopeSpecification::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::DeviceBoundSessionScopeSpecification_UnserializedMessageContext<
            UserType, DeviceBoundSessionScopeSpecification::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<DeviceBoundSessionScopeSpecification::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return DeviceBoundSessionScopeSpecification::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::DeviceBoundSessionScopeSpecification_UnserializedMessageContext<
            UserType, DeviceBoundSessionScopeSpecification::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<DeviceBoundSessionScopeSpecification::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  DeviceBoundSessionScopeSpecificationType type;
  
  std::string domain;
  
  std::string path;

  // 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, DeviceBoundSessionScopeSpecification::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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






class  DeviceBoundSessionCredential {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<DeviceBoundSessionCredential, T>::value>;
  using DataView = DeviceBoundSessionCredentialDataView;
  using Data_ = internal::DeviceBoundSessionCredential_Data;

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

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

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


  DeviceBoundSessionCredential();

  DeviceBoundSessionCredential(
      const std::string& name,
      const std::string& attributes);


  ~DeviceBoundSessionCredential();

  // 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 = DeviceBoundSessionCredentialPtr>
  DeviceBoundSessionCredentialPtr 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, DeviceBoundSessionCredential::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, DeviceBoundSessionCredential::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<
        DeviceBoundSessionCredential::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        DeviceBoundSessionCredential::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::DeviceBoundSessionCredential_UnserializedMessageContext<
            UserType, DeviceBoundSessionCredential::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<DeviceBoundSessionCredential::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return DeviceBoundSessionCredential::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::DeviceBoundSessionCredential_UnserializedMessageContext<
            UserType, DeviceBoundSessionCredential::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<DeviceBoundSessionCredential::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::string name;
  
  std::string attributes;

  // 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, DeviceBoundSessionCredential::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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







class  DeviceBoundSessionUrlRuleDisplay {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<DeviceBoundSessionUrlRuleDisplay, T>::value>;
  using DataView = DeviceBoundSessionUrlRuleDisplayDataView;
  using Data_ = internal::DeviceBoundSessionUrlRuleDisplay_Data;

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

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

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


  DeviceBoundSessionUrlRuleDisplay();

  DeviceBoundSessionUrlRuleDisplay(
      ::net::device_bound_sessions::InclusionResult rule_type,
      const std::string& host_pattern,
      const std::string& path_prefix);


  ~DeviceBoundSessionUrlRuleDisplay();

  // 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 = DeviceBoundSessionUrlRuleDisplayPtr>
  DeviceBoundSessionUrlRuleDisplayPtr 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, DeviceBoundSessionUrlRuleDisplay::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, DeviceBoundSessionUrlRuleDisplay::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<
        DeviceBoundSessionUrlRuleDisplay::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        DeviceBoundSessionUrlRuleDisplay::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::DeviceBoundSessionUrlRuleDisplay_UnserializedMessageContext<
            UserType, DeviceBoundSessionUrlRuleDisplay::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<DeviceBoundSessionUrlRuleDisplay::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return DeviceBoundSessionUrlRuleDisplay::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::DeviceBoundSessionUrlRuleDisplay_UnserializedMessageContext<
            UserType, DeviceBoundSessionUrlRuleDisplay::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<DeviceBoundSessionUrlRuleDisplay::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  ::net::device_bound_sessions::InclusionResult rule_type;
  
  std::string host_pattern;
  
  std::string path_prefix;

  // 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, DeviceBoundSessionUrlRuleDisplay::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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










class  DeviceBoundSessionTerminationDetails {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<DeviceBoundSessionTerminationDetails, T>::value>;
  using DataView = DeviceBoundSessionTerminationDetailsDataView;
  using Data_ = internal::DeviceBoundSessionTerminationDetails_Data;

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

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

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


  DeviceBoundSessionTerminationDetails();

  explicit DeviceBoundSessionTerminationDetails(
      ::net::device_bound_sessions::DeletionReason deletion_reason);


  ~DeviceBoundSessionTerminationDetails();

  // 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 = DeviceBoundSessionTerminationDetailsPtr>
  DeviceBoundSessionTerminationDetailsPtr 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, DeviceBoundSessionTerminationDetails::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, DeviceBoundSessionTerminationDetails::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<
        DeviceBoundSessionTerminationDetails::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        DeviceBoundSessionTerminationDetails::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::DeviceBoundSessionTerminationDetails_UnserializedMessageContext<
            UserType, DeviceBoundSessionTerminationDetails::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<DeviceBoundSessionTerminationDetails::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return DeviceBoundSessionTerminationDetails::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::DeviceBoundSessionTerminationDetails_UnserializedMessageContext<
            UserType, DeviceBoundSessionTerminationDetails::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<DeviceBoundSessionTerminationDetails::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  ::net::device_bound_sessions::DeletionReason deletion_reason;

  // 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, DeviceBoundSessionTerminationDetails::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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





class  DeviceBoundSessionChallengeDetails {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<DeviceBoundSessionChallengeDetails, T>::value>;
  using DataView = DeviceBoundSessionChallengeDetailsDataView;
  using Data_ = internal::DeviceBoundSessionChallengeDetails_Data;

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

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

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


  DeviceBoundSessionChallengeDetails();

  DeviceBoundSessionChallengeDetails(
      ::net::device_bound_sessions::ChallengeResult challenge_result,
      const std::string& challenge);


  ~DeviceBoundSessionChallengeDetails();

  // 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 = DeviceBoundSessionChallengeDetailsPtr>
  DeviceBoundSessionChallengeDetailsPtr 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, DeviceBoundSessionChallengeDetails::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, DeviceBoundSessionChallengeDetails::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<
        DeviceBoundSessionChallengeDetails::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        DeviceBoundSessionChallengeDetails::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::DeviceBoundSessionChallengeDetails_UnserializedMessageContext<
            UserType, DeviceBoundSessionChallengeDetails::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<DeviceBoundSessionChallengeDetails::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return DeviceBoundSessionChallengeDetails::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::DeviceBoundSessionChallengeDetails_UnserializedMessageContext<
            UserType, DeviceBoundSessionChallengeDetails::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<DeviceBoundSessionChallengeDetails::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  ::net::device_bound_sessions::ChallengeResult challenge_result;
  
  std::string challenge;

  // 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, DeviceBoundSessionChallengeDetails::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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






class  DeviceBoundSessionEventTypeDetails {
 public:
  using DataView = DeviceBoundSessionEventTypeDetailsDataView;
  using Data_ = internal::DeviceBoundSessionEventTypeDetails_Data;
  using Tag = Data_::DeviceBoundSessionEventTypeDetails_Tag;

  template <typename... Args>
  static DeviceBoundSessionEventTypeDetailsPtr New(Args&&... args) {
    static_assert(
        sizeof...(args) < 0,
        "Do not use Union::New(); to create a union of a given subtype, use "
        "New<SubType>(), not New() followed by set_<sub_type>(). To represent "
        "an empty union, mark the field or parameter as nullable in the mojom "
        "definition.");
    return nullptr;
  }

  // Construct an instance holding |creation|.
  static DeviceBoundSessionEventTypeDetailsPtr NewCreation(
      const ::net::device_bound_sessions::CreationEventDetails& value);
  // Construct an instance holding |refresh|.
  static DeviceBoundSessionEventTypeDetailsPtr NewRefresh(
      const ::net::device_bound_sessions::RefreshEventDetails& value);
  // Construct an instance holding |termination|.
  static DeviceBoundSessionEventTypeDetailsPtr NewTermination(
      const ::net::device_bound_sessions::TerminationEventDetails& value);
  // Construct an instance holding |challenge|.
  static DeviceBoundSessionEventTypeDetailsPtr NewChallenge(
      const ::net::device_bound_sessions::ChallengeEventDetails& value);

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

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

  // Delete the copy constructor and copy assignment operators because `data_`
  // contains raw pointers that must not be copied.
  DeviceBoundSessionEventTypeDetails(const DeviceBoundSessionEventTypeDetails& other) = delete;
  DeviceBoundSessionEventTypeDetails& operator=(const DeviceBoundSessionEventTypeDetails& other) = delete;

  // 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 UnionPtrType = DeviceBoundSessionEventTypeDetailsPtr>
  DeviceBoundSessionEventTypeDetailsPtr 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,
            typename std::enable_if<std::is_same<
                T, DeviceBoundSessionEventTypeDetails>::value>::type* = nullptr>
  bool Equals(const T& other) const;

  template <typename T,
            typename std::enable_if<std::is_same<
                T, DeviceBoundSessionEventTypeDetails>::value>::type* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  Tag which() const {
    return tag_;
  }

  bool is_creation() const { return tag_ == Tag::kCreation; }
  const ::net::device_bound_sessions::CreationEventDetails& get_creation() const {
    CHECK(tag_ == Tag::kCreation);
    return data_.creation;
  }
  ::net::device_bound_sessions::CreationEventDetails& get_creation() {
    CHECK(tag_ == Tag::kCreation);
    return data_.creation;
  }
  void set_creation(const ::net::device_bound_sessions::CreationEventDetails& creation);

  bool is_refresh() const { return tag_ == Tag::kRefresh; }
  const ::net::device_bound_sessions::RefreshEventDetails& get_refresh() const {
    CHECK(tag_ == Tag::kRefresh);
    return data_.refresh;
  }
  ::net::device_bound_sessions::RefreshEventDetails& get_refresh() {
    CHECK(tag_ == Tag::kRefresh);
    return data_.refresh;
  }
  void set_refresh(const ::net::device_bound_sessions::RefreshEventDetails& refresh);

  bool is_termination() const { return tag_ == Tag::kTermination; }
  const ::net::device_bound_sessions::TerminationEventDetails& get_termination() const {
    CHECK(tag_ == Tag::kTermination);
    return data_.termination;
  }
  ::net::device_bound_sessions::TerminationEventDetails& get_termination() {
    CHECK(tag_ == Tag::kTermination);
    return data_.termination;
  }
  void set_termination(const ::net::device_bound_sessions::TerminationEventDetails& termination);

  bool is_challenge() const { return tag_ == Tag::kChallenge; }
  const ::net::device_bound_sessions::ChallengeEventDetails& get_challenge() const {
    CHECK(tag_ == Tag::kChallenge);
    return data_.challenge;
  }
  ::net::device_bound_sessions::ChallengeEventDetails& get_challenge() {
    CHECK(tag_ == Tag::kChallenge);
    return data_.challenge;
  }
  void set_challenge(const ::net::device_bound_sessions::ChallengeEventDetails& challenge);

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

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    return mojo::internal::DeserializeImpl<DeviceBoundSessionEventTypeDetails::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

 private:
  template <typename T>
  friend class ::mojo::InlinedStructPtr;
  template <typename T>
  friend class ::mojo::StructPtr;

  union Union_ {
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kCreation)>,
        const ::net::device_bound_sessions::CreationEventDetails& value);
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kRefresh)>,
        const ::net::device_bound_sessions::RefreshEventDetails& value);
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kTermination)>,
        const ::net::device_bound_sessions::TerminationEventDetails& value);
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kChallenge)>,
        const ::net::device_bound_sessions::ChallengeEventDetails& value);
    // The contents of the union are explicitly destroyed by `DestroyActive()`.
    ~Union_() {}

    ::net::device_bound_sessions::CreationEventDetails creation;
    ::net::device_bound_sessions::RefreshEventDetails refresh;
    ::net::device_bound_sessions::TerminationEventDetails termination;
    ::net::device_bound_sessions::ChallengeEventDetails challenge;
  };

  DeviceBoundSessionEventTypeDetails(
      std::in_place_index_t<static_cast<size_t>(Tag::kCreation)>,
      const ::net::device_bound_sessions::CreationEventDetails& value);
  DeviceBoundSessionEventTypeDetails(
      std::in_place_index_t<static_cast<size_t>(Tag::kRefresh)>,
      const ::net::device_bound_sessions::RefreshEventDetails& value);
  DeviceBoundSessionEventTypeDetails(
      std::in_place_index_t<static_cast<size_t>(Tag::kTermination)>,
      const ::net::device_bound_sessions::TerminationEventDetails& value);
  DeviceBoundSessionEventTypeDetails(
      std::in_place_index_t<static_cast<size_t>(Tag::kChallenge)>,
      const ::net::device_bound_sessions::ChallengeEventDetails& value);

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

  void DestroyActive();
  Tag tag_;
  Union_ data_;
};





class  DeviceBoundSessionKey {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<DeviceBoundSessionKey, T>::value>;
  using DataView = DeviceBoundSessionKeyDataView;
  using Data_ = internal::DeviceBoundSessionKey_Data;

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

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

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


  DeviceBoundSessionKey();

  DeviceBoundSessionKey(
      const ::net::SchemefulSite& site,
      const std::string& id);


  ~DeviceBoundSessionKey();

  // 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 = DeviceBoundSessionKeyPtr>
  DeviceBoundSessionKeyPtr 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, DeviceBoundSessionKey::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, DeviceBoundSessionKey::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<
        DeviceBoundSessionKey::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        DeviceBoundSessionKey::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::DeviceBoundSessionKey_UnserializedMessageContext<
            UserType, DeviceBoundSessionKey::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<DeviceBoundSessionKey::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return DeviceBoundSessionKey::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::DeviceBoundSessionKey_UnserializedMessageContext<
            UserType, DeviceBoundSessionKey::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<DeviceBoundSessionKey::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  ::net::SchemefulSite site;
  
  std::string id;

  // 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, DeviceBoundSessionKey::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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





class  DeviceBoundSessionAccess {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<DeviceBoundSessionAccess, T>::value>;
  using DataView = DeviceBoundSessionAccessDataView;
  using Data_ = internal::DeviceBoundSessionAccess_Data;

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

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

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


  DeviceBoundSessionAccess();

  DeviceBoundSessionAccess(
      DeviceBoundSessionAccessType access_type,
      const ::net::device_bound_sessions::SessionKey& session_key,
      std::vector<std::string> cookies);


  ~DeviceBoundSessionAccess();

  // 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 = DeviceBoundSessionAccessPtr>
  DeviceBoundSessionAccessPtr 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, DeviceBoundSessionAccess::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, DeviceBoundSessionAccess::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<
        DeviceBoundSessionAccess::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        DeviceBoundSessionAccess::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::DeviceBoundSessionAccess_UnserializedMessageContext<
            UserType, DeviceBoundSessionAccess::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<DeviceBoundSessionAccess::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return DeviceBoundSessionAccess::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::DeviceBoundSessionAccess_UnserializedMessageContext<
            UserType, DeviceBoundSessionAccess::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<DeviceBoundSessionAccess::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  DeviceBoundSessionAccessType access_type;
  
  ::net::device_bound_sessions::SessionKey session_key;
  
  std::vector<std::string> cookies;

  // 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, DeviceBoundSessionAccess::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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





class  DeviceBoundSessionWithUsage {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<DeviceBoundSessionWithUsage, T>::value>;
  using DataView = DeviceBoundSessionWithUsageDataView;
  using Data_ = internal::DeviceBoundSessionWithUsage_Data;

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

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

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


  DeviceBoundSessionWithUsage();

  DeviceBoundSessionWithUsage(
      const ::net::device_bound_sessions::SessionKey& session_key,
      DeviceBoundSessionUsage usage);


  ~DeviceBoundSessionWithUsage();

  // 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 = DeviceBoundSessionWithUsagePtr>
  DeviceBoundSessionWithUsagePtr 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, DeviceBoundSessionWithUsage::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, DeviceBoundSessionWithUsage::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<
        DeviceBoundSessionWithUsage::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        DeviceBoundSessionWithUsage::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::DeviceBoundSessionWithUsage_UnserializedMessageContext<
            UserType, DeviceBoundSessionWithUsage::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<DeviceBoundSessionWithUsage::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return DeviceBoundSessionWithUsage::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::DeviceBoundSessionWithUsage_UnserializedMessageContext<
            UserType, DeviceBoundSessionWithUsage::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<DeviceBoundSessionWithUsage::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  ::net::device_bound_sessions::SessionKey session_key;
  
  DeviceBoundSessionUsage usage;

  // 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, DeviceBoundSessionWithUsage::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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






class  DeviceBoundSessionScope {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<DeviceBoundSessionScope, T>::value>;
  using DataView = DeviceBoundSessionScopeDataView;
  using Data_ = internal::DeviceBoundSessionScope_Data;

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

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

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


  DeviceBoundSessionScope();

  DeviceBoundSessionScope(
      bool include_site,
      std::vector<DeviceBoundSessionScopeSpecificationPtr> specifications,
      const std::string& origin);

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

  ~DeviceBoundSessionScope();

  // 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 = DeviceBoundSessionScopePtr>
  DeviceBoundSessionScopePtr 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, DeviceBoundSessionScope::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, DeviceBoundSessionScope::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<
        DeviceBoundSessionScope::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        DeviceBoundSessionScope::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::DeviceBoundSessionScope_UnserializedMessageContext<
            UserType, DeviceBoundSessionScope::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<DeviceBoundSessionScope::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return DeviceBoundSessionScope::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::DeviceBoundSessionScope_UnserializedMessageContext<
            UserType, DeviceBoundSessionScope::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<DeviceBoundSessionScope::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  bool include_site;
  
  std::vector<DeviceBoundSessionScopeSpecificationPtr> specifications;
  
  std::string origin;

  // 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, DeviceBoundSessionScope::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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






class  DeviceBoundSessionParams {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<DeviceBoundSessionParams, T>::value>;
  using DataView = DeviceBoundSessionParamsDataView;
  using Data_ = internal::DeviceBoundSessionParams_Data;

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

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

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


  DeviceBoundSessionParams();

  DeviceBoundSessionParams(
      const std::string& session_id,
      const ::GURL& fetcher_url,
      const std::string& refresh_url,
      DeviceBoundSessionScopePtr scope,
      std::vector<DeviceBoundSessionCredentialPtr> credentials,
      std::vector<std::string> allowed_refresh_initiators);

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

  ~DeviceBoundSessionParams();

  // 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 = DeviceBoundSessionParamsPtr>
  DeviceBoundSessionParamsPtr 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, DeviceBoundSessionParams::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, DeviceBoundSessionParams::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<
        DeviceBoundSessionParams::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        DeviceBoundSessionParams::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::DeviceBoundSessionParams_UnserializedMessageContext<
            UserType, DeviceBoundSessionParams::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<DeviceBoundSessionParams::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return DeviceBoundSessionParams::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::DeviceBoundSessionParams_UnserializedMessageContext<
            UserType, DeviceBoundSessionParams::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<DeviceBoundSessionParams::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::string session_id;
  
  ::GURL fetcher_url;
  
  std::string refresh_url;
  
  DeviceBoundSessionScopePtr scope;
  
  std::vector<DeviceBoundSessionCredentialPtr> credentials;
  
  std::vector<std::string> allowed_refresh_initiators;

  // 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, DeviceBoundSessionParams::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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





class  DeviceBoundSessionCookieCravingDisplay {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<DeviceBoundSessionCookieCravingDisplay, T>::value>;
  using DataView = DeviceBoundSessionCookieCravingDisplayDataView;
  using Data_ = internal::DeviceBoundSessionCookieCravingDisplay_Data;

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

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

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


  DeviceBoundSessionCookieCravingDisplay();

  DeviceBoundSessionCookieCravingDisplay(
      const std::string& name,
      const std::string& domain,
      const std::string& path,
      bool secure,
      bool http_only,
      ::net::CookieSameSite same_site);


  ~DeviceBoundSessionCookieCravingDisplay();

  // 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 = DeviceBoundSessionCookieCravingDisplayPtr>
  DeviceBoundSessionCookieCravingDisplayPtr 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, DeviceBoundSessionCookieCravingDisplay::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, DeviceBoundSessionCookieCravingDisplay::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<
        DeviceBoundSessionCookieCravingDisplay::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        DeviceBoundSessionCookieCravingDisplay::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::DeviceBoundSessionCookieCravingDisplay_UnserializedMessageContext<
            UserType, DeviceBoundSessionCookieCravingDisplay::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<DeviceBoundSessionCookieCravingDisplay::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return DeviceBoundSessionCookieCravingDisplay::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::DeviceBoundSessionCookieCravingDisplay_UnserializedMessageContext<
            UserType, DeviceBoundSessionCookieCravingDisplay::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<DeviceBoundSessionCookieCravingDisplay::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::string name;
  
  std::string domain;
  
  std::string path;
  
  bool secure;
  
  bool http_only;
  
  ::net::CookieSameSite same_site;

  // 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, DeviceBoundSessionCookieCravingDisplay::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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






class  DeviceBoundSessionInclusionRulesDisplay {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<DeviceBoundSessionInclusionRulesDisplay, T>::value>;
  using DataView = DeviceBoundSessionInclusionRulesDisplayDataView;
  using Data_ = internal::DeviceBoundSessionInclusionRulesDisplay_Data;

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

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

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


  DeviceBoundSessionInclusionRulesDisplay();

  DeviceBoundSessionInclusionRulesDisplay(
      const std::string& origin,
      bool include_site,
      std::vector<::net::device_bound_sessions::UrlRuleDisplay> url_rules);


  ~DeviceBoundSessionInclusionRulesDisplay();

  // 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 = DeviceBoundSessionInclusionRulesDisplayPtr>
  DeviceBoundSessionInclusionRulesDisplayPtr 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, DeviceBoundSessionInclusionRulesDisplay::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, DeviceBoundSessionInclusionRulesDisplay::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<
        DeviceBoundSessionInclusionRulesDisplay::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        DeviceBoundSessionInclusionRulesDisplay::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::DeviceBoundSessionInclusionRulesDisplay_UnserializedMessageContext<
            UserType, DeviceBoundSessionInclusionRulesDisplay::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<DeviceBoundSessionInclusionRulesDisplay::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return DeviceBoundSessionInclusionRulesDisplay::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::DeviceBoundSessionInclusionRulesDisplay_UnserializedMessageContext<
            UserType, DeviceBoundSessionInclusionRulesDisplay::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<DeviceBoundSessionInclusionRulesDisplay::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::string origin;
  
  bool include_site;
  
  std::vector<::net::device_bound_sessions::UrlRuleDisplay> url_rules;

  // 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, DeviceBoundSessionInclusionRulesDisplay::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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





class  DeviceBoundSessionDisplay {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<DeviceBoundSessionDisplay, T>::value>;
  using DataView = DeviceBoundSessionDisplayDataView;
  using Data_ = internal::DeviceBoundSessionDisplay_Data;

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

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

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


  DeviceBoundSessionDisplay();

  DeviceBoundSessionDisplay(
      const ::net::device_bound_sessions::SessionKey& key,
      const ::GURL& refresh_url,
      const ::net::device_bound_sessions::SessionInclusionRulesDisplay& inclusion_rules,
      std::vector<::net::device_bound_sessions::CookieCravingDisplay> cookie_cravings,
      ::base::Time expiry_date,
      const std::optional<std::string>& cached_challenge,
      std::vector<std::string> allowed_refresh_initiators);


  ~DeviceBoundSessionDisplay();

  // 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 = DeviceBoundSessionDisplayPtr>
  DeviceBoundSessionDisplayPtr 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, DeviceBoundSessionDisplay::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, DeviceBoundSessionDisplay::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<
        DeviceBoundSessionDisplay::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        DeviceBoundSessionDisplay::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::DeviceBoundSessionDisplay_UnserializedMessageContext<
            UserType, DeviceBoundSessionDisplay::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<DeviceBoundSessionDisplay::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return DeviceBoundSessionDisplay::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::DeviceBoundSessionDisplay_UnserializedMessageContext<
            UserType, DeviceBoundSessionDisplay::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<DeviceBoundSessionDisplay::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  ::net::device_bound_sessions::SessionKey key;
  
  ::GURL refresh_url;
  
  ::net::device_bound_sessions::SessionInclusionRulesDisplay inclusion_rules;
  
  std::vector<::net::device_bound_sessions::CookieCravingDisplay> cookie_cravings;
  
  ::base::Time expiry_date;
  
  std::optional<std::string> cached_challenge;
  
  std::vector<std::string> allowed_refresh_initiators;

  // 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, DeviceBoundSessionDisplay::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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





class  DeviceBoundSessionFailedRequest {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<DeviceBoundSessionFailedRequest, T>::value>;
  using DataView = DeviceBoundSessionFailedRequestDataView;
  using Data_ = internal::DeviceBoundSessionFailedRequest_Data;

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

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

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


  DeviceBoundSessionFailedRequest();

  DeviceBoundSessionFailedRequest(
      const ::GURL& request_url,
      std::optional<int32_t> net_error,
      std::optional<int32_t> response_error,
      const std::optional<std::string>& response_error_body);


  ~DeviceBoundSessionFailedRequest();

  // 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 = DeviceBoundSessionFailedRequestPtr>
  DeviceBoundSessionFailedRequestPtr 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, DeviceBoundSessionFailedRequest::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, DeviceBoundSessionFailedRequest::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<
        DeviceBoundSessionFailedRequest::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        DeviceBoundSessionFailedRequest::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::DeviceBoundSessionFailedRequest_UnserializedMessageContext<
            UserType, DeviceBoundSessionFailedRequest::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<DeviceBoundSessionFailedRequest::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return DeviceBoundSessionFailedRequest::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::DeviceBoundSessionFailedRequest_UnserializedMessageContext<
            UserType, DeviceBoundSessionFailedRequest::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<DeviceBoundSessionFailedRequest::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  ::GURL request_url;
  
  std::optional<int32_t> net_error;
  
  std::optional<int32_t> response_error;
  
  std::optional<std::string> response_error_body;

  // 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, DeviceBoundSessionFailedRequest::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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





class  DeviceBoundSessionCreationDetails {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<DeviceBoundSessionCreationDetails, T>::value>;
  using DataView = DeviceBoundSessionCreationDetailsDataView;
  using Data_ = internal::DeviceBoundSessionCreationDetails_Data;

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

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

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


  DeviceBoundSessionCreationDetails();

  DeviceBoundSessionCreationDetails(
      ::net::device_bound_sessions::SessionError::ErrorType fetch_error,
      const std::optional<::net::device_bound_sessions::SessionDisplay>& new_session_display,
      const std::optional<::net::device_bound_sessions::FailedRequest>& failed_request);


  ~DeviceBoundSessionCreationDetails();

  // 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 = DeviceBoundSessionCreationDetailsPtr>
  DeviceBoundSessionCreationDetailsPtr 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, DeviceBoundSessionCreationDetails::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, DeviceBoundSessionCreationDetails::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<
        DeviceBoundSessionCreationDetails::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        DeviceBoundSessionCreationDetails::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::DeviceBoundSessionCreationDetails_UnserializedMessageContext<
            UserType, DeviceBoundSessionCreationDetails::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<DeviceBoundSessionCreationDetails::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return DeviceBoundSessionCreationDetails::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::DeviceBoundSessionCreationDetails_UnserializedMessageContext<
            UserType, DeviceBoundSessionCreationDetails::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<DeviceBoundSessionCreationDetails::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  ::net::device_bound_sessions::SessionError::ErrorType fetch_error;
  
  std::optional<::net::device_bound_sessions::SessionDisplay> new_session_display;
  
  std::optional<::net::device_bound_sessions::FailedRequest> failed_request;

  // 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, DeviceBoundSessionCreationDetails::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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





class  DeviceBoundSessionRefreshDetails {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<DeviceBoundSessionRefreshDetails, T>::value>;
  using DataView = DeviceBoundSessionRefreshDetailsDataView;
  using Data_ = internal::DeviceBoundSessionRefreshDetails_Data;

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

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

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


  DeviceBoundSessionRefreshDetails();

  DeviceBoundSessionRefreshDetails(
      ::net::device_bound_sessions::RefreshResult refresh_result,
      std::optional<::net::device_bound_sessions::SessionError::ErrorType> fetch_error,
      const std::optional<::net::device_bound_sessions::SessionDisplay>& new_session_display,
      bool was_fully_proactive_refresh,
      const std::optional<::net::device_bound_sessions::FailedRequest>& failed_request);


  ~DeviceBoundSessionRefreshDetails();

  // 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 = DeviceBoundSessionRefreshDetailsPtr>
  DeviceBoundSessionRefreshDetailsPtr 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, DeviceBoundSessionRefreshDetails::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, DeviceBoundSessionRefreshDetails::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<
        DeviceBoundSessionRefreshDetails::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        DeviceBoundSessionRefreshDetails::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::DeviceBoundSessionRefreshDetails_UnserializedMessageContext<
            UserType, DeviceBoundSessionRefreshDetails::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<DeviceBoundSessionRefreshDetails::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return DeviceBoundSessionRefreshDetails::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::DeviceBoundSessionRefreshDetails_UnserializedMessageContext<
            UserType, DeviceBoundSessionRefreshDetails::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<DeviceBoundSessionRefreshDetails::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  ::net::device_bound_sessions::RefreshResult refresh_result;
  
  std::optional<::net::device_bound_sessions::SessionError::ErrorType> fetch_error;
  
  std::optional<::net::device_bound_sessions::SessionDisplay> new_session_display;
  
  bool was_fully_proactive_refresh;
  
  std::optional<::net::device_bound_sessions::FailedRequest> failed_request;

  // 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, DeviceBoundSessionRefreshDetails::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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







class  DeviceBoundSessionEvent {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<DeviceBoundSessionEvent, T>::value>;
  using DataView = DeviceBoundSessionEventDataView;
  using Data_ = internal::DeviceBoundSessionEvent_Data;

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

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

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


  DeviceBoundSessionEvent();

  DeviceBoundSessionEvent(
      const ::base::UnguessableToken& event_id,
      const ::net::SchemefulSite& site,
      const std::optional<std::string>& session_id,
      bool succeeded,
      const ::net::device_bound_sessions::SessionEventTypeDetails& event_type_details);


  ~DeviceBoundSessionEvent();

  // 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 = DeviceBoundSessionEventPtr>
  DeviceBoundSessionEventPtr 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, DeviceBoundSessionEvent::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, DeviceBoundSessionEvent::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<
        DeviceBoundSessionEvent::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        DeviceBoundSessionEvent::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::DeviceBoundSessionEvent_UnserializedMessageContext<
            UserType, DeviceBoundSessionEvent::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<DeviceBoundSessionEvent::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return DeviceBoundSessionEvent::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::DeviceBoundSessionEvent_UnserializedMessageContext<
            UserType, DeviceBoundSessionEvent::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<DeviceBoundSessionEvent::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  ::base::UnguessableToken event_id;
  
  ::net::SchemefulSite site;
  
  std::optional<std::string> session_id;
  
  bool succeeded;
  
  ::net::device_bound_sessions::SessionEventTypeDetails event_type_details;

  // 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, DeviceBoundSessionEvent::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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

template <typename UnionPtrType>
DeviceBoundSessionEventTypeDetailsPtr DeviceBoundSessionEventTypeDetails::Clone() const {
  switch (tag_) {
    case Tag::kCreation:
      return NewCreation(
          mojo::Clone(data_.creation));
    case Tag::kRefresh:
      return NewRefresh(
          mojo::Clone(data_.refresh));
    case Tag::kTermination:
      return NewTermination(
          mojo::Clone(data_.termination));
    case Tag::kChallenge:
      return NewChallenge(
          mojo::Clone(data_.challenge));
  }
  return nullptr;
}

template <typename T,
          typename std::enable_if<std::is_same<
              T, DeviceBoundSessionEventTypeDetails>::value>::type*>
bool DeviceBoundSessionEventTypeDetails::Equals(const T& other) const {
  if (tag_ != other.which())
    return false;

  switch (tag_) {
    case Tag::kCreation:
      return mojo::Equals(data_.creation, other.data_.creation);
    case Tag::kRefresh:
      return mojo::Equals(data_.refresh, other.data_.refresh);
    case Tag::kTermination:
      return mojo::Equals(data_.termination, other.data_.termination);
    case Tag::kChallenge:
      return mojo::Equals(data_.challenge, other.data_.challenge);
  }

  return false;
}
template <typename StructPtrType>
DeviceBoundSessionKeyPtr DeviceBoundSessionKey::Clone() const {
  return New(
      mojo::Clone(site),
      mojo::Clone(id)
  );
}

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

template <typename T, DeviceBoundSessionKey::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.site < rhs.site)
    return true;
  if (rhs.site < lhs.site)
    return false;
  if (lhs.id < rhs.id)
    return true;
  if (rhs.id < lhs.id)
    return false;
  return false;
}
template <typename StructPtrType>
DeviceBoundSessionAccessPtr DeviceBoundSessionAccess::Clone() const {
  return New(
      mojo::Clone(access_type),
      mojo::Clone(session_key),
      mojo::Clone(cookies)
  );
}

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

template <typename T, DeviceBoundSessionAccess::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.access_type < rhs.access_type)
    return true;
  if (rhs.access_type < lhs.access_type)
    return false;
  if (lhs.session_key < rhs.session_key)
    return true;
  if (rhs.session_key < lhs.session_key)
    return false;
  if (lhs.cookies < rhs.cookies)
    return true;
  if (rhs.cookies < lhs.cookies)
    return false;
  return false;
}
template <typename StructPtrType>
DeviceBoundSessionWithUsagePtr DeviceBoundSessionWithUsage::Clone() const {
  return New(
      mojo::Clone(session_key),
      mojo::Clone(usage)
  );
}

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

template <typename T, DeviceBoundSessionWithUsage::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.session_key < rhs.session_key)
    return true;
  if (rhs.session_key < lhs.session_key)
    return false;
  if (lhs.usage < rhs.usage)
    return true;
  if (rhs.usage < lhs.usage)
    return false;
  return false;
}
template <typename StructPtrType>
DeviceBoundSessionScopeSpecificationPtr DeviceBoundSessionScopeSpecification::Clone() const {
  return New(
      mojo::Clone(type),
      mojo::Clone(domain),
      mojo::Clone(path)
  );
}

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

template <typename T, DeviceBoundSessionScopeSpecification::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.type < rhs.type)
    return true;
  if (rhs.type < lhs.type)
    return false;
  if (lhs.domain < rhs.domain)
    return true;
  if (rhs.domain < lhs.domain)
    return false;
  if (lhs.path < rhs.path)
    return true;
  if (rhs.path < lhs.path)
    return false;
  return false;
}
template <typename StructPtrType>
DeviceBoundSessionScopePtr DeviceBoundSessionScope::Clone() const {
  return New(
      mojo::Clone(include_site),
      mojo::Clone(specifications),
      mojo::Clone(origin)
  );
}

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

template <typename T, DeviceBoundSessionScope::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.include_site < rhs.include_site)
    return true;
  if (rhs.include_site < lhs.include_site)
    return false;
  if (lhs.specifications < rhs.specifications)
    return true;
  if (rhs.specifications < lhs.specifications)
    return false;
  if (lhs.origin < rhs.origin)
    return true;
  if (rhs.origin < lhs.origin)
    return false;
  return false;
}
template <typename StructPtrType>
DeviceBoundSessionCredentialPtr DeviceBoundSessionCredential::Clone() const {
  return New(
      mojo::Clone(name),
      mojo::Clone(attributes)
  );
}

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

template <typename T, DeviceBoundSessionCredential::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.attributes < rhs.attributes)
    return true;
  if (rhs.attributes < lhs.attributes)
    return false;
  return false;
}
template <typename StructPtrType>
DeviceBoundSessionParamsPtr DeviceBoundSessionParams::Clone() const {
  return New(
      mojo::Clone(session_id),
      mojo::Clone(fetcher_url),
      mojo::Clone(refresh_url),
      mojo::Clone(scope),
      mojo::Clone(credentials),
      mojo::Clone(allowed_refresh_initiators)
  );
}

template <typename T, DeviceBoundSessionParams::EnableIfSame<T>*>
bool DeviceBoundSessionParams::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->session_id, other_struct.session_id))
    return false;
  if (!mojo::Equals(this->fetcher_url, other_struct.fetcher_url))
    return false;
  if (!mojo::Equals(this->refresh_url, other_struct.refresh_url))
    return false;
  if (!mojo::Equals(this->scope, other_struct.scope))
    return false;
  if (!mojo::Equals(this->credentials, other_struct.credentials))
    return false;
  if (!mojo::Equals(this->allowed_refresh_initiators, other_struct.allowed_refresh_initiators))
    return false;
  return true;
}

template <typename T, DeviceBoundSessionParams::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.session_id < rhs.session_id)
    return true;
  if (rhs.session_id < lhs.session_id)
    return false;
  if (lhs.fetcher_url < rhs.fetcher_url)
    return true;
  if (rhs.fetcher_url < lhs.fetcher_url)
    return false;
  if (lhs.refresh_url < rhs.refresh_url)
    return true;
  if (rhs.refresh_url < lhs.refresh_url)
    return false;
  if (lhs.scope < rhs.scope)
    return true;
  if (rhs.scope < lhs.scope)
    return false;
  if (lhs.credentials < rhs.credentials)
    return true;
  if (rhs.credentials < lhs.credentials)
    return false;
  if (lhs.allowed_refresh_initiators < rhs.allowed_refresh_initiators)
    return true;
  if (rhs.allowed_refresh_initiators < lhs.allowed_refresh_initiators)
    return false;
  return false;
}
template <typename StructPtrType>
DeviceBoundSessionCookieCravingDisplayPtr DeviceBoundSessionCookieCravingDisplay::Clone() const {
  return New(
      mojo::Clone(name),
      mojo::Clone(domain),
      mojo::Clone(path),
      mojo::Clone(secure),
      mojo::Clone(http_only),
      mojo::Clone(same_site)
  );
}

template <typename T, DeviceBoundSessionCookieCravingDisplay::EnableIfSame<T>*>
bool DeviceBoundSessionCookieCravingDisplay::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->name, other_struct.name))
    return false;
  if (!mojo::Equals(this->domain, other_struct.domain))
    return false;
  if (!mojo::Equals(this->path, other_struct.path))
    return false;
  if (!mojo::Equals(this->secure, other_struct.secure))
    return false;
  if (!mojo::Equals(this->http_only, other_struct.http_only))
    return false;
  if (!mojo::Equals(this->same_site, other_struct.same_site))
    return false;
  return true;
}

template <typename T, DeviceBoundSessionCookieCravingDisplay::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.domain < rhs.domain)
    return true;
  if (rhs.domain < lhs.domain)
    return false;
  if (lhs.path < rhs.path)
    return true;
  if (rhs.path < lhs.path)
    return false;
  if (lhs.secure < rhs.secure)
    return true;
  if (rhs.secure < lhs.secure)
    return false;
  if (lhs.http_only < rhs.http_only)
    return true;
  if (rhs.http_only < lhs.http_only)
    return false;
  if (lhs.same_site < rhs.same_site)
    return true;
  if (rhs.same_site < lhs.same_site)
    return false;
  return false;
}
template <typename StructPtrType>
DeviceBoundSessionUrlRuleDisplayPtr DeviceBoundSessionUrlRuleDisplay::Clone() const {
  return New(
      mojo::Clone(rule_type),
      mojo::Clone(host_pattern),
      mojo::Clone(path_prefix)
  );
}

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

template <typename T, DeviceBoundSessionUrlRuleDisplay::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.rule_type < rhs.rule_type)
    return true;
  if (rhs.rule_type < lhs.rule_type)
    return false;
  if (lhs.host_pattern < rhs.host_pattern)
    return true;
  if (rhs.host_pattern < lhs.host_pattern)
    return false;
  if (lhs.path_prefix < rhs.path_prefix)
    return true;
  if (rhs.path_prefix < lhs.path_prefix)
    return false;
  return false;
}
template <typename StructPtrType>
DeviceBoundSessionInclusionRulesDisplayPtr DeviceBoundSessionInclusionRulesDisplay::Clone() const {
  return New(
      mojo::Clone(origin),
      mojo::Clone(include_site),
      mojo::Clone(url_rules)
  );
}

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

template <typename T, DeviceBoundSessionInclusionRulesDisplay::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.origin < rhs.origin)
    return true;
  if (rhs.origin < lhs.origin)
    return false;
  if (lhs.include_site < rhs.include_site)
    return true;
  if (rhs.include_site < lhs.include_site)
    return false;
  if (lhs.url_rules < rhs.url_rules)
    return true;
  if (rhs.url_rules < lhs.url_rules)
    return false;
  return false;
}
template <typename StructPtrType>
DeviceBoundSessionDisplayPtr DeviceBoundSessionDisplay::Clone() const {
  return New(
      mojo::Clone(key),
      mojo::Clone(refresh_url),
      mojo::Clone(inclusion_rules),
      mojo::Clone(cookie_cravings),
      mojo::Clone(expiry_date),
      mojo::Clone(cached_challenge),
      mojo::Clone(allowed_refresh_initiators)
  );
}

template <typename T, DeviceBoundSessionDisplay::EnableIfSame<T>*>
bool DeviceBoundSessionDisplay::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->key, other_struct.key))
    return false;
  if (!mojo::Equals(this->refresh_url, other_struct.refresh_url))
    return false;
  if (!mojo::Equals(this->inclusion_rules, other_struct.inclusion_rules))
    return false;
  if (!mojo::Equals(this->cookie_cravings, other_struct.cookie_cravings))
    return false;
  if (!mojo::Equals(this->expiry_date, other_struct.expiry_date))
    return false;
  if (!mojo::Equals(this->cached_challenge, other_struct.cached_challenge))
    return false;
  if (!mojo::Equals(this->allowed_refresh_initiators, other_struct.allowed_refresh_initiators))
    return false;
  return true;
}

template <typename T, DeviceBoundSessionDisplay::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.key < rhs.key)
    return true;
  if (rhs.key < lhs.key)
    return false;
  if (lhs.refresh_url < rhs.refresh_url)
    return true;
  if (rhs.refresh_url < lhs.refresh_url)
    return false;
  if (lhs.inclusion_rules < rhs.inclusion_rules)
    return true;
  if (rhs.inclusion_rules < lhs.inclusion_rules)
    return false;
  if (lhs.cookie_cravings < rhs.cookie_cravings)
    return true;
  if (rhs.cookie_cravings < lhs.cookie_cravings)
    return false;
  if (lhs.expiry_date < rhs.expiry_date)
    return true;
  if (rhs.expiry_date < lhs.expiry_date)
    return false;
  if (lhs.cached_challenge < rhs.cached_challenge)
    return true;
  if (rhs.cached_challenge < lhs.cached_challenge)
    return false;
  if (lhs.allowed_refresh_initiators < rhs.allowed_refresh_initiators)
    return true;
  if (rhs.allowed_refresh_initiators < lhs.allowed_refresh_initiators)
    return false;
  return false;
}
template <typename StructPtrType>
DeviceBoundSessionFailedRequestPtr DeviceBoundSessionFailedRequest::Clone() const {
  return New(
      mojo::Clone(request_url),
      mojo::Clone(net_error),
      mojo::Clone(response_error),
      mojo::Clone(response_error_body)
  );
}

template <typename T, DeviceBoundSessionFailedRequest::EnableIfSame<T>*>
bool DeviceBoundSessionFailedRequest::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->request_url, other_struct.request_url))
    return false;
  if (!mojo::Equals(this->net_error, other_struct.net_error))
    return false;
  if (!mojo::Equals(this->response_error, other_struct.response_error))
    return false;
  if (!mojo::Equals(this->response_error_body, other_struct.response_error_body))
    return false;
  return true;
}

template <typename T, DeviceBoundSessionFailedRequest::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.request_url < rhs.request_url)
    return true;
  if (rhs.request_url < lhs.request_url)
    return false;
  if (lhs.net_error < rhs.net_error)
    return true;
  if (rhs.net_error < lhs.net_error)
    return false;
  if (lhs.response_error < rhs.response_error)
    return true;
  if (rhs.response_error < lhs.response_error)
    return false;
  if (lhs.response_error_body < rhs.response_error_body)
    return true;
  if (rhs.response_error_body < lhs.response_error_body)
    return false;
  return false;
}
template <typename StructPtrType>
DeviceBoundSessionCreationDetailsPtr DeviceBoundSessionCreationDetails::Clone() const {
  return New(
      mojo::Clone(fetch_error),
      mojo::Clone(new_session_display),
      mojo::Clone(failed_request)
  );
}

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

template <typename T, DeviceBoundSessionCreationDetails::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.fetch_error < rhs.fetch_error)
    return true;
  if (rhs.fetch_error < lhs.fetch_error)
    return false;
  if (lhs.new_session_display < rhs.new_session_display)
    return true;
  if (rhs.new_session_display < lhs.new_session_display)
    return false;
  if (lhs.failed_request < rhs.failed_request)
    return true;
  if (rhs.failed_request < lhs.failed_request)
    return false;
  return false;
}
template <typename StructPtrType>
DeviceBoundSessionRefreshDetailsPtr DeviceBoundSessionRefreshDetails::Clone() const {
  return New(
      mojo::Clone(refresh_result),
      mojo::Clone(fetch_error),
      mojo::Clone(new_session_display),
      mojo::Clone(was_fully_proactive_refresh),
      mojo::Clone(failed_request)
  );
}

template <typename T, DeviceBoundSessionRefreshDetails::EnableIfSame<T>*>
bool DeviceBoundSessionRefreshDetails::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->refresh_result, other_struct.refresh_result))
    return false;
  if (!mojo::Equals(this->fetch_error, other_struct.fetch_error))
    return false;
  if (!mojo::Equals(this->new_session_display, other_struct.new_session_display))
    return false;
  if (!mojo::Equals(this->was_fully_proactive_refresh, other_struct.was_fully_proactive_refresh))
    return false;
  if (!mojo::Equals(this->failed_request, other_struct.failed_request))
    return false;
  return true;
}

template <typename T, DeviceBoundSessionRefreshDetails::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.refresh_result < rhs.refresh_result)
    return true;
  if (rhs.refresh_result < lhs.refresh_result)
    return false;
  if (lhs.fetch_error < rhs.fetch_error)
    return true;
  if (rhs.fetch_error < lhs.fetch_error)
    return false;
  if (lhs.new_session_display < rhs.new_session_display)
    return true;
  if (rhs.new_session_display < lhs.new_session_display)
    return false;
  if (lhs.was_fully_proactive_refresh < rhs.was_fully_proactive_refresh)
    return true;
  if (rhs.was_fully_proactive_refresh < lhs.was_fully_proactive_refresh)
    return false;
  if (lhs.failed_request < rhs.failed_request)
    return true;
  if (rhs.failed_request < lhs.failed_request)
    return false;
  return false;
}
template <typename StructPtrType>
DeviceBoundSessionTerminationDetailsPtr DeviceBoundSessionTerminationDetails::Clone() const {
  return New(
      mojo::Clone(deletion_reason)
  );
}

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

template <typename T, DeviceBoundSessionTerminationDetails::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.deletion_reason < rhs.deletion_reason)
    return true;
  if (rhs.deletion_reason < lhs.deletion_reason)
    return false;
  return false;
}
template <typename StructPtrType>
DeviceBoundSessionChallengeDetailsPtr DeviceBoundSessionChallengeDetails::Clone() const {
  return New(
      mojo::Clone(challenge_result),
      mojo::Clone(challenge)
  );
}

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

template <typename T, DeviceBoundSessionChallengeDetails::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.challenge_result < rhs.challenge_result)
    return true;
  if (rhs.challenge_result < lhs.challenge_result)
    return false;
  if (lhs.challenge < rhs.challenge)
    return true;
  if (rhs.challenge < lhs.challenge)
    return false;
  return false;
}
template <typename StructPtrType>
DeviceBoundSessionEventPtr DeviceBoundSessionEvent::Clone() const {
  return New(
      mojo::Clone(event_id),
      mojo::Clone(site),
      mojo::Clone(session_id),
      mojo::Clone(succeeded),
      mojo::Clone(event_type_details)
  );
}

template <typename T, DeviceBoundSessionEvent::EnableIfSame<T>*>
bool DeviceBoundSessionEvent::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->event_id, other_struct.event_id))
    return false;
  if (!mojo::Equals(this->site, other_struct.site))
    return false;
  if (!mojo::Equals(this->session_id, other_struct.session_id))
    return false;
  if (!mojo::Equals(this->succeeded, other_struct.succeeded))
    return false;
  if (!mojo::Equals(this->event_type_details, other_struct.event_type_details))
    return false;
  return true;
}

template <typename T, DeviceBoundSessionEvent::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.event_id < rhs.event_id)
    return true;
  if (rhs.event_id < lhs.event_id)
    return false;
  if (lhs.site < rhs.site)
    return true;
  if (rhs.site < lhs.site)
    return false;
  if (lhs.session_id < rhs.session_id)
    return true;
  if (rhs.session_id < lhs.session_id)
    return false;
  if (lhs.succeeded < rhs.succeeded)
    return true;
  if (rhs.succeeded < lhs.succeeded)
    return false;
  if (lhs.event_type_details < rhs.event_type_details)
    return true;
  if (rhs.event_type_details < lhs.event_type_details)
    return false;
  return false;
}


}  // network::mojom

namespace mojo {


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

  static const decltype(::network::mojom::DeviceBoundSessionKey::site)& site(
      const ::network::mojom::DeviceBoundSessionKeyPtr& input) {
    return input->site;
  }

  static const decltype(::network::mojom::DeviceBoundSessionKey::id)& id(
      const ::network::mojom::DeviceBoundSessionKeyPtr& input) {
    return input->id;
  }

  static bool Read(::network::mojom::DeviceBoundSessionKey::DataView input, ::network::mojom::DeviceBoundSessionKeyPtr* output);
};


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

  static decltype(::network::mojom::DeviceBoundSessionAccess::access_type) access_type(
      const ::network::mojom::DeviceBoundSessionAccessPtr& input) {
    return input->access_type;
  }

  static const decltype(::network::mojom::DeviceBoundSessionAccess::session_key)& session_key(
      const ::network::mojom::DeviceBoundSessionAccessPtr& input) {
    return input->session_key;
  }

  static const decltype(::network::mojom::DeviceBoundSessionAccess::cookies)& cookies(
      const ::network::mojom::DeviceBoundSessionAccessPtr& input) {
    return input->cookies;
  }

  static bool Read(::network::mojom::DeviceBoundSessionAccess::DataView input, ::network::mojom::DeviceBoundSessionAccessPtr* output);
};


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

  static const decltype(::network::mojom::DeviceBoundSessionWithUsage::session_key)& session_key(
      const ::network::mojom::DeviceBoundSessionWithUsagePtr& input) {
    return input->session_key;
  }

  static decltype(::network::mojom::DeviceBoundSessionWithUsage::usage) usage(
      const ::network::mojom::DeviceBoundSessionWithUsagePtr& input) {
    return input->usage;
  }

  static bool Read(::network::mojom::DeviceBoundSessionWithUsage::DataView input, ::network::mojom::DeviceBoundSessionWithUsagePtr* output);
};


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

  static decltype(::network::mojom::DeviceBoundSessionScopeSpecification::type) type(
      const ::network::mojom::DeviceBoundSessionScopeSpecificationPtr& input) {
    return input->type;
  }

  static const decltype(::network::mojom::DeviceBoundSessionScopeSpecification::domain)& domain(
      const ::network::mojom::DeviceBoundSessionScopeSpecificationPtr& input) {
    return input->domain;
  }

  static const decltype(::network::mojom::DeviceBoundSessionScopeSpecification::path)& path(
      const ::network::mojom::DeviceBoundSessionScopeSpecificationPtr& input) {
    return input->path;
  }

  static bool Read(::network::mojom::DeviceBoundSessionScopeSpecification::DataView input, ::network::mojom::DeviceBoundSessionScopeSpecificationPtr* output);
};


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

  static decltype(::network::mojom::DeviceBoundSessionScope::include_site) include_site(
      const ::network::mojom::DeviceBoundSessionScopePtr& input) {
    return input->include_site;
  }

  static const decltype(::network::mojom::DeviceBoundSessionScope::specifications)& specifications(
      const ::network::mojom::DeviceBoundSessionScopePtr& input) {
    return input->specifications;
  }

  static const decltype(::network::mojom::DeviceBoundSessionScope::origin)& origin(
      const ::network::mojom::DeviceBoundSessionScopePtr& input) {
    return input->origin;
  }

  static bool Read(::network::mojom::DeviceBoundSessionScope::DataView input, ::network::mojom::DeviceBoundSessionScopePtr* output);
};


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

  static const decltype(::network::mojom::DeviceBoundSessionCredential::name)& name(
      const ::network::mojom::DeviceBoundSessionCredentialPtr& input) {
    return input->name;
  }

  static const decltype(::network::mojom::DeviceBoundSessionCredential::attributes)& attributes(
      const ::network::mojom::DeviceBoundSessionCredentialPtr& input) {
    return input->attributes;
  }

  static bool Read(::network::mojom::DeviceBoundSessionCredential::DataView input, ::network::mojom::DeviceBoundSessionCredentialPtr* output);
};


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

  static const decltype(::network::mojom::DeviceBoundSessionParams::session_id)& session_id(
      const ::network::mojom::DeviceBoundSessionParamsPtr& input) {
    return input->session_id;
  }

  static const decltype(::network::mojom::DeviceBoundSessionParams::fetcher_url)& fetcher_url(
      const ::network::mojom::DeviceBoundSessionParamsPtr& input) {
    return input->fetcher_url;
  }

  static const decltype(::network::mojom::DeviceBoundSessionParams::refresh_url)& refresh_url(
      const ::network::mojom::DeviceBoundSessionParamsPtr& input) {
    return input->refresh_url;
  }

  static const decltype(::network::mojom::DeviceBoundSessionParams::scope)& scope(
      const ::network::mojom::DeviceBoundSessionParamsPtr& input) {
    return input->scope;
  }

  static const decltype(::network::mojom::DeviceBoundSessionParams::credentials)& credentials(
      const ::network::mojom::DeviceBoundSessionParamsPtr& input) {
    return input->credentials;
  }

  static const decltype(::network::mojom::DeviceBoundSessionParams::allowed_refresh_initiators)& allowed_refresh_initiators(
      const ::network::mojom::DeviceBoundSessionParamsPtr& input) {
    return input->allowed_refresh_initiators;
  }

  static bool Read(::network::mojom::DeviceBoundSessionParams::DataView input, ::network::mojom::DeviceBoundSessionParamsPtr* output);
};


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

  static const decltype(::network::mojom::DeviceBoundSessionCookieCravingDisplay::name)& name(
      const ::network::mojom::DeviceBoundSessionCookieCravingDisplayPtr& input) {
    return input->name;
  }

  static const decltype(::network::mojom::DeviceBoundSessionCookieCravingDisplay::domain)& domain(
      const ::network::mojom::DeviceBoundSessionCookieCravingDisplayPtr& input) {
    return input->domain;
  }

  static const decltype(::network::mojom::DeviceBoundSessionCookieCravingDisplay::path)& path(
      const ::network::mojom::DeviceBoundSessionCookieCravingDisplayPtr& input) {
    return input->path;
  }

  static decltype(::network::mojom::DeviceBoundSessionCookieCravingDisplay::secure) secure(
      const ::network::mojom::DeviceBoundSessionCookieCravingDisplayPtr& input) {
    return input->secure;
  }

  static decltype(::network::mojom::DeviceBoundSessionCookieCravingDisplay::http_only) http_only(
      const ::network::mojom::DeviceBoundSessionCookieCravingDisplayPtr& input) {
    return input->http_only;
  }

  static decltype(::network::mojom::DeviceBoundSessionCookieCravingDisplay::same_site) same_site(
      const ::network::mojom::DeviceBoundSessionCookieCravingDisplayPtr& input) {
    return input->same_site;
  }

  static bool Read(::network::mojom::DeviceBoundSessionCookieCravingDisplay::DataView input, ::network::mojom::DeviceBoundSessionCookieCravingDisplayPtr* output);
};


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

  static decltype(::network::mojom::DeviceBoundSessionUrlRuleDisplay::rule_type) rule_type(
      const ::network::mojom::DeviceBoundSessionUrlRuleDisplayPtr& input) {
    return input->rule_type;
  }

  static const decltype(::network::mojom::DeviceBoundSessionUrlRuleDisplay::host_pattern)& host_pattern(
      const ::network::mojom::DeviceBoundSessionUrlRuleDisplayPtr& input) {
    return input->host_pattern;
  }

  static const decltype(::network::mojom::DeviceBoundSessionUrlRuleDisplay::path_prefix)& path_prefix(
      const ::network::mojom::DeviceBoundSessionUrlRuleDisplayPtr& input) {
    return input->path_prefix;
  }

  static bool Read(::network::mojom::DeviceBoundSessionUrlRuleDisplay::DataView input, ::network::mojom::DeviceBoundSessionUrlRuleDisplayPtr* output);
};


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

  static const decltype(::network::mojom::DeviceBoundSessionInclusionRulesDisplay::origin)& origin(
      const ::network::mojom::DeviceBoundSessionInclusionRulesDisplayPtr& input) {
    return input->origin;
  }

  static decltype(::network::mojom::DeviceBoundSessionInclusionRulesDisplay::include_site) include_site(
      const ::network::mojom::DeviceBoundSessionInclusionRulesDisplayPtr& input) {
    return input->include_site;
  }

  static const decltype(::network::mojom::DeviceBoundSessionInclusionRulesDisplay::url_rules)& url_rules(
      const ::network::mojom::DeviceBoundSessionInclusionRulesDisplayPtr& input) {
    return input->url_rules;
  }

  static bool Read(::network::mojom::DeviceBoundSessionInclusionRulesDisplay::DataView input, ::network::mojom::DeviceBoundSessionInclusionRulesDisplayPtr* output);
};


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

  static const decltype(::network::mojom::DeviceBoundSessionDisplay::key)& key(
      const ::network::mojom::DeviceBoundSessionDisplayPtr& input) {
    return input->key;
  }

  static const decltype(::network::mojom::DeviceBoundSessionDisplay::refresh_url)& refresh_url(
      const ::network::mojom::DeviceBoundSessionDisplayPtr& input) {
    return input->refresh_url;
  }

  static const decltype(::network::mojom::DeviceBoundSessionDisplay::inclusion_rules)& inclusion_rules(
      const ::network::mojom::DeviceBoundSessionDisplayPtr& input) {
    return input->inclusion_rules;
  }

  static const decltype(::network::mojom::DeviceBoundSessionDisplay::cookie_cravings)& cookie_cravings(
      const ::network::mojom::DeviceBoundSessionDisplayPtr& input) {
    return input->cookie_cravings;
  }

  static const decltype(::network::mojom::DeviceBoundSessionDisplay::expiry_date)& expiry_date(
      const ::network::mojom::DeviceBoundSessionDisplayPtr& input) {
    return input->expiry_date;
  }

  static const decltype(::network::mojom::DeviceBoundSessionDisplay::cached_challenge)& cached_challenge(
      const ::network::mojom::DeviceBoundSessionDisplayPtr& input) {
    return input->cached_challenge;
  }

  static const decltype(::network::mojom::DeviceBoundSessionDisplay::allowed_refresh_initiators)& allowed_refresh_initiators(
      const ::network::mojom::DeviceBoundSessionDisplayPtr& input) {
    return input->allowed_refresh_initiators;
  }

  static bool Read(::network::mojom::DeviceBoundSessionDisplay::DataView input, ::network::mojom::DeviceBoundSessionDisplayPtr* output);
};


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

  static const decltype(::network::mojom::DeviceBoundSessionFailedRequest::request_url)& request_url(
      const ::network::mojom::DeviceBoundSessionFailedRequestPtr& input) {
    return input->request_url;
  }

  static decltype(::network::mojom::DeviceBoundSessionFailedRequest::net_error) net_error(
      const ::network::mojom::DeviceBoundSessionFailedRequestPtr& input) {
    return input->net_error;
  }

  static decltype(::network::mojom::DeviceBoundSessionFailedRequest::response_error) response_error(
      const ::network::mojom::DeviceBoundSessionFailedRequestPtr& input) {
    return input->response_error;
  }

  static const decltype(::network::mojom::DeviceBoundSessionFailedRequest::response_error_body)& response_error_body(
      const ::network::mojom::DeviceBoundSessionFailedRequestPtr& input) {
    return input->response_error_body;
  }

  static bool Read(::network::mojom::DeviceBoundSessionFailedRequest::DataView input, ::network::mojom::DeviceBoundSessionFailedRequestPtr* output);
};


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

  static decltype(::network::mojom::DeviceBoundSessionCreationDetails::fetch_error) fetch_error(
      const ::network::mojom::DeviceBoundSessionCreationDetailsPtr& input) {
    return input->fetch_error;
  }

  static const decltype(::network::mojom::DeviceBoundSessionCreationDetails::new_session_display)& new_session_display(
      const ::network::mojom::DeviceBoundSessionCreationDetailsPtr& input) {
    return input->new_session_display;
  }

  static const decltype(::network::mojom::DeviceBoundSessionCreationDetails::failed_request)& failed_request(
      const ::network::mojom::DeviceBoundSessionCreationDetailsPtr& input) {
    return input->failed_request;
  }

  static bool Read(::network::mojom::DeviceBoundSessionCreationDetails::DataView input, ::network::mojom::DeviceBoundSessionCreationDetailsPtr* output);
};


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

  static decltype(::network::mojom::DeviceBoundSessionRefreshDetails::refresh_result) refresh_result(
      const ::network::mojom::DeviceBoundSessionRefreshDetailsPtr& input) {
    return input->refresh_result;
  }

  static decltype(::network::mojom::DeviceBoundSessionRefreshDetails::fetch_error) fetch_error(
      const ::network::mojom::DeviceBoundSessionRefreshDetailsPtr& input) {
    return input->fetch_error;
  }

  static const decltype(::network::mojom::DeviceBoundSessionRefreshDetails::new_session_display)& new_session_display(
      const ::network::mojom::DeviceBoundSessionRefreshDetailsPtr& input) {
    return input->new_session_display;
  }

  static decltype(::network::mojom::DeviceBoundSessionRefreshDetails::was_fully_proactive_refresh) was_fully_proactive_refresh(
      const ::network::mojom::DeviceBoundSessionRefreshDetailsPtr& input) {
    return input->was_fully_proactive_refresh;
  }

  static const decltype(::network::mojom::DeviceBoundSessionRefreshDetails::failed_request)& failed_request(
      const ::network::mojom::DeviceBoundSessionRefreshDetailsPtr& input) {
    return input->failed_request;
  }

  static bool Read(::network::mojom::DeviceBoundSessionRefreshDetails::DataView input, ::network::mojom::DeviceBoundSessionRefreshDetailsPtr* output);
};


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

  static decltype(::network::mojom::DeviceBoundSessionTerminationDetails::deletion_reason) deletion_reason(
      const ::network::mojom::DeviceBoundSessionTerminationDetailsPtr& input) {
    return input->deletion_reason;
  }

  static bool Read(::network::mojom::DeviceBoundSessionTerminationDetails::DataView input, ::network::mojom::DeviceBoundSessionTerminationDetailsPtr* output);
};


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

  static decltype(::network::mojom::DeviceBoundSessionChallengeDetails::challenge_result) challenge_result(
      const ::network::mojom::DeviceBoundSessionChallengeDetailsPtr& input) {
    return input->challenge_result;
  }

  static const decltype(::network::mojom::DeviceBoundSessionChallengeDetails::challenge)& challenge(
      const ::network::mojom::DeviceBoundSessionChallengeDetailsPtr& input) {
    return input->challenge;
  }

  static bool Read(::network::mojom::DeviceBoundSessionChallengeDetails::DataView input, ::network::mojom::DeviceBoundSessionChallengeDetailsPtr* output);
};


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

  static const decltype(::network::mojom::DeviceBoundSessionEvent::event_id)& event_id(
      const ::network::mojom::DeviceBoundSessionEventPtr& input) {
    return input->event_id;
  }

  static const decltype(::network::mojom::DeviceBoundSessionEvent::site)& site(
      const ::network::mojom::DeviceBoundSessionEventPtr& input) {
    return input->site;
  }

  static const decltype(::network::mojom::DeviceBoundSessionEvent::session_id)& session_id(
      const ::network::mojom::DeviceBoundSessionEventPtr& input) {
    return input->session_id;
  }

  static decltype(::network::mojom::DeviceBoundSessionEvent::succeeded) succeeded(
      const ::network::mojom::DeviceBoundSessionEventPtr& input) {
    return input->succeeded;
  }

  static const decltype(::network::mojom::DeviceBoundSessionEvent::event_type_details)& event_type_details(
      const ::network::mojom::DeviceBoundSessionEventPtr& input) {
    return input->event_type_details;
  }

  static bool Read(::network::mojom::DeviceBoundSessionEvent::DataView input, ::network::mojom::DeviceBoundSessionEventPtr* output);
};


template <>
struct  UnionTraits<::network::mojom::DeviceBoundSessionEventTypeDetails::DataView,
                                        ::network::mojom::DeviceBoundSessionEventTypeDetailsPtr> {
  static bool IsNull(const ::network::mojom::DeviceBoundSessionEventTypeDetailsPtr& input) { return !input; }
  static void SetToNull(::network::mojom::DeviceBoundSessionEventTypeDetailsPtr* output) { output->reset(); }

  static ::network::mojom::DeviceBoundSessionEventTypeDetails::Tag GetTag(const ::network::mojom::DeviceBoundSessionEventTypeDetailsPtr& input) {
    return input->which();
  }

  static const ::net::device_bound_sessions::CreationEventDetails& creation(const ::network::mojom::DeviceBoundSessionEventTypeDetailsPtr& input) {
    return input->get_creation();
  }

  static const ::net::device_bound_sessions::RefreshEventDetails& refresh(const ::network::mojom::DeviceBoundSessionEventTypeDetailsPtr& input) {
    return input->get_refresh();
  }

  static const ::net::device_bound_sessions::TerminationEventDetails& termination(const ::network::mojom::DeviceBoundSessionEventTypeDetailsPtr& input) {
    return input->get_termination();
  }

  static const ::net::device_bound_sessions::ChallengeEventDetails& challenge(const ::network::mojom::DeviceBoundSessionEventTypeDetailsPtr& input) {
    return input->get_challenge();
  }

  static bool Read(::network::mojom::DeviceBoundSessionEventTypeDetails::DataView input, ::network::mojom::DeviceBoundSessionEventTypeDetailsPtr* output);
};

}  // namespace mojo

#endif  // SERVICES_NETWORK_PUBLIC_MOJOM_DEVICE_BOUND_SESSIONS_MOJOM_H_