// components/omnibox/browser/searchbox.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 COMPONENTS_OMNIBOX_BROWSER_SEARCHBOX_MOJOM_SHARED_H_
#define COMPONENTS_OMNIBOX_BROWSER_SEARCHBOX_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 "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"
#include "mojo/public/cpp/bindings/lib/interface_serialization.h"
#include "mojo/public/cpp/system/data_pipe.h"



#include "components/omnibox/browser/searchbox.mojom-data-view.h"  // IWYU pragma: export




namespace std {

template <>
struct hash<::searchbox::mojom::KeywordType>
    : public mojo::internal::EnumHashImpl<::searchbox::mojom::KeywordType> {};

template <>
struct hash<::searchbox::mojom::TabAttachmentSource>
    : public mojo::internal::EnumHashImpl<::searchbox::mojom::TabAttachmentSource> {};

template <>
struct hash<::searchbox::mojom::SideType>
    : public mojo::internal::EnumHashImpl<::searchbox::mojom::SideType> {};

template <>
struct hash<::searchbox::mojom::RenderType>
    : public mojo::internal::EnumHashImpl<::searchbox::mojom::RenderType> {};

template <>
struct hash<::searchbox::mojom::SelectionLineState>
    : public mojo::internal::EnumHashImpl<::searchbox::mojom::SelectionLineState> {};

template <>
struct hash<::searchbox::mojom::SelectionDirection>
    : public mojo::internal::EnumHashImpl<::searchbox::mojom::SelectionDirection> {};

template <>
struct hash<::searchbox::mojom::SelectionStep>
    : public mojo::internal::EnumHashImpl<::searchbox::mojom::SelectionStep> {};

template <>
struct hash<::searchbox::mojom::DriveUploadError>
    : public mojo::internal::EnumHashImpl<::searchbox::mojom::DriveUploadError> {};

template <>
struct hash<::searchbox::mojom::DriveDisclaimerStatus>
    : public mojo::internal::EnumHashImpl<::searchbox::mojom::DriveDisclaimerStatus> {};

template <>
struct hash<::searchbox::mojom::InputMethod>
    : public mojo::internal::EnumHashImpl<::searchbox::mojom::InputMethod> {};

}  // namespace std

namespace mojo {


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::searchbox::mojom::KeywordType, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::searchbox::mojom::KeywordType, 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<::searchbox::mojom::KeywordType>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::searchbox::mojom::KeywordType, UserType> ||
                        HasInfallibleConversion(::searchbox::mojom::KeywordType()),
                    "::searchbox::mojom::KeywordType 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<::searchbox::mojom::TabAttachmentSource, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::searchbox::mojom::TabAttachmentSource, 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<::searchbox::mojom::TabAttachmentSource>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::searchbox::mojom::TabAttachmentSource, UserType> ||
                        HasInfallibleConversion(::searchbox::mojom::TabAttachmentSource()),
                    "::searchbox::mojom::TabAttachmentSource 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<::searchbox::mojom::SideType, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::searchbox::mojom::SideType, 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<::searchbox::mojom::SideType>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::searchbox::mojom::SideType, UserType> ||
                        HasInfallibleConversion(::searchbox::mojom::SideType()),
                    "::searchbox::mojom::SideType 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<::searchbox::mojom::RenderType, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::searchbox::mojom::RenderType, 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<::searchbox::mojom::RenderType>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::searchbox::mojom::RenderType, UserType> ||
                        HasInfallibleConversion(::searchbox::mojom::RenderType()),
                    "::searchbox::mojom::RenderType 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<::searchbox::mojom::SelectionLineState, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::searchbox::mojom::SelectionLineState, 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<::searchbox::mojom::SelectionLineState>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::searchbox::mojom::SelectionLineState, UserType> ||
                        HasInfallibleConversion(::searchbox::mojom::SelectionLineState()),
                    "::searchbox::mojom::SelectionLineState 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<::searchbox::mojom::SelectionDirection, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::searchbox::mojom::SelectionDirection, 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<::searchbox::mojom::SelectionDirection>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::searchbox::mojom::SelectionDirection, UserType> ||
                        HasInfallibleConversion(::searchbox::mojom::SelectionDirection()),
                    "::searchbox::mojom::SelectionDirection 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<::searchbox::mojom::SelectionStep, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::searchbox::mojom::SelectionStep, 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<::searchbox::mojom::SelectionStep>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::searchbox::mojom::SelectionStep, UserType> ||
                        HasInfallibleConversion(::searchbox::mojom::SelectionStep()),
                    "::searchbox::mojom::SelectionStep 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<::searchbox::mojom::DriveUploadError, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::searchbox::mojom::DriveUploadError, 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<::searchbox::mojom::DriveUploadError>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::searchbox::mojom::DriveUploadError, UserType> ||
                        HasInfallibleConversion(::searchbox::mojom::DriveUploadError()),
                    "::searchbox::mojom::DriveUploadError 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<::searchbox::mojom::DriveDisclaimerStatus, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::searchbox::mojom::DriveDisclaimerStatus, 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<::searchbox::mojom::DriveDisclaimerStatus>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::searchbox::mojom::DriveDisclaimerStatus, UserType> ||
                        HasInfallibleConversion(::searchbox::mojom::DriveDisclaimerStatus()),
                    "::searchbox::mojom::DriveDisclaimerStatus 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<::searchbox::mojom::InputMethod, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::searchbox::mojom::InputMethod, 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<::searchbox::mojom::InputMethod>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::searchbox::mojom::InputMethod, UserType> ||
                        HasInfallibleConversion(::searchbox::mojom::InputMethod()),
                    "::searchbox::mojom::InputMethod 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<::searchbox::mojom::ACMatchClassificationDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::searchbox::mojom::ACMatchClassificationDataView, UserType>;

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

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

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

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

