// media/mojo/mojom/speech_recognition_error.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 MEDIA_MOJO_MOJOM_SPEECH_RECOGNITION_ERROR_MOJOM_SEND_VALIDATION_H_
#define MEDIA_MOJO_MOJOM_SPEECH_RECOGNITION_ERROR_MOJOM_SEND_VALIDATION_H_

#include "media/mojo/mojom/speech_recognition_error.mojom-shared-internal.h"
#include "media/mojo/mojom/speech_recognition_error_code.mojom-shared.h"

#include "media/mojo/mojom/speech_recognition_error.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<::media::mojom::SpeechAudioErrorDetails, MaybeConstUserType>
    : std::false_type {};

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

      
      mojo::internal::Serialize<::media::mojom::SpeechRecognitionErrorCode>(
        Traits::code(input),
        &fragment->code);

      
      mojo::internal::Serialize<::media::mojom::SpeechAudioErrorDetails>(
        Traits::details(input),
        &fragment->details);
  }
};

}  // namespace mojo::internal

#endif  // MEDIA_MOJO_MOJOM_SPEECH_RECOGNITION_ERROR_MOJOM_SEND_VALIDATION_H_