// chrome/common/actor_webui.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 CHROME_COMMON_ACTOR_WEBUI_MOJOM_SEND_VALIDATION_H_
#define CHROME_COMMON_ACTOR_WEBUI_MOJOM_SEND_VALIDATION_H_

#include "chrome/common/actor_webui.mojom-shared-internal.h"
#include "chrome/common/glic_enums.mojom-shared.h"
#include "skia/public/mojom/bitmap.mojom-shared.h"
#include "url/mojom/origin.mojom-shared.h"

#include "chrome/common/actor_webui.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/has_send_validation_helper.h"

namespace mojo::internal {
template <typename MaybeConstUserType>
struct HasSendValidationSerialize<::actor::webui::mojom::TaskDuration, MaybeConstUserType>
    : std::false_type {};
template <typename MaybeConstUserType>
struct HasSendValidationSerialize<::actor::webui::mojom::UserGrantedPermissionDuration, MaybeConstUserType>
    : std::false_type {};
template <typename MaybeConstUserType>
struct HasSendValidationSerialize<::actor::webui::mojom::CredentialType, MaybeConstUserType>
    : std::false_type {};
template <typename MaybeConstUserType>
struct HasSendValidationSerialize<::actor::webui::mojom::SelectCredentialDialogErrorReason, MaybeConstUserType>
    : std::false_type {};
template <typename MaybeConstUserType>
struct HasSendValidationSerialize<::actor::webui::mojom::SelectAutofillSuggestionsDialogErrorReason, MaybeConstUserType>
    : std::false_type {};
template <typename MaybeConstUserType>
struct HasSendValidationSerialize<::actor::webui::mojom::ConfirmationRequestErrorReason, MaybeConstUserType>
    : std::false_type {};
template <typename MaybeConstUserType>
struct HasSendValidationSerialize<::actor::webui::mojom::GmailOtpErrorReason, MaybeConstUserType>
    : std::false_type {};

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

      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, send_validation>(
        in_title,
        title_fragment);