    ::searchbox::mojom::ACMatchClassificationDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::hint(input)) in_hint = Traits::hint(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->hint)::BaseType> hint_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_hint,
      hint_fragment);

    fragment->hint.Set(
        hint_fragment.is_null() ? nullptr : hint_fragment.data());

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

    decltype(Traits::suggestion_contents(input)) in_suggestion_contents = Traits::suggestion_contents(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->suggestion_contents)::BaseType> suggestion_contents_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_suggestion_contents,
      suggestion_contents_fragment);

    fragment->suggestion_contents.Set(
        suggestion_contents_fragment.is_null() ? nullptr : suggestion_contents_fragment.data());

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

    decltype(Traits::icon_path(input)) in_icon_path = Traits::icon_path(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->icon_path)::BaseType> icon_path_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_icon_path,
      icon_path_fragment);

    fragment->icon_path.Set(
        icon_path_fragment.is_null() ? nullptr : icon_path_fragment.data());

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

    decltype(Traits::a11y_label(input)) in_a11y_label = Traits::a11y_label(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->a11y_label)::BaseType> a11y_label_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_a11y_label,
      a11y_label_fragment);

    fragment->a11y_label.Set(
        a11y_label_fragment.is_null() ? nullptr : a11y_label_fragment.data());

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

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

    ::searchbox::mojom::ActionDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::first_line(input)) in_first_line = Traits::first_line(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->first_line)::BaseType> first_line_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::String16DataView>(
      in_first_line,
      first_line_fragment);

    fragment->first_line.Set(
        first_line_fragment.is_null() ? nullptr : first_line_fragment.data());

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

    decltype(Traits::second_line(input)) in_second_line = Traits::second_line(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->second_line)::BaseType> second_line_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::String16DataView>(
      in_second_line,
      second_line_fragment);

    fragment->second_line.Set(
        second_line_fragment.is_null() ? nullptr : second_line_fragment.data());

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

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

    ::searchbox::mojom::SuggestionAnswerDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

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

    
    mojo::internal::Serialize<::searchbox::mojom::KeywordType>(
      Traits::type(input),
      &fragment->type);

    decltype(Traits::keyword(input)) in_keyword = Traits::keyword(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->keyword)::BaseType> keyword_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_keyword,
      keyword_fragment);

    fragment->keyword.Set(
        keyword_fragment.is_null() ? nullptr : keyword_fragment.data());

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

    decltype(Traits::display_text(input)) in_display_text = Traits::display_text(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->display_text)::BaseType> display_text_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_display_text,
      display_text_fragment);

    fragment->display_text.Set(
        display_text_fragment.is_null() ? nullptr : display_text_fragment.data());

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

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

    ::searchbox::mojom::InputKeywordModelDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

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

    
    mojo::internal::Serialize<::searchbox::mojom::KeywordType>(
      Traits::type(input),
      &fragment->type);

    decltype(Traits::chip_hint(input)) in_chip_hint = Traits::chip_hint(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->chip_hint)::BaseType> chip_hint_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_chip_hint,
      chip_hint_fragment);

    fragment->chip_hint.Set(
        chip_hint_fragment.is_null() ? nullptr : chip_hint_fragment.data());

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

    decltype(Traits::chip_a11y(input)) in_chip_a11y = Traits::chip_a11y(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->chip_a11y)::BaseType> chip_a11y_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_chip_a11y,
      chip_a11y_fragment);

    fragment->chip_a11y.Set(
        chip_a11y_fragment.is_null() ? nullptr : chip_a11y_fragment.data());

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

    decltype(Traits::placeholder(input)) in_placeholder = Traits::placeholder(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->placeholder)::BaseType> placeholder_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_placeholder,
      placeholder_fragment);

    fragment->placeholder.Set(
        placeholder_fragment.is_null() ? nullptr : placeholder_fragment.data());

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

    decltype(Traits::keyword(input)) in_keyword = Traits::keyword(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->keyword)::BaseType> keyword_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_keyword,
      keyword_fragment);

    fragment->keyword.Set(
        keyword_fragment.is_null() ? nullptr : keyword_fragment.data());

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

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

    ::searchbox::mojom::MatchKeywordModelDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

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

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

    decltype(Traits::a11y_label(input)) in_a11y_label = Traits::a11y_label(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->a11y_label)::BaseType> a11y_label_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::String16DataView>(
      in_a11y_label,
      a11y_label_fragment);

    fragment->a11y_label.Set(
        a11y_label_fragment.is_null() ? nullptr : a11y_label_fragment.data());

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

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

    decltype(Traits::actions(input)) in_actions = Traits::actions(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->actions)::BaseType>
        actions_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& actions_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::searchbox::mojom::ActionDataView>>(
      in_actions,
      actions_fragment,
      &actions_validate_params);

    fragment->actions.Set(
        actions_fragment.is_null() ? nullptr : actions_fragment.data());

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

    decltype(Traits::answer(input)) in_answer = Traits::answer(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->answer)::BaseType> answer_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::searchbox::mojom::SuggestionAnswerDataView>(
      in_answer,
      answer_fragment);

    fragment->answer.Set(
        answer_fragment.is_null() ? nullptr : answer_fragment.data());

    decltype(Traits::contents(input)) in_contents = Traits::contents(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->contents)::BaseType> contents_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::String16DataView>(
      in_contents,
      contents_fragment);

    fragment->contents.Set(
        contents_fragment.is_null() ? nullptr : contents_fragment.data());

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

    decltype(Traits::contents_class(input)) in_contents_class = Traits::contents_class(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->contents_class)::BaseType>
        contents_class_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& contents_class_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::searchbox::mojom::ACMatchClassificationDataView>>(
      in_contents_class,
      contents_class_fragment,
      &contents_class_validate_params);

    fragment->contents_class.Set(
        contents_class_fragment.is_null() ? nullptr : contents_class_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->contents_class.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null contents_class in AutocompleteMatch 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_base::mojom::String16DataView>(
      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 AutocompleteMatch struct");

    decltype(Traits::description_class(input)) in_description_class = Traits::description_class(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->description_class)::BaseType>
        description_class_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& description_class_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::searchbox::mojom::ACMatchClassificationDataView>>(
      in_description_class,
      description_class_fragment,
      &description_class_validate_params);

    fragment->description_class.Set(
        description_class_fragment.is_null() ? nullptr : description_class_fragment.data());

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

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

    fragment->destination_url.Set(
        destination_url_fragment.is_null() ? nullptr : destination_url_fragment.data());

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

    decltype(Traits::inline_autocompletion(input)) in_inline_autocompletion = Traits::inline_autocompletion(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->inline_autocompletion)::BaseType> inline_autocompletion_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::String16DataView>(
      in_inline_autocompletion,
      inline_autocompletion_fragment);

    fragment->inline_autocompletion.Set(
        inline_autocompletion_fragment.is_null() ? nullptr : inline_autocompletion_fragment.data());

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

    decltype(Traits::fill_into_edit(input)) in_fill_into_edit = Traits::fill_into_edit(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->fill_into_edit)::BaseType> fill_into_edit_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::String16DataView>(
      in_fill_into_edit,
      fill_into_edit_fragment);

    fragment->fill_into_edit.Set(
        fill_into_edit_fragment.is_null() ? nullptr : fill_into_edit_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->fill_into_edit.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null fill_into_edit in AutocompleteMatch struct");
    fragment->is_weather_answer_suggestion_$flag = Traits::is_weather_answer_suggestion(input).has_value();
    if (Traits::is_weather_answer_suggestion(input).has_value()) {
      fragment->is_weather_answer_suggestion_$value = Traits::is_weather_answer_suggestion(input).value();
    }

    decltype(Traits::icon_path(input)) in_icon_path = Traits::icon_path(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->icon_path)::BaseType> icon_path_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_icon_path,
      icon_path_fragment);

    fragment->icon_path.Set(
        icon_path_fragment.is_null() ? nullptr : icon_path_fragment.data());

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

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

    fragment->icon_url.Set(
        icon_url_fragment.is_null() ? nullptr : icon_url_fragment.data());

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

    decltype(Traits::image_dominant_color(input)) in_image_dominant_color = Traits::image_dominant_color(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->image_dominant_color)::BaseType> image_dominant_color_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_image_dominant_color,
      image_dominant_color_fragment);

    fragment->image_dominant_color.Set(
        image_dominant_color_fragment.is_null() ? nullptr : image_dominant_color_fragment.data());

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

    decltype(Traits::image_url(input)) in_image_url = Traits::image_url(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->image_url)::BaseType> image_url_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_image_url,
      image_url_fragment);

    fragment->image_url.Set(
        image_url_fragment.is_null() ? nullptr : image_url_fragment.data());

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

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

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

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

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

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

    decltype(Traits::type(input)) in_type = Traits::type(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->type)::BaseType> type_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_type,
      type_fragment);

    fragment->type.Set(
        type_fragment.is_null() ? nullptr : type_fragment.data());

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

    decltype(Traits::remove_button_a11y_label(input)) in_remove_button_a11y_label = Traits::remove_button_a11y_label(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->remove_button_a11y_label)::BaseType> remove_button_a11y_label_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::String16DataView>(
      in_remove_button_a11y_label,
      remove_button_a11y_label_fragment);

    fragment->remove_button_a11y_label.Set(
        remove_button_a11y_label_fragment.is_null() ? nullptr : remove_button_a11y_label_fragment.data());

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

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

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

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

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

    decltype(Traits::tail_suggest_common_prefix(input)) in_tail_suggest_common_prefix = Traits::tail_suggest_common_prefix(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->tail_suggest_common_prefix)::BaseType> tail_suggest_common_prefix_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::String16DataView>(
      in_tail_suggest_common_prefix,
      tail_suggest_common_prefix_fragment);

    fragment->tail_suggest_common_prefix.Set(
        tail_suggest_common_prefix_fragment.is_null() ? nullptr : tail_suggest_common_prefix_fragment.data());

    decltype(Traits::keyword_model(input)) in_keyword_model = Traits::keyword_model(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->keyword_model)::BaseType> keyword_model_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::searchbox::mojom::MatchKeywordModelDataView>(
      in_keyword_model,
      keyword_model_fragment);

    fragment->keyword_model.Set(
        keyword_model_fragment.is_null() ? nullptr : keyword_model_fragment.data());

    decltype(Traits::fusebox_action(input)) in_fusebox_action = Traits::fusebox_action(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->fusebox_action)::BaseType> fusebox_action_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::fusebox_action::mojom::FuseboxActionDataView>(
      in_fusebox_action,
      fusebox_action_fragment);

    fragment->fusebox_action.Set(
        fusebox_action_fragment.is_null() ? nullptr : fusebox_action_fragment.data());
  }

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

    ::searchbox::mojom::AutocompleteMatchDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

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

    fragment->tab_id = Traits::tab_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");

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

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

    decltype(Traits::last_active(input)) in_last_active = Traits::last_active(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->last_active)::BaseType> last_active_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::TimeTicksDataView>(
      in_last_active,
      last_active_fragment);

    fragment->last_active.Set(
        last_active_fragment.is_null() ? nullptr : last_active_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::uuid(input)) in_uuid = Traits::uuid(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->uuid)::BaseType> uuid_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::UnguessableTokenDataView>(
      in_uuid,
      uuid_fragment);

    fragment->uuid.Set(
        uuid_fragment.is_null() ? nullptr : uuid_fragment.data());

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

    decltype(Traits::name(input)) in_name = Traits::name(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->name)::BaseType> name_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_name,
      name_fragment);

    fragment->name.Set(
        name_fragment.is_null() ? nullptr : name_fragment.data());

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

    decltype(Traits::mime_type(input)) in_mime_type = Traits::mime_type(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->mime_type)::BaseType> mime_type_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_mime_type,
      mime_type_fragment);

    fragment->mime_type.Set(
        mime_type_fragment.is_null() ? nullptr : mime_type_fragment.data());

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

    decltype(Traits::image_data_url(input)) in_image_data_url = Traits::image_data_url(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->image_data_url)::BaseType> image_data_url_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_image_data_url,
      image_data_url_fragment);

    fragment->image_data_url.Set(
        image_data_url_fragment.is_null() ? nullptr : image_data_url_fragment.data());
    fragment->error_type_$flag = Traits::error_type(input).has_value();
    if (Traits::error_type(input).has_value()) {
      
      mojo::internal::Serialize<::composebox_query::mojom::ContextUploadErrorType>(
        Traits::error_type(input).value(),
        &fragment->error_type_$value);
    } else {
      fragment->error_type_$value =
          static_cast<int32_t>(::composebox_query::mojom::ContextUploadErrorType::kMinValue);
    }

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

    fragment->icon_url.Set(
        icon_url_fragment.is_null() ? nullptr : icon_url_fragment.data());

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

    fragment->thumbnail_url.Set(
        thumbnail_url_fragment.is_null() ? nullptr : thumbnail_url_fragment.data());
  }

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

    ::searchbox::mojom::FileAttachmentDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

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

    fragment->tab_id = Traits::tab_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 TabAttachment 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 TabAttachment struct");

    
    mojo::internal::Serialize<::searchbox::mojom::TabAttachmentSource>(
      Traits::source(input),
      &fragment->source);
  }

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

    ::searchbox::mojom::TabAttachmentDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

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

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

    fragment->input.Set(
        input_fragment.is_null() ? nullptr : input_fragment.data());

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

    decltype(Traits::attachments(input)) in_attachments = Traits::attachments(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->attachments)::BaseType>
        attachments_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& attachments_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::searchbox::mojom::SearchContextAttachmentDataView>>(
      in_attachments,
      attachments_fragment,
      &attachments_validate_params);

    fragment->attachments.Set(
        attachments_fragment.is_null() ? nullptr : attachments_fragment.data());

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

    
    mojo::internal::Serialize<::composebox_query::mojom::ToolMode>(
      Traits::tool_mode(input),
      &fragment->tool_mode);
  }

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

    ::searchbox::mojom::SearchContextDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::file_name(input)) in_file_name = Traits::file_name(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->file_name)::BaseType> file_name_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_file_name,
      file_name_fragment);

    fragment->file_name.Set(
        file_name_fragment.is_null() ? nullptr : file_name_fragment.data());

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

    decltype(Traits::mime_type(input)) in_mime_type = Traits::mime_type(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->mime_type)::BaseType> mime_type_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_mime_type,
      mime_type_fragment);

    fragment->mime_type.Set(
        mime_type_fragment.is_null() ? nullptr : mime_type_fragment.data());

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

    decltype(Traits::image_data_url(input)) in_image_data_url = Traits::image_data_url(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->image_data_url)::BaseType> image_data_url_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_image_data_url,
      image_data_url_fragment);

    fragment->image_data_url.Set(
        image_data_url_fragment.is_null() ? nullptr : image_data_url_fragment.data());

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

    decltype(Traits::selection_time(input)) in_selection_time = Traits::selection_time(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->selection_time)::BaseType> selection_time_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::JSTimeDataView>(
      in_selection_time,
      selection_time_fragment);

    fragment->selection_time.Set(
        selection_time_fragment.is_null() ? nullptr : selection_time_fragment.data());

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

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

    fragment->thumbnail_url.Set(
        thumbnail_url_fragment.is_null() ? nullptr : thumbnail_url_fragment.data());
  }

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

    ::searchbox::mojom::SelectedFileInfoDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::header(input)) in_header = Traits::header(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->header)::BaseType> header_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::String16DataView>(
      in_header,
      header_fragment);

    fragment->header.Set(
        header_fragment.is_null() ? nullptr : header_fragment.data());

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

    
    mojo::internal::Serialize<::searchbox::mojom::RenderType>(
      Traits::render_type(input),
      &fragment->render_type);

    
    mojo::internal::Serialize<::searchbox::mojom::SideType>(
      Traits::side_type(input),
      &fragment->side_type);
  }

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

    ::searchbox::mojom::SuggestionGroupDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

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

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

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

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

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

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

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

    ::searchbox::mojom::SmartComposeStatsDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

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

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

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

    decltype(Traits::input(input)) in_input = Traits::input(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->input)::BaseType> input_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::String16DataView>(
      in_input,
      input_fragment);

    fragment->input.Set(
        input_fragment.is_null() ? nullptr : input_fragment.data());

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

    decltype(Traits::suggestion_groups_map(input)) in_suggestion_groups_map = Traits::suggestion_groups_map(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->suggestion_groups_map)::BaseType>
        suggestion_groups_map_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& suggestion_groups_map_validate_params =
        mojo::internal::GetMapValidator<*&mojo::internal::GetArrayValidator<0, false, nullptr>(), *&mojo::internal::GetArrayValidator<0, false, nullptr>()>();
    
    mojo::internal::Serialize<mojo::MapDataView<int32_t, ::searchbox::mojom::SuggestionGroupDataView>>(
      in_suggestion_groups_map,
      suggestion_groups_map_fragment,
      &suggestion_groups_map_validate_params);

    fragment->suggestion_groups_map.Set(
        suggestion_groups_map_fragment.is_null() ? nullptr : suggestion_groups_map_fragment.data());

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

    decltype(Traits::matches(input)) in_matches = Traits::matches(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->matches)::BaseType>
        matches_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& matches_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::searchbox::mojom::AutocompleteMatchDataView>>(
      in_matches,
      matches_fragment,
      &matches_validate_params);

    fragment->matches.Set(
        matches_fragment.is_null() ? nullptr : matches_fragment.data());

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

    decltype(Traits::smart_compose_inline_hint(input)) in_smart_compose_inline_hint = Traits::smart_compose_inline_hint(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->smart_compose_inline_hint)::BaseType> smart_compose_inline_hint_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::String16DataView>(
      in_smart_compose_inline_hint,
      smart_compose_inline_hint_fragment);

    fragment->smart_compose_inline_hint.Set(
        smart_compose_inline_hint_fragment.is_null() ? nullptr : smart_compose_inline_hint_fragment.data());
  }

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

    ::searchbox::mojom::AutocompleteResultDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

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

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

    
    mojo::internal::Serialize<::searchbox::mojom::SelectionLineState>(
      Traits::state(input),
      &fragment->state);

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

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

    ::searchbox::mojom::OmniboxPopupSelectionDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

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

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

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

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

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

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

    ::searchbox::mojom::ActionModifiersDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::texts(input)) in_texts = Traits::texts(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->texts)::BaseType>
        texts_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& texts_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::mojo_base::mojom::String16DataView>>(
      in_texts,
      texts_fragment,
      &texts_validate_params);

    fragment->texts.Set(
        texts_fragment.is_null() ? nullptr : texts_fragment.data());

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

    decltype(Traits::change_text_animation_interval(input)) in_change_text_animation_interval = Traits::change_text_animation_interval(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->change_text_animation_interval)::BaseType> change_text_animation_interval_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::TimeDeltaDataView>(
      in_change_text_animation_interval,
      change_text_animation_interval_fragment);

    fragment->change_text_animation_interval.Set(
        change_text_animation_interval_fragment.is_null() ? nullptr : change_text_animation_interval_fragment.data());

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

    decltype(Traits::fade_text_animation_duration(input)) in_fade_text_animation_duration = Traits::fade_text_animation_duration(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->fade_text_animation_duration)::BaseType> fade_text_animation_duration_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::TimeDeltaDataView>(
      in_fade_text_animation_duration,
      fade_text_animation_duration_fragment);

    fragment->fade_text_animation_duration.Set(
        fade_text_animation_duration_fragment.is_null() ? nullptr : fade_text_animation_duration_fragment.data());

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

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

    ::searchbox::mojom::PlaceholderConfigDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::token(input)) in_token = Traits::token(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->token)::BaseType> token_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::mojo_base::mojom::UnguessableTokenDataView>(
      in_token,
      token_fragment);

    fragment->token.Set(
        token_fragment.is_null() ? nullptr : token_fragment.data());

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

    decltype(Traits::mime_type(input)) in_mime_type = Traits::mime_type(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->mime_type)::BaseType> mime_type_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_mime_type,
      mime_type_fragment);

    fragment->mime_type.Set(
        mime_type_fragment.is_null() ? nullptr : mime_type_fragment.data());

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

    decltype(Traits::file_name(input)) in_file_name = Traits::file_name(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->file_name)::BaseType> file_name_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_file_name,
      file_name_fragment);

    fragment->file_name.Set(
        file_name_fragment.is_null() ? nullptr : file_name_fragment.data());

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

    decltype(Traits::thumbnail_url(input)) in_thumbnail_url = Traits::thumbnail_url(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->thumbnail_url)::BaseType> thumbnail_url_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_thumbnail_url,
      thumbnail_url_fragment);

    fragment->thumbnail_url.Set(
        thumbnail_url_fragment.is_null() ? nullptr : thumbnail_url_fragment.data());

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

    fragment->icon_url.Set(
        icon_url_fragment.is_null() ? nullptr : icon_url_fragment.data());
  }

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

    ::searchbox::mojom::DriveFileDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::files(input)) in_files = Traits::files(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->files)::BaseType>
        files_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& files_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<::searchbox::mojom::DriveFileDataView>>(
      in_files,
      files_fragment,
      &files_validate_params);

    fragment->files.Set(
        files_fragment.is_null() ? nullptr : files_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->files.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null files in DriveUploadResponse struct");
    fragment->error_$flag = Traits::error(input).has_value();
    if (Traits::error(input).has_value()) {
      
      mojo::internal::Serialize<::searchbox::mojom::DriveUploadError>(
        Traits::error(input).value(),
        &fragment->error_$value);
    } else {
      fragment->error_$value =
          static_cast<int32_t>(::searchbox::mojom::DriveUploadError::kMinValue);
    }
  }

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

    ::searchbox::mojom::DriveUploadResponseDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

  static void Serialize(MaybeConstUserType& input,
                        MessageFragment<::searchbox::mojom::internal::SearchContextAttachment_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 ::searchbox::mojom::SearchContextAttachmentDataView::Tag::kFileAttachment: {
    decltype(Traits::file_attachment(input))
    in_file_attachment = Traits::file_attachment(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_file_attachment)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::searchbox::mojom::FileAttachmentDataView>(
  in_file_attachment,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null file_attachment in SearchContextAttachment union");
    fragment->data.f_file_attachment.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::searchbox::mojom::SearchContextAttachmentDataView::Tag::kTabAttachment: {
    decltype(Traits::tab_attachment(input))
    in_tab_attachment = Traits::tab_attachment(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_tab_attachment)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::searchbox::mojom::TabAttachmentDataView>(
  in_tab_attachment,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null tab_attachment in SearchContextAttachment union");
    fragment->data.f_tab_attachment.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
}
  }

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

    ::searchbox::mojom::SearchContextAttachmentDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

  static void Serialize(MaybeConstUserType& input,
                        MessageFragment<::searchbox::mojom::internal::PageHandler_AddFileContext_ResponseParam_Result_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 ::searchbox::mojom::PageHandler_AddFileContext_ResponseParam_ResultDataView::Tag::kSuccess: {
    decltype(Traits::success(input))
    in_success = Traits::success(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_success)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::mojo_base::mojom::UnguessableTokenDataView>(
  in_success,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null success in PageHandler_AddFileContext_ResponseParam_Result union");
    fragment->data.f_success.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::searchbox::mojom::PageHandler_AddFileContext_ResponseParam_ResultDataView::Tag::kFailure: {
    decltype(Traits::failure(input))
    in_failure = Traits::failure(input);
        
mojo::internal::Serialize<::composebox_query::mojom::ContextUploadErrorType>(
  in_failure,
  &fragment->data.f_failure);
    break;
  }
}
  }

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

    ::searchbox::mojom::PageHandler_AddFileContext_ResponseParam_ResultDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal


namespace internal {

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

  static void Serialize(MaybeConstUserType& input,
                        MessageFragment<::searchbox::mojom::internal::PageHandler_AddTabContext_ResponseParam_Result_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 ::searchbox::mojom::PageHandler_AddTabContext_ResponseParam_ResultDataView::Tag::kSuccess: {
    decltype(Traits::success(input))
    in_success = Traits::success(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_success)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::mojo_base::mojom::UnguessableTokenDataView>(
  in_success,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  mojo::internal::SendValidation::kDefault,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null success in PageHandler_AddTabContext_ResponseParam_Result union");
    fragment->data.f_success.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::searchbox::mojom::PageHandler_AddTabContext_ResponseParam_ResultDataView::Tag::kFailure: {
    decltype(Traits::failure(input))
    in_failure = Traits::failure(input);
        
mojo::internal::Serialize<::composebox_query::mojom::ContextUploadErrorType>(
  in_failure,
  &fragment->data.f_failure);
    break;
  }
}
  }

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

    ::searchbox::mojom::PageHandler_AddTabContext_ResponseParam_ResultDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal

}  // namespace mojo


namespace searchbox::mojom {



inline void ActionDataView::GetHintDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->hint.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void ActionDataView::GetSuggestionContentsDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->suggestion_contents.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void ActionDataView::GetIconPathDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->icon_path.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void ActionDataView::GetA11yLabelDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->a11y_label.Get();
  *output = mojo::StringDataView(pointer, message_);
}


inline void SuggestionAnswerDataView::GetFirstLineDataView(
    ::mojo_base::mojom::String16DataView* output) {
  auto pointer = data_->first_line.Get();
  *output = ::mojo_base::mojom::String16DataView(pointer, message_);
}
inline void SuggestionAnswerDataView::GetSecondLineDataView(
    ::mojo_base::mojom::String16DataView* output) {
  auto pointer = data_->second_line.Get();
  *output = ::mojo_base::mojom::String16DataView(pointer, message_);
}


inline void InputKeywordModelDataView::GetKeywordDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->keyword.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void InputKeywordModelDataView::GetDisplayTextDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->display_text.Get();
  *output = mojo::StringDataView(pointer, message_);
}


inline void MatchKeywordModelDataView::GetChipHintDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->chip_hint.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void MatchKeywordModelDataView::GetChipA11yDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->chip_a11y.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void MatchKeywordModelDataView::GetPlaceholderDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->placeholder.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void MatchKeywordModelDataView::GetKeywordDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->keyword.Get();
  *output = mojo::StringDataView(pointer, message_);
}


inline void AutocompleteMatchDataView::GetA11yLabelDataView(
    ::mojo_base::mojom::String16DataView* output) {
  auto pointer = data_->a11y_label.Get();
  *output = ::mojo_base::mojom::String16DataView(pointer, message_);
}
inline void AutocompleteMatchDataView::GetActionsDataView(
    mojo::ArrayDataView<ActionDataView>* output) {
  auto pointer = data_->actions.Get();
  *output = mojo::ArrayDataView<ActionDataView>(pointer, message_);
}
inline void AutocompleteMatchDataView::GetAnswerDataView(
    SuggestionAnswerDataView* output) {
  auto pointer = data_->answer.Get();
  *output = SuggestionAnswerDataView(pointer, message_);
}
inline void AutocompleteMatchDataView::GetContentsDataView(
    ::mojo_base::mojom::String16DataView* output) {
  auto pointer = data_->contents.Get();
  *output = ::mojo_base::mojom::String16DataView(pointer, message_);
}
inline void AutocompleteMatchDataView::GetContentsClassDataView(
    mojo::ArrayDataView<ACMatchClassificationDataView>* output) {
  auto pointer = data_->contents_class.Get();
  *output = mojo::ArrayDataView<ACMatchClassificationDataView>(pointer, message_);
}
inline void AutocompleteMatchDataView::GetDescriptionDataView(
    ::mojo_base::mojom::String16DataView* output) {
  auto pointer = data_->description.Get();
  *output = ::mojo_base::mojom::String16DataView(pointer, message_);
}
inline void AutocompleteMatchDataView::GetDescriptionClassDataView(
    mojo::ArrayDataView<ACMatchClassificationDataView>* output) {
  auto pointer = data_->description_class.Get();
  *output = mojo::ArrayDataView<ACMatchClassificationDataView>(pointer, message_);
}
inline void AutocompleteMatchDataView::GetDestinationUrlDataView(
    ::url::mojom::UrlDataView* output) {
  auto pointer = data_->destination_url.Get();
  *output = ::url::mojom::UrlDataView(pointer, message_);
}
inline void AutocompleteMatchDataView::GetInlineAutocompletionDataView(
    ::mojo_base::mojom::String16DataView* output) {
  auto pointer = data_->inline_autocompletion.Get();
  *output = ::mojo_base::mojom::String16DataView(pointer, message_);
}
inline void AutocompleteMatchDataView::GetFillIntoEditDataView(
    ::mojo_base::mojom::String16DataView* output) {
  auto pointer = data_->fill_into_edit.Get();
  *output = ::mojo_base::mojom::String16DataView(pointer, message_);
}
inline void AutocompleteMatchDataView::GetIconPathDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->icon_path.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void AutocompleteMatchDataView::GetIconUrlDataView(
    ::url::mojom::UrlDataView* output) {
  auto pointer = data_->icon_url.Get();
  *output = ::url::mojom::UrlDataView(pointer, message_);
}
inline void AutocompleteMatchDataView::GetImageDominantColorDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->image_dominant_color.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void AutocompleteMatchDataView::GetImageUrlDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->image_url.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void AutocompleteMatchDataView::GetTypeDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->type.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void AutocompleteMatchDataView::GetRemoveButtonA11yLabelDataView(
    ::mojo_base::mojom::String16DataView* output) {
  auto pointer = data_->remove_button_a11y_label.Get();
  *output = ::mojo_base::mojom::String16DataView(pointer, message_);
}
inline void AutocompleteMatchDataView::GetTailSuggestCommonPrefixDataView(
    ::mojo_base::mojom::String16DataView* output) {
  auto pointer = data_->tail_suggest_common_prefix.Get();
  *output = ::mojo_base::mojom::String16DataView(pointer, message_);
}
inline void AutocompleteMatchDataView::GetKeywordModelDataView(
    MatchKeywordModelDataView* output) {
  auto pointer = data_->keyword_model.Get();
  *output = MatchKeywordModelDataView(pointer, message_);
}
inline void AutocompleteMatchDataView::GetFuseboxActionDataView(
    ::fusebox_action::mojom::FuseboxActionDataView* output) {
  auto pointer = data_->fusebox_action.Get();
  *output = ::fusebox_action::mojom::FuseboxActionDataView(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 TabInfoDataView::GetLastActiveDataView(
    ::mojo_base::mojom::TimeTicksDataView* output) {
  auto pointer = data_->last_active.Get();
  *output = ::mojo_base::mojom::TimeTicksDataView(pointer, message_);
}


inline void FileAttachmentDataView::GetUuidDataView(
    ::mojo_base::mojom::UnguessableTokenDataView* output) {
  auto pointer = data_->uuid.Get();
  *output = ::mojo_base::mojom::UnguessableTokenDataView(pointer, message_);
}
inline void FileAttachmentDataView::GetNameDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->name.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void FileAttachmentDataView::GetMimeTypeDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->mime_type.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void FileAttachmentDataView::GetImageDataUrlDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->image_data_url.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void FileAttachmentDataView::GetIconUrlDataView(
    ::url::mojom::UrlDataView* output) {
  auto pointer = data_->icon_url.Get();
  *output = ::url::mojom::UrlDataView(pointer, message_);
}
inline void FileAttachmentDataView::GetThumbnailUrlDataView(
    ::url::mojom::UrlDataView* output) {
  auto pointer = data_->thumbnail_url.Get();
  *output = ::url::mojom::UrlDataView(pointer, message_);
}


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


inline void SearchContextDataView::GetInputDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->input.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void SearchContextDataView::GetAttachmentsDataView(
    mojo::ArrayDataView<SearchContextAttachmentDataView>* output) {
  auto pointer = data_->attachments.Get();
  *output = mojo::ArrayDataView<SearchContextAttachmentDataView>(pointer, message_);
}


inline void SelectedFileInfoDataView::GetFileNameDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->file_name.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void SelectedFileInfoDataView::GetMimeTypeDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->mime_type.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void SelectedFileInfoDataView::GetImageDataUrlDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->image_data_url.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void SelectedFileInfoDataView::GetSelectionTimeDataView(
    ::mojo_base::mojom::JSTimeDataView* output) {
  auto pointer = data_->selection_time.Get();
  *output = ::mojo_base::mojom::JSTimeDataView(pointer, message_);
}
inline void SelectedFileInfoDataView::GetThumbnailUrlDataView(
    ::url::mojom::UrlDataView* output) {
  auto pointer = data_->thumbnail_url.Get();
  *output = ::url::mojom::UrlDataView(pointer, message_);
}


inline void SuggestionGroupDataView::GetHeaderDataView(
    ::mojo_base::mojom::String16DataView* output) {
  auto pointer = data_->header.Get();
  *output = ::mojo_base::mojom::String16DataView(pointer, message_);
}




inline void AutocompleteResultDataView::GetInputDataView(
    ::mojo_base::mojom::String16DataView* output) {
  auto pointer = data_->input.Get();
  *output = ::mojo_base::mojom::String16DataView(pointer, message_);
}
inline void AutocompleteResultDataView::GetSuggestionGroupsMapDataView(
    mojo::MapDataView<int32_t, SuggestionGroupDataView>* output) {
  auto pointer = data_->suggestion_groups_map.Get();
  *output = mojo::MapDataView<int32_t, SuggestionGroupDataView>(pointer, message_);
}
inline void AutocompleteResultDataView::GetMatchesDataView(
    mojo::ArrayDataView<AutocompleteMatchDataView>* output) {
  auto pointer = data_->matches.Get();
  *output = mojo::ArrayDataView<AutocompleteMatchDataView>(pointer, message_);
}
inline void AutocompleteResultDataView::GetSmartComposeInlineHintDataView(
    ::mojo_base::mojom::String16DataView* output) {
  auto pointer = data_->smart_compose_inline_hint.Get();
  *output = ::mojo_base::mojom::String16DataView(pointer, message_);
}






inline void PlaceholderConfigDataView::GetTextsDataView(
    mojo::ArrayDataView<::mojo_base::mojom::String16DataView>* output) {
  auto pointer = data_->texts.Get();
  *output = mojo::ArrayDataView<::mojo_base::mojom::String16DataView>(pointer, message_);
}
inline void PlaceholderConfigDataView::GetChangeTextAnimationIntervalDataView(
    ::mojo_base::mojom::TimeDeltaDataView* output) {
  auto pointer = data_->change_text_animation_interval.Get();
  *output = ::mojo_base::mojom::TimeDeltaDataView(pointer, message_);
}
inline void PlaceholderConfigDataView::GetFadeTextAnimationDurationDataView(
    ::mojo_base::mojom::TimeDeltaDataView* output) {
  auto pointer = data_->fade_text_animation_duration.Get();
  *output = ::mojo_base::mojom::TimeDeltaDataView(pointer, message_);
}


inline void DriveFileDataView::GetTokenDataView(
    ::mojo_base::mojom::UnguessableTokenDataView* output) {
  auto pointer = data_->token.Get();
  *output = ::mojo_base::mojom::UnguessableTokenDataView(pointer, message_);
}
inline void DriveFileDataView::GetMimeTypeDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->mime_type.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void DriveFileDataView::GetFileNameDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->file_name.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void DriveFileDataView::GetThumbnailUrlDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->thumbnail_url.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void DriveFileDataView::GetIconUrlDataView(
    ::url::mojom::UrlDataView* output) {
  auto pointer = data_->icon_url.Get();
  *output = ::url::mojom::UrlDataView(pointer, message_);
}


inline void DriveUploadResponseDataView::GetFilesDataView(
    mojo::ArrayDataView<DriveFileDataView>* output) {
  auto pointer = data_->files.Get();
  *output = mojo::ArrayDataView<DriveFileDataView>(pointer, message_);
}


inline void SearchContextAttachmentDataView::GetFileAttachmentDataView(
    FileAttachmentDataView* output) const {
  CHECK(is_file_attachment());
  *output = FileAttachmentDataView(data_->data.f_file_attachment.Get(), message_);
}
inline void SearchContextAttachmentDataView::GetTabAttachmentDataView(
    TabAttachmentDataView* output) const {
  CHECK(is_tab_attachment());
  *output = TabAttachmentDataView(data_->data.f_tab_attachment.Get(), message_);
}

inline void PageHandler_AddFileContext_ResponseParam_ResultDataView::GetSuccessDataView(
    ::mojo_base::mojom::UnguessableTokenDataView* output) const {
  CHECK(is_success());
  *output = ::mojo_base::mojom::UnguessableTokenDataView(data_->data.f_success.Get(), message_);
}

inline void PageHandler_AddTabContext_ResponseParam_ResultDataView::GetSuccessDataView(
    ::mojo_base::mojom::UnguessableTokenDataView* output) const {
  CHECK(is_success());
  *output = ::mojo_base::mojom::UnguessableTokenDataView(data_->data.f_success.Get(), message_);
}


}  // searchbox::mojom

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

namespace perfetto {

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

} // namespace perfetto

namespace perfetto {

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

} // namespace perfetto

namespace perfetto {

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

} // namespace perfetto

namespace perfetto {

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

} // namespace perfetto

namespace perfetto {

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

} // namespace perfetto

namespace perfetto {

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

} // namespace perfetto

namespace perfetto {

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

} // namespace perfetto

namespace perfetto {

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

} // namespace perfetto

namespace perfetto {

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

} // namespace perfetto

namespace perfetto {

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

} // namespace perfetto

#endif  // COMPONENTS_OMNIBOX_BROWSER_SEARCHBOX_MOJOM_SHARED_H_