// third_party/blink/public/mojom/device/device.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 THIRD_PARTY_BLINK_PUBLIC_MOJOM_DEVICE_DEVICE_MOJOM_DATA_VIEW_H_
#define THIRD_PARTY_BLINK_PUBLIC_MOJOM_DEVICE_DEVICE_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 "third_party/blink/public/mojom/device/device.mojom-shared-internal.h"


namespace blink::mojom {
class DeviceAttributeValueDataView;

class DeviceAPIService_GetDirectoryId_ResponseParam_ResultDataView;
class DeviceAPIService_GetHostname_ResponseParam_ResultDataView;
class DeviceAPIService_GetSerialNumber_ResponseParam_ResultDataView;
class DeviceAPIService_GetAnnotatedAssetId_ResponseParam_ResultDataView;
class DeviceAPIService_GetAnnotatedLocation_ResponseParam_ResultDataView;


}  // blink::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::blink::mojom::DeviceAttributeValueDataView> {
  using Data = ::blink::mojom::internal::DeviceAttributeValue_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::blink::mojom::DeviceAPIService_GetDirectoryId_ResponseParam_ResultDataView> {
  using Data = ::blink::mojom::internal::DeviceAPIService_GetDirectoryId_ResponseParam_Result_Data;
  using DataAsArrayElement = Data;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kUnion;
};

template <>
struct MojomTypeTraits<::blink::mojom::DeviceAPIService_GetHostname_ResponseParam_ResultDataView> {
  using Data = ::blink::mojom::internal::DeviceAPIService_GetHostname_ResponseParam_Result_Data;
  using DataAsArrayElement = Data;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kUnion;
};

template <>
struct MojomTypeTraits<::blink::mojom::DeviceAPIService_GetSerialNumber_ResponseParam_ResultDataView> {
  using Data = ::blink::mojom::internal::DeviceAPIService_GetSerialNumber_ResponseParam_Result_Data;
  using DataAsArrayElement = Data;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kUnion;
};

template <>
struct MojomTypeTraits<::blink::mojom::DeviceAPIService_GetAnnotatedAssetId_ResponseParam_ResultDataView> {
  using Data = ::blink::mojom::internal::DeviceAPIService_GetAnnotatedAssetId_ResponseParam_Result_Data;
  using DataAsArrayElement = Data;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kUnion;
};

template <>
struct MojomTypeTraits<::blink::mojom::DeviceAPIService_GetAnnotatedLocation_ResponseParam_ResultDataView> {
  using Data = ::blink::mojom::internal::DeviceAPIService_GetAnnotatedLocation_ResponseParam_Result_Data;
  using DataAsArrayElement = Data;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kUnion;
};

}  // namespace internal
}  // namespace mojo


namespace blink::mojom {
// Interface base classes. They are used for type safety check.
class ManagedConfigurationObserverInterfaceBase {};

using ManagedConfigurationObserverPtrDataView =
    mojo::InterfacePtrDataView<ManagedConfigurationObserverInterfaceBase>;
using ManagedConfigurationObserverRequestDataView =
    mojo::InterfaceRequestDataView<ManagedConfigurationObserverInterfaceBase>;
using ManagedConfigurationObserverAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<ManagedConfigurationObserverInterfaceBase>;
using ManagedConfigurationObserverAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<ManagedConfigurationObserverInterfaceBase>;
class DeviceAPIServiceInterfaceBase {};

using DeviceAPIServicePtrDataView =
    mojo::InterfacePtrDataView<DeviceAPIServiceInterfaceBase>;
using DeviceAPIServiceRequestDataView =
    mojo::InterfaceRequestDataView<DeviceAPIServiceInterfaceBase>;
using DeviceAPIServiceAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<DeviceAPIServiceInterfaceBase>;
using DeviceAPIServiceAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<DeviceAPIServiceInterfaceBase>;
class ManagedConfigurationServiceInterfaceBase {};

using ManagedConfigurationServicePtrDataView =
    mojo::InterfacePtrDataView<ManagedConfigurationServiceInterfaceBase>;
using ManagedConfigurationServiceRequestDataView =
    mojo::InterfaceRequestDataView<ManagedConfigurationServiceInterfaceBase>;
using ManagedConfigurationServiceAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<ManagedConfigurationServiceInterfaceBase>;
using ManagedConfigurationServiceAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<ManagedConfigurationServiceInterfaceBase>;


class DeviceAttributeValueDataView {
 public:
  DeviceAttributeValueDataView() = default;

