// chrome/common/actor_webui.mojom-shared.cc 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.

#include "chrome/common/actor_webui.mojom-shared.h"
#include <ostream>
#include <utility>
#include "base/strings/stringprintf.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/lib/validation_util.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"

#include "chrome/common/actor_webui.mojom-params-data.h"
namespace actor {
namespace webui {
namespace mojom {

NOINLINE static const char* TaskDurationToStringHelper(TaskDuration value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case TaskDuration::kDefault:
      return "kDefault";
    case TaskDuration::kTransient:
      return "kTransient";
    default:
      return nullptr;
  }
}

std::string TaskDurationToString(TaskDuration value) {
  const char *str = TaskDurationToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown TaskDuration value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, TaskDuration value) {
  return os << TaskDurationToString(value);
}

NOINLINE static const char* UserGrantedPermissionDurationToStringHelper(UserGrantedPermissionDuration value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case UserGrantedPermissionDuration::kOneTime:
      return "kOneTime";
    case UserGrantedPermissionDuration::kAlwaysAllow:
      return "kAlwaysAllow";
    default:
      return nullptr;
  }
}

std::string UserGrantedPermissionDurationToString(UserGrantedPermissionDuration value) {
  const char *str = UserGrantedPermissionDurationToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown UserGrantedPermissionDuration value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, UserGrantedPermissionDuration value) {
  return os << UserGrantedPermissionDurationToString(value);
}

NOINLINE static const char* CredentialTypeToStringHelper(CredentialType value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case CredentialType::kPassword:
      return "kPassword";
    case CredentialType::kFederated:
      return "kFederated";
    default:
      return nullptr;
  }
}

std::string CredentialTypeToString(CredentialType value) {
  const char *str = CredentialTypeToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown CredentialType value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, CredentialType value) {
  return os << CredentialTypeToString(value);
}

NOINLINE static const char* SelectCredentialDialogErrorReasonToStringHelper(SelectCredentialDialogErrorReason value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case SelectCredentialDialogErrorReason::kDialogPromiseNoSubscriber:
      return "kDialogPromiseNoSubscriber";
    default:
      return nullptr;
  }
}

std::string SelectCredentialDialogErrorReasonToString(SelectCredentialDialogErrorReason value) {
  const char *str = SelectCredentialDialogErrorReasonToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown SelectCredentialDialogErrorReason value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, SelectCredentialDialogErrorReason value) {
  return os << SelectCredentialDialogErrorReasonToString(value);
}

NOINLINE static const char* SelectAutofillSuggestionsDialogErrorReasonToStringHelper(SelectAutofillSuggestionsDialogErrorReason value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case SelectAutofillSuggestionsDialogErrorReason::kDialogPromiseNoSubscriber:
      return "kDialogPromiseNoSubscriber";
    case SelectAutofillSuggestionsDialogErrorReason::kMismatchedTaskId:
      return "kMismatchedTaskId";
    case SelectAutofillSuggestionsDialogErrorReason::kNoActorTaskDelegate:
      return "kNoActorTaskDelegate";
    default:
      return nullptr;
  }
}

std::string SelectAutofillSuggestionsDialogErrorReasonToString(SelectAutofillSuggestionsDialogErrorReason value) {
  const char *str = SelectAutofillSuggestionsDialogErrorReasonToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown SelectAutofillSuggestionsDialogErrorReason value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, SelectAutofillSuggestionsDialogErrorReason value) {
  return os << SelectAutofillSuggestionsDialogErrorReasonToString(value);
}

NOINLINE static const char* ConfirmationRequestErrorReasonToStringHelper(ConfirmationRequestErrorReason value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case ConfirmationRequestErrorReason::kRequestPromiseNoSubscriber:
      return "kRequestPromiseNoSubscriber";
    case ConfirmationRequestErrorReason::kPreemptedByNewRequest:
      return "kPreemptedByNewRequest";
    default:
      return nullptr;
  }
}

