// components/notebooks/internals/webui/notebooks_internals.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 COMPONENTS_NOTEBOOKS_INTERNALS_WEBUI_NOTEBOOKS_INTERNALS_MOJOM_SEND_VALIDATION_H_
#define COMPONENTS_NOTEBOOKS_INTERNALS_WEBUI_NOTEBOOKS_INTERNALS_MOJOM_SEND_VALIDATION_H_

#include "components/notebooks/internals/webui/notebooks_internals.mojom-shared-internal.h"
#include "url/mojom/url.mojom-shared.h"

#include "components/notebooks/internals/webui/notebooks_internals.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"

namespace mojo::internal {

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

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

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

      fragment->notebook_home_url.Set(
          notebook_home_url_fragment.is_null() ? nullptr : notebook_home_url_fragment.data());

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

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

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

}  // namespace mojo::internal

#endif  // COMPONENTS_NOTEBOOKS_INTERNALS_WEBUI_NOTEBOOKS_INTERNALS_MOJOM_SEND_VALIDATION_H_