// chrome/browser/ui/webui/feed_internals/feed_internals.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_FEED_INTERNALS_FEED_INTERNALS_MOJOM_DATA_VIEW_H_
#define CHROME_BROWSER_UI_WEBUI_FEED_INTERNALS_FEED_INTERNALS_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/feed_internals/feed_internals.mojom-shared-internal.h"
#include "mojo/public/mojom/base/time.mojom-shared.h"
#include "url/mojom/url.mojom-shared.h"


namespace feed_internals::mojom {
class PropertiesDataView;

class LastFetchPropertiesDataView;



}  // feed_internals::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::feed_internals::mojom::PropertiesDataView> {
  using Data = ::feed_internals::mojom::internal::Properties_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::feed_internals::mojom::LastFetchPropertiesDataView> {
  using Data = ::feed_internals::mojom::internal::LastFetchProperties_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

}  // namespace internal
}  // namespace mojo


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

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


class PropertiesDataView {
 public:
  PropertiesDataView() = default;

  PropertiesDataView(
      internal::Properties_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  bool is_feed_enabled() const {
    return data_->is_feed_enabled;
  }
  bool is_feed_visible() const {
    return data_->is_feed_visible;
  }
  bool is_feed_allowed() const {
    return data_->is_feed_allowed;
  }
  bool is_prefetching_enabled() const {
    return data_->is_prefetching_enabled;
  }
  inline void GetLoadStreamStatusDataView(
      mojo::StringDataView* output);

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

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

  template <typename UserType>
  [[nodiscard]] bool ReadFeedActionsUrl(UserType* output) {
    
    auto* pointer = data_->feed_actions_url.Get();
    return mojo::internal::Deserialize<::url::mojom::UrlDataView>(
        pointer, output, message_);
  }
 private:
  internal::Properties_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class LastFetchPropertiesDataView {
 public:
  LastFetchPropertiesDataView() = default;

  LastFetchPropertiesDataView(
      internal::LastFetchProperties_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

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

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

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

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

  template <typename UserType>
  [[nodiscard]] bool ReadLastBlessNonce(UserType* output) {
    
    auto* pointer = data_->last_bless_nonce.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  int32_t last_action_upload_status() const {
    return data_->last_action_upload_status;
  }
  inline void GetLastActionUploadTimeDataView(
      ::mojo_base::mojom::TimeDeltaDataView* output);

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


}  // feed_internals::mojom

#endif  // CHROME_BROWSER_UI_WEBUI_FEED_INTERNALS_FEED_INTERNALS_MOJOM_DATA_VIEW_H_