std::string ConfirmationRequestErrorReasonToString(ConfirmationRequestErrorReason value) {
  const char *str = ConfirmationRequestErrorReasonToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown ConfirmationRequestErrorReason value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, ConfirmationRequestErrorReason value) {
  return os << ConfirmationRequestErrorReasonToString(value);
}

NOINLINE static const char* GmailOtpErrorReasonToStringHelper(GmailOtpErrorReason value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case GmailOtpErrorReason::kRequestPromiseNoSubscriber:
      return "kRequestPromiseNoSubscriber";
    default:
      return nullptr;
  }
}

std::string GmailOtpErrorReasonToString(GmailOtpErrorReason value) {
  const char *str = GmailOtpErrorReasonToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown GmailOtpErrorReason value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, GmailOtpErrorReason value) {
  return os << GmailOtpErrorReasonToString(value);
}

namespace internal {
// static
bool SelectAutofillSuggestionsDialogResult_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context,
    bool inlined) {
  if (!data) {
    DCHECK(!inlined);
    return true;
  }

  // If it is inlined, the alignment is already enforced by its enclosing
  // object. We don't have to validate that.
  DCHECK(!inlined || mojo::internal::IsAligned(data));

  if (!inlined &&
      !mojo::internal::ValidateNonInlinedUnionHeaderAndClaimMemory(
          data, validation_context)) {
    return false;
  }

  const SelectAutofillSuggestionsDialogResult_Data* object = static_cast<const SelectAutofillSuggestionsDialogResult_Data*>(data);

  if (inlined && object->is_null())
    return true;

  switch (object->tag) {

    case SelectAutofillSuggestionsDialogResult_Tag::kErrorReason: {


      if (!::actor::webui::mojom::internal::SelectAutofillSuggestionsDialogErrorReason_Data
            ::Validate(object->data.f_error_reason, validation_context))
        return false;
      return true;
    }
    case SelectAutofillSuggestionsDialogResult_Tag::kSelectedSuggestions: {

      if (!mojo::internal::ValidatePointerNonNullable(
              object->data.f_selected_suggestions, 2, validation_context)) {
        return false;
      }
      constexpr const mojo::internal::ContainerValidateParams& selected_suggestions_validate_params =
          mojo::internal::GetArrayValidator<0, false, nullptr>();
      if (!mojo::internal::ValidateContainer(object->data.f_selected_suggestions, validation_context,
                                             &selected_suggestions_validate_params)) {
        return false;
      }
      return true;
    }
    default: {

      ReportValidationError(
          validation_context,
          mojo::internal::VALIDATION_ERROR_UNKNOWN_UNION_TAG,
          "unknown tag in SelectAutofillSuggestionsDialogResult");
      return false;
    }
  }
}
// static
bool UserConfirmationDialogResult_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context,
    bool inlined) {
  if (!data) {
    DCHECK(!inlined);
    return true;
  }

  // If it is inlined, the alignment is already enforced by its enclosing
  // object. We don't have to validate that.
  DCHECK(!inlined || mojo::internal::IsAligned(data));

  if (!inlined &&
      !mojo::internal::ValidateNonInlinedUnionHeaderAndClaimMemory(
          data, validation_context)) {
    return false;
  }

  const UserConfirmationDialogResult_Data* object = static_cast<const UserConfirmationDialogResult_Data*>(data);

  if (inlined && object->is_null())
    return true;

  switch (object->tag) {

    case UserConfirmationDialogResult_Tag::kPermissionGranted: {

      return true;
    }
    case UserConfirmationDialogResult_Tag::kErrorReason: {


      if (!::actor::webui::mojom::internal::ConfirmationRequestErrorReason_Data
            ::Validate(object->data.f_error_reason, validation_context))
        return false;
      return true;
    }
    default: {

      ReportValidationError(
          validation_context,
          mojo::internal::VALIDATION_ERROR_UNKNOWN_UNION_TAG,
          "unknown tag in UserConfirmationDialogResult");
      return false;
    }
  }
}
// static
bool ConfirmationRequestResult_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context,
    bool inlined) {
  if (!data) {
    DCHECK(!inlined);
    return true;
  }

  // If it is inlined, the alignment is already enforced by its enclosing
  // object. We don't have to validate that.
  DCHECK(!inlined || mojo::internal::IsAligned(data));

  if (!inlined &&
      !mojo::internal::ValidateNonInlinedUnionHeaderAndClaimMemory(
          data, validation_context)) {
    return false;
  }

  const ConfirmationRequestResult_Data* object = static_cast<const ConfirmationRequestResult_Data*>(data);

  if (inlined && object->is_null())
    return true;

  switch (object->tag) {

    case ConfirmationRequestResult_Tag::kPermissionGranted: {

      return true;
    }
    case ConfirmationRequestResult_Tag::kErrorReason: {


      if (!::actor::webui::mojom::internal::ConfirmationRequestErrorReason_Data
            ::Validate(object->data.f_error_reason, validation_context))
        return false;
      return true;
    }
    default: {

      ReportValidationError(
          validation_context,
          mojo::internal::VALIDATION_ERROR_UNKNOWN_UNION_TAG,
          "unknown tag in ConfirmationRequestResult");
      return false;
    }
  }
}
// static
bool GmailOtpOptInResult_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context,
    bool inlined) {
  if (!data) {
    DCHECK(!inlined);
    return true;
  }

  // If it is inlined, the alignment is already enforced by its enclosing
  // object. We don't have to validate that.
  DCHECK(!inlined || mojo::internal::IsAligned(data));

  if (!inlined &&
      !mojo::internal::ValidateNonInlinedUnionHeaderAndClaimMemory(
          data, validation_context)) {
    return false;
  }

  const GmailOtpOptInResult_Data* object = static_cast<const GmailOtpOptInResult_Data*>(data);

  if (inlined && object->is_null())
    return true;

  switch (object->tag) {

    case GmailOtpOptInResult_Tag::kResponse: {

      if (!mojo::internal::ValidatePointerNonNullable(
              object->data.f_response, 1, validation_context)) {
        return false;
      }
      if (!mojo::internal::ValidateStruct(object->data.f_response, validation_context))
        return false;
      return true;
    }
    case GmailOtpOptInResult_Tag::kErrorReason: {


      if (!::actor::webui::mojom::internal::GmailOtpErrorReason_Data
            ::Validate(object->data.f_error_reason, validation_context))
        return false;
      return true;
    }
    default: {

      ReportValidationError(
          validation_context,
          mojo::internal::VALIDATION_ERROR_UNKNOWN_UNION_TAG,
          "unknown tag in GmailOtpOptInResult");
      return false;
    }
  }
}
// static
bool GmailOtpConfirmationResult_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context,
    bool inlined) {
  if (!data) {
    DCHECK(!inlined);
    return true;
  }

  // If it is inlined, the alignment is already enforced by its enclosing
  // object. We don't have to validate that.
  DCHECK(!inlined || mojo::internal::IsAligned(data));

  if (!inlined &&
      !mojo::internal::ValidateNonInlinedUnionHeaderAndClaimMemory(
          data, validation_context)) {
    return false;
  }

  const GmailOtpConfirmationResult_Data* object = static_cast<const GmailOtpConfirmationResult_Data*>(data);

  if (inlined && object->is_null())
    return true;

  switch (object->tag) {

    case GmailOtpConfirmationResult_Tag::kResponse: {

      if (!mojo::internal::ValidatePointerNonNullable(
              object->data.f_response, 1, validation_context)) {
        return false;
      }
      if (!mojo::internal::ValidateStruct(object->data.f_response, validation_context))
        return false;
      return true;
    }
    case GmailOtpConfirmationResult_Tag::kErrorReason: {


      if (!::actor::webui::mojom::internal::GmailOtpErrorReason_Data
            ::Validate(object->data.f_error_reason, validation_context))
        return false;
      return true;
    }
    default: {

      ReportValidationError(
          validation_context,
          mojo::internal::VALIDATION_ERROR_UNKNOWN_UNION_TAG,
          "unknown tag in GmailOtpConfirmationResult");
      return false;
    }
  }
}


