// services/network/public/mojom/device_bound_sessions.mojom-data-view.h is auto generated by mojom_bindings_generator.py, do not edit

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

// This file defines XDataView for type traits and can be included in
// _mojom_traits.h definitions but otherwise please use .mojom-forward.h,
// .mojom-shared.h or .mojom.h.

// IWYU pragma: private
// IWYU pragma: friend "traits"

#ifndef SERVICES_NETWORK_PUBLIC_MOJOM_DEVICE_BOUND_SESSIONS_MOJOM_DATA_VIEW_H_
#define SERVICES_NETWORK_PUBLIC_MOJOM_DEVICE_BOUND_SESSIONS_MOJOM_DATA_VIEW_H_

#include <stdint.h>

#include <functional>
#include <iosfwd>
#include <type_traits>
#include <utility>
#include "mojo/public/cpp/bindings/array_data_view.h"
#include "mojo/public/cpp/bindings/string_data_view.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"

#include "services/network/public/mojom/device_bound_sessions.mojom-shared-internal.h"
#include "mojo/public/mojom/base/time.mojom-shared.h"
#include "mojo/public/mojom/base/unguessable_token.mojom-shared.h"
#include "sandbox/policy/mojom/context.mojom-shared.h"
#include "services/network/public/mojom/clear_data_filter.mojom-shared.h"
#include "services/network/public/mojom/cookie_manager.mojom-shared.h"
#include "services/network/public/mojom/schemeful_site.mojom-shared.h"
#include "url/mojom/url.mojom-shared.h"


