// components/omnibox/browser/searchbox.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 COMPONENTS_OMNIBOX_BROWSER_SEARCHBOX_MOJOM_DATA_VIEW_H_
#define COMPONENTS_OMNIBOX_BROWSER_SEARCHBOX_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 "components/omnibox/browser/searchbox.mojom-shared-internal.h"
#include "components/omnibox/browser/fusebox_action.mojom-shared.h"
#include "components/omnibox/browser/omnibox.mojom-shared.h"
#include "components/omnibox/composebox/composebox_query.mojom-shared.h"
#include "mojo/public/mojom/base/big_buffer.mojom-shared.h"
#include "mojo/public/mojom/base/string16.mojom-shared.h"
#include "mojo/public/mojom/base/time.mojom-shared.h"
#include "mojo/public/mojom/base/unguessable_token.mojom-shared.h"
#include "ui/base/mojom/window_open_disposition.mojom-shared.h"
#include "ui/gfx/geometry/mojom/geometry.mojom-shared.h"
#include "url/mojom/url.mojom-shared.h"


namespace searchbox::mojom {
class ACMatchClassificationDataView;

class ActionDataView;

class SuggestionAnswerDataView;

class InputKeywordModelDataView;

class MatchKeywordModelDataView;

class AutocompleteMatchDataView;

class TabInfoDataView;

class FileAttachmentDataView;

class TabAttachmentDataView;

class SearchContextDataView;

class SelectedFileInfoDataView;

class SuggestionGroupDataView;

class SmartComposeStatsDataView;

class AutocompleteResultDataView;

class OmniboxPopupSelectionDataView;

class ActionModifiersDataView;

class PlaceholderConfigDataView;

class DriveFileDataView;

class DriveUploadResponseDataView;

class SearchContextAttachmentDataView;
class PageHandler_AddFileContext_ResponseParam_ResultDataView;
class PageHandler_AddTabContext_ResponseParam_ResultDataView;


}  // searchbox::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::searchbox::mojom::ACMatchClassificationDataView> {
  using Data = ::searchbox::mojom::internal::ACMatchClassification_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::ActionDataView> {
  using Data = ::searchbox::mojom::internal::Action_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::SuggestionAnswerDataView> {
  using Data = ::searchbox::mojom::internal::SuggestionAnswer_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::InputKeywordModelDataView> {
  using Data = ::searchbox::mojom::internal::InputKeywordModel_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::MatchKeywordModelDataView> {
  using Data = ::searchbox::mojom::internal::MatchKeywordModel_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::AutocompleteMatchDataView> {
  using Data = ::searchbox::mojom::internal::AutocompleteMatch_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::TabInfoDataView> {
  using Data = ::searchbox::mojom::internal::TabInfo_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::FileAttachmentDataView> {
  using Data = ::searchbox::mojom::internal::FileAttachment_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::TabAttachmentDataView> {
  using Data = ::searchbox::mojom::internal::TabAttachment_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::SearchContextDataView> {
  using Data = ::searchbox::mojom::internal::SearchContext_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::SelectedFileInfoDataView> {
  using Data = ::searchbox::mojom::internal::SelectedFileInfo_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::SuggestionGroupDataView> {
  using Data = ::searchbox::mojom::internal::SuggestionGroup_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::SmartComposeStatsDataView> {
  using Data = ::searchbox::mojom::internal::SmartComposeStats_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::AutocompleteResultDataView> {
  using Data = ::searchbox::mojom::internal::AutocompleteResult_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::OmniboxPopupSelectionDataView> {
  using Data = ::searchbox::mojom::internal::OmniboxPopupSelection_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::ActionModifiersDataView> {
  using Data = ::searchbox::mojom::internal::ActionModifiers_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::PlaceholderConfigDataView> {
  using Data = ::searchbox::mojom::internal::PlaceholderConfig_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::DriveFileDataView> {
  using Data = ::searchbox::mojom::internal::DriveFile_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::DriveUploadResponseDataView> {
  using Data = ::searchbox::mojom::internal::DriveUploadResponse_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::SearchContextAttachmentDataView> {
  using Data = ::searchbox::mojom::internal::SearchContextAttachment_Data;
  using DataAsArrayElement = Data;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kUnion;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::PageHandler_AddFileContext_ResponseParam_ResultDataView> {
  using Data = ::searchbox::mojom::internal::PageHandler_AddFileContext_ResponseParam_Result_Data;
  using DataAsArrayElement = Data;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kUnion;
};

template <>
struct MojomTypeTraits<::searchbox::mojom::PageHandler_AddTabContext_ResponseParam_ResultDataView> {
  using Data = ::searchbox::mojom::internal::PageHandler_AddTabContext_ResponseParam_Result_Data;
  using DataAsArrayElement = Data;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kUnion;
};

}  // namespace internal
}  // namespace mojo


namespace searchbox::mojom {


enum class KeywordType : int32_t {
  
  kChip = 0,
  
  kInKeyword = 1,
  
  kInstant = 2,
  kMinValue = 0,
  kMaxValue = 2,
};

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

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


enum class TabAttachmentSource : int32_t {
  
  kOther = 0,
  
  kContextMenu = 1,
  
  kCurrentTabChip = 2,
  
  kActionChip = 3,
  
  kAutoActive = 4,
  
  kAutoAdded = 5,
  kMinValue = 0,
  kMaxValue = 5,
};

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

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


enum class SideType : int32_t {
  
  kDefaultPrimary = 0,
  
  kSecondary = 1,
  kMinValue = 0,
  kMaxValue = 1,
};

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

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


enum class RenderType : int32_t {
  
  kDefaultVertical = 0,
  
  kHorizontal = 1,
  
  kGrid = 2,
  kMinValue = 0,
  kMaxValue = 2,
};

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

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


enum class SelectionLineState : int32_t {
  
  kNormal = 1,
  
  kKeywordMode = 2,
  
  kFocusedButtonAction = 3,
  
  kFocusedButtonRemoveSuggestion = 4,
  
  kFocusedButtonAim = 5,
  
  kFocusedButtonContextEntrypoint = 6,
  
  kCtrlEnter = 7,
  kMinValue = 1,
  kMaxValue = 7,
};

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

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


enum class SelectionDirection : int32_t {
  
  kForward = 1,
  
  kBackward = 2,
  kMinValue = 1,
  kMaxValue = 2,
};

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

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


enum class SelectionStep : int32_t {
  
  kWholeLine = 1,
  
  kStateOrLine = 2,
  
  kAllLines = 3,
  kMinValue = 1,
  kMaxValue = 3,
};

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

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


enum class DriveUploadError : int32_t {
  
  kSizeLimitExceeded = 0,
  
  kMaxFilesExceeded = 1,
  kMinValue = 0,
  kMaxValue = 1,
};

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

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


enum class DriveDisclaimerStatus : int32_t {
  
  kNotAccepted = 0,
  
  kAccepted = 1,
  
  kRestricted = 2,
  kMinValue = 0,
  kMaxValue = 2,
};

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

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


enum class InputMethod : int32_t {
  
  kKeyboard = 1,
  
  kPaste = 2,
  
  kSpeech = 6,
  
  kTab = 8,
  
  kLensCamera = 10,
  
  kSmartCompose = 11,
  kMinValue = 1,
  kMaxValue = 11,
};

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

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

using PageHandlerFactoryPtrDataView =
    mojo::InterfacePtrDataView<PageHandlerFactoryInterfaceBase>;
using PageHandlerFactoryRequestDataView =
    mojo::InterfaceRequestDataView<PageHandlerFactoryInterfaceBase>;
using PageHandlerFactoryAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<PageHandlerFactoryInterfaceBase>;
using PageHandlerFactoryAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<PageHandlerFactoryInterfaceBase>;
class PageHandlerInterfaceBase {};

using PageHandlerPtrDataView =
    mojo::InterfacePtrDataView<PageHandlerInterfaceBase>;
using PageHandlerRequestDataView =
    mojo::InterfaceRequestDataView<PageHandlerInterfaceBase>;
using PageHandlerAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<PageHandlerInterfaceBase>;
using PageHandlerAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<PageHandlerInterfaceBase>;
class PageInterfaceBase {};

using PagePtrDataView =
    mojo::InterfacePtrDataView<PageInterfaceBase>;
using PageRequestDataView =
    mojo::InterfaceRequestDataView<PageInterfaceBase>;
using PageAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<PageInterfaceBase>;
using PageAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<PageInterfaceBase>;


class ACMatchClassificationDataView {
 public:
  ACMatchClassificationDataView() = default;

  ACMatchClassificationDataView(
      internal::ACMatchClassification_Data* data,
      mojo::Message* message)
      : data_(data) {}

  bool is_null() const { return !data_; }
  uint32_t offset() const {
    return data_->offset;
  }
  int32_t style() const {
    return data_->style;
  }
 private:
  internal::ACMatchClassification_Data* data_ = nullptr;
};


class ActionDataView {
 public:
  ActionDataView() = default;

  ActionDataView(
      internal::Action_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

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

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

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

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

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


class SuggestionAnswerDataView {
 public:
  SuggestionAnswerDataView() = default;

  SuggestionAnswerDataView(
      internal::SuggestionAnswer_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

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

  template <typename UserType>
  [[nodiscard]] bool ReadFirstLine(UserType* output) {
    
    auto* pointer = data_->first_line.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::String16DataView>(
        pointer, output, message_);
  }
  inline void GetSecondLineDataView(
      ::mojo_base::mojom::String16DataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadSecondLine(UserType* output) {
    
    auto* pointer = data_->second_line.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::String16DataView>(
        pointer, output, message_);
  }
 private:
  internal::SuggestionAnswer_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class InputKeywordModelDataView {
 public:
  InputKeywordModelDataView() = default;

  InputKeywordModelDataView(
      internal::InputKeywordModel_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<::searchbox::mojom::KeywordType>(
        data_value, output);
  }
  KeywordType type() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::searchbox::mojom::KeywordType>(data_->type));
  }
  inline void GetKeywordDataView(
      mojo::StringDataView* output);

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

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


class MatchKeywordModelDataView {
 public:
  MatchKeywordModelDataView() = default;

  MatchKeywordModelDataView(
      internal::MatchKeywordModel_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<::searchbox::mojom::KeywordType>(
        data_value, output);
  }
  KeywordType type() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::searchbox::mojom::KeywordType>(data_->type));
  }
  inline void GetChipHintDataView(
      mojo::StringDataView* output);

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

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

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

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


class AutocompleteMatchDataView {
 public:
  AutocompleteMatchDataView() = default;

  AutocompleteMatchDataView(
      internal::AutocompleteMatch_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  bool is_hidden() const {
    return data_->is_hidden;
  }
  inline void GetA11yLabelDataView(
      ::mojo_base::mojom::String16DataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadA11yLabel(UserType* output) {
    
    auto* pointer = data_->a11y_label.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::String16DataView>(
        pointer, output, message_);
  }
  bool allowed_to_be_default_match() const {
    return data_->allowed_to_be_default_match;
  }
  inline void GetActionsDataView(
      mojo::ArrayDataView<ActionDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadActions(UserType* output) {
    
    auto* pointer = data_->actions.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::searchbox::mojom::ActionDataView>>(
        pointer, output, message_);
  }
  inline void GetAnswerDataView(
      SuggestionAnswerDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadAnswer(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        ::searchbox::mojom::SuggestionAnswerDataView, UserType>(),
    "Attempting to read the optional `answer` 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 `MaybeReadAnswer` instead "
    "of `ReadAnswer if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->answer.Get();
    return mojo::internal::Deserialize<::searchbox::mojom::SuggestionAnswerDataView>(
        pointer, output, message_);
  }
  inline void GetContentsDataView(
      ::mojo_base::mojom::String16DataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadContents(UserType* output) {
    
    auto* pointer = data_->contents.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::String16DataView>(
        pointer, output, message_);
  }
  inline void GetContentsClassDataView(
      mojo::ArrayDataView<ACMatchClassificationDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadContentsClass(UserType* output) {
    
    auto* pointer = data_->contents_class.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::searchbox::mojom::ACMatchClassificationDataView>>(
        pointer, output, message_);
  }
  inline void GetDescriptionDataView(
      ::mojo_base::mojom::String16DataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadDescription(UserType* output) {
    
    auto* pointer = data_->description.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::String16DataView>(
        pointer, output, message_);
  }
  inline void GetDescriptionClassDataView(
      mojo::ArrayDataView<ACMatchClassificationDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadDescriptionClass(UserType* output) {
    
    auto* pointer = data_->description_class.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::searchbox::mojom::ACMatchClassificationDataView>>(
        pointer, output, message_);
  }
  inline void GetDestinationUrlDataView(
      ::url::mojom::UrlDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadDestinationUrl(UserType* output) {
    
    auto* pointer = data_->destination_url.Get();
    return mojo::internal::Deserialize<::url::mojom::UrlDataView>(
        pointer, output, message_);
  }
  inline void GetInlineAutocompletionDataView(
      ::mojo_base::mojom::String16DataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadInlineAutocompletion(UserType* output) {
    
    auto* pointer = data_->inline_autocompletion.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::String16DataView>(
        pointer, output, message_);
  }
  inline void GetFillIntoEditDataView(
      ::mojo_base::mojom::String16DataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadFillIntoEdit(UserType* output) {
    
    auto* pointer = data_->fill_into_edit.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::String16DataView>(
        pointer, output, message_);
  }
  std::optional<bool> is_weather_answer_suggestion() const {

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

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

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

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

  template <typename UserType>
  [[nodiscard]] bool ReadImageUrl(UserType* output) {
    
    auto* pointer = data_->image_url.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  bool is_contextual_suggestion() const {
    return data_->is_contextual_suggestion;
  }
  bool is_noncanned_aim_suggestion() const {
    return data_->is_noncanned_aim_suggestion;
  }
  bool is_rich_suggestion() const {
    return data_->is_rich_suggestion;
  }
  bool is_search_type() const {
    return data_->is_search_type;
  }
  bool is_enterprise_search_aggregator_people_type() const {
    return data_->is_enterprise_search_aggregator_people_type;
  }
  inline void GetTypeDataView(
      mojo::StringDataView* output);

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

  template <typename UserType>
  [[nodiscard]] bool ReadRemoveButtonA11yLabel(UserType* output) {
    
    auto* pointer = data_->remove_button_a11y_label.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::String16DataView>(
        pointer, output, message_);
  }
  bool swap_contents_and_description() const {
    return data_->swap_contents_and_description;
  }
  bool show_contextual_description() const {
    return data_->show_contextual_description;
  }
  int32_t suggestion_group_id() const {
    return data_->suggestion_group_id;
  }
  bool supports_deletion() const {
    return data_->supports_deletion;
  }
  inline void GetTailSuggestCommonPrefixDataView(
      ::mojo_base::mojom::String16DataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadTailSuggestCommonPrefix(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        ::mojo_base::mojom::String16DataView, UserType>(),
    "Attempting to read the optional `tail_suggest_common_prefix` 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 `MaybeReadTailSuggestCommonPrefix` instead "
    "of `ReadTailSuggestCommonPrefix if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->tail_suggest_common_prefix.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::String16DataView>(
        pointer, output, message_);
  }
  inline void GetKeywordModelDataView(
      MatchKeywordModelDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadKeywordModel(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        ::searchbox::mojom::MatchKeywordModelDataView, UserType>(),
    "Attempting to read the optional `keyword_model` 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 `MaybeReadKeywordModel` instead "
    "of `ReadKeywordModel if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->keyword_model.Get();
    return mojo::internal::Deserialize<::searchbox::mojom::MatchKeywordModelDataView>(
        pointer, output, message_);
  }
  inline void GetFuseboxActionDataView(
      ::fusebox_action::mojom::FuseboxActionDataView* output);

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


class TabInfoDataView {
 public:
  TabInfoDataView() = default;

  TabInfoDataView(
      internal::TabInfo_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  int32_t tab_id() const {
    return data_->tab_id;
  }
  inline void GetTitleDataView(
      mojo::StringDataView* output);

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

  template <typename UserType>
  [[nodiscard]] bool ReadUrl(UserType* output) {
    
    auto* pointer = data_->url.Get();
    return mojo::internal::Deserialize<::url::mojom::UrlDataView>(
        pointer, output, message_);
  }
  bool show_in_current_tab_chip() const {
    return data_->show_in_current_tab_chip;
  }
  bool show_in_previous_tab_chip() const {
    return data_->show_in_previous_tab_chip;
  }
  inline void GetLastActiveDataView(
      ::mojo_base::mojom::TimeTicksDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadLastActive(UserType* output) {
    
    auto* pointer = data_->last_active.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::TimeTicksDataView>(
        pointer, output, message_);
  }
 private:
  internal::TabInfo_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class FileAttachmentDataView {
 public:
  FileAttachmentDataView() = default;

  FileAttachmentDataView(
      internal::FileAttachment_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

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

  template <typename UserType>
  [[nodiscard]] bool ReadUuid(UserType* output) {
    
    auto* pointer = data_->uuid.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::UnguessableTokenDataView>(
        pointer, output, message_);
  }
  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 GetMimeTypeDataView(
      mojo::StringDataView* output);

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

  template <typename UserType>
  [[nodiscard]] bool ReadImageDataUrl(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        mojo::StringDataView, UserType>(),
    "Attempting to read the optional `image_data_url` 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 `MaybeReadImageDataUrl` instead "
    "of `ReadImageDataUrl if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->image_data_url.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  template <typename UserType>
  [[nodiscard]] bool ReadErrorType(UserType* output) const {
    if (!data_->error_type_$flag) {
      *output = std::nullopt;
      return true;
    }

    return mojo::internal::Deserialize<::composebox_query::mojom::ContextUploadErrorType>(
        data_->error_type_$value, &output->emplace());
  }
  std::optional<::composebox_query::mojom::ContextUploadErrorType> error_type() const {
    if (!data_->error_type_$flag) {
      return std::nullopt;
    }
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::composebox_query::mojom::ContextUploadErrorType>(data_->error_type_$value));
  }
  inline void GetIconUrlDataView(
      ::url::mojom::UrlDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadIconUrl(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        ::url::mojom::UrlDataView, UserType>(),
    "Attempting to read the optional `icon_url` 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 `MaybeReadIconUrl` instead "
    "of `ReadIconUrl if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->icon_url.Get();
    return mojo::internal::Deserialize<::url::mojom::UrlDataView>(
        pointer, output, message_);
  }
  inline void GetThumbnailUrlDataView(
      ::url::mojom::UrlDataView* output);

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


class TabAttachmentDataView {
 public:
  TabAttachmentDataView() = default;

  TabAttachmentDataView(
      internal::TabAttachment_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  int32_t tab_id() const {
    return data_->tab_id;
  }
  inline void GetTitleDataView(
      mojo::StringDataView* output);

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

  template <typename UserType>
  [[nodiscard]] bool ReadUrl(UserType* output) {
    
    auto* pointer = data_->url.Get();
    return mojo::internal::Deserialize<::url::mojom::UrlDataView>(
        pointer, output, message_);
  }
  template <typename UserType>
  [[nodiscard]] bool ReadSource(UserType* output) const {
    auto data_value = data_->source;
    return mojo::internal::Deserialize<::searchbox::mojom::TabAttachmentSource>(
        data_value, output);
  }
  TabAttachmentSource source() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::searchbox::mojom::TabAttachmentSource>(data_->source));
  }
 private:
  internal::TabAttachment_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class SearchContextDataView {
 public:
  SearchContextDataView() = default;

  SearchContextDataView(
      internal::SearchContext_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

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

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

  template <typename UserType>
  [[nodiscard]] bool ReadAttachments(UserType* output) {
    
    auto* pointer = data_->attachments.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::searchbox::mojom::SearchContextAttachmentDataView>>(
        pointer, output, message_);
  }
  template <typename UserType>
  [[nodiscard]] bool ReadToolMode(UserType* output) const {
    auto data_value = data_->tool_mode;
    return mojo::internal::Deserialize<::composebox_query::mojom::ToolMode>(
        data_value, output);
  }
  ::composebox_query::mojom::ToolMode tool_mode() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::composebox_query::mojom::ToolMode>(data_->tool_mode));
  }
 private:
  internal::SearchContext_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class SelectedFileInfoDataView {
 public:
  SelectedFileInfoDataView() = default;

  SelectedFileInfoDataView(
      internal::SelectedFileInfo_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

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

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

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

  template <typename UserType>
  [[nodiscard]] bool ReadImageDataUrl(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        mojo::StringDataView, UserType>(),
    "Attempting to read the optional `image_data_url` 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 `MaybeReadImageDataUrl` instead "
    "of `ReadImageDataUrl if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->image_data_url.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  bool is_deletable() const {
    return data_->is_deletable;
  }
  inline void GetSelectionTimeDataView(
      ::mojo_base::mojom::JSTimeDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadSelectionTime(UserType* output) {
    
    auto* pointer = data_->selection_time.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::JSTimeDataView>(
        pointer, output, message_);
  }
  inline void GetThumbnailUrlDataView(
      ::url::mojom::UrlDataView* output);

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


class SuggestionGroupDataView {
 public:
  SuggestionGroupDataView() = default;

  SuggestionGroupDataView(
      internal::SuggestionGroup_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

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

  template <typename UserType>
  [[nodiscard]] bool ReadHeader(UserType* output) {
    
    auto* pointer = data_->header.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::String16DataView>(
        pointer, output, message_);
  }
  template <typename UserType>
  [[nodiscard]] bool ReadRenderType(UserType* output) const {
    auto data_value = data_->render_type;
    return mojo::internal::Deserialize<::searchbox::mojom::RenderType>(
        data_value, output);
  }
  RenderType render_type() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::searchbox::mojom::RenderType>(data_->render_type));
  }
  template <typename UserType>
  [[nodiscard]] bool ReadSideType(UserType* output) const {
    auto data_value = data_->side_type;
    return mojo::internal::Deserialize<::searchbox::mojom::SideType>(
        data_value, output);
  }
  SideType side_type() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::searchbox::mojom::SideType>(data_->side_type));
  }
 private:
  internal::SuggestionGroup_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class SmartComposeStatsDataView {
 public:
  SmartComposeStatsDataView() = default;

  SmartComposeStatsDataView(
      internal::SmartComposeStats_Data* data,
      mojo::Message* message)
      : data_(data) {}

  bool is_null() const { return !data_; }
  bool enabled() const {
    return data_->enabled;
  }
  int32_t shown_count() const {
    return data_->shown_count;
  }
  int32_t accepted_count() const {
    return data_->accepted_count;
  }
  int32_t characters_accepted() const {
    return data_->characters_accepted;
  }
  int32_t shown_length() const {
    return data_->shown_length;
  }
 private:
  internal::SmartComposeStats_Data* data_ = nullptr;
};


class AutocompleteResultDataView {
 public:
  AutocompleteResultDataView() = default;

  AutocompleteResultDataView(
      internal::AutocompleteResult_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  int32_t query_id() const {
    return data_->query_id;
  }
  uint32_t sequence_id() const {
    return data_->sequence_id;
  }
  inline void GetInputDataView(
      ::mojo_base::mojom::String16DataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadInput(UserType* output) {
    
    auto* pointer = data_->input.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::String16DataView>(
        pointer, output, message_);
  }
  inline void GetSuggestionGroupsMapDataView(
      mojo::MapDataView<int32_t, SuggestionGroupDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadSuggestionGroupsMap(UserType* output) {
    
    auto* pointer = data_->suggestion_groups_map.Get();
    return mojo::internal::Deserialize<mojo::MapDataView<int32_t, ::searchbox::mojom::SuggestionGroupDataView>>(
        pointer, output, message_);
  }
  inline void GetMatchesDataView(
      mojo::ArrayDataView<AutocompleteMatchDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadMatches(UserType* output) {
    
    auto* pointer = data_->matches.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::searchbox::mojom::AutocompleteMatchDataView>>(
        pointer, output, message_);
  }
  inline void GetSmartComposeInlineHintDataView(
      ::mojo_base::mojom::String16DataView* output);

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


class OmniboxPopupSelectionDataView {
 public:
  OmniboxPopupSelectionDataView() = default;

  OmniboxPopupSelectionDataView(
      internal::OmniboxPopupSelection_Data* data,
      mojo::Message* message)
      : data_(data) {}

  bool is_null() const { return !data_; }
  uint8_t line() const {
    return data_->line;
  }
  template <typename UserType>
  [[nodiscard]] bool ReadState(UserType* output) const {
    auto data_value = data_->state;
    return mojo::internal::Deserialize<::searchbox::mojom::SelectionLineState>(
        data_value, output);
  }
  SelectionLineState state() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::searchbox::mojom::SelectionLineState>(data_->state));
  }
  uint8_t action_index() const {
    return data_->action_index;
  }
 private:
  internal::OmniboxPopupSelection_Data* data_ = nullptr;
};


class ActionModifiersDataView {
 public:
  ActionModifiersDataView() = default;

  ActionModifiersDataView(
      internal::ActionModifiers_Data* data,
      mojo::Message* message)
      : data_(data) {}

  bool is_null() const { return !data_; }
  bool alt_key() const {
    return data_->alt_key;
  }
  bool ctrl_key() const {
    return data_->ctrl_key;
  }
  bool meta_key() const {
    return data_->meta_key;
  }
  bool shift_key() const {
    return data_->shift_key;
  }
 private:
  internal::ActionModifiers_Data* data_ = nullptr;
};


class PlaceholderConfigDataView {
 public:
  PlaceholderConfigDataView() = default;

  PlaceholderConfigDataView(
      internal::PlaceholderConfig_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetTextsDataView(
      mojo::ArrayDataView<::mojo_base::mojom::String16DataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadTexts(UserType* output) {
    
    auto* pointer = data_->texts.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::mojo_base::mojom::String16DataView>>(
        pointer, output, message_);
  }
  inline void GetChangeTextAnimationIntervalDataView(
      ::mojo_base::mojom::TimeDeltaDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadChangeTextAnimationInterval(UserType* output) {
    
    auto* pointer = data_->change_text_animation_interval.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::TimeDeltaDataView>(
        pointer, output, message_);
  }
  inline void GetFadeTextAnimationDurationDataView(
      ::mojo_base::mojom::TimeDeltaDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadFadeTextAnimationDuration(UserType* output) {
    
    auto* pointer = data_->fade_text_animation_duration.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::TimeDeltaDataView>(
        pointer, output, message_);
  }
 private:
  internal::PlaceholderConfig_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class DriveFileDataView {
 public:
  DriveFileDataView() = default;

  DriveFileDataView(
      internal::DriveFile_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

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

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

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

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

  template <typename UserType>
  [[nodiscard]] bool ReadThumbnailUrl(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        mojo::StringDataView, UserType>(),
    "Attempting to read the optional `thumbnail_url` 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 `MaybeReadThumbnailUrl` instead "
    "of `ReadThumbnailUrl if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->thumbnail_url.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  inline void GetIconUrlDataView(
      ::url::mojom::UrlDataView* output);

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


class DriveUploadResponseDataView {
 public:
  DriveUploadResponseDataView() = default;

  DriveUploadResponseDataView(
      internal::DriveUploadResponse_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetFilesDataView(
      mojo::ArrayDataView<DriveFileDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadFiles(UserType* output) {
    
    auto* pointer = data_->files.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::searchbox::mojom::DriveFileDataView>>(
        pointer, output, message_);
  }
  template <typename UserType>
  [[nodiscard]] bool ReadError(UserType* output) const {
    if (!data_->error_$flag) {
      *output = std::nullopt;
      return true;
    }

    return mojo::internal::Deserialize<::searchbox::mojom::DriveUploadError>(
        data_->error_$value, &output->emplace());
  }
  std::optional<DriveUploadError> error() const {
    if (!data_->error_$flag) {
      return std::nullopt;
    }
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::searchbox::mojom::DriveUploadError>(data_->error_$value));
  }
 private:
  internal::DriveUploadResponse_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class SearchContextAttachmentDataView {
 public:
  using Tag = internal::SearchContextAttachment_Data::SearchContextAttachment_Tag;

  SearchContextAttachmentDataView() = default;

  SearchContextAttachmentDataView(
      internal::SearchContextAttachment_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_file_attachment() const { return data_->tag == Tag::kFileAttachment; }
  inline void GetFileAttachmentDataView(
      FileAttachmentDataView* output) const;

  template <typename UserType>
  [[nodiscard]] bool ReadFileAttachment(UserType* output) const {
    
    CHECK(is_file_attachment());
    return mojo::internal::Deserialize<::searchbox::mojom::FileAttachmentDataView>(
        data_->data.f_file_attachment.Get(), output, message_);
  }
  bool is_tab_attachment() const { return data_->tag == Tag::kTabAttachment; }
  inline void GetTabAttachmentDataView(
      TabAttachmentDataView* output) const;

  template <typename UserType>
  [[nodiscard]] bool ReadTabAttachment(UserType* output) const {
    
    CHECK(is_tab_attachment());
    return mojo::internal::Deserialize<::searchbox::mojom::TabAttachmentDataView>(
        data_->data.f_tab_attachment.Get(), output, message_);
  }

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



class PageHandler_AddFileContext_ResponseParam_ResultDataView {
 public:
  using Tag = internal::PageHandler_AddFileContext_ResponseParam_Result_Data::PageHandler_AddFileContext_ResponseParam_Result_Tag;

  PageHandler_AddFileContext_ResponseParam_ResultDataView() = default;

  PageHandler_AddFileContext_ResponseParam_ResultDataView(
      internal::PageHandler_AddFileContext_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(
      ::mojo_base::mojom::UnguessableTokenDataView* output) const;

  template <typename UserType>
  [[nodiscard]] bool ReadSuccess(UserType* output) const {
    
    CHECK(is_success());
    return mojo::internal::Deserialize<::mojo_base::mojom::UnguessableTokenDataView>(
        data_->data.f_success.Get(), output, message_);
  }
  bool is_failure() const { return data_->tag == Tag::kFailure; }
  template <typename UserType>
  [[nodiscard]] bool ReadFailure(UserType* output) const {
    CHECK(is_failure());
    return mojo::internal::Deserialize<::composebox_query::mojom::ContextUploadErrorType>(
        data_->data.f_failure, output);
  }
  ::composebox_query::mojom::ContextUploadErrorType failure() const {
    CHECK(is_failure());
    // TODO(dcheng): This seems incorrect, as it bypasses enum traits.
    return ::mojo::internal::ToKnownEnumValueHelper(
        static_cast<::composebox_query::mojom::ContextUploadErrorType>(data_->data.f_failure));
  }

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



class PageHandler_AddTabContext_ResponseParam_ResultDataView {
 public:
  using Tag = internal::PageHandler_AddTabContext_ResponseParam_Result_Data::PageHandler_AddTabContext_ResponseParam_Result_Tag;

  PageHandler_AddTabContext_ResponseParam_ResultDataView() = default;

  PageHandler_AddTabContext_ResponseParam_ResultDataView(
      internal::PageHandler_AddTabContext_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(
      ::mojo_base::mojom::UnguessableTokenDataView* output) const;

  template <typename UserType>
  [[nodiscard]] bool ReadSuccess(UserType* output) const {
    
    CHECK(is_success());
    return mojo::internal::Deserialize<::mojo_base::mojom::UnguessableTokenDataView>(
        data_->data.f_success.Get(), output, message_);
  }
  bool is_failure() const { return data_->tag == Tag::kFailure; }
  template <typename UserType>
  [[nodiscard]] bool ReadFailure(UserType* output) const {
    CHECK(is_failure());
    return mojo::internal::Deserialize<::composebox_query::mojom::ContextUploadErrorType>(
        data_->data.f_failure, output);
  }
  ::composebox_query::mojom::ContextUploadErrorType failure() const {
    CHECK(is_failure());
    // TODO(dcheng): This seems incorrect, as it bypasses enum traits.
    return ::mojo::internal::ToKnownEnumValueHelper(
        static_cast<::composebox_query::mojom::ContextUploadErrorType>(data_->data.f_failure));
  }

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



}  // searchbox::mojom

#endif  // COMPONENTS_OMNIBOX_BROWSER_SEARCHBOX_MOJOM_DATA_VIEW_H_