// static
bool TaskOptions_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const TaskOptions_Data* object =
      static_cast<const TaskOptions_Data*>(data);

  constexpr const mojo::internal::ContainerValidateParams& title_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->title, validation_context,
                                         &title_validate_params)) {
    return false;
  }


  if (!::actor::webui::mojom::internal::TaskDuration_Data
        ::Validate(object->duration_$value, validation_context))
    return false;


  if (!::glic::mojom::internal::FeatureMode_Data
        ::Validate(object->feature_mode_$value, validation_context))
    return false;

  return true;
}

TaskOptions_Data::TaskOptions_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool Credential_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 56, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const Credential_Data* object =
      static_cast<const Credential_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->username, 2, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& username_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->username, validation_context,
                                         &username_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->source_site_or_app, 3, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& source_site_or_app_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->source_site_or_app, validation_context,
                                         &source_site_or_app_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->request_origin, 4, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->request_origin, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->display_origin, 5, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& display_origin_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->display_origin, validation_context,
                                         &display_origin_validate_params)) {
    return false;
  }


  if (!::actor::webui::mojom::internal::CredentialType_Data
        ::Validate(object->type, validation_context))
    return false;

  if (!mojo::internal::ValidateStruct(object->account_picture, validation_context))
    return false;

  return true;
}