namespace network::mojom {
class DeviceBoundSessionKeyDataView;

class DeviceBoundSessionAccessDataView;

class DeviceBoundSessionWithUsageDataView;

class DeviceBoundSessionScopeSpecificationDataView;

class DeviceBoundSessionScopeDataView;

class DeviceBoundSessionCredentialDataView;

class DeviceBoundSessionParamsDataView;

class DeviceBoundSessionCookieCravingDisplayDataView;

class DeviceBoundSessionUrlRuleDisplayDataView;

class DeviceBoundSessionInclusionRulesDisplayDataView;

class DeviceBoundSessionDisplayDataView;

class DeviceBoundSessionFailedRequestDataView;

class DeviceBoundSessionCreationDetailsDataView;

class DeviceBoundSessionRefreshDetailsDataView;

class DeviceBoundSessionTerminationDetailsDataView;

class DeviceBoundSessionChallengeDetailsDataView;

class DeviceBoundSessionEventDataView;

class DeviceBoundSessionEventTypeDetailsDataView;


}  // network::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::network::mojom::DeviceBoundSessionKeyDataView> {
  using Data = ::network::mojom::internal::DeviceBoundSessionKey_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::DeviceBoundSessionAccessDataView> {
  using Data = ::network::mojom::internal::DeviceBoundSessionAccess_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::DeviceBoundSessionWithUsageDataView> {
  using Data = ::network::mojom::internal::DeviceBoundSessionWithUsage_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::DeviceBoundSessionScopeSpecificationDataView> {
  using Data = ::network::mojom::internal::DeviceBoundSessionScopeSpecification_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::DeviceBoundSessionScopeDataView> {
  using Data = ::network::mojom::internal::DeviceBoundSessionScope_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::DeviceBoundSessionCredentialDataView> {
  using Data = ::network::mojom::internal::DeviceBoundSessionCredential_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::DeviceBoundSessionParamsDataView> {
  using Data = ::network::mojom::internal::DeviceBoundSessionParams_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::DeviceBoundSessionCookieCravingDisplayDataView> {
  using Data = ::network::mojom::internal::DeviceBoundSessionCookieCravingDisplay_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::DeviceBoundSessionUrlRuleDisplayDataView> {
  using Data = ::network::mojom::internal::DeviceBoundSessionUrlRuleDisplay_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::DeviceBoundSessionInclusionRulesDisplayDataView> {
  using Data = ::network::mojom::internal::DeviceBoundSessionInclusionRulesDisplay_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::DeviceBoundSessionDisplayDataView> {
  using Data = ::network::mojom::internal::DeviceBoundSessionDisplay_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::DeviceBoundSessionFailedRequestDataView> {
  using Data = ::network::mojom::internal::DeviceBoundSessionFailedRequest_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::DeviceBoundSessionCreationDetailsDataView> {
  using Data = ::network::mojom::internal::DeviceBoundSessionCreationDetails_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::DeviceBoundSessionRefreshDetailsDataView> {
  using Data = ::network::mojom::internal::DeviceBoundSessionRefreshDetails_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::DeviceBoundSessionTerminationDetailsDataView> {
  using Data = ::network::mojom::internal::DeviceBoundSessionTerminationDetails_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::DeviceBoundSessionChallengeDetailsDataView> {
  using Data = ::network::mojom::internal::DeviceBoundSessionChallengeDetails_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::DeviceBoundSessionEventDataView> {
  using Data = ::network::mojom::internal::DeviceBoundSessionEvent_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::network::mojom::DeviceBoundSessionEventTypeDetailsDataView> {
  using Data = ::network::mojom::internal::DeviceBoundSessionEventTypeDetails_Data;
  using DataAsArrayElement = Data;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kUnion;
};

}  // namespace internal
}  // namespace mojo


namespace network::mojom {


enum class DeviceBoundSessionAccessType : int32_t {
  
  kCreation = 0,
  
  kUpdate = 1,
  
  kTermination = 2,
  kMinValue = 0,
  kMaxValue = 2,
};

 std::ostream& operator<<(std::ostream& os, DeviceBoundSessionAccessType value);
inline bool IsKnownEnumValue(DeviceBoundSessionAccessType value) {
  return internal::DeviceBoundSessionAccessType_Data::IsKnownValue(
      static_cast<int32_t>(value));
}

// Returns true if the enum has an infallible conversion from the mojom enum.
consteval bool HasInfallibleConversion(DeviceBoundSessionAccessType) {
  return true;
}


enum class DeviceBoundSessionUsage : int32_t {
  
  kUnknown = 0,
  
  kNoSiteMatchNotInScope = 1,
  
  kSiteMatchNotInScope = 2,
  
  kInScopeRefreshNotYetNeeded = 3,
  
  kInScopeRefreshNotAllowed = 4,
  
  kInScopeProactiveRefreshNotPossible = 5,
  
  kInScopeProactiveRefreshAttempted = 6,
  
  kDeferred = 7,
  kMinValue = 0,
  kMaxValue = 7,
};

 std::ostream& operator<<(std::ostream& os, DeviceBoundSessionUsage value);
inline bool IsKnownEnumValue(DeviceBoundSessionUsage value) {
  return internal::DeviceBoundSessionUsage_Data::IsKnownValue(
      static_cast<int32_t>(value));
}

// Returns true if the enum has an infallible conversion from the mojom enum.
consteval bool HasInfallibleConversion(DeviceBoundSessionUsage) {
  return true;
}


enum class DeviceBoundSessionDeletionReason : int32_t {
  
  kExpired = 0,
  
  kFailedToRestoreKey = 1,
  
  kFailedToUnwrapKey = 2,
  
  kStoragePartitionCleared = 3,
  
  kClearBrowsingData = 4,
  
  kServerRequested = 5,
  
  kInvalidSessionParams = 6,
  
  kRefreshFatalError = 7,
  
  kDevTools = 8,
  kMinValue = 0,
  kMaxValue = 8,
};

 std::ostream& operator<<(std::ostream& os, DeviceBoundSessionDeletionReason value);
inline bool IsKnownEnumValue(DeviceBoundSessionDeletionReason value) {
  return internal::DeviceBoundSessionDeletionReason_Data::IsKnownValue(
      static_cast<int32_t>(value));
}

// Returns true if the enum has an infallible conversion from the mojom enum.
consteval bool HasInfallibleConversion(DeviceBoundSessionDeletionReason) {
  return true;
}


enum class DeviceBoundSessionScopeSpecificationType : int32_t {
  
  kExclude = 0,
  
  kInclude = 1,
  kMinValue = 0,
  kMaxValue = 1,
};

 std::ostream& operator<<(std::ostream& os, DeviceBoundSessionScopeSpecificationType value);
inline bool IsKnownEnumValue(DeviceBoundSessionScopeSpecificationType value) {
  return internal::DeviceBoundSessionScopeSpecificationType_Data::IsKnownValue(
      static_cast<int32_t>(value));
}

// Returns true if the enum has an infallible conversion from the mojom enum.
consteval bool HasInfallibleConversion(DeviceBoundSessionScopeSpecificationType) {
  return true;
}


enum class DeviceBoundSessionError : int32_t {
  
  kSuccess = 0,
  
  kSigningKeyGenerationError = 1,
  
  kSigningError = 2,
  
  kServerRequestedTermination = 5,
  
  kInvalidSessionId = 7,
  
  kInvalidChallenge = 9,
  
  kTooManyChallenges = 10,
  
  kInvalidFetcherUrl = 11,
  
  kInvalidRefreshUrl = 12,
  
  kTransientHttpError = 13,
  
  kScopeOriginSameSiteMismatch = 15,
  
  kRefreshUrlSameSiteMismatch = 16,
  
  kMismatchedSessionId = 18,
  
  kMissingScope = 21,
  
  kNoCredentials = 22,
  
  kSubdomainRegistrationWellKnownUnavailable = 24,
  
  kSubdomainRegistrationUnauthorized = 25,
  
  kSubdomainRegistrationWellKnownMalformed = 26,
  
  kSessionProviderWellKnownUnavailable = 28,
  
  kRelyingPartyWellKnownUnavailable = 30,
  
  kFederatedKeyThumbprintMismatch = 32,
  
  kInvalidFederatedSessionUrl = 33,
  
  kInvalidFederatedKey = 35,
  
  kTooManyRelyingOriginLabels = 36,
  
  kBoundCookieSetForbidden = 37,
  
  kNetError = 38,
  
  kProxyError = 39,
  
  kEmptySessionConfig = 41,
  
  kInvalidCredentialsConfig = 42,
  
  kInvalidCredentialsType = 43,
  
  kInvalidCredentialsEmptyName = 44,
  
  kInvalidCredentialsCookie = 45,
  
  kPersistentHttpError = 46,
  
  kRegistrationAttemptedChallenge = 47,
  
  kInvalidScopeOrigin = 48,
  
  kScopeOriginContainsPath = 49,
  
  kRefreshInitiatorNotString = 50,
  
  kRefreshInitiatorInvalidHostPattern = 51,
  
  kInvalidScopeSpecification = 52,
  
  kMissingScopeSpecificationType = 53,
  
  kEmptyScopeSpecificationDomain = 54,
  
  kEmptyScopeSpecificationPath = 55,
  
  kInvalidScopeSpecificationType = 56,
  
  kInvalidScopeIncludeSite = 57,
  
  kMissingScopeIncludeSite = 58,
  
  kFederatedNotAuthorizedByProvider = 59,
  
  kFederatedNotAuthorizedByRelyingParty = 60,
  
  kSessionProviderWellKnownMalformed = 61,
  
  kSessionProviderWellKnownHasProviderOrigin = 62,
  
  kRelyingPartyWellKnownMalformed = 63,
  
  kRelyingPartyWellKnownHasRelyingOrigins = 64,
  
  kInvalidFederatedSessionProviderSessionMissing = 65,
  
  kInvalidFederatedSessionWrongProviderOrigin = 66,
  
  kInvalidCredentialsCookieCreationTime = 67,
  
  kInvalidCredentialsCookieName = 68,
  
  kInvalidCredentialsCookieParsing = 69,
  
  kInvalidCredentialsCookieUnpermittedAttribute = 70,
  
  kInvalidCredentialsCookieInvalidDomain = 71,
  
  kInvalidCredentialsCookiePrefix = 72,
  
  kInvalidScopeRulePath = 73,
  
  kInvalidScopeRuleHostPattern = 74,
  
  kScopeRuleOriginScopedHostPatternMismatch = 75,
  
  kScopeRuleSiteScopedHostPatternMismatch = 76,
  
  kSigningQuotaExceeded = 77,
  
  kInvalidConfigJson = 78,
  
  kInvalidFederatedSessionProviderFailedToRestoreKey = 79,
  
  kFailedToUnwrapKey = 80,
  
  kSessionDeletedDuringRefresh = 81,
  
  kTransientSigningError = 82,
  
  kCrossOriginRegistrationSiteNotIncluded = 83,
  
  kAttestationKeyGenerationError = 84,
  
  kInvalidPreProvisionedKeyInitiatorMissing = 85,
  
  kPreProvisionedKeyAccessNotGranted = 86,
  
  kPreProvisionedKeyNotFound = 87,
  
  kAttestationCertificationError = 88,
  
  kAttestationSigningError = 89,
  kMinValue = 0,
  kMaxValue = 89,
};

 std::ostream& operator<<(std::ostream& os, DeviceBoundSessionError value);
inline bool IsKnownEnumValue(DeviceBoundSessionError value) {
  return internal::DeviceBoundSessionError_Data::IsKnownValue(
      static_cast<int32_t>(value));
}

// Returns true if the enum has an infallible conversion from the mojom enum.
consteval bool HasInfallibleConversion(DeviceBoundSessionError) {
  return true;
}


enum class DeviceBoundSessionRefreshResult : int32_t {
  
  kRefreshed = 0,
  
  kInitializedService = 1,
  
  kUnreachable = 2,
  
  kServerError = 3,
  
  kFatalError = 5,
  
  kSigningQuotaExceeded = 6,
  
  kRefreshedAsWaiter = 7,
  
  kTransientSigningError = 8,
  
  kInScopeRefreshNotYetNeeded = 9,
  kMinValue = 0,
  kMaxValue = 9,
};

 std::ostream& operator<<(std::ostream& os, DeviceBoundSessionRefreshResult value);
inline bool IsKnownEnumValue(DeviceBoundSessionRefreshResult value) {
  return internal::DeviceBoundSessionRefreshResult_Data::IsKnownValue(
      static_cast<int32_t>(value));
}

// Returns true if the enum has an infallible conversion from the mojom enum.
consteval bool HasInfallibleConversion(DeviceBoundSessionRefreshResult) {
  return true;
}


enum class DeviceBoundSessionChallengeResult : int32_t {
  
  kSuccess = 0,
  
  kNoSessionId = 1,
  
  kNoSessionMatch = 2,
  
  kCantSetBoundCookie = 3,
  kMinValue = 0,
  kMaxValue = 3,
};

 std::ostream& operator<<(std::ostream& os, DeviceBoundSessionChallengeResult value);
inline bool IsKnownEnumValue(DeviceBoundSessionChallengeResult value) {
  return internal::DeviceBoundSessionChallengeResult_Data::IsKnownValue(
      static_cast<int32_t>(value));
}

// Returns true if the enum has an infallible conversion from the mojom enum.
consteval bool HasInfallibleConversion(DeviceBoundSessionChallengeResult) {
  return true;
}


enum class DeviceBoundSessionInclusionResult : int32_t {
  
  kExclude = 0,
  
  kInclude = 1,
  kMinValue = 0,
  kMaxValue = 1,
};

 std::ostream& operator<<(std::ostream& os, DeviceBoundSessionInclusionResult value);
inline bool IsKnownEnumValue(DeviceBoundSessionInclusionResult value) {
  return internal::DeviceBoundSessionInclusionResult_Data::IsKnownValue(
      static_cast<int32_t>(value));
}

// Returns true if the enum has an infallible conversion from the mojom enum.
consteval bool HasInfallibleConversion(DeviceBoundSessionInclusionResult) {
  return true;
}
// Interface base classes. They are used for type safety check.
class DeviceBoundSessionManagerInterfaceBase {};

using DeviceBoundSessionManagerPtrDataView =
    mojo::InterfacePtrDataView<DeviceBoundSessionManagerInterfaceBase>;
using DeviceBoundSessionManagerRequestDataView =
    mojo::InterfaceRequestDataView<DeviceBoundSessionManagerInterfaceBase>;
using DeviceBoundSessionManagerAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<DeviceBoundSessionManagerInterfaceBase>;
using DeviceBoundSessionManagerAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<DeviceBoundSessionManagerInterfaceBase>;
class DeviceBoundSessionAccessObserverInterfaceBase {};

using DeviceBoundSessionAccessObserverPtrDataView =
    mojo::InterfacePtrDataView<DeviceBoundSessionAccessObserverInterfaceBase>;
using DeviceBoundSessionAccessObserverRequestDataView =
    mojo::InterfaceRequestDataView<DeviceBoundSessionAccessObserverInterfaceBase>;
using DeviceBoundSessionAccessObserverAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<DeviceBoundSessionAccessObserverInterfaceBase>;
using DeviceBoundSessionAccessObserverAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<DeviceBoundSessionAccessObserverInterfaceBase>;
class DeviceBoundSessionEventObserverInterfaceBase {};

using DeviceBoundSessionEventObserverPtrDataView =
    mojo::InterfacePtrDataView<DeviceBoundSessionEventObserverInterfaceBase>;
using DeviceBoundSessionEventObserverRequestDataView =
    mojo::InterfaceRequestDataView<DeviceBoundSessionEventObserverInterfaceBase>;
using DeviceBoundSessionEventObserverAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<DeviceBoundSessionEventObserverInterfaceBase>;
using DeviceBoundSessionEventObserverAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<DeviceBoundSessionEventObserverInterfaceBase>;


class DeviceBoundSessionKeyDataView {
 public:
  DeviceBoundSessionKeyDataView() = default;

  DeviceBoundSessionKeyDataView(
      internal::DeviceBoundSessionKey_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetSiteDataView(
      ::network::mojom::SchemefulSiteDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadSite(UserType* output) {
    
    auto* pointer = data_->site.Get();
    return mojo::internal::Deserialize<::network::mojom::SchemefulSiteDataView>(
        pointer, output, message_);
  }
  inline void GetIdDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadId(UserType* output) {
    
    auto* pointer = data_->id.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
 private:
  internal::DeviceBoundSessionKey_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class DeviceBoundSessionAccessDataView {
 public:
  DeviceBoundSessionAccessDataView() = default;

  DeviceBoundSessionAccessDataView(
      internal::DeviceBoundSessionAccess_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  template <typename UserType>
  [[nodiscard]] bool ReadAccessType(UserType* output) const {
    auto data_value = data_->access_type;
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionAccessType>(
        data_value, output);
  }
  DeviceBoundSessionAccessType access_type() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::network::mojom::DeviceBoundSessionAccessType>(data_->access_type));
  }
  inline void GetSessionKeyDataView(
      DeviceBoundSessionKeyDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadSessionKey(UserType* output) {
    
    auto* pointer = data_->session_key.Get();
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionKeyDataView>(
        pointer, output, message_);
  }
  inline void GetCookiesDataView(
      mojo::ArrayDataView<mojo::StringDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadCookies(UserType* output) {
    
    auto* pointer = data_->cookies.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<mojo::StringDataView>>(
        pointer, output, message_);
  }
 private:
  internal::DeviceBoundSessionAccess_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class DeviceBoundSessionWithUsageDataView {
 public:
  DeviceBoundSessionWithUsageDataView() = default;

  DeviceBoundSessionWithUsageDataView(
      internal::DeviceBoundSessionWithUsage_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetSessionKeyDataView(
      DeviceBoundSessionKeyDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadSessionKey(UserType* output) {
    
    auto* pointer = data_->session_key.Get();
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionKeyDataView>(
        pointer, output, message_);
  }
  template <typename UserType>
  [[nodiscard]] bool ReadUsage(UserType* output) const {
    auto data_value = data_->usage;
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionUsage>(
        data_value, output);
  }
  DeviceBoundSessionUsage usage() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::network::mojom::DeviceBoundSessionUsage>(data_->usage));
  }
 private:
  internal::DeviceBoundSessionWithUsage_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class DeviceBoundSessionScopeSpecificationDataView {
 public:
  DeviceBoundSessionScopeSpecificationDataView() = default;

  DeviceBoundSessionScopeSpecificationDataView(
      internal::DeviceBoundSessionScopeSpecification_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  template <typename UserType>
  [[nodiscard]] bool ReadType(UserType* output) const {
    auto data_value = data_->type;
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionScopeSpecificationType>(
        data_value, output);
  }
  DeviceBoundSessionScopeSpecificationType type() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::network::mojom::DeviceBoundSessionScopeSpecificationType>(data_->type));
  }
  inline void GetDomainDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadDomain(UserType* output) {
    
    auto* pointer = data_->domain.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  inline void GetPathDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadPath(UserType* output) {
    
    auto* pointer = data_->path.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
 private:
  internal::DeviceBoundSessionScopeSpecification_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class DeviceBoundSessionScopeDataView {
 public:
  DeviceBoundSessionScopeDataView() = default;

  DeviceBoundSessionScopeDataView(
      internal::DeviceBoundSessionScope_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  bool include_site() const {
    return data_->include_site;
  }
  inline void GetSpecificationsDataView(
      mojo::ArrayDataView<DeviceBoundSessionScopeSpecificationDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadSpecifications(UserType* output) {
    
    auto* pointer = data_->specifications.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::network::mojom::DeviceBoundSessionScopeSpecificationDataView>>(
        pointer, output, message_);
  }
  inline void GetOriginDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadOrigin(UserType* output) {
    
    auto* pointer = data_->origin.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
 private:
  internal::DeviceBoundSessionScope_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class DeviceBoundSessionCredentialDataView {
 public:
  DeviceBoundSessionCredentialDataView() = default;

  DeviceBoundSessionCredentialDataView(
      internal::DeviceBoundSessionCredential_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetNameDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadName(UserType* output) {
    
    auto* pointer = data_->name.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  inline void GetAttributesDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadAttributes(UserType* output) {
    
    auto* pointer = data_->attributes.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
 private:
  internal::DeviceBoundSessionCredential_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class DeviceBoundSessionParamsDataView {
 public:
  DeviceBoundSessionParamsDataView() = default;

  DeviceBoundSessionParamsDataView(
      internal::DeviceBoundSessionParams_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetSessionIdDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadSessionId(UserType* output) {
    
    auto* pointer = data_->session_id.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  inline void GetFetcherUrlDataView(
      ::url::mojom::UrlDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadFetcherUrl(UserType* output) {
    
    auto* pointer = data_->fetcher_url.Get();
    return mojo::internal::Deserialize<::url::mojom::UrlDataView>(
        pointer, output, message_);
  }
  inline void GetRefreshUrlDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadRefreshUrl(UserType* output) {
    
    auto* pointer = data_->refresh_url.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  inline void GetScopeDataView(
      DeviceBoundSessionScopeDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadScope(UserType* output) {
    
    auto* pointer = data_->scope.Get();
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionScopeDataView>(
        pointer, output, message_);
  }
  inline void GetCredentialsDataView(
      mojo::ArrayDataView<DeviceBoundSessionCredentialDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadCredentials(UserType* output) {
    
    auto* pointer = data_->credentials.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::network::mojom::DeviceBoundSessionCredentialDataView>>(
        pointer, output, message_);
  }
  inline void GetAllowedRefreshInitiatorsDataView(
      mojo::ArrayDataView<mojo::StringDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadAllowedRefreshInitiators(UserType* output) {
    
    auto* pointer = data_->allowed_refresh_initiators.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<mojo::StringDataView>>(
        pointer, output, message_);
  }
 private:
  internal::DeviceBoundSessionParams_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class DeviceBoundSessionCookieCravingDisplayDataView {
 public:
  DeviceBoundSessionCookieCravingDisplayDataView() = default;

  DeviceBoundSessionCookieCravingDisplayDataView(
      internal::DeviceBoundSessionCookieCravingDisplay_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetNameDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadName(UserType* output) {
    
    auto* pointer = data_->name.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  inline void GetDomainDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadDomain(UserType* output) {
    
    auto* pointer = data_->domain.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  inline void GetPathDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadPath(UserType* output) {
    
    auto* pointer = data_->path.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  bool secure() const {
    return data_->secure;
  }
  bool http_only() const {
    return data_->http_only;
  }
  template <typename UserType>
  [[nodiscard]] bool ReadSameSite(UserType* output) const {
    auto data_value = data_->same_site;
    return mojo::internal::Deserialize<::network::mojom::CookieSameSite>(
        data_value, output);
  }
  ::network::mojom::CookieSameSite same_site() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::network::mojom::CookieSameSite>(data_->same_site));
  }
 private:
  internal::DeviceBoundSessionCookieCravingDisplay_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class DeviceBoundSessionUrlRuleDisplayDataView {
 public:
  DeviceBoundSessionUrlRuleDisplayDataView() = default;

  DeviceBoundSessionUrlRuleDisplayDataView(
      internal::DeviceBoundSessionUrlRuleDisplay_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  template <typename UserType>
  [[nodiscard]] bool ReadRuleType(UserType* output) const {
    auto data_value = data_->rule_type;
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionInclusionResult>(
        data_value, output);
  }
  DeviceBoundSessionInclusionResult rule_type() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::network::mojom::DeviceBoundSessionInclusionResult>(data_->rule_type));
  }
  inline void GetHostPatternDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadHostPattern(UserType* output) {
    
    auto* pointer = data_->host_pattern.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  inline void GetPathPrefixDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadPathPrefix(UserType* output) {
    
    auto* pointer = data_->path_prefix.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
 private:
  internal::DeviceBoundSessionUrlRuleDisplay_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class DeviceBoundSessionInclusionRulesDisplayDataView {
 public:
  DeviceBoundSessionInclusionRulesDisplayDataView() = default;

  DeviceBoundSessionInclusionRulesDisplayDataView(
      internal::DeviceBoundSessionInclusionRulesDisplay_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetOriginDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadOrigin(UserType* output) {
    
    auto* pointer = data_->origin.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  bool include_site() const {
    return data_->include_site;
  }
  inline void GetUrlRulesDataView(
      mojo::ArrayDataView<DeviceBoundSessionUrlRuleDisplayDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadUrlRules(UserType* output) {
    
    auto* pointer = data_->url_rules.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::network::mojom::DeviceBoundSessionUrlRuleDisplayDataView>>(
        pointer, output, message_);
  }
 private:
  internal::DeviceBoundSessionInclusionRulesDisplay_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class DeviceBoundSessionDisplayDataView {
 public:
  DeviceBoundSessionDisplayDataView() = default;

  DeviceBoundSessionDisplayDataView(
      internal::DeviceBoundSessionDisplay_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetKeyDataView(
      DeviceBoundSessionKeyDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadKey(UserType* output) {
    
    auto* pointer = data_->key.Get();
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionKeyDataView>(
        pointer, output, message_);
  }
  inline void GetRefreshUrlDataView(
      ::url::mojom::UrlDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadRefreshUrl(UserType* output) {
    
    auto* pointer = data_->refresh_url.Get();
    return mojo::internal::Deserialize<::url::mojom::UrlDataView>(
        pointer, output, message_);
  }
  inline void GetInclusionRulesDataView(
      DeviceBoundSessionInclusionRulesDisplayDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadInclusionRules(UserType* output) {
    
    auto* pointer = data_->inclusion_rules.Get();
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionInclusionRulesDisplayDataView>(
        pointer, output, message_);
  }
  inline void GetCookieCravingsDataView(
      mojo::ArrayDataView<DeviceBoundSessionCookieCravingDisplayDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadCookieCravings(UserType* output) {
    
    auto* pointer = data_->cookie_cravings.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::network::mojom::DeviceBoundSessionCookieCravingDisplayDataView>>(
        pointer, output, message_);
  }
  inline void GetExpiryDateDataView(
      ::mojo_base::mojom::TimeDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadExpiryDate(UserType* output) {
    
    auto* pointer = data_->expiry_date.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::TimeDataView>(
        pointer, output, message_);
  }
  inline void GetCachedChallengeDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadCachedChallenge(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        mojo::StringDataView, UserType>(),
    "Attempting to read the optional `cached_challenge` field into a type which "
    "cannot represent a null value. Either wrap the destination object "
    "with std::optional, ensure that any corresponding "
    "{Struct/Union/Array/String}Traits define the necessary IsNull and "
    "SetToNull methods, or use `MaybeReadCachedChallenge` instead "
    "of `ReadCachedChallenge if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->cached_challenge.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  inline void GetAllowedRefreshInitiatorsDataView(
      mojo::ArrayDataView<mojo::StringDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadAllowedRefreshInitiators(UserType* output) {
    
    auto* pointer = data_->allowed_refresh_initiators.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<mojo::StringDataView>>(
        pointer, output, message_);
  }
 private:
  internal::DeviceBoundSessionDisplay_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class DeviceBoundSessionFailedRequestDataView {
 public:
  DeviceBoundSessionFailedRequestDataView() = default;

  DeviceBoundSessionFailedRequestDataView(
      internal::DeviceBoundSessionFailedRequest_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetRequestUrlDataView(
      ::url::mojom::UrlDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadRequestUrl(UserType* output) {
    
    auto* pointer = data_->request_url.Get();
    return mojo::internal::Deserialize<::url::mojom::UrlDataView>(
        pointer, output, message_);
  }
  std::optional<int32_t> net_error() const {

    return data_->net_error_$flag
        ? std::make_optional(data_->net_error_$value)
        : std::nullopt;
  }
  std::optional<int32_t> response_error() const {

    return data_->response_error_$flag
        ? std::make_optional(data_->response_error_$value)
        : std::nullopt;
  }
  inline void GetResponseErrorBodyDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadResponseErrorBody(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        mojo::StringDataView, UserType>(),
    "Attempting to read the optional `response_error_body` field into a type which "
    "cannot represent a null value. Either wrap the destination object "
    "with std::optional, ensure that any corresponding "
    "{Struct/Union/Array/String}Traits define the necessary IsNull and "
    "SetToNull methods, or use `MaybeReadResponseErrorBody` instead "
    "of `ReadResponseErrorBody if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->response_error_body.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
 private:
  internal::DeviceBoundSessionFailedRequest_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class DeviceBoundSessionCreationDetailsDataView {
 public:
  DeviceBoundSessionCreationDetailsDataView() = default;

  DeviceBoundSessionCreationDetailsDataView(
      internal::DeviceBoundSessionCreationDetails_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  template <typename UserType>
  [[nodiscard]] bool ReadFetchError(UserType* output) const {
    auto data_value = data_->fetch_error;
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionError>(
        data_value, output);
  }
  DeviceBoundSessionError fetch_error() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::network::mojom::DeviceBoundSessionError>(data_->fetch_error));
  }
  inline void GetNewSessionDisplayDataView(
      DeviceBoundSessionDisplayDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadNewSessionDisplay(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        ::network::mojom::DeviceBoundSessionDisplayDataView, UserType>(),
    "Attempting to read the optional `new_session_display` field into a type which "
    "cannot represent a null value. Either wrap the destination object "
    "with std::optional, ensure that any corresponding "
    "{Struct/Union/Array/String}Traits define the necessary IsNull and "
    "SetToNull methods, or use `MaybeReadNewSessionDisplay` instead "
    "of `ReadNewSessionDisplay if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->new_session_display.Get();
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionDisplayDataView>(
        pointer, output, message_);
  }
  inline void GetFailedRequestDataView(
      DeviceBoundSessionFailedRequestDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadFailedRequest(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        ::network::mojom::DeviceBoundSessionFailedRequestDataView, UserType>(),
    "Attempting to read the optional `failed_request` field into a type which "
    "cannot represent a null value. Either wrap the destination object "
    "with std::optional, ensure that any corresponding "
    "{Struct/Union/Array/String}Traits define the necessary IsNull and "
    "SetToNull methods, or use `MaybeReadFailedRequest` instead "
    "of `ReadFailedRequest if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->failed_request.Get();
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionFailedRequestDataView>(
        pointer, output, message_);
  }
 private:
  internal::DeviceBoundSessionCreationDetails_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class DeviceBoundSessionRefreshDetailsDataView {
 public:
  DeviceBoundSessionRefreshDetailsDataView() = default;

  DeviceBoundSessionRefreshDetailsDataView(
      internal::DeviceBoundSessionRefreshDetails_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  template <typename UserType>
  [[nodiscard]] bool ReadRefreshResult(UserType* output) const {
    auto data_value = data_->refresh_result;
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionRefreshResult>(
        data_value, output);
  }
  DeviceBoundSessionRefreshResult refresh_result() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::network::mojom::DeviceBoundSessionRefreshResult>(data_->refresh_result));
  }
  template <typename UserType>
  [[nodiscard]] bool ReadFetchError(UserType* output) const {
    if (!data_->fetch_error_$flag) {
      *output = std::nullopt;
      return true;
    }

    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionError>(
        data_->fetch_error_$value, &output->emplace());
  }
  std::optional<DeviceBoundSessionError> fetch_error() const {
    if (!data_->fetch_error_$flag) {
      return std::nullopt;
    }
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::network::mojom::DeviceBoundSessionError>(data_->fetch_error_$value));
  }
  inline void GetNewSessionDisplayDataView(
      DeviceBoundSessionDisplayDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadNewSessionDisplay(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        ::network::mojom::DeviceBoundSessionDisplayDataView, UserType>(),
    "Attempting to read the optional `new_session_display` field into a type which "
    "cannot represent a null value. Either wrap the destination object "
    "with std::optional, ensure that any corresponding "
    "{Struct/Union/Array/String}Traits define the necessary IsNull and "
    "SetToNull methods, or use `MaybeReadNewSessionDisplay` instead "
    "of `ReadNewSessionDisplay if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->new_session_display.Get();
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionDisplayDataView>(
        pointer, output, message_);
  }
  bool was_fully_proactive_refresh() const {
    return data_->was_fully_proactive_refresh;
  }
  inline void GetFailedRequestDataView(
      DeviceBoundSessionFailedRequestDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadFailedRequest(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        ::network::mojom::DeviceBoundSessionFailedRequestDataView, UserType>(),
    "Attempting to read the optional `failed_request` field into a type which "
    "cannot represent a null value. Either wrap the destination object "
    "with std::optional, ensure that any corresponding "
    "{Struct/Union/Array/String}Traits define the necessary IsNull and "
    "SetToNull methods, or use `MaybeReadFailedRequest` instead "
    "of `ReadFailedRequest if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->failed_request.Get();
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionFailedRequestDataView>(
        pointer, output, message_);
  }
 private:
  internal::DeviceBoundSessionRefreshDetails_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class DeviceBoundSessionTerminationDetailsDataView {
 public:
  DeviceBoundSessionTerminationDetailsDataView() = default;

  DeviceBoundSessionTerminationDetailsDataView(
      internal::DeviceBoundSessionTerminationDetails_Data* data,
      mojo::Message* message)
      : data_(data) {}

  bool is_null() const { return !data_; }
  template <typename UserType>
  [[nodiscard]] bool ReadDeletionReason(UserType* output) const {
    auto data_value = data_->deletion_reason;
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionDeletionReason>(
        data_value, output);
  }
  DeviceBoundSessionDeletionReason deletion_reason() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::network::mojom::DeviceBoundSessionDeletionReason>(data_->deletion_reason));
  }
 private:
  internal::DeviceBoundSessionTerminationDetails_Data* data_ = nullptr;
};


class DeviceBoundSessionChallengeDetailsDataView {
 public:
  DeviceBoundSessionChallengeDetailsDataView() = default;

  DeviceBoundSessionChallengeDetailsDataView(
      internal::DeviceBoundSessionChallengeDetails_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  template <typename UserType>
  [[nodiscard]] bool ReadChallengeResult(UserType* output) const {
    auto data_value = data_->challenge_result;
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionChallengeResult>(
        data_value, output);
  }
  DeviceBoundSessionChallengeResult challenge_result() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::network::mojom::DeviceBoundSessionChallengeResult>(data_->challenge_result));
  }
  inline void GetChallengeDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadChallenge(UserType* output) {
    
    auto* pointer = data_->challenge.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
 private:
  internal::DeviceBoundSessionChallengeDetails_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class DeviceBoundSessionEventDataView {
 public:
  DeviceBoundSessionEventDataView() = default;

  DeviceBoundSessionEventDataView(
      internal::DeviceBoundSessionEvent_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetEventIdDataView(
      ::mojo_base::mojom::UnguessableTokenDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadEventId(UserType* output) {
    
    auto* pointer = data_->event_id.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::UnguessableTokenDataView>(
        pointer, output, message_);
  }
  inline void GetSiteDataView(
      ::network::mojom::SchemefulSiteDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadSite(UserType* output) {
    
    auto* pointer = data_->site.Get();
    return mojo::internal::Deserialize<::network::mojom::SchemefulSiteDataView>(
        pointer, output, message_);
  }
  inline void GetSessionIdDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadSessionId(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        mojo::StringDataView, UserType>(),
    "Attempting to read the optional `session_id` field into a type which "
    "cannot represent a null value. Either wrap the destination object "
    "with std::optional, ensure that any corresponding "
    "{Struct/Union/Array/String}Traits define the necessary IsNull and "
    "SetToNull methods, or use `MaybeReadSessionId` instead "
    "of `ReadSessionId if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->session_id.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  bool succeeded() const {
    return data_->succeeded;
  }
  inline void GetEventTypeDetailsDataView(
      DeviceBoundSessionEventTypeDetailsDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadEventTypeDetails(UserType* output) {
    
    auto* pointer = !data_->event_type_details.is_null() ? &data_->event_type_details : nullptr;
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionEventTypeDetailsDataView>(
        pointer, output, message_);
  }
 private:
  internal::DeviceBoundSessionEvent_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


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

  DeviceBoundSessionEventTypeDetailsDataView() = default;

  DeviceBoundSessionEventTypeDetailsDataView(
      internal::DeviceBoundSessionEventTypeDetails_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const {
    // For inlined unions, |data_| is always non-null. In that case we need to
    // check |data_->is_null()|.
    return !data_ || data_->is_null();
  }

  Tag tag() const { return data_->tag; }
  bool is_creation() const { return data_->tag == Tag::kCreation; }
  inline void GetCreationDataView(
      DeviceBoundSessionCreationDetailsDataView* output) const;

  template <typename UserType>
  [[nodiscard]] bool ReadCreation(UserType* output) const {
    
    CHECK(is_creation());
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionCreationDetailsDataView>(
        data_->data.f_creation.Get(), output, message_);
  }
  bool is_refresh() const { return data_->tag == Tag::kRefresh; }
  inline void GetRefreshDataView(
      DeviceBoundSessionRefreshDetailsDataView* output) const;

  template <typename UserType>
  [[nodiscard]] bool ReadRefresh(UserType* output) const {
    
    CHECK(is_refresh());
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionRefreshDetailsDataView>(
        data_->data.f_refresh.Get(), output, message_);
  }
  bool is_termination() const { return data_->tag == Tag::kTermination; }
  inline void GetTerminationDataView(
      DeviceBoundSessionTerminationDetailsDataView* output) const;

  template <typename UserType>
  [[nodiscard]] bool ReadTermination(UserType* output) const {
    
    CHECK(is_termination());
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionTerminationDetailsDataView>(
        data_->data.f_termination.Get(), output, message_);
  }
  bool is_challenge() const { return data_->tag == Tag::kChallenge; }
  inline void GetChallengeDataView(
      DeviceBoundSessionChallengeDetailsDataView* output) const;

  template <typename UserType>
  [[nodiscard]] bool ReadChallenge(UserType* output) const {
    
    CHECK(is_challenge());
    return mojo::internal::Deserialize<::network::mojom::DeviceBoundSessionChallengeDetailsDataView>(
        data_->data.f_challenge.Get(), output, message_);
  }

 private:
  internal::DeviceBoundSessionEventTypeDetails_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};



}  // network::mojom

#endif  // SERVICES_NETWORK_PUBLIC_MOJOM_DEVICE_BOUND_SESSIONS_MOJOM_DATA_VIEW_H_