// chrome/browser/glic/host/glic_internals.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 CHROME_BROWSER_GLIC_HOST_GLIC_INTERNALS_MOJOM_SHARED_H_
#define CHROME_BROWSER_GLIC_HOST_GLIC_INTERNALS_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 "chrome/browser/glic/host/glic_internals.mojom-shared-internal.h"
#include "chrome/browser/glic/host/glic.mojom-shared.h"
#include "chrome/common/glic_enums.mojom-shared.h"
#include "mojo/public/mojom/base/time.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 "chrome/browser/glic/host/glic_internals.mojom-data-view.h"  // IWYU pragma: export




namespace std {

template <>
struct hash<::glic::mojom::FreCompletionWaitMode>
    : public mojo::internal::EnumHashImpl<::glic::mojom::FreCompletionWaitMode> {};

}  // namespace std

namespace mojo {


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::glic::mojom::FreCompletionWaitMode, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = EnumTraits<::glic::mojom::FreCompletionWaitMode, 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<::glic::mojom::FreCompletionWaitMode>(input));
    if constexpr (requires {
                    {
                      Traits::FromMojom(known_value)
                    } -> std::same_as<UserType>;
                  }) {
      static_assert(std::same_as<::glic::mojom::FreCompletionWaitMode, UserType> ||
                        HasInfallibleConversion(::glic::mojom::FreCompletionWaitMode()),
                    "::glic::mojom::FreCompletionWaitMode 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<::glic::mojom::TieredRolloutInfoDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::glic::mojom::TieredRolloutInfoDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::glic::mojom::internal::TieredRolloutInfo_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();
    fragment->ai_subscription_tier_$flag = Traits::ai_subscription_tier(input).has_value();
    if (Traits::ai_subscription_tier(input).has_value()) {
      fragment->ai_subscription_tier_$value = Traits::ai_subscription_tier(input).value();
    }

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

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

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

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

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

    fragment->tiered_rollout_v2_eligible_tiers.Set(
        tiered_rollout_v2_eligible_tiers_fragment.is_null() ? nullptr : tiered_rollout_v2_eligible_tiers_fragment.data());

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

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

    fragment->preference_sync_status.Set(
        preference_sync_status_fragment.is_null() ? nullptr : preference_sync_status_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    decltype(Traits::enablement(input)) in_enablement = Traits::enablement(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->enablement)::BaseType> enablement_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::glic::mojom::ProfileEnablementDataView>(
      in_enablement,
      enablement_fragment);

    fragment->enablement.Set(
        enablement_fragment.is_null() ? nullptr : enablement_fragment.data());

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

    decltype(Traits::config(input)) in_config = Traits::config(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->config)::BaseType> config_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::glic::mojom::ConfigInfoDataView>(
      in_config,
      config_fragment);

    fragment->config.Set(
        config_fragment.is_null() ? nullptr : config_fragment.data());

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

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

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

    decltype(Traits::debug_info(input)) in_debug_info = Traits::debug_info(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->debug_info)::BaseType> debug_info_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::glic::mojom::InternalsDebugInfoDataView>(
      in_debug_info,
      debug_info_fragment);

    fragment->debug_info.Set(
        debug_info_fragment.is_null() ? nullptr : debug_info_fragment.data());

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

    decltype(Traits::tiered_rollout_info(input)) in_tiered_rollout_info = Traits::tiered_rollout_info(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->tiered_rollout_info)::BaseType> tiered_rollout_info_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::glic::mojom::TieredRolloutInfoDataView>(
      in_tiered_rollout_info,
      tiered_rollout_info_fragment);

    fragment->tiered_rollout_info.Set(
        tiered_rollout_info_fragment.is_null() ? nullptr : tiered_rollout_info_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

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

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

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

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

    
    mojo::internal::Serialize<::glic::mojom::Platform>(
      Traits::platform(input),
      &fragment->platform);

    
    mojo::internal::Serialize<::glic::mojom::FormFactor>(
      Traits::form_factor(input),
      &fragment->form_factor);

    decltype(Traits::boolean_settings(input)) in_boolean_settings = Traits::boolean_settings(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->boolean_settings)::BaseType>
        boolean_settings_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& boolean_settings_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, bool>>(
      in_boolean_settings,
      boolean_settings_fragment,
      &boolean_settings_validate_params);

    fragment->boolean_settings.Set(
        boolean_settings_fragment.is_null() ? nullptr : boolean_settings_fragment.data());

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

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

    fragment->hotkey.Set(
        hotkey_fragment.is_null() ? nullptr : hotkey_fragment.data());

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

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

    fragment->locale.Set(
        locale_fragment.is_null() ? nullptr : locale_fragment.data());

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

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

    fragment->permanent_country_code.Set(
        permanent_country_code_fragment.is_null() ? nullptr : permanent_country_code_fragment.data());

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

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

    fragment->session_country_code.Set(
        session_country_code_fragment.is_null() ? nullptr : session_country_code_fragment.data());

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

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

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

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

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

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

    fragment->dogfood_status.Set(
        dogfood_status_fragment.is_null() ? nullptr : dogfood_status_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

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

    fragment->public_key.Set(
        public_key_fragment.is_null() ? nullptr : public_key_fragment.data());

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

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

    fragment->auth_secret.Set(
        auth_secret_fragment.is_null() ? nullptr : auth_secret_fragment.data());

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

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

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

}  // namespace internal


namespace internal {

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

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

    
    mojo::internal::Serialize<::glic::mojom::InvocationSource>(
      Traits::invocation_source(input),
      &fragment->invocation_source);

    decltype(Traits::prompts(input)) in_prompts = Traits::prompts(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->prompts)::BaseType>
        prompts_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& prompts_validate_params =
        mojo::internal::GetArrayValidator<0, false, &mojo::internal::GetArrayValidator<0, false, nullptr>()>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<mojo::StringDataView>>(
      in_prompts,
      prompts_fragment,
      &prompts_validate_params);

    fragment->prompts.Set(
        prompts_fragment.is_null() ? nullptr : prompts_fragment.data());

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

    decltype(Traits::additional_context(input)) in_additional_context = Traits::additional_context(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->additional_context)::BaseType> additional_context_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::glic::mojom::AdditionalContextDataView>(
      in_additional_context,
      additional_context_fragment);

    fragment->additional_context.Set(
        additional_context_fragment.is_null() ? nullptr : additional_context_fragment.data());

    decltype(Traits::conversation(input)) in_conversation = Traits::conversation(input);
    mojo::internal::MessageFragment<decltype(fragment->conversation)>
        conversation_fragment(fragment.message());
    conversation_fragment.Claim(&fragment->conversation);
    
    mojo::internal::Serialize<::glic::mojom::InvokeConversationSelectionDataView>(
      in_conversation,
      conversation_fragment,
      true);

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->conversation.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null conversation in TriggerInvokeFromInternalsOptions struct");
    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->disable_zss = Traits::disable_zss(input);

    decltype(Traits::zss_config(input)) in_zss_config = Traits::zss_config(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->zss_config)::BaseType> zss_config_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::glic::mojom::ZssConfigDataView>(
      in_zss_config,
      zss_config_fragment);

    fragment->zss_config.Set(
        zss_config_fragment.is_null() ? nullptr : zss_config_fragment.data());

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

    fragment->skill_id.Set(
        skill_id_fragment.is_null() ? nullptr : skill_id_fragment.data());

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

    fragment->error_message.Set(
        error_message_fragment.is_null() ? nullptr : error_message_fragment.data());

    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>(
      in_timeout,
      timeout_fragment);

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

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

    
    mojo::internal::Serialize<::glic::mojom::FreOverride>(
      Traits::fre_override(input),
      &fragment->fre_override);

    fragment->wait_for_panel_open = Traits::wait_for_panel_open(input);
    fragment->focus_on_show_$flag = Traits::focus_on_show(input).has_value();
    if (Traits::focus_on_show(input).has_value()) {
      fragment->focus_on_show_$value = Traits::focus_on_show(input).value();
    }

    
    mojo::internal::Serialize<::glic::mojom::FreCompletionWaitMode>(
      Traits::fre_completion_wait_mode(input),
      &fragment->fre_completion_wait_mode);
    fragment->show_panel_$flag = Traits::show_panel(input).has_value();
    if (Traits::show_panel(input).has_value()) {
      fragment->show_panel_$value = Traits::show_panel(input).value();
    }

    decltype(Traits::surface(input)) in_surface = Traits::surface(input);
    mojo::internal::MessageFragment<decltype(fragment->surface)>
        surface_fragment(fragment.message());
    surface_fragment.Claim(&fragment->surface);
    
    mojo::internal::Serialize<::glic::mojom::InvokeTargetSurfaceDataView>(
      in_surface,
      surface_fragment,
      true);

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->surface.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null surface in TriggerInvokeFromInternalsOptions struct");
    fragment->specific_tab_index_$flag = Traits::specific_tab_index(input).has_value();
    if (Traits::specific_tab_index(input).has_value()) {
      fragment->specific_tab_index_$value = Traits::specific_tab_index(input).value();
    }

    decltype(Traits::specific_tabs_to_share_indices(input)) in_specific_tabs_to_share_indices = Traits::specific_tabs_to_share_indices(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->specific_tabs_to_share_indices)::BaseType>
        specific_tabs_to_share_indices_fragment(fragment.message());
    constexpr const mojo::internal::ContainerValidateParams& specific_tabs_to_share_indices_validate_params =
        mojo::internal::GetArrayValidator<0, false, nullptr>();
    
    mojo::internal::Serialize<mojo::ArrayDataView<int32_t>>(
      in_specific_tabs_to_share_indices,
      specific_tabs_to_share_indices_fragment,
      &specific_tabs_to_share_indices_validate_params);

    fragment->specific_tabs_to_share_indices.Set(
        specific_tabs_to_share_indices_fragment.is_null() ? nullptr : specific_tabs_to_share_indices_fragment.data());

    
    mojo::internal::Serialize<::glic::mojom::ActuationTarget>(
      Traits::actuation_target(input),
      &fragment->actuation_target);

    decltype(Traits::payload(input)) in_payload = Traits::payload(input);
    mojo::internal::MessageFragment<decltype(fragment->payload)>
        payload_fragment(fragment.message());
    payload_fragment.Claim(&fragment->payload);
    
    mojo::internal::Serialize<::glic::mojom::InvocationPayloadDataView>(
      in_payload,
      payload_fragment,
      true);

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

    decltype(Traits::key_config(input)) in_key_config = Traits::key_config(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->key_config)::BaseType> key_config_fragment(
            fragment.message());
    
    mojo::internal::Serialize<::glic::mojom::ScreenshotTestKeyConfigurationDataView>(
      in_key_config,
      key_config_fragment);

    fragment->key_config.Set(
        key_config_fragment.is_null() ? nullptr : key_config_fragment.data());

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

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

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

}  // namespace internal

}  // namespace mojo


namespace glic::mojom {

inline void TieredRolloutInfoDataView::GetTieredRolloutV2EligibleTiersDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->tiered_rollout_v2_eligible_tiers.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void TieredRolloutInfoDataView::GetPreferenceSyncStatusDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->preference_sync_status.Get();
  *output = mojo::StringDataView(pointer, message_);
}


inline void InternalsDataPayloadDataView::GetEnablementDataView(
    ::glic::mojom::ProfileEnablementDataView* output) {
  auto pointer = data_->enablement.Get();
  *output = ::glic::mojom::ProfileEnablementDataView(pointer, message_);
}
inline void InternalsDataPayloadDataView::GetConfigDataView(
    ::glic::mojom::ConfigInfoDataView* output) {
  auto pointer = data_->config.Get();
  *output = ::glic::mojom::ConfigInfoDataView(pointer, message_);
}
inline void InternalsDataPayloadDataView::GetDebugInfoDataView(
    InternalsDebugInfoDataView* output) {
  auto pointer = data_->debug_info.Get();
  *output = InternalsDebugInfoDataView(pointer, message_);
}
inline void InternalsDataPayloadDataView::GetTieredRolloutInfoDataView(
    TieredRolloutInfoDataView* output) {
  auto pointer = data_->tiered_rollout_info.Get();
  *output = TieredRolloutInfoDataView(pointer, message_);
}


inline void InternalsDebugInfoDataView::GetBooleanSettingsDataView(
    mojo::MapDataView<mojo::StringDataView, bool>* output) {
  auto pointer = data_->boolean_settings.Get();
  *output = mojo::MapDataView<mojo::StringDataView, bool>(pointer, message_);
}
inline void InternalsDebugInfoDataView::GetHotkeyDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->hotkey.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void InternalsDebugInfoDataView::GetLocaleDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->locale.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void InternalsDebugInfoDataView::GetPermanentCountryCodeDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->permanent_country_code.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void InternalsDebugInfoDataView::GetSessionCountryCodeDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->session_country_code.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void InternalsDebugInfoDataView::GetDogfoodStatusDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->dogfood_status.Get();
  *output = mojo::StringDataView(pointer, message_);
}


inline void ScreenshotTestKeyConfigurationDataView::GetPublicKeyDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->public_key.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void ScreenshotTestKeyConfigurationDataView::GetAuthSecretDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->auth_secret.Get();
  *output = mojo::StringDataView(pointer, message_);
}


inline void TriggerInvokeFromInternalsOptionsDataView::GetPromptsDataView(
    mojo::ArrayDataView<mojo::StringDataView>* output) {
  auto pointer = data_->prompts.Get();
  *output = mojo::ArrayDataView<mojo::StringDataView>(pointer, message_);
}
inline void TriggerInvokeFromInternalsOptionsDataView::GetAdditionalContextDataView(
    ::glic::mojom::AdditionalContextDataView* output) {
  auto pointer = data_->additional_context.Get();
  *output = ::glic::mojom::AdditionalContextDataView(pointer, message_);
}
inline void TriggerInvokeFromInternalsOptionsDataView::GetConversationDataView(
    ::glic::mojom::InvokeConversationSelectionDataView* output) {
  auto pointer = &data_->conversation;
  *output = ::glic::mojom::InvokeConversationSelectionDataView(pointer, message_);
}
inline void TriggerInvokeFromInternalsOptionsDataView::GetZssConfigDataView(
    ::glic::mojom::ZssConfigDataView* output) {
  auto pointer = data_->zss_config.Get();
  *output = ::glic::mojom::ZssConfigDataView(pointer, message_);
}
inline void TriggerInvokeFromInternalsOptionsDataView::GetSkillIdDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->skill_id.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void TriggerInvokeFromInternalsOptionsDataView::GetErrorMessageDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->error_message.Get();
  *output = mojo::StringDataView(pointer, message_);
}
inline void TriggerInvokeFromInternalsOptionsDataView::GetTimeoutDataView(
    ::mojo_base::mojom::TimeDeltaDataView* output) {
  auto pointer = data_->timeout.Get();
  *output = ::mojo_base::mojom::TimeDeltaDataView(pointer, message_);
}
inline void TriggerInvokeFromInternalsOptionsDataView::GetSurfaceDataView(
    ::glic::mojom::InvokeTargetSurfaceDataView* output) {
  auto pointer = &data_->surface;
  *output = ::glic::mojom::InvokeTargetSurfaceDataView(pointer, message_);
}
inline void TriggerInvokeFromInternalsOptionsDataView::GetSpecificTabsToShareIndicesDataView(
    mojo::ArrayDataView<int32_t>* output) {
  auto pointer = data_->specific_tabs_to_share_indices.Get();
  *output = mojo::ArrayDataView<int32_t>(pointer, message_);
}
inline void TriggerInvokeFromInternalsOptionsDataView::GetPayloadDataView(
    ::glic::mojom::InvocationPayloadDataView* output) {
  auto pointer = &data_->payload;
  *output = ::glic::mojom::InvocationPayloadDataView(pointer, message_);
}
inline void TriggerInvokeFromInternalsOptionsDataView::GetKeyConfigDataView(
    ScreenshotTestKeyConfigurationDataView* output) {
  auto pointer = data_->key_config.Get();
  *output = ScreenshotTestKeyConfigurationDataView(pointer, message_);
}



}  // glic::mojom

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

namespace perfetto {

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

} // namespace perfetto

#endif  // CHROME_BROWSER_GLIC_HOST_GLIC_INTERNALS_MOJOM_SHARED_H_