Credential_Data::Credential_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool SelectCredentialDialogRequest_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const SelectCredentialDialogRequest_Data* object =
      static_cast<const SelectCredentialDialogRequest_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->credentials, 3, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& credentials_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->credentials, validation_context,
                                         &credentials_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->icons, 4, validation_context)) {
    return false;
  }
  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>()>();
  if (!mojo::internal::ValidateContainer(object->icons, validation_context,
                                         &icons_validate_params)) {
    return false;
  }

  return true;
}

SelectCredentialDialogRequest_Data::SelectCredentialDialogRequest_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool SelectCredentialDialogResponse_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const SelectCredentialDialogResponse_Data* object =
      static_cast<const SelectCredentialDialogResponse_Data*>(data);


  if (!::actor::webui::mojom::internal::SelectCredentialDialogErrorReason_Data
        ::Validate(object->error_reason_$value, validation_context))
    return false;


  if (!::actor::webui::mojom::internal::UserGrantedPermissionDuration_Data
        ::Validate(object->permission_duration_$value, validation_context))
    return false;

  return true;
}

SelectCredentialDialogResponse_Data::SelectCredentialDialogResponse_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool AutofillSuggestion_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 40, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const AutofillSuggestion_Data* object =
      static_cast<const AutofillSuggestion_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->id, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& id_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->id, validation_context,
                                         &id_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->title, 2, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& title_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->title, validation_context,
                                         &title_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->details, 3, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& details_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->details, validation_context,
                                         &details_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidateStruct(object->icon, validation_context))
    return false;

  return true;
}

AutofillSuggestion_Data::AutofillSuggestion_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool FormFillingRequest_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 40, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const FormFillingRequest_Data* object =
      static_cast<const FormFillingRequest_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->formatted_request_origin, 2, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& formatted_request_origin_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->formatted_request_origin, validation_context,
                                         &formatted_request_origin_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->section_label, 3, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& section_label_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->section_label, validation_context,
                                         &section_label_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->suggestions, 4, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& suggestions_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->suggestions, validation_context,
                                         &suggestions_validate_params)) {
    return false;
  }

  return true;
}

FormFillingRequest_Data::FormFillingRequest_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool SelectAutofillSuggestionsDialogRequest_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const SelectAutofillSuggestionsDialogRequest_Data* object =
      static_cast<const SelectAutofillSuggestionsDialogRequest_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->form_filling_requests, 2, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& form_filling_requests_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->form_filling_requests, validation_context,
                                         &form_filling_requests_validate_params)) {
    return false;
  }

  return true;
}

