// chrome/browser/ui/webui/context_hub/context_hub.mojom-shared.h is auto generated by mojom_bindings_generator.py, do not edit

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

#ifndef CHROME_BROWSER_UI_WEBUI_CONTEXT_HUB_CONTEXT_HUB_MOJOM_SHARED_H_
#define CHROME_BROWSER_UI_WEBUI_CONTEXT_HUB_CONTEXT_HUB_MOJOM_SHARED_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/map_data_view.h"
#include "mojo/public/cpp/bindings/string_data_view.h"
#include "mojo/public/cpp/system/message_pipe.h"

#include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h"

#include "chrome/browser/ui/webui/context_hub/context_hub.mojom-shared-internal.h"
#include "mojo/public/mojom/base/time.mojom-shared.h"
#include "mojo/public/mojom/base/uuid.mojom-shared.h"
#include "url/mojom/url.mojom-shared.h"
#include "mojo/public/cpp/bindings/lib/interface_serialization.h"
#include "mojo/public/cpp/system/data_pipe.h"



#include "chrome/browser/ui/webui/context_hub/context_hub.mojom-data-view.h"  // IWYU pragma: export




namespace std {

template <>
struct hash<::browser::context_hub::mojom::AutoTodoStatus>
    : public mojo::internal::EnumHashImpl<::browser::context_hub::mojom::AutoTodoStatus> {};

template <>
struct hash<::browser::context_hub::mojom::AutoTodoGroup>
    : public mojo::internal::EnumHashImpl<::browser::context_hub::mojom::AutoTodoGroup> {};

template <>
struct hash<::browser::context_hub::mojom::EntryType>
    : public mojo::internal::EnumHashImpl<::browser::context_hub::mojom::EntryType> {};

template <>
struct hash<::browser::context_hub::mojom::ChatRole>
    : public mojo::internal::EnumHashImpl<::browser::context_hub::mojom::ChatRole> {};

}  // namespace std

namespace mojo {


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::browser::context_hub::mojom::AutoTodoStatus, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::browser::context_hub::mojom::AutoTodoStatus, UserType>;

  static void Serialize(UserType input, int32_t* output) {
    *output = static_cast<int32_t>(Traits::ToMojom(input));
  }

  static bool Deserialize(int32_t input, UserType* output) {
    auto known_value = ::mojo::internal::ToKnownEnumValueHelper(
        static_cast<::browser::context_hub::mojom::AutoTodoStatus>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::browser::context_hub::mojom::AutoTodoStatus, UserType> ||
                        HasInfallibleConversion(::browser::context_hub::mojom::AutoTodoStatus()),
                    "::browser::context_hub::mojom::AutoTodoStatus does not have an infallible conversion, "
                    "use an optional return type.");
      *output = Traits::FromMojom(known_value);
      return true;
    } else {
      static_assert(
          requires {
            {
              Traits::FromMojom(known_value)
            } -> std::same_as<std::optional<UserType>>;
          }, "FromMojom must return by value or optional.");
      std::optional<UserType> from_mojom = Traits::FromMojom(known_value);
      if (from_mojom) {
        *output = *from_mojom;
      }
      return from_mojom.has_value();
    }
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::browser::context_hub::mojom::AutoTodoGroup, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::browser::context_hub::mojom::AutoTodoGroup, UserType>;

  static void Serialize(UserType input, int32_t* output) {
    *output = static_cast<int32_t>(Traits::ToMojom(input));
  }

  static bool Deserialize(int32_t input, UserType* output) {
    auto known_value = ::mojo::internal::ToKnownEnumValueHelper(
        static_cast<::browser::context_hub::mojom::AutoTodoGroup>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::browser::context_hub::mojom::AutoTodoGroup, UserType> ||
                        HasInfallibleConversion(::browser::context_hub::mojom::AutoTodoGroup()),
                    "::browser::context_hub::mojom::AutoTodoGroup does not have an infallible conversion, "
                    "use an optional return type.");
      *output = Traits::FromMojom(known_value);
      return true;
    } else {
      static_assert(
          requires {
            {
              Traits::FromMojom(known_value)
            } -> std::same_as<std::optional<UserType>>;
          }, "FromMojom must return by value or optional.");
      std::optional<UserType> from_mojom = Traits::FromMojom(known_value);
      if (from_mojom) {
        *output = *from_mojom;
      }
      return from_mojom.has_value();
    }
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::browser::context_hub::mojom::EntryType, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::browser::context_hub::mojom::EntryType, UserType>;

