// ui/webui/resources/cr_components/help_bubble/help_bubble.mojom-send-validation.h is auto generated by mojom_bindings_generator.py, do not edit

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

#ifndef UI_WEBUI_RESOURCES_CR_COMPONENTS_HELP_BUBBLE_HELP_BUBBLE_MOJOM_SEND_VALIDATION_H_
#define UI_WEBUI_RESOURCES_CR_COMPONENTS_HELP_BUBBLE_HELP_BUBBLE_MOJOM_SEND_VALIDATION_H_

#include "ui/webui/resources/cr_components/help_bubble/help_bubble.mojom-shared-internal.h"
#include "mojo/public/mojom/base/time.mojom-shared.h"
#include "ui/webui/resources/js/tracked_element/tracked_element.mojom-shared.h"

#include "ui/webui/resources/cr_components/help_bubble/help_bubble.mojom-data-view.h"

#include "mojo/public/cpp/bindings/lib/send_validation_type.h"
#include "mojo/public/cpp/bindings/lib/send_validation.h"
#include "mojo/public/cpp/bindings/lib/interface_serialization_send_validation.h"
#include "mojo/public/cpp/bindings/lib/has_send_validation_helper.h"

namespace mojo::internal {
template <typename MaybeConstUserType>
struct HasSendValidationSerialize<::help_bubble::mojom::HelpBubbleArrowPosition, MaybeConstUserType>
    : std::false_type {};
template <typename MaybeConstUserType>
struct HasSendValidationSerialize<::help_bubble::mojom::HelpBubbleClosedReason, MaybeConstUserType>
    : std::false_type {};

template <typename MaybeConstUserType, mojo::internal::SendValidation send_validation>
struct SendValidationSerializer<::help_bubble::mojom::HelpBubbleButtonParamsDataView, MaybeConstUserType, send_validation> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::help_bubble::mojom::HelpBubbleButtonParamsDataView, UserType>;
  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::help_bubble::mojom::internal::HelpBubbleButtonParams_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

      decltype(Traits::text(input)) in_text = Traits::text(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->text)::BaseType> text_fragment(
              fragment.message());
      
      mojo::internal::Serialize<mojo::StringDataView, send_validation>(
        in_text,
        text_fragment);

      fragment->text.Set(
          text_fragment.is_null() ? nullptr : text_fragment.data());

      
      MOJO_INTERNAL_CHECK_SERIALIZATION(
        send_validation,
        !(fragment->text.is_null()),
        mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
        "null text in HelpBubbleButtonParams struct");

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

template <typename MaybeConstUserType, mojo::internal::SendValidation send_validation>
struct SendValidationSerializer<::help_bubble::mojom::ProgressDataView, MaybeConstUserType, send_validation> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::help_bubble::mojom::ProgressDataView, UserType>;
  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::help_bubble::mojom::internal::Progress_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

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

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

template <typename MaybeConstUserType, mojo::internal::SendValidation send_validation>
struct SendValidationSerializer<::help_bubble::mojom::HelpBubbleParamsDataView, MaybeConstUserType, send_validation> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::help_bubble::mojom::HelpBubbleParamsDataView, UserType>;
  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::help_bubble::mojom::internal::HelpBubbleParams_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

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

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

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

      
      mojo::internal::Serialize<::help_bubble::mojom::HelpBubbleArrowPosition>(
        Traits::position(input),
        &fragment->position);

      decltype(Traits::title_text(input)) in_title_text = Traits::title_text(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->title_text)::BaseType> title_text_fragment(
              fragment.message());
      
      mojo::internal::Serialize<mojo::StringDataView, send_validation>(
        in_title_text,
        title_text_fragment);

      fragment->title_text.Set(
          title_text_fragment.is_null() ? nullptr : title_text_fragment.data());

      decltype(Traits::body_text(input)) in_body_text = Traits::body_text(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->body_text)::BaseType> body_text_fragment(
              fragment.message());
      
      mojo::internal::Serialize<mojo::StringDataView, send_validation>(
        in_body_text,
        body_text_fragment);