SelectAutofillSuggestionsDialogRequest_Data::SelectAutofillSuggestionsDialogRequest_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool FormFillingResponse_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const FormFillingResponse_Data* object =
      static_cast<const FormFillingResponse_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->selected_suggestion_id, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& selected_suggestion_id_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->selected_suggestion_id, validation_context,
                                         &selected_suggestion_id_validate_params)) {
    return false;
  }

  return true;
}

FormFillingResponse_Data::FormFillingResponse_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool AutofillSuggestionDialogOnFormPresentedParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const AutofillSuggestionDialogOnFormPresentedParams_Data* object =
      static_cast<const AutofillSuggestionDialogOnFormPresentedParams_Data*>(data);

  return true;
}

AutofillSuggestionDialogOnFormPresentedParams_Data::AutofillSuggestionDialogOnFormPresentedParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool AutofillSuggestionDialogOnFormPreviewChangedParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const AutofillSuggestionDialogOnFormPreviewChangedParams_Data* object =
      static_cast<const AutofillSuggestionDialogOnFormPreviewChangedParams_Data*>(data);

  if (!mojo::internal::ValidateStruct(object->response, validation_context))
    return false;

  return true;
}

AutofillSuggestionDialogOnFormPreviewChangedParams_Data::AutofillSuggestionDialogOnFormPreviewChangedParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool AutofillSuggestionDialogOnFormConfirmedParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const AutofillSuggestionDialogOnFormConfirmedParams_Data* object =
      static_cast<const AutofillSuggestionDialogOnFormConfirmedParams_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->response, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->response, validation_context))
    return false;

  return true;
}

AutofillSuggestionDialogOnFormConfirmedParams_Data::AutofillSuggestionDialogOnFormConfirmedParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool SelectAutofillSuggestionsDialogResponse_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const SelectAutofillSuggestionsDialogResponse_Data* object =
      static_cast<const SelectAutofillSuggestionsDialogResponse_Data*>(data);

  if (!mojo::internal::ValidateInlinedUnionNonNullable(
          object->result, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateInlinedUnion(object->result, validation_context))
    return false;

  return true;
}

SelectAutofillSuggestionsDialogResponse_Data::SelectAutofillSuggestionsDialogResponse_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool UserConfirmationDialogPayload_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const UserConfirmationDialogPayload_Data* object =
      static_cast<const UserConfirmationDialogPayload_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->navigation_origin, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->navigation_origin, validation_context))
    return false;

  return true;
}

UserConfirmationDialogPayload_Data::UserConfirmationDialogPayload_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool UserConfirmationDialogRequest_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const UserConfirmationDialogRequest_Data* object =
      static_cast<const UserConfirmationDialogRequest_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->payload, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->payload, validation_context))
    return false;

  return true;
}

UserConfirmationDialogRequest_Data::UserConfirmationDialogRequest_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool UserConfirmationDialogResponse_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const UserConfirmationDialogResponse_Data* object =
      static_cast<const UserConfirmationDialogResponse_Data*>(data);

  if (!mojo::internal::ValidateInlinedUnionNonNullable(
          object->result, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateInlinedUnion(object->result, validation_context))
    return false;

  return true;
}

UserConfirmationDialogResponse_Data::UserConfirmationDialogResponse_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool NavigationConfirmationRequest_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const NavigationConfirmationRequest_Data* object =
      static_cast<const NavigationConfirmationRequest_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->navigation_origin, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->navigation_origin, validation_context))
    return false;

  return true;
}

NavigationConfirmationRequest_Data::NavigationConfirmationRequest_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool NavigationConfirmationResponse_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const NavigationConfirmationResponse_Data* object =
      static_cast<const NavigationConfirmationResponse_Data*>(data);

  if (!mojo::internal::ValidateInlinedUnionNonNullable(
          object->result, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateInlinedUnion(object->result, validation_context))
    return false;

  return true;
}

NavigationConfirmationResponse_Data::NavigationConfirmationResponse_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool GmailOtpOptInRequest_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const GmailOtpOptInRequest_Data* object =
      static_cast<const GmailOtpOptInRequest_Data*>(data);

  return true;
}