      fragment->title.Set(
          title_fragment.is_null() ? nullptr : title_fragment.data());
      fragment->duration_$flag = Traits::duration(input).has_value();
      if (Traits::duration(input).has_value()) {
        
        mojo::internal::Serialize<::actor::webui::mojom::TaskDuration>(
          Traits::duration(input).value(),
          &fragment->duration_$value);
      } else {
        fragment->duration_$value =
            static_cast<int32_t>(::actor::webui::mojom::TaskDuration::kMinValue);
      }
      fragment->feature_mode_$flag = Traits::feature_mode(input).has_value();
      if (Traits::feature_mode(input).has_value()) {
        
        mojo::internal::Serialize<::glic::mojom::FeatureMode>(
          Traits::feature_mode(input).value(),
          &fragment->feature_mode_$value);
      } else {
        fragment->feature_mode_$value =
            static_cast<int32_t>(::glic::mojom::FeatureMode::kMinValue);
      }
      fragment->actuation_tab_id_$flag = Traits::actuation_tab_id(input).has_value();
      if (Traits::actuation_tab_id(input).has_value()) {
        fragment->actuation_tab_id_$value = Traits::actuation_tab_id(input).value();
      }
  }
};

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

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

      decltype(Traits::username(input)) in_username = Traits::username(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->username)::BaseType> username_fragment(
              fragment.message());
      
      mojo::internal::Serialize<mojo::StringDataView, send_validation>(
        in_username,
        username_fragment);

      fragment->username.Set(
          username_fragment.is_null() ? nullptr : username_fragment.data());

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

      decltype(Traits::source_site_or_app(input)) in_source_site_or_app = Traits::source_site_or_app(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->source_site_or_app)::BaseType> source_site_or_app_fragment(
              fragment.message());
      
      mojo::internal::Serialize<mojo::StringDataView, send_validation>(
        in_source_site_or_app,
        source_site_or_app_fragment);

      fragment->source_site_or_app.Set(
          source_site_or_app_fragment.is_null() ? nullptr : source_site_or_app_fragment.data());

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

      decltype(Traits::request_origin(input)) in_request_origin = Traits::request_origin(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->request_origin)::BaseType> request_origin_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::url::mojom::OriginDataView, send_validation>(
        in_request_origin,
        request_origin_fragment);

      fragment->request_origin.Set(
          request_origin_fragment.is_null() ? nullptr : request_origin_fragment.data());

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

      decltype(Traits::display_origin(input)) in_display_origin = Traits::display_origin(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->display_origin)::BaseType> display_origin_fragment(
              fragment.message());
      
      mojo::internal::Serialize<mojo::StringDataView, send_validation>(
        in_display_origin,
        display_origin_fragment);

      fragment->display_origin.Set(
          display_origin_fragment.is_null() ? nullptr : display_origin_fragment.data());

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

      
      mojo::internal::Serialize<::actor::webui::mojom::CredentialType>(
        Traits::type(input),
        &fragment->type);

      decltype(Traits::account_picture(input)) in_account_picture = Traits::account_picture(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->account_picture)::BaseType> account_picture_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::skia::mojom::BitmapN32DataView, send_validation>(
        in_account_picture,
        account_picture_fragment);

      fragment->account_picture.Set(
          account_picture_fragment.is_null() ? nullptr : account_picture_fragment.data());
  }
};

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

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

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

      decltype(Traits::credentials(input)) in_credentials = Traits::credentials(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->credentials)::BaseType>
          credentials_fragment(fragment.message());
      constexpr const mojo::internal::ContainerValidateParams& credentials_validate_params =
          mojo::internal::GetArrayValidator<0, false, nullptr>();
      
      mojo::internal::Serialize<mojo::ArrayDataView<::actor::webui::mojom::CredentialDataView>, send_validation>(
        in_credentials,
        credentials_fragment,
        &credentials_validate_params);

      fragment->credentials.Set(
          credentials_fragment.is_null() ? nullptr : credentials_fragment.data());

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

      decltype(Traits::icons(input)) in_icons = Traits::icons(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->icons)::BaseType>
          icons_fragment(fragment.message());
      constexpr const mojo::internal::ContainerValidateParams& icons_validate_params =
          mojo::internal::GetMapValidator<*&mojo::internal::GetArrayValidator<0, false, &mojo::internal::GetArrayValidator<0, false, nullptr>()>(), *&mojo::internal::GetArrayValidator<0, false, nullptr>()>();
      
      mojo::internal::Serialize<mojo::MapDataView<mojo::StringDataView, ::skia::mojom::BitmapN32DataView>, send_validation>(
        in_icons,
        icons_fragment,
        &icons_validate_params);

      fragment->icons.Set(
          icons_fragment.is_null() ? nullptr : icons_fragment.data());

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

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

      fragment->task_id = Traits::task_id(input);
      fragment->error_reason_$flag = Traits::error_reason(input).has_value();
      if (Traits::error_reason(input).has_value()) {
        
        mojo::internal::Serialize<::actor::webui::mojom::SelectCredentialDialogErrorReason>(
          Traits::error_reason(input).value(),
          &fragment->error_reason_$value);
      } else {
        fragment->error_reason_$value =
            static_cast<int32_t>(::actor::webui::mojom::SelectCredentialDialogErrorReason::kMinValue);
      }
      fragment->permission_duration_$flag = Traits::permission_duration(input).has_value();
      if (Traits::permission_duration(input).has_value()) {
        
        mojo::internal::Serialize<::actor::webui::mojom::UserGrantedPermissionDuration>(
          Traits::permission_duration(input).value(),
          &fragment->permission_duration_$value);
      } else {
        fragment->permission_duration_$value =
            static_cast<int32_t>(::actor::webui::mojom::UserGrantedPermissionDuration::kMinValue);
      }
      fragment->selected_credential_id_$flag = Traits::selected_credential_id(input).has_value();
      if (Traits::selected_credential_id(input).has_value()) {
        fragment->selected_credential_id_$value = Traits::selected_credential_id(input).value();
      }
  }
};

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

      decltype(Traits::id(input)) in_id = Traits::id(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->id)::BaseType> id_fragment(
              fragment.message());
      
      mojo::internal::Serialize<mojo::StringDataView, 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 AutofillSuggestion struct");

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

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

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

      decltype(Traits::details(input)) in_details = Traits::details(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->details)::BaseType> details_fragment(
              fragment.message());
      
      mojo::internal::Serialize<mojo::StringDataView, send_validation>(
        in_details,
        details_fragment);

      fragment->details.Set(
          details_fragment.is_null() ? nullptr : details_fragment.data());

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

      decltype(Traits::icon(input)) in_icon = Traits::icon(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->icon)::BaseType> icon_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::skia::mojom::BitmapN32DataView, send_validation>(
        in_icon,
        icon_fragment);

      fragment->icon.Set(
          icon_fragment.is_null() ? nullptr : icon_fragment.data());
  }
};

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

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

      decltype(Traits::formatted_request_origin(input)) in_formatted_request_origin = Traits::formatted_request_origin(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->formatted_request_origin)::BaseType> formatted_request_origin_fragment(
              fragment.message());
      
      mojo::internal::Serialize<mojo::StringDataView, send_validation>(
        in_formatted_request_origin,
        formatted_request_origin_fragment);

      fragment->formatted_request_origin.Set(
          formatted_request_origin_fragment.is_null() ? nullptr : formatted_request_origin_fragment.data());

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

      decltype(Traits::section_label(input)) in_section_label = Traits::section_label(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->section_label)::BaseType> section_label_fragment(
              fragment.message());
      
      mojo::internal::Serialize<mojo::StringDataView, send_validation>(
        in_section_label,
        section_label_fragment);

      fragment->section_label.Set(
          section_label_fragment.is_null() ? nullptr : section_label_fragment.data());

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

      decltype(Traits::suggestions(input)) in_suggestions = Traits::suggestions(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->suggestions)::BaseType>
          suggestions_fragment(fragment.message());
      constexpr const mojo::internal::ContainerValidateParams& suggestions_validate_params =
          mojo::internal::GetArrayValidator<0, false, nullptr>();
      
      mojo::internal::Serialize<mojo::ArrayDataView<::actor::webui::mojom::AutofillSuggestionDataView>, send_validation>(
        in_suggestions,
        suggestions_fragment,
        &suggestions_validate_params);

      fragment->suggestions.Set(
          suggestions_fragment.is_null() ? nullptr : suggestions_fragment.data());

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

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

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

      decltype(Traits::form_filling_requests(input)) in_form_filling_requests = Traits::form_filling_requests(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->form_filling_requests)::BaseType>
          form_filling_requests_fragment(fragment.message());
      constexpr const mojo::internal::ContainerValidateParams& form_filling_requests_validate_params =
          mojo::internal::GetArrayValidator<0, false, nullptr>();
      
      mojo::internal::Serialize<mojo::ArrayDataView<::actor::webui::mojom::FormFillingRequestDataView>, send_validation>(
        in_form_filling_requests,
        form_filling_requests_fragment,
        &form_filling_requests_validate_params);

      fragment->form_filling_requests.Set(
          form_filling_requests_fragment.is_null() ? nullptr : form_filling_requests_fragment.data());

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

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

      decltype(Traits::selected_suggestion_id(input)) in_selected_suggestion_id = Traits::selected_suggestion_id(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->selected_suggestion_id)::BaseType> selected_suggestion_id_fragment(
              fragment.message());
      
      mojo::internal::Serialize<mojo::StringDataView, send_validation>(
        in_selected_suggestion_id,
        selected_suggestion_id_fragment);

      fragment->selected_suggestion_id.Set(
          selected_suggestion_id_fragment.is_null() ? nullptr : selected_suggestion_id_fragment.data());

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

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

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

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

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

      decltype(Traits::response(input)) in_response = Traits::response(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->response)::BaseType> response_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::actor::webui::mojom::FormFillingResponseDataView, send_validation>(
        in_response,
        response_fragment);

      fragment->response.Set(
          response_fragment.is_null() ? nullptr : response_fragment.data());
  }
};

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

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

      decltype(Traits::response(input)) in_response = Traits::response(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->response)::BaseType> response_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::actor::webui::mojom::FormFillingResponseDataView, send_validation>(
        in_response,
        response_fragment);

      fragment->response.Set(
          response_fragment.is_null() ? nullptr : response_fragment.data());

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

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

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

      decltype(Traits::result(input)) in_result = Traits::result(input);
      mojo::internal::MessageFragment<decltype(fragment->result)>
          result_fragment(fragment.message());
      result_fragment.Claim(&fragment->result);
      
      mojo::internal::Serialize<::actor::webui::mojom::SelectAutofillSuggestionsDialogResultDataView, send_validation>(
        in_result,
        result_fragment,
        true);

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

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

      decltype(Traits::navigation_origin(input)) in_navigation_origin = Traits::navigation_origin(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->navigation_origin)::BaseType> navigation_origin_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::url::mojom::OriginDataView, send_validation>(
        in_navigation_origin,
        navigation_origin_fragment);

      fragment->navigation_origin.Set(
          navigation_origin_fragment.is_null() ? nullptr : navigation_origin_fragment.data());

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

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

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

      decltype(Traits::payload(input)) in_payload = Traits::payload(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->payload)::BaseType> payload_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::actor::webui::mojom::UserConfirmationDialogPayloadDataView, send_validation>(
        in_payload,
        payload_fragment);

      fragment->payload.Set(
          payload_fragment.is_null() ? nullptr : payload_fragment.data());

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

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

      decltype(Traits::result(input)) in_result = Traits::result(input);
      mojo::internal::MessageFragment<decltype(fragment->result)>
          result_fragment(fragment.message());
      result_fragment.Claim(&fragment->result);
      
      mojo::internal::Serialize<::actor::webui::mojom::ConfirmationRequestResultDataView, send_validation>(
        in_result,
        result_fragment,
        true);

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

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

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

      decltype(Traits::navigation_origin(input)) in_navigation_origin = Traits::navigation_origin(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->navigation_origin)::BaseType> navigation_origin_fragment(
              fragment.message());
      
      mojo::internal::Serialize<::url::mojom::OriginDataView, send_validation>(
        in_navigation_origin,
        navigation_origin_fragment);

      fragment->navigation_origin.Set(
          navigation_origin_fragment.is_null() ? nullptr : navigation_origin_fragment.data());

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

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

      decltype(Traits::result(input)) in_result = Traits::result(input);
      mojo::internal::MessageFragment<decltype(fragment->result)>
          result_fragment(fragment.message());
      result_fragment.Claim(&fragment->result);
      
      mojo::internal::Serialize<::actor::webui::mojom::ConfirmationRequestResultDataView, send_validation>(
        in_result,
        result_fragment,
        true);

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

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

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

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

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

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

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

      decltype(Traits::verification_code(input)) in_verification_code = Traits::verification_code(input);
      mojo::internal::MessageFragment<
          typename decltype(fragment->verification_code)::BaseType> verification_code_fragment(
              fragment.message());
      
      mojo::internal::Serialize<mojo::StringDataView, send_validation>(
        in_verification_code,
        verification_code_fragment);

      fragment->verification_code.Set(
          verification_code_fragment.is_null() ? nullptr : verification_code_fragment.data());

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

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

      fragment->permission_granted = Traits::permission_granted(input);
  }
};
template <typename MaybeConstUserType, SendValidation send_validation>
struct SendValidationSerializer<::actor::webui::mojom::SelectAutofillSuggestionsDialogResultDataView, MaybeConstUserType, send_validation> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = UnionTraits<::actor::webui::mojom::SelectAutofillSuggestionsDialogResultDataView, UserType>;
  static void Serialize(MaybeConstUserType& input,
                        MessageFragment<::actor::webui::mojom::internal::SelectAutofillSuggestionsDialogResult_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 ::actor::webui::mojom::SelectAutofillSuggestionsDialogResultDataView::Tag::kErrorReason: {
    decltype(Traits::error_reason(input))
    in_error_reason = Traits::error_reason(input);
        
mojo::internal::Serialize<::actor::webui::mojom::SelectAutofillSuggestionsDialogErrorReason, send_validation>(
  in_error_reason,
  &fragment->data.f_error_reason);
    break;
  }
  case ::actor::webui::mojom::SelectAutofillSuggestionsDialogResultDataView::Tag::kSelectedSuggestions: {
    decltype(Traits::selected_suggestions(input))
    in_selected_suggestions = Traits::selected_suggestions(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_selected_suggestions)::BaseType>
    value_fragment(fragment.message());
        constexpr const mojo::internal::ContainerValidateParams& selected_suggestions_validate_params =
            mojo::internal::GetArrayValidator<0, false, nullptr>();
        
mojo::internal::Serialize<mojo::ArrayDataView<::actor::webui::mojom::FormFillingResponseDataView>, send_validation>(
  in_selected_suggestions,
  value_fragment,
  &selected_suggestions_validate_params);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  send_validation,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null selected_suggestions in SelectAutofillSuggestionsDialogResult union");
    fragment->data.f_selected_suggestions.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
}
  }
};
template <typename MaybeConstUserType, SendValidation send_validation>
struct SendValidationSerializer<::actor::webui::mojom::UserConfirmationDialogResultDataView, MaybeConstUserType, send_validation> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = UnionTraits<::actor::webui::mojom::UserConfirmationDialogResultDataView, UserType>;
  static void Serialize(MaybeConstUserType& input,
                        MessageFragment<::actor::webui::mojom::internal::UserConfirmationDialogResult_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 ::actor::webui::mojom::UserConfirmationDialogResultDataView::Tag::kPermissionGranted: {
    decltype(Traits::permission_granted(input))
    in_permission_granted = Traits::permission_granted(input);
    fragment->data.f_permission_granted = in_permission_granted;
    break;
  }
  case ::actor::webui::mojom::UserConfirmationDialogResultDataView::Tag::kErrorReason: {
    decltype(Traits::error_reason(input))
    in_error_reason = Traits::error_reason(input);
        
mojo::internal::Serialize<::actor::webui::mojom::ConfirmationRequestErrorReason, send_validation>(
  in_error_reason,
  &fragment->data.f_error_reason);
    break;
  }
}
  }
};
template <typename MaybeConstUserType, SendValidation send_validation>
struct SendValidationSerializer<::actor::webui::mojom::ConfirmationRequestResultDataView, MaybeConstUserType, send_validation> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = UnionTraits<::actor::webui::mojom::ConfirmationRequestResultDataView, UserType>;
  static void Serialize(MaybeConstUserType& input,
                        MessageFragment<::actor::webui::mojom::internal::ConfirmationRequestResult_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 ::actor::webui::mojom::ConfirmationRequestResultDataView::Tag::kPermissionGranted: {
    decltype(Traits::permission_granted(input))
    in_permission_granted = Traits::permission_granted(input);
    fragment->data.f_permission_granted = in_permission_granted;
    break;
  }
  case ::actor::webui::mojom::ConfirmationRequestResultDataView::Tag::kErrorReason: {
    decltype(Traits::error_reason(input))
    in_error_reason = Traits::error_reason(input);
        
mojo::internal::Serialize<::actor::webui::mojom::ConfirmationRequestErrorReason, send_validation>(
  in_error_reason,
  &fragment->data.f_error_reason);
    break;
  }
}
  }
};
template <typename MaybeConstUserType, SendValidation send_validation>
struct SendValidationSerializer<::actor::webui::mojom::GmailOtpOptInResultDataView, MaybeConstUserType, send_validation> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = UnionTraits<::actor::webui::mojom::GmailOtpOptInResultDataView, UserType>;
  static void Serialize(MaybeConstUserType& input,
                        MessageFragment<::actor::webui::mojom::internal::GmailOtpOptInResult_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 ::actor::webui::mojom::GmailOtpOptInResultDataView::Tag::kResponse: {
    decltype(Traits::response(input))
    in_response = Traits::response(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_response)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::actor::webui::mojom::GmailOtpOptInResponseDataView, send_validation>(
  in_response,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  send_validation,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null response in GmailOtpOptInResult union");
    fragment->data.f_response.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::actor::webui::mojom::GmailOtpOptInResultDataView::Tag::kErrorReason: {
    decltype(Traits::error_reason(input))
    in_error_reason = Traits::error_reason(input);
        
mojo::internal::Serialize<::actor::webui::mojom::GmailOtpErrorReason, send_validation>(
  in_error_reason,
  &fragment->data.f_error_reason);
    break;
  }
}
  }
};
template <typename MaybeConstUserType, SendValidation send_validation>
struct SendValidationSerializer<::actor::webui::mojom::GmailOtpConfirmationResultDataView, MaybeConstUserType, send_validation> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = UnionTraits<::actor::webui::mojom::GmailOtpConfirmationResultDataView, UserType>;
  static void Serialize(MaybeConstUserType& input,
                        MessageFragment<::actor::webui::mojom::internal::GmailOtpConfirmationResult_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 ::actor::webui::mojom::GmailOtpConfirmationResultDataView::Tag::kResponse: {
    decltype(Traits::response(input))
    in_response = Traits::response(input);
    mojo::internal::MessageFragment<
      typename decltype(fragment->data.f_response)::BaseType>
    value_fragment(fragment.message());
        
mojo::internal::Serialize<::actor::webui::mojom::GmailOtpConfirmationResponseDataView, send_validation>(
  in_response,
  value_fragment);
  
MOJO_INTERNAL_CHECK_SERIALIZATION(
  send_validation,
  !(value_fragment.is_null()),
  mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
  "null response in GmailOtpConfirmationResult union");
    fragment->data.f_response.Set(
      value_fragment.is_null() ? nullptr : value_fragment.data());
    break;
  }
  case ::actor::webui::mojom::GmailOtpConfirmationResultDataView::Tag::kErrorReason: {
    decltype(Traits::error_reason(input))
    in_error_reason = Traits::error_reason(input);
        
mojo::internal::Serialize<::actor::webui::mojom::GmailOtpErrorReason, send_validation>(
  in_error_reason,
  &fragment->data.f_error_reason);
    break;
  }
}
  }
};

}  // namespace mojo::internal

#endif  // CHROME_COMMON_ACTOR_WEBUI_MOJOM_SEND_VALIDATION_H_