      fragment->body_text.Set(
          body_text_fragment.is_null() ? nullptr : body_text_fragment.data());

      
      MOJO_INTERNAL_CHECK_SERIALIZATION(
        send_validation,
        !(fragment->body_text.is_null()),
        mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
        "null body_text in HelpBubbleParams struct");

      decltype(Traits::close_button_alt_text(input)) in_close_button_alt_text = Traits::close_button_alt_text(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->close_button_alt_text)::BaseType> close_button_alt_text_fragment(
              fragment.message());
      
      mojo::internal::Serialize<mojo::StringDataView, send_validation>(
        in_close_button_alt_text,
        close_button_alt_text_fragment);

      fragment->close_button_alt_text.Set(
          close_button_alt_text_fragment.is_null() ? nullptr : close_button_alt_text_fragment.data());

      
      MOJO_INTERNAL_CHECK_SERIALIZATION(
        send_validation,
        !(fragment->close_button_alt_text.is_null()),
        mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
        "null close_button_alt_text in HelpBubbleParams struct");

      decltype(Traits::body_icon_name(input)) in_body_icon_name = Traits::body_icon_name(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->body_icon_name)::BaseType> body_icon_name_fragment(
              fragment.message());
      
      mojo::internal::Serialize<mojo::StringDataView, send_validation>(
        in_body_icon_name,
        body_icon_name_fragment);

      fragment->body_icon_name.Set(
          body_icon_name_fragment.is_null() ? nullptr : body_icon_name_fragment.data());

      decltype(Traits::body_icon_alt_text(input)) in_body_icon_alt_text = Traits::body_icon_alt_text(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->body_icon_alt_text)::BaseType> body_icon_alt_text_fragment(
              fragment.message());
      
      mojo::internal::Serialize<mojo::StringDataView, send_validation>(
        in_body_icon_alt_text,
        body_icon_alt_text_fragment);

      fragment->body_icon_alt_text.Set(
          body_icon_alt_text_fragment.is_null() ? nullptr : body_icon_alt_text_fragment.data());

      
      MOJO_INTERNAL_CHECK_SERIALIZATION(
        send_validation,
        !(fragment->body_icon_alt_text.is_null()),
        mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
        "null body_icon_alt_text in HelpBubbleParams struct");

      decltype(Traits::progress(input)) in_progress = Traits::progress(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->progress)::BaseType> progress_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::help_bubble::mojom::ProgressDataView, send_validation>(
        in_progress,
        progress_fragment);

      fragment->progress.Set(
          progress_fragment.is_null() ? nullptr : progress_fragment.data());

      decltype(Traits::buttons(input)) in_buttons = Traits::buttons(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->buttons)::BaseType>
          buttons_fragment(fragment.message());
      constexpr const mojo::internal::ContainerValidateParams& buttons_validate_params =
          mojo::internal::GetArrayValidator<0, false, nullptr>();
      
      mojo::internal::Serialize<mojo::ArrayDataView<::help_bubble::mojom::HelpBubbleButtonParamsDataView>, send_validation>(
        in_buttons,
        buttons_fragment,
        &buttons_validate_params);

      fragment->buttons.Set(
          buttons_fragment.is_null() ? nullptr : buttons_fragment.data());

      
      MOJO_INTERNAL_CHECK_SERIALIZATION(
        send_validation,
        !(fragment->buttons.is_null()),
        mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
        "null buttons in HelpBubbleParams struct");
      fragment->focus_on_show_hint_$flag = Traits::focus_on_show_hint(input).has_value();
      if (Traits::focus_on_show_hint(input).has_value()) {
        fragment->focus_on_show_hint_$value = Traits::focus_on_show_hint(input).value();
      }

      decltype(Traits::timeout(input)) in_timeout = Traits::timeout(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->timeout)::BaseType> timeout_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::mojo_base::mojom::TimeDeltaDataView, send_validation>(
        in_timeout,
        timeout_fragment);

      fragment->timeout.Set(
          timeout_fragment.is_null() ? nullptr : timeout_fragment.data());
  }
};

}  // namespace mojo::internal

#endif  // UI_WEBUI_RESOURCES_CR_COMPONENTS_HELP_BUBBLE_HELP_BUBBLE_MOJOM_SEND_VALIDATION_H_