  static void Serialize(UserType input, int32_t* output) {
    *output = static_cast<int32_t>(Traits::ToMojom(input));
  }

  static bool Deserialize(int32_t input, UserType* output) {
    auto known_value = ::mojo::internal::ToKnownEnumValueHelper(
        static_cast<::browser::context_hub::mojom::EntryType>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::browser::context_hub::mojom::EntryType, UserType> ||
                        HasInfallibleConversion(::browser::context_hub::mojom::EntryType()),
                    "::browser::context_hub::mojom::EntryType does not have an infallible conversion, "
                    "use an optional return type.");
      *output = Traits::FromMojom(known_value);
      return true;
    } else {
      static_assert(
          requires {
            {
              Traits::FromMojom(known_value)
            } -> std::same_as<std::optional<UserType>>;
          }, "FromMojom must return by value or optional.");
      std::optional<UserType> from_mojom = Traits::FromMojom(known_value);
      if (from_mojom) {
        *output = *from_mojom;
      }
      return from_mojom.has_value();
    }
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::browser::context_hub::mojom::ChatRole, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::browser::context_hub::mojom::ChatRole, UserType>;

  static void Serialize(UserType input, int32_t* output) {
    *output = static_cast<int32_t>(Traits::ToMojom(input));
  }

  static bool Deserialize(int32_t input, UserType* output) {
    auto known_value = ::mojo::internal::ToKnownEnumValueHelper(
        static_cast<::browser::context_hub::mojom::ChatRole>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::browser::context_hub::mojom::ChatRole, UserType> ||
                        HasInfallibleConversion(::browser::context_hub::mojom::ChatRole()),
                    "::browser::context_hub::mojom::ChatRole does not have an infallible conversion, "
                    "use an optional return type.");
      *output = Traits::FromMojom(known_value);
      return true;
    } else {
      static_assert(
          requires {
            {
              Traits::FromMojom(known_value)
            } -> std::same_as<std::optional<UserType>>;
          }, "FromMojom must return by value or optional.");
      std::optional<UserType> from_mojom = Traits::FromMojom(known_value);
      if (from_mojom) {
        *output = *from_mojom;
      }
      return from_mojom.has_value();
    }
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::browser::context_hub::mojom::GmailReferenceDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::browser::context_hub::mojom::GmailReferenceDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::browser::context_hub::mojom::internal::GmailReference_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    decltype(Traits::message_url(input)) in_message_url = Traits::message_url(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->message_url)::BaseType> message_url_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::url::mojom::UrlDataView>(
      in_message_url,
      message_url_fragment);

    fragment->message_url.Set(
        message_url_fragment.is_null() ? nullptr : message_url_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->message_url.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null message_url in GmailReference struct");

    decltype(Traits::subject(input)) in_subject = Traits::subject(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->subject)::BaseType> subject_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_subject,
      subject_fragment);

    fragment->subject.Set(
        subject_fragment.is_null() ? nullptr : subject_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->subject.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null subject in GmailReference struct");
  }