  DeviceAttributeValueDataView(
      internal::DeviceAttributeValue_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

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

  template <typename UserType>
  [[nodiscard]] bool ReadValue(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        mojo::StringDataView, UserType>(),
    "Attempting to read the optional `value` 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 `MaybeReadValue` instead "
    "of `ReadValue if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->value.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
 private:
  internal::DeviceAttributeValue_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class DeviceAPIService_GetDirectoryId_ResponseParam_ResultDataView {
 public:
  using Tag = internal::DeviceAPIService_GetDirectoryId_ResponseParam_Result_Data::DeviceAPIService_GetDirectoryId_ResponseParam_Result_Tag;

  DeviceAPIService_GetDirectoryId_ResponseParam_ResultDataView() = default;

  DeviceAPIService_GetDirectoryId_ResponseParam_ResultDataView(
      internal::DeviceAPIService_GetDirectoryId_ResponseParam_Result_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_success() const { return data_->tag == Tag::kSuccess; }
  inline void GetSuccessDataView(
      DeviceAttributeValueDataView* output) const;

  template <typename UserType>
  [[nodiscard]] bool ReadSuccess(UserType* output) const {
    
    CHECK(is_success());
    return mojo::internal::Deserialize<::blink::mojom::DeviceAttributeValueDataView>(
        data_->data.f_success.Get(), output, message_);
  }
  bool is_failure() const { return data_->tag == Tag::kFailure; }
  inline void GetFailureDataView(
      mojo::StringDataView* output) const;

  template <typename UserType>
  [[nodiscard]] bool ReadFailure(UserType* output) const {
    
    CHECK(is_failure());
    return mojo::internal::Deserialize<mojo::StringDataView>(
        data_->data.f_failure.Get(), output, message_);
  }

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



class DeviceAPIService_GetHostname_ResponseParam_ResultDataView {
 public:
  using Tag = internal::DeviceAPIService_GetHostname_ResponseParam_Result_Data::DeviceAPIService_GetHostname_ResponseParam_Result_Tag;

  DeviceAPIService_GetHostname_ResponseParam_ResultDataView() = default;

  DeviceAPIService_GetHostname_ResponseParam_ResultDataView(
      internal::DeviceAPIService_GetHostname_ResponseParam_Result_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_success() const { return data_->tag == Tag::kSuccess; }
  inline void GetSuccessDataView(
      DeviceAttributeValueDataView* output) const;

  template <typename UserType>
  [[nodiscard]] bool ReadSuccess(UserType* output) const {
    
    CHECK(is_success());
    return mojo::internal::Deserialize<::blink::mojom::DeviceAttributeValueDataView>(
        data_->data.f_success.Get(), output, message_);
  }
  bool is_failure() const { return data_->tag == Tag::kFailure; }
  inline void GetFailureDataView(
      mojo::StringDataView* output) const;

  template <typename UserType>
  [[nodiscard]] bool ReadFailure(UserType* output) const {
    
    CHECK(is_failure());
    return mojo::internal::Deserialize<mojo::StringDataView>(
        data_->data.f_failure.Get(), output, message_);
  }

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



class DeviceAPIService_GetSerialNumber_ResponseParam_ResultDataView {
 public:
  using Tag = internal::DeviceAPIService_GetSerialNumber_ResponseParam_Result_Data::DeviceAPIService_GetSerialNumber_ResponseParam_Result_Tag;

  DeviceAPIService_GetSerialNumber_ResponseParam_ResultDataView() = default;

  DeviceAPIService_GetSerialNumber_ResponseParam_ResultDataView(
      internal::DeviceAPIService_GetSerialNumber_ResponseParam_Result_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_success() const { return data_->tag == Tag::kSuccess; }
  inline void GetSuccessDataView(
      DeviceAttributeValueDataView* output) const;

  template <typename UserType>
  [[nodiscard]] bool ReadSuccess(UserType* output) const {
    
    CHECK(is_success());
    return mojo::internal::Deserialize<::blink::mojom::DeviceAttributeValueDataView>(
        data_->data.f_success.Get(), output, message_);
  }
  bool is_failure() const { return data_->tag == Tag::kFailure; }
  inline void GetFailureDataView(
      mojo::StringDataView* output) const;

  template <typename UserType>
  [[nodiscard]] bool ReadFailure(UserType* output) const {
    
    CHECK(is_failure());
    return mojo::internal::Deserialize<mojo::StringDataView>(
        data_->data.f_failure.Get(), output, message_);
  }

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



class DeviceAPIService_GetAnnotatedAssetId_ResponseParam_ResultDataView {
 public:
  using Tag = internal::DeviceAPIService_GetAnnotatedAssetId_ResponseParam_Result_Data::DeviceAPIService_GetAnnotatedAssetId_ResponseParam_Result_Tag;

  DeviceAPIService_GetAnnotatedAssetId_ResponseParam_ResultDataView() = default;

  DeviceAPIService_GetAnnotatedAssetId_ResponseParam_ResultDataView(
      internal::DeviceAPIService_GetAnnotatedAssetId_ResponseParam_Result_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_success() const { return data_->tag == Tag::kSuccess; }
  inline void GetSuccessDataView(
      DeviceAttributeValueDataView* output) const;

  template <typename UserType>
  [[nodiscard]] bool ReadSuccess(UserType* output) const {
    
    CHECK(is_success());
    return mojo::internal::Deserialize<::blink::mojom::DeviceAttributeValueDataView>(
        data_->data.f_success.Get(), output, message_);
  }
  bool is_failure() const { return data_->tag == Tag::kFailure; }
  inline void GetFailureDataView(
      mojo::StringDataView* output) const;

  template <typename UserType>
  [[nodiscard]] bool ReadFailure(UserType* output) const {
    
    CHECK(is_failure());
    return mojo::internal::Deserialize<mojo::StringDataView>(
        data_->data.f_failure.Get(), output, message_);
  }

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



class DeviceAPIService_GetAnnotatedLocation_ResponseParam_ResultDataView {
 public:
  using Tag = internal::DeviceAPIService_GetAnnotatedLocation_ResponseParam_Result_Data::DeviceAPIService_GetAnnotatedLocation_ResponseParam_Result_Tag;

  DeviceAPIService_GetAnnotatedLocation_ResponseParam_ResultDataView() = default;

  DeviceAPIService_GetAnnotatedLocation_ResponseParam_ResultDataView(
      internal::DeviceAPIService_GetAnnotatedLocation_ResponseParam_Result_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_success() const { return data_->tag == Tag::kSuccess; }
  inline void GetSuccessDataView(
      DeviceAttributeValueDataView* output) const;

  template <typename UserType>
  [[nodiscard]] bool ReadSuccess(UserType* output) const {
    
    CHECK(is_success());
    return mojo::internal::Deserialize<::blink::mojom::DeviceAttributeValueDataView>(
        data_->data.f_success.Get(), output, message_);
  }
  bool is_failure() const { return data_->tag == Tag::kFailure; }
  inline void GetFailureDataView(
      mojo::StringDataView* output) const;

  template <typename UserType>
  [[nodiscard]] bool ReadFailure(UserType* output) const {
    
    CHECK(is_failure());
    return mojo::internal::Deserialize<mojo::StringDataView>(
        data_->data.f_failure.Get(), output, message_);
  }

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



}  // blink::mojom

#endif  // THIRD_PARTY_BLINK_PUBLIC_MOJOM_DEVICE_DEVICE_MOJOM_DATA_VIEW_H_