GmailOtpOptInRequest_Data::GmailOtpOptInRequest_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool GmailOtpOptInResponse_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const GmailOtpOptInResponse_Data* object =
      static_cast<const GmailOtpOptInResponse_Data*>(data);

  return true;
}

GmailOtpOptInResponse_Data::GmailOtpOptInResponse_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool GmailOtpConfirmationRequest_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const GmailOtpConfirmationRequest_Data* object =
      static_cast<const GmailOtpConfirmationRequest_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->verification_code, 2, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& verification_code_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->verification_code, validation_context,
                                         &verification_code_validate_params)) {
    return false;
  }

  return true;
}

GmailOtpConfirmationRequest_Data::GmailOtpConfirmationRequest_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool GmailOtpConfirmationResponse_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const GmailOtpConfirmationResponse_Data* object =
      static_cast<const GmailOtpConfirmationResponse_Data*>(data);

  return true;
}

GmailOtpConfirmationResponse_Data::GmailOtpConfirmationResponse_Data()
    : header_({sizeof(*this), 0}) {}

}  // namespace internal
}  // namespace mojom
}  // namespace webui
}  // namespace actor

namespace perfetto {

// static
void TraceFormatTraits<::actor::webui::mojom::TaskDuration>::WriteIntoTrace(
   perfetto::TracedValue context, ::actor::webui::mojom::TaskDuration value) {
  return std::move(context).WriteString(::actor::webui::mojom::TaskDurationToString(value));
}

} // namespace perfetto

namespace perfetto {

// static
void TraceFormatTraits<::actor::webui::mojom::UserGrantedPermissionDuration>::WriteIntoTrace(
   perfetto::TracedValue context, ::actor::webui::mojom::UserGrantedPermissionDuration value) {
  return std::move(context).WriteString(::actor::webui::mojom::UserGrantedPermissionDurationToString(value));
}

} // namespace perfetto

namespace perfetto {

// static
void TraceFormatTraits<::actor::webui::mojom::CredentialType>::WriteIntoTrace(
   perfetto::TracedValue context, ::actor::webui::mojom::CredentialType value) {
  return std::move(context).WriteString(::actor::webui::mojom::CredentialTypeToString(value));
}

} // namespace perfetto

namespace perfetto {

// static
void TraceFormatTraits<::actor::webui::mojom::SelectCredentialDialogErrorReason>::WriteIntoTrace(
   perfetto::TracedValue context, ::actor::webui::mojom::SelectCredentialDialogErrorReason value) {
  return std::move(context).WriteString(::actor::webui::mojom::SelectCredentialDialogErrorReasonToString(value));
}

} // namespace perfetto

namespace perfetto {

// static
void TraceFormatTraits<::actor::webui::mojom::SelectAutofillSuggestionsDialogErrorReason>::WriteIntoTrace(
   perfetto::TracedValue context, ::actor::webui::mojom::SelectAutofillSuggestionsDialogErrorReason value) {
  return std::move(context).WriteString(::actor::webui::mojom::SelectAutofillSuggestionsDialogErrorReasonToString(value));
}

} // namespace perfetto

namespace perfetto {

// static
void TraceFormatTraits<::actor::webui::mojom::ConfirmationRequestErrorReason>::WriteIntoTrace(
   perfetto::TracedValue context, ::actor::webui::mojom::ConfirmationRequestErrorReason value) {
  return std::move(context).WriteString(::actor::webui::mojom::ConfirmationRequestErrorReasonToString(value));
}

} // namespace perfetto

namespace perfetto {

// static
void TraceFormatTraits<::actor::webui::mojom::GmailOtpErrorReason>::WriteIntoTrace(
   perfetto::TracedValue context, ::actor::webui::mojom::GmailOtpErrorReason value) {
  return std::move(context).WriteString(::actor::webui::mojom::GmailOtpErrorReasonToString(value));
}

} // namespace perfetto