  static bool Deserialize(::browser::context_hub::mojom::internal::GmailReference_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::browser::context_hub::mojom::GmailReferenceDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::browser::context_hub::mojom::PhotosReferenceDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::browser::context_hub::mojom::PhotosReferenceDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::browser::context_hub::mojom::internal::PhotosReference_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    decltype(Traits::photos_url(input)) in_photos_url = Traits::photos_url(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->photos_url)::BaseType> photos_url_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::url::mojom::UrlDataView>(
      in_photos_url,
      photos_url_fragment);

    fragment->photos_url.Set(
        photos_url_fragment.is_null() ? nullptr : photos_url_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->photos_url.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null photos_url in PhotosReference struct");
  }

  static bool Deserialize(::browser::context_hub::mojom::internal::PhotosReference_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::browser::context_hub::mojom::PhotosReferenceDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::browser::context_hub::mojom::FirstPartyDataDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::browser::context_hub::mojom::FirstPartyDataDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::browser::context_hub::mojom::internal::FirstPartyData_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    decltype(Traits::source_references(input)) in_source_references = Traits::source_references(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->source_references)::BaseType>
        source_references_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& source_references_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::browser::context_hub::mojom::SourceReferenceDataView>>(
      in_source_references,
      source_references_fragment,
      &source_references_validate_params);

    fragment->source_references.Set(
        source_references_fragment.is_null() ? nullptr : source_references_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->source_references.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null source_references in FirstPartyData struct");

    decltype(Traits::actionable_url(input)) in_actionable_url = Traits::actionable_url(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->actionable_url)::BaseType> actionable_url_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::url::mojom::UrlDataView>(
      in_actionable_url,
      actionable_url_fragment);

    fragment->actionable_url.Set(
        actionable_url_fragment.is_null() ? nullptr : actionable_url_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->actionable_url.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null actionable_url in FirstPartyData struct");
  }

  static bool Deserialize(::browser::context_hub::mojom::internal::FirstPartyData_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::browser::context_hub::mojom::FirstPartyDataDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::browser::context_hub::mojom::ThirdPartyDataDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::browser::context_hub::mojom::ThirdPartyDataDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::browser::context_hub::mojom::internal::ThirdPartyData_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    fragment->tab_id = Traits::tab_id(input);

    decltype(Traits::last_active_timestamp(input)) in_last_active_timestamp = Traits::last_active_timestamp(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->last_active_timestamp)::BaseType> last_active_timestamp_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::TimeDataView>(
      in_last_active_timestamp,
      last_active_timestamp_fragment);

    fragment->last_active_timestamp.Set(
        last_active_timestamp_fragment.is_null() ? nullptr : last_active_timestamp_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->last_active_timestamp.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null last_active_timestamp in ThirdPartyData struct");

    
    mojo::internal::Serialize<::browser::context_hub::mojom::AutoTodoGroup>(
      Traits::group_type(input),
      &fragment->group_type);
  }

  static bool Deserialize(::browser::context_hub::mojom::internal::ThirdPartyData_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::browser::context_hub::mojom::ThirdPartyDataDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::browser::context_hub::mojom::AutoTodoItemDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::browser::context_hub::mojom::AutoTodoItemDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::browser::context_hub::mojom::internal::AutoTodoItem_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    decltype(Traits::id(input)) in_id = Traits::id(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->id)::BaseType> id_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_id,
      id_fragment);

    fragment->id.Set(
        id_fragment.is_null() ? nullptr : id_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->id.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null id in AutoTodoItem struct");

    decltype(Traits::title(input)) in_title = Traits::title(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->title)::BaseType> title_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_title,
      title_fragment);

    fragment->title.Set(
        title_fragment.is_null() ? nullptr : title_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->title.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null title in AutoTodoItem struct");

    decltype(Traits::description(input)) in_description = Traits::description(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->description)::BaseType> description_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_description,
      description_fragment);

    fragment->description.Set(
        description_fragment.is_null() ? nullptr : description_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->description.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null description in AutoTodoItem struct");

    
    mojo::internal::Serialize<::browser::context_hub::mojom::AutoTodoStatus>(
      Traits::status(input),
      &fragment->status);

    fragment->score = Traits::score(input);

    decltype(Traits::data(input)) in_data = Traits::data(input);
    mojo::internal::MessageFragment<decltype(fragment->data)>
        data_fragment(fragment.message());
    data_fragment.Claim(&fragment->data);
    
    mojo::internal::Serialize<::browser::context_hub::mojom::AutoTodoDataDataView>(
      in_data,
      data_fragment,
      true);

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->data.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null data in AutoTodoItem struct");
  }

  static bool Deserialize(::browser::context_hub::mojom::internal::AutoTodoItem_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::browser::context_hub::mojom::AutoTodoItemDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::browser::context_hub::mojom::MemoryBankEntryDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::browser::context_hub::mojom::MemoryBankEntryDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::browser::context_hub::mojom::internal::MemoryBankEntry_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    fragment->id = Traits::id(input);

    
    mojo::internal::Serialize<::browser::context_hub::mojom::EntryType>(
      Traits::type(input),
      &fragment->type);

    decltype(Traits::timestamp(input)) in_timestamp = Traits::timestamp(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->timestamp)::BaseType> timestamp_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::TimeDataView>(
      in_timestamp,
      timestamp_fragment);

    fragment->timestamp.Set(
        timestamp_fragment.is_null() ? nullptr : timestamp_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->timestamp.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null timestamp in MemoryBankEntry struct");

    decltype(Traits::url(input)) in_url = Traits::url(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->url)::BaseType> url_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::url::mojom::UrlDataView>(
      in_url,
      url_fragment);

    fragment->url.Set(
        url_fragment.is_null() ? nullptr : url_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->url.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null url in MemoryBankEntry struct");

    decltype(Traits::tab_title(input)) in_tab_title = Traits::tab_title(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->tab_title)::BaseType> tab_title_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_tab_title,
      tab_title_fragment);

    fragment->tab_title.Set(
        tab_title_fragment.is_null() ? nullptr : tab_title_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->tab_title.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null tab_title in MemoryBankEntry struct");

    decltype(Traits::selected_text(input)) in_selected_text = Traits::selected_text(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->selected_text)::BaseType> selected_text_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_selected_text,
      selected_text_fragment);

    fragment->selected_text.Set(
        selected_text_fragment.is_null() ? nullptr : selected_text_fragment.data());

    decltype(Traits::tags(input)) in_tags = Traits::tags(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->tags)::BaseType>
        tags_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& tags_validate_params =
        mojo::internal::GetArrayValidator<0, false, &mojo::internal::GetArrayValidator<0, false, nullptr>()>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<mojo::StringDataView>>(
      in_tags,
      tags_fragment,
      &tags_validate_params);

    fragment->tags.Set(
        tags_fragment.is_null() ? nullptr : tags_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->tags.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null tags in MemoryBankEntry struct");

    decltype(Traits::note(input)) in_note = Traits::note(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->note)::BaseType> note_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_note,
      note_fragment);

    fragment->note.Set(
        note_fragment.is_null() ? nullptr : note_fragment.data());

    decltype(Traits::collection(input)) in_collection = Traits::collection(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->collection)::BaseType> collection_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_collection,
      collection_fragment);

    fragment->collection.Set(
        collection_fragment.is_null() ? nullptr : collection_fragment.data());
  }

  static bool Deserialize(::browser::context_hub::mojom::internal::MemoryBankEntry_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::browser::context_hub::mojom::MemoryBankEntryDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::browser::context_hub::mojom::TabInfoDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::browser::context_hub::mojom::TabInfoDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::browser::context_hub::mojom::internal::TabInfo_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    fragment->id = Traits::id(input);

    decltype(Traits::title(input)) in_title = Traits::title(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->title)::BaseType> title_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_title,
      title_fragment);

    fragment->title.Set(
        title_fragment.is_null() ? nullptr : title_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->title.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null title in TabInfo struct");

    decltype(Traits::url(input)) in_url = Traits::url(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->url)::BaseType> url_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::url::mojom::UrlDataView>(
      in_url,
      url_fragment);

    fragment->url.Set(
        url_fragment.is_null() ? nullptr : url_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->url.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null url in TabInfo struct");
  }

  static bool Deserialize(::browser::context_hub::mojom::internal::TabInfo_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::browser::context_hub::mojom::TabInfoDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::browser::context_hub::mojom::TabGroupDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::browser::context_hub::mojom::TabGroupDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::browser::context_hub::mojom::internal::TabGroup_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    decltype(Traits::label(input)) in_label = Traits::label(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->label)::BaseType> label_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_label,
      label_fragment);

    fragment->label.Set(
        label_fragment.is_null() ? nullptr : label_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->label.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null label in TabGroup struct");

    decltype(Traits::tabs(input)) in_tabs = Traits::tabs(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->tabs)::BaseType>
        tabs_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& tabs_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::browser::context_hub::mojom::TabInfoDataView>>(
      in_tabs,
      tabs_fragment,
      &tabs_validate_params);

    fragment->tabs.Set(
        tabs_fragment.is_null() ? nullptr : tabs_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->tabs.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null tabs in TabGroup struct");

    decltype(Traits::saved_guid(input)) in_saved_guid = Traits::saved_guid(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->saved_guid)::BaseType> saved_guid_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::UuidDataView>(
      in_saved_guid,
      saved_guid_fragment);

    fragment->saved_guid.Set(
        saved_guid_fragment.is_null() ? nullptr : saved_guid_fragment.data());
  }

  static bool Deserialize(::browser::context_hub::mojom::internal::TabGroup_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::browser::context_hub::mojom::TabGroupDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::browser::context_hub::mojom::ChatMessageDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::browser::context_hub::mojom::ChatMessageDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::browser::context_hub::mojom::internal::ChatMessage_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    
    mojo::internal::Serialize<::browser::context_hub::mojom::ChatRole>(
      Traits::role(input),
      &fragment->role);

    decltype(Traits::content(input)) in_content = Traits::content(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->content)::BaseType> content_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_content,
      content_fragment);

    fragment->content.Set(
        content_fragment.is_null() ? nullptr : content_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->content.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null content in ChatMessage struct");
  }

  static bool Deserialize(::browser::context_hub::mojom::internal::ChatMessage_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::browser::context_hub::mojom::ChatMessageDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::browser::context_hub::mojom::SaveToMemoryBankContextDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::browser::context_hub::mojom::SaveToMemoryBankContextDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::browser::context_hub::mojom::internal::SaveToMemoryBankContext_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    decltype(Traits::url(input)) in_url = Traits::url(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->url)::BaseType> url_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::url::mojom::UrlDataView>(
      in_url,
      url_fragment);

    fragment->url.Set(
        url_fragment.is_null() ? nullptr : url_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->url.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null url in SaveToMemoryBankContext struct");

    decltype(Traits::tab_title(input)) in_tab_title = Traits::tab_title(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->tab_title)::BaseType> tab_title_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_tab_title,
      tab_title_fragment);

    fragment->tab_title.Set(
        tab_title_fragment.is_null() ? nullptr : tab_title_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->tab_title.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null tab_title in SaveToMemoryBankContext struct");

    decltype(Traits::selected_text(input)) in_selected_text = Traits::selected_text(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->selected_text)::BaseType> selected_text_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_selected_text,
      selected_text_fragment);

    fragment->selected_text.Set(
        selected_text_fragment.is_null() ? nullptr : selected_text_fragment.data());

    fragment->is_text_selection = Traits::is_text_selection(input);
  }

  static bool Deserialize(::browser::context_hub::mojom::internal::SaveToMemoryBankContext_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::browser::context_hub::mojom::SaveToMemoryBankContextDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::browser::context_hub::mojom::MemoryBankEntryAnnotationsDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::browser::context_hub::mojom::MemoryBankEntryAnnotationsDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::browser::context_hub::mojom::internal::MemoryBankEntryAnnotations_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    decltype(Traits::collection(input)) in_collection = Traits::collection(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->collection)::BaseType> collection_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_collection,
      collection_fragment);

    fragment->collection.Set(
        collection_fragment.is_null() ? nullptr : collection_fragment.data());

    decltype(Traits::note(input)) in_note = Traits::note(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->note)::BaseType> note_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_note,
      note_fragment);

    fragment->note.Set(
        note_fragment.is_null() ? nullptr : note_fragment.data());

    decltype(Traits::tags(input)) in_tags = Traits::tags(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->tags)::BaseType>
        tags_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& tags_validate_params =
        mojo::internal::GetArrayValidator<0, false, &mojo::internal::GetArrayValidator<0, false, nullptr>()>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<mojo::StringDataView>>(
      in_tags,
      tags_fragment,
      &tags_validate_params);

    fragment->tags.Set(
        tags_fragment.is_null() ? nullptr : tags_fragment.data());
  }

  static bool Deserialize(::browser::context_hub::mojom::internal::MemoryBankEntryAnnotations_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::browser::context_hub::mojom::MemoryBankEntryAnnotationsDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::browser::context_hub::mojom::AutoTodoItemFeedbackDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::browser::context_hub::mojom::AutoTodoItemFeedbackDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::browser::context_hub::mojom::internal::AutoTodoItemFeedback_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    decltype(Traits::todo_id(input)) in_todo_id = Traits::todo_id(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->todo_id)::BaseType> todo_id_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_todo_id,
      todo_id_fragment);

    fragment->todo_id.Set(
        todo_id_fragment.is_null() ? nullptr : todo_id_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->todo_id.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null todo_id in AutoTodoItemFeedback struct");

    fragment->liked = Traits::liked(input);
  }

  static bool Deserialize(::browser::context_hub::mojom::internal::AutoTodoItemFeedback_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::browser::context_hub::mojom::AutoTodoItemFeedbackDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::browser::context_hub::mojom::SourceReferenceDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = UnionTraits<::browser::context_hub::mojom::SourceReferenceDataView, UserType>;

  static void Serialize(MaybeConstUserType& input,
                        MessageFragment<::browser::context_hub::mojom::internal::SourceReference_Data>& fragment,
                        bool inlined) {
    
    if (CallIsNullIfExists<Traits>(input)) {
       if (inlined)
        fragment->set_null();
      return;
    }

if (!inlined)
  fragment.Allocate();

    // TODO(azani): Handle unknown and objects.
    // Set the not-null flag.
fragment->size = kUnionDataSize;
fragment->tag = Traits::GetTag(input);
switch (fragment->tag) {
  case ::browser::context_hub::mojom::SourceReferenceDataView::Tag::kGmail: {
    decltype(Traits::gmail(input))
    in_gmail = Traits::gmail(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_gmail)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::browser::context_hub::mojom::GmailReferenceDataView>(
  in_gmail,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null gmail in SourceReference union");
    fragment->data.f_gmail.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::browser::context_hub::mojom::SourceReferenceDataView::Tag::kPhotos: {
    decltype(Traits::photos(input))
    in_photos = Traits::photos(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_photos)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::browser::context_hub::mojom::PhotosReferenceDataView>(
  in_photos,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null photos in SourceReference union");
    fragment->data.f_photos.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
}
  }

  static bool Deserialize(::browser::context_hub::mojom::internal::SourceReference_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input || input->is_null())
      return CallSetToNullIfExists<Traits>(output);

    ::browser::context_hub::mojom::SourceReferenceDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::browser::context_hub::mojom::AutoTodoDataDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = UnionTraits<::browser::context_hub::mojom::AutoTodoDataDataView, UserType>;

  static void Serialize(MaybeConstUserType& input,
                        MessageFragment<::browser::context_hub::mojom::internal::AutoTodoData_Data>& fragment,
                        bool inlined) {
    
    if (CallIsNullIfExists<Traits>(input)) {
       if (inlined)
        fragment->set_null();
      return;
    }

if (!inlined)
  fragment.Allocate();

    // TODO(azani): Handle unknown and objects.
    // Set the not-null flag.
fragment->size = kUnionDataSize;
fragment->tag = Traits::GetTag(input);
switch (fragment->tag) {
  case ::browser::context_hub::mojom::AutoTodoDataDataView::Tag::kFirstParty: {
    decltype(Traits::first_party(input))
    in_first_party = Traits::first_party(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_first_party)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::browser::context_hub::mojom::FirstPartyDataDataView>(
  in_first_party,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null first_party in AutoTodoData union");
    fragment->data.f_first_party.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::browser::context_hub::mojom::AutoTodoDataDataView::Tag::kThirdParty: {
    decltype(Traits::third_party(input))
    in_third_party = Traits::third_party(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_third_party)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::browser::context_hub::mojom::ThirdPartyDataDataView>(
  in_third_party,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null third_party in AutoTodoData union");
    fragment->data.f_third_party.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
}
  }

  static bool Deserialize(::browser::context_hub::mojom::internal::AutoTodoData_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input || input->is_null())
      return CallSetToNullIfExists<Traits>(output);

    ::browser::context_hub::mojom::AutoTodoDataDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal

}  // namespace mojo


namespace browser::context_hub::mojom {

inline void GmailReferenceDataView::GetMessageUrlDataView(
    ::url::mojom::UrlDataView* output) {
  auto pointer = data_->message_url.Get();
  *output = ::url::mojom::UrlDataView(pointer, message_);
}
inline void GmailReferenceDataView::GetSubjectDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->subject.Get();
  *output = mojo::StringDataView(pointer, message_);
}


inline void PhotosReferenceDataView::GetPhotosUrlDataView(
    ::url::mojom::UrlDataView* output) {
  auto pointer = data_->photos_url.Get();
  *output = ::url::mojom::UrlDataView(pointer, message_);
}


inline void FirstPartyDataDataView::GetSourceReferencesDataView(
    mojo::ArrayDataView<SourceReferenceDataView>* output) {
  auto pointer = data_->source_references.Get();
  *output = mojo::ArrayDataView<SourceReferenceDataView>(pointer, message_);
}
inline void FirstPartyDataDataView::GetActionableUrlDataView(
    ::url::mojom::UrlDataView* output) {
  auto pointer = data_->actionable_url.Get();
  *output = ::url::mojom::UrlDataView(pointer, message_);
}


inline void ThirdPartyDataDataView::GetLastActiveTimestampDataView(
    ::mojo_base::mojom::TimeDataView* output) {
  auto pointer = data_->last_active_timestamp.Get();
  *output = ::mojo_base::mojom::TimeDataView(pointer, message_);
}


inline void AutoTodoItemDataView::GetIdDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->id.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void AutoTodoItemDataView::GetTitleDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->title.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void AutoTodoItemDataView::GetDescriptionDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->description.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void AutoTodoItemDataView::GetDataDataView(
    AutoTodoDataDataView* output) {
  auto pointer = &data_->data;
  *output = AutoTodoDataDataView(pointer, message_);
}


inline void MemoryBankEntryDataView::GetTimestampDataView(
    ::mojo_base::mojom::TimeDataView* output) {
  auto pointer = data_->timestamp.Get();
  *output = ::mojo_base::mojom::TimeDataView(pointer, message_);
}
inline void MemoryBankEntryDataView::GetUrlDataView(
    ::url::mojom::UrlDataView* output) {
  auto pointer = data_->url.Get();
  *output = ::url::mojom::UrlDataView(pointer, message_);
}
inline void MemoryBankEntryDataView::GetTabTitleDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->tab_title.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void MemoryBankEntryDataView::GetSelectedTextDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->selected_text.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void MemoryBankEntryDataView::GetTagsDataView(
    mojo::ArrayDataView<mojo::StringDataView>* output) {
  auto pointer = data_->tags.Get();
  *output = mojo::ArrayDataView<mojo::StringDataView>(pointer, message_);
}
inline void MemoryBankEntryDataView::GetNoteDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->note.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void MemoryBankEntryDataView::GetCollectionDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->collection.Get();
  *output = mojo::StringDataView(pointer, message_);
}


inline void TabInfoDataView::GetTitleDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->title.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void TabInfoDataView::GetUrlDataView(
    ::url::mojom::UrlDataView* output) {
  auto pointer = data_->url.Get();
  *output = ::url::mojom::UrlDataView(pointer, message_);
}


inline void TabGroupDataView::GetLabelDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->label.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void TabGroupDataView::GetTabsDataView(
    mojo::ArrayDataView<TabInfoDataView>* output) {
  auto pointer = data_->tabs.Get();
  *output = mojo::ArrayDataView<TabInfoDataView>(pointer, message_);
}
inline void TabGroupDataView::GetSavedGuidDataView(
    ::mojo_base::mojom::UuidDataView* output) {
  auto pointer = data_->saved_guid.Get();
  *output = ::mojo_base::mojom::UuidDataView(pointer, message_);
}


inline void ChatMessageDataView::GetContentDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->content.Get();
  *output = mojo::StringDataView(pointer, message_);
}


inline void SaveToMemoryBankContextDataView::GetUrlDataView(
    ::url::mojom::UrlDataView* output) {
  auto pointer = data_->url.Get();
  *output = ::url::mojom::UrlDataView(pointer, message_);
}
inline void SaveToMemoryBankContextDataView::GetTabTitleDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->tab_title.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void SaveToMemoryBankContextDataView::GetSelectedTextDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->selected_text.Get();
  *output = mojo::StringDataView(pointer, message_);
}


inline void MemoryBankEntryAnnotationsDataView::GetCollectionDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->collection.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void MemoryBankEntryAnnotationsDataView::GetNoteDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->note.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void MemoryBankEntryAnnotationsDataView::GetTagsDataView(
    mojo::ArrayDataView<mojo::StringDataView>* output) {
  auto pointer = data_->tags.Get();
  *output = mojo::ArrayDataView<mojo::StringDataView>(pointer, message_);
}


inline void AutoTodoItemFeedbackDataView::GetTodoIdDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->todo_id.Get();
  *output = mojo::StringDataView(pointer, message_);
}


inline void SourceReferenceDataView::GetGmailDataView(
    GmailReferenceDataView* output) const {
  CHECK(is_gmail());
  *output = GmailReferenceDataView(data_->data.f_gmail.Get(), message_);
}
inline void SourceReferenceDataView::GetPhotosDataView(
    PhotosReferenceDataView* output) const {
  CHECK(is_photos());
  *output = PhotosReferenceDataView(data_->data.f_photos.Get(), message_);
}

inline void AutoTodoDataDataView::GetFirstPartyDataView(
    FirstPartyDataDataView* output) const {
  CHECK(is_first_party());
  *output = FirstPartyDataDataView(data_->data.f_first_party.Get(), message_);
}
inline void AutoTodoDataDataView::GetThirdPartyDataView(
    ThirdPartyDataDataView* output) const {
  CHECK(is_third_party());
  *output = ThirdPartyDataDataView(data_->data.f_third_party.Get(), message_);
}


}  // browser::context_hub::mojom

// Declare TraceFormatTraits for enums, which should be defined in ::perfetto
// namespace.

namespace perfetto {

template <>
struct  TraceFormatTraits<::browser::context_hub::mojom::AutoTodoStatus> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::browser::context_hub::mojom::AutoTodoStatus value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct  TraceFormatTraits<::browser::context_hub::mojom::AutoTodoGroup> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::browser::context_hub::mojom::AutoTodoGroup value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct  TraceFormatTraits<::browser::context_hub::mojom::EntryType> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::browser::context_hub::mojom::EntryType value);
};

} // namespace perfetto

namespace perfetto {

template <>
struct  TraceFormatTraits<::browser::context_hub::mojom::ChatRole> {
 static void WriteIntoTrace(perfetto::TracedValue context, ::browser::context_hub::mojom::ChatRole value);
};

} // namespace perfetto

#endif  // CHROME_BROWSER_UI_WEBUI_CONTEXT_HUB_CONTEXT_HUB_MOJOM_SHARED_H_