// chrome/browser/ui/webui/omnibox/aim_eligibility/aim_eligibility.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 CHROME_BROWSER_UI_WEBUI_OMNIBOX_AIM_ELIGIBILITY_AIM_ELIGIBILITY_MOJOM_DATA_VIEW_H_
#define CHROME_BROWSER_UI_WEBUI_OMNIBOX_AIM_ELIGIBILITY_AIM_ELIGIBILITY_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 "chrome/browser/ui/webui/omnibox/aim_eligibility/aim_eligibility.mojom-shared-internal.h"
#include "mojo/public/mojom/base/time.mojom-shared.h"


namespace aim_eligibility::mojom {
class DriveStatusDataView;

class EligibilityStateDataView;



}  // aim_eligibility::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::aim_eligibility::mojom::DriveStatusDataView> {
  using Data = ::aim_eligibility::mojom::internal::DriveStatus_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::aim_eligibility::mojom::EligibilityStateDataView> {
  using Data = ::aim_eligibility::mojom::internal::EligibilityState_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

}  // namespace internal
}  // namespace mojo


namespace aim_eligibility::mojom {


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

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

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

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

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

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


class DriveStatusDataView {
 public:
  DriveStatusDataView() = default;

  DriveStatusDataView(
      internal::DriveStatus_Data* data,
      mojo::Message* message)
      : data_(data) {}

  bool is_null() const { return !data_; }
  bool is_drive_supported() const {
    return data_->is_drive_supported;
  }
  bool is_pec_eligible() const {
    return data_->is_pec_eligible;
  }
  bool is_identity_match() const {
    return data_->is_identity_match;
  }
  bool is_incognito() const {
    return data_->is_incognito;
  }
  bool is_feature_flag_enabled() const {
    return data_->is_feature_flag_enabled;
  }
  bool is_force_drive_disclaimer_accepted() const {
    return data_->is_force_drive_disclaimer_accepted;
  }
  bool is_search_content_sharing_enabled() const {
    return data_->is_search_content_sharing_enabled;
  }
  template <typename UserType>
  [[nodiscard]] bool ReadDisclaimerState(UserType* output) const {
    auto data_value = data_->disclaimer_state;
    return mojo::internal::Deserialize<::aim_eligibility::mojom::DisclaimerState>(
        data_value, output);
  }
  DisclaimerState disclaimer_state() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::aim_eligibility::mojom::DisclaimerState>(data_->disclaimer_state));
  }
  bool is_disclaimer_flag_enabled() const {
    return data_->is_disclaimer_flag_enabled;
  }
 private:
  internal::DriveStatus_Data* data_ = nullptr;
};


class EligibilityStateDataView {
 public:
  EligibilityStateDataView() = default;

  EligibilityStateDataView(
      internal::EligibilityState_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  bool is_eligible() const {
    return data_->is_eligible;
  }
  bool is_eligible_by_policy() const {
    return data_->is_eligible_by_policy;
  }
  bool is_third_party_eligible_by_policy() const {
    return data_->is_third_party_eligible_by_policy;
  }
  bool is_eligible_by_dse() const {
    return data_->is_eligible_by_dse;
  }
  bool is_eligible_by_server() const {
    return data_->is_eligible_by_server;
  }
  bool is_server_eligibility_enabled() const {
    return data_->is_server_eligibility_enabled;
  }
  inline void GetEligibilityResponseBase64EncodedDataView(
      mojo::StringDataView* output);

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

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

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

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

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

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


}  // aim_eligibility::mojom

#endif  // CHROME_BROWSER_UI_WEBUI_OMNIBOX_AIM_ELIGIBILITY_AIM_ELIGIBILITY_MOJOM_DATA_VIEW_H_