// third_party/blink/public/mojom/webid/federated_request.mojom.h is auto generated by mojom_bindings_generator.py, do not edit

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_PUBLIC_MOJOM_WEBID_FEDERATED_REQUEST_MOJOM_H_
#define THIRD_PARTY_BLINK_PUBLIC_MOJOM_WEBID_FEDERATED_REQUEST_MOJOM_H_

#include <stdint.h>

#include <limits>
#include <optional>
#include <type_traits>
#include <utility>
#include "mojo/public/cpp/bindings/clone_traits.h"
#include "mojo/public/cpp/bindings/equals_traits.h"
#include "mojo/public/cpp/bindings/struct_ptr.h"
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "mojo/public/cpp/bindings/union_traits.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"

#include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h"

#include "third_party/blink/public/mojom/webid/federated_request.mojom-features.h"  // IWYU pragma: export
#include "third_party/blink/public/mojom/webid/federated_request.mojom-shared.h"  // IWYU pragma: export
#include "third_party/blink/public/mojom/webid/federated_request.mojom-forward.h"  // IWYU pragma: export
#include "mojo/public/mojom/base/time.mojom.h"
#include "mojo/public/mojom/base/values.mojom.h"
#include "third_party/blink/public/mojom/credentialmanagement/credential_manager.mojom.h"
#include "url/mojom/origin.mojom.h"
#include "url/mojom/url.mojom.h"
#include <string>
#include <vector>

#include "mojo/public/cpp/bindings/lib/control_message_handler.h"
#include "mojo/public/cpp/bindings/raw_ptr_impl_ref_traits.h"


#include "base/types/expected.h"
#include "third_party/blink/public/common/webid/federated_auth_request_mojom_traits.h"
#include "third_party/blink/public/common/common_export.h"




namespace blink::mojom {

class FederatedRequestProxy;

template <typename ImplRefTraits>
class FederatedRequestStub;

class FederatedRequestRequestValidator;


class BLINK_COMMON_EXPORT FederatedRequest
    : public FederatedRequestInterfaceBase {
 public:
  using IPCStableHashFunction = uint32_t(*)();
  static constexpr const char* Name_ = "blink.mojom.FederatedRequest";
  static IPCStableHashFunction MessageToMethodInfo_(mojo::Message& message);
  static const char* MessageToMethodName_(mojo::Message& message);
  static constexpr uint32_t Version_ = 0;
  static constexpr bool PassesAssociatedKinds_ = false;
  static constexpr bool HasUninterruptableMethods_ = false;

  using Base_ = FederatedRequestInterfaceBase;
  using Proxy_ = FederatedRequestProxy;

  template <typename ImplRefTraits>
  using Stub_ = FederatedRequestStub<ImplRefTraits>;

  using RequestValidator_ = FederatedRequestRequestValidator;
  using ResponseValidator_ = mojo::PassThroughFilter;
  enum MethodMinVersions : uint32_t {
    kAbortMinVersion = 0,
  };

// crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK
// with not having this data in traces there.
#if !BUILDFLAG(IS_FUCHSIA)
  struct Abort_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
#endif // !BUILDFLAG(IS_FUCHSIA)
  virtual ~FederatedRequest() = default;

  virtual void Abort() = 0;
};

class FederatedRequestServiceProxy;

template <typename ImplRefTraits>
class FederatedRequestServiceStub;

class FederatedRequestServiceRequestValidator;
class FederatedRequestServiceResponseValidator;


class BLINK_COMMON_EXPORT FederatedRequestService
    : public FederatedRequestServiceInterfaceBase {
 public:
  using IPCStableHashFunction = uint32_t(*)();
  static constexpr const char* Name_ = "blink.mojom.FederatedRequestService";
  static IPCStableHashFunction MessageToMethodInfo_(mojo::Message& message);
  static const char* MessageToMethodName_(mojo::Message& message);
  static constexpr uint32_t Version_ = 0;
  static constexpr bool PassesAssociatedKinds_ = false;
  static constexpr bool HasUninterruptableMethods_ = false;

  using Base_ = FederatedRequestServiceInterfaceBase;
  using Proxy_ = FederatedRequestServiceProxy;

  template <typename ImplRefTraits>
  using Stub_ = FederatedRequestServiceStub<ImplRefTraits>;

  using RequestValidator_ = FederatedRequestServiceRequestValidator;
  using ResponseValidator_ = FederatedRequestServiceResponseValidator;
  enum MethodMinVersions : uint32_t {
    kStartTokenRequestMinVersion = 0,
    kRegisterIdPMinVersion = 0,
    kUnregisterIdPMinVersion = 0,
    kCloseModalDialogViewMinVersion = 0,
    kPreventSilentAccessMinVersion = 0,
    kRequestUserInfoMinVersion = 0,
    kDisconnectMinVersion = 0,
    kResolveTokenRequestMinVersion = 0,
    kSetIdpSigninStatusMinVersion = 0,
  };

// crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK
// with not having this data in traces there.
#if !BUILDFLAG(IS_FUCHSIA)
  struct StartTokenRequest_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct RegisterIdP_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct UnregisterIdP_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct CloseModalDialogView_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct PreventSilentAccess_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct RequestUserInfo_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct Disconnect_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct ResolveTokenRequest_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct SetIdpSigninStatus_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
#endif // !BUILDFLAG(IS_FUCHSIA)
  virtual ~FederatedRequestService() = default;

  using StartTokenRequestCallback = base::OnceCallback<void(base::expected<
  TokenRequestSuccessPtr,
  TokenRequestFailurePtr>)>;
  using StartTokenRequestResult = base::expected<
  TokenRequestSuccessPtr,
  TokenRequestFailurePtr>;
  using StartTokenRequestMojoCallback = base::OnceCallback<void(FederatedRequestService_StartTokenRequest_ResponseParam_ResultPtr)>;

  virtual void StartTokenRequest(std::vector<IdentityProviderGetParametersPtr> idp_get_params, ::password_manager::CredentialMediationRequirement requirement, ::mojo::PendingReceiver<FederatedRequest> request_receiver, StartTokenRequestCallback callback) = 0;

  using RegisterIdPCallback = base::OnceCallback<void(RegisterIdpStatus)>;
  using RegisterIdPMojoCallback = base::OnceCallback<void(RegisterIdpStatus)>;

  virtual void RegisterIdP(const ::GURL& url, RegisterIdPCallback callback) = 0;

  using UnregisterIdPCallback = base::OnceCallback<void(bool)>;
  using UnregisterIdPMojoCallback = base::OnceCallback<void(bool)>;

  virtual void UnregisterIdP(const ::GURL& url, UnregisterIdPCallback callback) = 0;

  virtual void CloseModalDialogView() = 0;

  using PreventSilentAccessCallback = base::OnceCallback<void()>;
  using PreventSilentAccessMojoCallback = base::OnceCallback<void()>;

  virtual void PreventSilentAccess(PreventSilentAccessCallback callback) = 0;

  using RequestUserInfoCallback = base::OnceCallback<void(RequestUserInfoResultPtr)>;
  using RequestUserInfoMojoCallback = base::OnceCallback<void(RequestUserInfoResultPtr)>;

  virtual void RequestUserInfo(IdentityProviderConfigPtr provider, RequestUserInfoCallback callback) = 0;

  using DisconnectCallback = base::OnceCallback<void(DisconnectStatus)>;
  using DisconnectMojoCallback = base::OnceCallback<void(DisconnectStatus)>;

  virtual void Disconnect(IdentityCredentialDisconnectOptionsPtr options, DisconnectCallback callback) = 0;

  using ResolveTokenRequestCallback = base::OnceCallback<void(bool)>;
  using ResolveTokenRequestMojoCallback = base::OnceCallback<void(bool)>;

  virtual void ResolveTokenRequest(const std::optional<std::string>& account_id, ResolveTokenParamsPtr params, ResolveTokenRequestCallback callback) = 0;

  using SetIdpSigninStatusCallback = base::OnceCallback<void()>;
  using SetIdpSigninStatusMojoCallback = base::OnceCallback<void()>;

  virtual void SetIdpSigninStatus(const ::url::Origin& origin, IdpSigninStatus status, const std::optional<::blink::common::webid::LoginStatusOptions>& options, SetIdpSigninStatusCallback callback) = 0;
};



class BLINK_COMMON_EXPORT FederatedRequestProxy
    : public FederatedRequest {
 public:
  using InterfaceType = FederatedRequest;

  explicit FederatedRequestProxy(mojo::MessageReceiverWithResponder* receiver);
  
  void Abort() final;

 private:
  mojo::MessageReceiverWithResponder* receiver_;
};



class BLINK_COMMON_EXPORT FederatedRequestServiceProxy
    : public FederatedRequestService {
 public:
  using InterfaceType = FederatedRequestService;

  explicit FederatedRequestServiceProxy(mojo::MessageReceiverWithResponder* receiver);
  
  void StartTokenRequest(std::vector<IdentityProviderGetParametersPtr> idp_get_params, ::password_manager::CredentialMediationRequirement requirement, ::mojo::PendingReceiver<FederatedRequest> request_receiver, StartTokenRequestCallback callback) final;
  
  void RegisterIdP(const ::GURL& url, RegisterIdPCallback callback) final;
  
  void UnregisterIdP(const ::GURL& url, UnregisterIdPCallback callback) final;
  
  void CloseModalDialogView() final;
  
  void PreventSilentAccess(PreventSilentAccessCallback callback) final;
  
  void RequestUserInfo(IdentityProviderConfigPtr provider, RequestUserInfoCallback callback) final;
  
  void Disconnect(IdentityCredentialDisconnectOptionsPtr options, DisconnectCallback callback) final;
  
  void ResolveTokenRequest(const std::optional<std::string>& account_id, ResolveTokenParamsPtr params, ResolveTokenRequestCallback callback) final;
  
  void SetIdpSigninStatus(const ::url::Origin& origin, IdpSigninStatus status, const std::optional<::blink::common::webid::LoginStatusOptions>& options, SetIdpSigninStatusCallback callback) final;

 private:
  mojo::MessageReceiverWithResponder* receiver_;
};
class BLINK_COMMON_EXPORT FederatedRequestStubDispatch {
 public:
  static bool Accept(FederatedRequest* impl, mojo::Message* message);
  static bool AcceptWithResponder(
      FederatedRequest* impl,
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder);
};

template <typename ImplRefTraits =
              mojo::RawPtrImplRefTraits<FederatedRequest>>
class FederatedRequestStub
    : public mojo::MessageReceiverWithResponderStatus {
 public:
  using ImplPointerType = typename ImplRefTraits::PointerType;

  FederatedRequestStub() = default;
  ~FederatedRequestStub() override = default;

  void set_sink(ImplPointerType sink) { sink_ = std::move(sink); }
  ImplPointerType& sink() { return sink_; }

  bool Accept(mojo::Message* message) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return FederatedRequestStubDispatch::Accept(
        ImplRefTraits::GetRawPointer(&sink_), message);
  }

  bool AcceptWithResponder(
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return FederatedRequestStubDispatch::AcceptWithResponder(
        ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder));
  }

 private:
  ImplPointerType sink_;
};
class BLINK_COMMON_EXPORT FederatedRequestServiceStubDispatch {
 public:
  static bool Accept(FederatedRequestService* impl, mojo::Message* message);
  static bool AcceptWithResponder(
      FederatedRequestService* impl,
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder);
};

template <typename ImplRefTraits =
              mojo::RawPtrImplRefTraits<FederatedRequestService>>
class FederatedRequestServiceStub
    : public mojo::MessageReceiverWithResponderStatus {
 public:
  using ImplPointerType = typename ImplRefTraits::PointerType;

  FederatedRequestServiceStub() = default;
  ~FederatedRequestServiceStub() override = default;

  void set_sink(ImplPointerType sink) { sink_ = std::move(sink); }
  ImplPointerType& sink() { return sink_; }

  bool Accept(mojo::Message* message) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return FederatedRequestServiceStubDispatch::Accept(
        ImplRefTraits::GetRawPointer(&sink_), message);
  }

  bool AcceptWithResponder(
      mojo::Message* message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override {
    if (ImplRefTraits::IsNull(sink_))
      return false;
    return FederatedRequestServiceStubDispatch::AcceptWithResponder(
        ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder));
  }

 private:
  ImplPointerType sink_;
};
class BLINK_COMMON_EXPORT FederatedRequestRequestValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};
class BLINK_COMMON_EXPORT FederatedRequestServiceRequestValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};
class BLINK_COMMON_EXPORT FederatedRequestServiceResponseValidator : public mojo::MessageReceiver {
 public:
  bool Accept(mojo::Message* message) override;
};










class BLINK_COMMON_EXPORT IdentityUserInfo {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<IdentityUserInfo, T>::value>;
  using DataView = IdentityUserInfoDataView;
  using Data_ = internal::IdentityUserInfo_Data;

  template <typename... Args>
  static IdentityUserInfoPtr New(Args&&... args) {
    return IdentityUserInfoPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static IdentityUserInfoPtr From(const U& u) {
    return mojo::TypeConverter<IdentityUserInfoPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, IdentityUserInfo>::Convert(*this);
  }


  IdentityUserInfo();

  IdentityUserInfo(
      const std::string& email,
      const std::string& given_name,
      const std::string& name,
      const std::string& picture);


  ~IdentityUserInfo();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = IdentityUserInfoPtr>
  IdentityUserInfoPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, IdentityUserInfo::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, IdentityUserInfo::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, IdentityUserInfo::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }
  size_t Hash(size_t seed) const;

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        IdentityUserInfo::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        IdentityUserInfo::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        IdentityUserInfo::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::IdentityUserInfo_UnserializedMessageContext<
            UserType, IdentityUserInfo::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<IdentityUserInfo::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return IdentityUserInfo::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::IdentityUserInfo_UnserializedMessageContext<
            UserType, IdentityUserInfo::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<IdentityUserInfo::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::string email;
  
  std::string given_name;
  
  std::string name;
  
  std::string picture;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, IdentityUserInfo::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, IdentityUserInfo::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, IdentityUserInfo::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, IdentityUserInfo::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}











class BLINK_COMMON_EXPORT RedirectParams {
 public:
  using DataView = RedirectParamsDataView;
  using Data_ = internal::RedirectParams_Data;
  using Tag = Data_::RedirectParams_Tag;

  template <typename... Args>
  static RedirectParamsPtr New(Args&&... args) {
    static_assert(
        sizeof...(args) < 0,
        "Do not use Union::New(); to create a union of a given subtype, use "
        "New<SubType>(), not New() followed by set_<sub_type>(). To represent "
        "an empty union, mark the field or parameter as nullable in the mojom "
        "definition.");
    return nullptr;
  }

  // Construct an instance holding |get|.
  static RedirectParamsPtr NewGet(
      RedirectGetParamsPtr value);
  // Construct an instance holding |post|.
  static RedirectParamsPtr NewPost(
      RedirectPostParamsPtr value);

  template <typename U>
  static RedirectParamsPtr From(const U& u) {
    return mojo::TypeConverter<RedirectParamsPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, RedirectParams>::Convert(*this);
  }
  ~RedirectParams();

  // Delete the copy constructor and copy assignment operators because `data_`
  // contains raw pointers that must not be copied.
  RedirectParams(const RedirectParams& other) = delete;
  RedirectParams& operator=(const RedirectParams& other) = delete;

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename UnionPtrType = RedirectParamsPtr>
  RedirectParamsPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T,
            typename std::enable_if<std::is_same<
                T, RedirectParams>::value>::type* = nullptr>
  bool Equals(const T& other) const;

  template <typename T,
            typename std::enable_if<std::is_same<
                T, RedirectParams>::value>::type* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  Tag which() const {
    return tag_;
  }

  bool is_get() const { return tag_ == Tag::kGet; }
  const RedirectGetParamsPtr& get_get() const {
    CHECK(tag_ == Tag::kGet);
    return data_.get;
  }
  RedirectGetParamsPtr& get_get() {
    CHECK(tag_ == Tag::kGet);
    return data_.get;
  }
  void set_get(RedirectGetParamsPtr get);

  bool is_post() const { return tag_ == Tag::kPost; }
  const RedirectPostParamsPtr& get_post() const {
    CHECK(tag_ == Tag::kPost);
    return data_.post;
  }
  RedirectPostParamsPtr& get_post() {
    CHECK(tag_ == Tag::kPost);
    return data_.post;
  }
  void set_post(RedirectPostParamsPtr post);

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        RedirectParams::DataView>(input);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    return mojo::internal::DeserializeImpl<RedirectParams::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

 private:
  template <typename T>
  friend class ::mojo::InlinedStructPtr;
  template <typename T>
  friend class ::mojo::StructPtr;

  union Union_ {
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kGet)>,
        RedirectGetParamsPtr value);
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kPost)>,
        RedirectPostParamsPtr value);
    // The contents of the union are explicitly destroyed by `DestroyActive()`.
    ~Union_() {}

    RedirectGetParamsPtr get;
    RedirectPostParamsPtr post;
  };

  RedirectParams(
      std::in_place_index_t<static_cast<size_t>(Tag::kGet)>,
      RedirectGetParamsPtr value);
  RedirectParams(
      std::in_place_index_t<static_cast<size_t>(Tag::kPost)>,
      RedirectPostParamsPtr value);

  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  void DestroyActive();
  Tag tag_;
  Union_ data_;
};



class BLINK_COMMON_EXPORT ResolveTokenParams {
 public:
  using DataView = ResolveTokenParamsDataView;
  using Data_ = internal::ResolveTokenParams_Data;
  using Tag = Data_::ResolveTokenParams_Tag;

  template <typename... Args>
  static ResolveTokenParamsPtr New(Args&&... args) {
    static_assert(
        sizeof...(args) < 0,
        "Do not use Union::New(); to create a union of a given subtype, use "
        "New<SubType>(), not New() followed by set_<sub_type>(). To represent "
        "an empty union, mark the field or parameter as nullable in the mojom "
        "definition.");
    return nullptr;
  }

  // Construct an instance holding |token|.
  static ResolveTokenParamsPtr NewToken(
      ::base::Value value);
  // Construct an instance holding |redirect_to|.
  static ResolveTokenParamsPtr NewRedirectTo(
      RedirectParamsPtr value);

  template <typename U>
  static ResolveTokenParamsPtr From(const U& u) {
    return mojo::TypeConverter<ResolveTokenParamsPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, ResolveTokenParams>::Convert(*this);
  }
  ~ResolveTokenParams();

  // Delete the copy constructor and copy assignment operators because `data_`
  // contains raw pointers that must not be copied.
  ResolveTokenParams(const ResolveTokenParams& other) = delete;
  ResolveTokenParams& operator=(const ResolveTokenParams& other) = delete;

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename UnionPtrType = ResolveTokenParamsPtr>
  ResolveTokenParamsPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T,
            typename std::enable_if<std::is_same<
                T, ResolveTokenParams>::value>::type* = nullptr>
  bool Equals(const T& other) const;

  template <typename T,
            typename std::enable_if<std::is_same<
                T, ResolveTokenParams>::value>::type* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  Tag which() const {
    return tag_;
  }

  bool is_token() const { return tag_ == Tag::kToken; }
  const ::base::Value& get_token() const {
    CHECK(tag_ == Tag::kToken);
    return data_.token;
  }
  ::base::Value& get_token() {
    CHECK(tag_ == Tag::kToken);
    return data_.token;
  }
  void set_token(::base::Value token);

  bool is_redirect_to() const { return tag_ == Tag::kRedirectTo; }
  const RedirectParamsPtr& get_redirect_to() const {
    CHECK(tag_ == Tag::kRedirectTo);
    return data_.redirect_to;
  }
  RedirectParamsPtr& get_redirect_to() {
    CHECK(tag_ == Tag::kRedirectTo);
    return data_.redirect_to;
  }
  void set_redirect_to(RedirectParamsPtr redirect_to);

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        ResolveTokenParams::DataView>(input);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    return mojo::internal::DeserializeImpl<ResolveTokenParams::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

 private:
  template <typename T>
  friend class ::mojo::InlinedStructPtr;
  template <typename T>
  friend class ::mojo::StructPtr;

  union Union_ {
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kToken)>,
        ::base::Value value);
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kRedirectTo)>,
        RedirectParamsPtr value);
    // The contents of the union are explicitly destroyed by `DestroyActive()`.
    ~Union_() {}

    ::base::Value token;
    RedirectParamsPtr redirect_to;
  };

  ResolveTokenParams(
      std::in_place_index_t<static_cast<size_t>(Tag::kToken)>,
      ::base::Value value);
  ResolveTokenParams(
      std::in_place_index_t<static_cast<size_t>(Tag::kRedirectTo)>,
      RedirectParamsPtr value);

  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  void DestroyActive();
  Tag tag_;
  Union_ data_;
};



class BLINK_COMMON_EXPORT RequestUserInfoResult {
 public:
  using DataView = RequestUserInfoResultDataView;
  using Data_ = internal::RequestUserInfoResult_Data;
  using Tag = Data_::RequestUserInfoResult_Tag;

  template <typename... Args>
  static RequestUserInfoResultPtr New(Args&&... args) {
    static_assert(
        sizeof...(args) < 0,
        "Do not use Union::New(); to create a union of a given subtype, use "
        "New<SubType>(), not New() followed by set_<sub_type>(). To represent "
        "an empty union, mark the field or parameter as nullable in the mojom "
        "definition.");
    return nullptr;
  }

  // Construct an instance holding |status|.
  static RequestUserInfoResultPtr NewStatus(
      RequestUserInfoStatus value);
  // Construct an instance holding |user_info|.
  static RequestUserInfoResultPtr NewUserInfo(
      std::vector<IdentityUserInfoPtr> value);

  template <typename U>
  static RequestUserInfoResultPtr From(const U& u) {
    return mojo::TypeConverter<RequestUserInfoResultPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, RequestUserInfoResult>::Convert(*this);
  }
  ~RequestUserInfoResult();

  // Delete the copy constructor and copy assignment operators because `data_`
  // contains raw pointers that must not be copied.
  RequestUserInfoResult(const RequestUserInfoResult& other) = delete;
  RequestUserInfoResult& operator=(const RequestUserInfoResult& other) = delete;

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename UnionPtrType = RequestUserInfoResultPtr>
  RequestUserInfoResultPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T,
            typename std::enable_if<std::is_same<
                T, RequestUserInfoResult>::value>::type* = nullptr>
  bool Equals(const T& other) const;

  template <typename T,
            typename std::enable_if<std::is_same<
                T, RequestUserInfoResult>::value>::type* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  Tag which() const {
    return tag_;
  }

  bool is_status() const { return tag_ == Tag::kStatus; }
  RequestUserInfoStatus get_status() const {
    CHECK(tag_ == Tag::kStatus);
    return data_.status;
  }
  void set_status(RequestUserInfoStatus status);

  bool is_user_info() const { return tag_ == Tag::kUserInfo; }
  const std::vector<IdentityUserInfoPtr>& get_user_info() const {
    CHECK(tag_ == Tag::kUserInfo);
    return data_.user_info;
  }
  std::vector<IdentityUserInfoPtr>& get_user_info() {
    CHECK(tag_ == Tag::kUserInfo);
    return data_.user_info;
  }
  void set_user_info(std::vector<IdentityUserInfoPtr> user_info);

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        RequestUserInfoResult::DataView>(input);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    return mojo::internal::DeserializeImpl<RequestUserInfoResult::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

 private:
  template <typename T>
  friend class ::mojo::InlinedStructPtr;
  template <typename T>
  friend class ::mojo::StructPtr;

  union Union_ {
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kStatus)>,
        RequestUserInfoStatus value);
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kUserInfo)>,
        std::vector<IdentityUserInfoPtr> value);
    // The contents of the union are explicitly destroyed by `DestroyActive()`.
    ~Union_() {}

    RequestUserInfoStatus status;
    std::vector<IdentityUserInfoPtr> user_info;
  };

  RequestUserInfoResult(
      std::in_place_index_t<static_cast<size_t>(Tag::kStatus)>,
      RequestUserInfoStatus value);
  RequestUserInfoResult(
      std::in_place_index_t<static_cast<size_t>(Tag::kUserInfo)>,
      std::vector<IdentityUserInfoPtr> value);

  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  void DestroyActive();
  Tag tag_;
  Union_ data_;
};



class BLINK_COMMON_EXPORT FederatedRequestService_StartTokenRequest_ResponseParam_Result {
 public:
  using DataView = FederatedRequestService_StartTokenRequest_ResponseParam_ResultDataView;
  using Data_ = internal::FederatedRequestService_StartTokenRequest_ResponseParam_Result_Data;
  using Tag = Data_::FederatedRequestService_StartTokenRequest_ResponseParam_Result_Tag;

  template <typename... Args>
  static FederatedRequestService_StartTokenRequest_ResponseParam_ResultPtr New(Args&&... args) {
    static_assert(
        sizeof...(args) < 0,
        "Do not use Union::New(); to create a union of a given subtype, use "
        "New<SubType>(), not New() followed by set_<sub_type>(). To represent "
        "an empty union, mark the field or parameter as nullable in the mojom "
        "definition.");
    return nullptr;
  }

  // Construct an instance holding |success|.
  static FederatedRequestService_StartTokenRequest_ResponseParam_ResultPtr NewSuccess(
      TokenRequestSuccessPtr value);
  // Construct an instance holding |failure|.
  static FederatedRequestService_StartTokenRequest_ResponseParam_ResultPtr NewFailure(
      TokenRequestFailurePtr value);

  template <typename U>
  static FederatedRequestService_StartTokenRequest_ResponseParam_ResultPtr From(const U& u) {
    return mojo::TypeConverter<FederatedRequestService_StartTokenRequest_ResponseParam_ResultPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, FederatedRequestService_StartTokenRequest_ResponseParam_Result>::Convert(*this);
  }
  ~FederatedRequestService_StartTokenRequest_ResponseParam_Result();

  // Delete the copy constructor and copy assignment operators because `data_`
  // contains raw pointers that must not be copied.
  FederatedRequestService_StartTokenRequest_ResponseParam_Result(const FederatedRequestService_StartTokenRequest_ResponseParam_Result& other) = delete;
  FederatedRequestService_StartTokenRequest_ResponseParam_Result& operator=(const FederatedRequestService_StartTokenRequest_ResponseParam_Result& other) = delete;

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename UnionPtrType = FederatedRequestService_StartTokenRequest_ResponseParam_ResultPtr>
  FederatedRequestService_StartTokenRequest_ResponseParam_ResultPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T,
            typename std::enable_if<std::is_same<
                T, FederatedRequestService_StartTokenRequest_ResponseParam_Result>::value>::type* = nullptr>
  bool Equals(const T& other) const;

  template <typename T,
            typename std::enable_if<std::is_same<
                T, FederatedRequestService_StartTokenRequest_ResponseParam_Result>::value>::type* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  Tag which() const {
    return tag_;
  }

  bool is_success() const { return tag_ == Tag::kSuccess; }
  const TokenRequestSuccessPtr& get_success() const {
    CHECK(tag_ == Tag::kSuccess);
    return data_.success;
  }
  TokenRequestSuccessPtr& get_success() {
    CHECK(tag_ == Tag::kSuccess);
    return data_.success;
  }
  void set_success(TokenRequestSuccessPtr success);

  bool is_failure() const { return tag_ == Tag::kFailure; }
  const TokenRequestFailurePtr& get_failure() const {
    CHECK(tag_ == Tag::kFailure);
    return data_.failure;
  }
  TokenRequestFailurePtr& get_failure() {
    CHECK(tag_ == Tag::kFailure);
    return data_.failure;
  }
  void set_failure(TokenRequestFailurePtr failure);

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        FederatedRequestService_StartTokenRequest_ResponseParam_Result::DataView>(input);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    return mojo::internal::DeserializeImpl<FederatedRequestService_StartTokenRequest_ResponseParam_Result::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

 private:
  template <typename T>
  friend class ::mojo::InlinedStructPtr;
  template <typename T>
  friend class ::mojo::StructPtr;

  union Union_ {
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kSuccess)>,
        TokenRequestSuccessPtr value);
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kFailure)>,
        TokenRequestFailurePtr value);
    // The contents of the union are explicitly destroyed by `DestroyActive()`.
    ~Union_() {}

    TokenRequestSuccessPtr success;
    TokenRequestFailurePtr failure;
  };

  FederatedRequestService_StartTokenRequest_ResponseParam_Result(
      std::in_place_index_t<static_cast<size_t>(Tag::kSuccess)>,
      TokenRequestSuccessPtr value);
  FederatedRequestService_StartTokenRequest_ResponseParam_Result(
      std::in_place_index_t<static_cast<size_t>(Tag::kFailure)>,
      TokenRequestFailurePtr value);

  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  void DestroyActive();
  Tag tag_;
  Union_ data_;
};





class BLINK_COMMON_EXPORT IdentityProviderConfig {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<IdentityProviderConfig, T>::value>;
  using DataView = IdentityProviderConfigDataView;
  using Data_ = internal::IdentityProviderConfig_Data;

  template <typename... Args>
  static IdentityProviderConfigPtr New(Args&&... args) {
    return IdentityProviderConfigPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static IdentityProviderConfigPtr From(const U& u) {
    return mojo::TypeConverter<IdentityProviderConfigPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, IdentityProviderConfig>::Convert(*this);
  }


  IdentityProviderConfig();

  IdentityProviderConfig(
      const ::GURL& config_url,
      bool from_idp_registration_api,
      const std::optional<std::string>& type,
      const std::string& client_id);


  ~IdentityProviderConfig();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = IdentityProviderConfigPtr>
  IdentityProviderConfigPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, IdentityProviderConfig::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, IdentityProviderConfig::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, IdentityProviderConfig::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        IdentityProviderConfig::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        IdentityProviderConfig::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        IdentityProviderConfig::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::IdentityProviderConfig_UnserializedMessageContext<
            UserType, IdentityProviderConfig::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<IdentityProviderConfig::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return IdentityProviderConfig::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::IdentityProviderConfig_UnserializedMessageContext<
            UserType, IdentityProviderConfig::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<IdentityProviderConfig::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  ::GURL config_url;
  
  bool from_idp_registration_api;
  
  std::optional<std::string> type;
  
  std::string client_id;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, IdentityProviderConfig::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, IdentityProviderConfig::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, IdentityProviderConfig::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, IdentityProviderConfig::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class BLINK_COMMON_EXPORT RedirectGetParams {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<RedirectGetParams, T>::value>;
  using DataView = RedirectGetParamsDataView;
  using Data_ = internal::RedirectGetParams_Data;

  template <typename... Args>
  static RedirectGetParamsPtr New(Args&&... args) {
    return RedirectGetParamsPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static RedirectGetParamsPtr From(const U& u) {
    return mojo::TypeConverter<RedirectGetParamsPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, RedirectGetParams>::Convert(*this);
  }


  RedirectGetParams();

  explicit RedirectGetParams(
      const ::GURL& url);


  ~RedirectGetParams();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = RedirectGetParamsPtr>
  RedirectGetParamsPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, RedirectGetParams::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, RedirectGetParams::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, RedirectGetParams::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        RedirectGetParams::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        RedirectGetParams::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        RedirectGetParams::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::RedirectGetParams_UnserializedMessageContext<
            UserType, RedirectGetParams::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<RedirectGetParams::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return RedirectGetParams::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::RedirectGetParams_UnserializedMessageContext<
            UserType, RedirectGetParams::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<RedirectGetParams::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  ::GURL url;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, RedirectGetParams::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, RedirectGetParams::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, RedirectGetParams::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, RedirectGetParams::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class BLINK_COMMON_EXPORT RedirectPostParams {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<RedirectPostParams, T>::value>;
  using DataView = RedirectPostParamsDataView;
  using Data_ = internal::RedirectPostParams_Data;

  template <typename... Args>
  static RedirectPostParamsPtr New(Args&&... args) {
    return RedirectPostParamsPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static RedirectPostParamsPtr From(const U& u) {
    return mojo::TypeConverter<RedirectPostParamsPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, RedirectPostParams>::Convert(*this);
  }


  RedirectPostParams();

  RedirectPostParams(
      const ::GURL& url,
      const std::string& request_body);


  ~RedirectPostParams();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = RedirectPostParamsPtr>
  RedirectPostParamsPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, RedirectPostParams::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, RedirectPostParams::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, RedirectPostParams::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        RedirectPostParams::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        RedirectPostParams::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        RedirectPostParams::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::RedirectPostParams_UnserializedMessageContext<
            UserType, RedirectPostParams::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<RedirectPostParams::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return RedirectPostParams::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::RedirectPostParams_UnserializedMessageContext<
            UserType, RedirectPostParams::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<RedirectPostParams::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  ::GURL url;
  
  std::string request_body;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, RedirectPostParams::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, RedirectPostParams::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, RedirectPostParams::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, RedirectPostParams::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class BLINK_COMMON_EXPORT IdentityProviderRequestOptions {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<IdentityProviderRequestOptions, T>::value>;
  using DataView = IdentityProviderRequestOptionsDataView;
  using Data_ = internal::IdentityProviderRequestOptions_Data;

  template <typename... Args>
  static IdentityProviderRequestOptionsPtr New(Args&&... args) {
    return IdentityProviderRequestOptionsPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static IdentityProviderRequestOptionsPtr From(const U& u) {
    return mojo::TypeConverter<IdentityProviderRequestOptionsPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, IdentityProviderRequestOptions>::Convert(*this);
  }


  IdentityProviderRequestOptions();

  IdentityProviderRequestOptions(
      IdentityProviderConfigPtr config,
      const std::string& nonce,
      const std::string& login_hint,
      const std::string& domain_hint,
      std::optional<std::vector<std::string>> fields,
      const std::optional<std::string>& params_json,
      std::optional<Format> format);

IdentityProviderRequestOptions(const IdentityProviderRequestOptions&) = delete;
IdentityProviderRequestOptions& operator=(const IdentityProviderRequestOptions&) = delete;

  ~IdentityProviderRequestOptions();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = IdentityProviderRequestOptionsPtr>
  IdentityProviderRequestOptionsPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, IdentityProviderRequestOptions::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, IdentityProviderRequestOptions::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, IdentityProviderRequestOptions::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        IdentityProviderRequestOptions::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        IdentityProviderRequestOptions::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        IdentityProviderRequestOptions::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::IdentityProviderRequestOptions_UnserializedMessageContext<
            UserType, IdentityProviderRequestOptions::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<IdentityProviderRequestOptions::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return IdentityProviderRequestOptions::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::IdentityProviderRequestOptions_UnserializedMessageContext<
            UserType, IdentityProviderRequestOptions::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<IdentityProviderRequestOptions::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  IdentityProviderConfigPtr config;
  
  std::string nonce;
  
  std::string login_hint;
  
  std::string domain_hint;
  
  std::optional<std::vector<std::string>> fields;
  
  std::optional<std::string> params_json;
  
  std::optional<Format> format;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, IdentityProviderRequestOptions::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, IdentityProviderRequestOptions::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, IdentityProviderRequestOptions::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, IdentityProviderRequestOptions::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class BLINK_COMMON_EXPORT IdentityCredentialDisconnectOptions {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<IdentityCredentialDisconnectOptions, T>::value>;
  using DataView = IdentityCredentialDisconnectOptionsDataView;
  using Data_ = internal::IdentityCredentialDisconnectOptions_Data;

  template <typename... Args>
  static IdentityCredentialDisconnectOptionsPtr New(Args&&... args) {
    return IdentityCredentialDisconnectOptionsPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static IdentityCredentialDisconnectOptionsPtr From(const U& u) {
    return mojo::TypeConverter<IdentityCredentialDisconnectOptionsPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, IdentityCredentialDisconnectOptions>::Convert(*this);
  }


  IdentityCredentialDisconnectOptions();

  IdentityCredentialDisconnectOptions(
      IdentityProviderConfigPtr config,
      const std::string& account_hint);

IdentityCredentialDisconnectOptions(const IdentityCredentialDisconnectOptions&) = delete;
IdentityCredentialDisconnectOptions& operator=(const IdentityCredentialDisconnectOptions&) = delete;

  ~IdentityCredentialDisconnectOptions();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = IdentityCredentialDisconnectOptionsPtr>
  IdentityCredentialDisconnectOptionsPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, IdentityCredentialDisconnectOptions::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, IdentityCredentialDisconnectOptions::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, IdentityCredentialDisconnectOptions::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        IdentityCredentialDisconnectOptions::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        IdentityCredentialDisconnectOptions::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        IdentityCredentialDisconnectOptions::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::IdentityCredentialDisconnectOptions_UnserializedMessageContext<
            UserType, IdentityCredentialDisconnectOptions::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<IdentityCredentialDisconnectOptions::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return IdentityCredentialDisconnectOptions::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::IdentityCredentialDisconnectOptions_UnserializedMessageContext<
            UserType, IdentityCredentialDisconnectOptions::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<IdentityCredentialDisconnectOptions::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  IdentityProviderConfigPtr config;
  
  std::string account_hint;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, IdentityCredentialDisconnectOptions::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, IdentityCredentialDisconnectOptions::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, IdentityCredentialDisconnectOptions::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, IdentityCredentialDisconnectOptions::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}






class BLINK_COMMON_EXPORT LoginStatusAccount {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<LoginStatusAccount, T>::value>;
  using DataView = LoginStatusAccountDataView;
  using Data_ = internal::LoginStatusAccount_Data;

  template <typename... Args>
  static LoginStatusAccountPtr New(Args&&... args) {
    return LoginStatusAccountPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static LoginStatusAccountPtr From(const U& u) {
    return mojo::TypeConverter<LoginStatusAccountPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, LoginStatusAccount>::Convert(*this);
  }


  LoginStatusAccount();

  LoginStatusAccount(
      const std::string& id,
      const std::string& email,
      const std::string& name,
      const std::optional<std::string>& given_name,
      const std::optional<::GURL>& picture);


  ~LoginStatusAccount();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = LoginStatusAccountPtr>
  LoginStatusAccountPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, LoginStatusAccount::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, LoginStatusAccount::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, LoginStatusAccount::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        LoginStatusAccount::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        LoginStatusAccount::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        LoginStatusAccount::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::LoginStatusAccount_UnserializedMessageContext<
            UserType, LoginStatusAccount::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<LoginStatusAccount::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return LoginStatusAccount::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::LoginStatusAccount_UnserializedMessageContext<
            UserType, LoginStatusAccount::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<LoginStatusAccount::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::string id;
  
  std::string email;
  
  std::string name;
  
  std::optional<std::string> given_name;
  
  std::optional<::GURL> picture;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, LoginStatusAccount::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, LoginStatusAccount::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, LoginStatusAccount::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, LoginStatusAccount::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class BLINK_COMMON_EXPORT LoginStatusOptions {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<LoginStatusOptions, T>::value>;
  using DataView = LoginStatusOptionsDataView;
  using Data_ = internal::LoginStatusOptions_Data;

  template <typename... Args>
  static LoginStatusOptionsPtr New(Args&&... args) {
    return LoginStatusOptionsPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static LoginStatusOptionsPtr From(const U& u) {
    return mojo::TypeConverter<LoginStatusOptionsPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, LoginStatusOptions>::Convert(*this);
  }


  LoginStatusOptions();

  LoginStatusOptions(
      std::vector<::blink::common::webid::LoginStatusAccount> accounts,
      std::optional<::base::TimeDelta> expiration);


  ~LoginStatusOptions();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = LoginStatusOptionsPtr>
  LoginStatusOptionsPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, LoginStatusOptions::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, LoginStatusOptions::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, LoginStatusOptions::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        LoginStatusOptions::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        LoginStatusOptions::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        LoginStatusOptions::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::LoginStatusOptions_UnserializedMessageContext<
            UserType, LoginStatusOptions::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<LoginStatusOptions::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return LoginStatusOptions::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::LoginStatusOptions_UnserializedMessageContext<
            UserType, LoginStatusOptions::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<LoginStatusOptions::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::vector<::blink::common::webid::LoginStatusAccount> accounts;
  
  std::optional<::base::TimeDelta> expiration;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, LoginStatusOptions::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, LoginStatusOptions::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, LoginStatusOptions::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, LoginStatusOptions::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class BLINK_COMMON_EXPORT IdentityProviderGetParameters {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<IdentityProviderGetParameters, T>::value>;
  using DataView = IdentityProviderGetParametersDataView;
  using Data_ = internal::IdentityProviderGetParameters_Data;

  template <typename... Args>
  static IdentityProviderGetParametersPtr New(Args&&... args) {
    return IdentityProviderGetParametersPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static IdentityProviderGetParametersPtr From(const U& u) {
    return mojo::TypeConverter<IdentityProviderGetParametersPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, IdentityProviderGetParameters>::Convert(*this);
  }


  IdentityProviderGetParameters();

  IdentityProviderGetParameters(
      std::vector<IdentityProviderRequestOptionsPtr> providers,
      RpContext context,
      RpMode mode);

IdentityProviderGetParameters(const IdentityProviderGetParameters&) = delete;
IdentityProviderGetParameters& operator=(const IdentityProviderGetParameters&) = delete;

  ~IdentityProviderGetParameters();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = IdentityProviderGetParametersPtr>
  IdentityProviderGetParametersPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, IdentityProviderGetParameters::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, IdentityProviderGetParameters::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, IdentityProviderGetParameters::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        IdentityProviderGetParameters::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        IdentityProviderGetParameters::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        IdentityProviderGetParameters::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::IdentityProviderGetParameters_UnserializedMessageContext<
            UserType, IdentityProviderGetParameters::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<IdentityProviderGetParameters::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return IdentityProviderGetParameters::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::IdentityProviderGetParameters_UnserializedMessageContext<
            UserType, IdentityProviderGetParameters::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<IdentityProviderGetParameters::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::vector<IdentityProviderRequestOptionsPtr> providers;
  
  RpContext context;
  
  RpMode mode;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, IdentityProviderGetParameters::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, IdentityProviderGetParameters::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, IdentityProviderGetParameters::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, IdentityProviderGetParameters::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class BLINK_COMMON_EXPORT TokenError {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<TokenError, T>::value>;
  using DataView = TokenErrorDataView;
  using Data_ = internal::TokenError_Data;

  template <typename... Args>
  static TokenErrorPtr New(Args&&... args) {
    return TokenErrorPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static TokenErrorPtr From(const U& u) {
    return mojo::TypeConverter<TokenErrorPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, TokenError>::Convert(*this);
  }


  TokenError();

  TokenError(
      const std::optional<std::string>& code,
      const std::optional<::GURL>& url);


  ~TokenError();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = TokenErrorPtr>
  TokenErrorPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, TokenError::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, TokenError::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, TokenError::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        TokenError::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        TokenError::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        TokenError::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::TokenError_UnserializedMessageContext<
            UserType, TokenError::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<TokenError::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return TokenError::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::TokenError_UnserializedMessageContext<
            UserType, TokenError::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<TokenError::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::optional<std::string> code;
  
  std::optional<::GURL> url;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, TokenError::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, TokenError::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, TokenError::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, TokenError::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class BLINK_COMMON_EXPORT TokenRequestSuccess {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<TokenRequestSuccess, T>::value>;
  using DataView = TokenRequestSuccessDataView;
  using Data_ = internal::TokenRequestSuccess_Data;

  template <typename... Args>
  static TokenRequestSuccessPtr New(Args&&... args) {
    return TokenRequestSuccessPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static TokenRequestSuccessPtr From(const U& u) {
    return mojo::TypeConverter<TokenRequestSuccessPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, TokenRequestSuccess>::Convert(*this);
  }


  TokenRequestSuccess();

  TokenRequestSuccess(
      const ::GURL& selected_idp_config_url,
      std::optional<::base::Value> token,
      bool is_auto_selected);

TokenRequestSuccess(const TokenRequestSuccess&) = delete;
TokenRequestSuccess& operator=(const TokenRequestSuccess&) = delete;

  ~TokenRequestSuccess();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = TokenRequestSuccessPtr>
  TokenRequestSuccessPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, TokenRequestSuccess::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, TokenRequestSuccess::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, TokenRequestSuccess::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        TokenRequestSuccess::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        TokenRequestSuccess::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        TokenRequestSuccess::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::TokenRequestSuccess_UnserializedMessageContext<
            UserType, TokenRequestSuccess::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<TokenRequestSuccess::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return TokenRequestSuccess::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::TokenRequestSuccess_UnserializedMessageContext<
            UserType, TokenRequestSuccess::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<TokenRequestSuccess::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  ::GURL selected_idp_config_url;
  
  std::optional<::base::Value> token;
  
  bool is_auto_selected;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, TokenRequestSuccess::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, TokenRequestSuccess::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, TokenRequestSuccess::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, TokenRequestSuccess::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class BLINK_COMMON_EXPORT TokenRequestFailure {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<TokenRequestFailure, T>::value>;
  using DataView = TokenRequestFailureDataView;
  using Data_ = internal::TokenRequestFailure_Data;

  template <typename... Args>
  static TokenRequestFailurePtr New(Args&&... args) {
    return TokenRequestFailurePtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static TokenRequestFailurePtr From(const U& u) {
    return mojo::TypeConverter<TokenRequestFailurePtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, TokenRequestFailure>::Convert(*this);
  }


  TokenRequestFailure();

  TokenRequestFailure(
      RequestTokenStatus status,
      TokenErrorPtr error);

TokenRequestFailure(const TokenRequestFailure&) = delete;
TokenRequestFailure& operator=(const TokenRequestFailure&) = delete;

  ~TokenRequestFailure();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = TokenRequestFailurePtr>
  TokenRequestFailurePtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, TokenRequestFailure::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, TokenRequestFailure::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, TokenRequestFailure::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        TokenRequestFailure::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        TokenRequestFailure::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        TokenRequestFailure::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::TokenRequestFailure_UnserializedMessageContext<
            UserType, TokenRequestFailure::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<TokenRequestFailure::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return TokenRequestFailure::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::TokenRequestFailure_UnserializedMessageContext<
            UserType, TokenRequestFailure::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<TokenRequestFailure::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  RequestTokenStatus status;
  
  TokenErrorPtr error;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, TokenRequestFailure::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, TokenRequestFailure::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, TokenRequestFailure::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, TokenRequestFailure::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}

template <typename UnionPtrType>
RedirectParamsPtr RedirectParams::Clone() const {
  switch (tag_) {
    case Tag::kGet:
      return NewGet(
          mojo::Clone(data_.get));
    case Tag::kPost:
      return NewPost(
          mojo::Clone(data_.post));
  }
  return nullptr;
}

template <typename T,
          typename std::enable_if<std::is_same<
              T, RedirectParams>::value>::type*>
bool RedirectParams::Equals(const T& other) const {
  if (tag_ != other.which())
    return false;

  switch (tag_) {
    case Tag::kGet:
      return mojo::Equals(data_.get, other.data_.get);
    case Tag::kPost:
      return mojo::Equals(data_.post, other.data_.post);
  }

  return false;
}
template <typename UnionPtrType>
ResolveTokenParamsPtr ResolveTokenParams::Clone() const {
  switch (tag_) {
    case Tag::kToken:
      return NewToken(
          mojo::Clone(data_.token));
    case Tag::kRedirectTo:
      return NewRedirectTo(
          mojo::Clone(data_.redirect_to));
  }
  return nullptr;
}

template <typename T,
          typename std::enable_if<std::is_same<
              T, ResolveTokenParams>::value>::type*>
bool ResolveTokenParams::Equals(const T& other) const {
  if (tag_ != other.which())
    return false;

  switch (tag_) {
    case Tag::kToken:
      return mojo::Equals(data_.token, other.data_.token);
    case Tag::kRedirectTo:
      return mojo::Equals(data_.redirect_to, other.data_.redirect_to);
  }

  return false;
}
template <typename UnionPtrType>
RequestUserInfoResultPtr RequestUserInfoResult::Clone() const {
  switch (tag_) {
    case Tag::kStatus:
      return NewStatus(
          mojo::Clone(data_.status));
    case Tag::kUserInfo:
      return NewUserInfo(
          mojo::Clone(data_.user_info));
  }
  return nullptr;
}

template <typename T,
          typename std::enable_if<std::is_same<
              T, RequestUserInfoResult>::value>::type*>
bool RequestUserInfoResult::Equals(const T& other) const {
  if (tag_ != other.which())
    return false;

  switch (tag_) {
    case Tag::kStatus:
      return mojo::Equals(data_.status, other.data_.status);
    case Tag::kUserInfo:
      return mojo::Equals(data_.user_info, other.data_.user_info);
  }

  return false;
}
template <typename UnionPtrType>
FederatedRequestService_StartTokenRequest_ResponseParam_ResultPtr FederatedRequestService_StartTokenRequest_ResponseParam_Result::Clone() const {
  switch (tag_) {
    case Tag::kSuccess:
      return NewSuccess(
          mojo::Clone(data_.success));
    case Tag::kFailure:
      return NewFailure(
          mojo::Clone(data_.failure));
  }
  return nullptr;
}

template <typename T,
          typename std::enable_if<std::is_same<
              T, FederatedRequestService_StartTokenRequest_ResponseParam_Result>::value>::type*>
bool FederatedRequestService_StartTokenRequest_ResponseParam_Result::Equals(const T& other) const {
  if (tag_ != other.which())
    return false;

  switch (tag_) {
    case Tag::kSuccess:
      return mojo::Equals(data_.success, other.data_.success);
    case Tag::kFailure:
      return mojo::Equals(data_.failure, other.data_.failure);
  }

  return false;
}
template <typename StructPtrType>
IdentityProviderConfigPtr IdentityProviderConfig::Clone() const {
  return New(
      mojo::Clone(config_url),
      mojo::Clone(from_idp_registration_api),
      mojo::Clone(type),
      mojo::Clone(client_id)
  );
}

template <typename T, IdentityProviderConfig::EnableIfSame<T>*>
bool IdentityProviderConfig::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->config_url, other_struct.config_url))
    return false;
  if (!mojo::Equals(this->from_idp_registration_api, other_struct.from_idp_registration_api))
    return false;
  if (!mojo::Equals(this->type, other_struct.type))
    return false;
  if (!mojo::Equals(this->client_id, other_struct.client_id))
    return false;
  return true;
}

template <typename T, IdentityProviderConfig::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.config_url < rhs.config_url)
    return true;
  if (rhs.config_url < lhs.config_url)
    return false;
  if (lhs.from_idp_registration_api < rhs.from_idp_registration_api)
    return true;
  if (rhs.from_idp_registration_api < lhs.from_idp_registration_api)
    return false;
  if (lhs.type < rhs.type)
    return true;
  if (rhs.type < lhs.type)
    return false;
  if (lhs.client_id < rhs.client_id)
    return true;
  if (rhs.client_id < lhs.client_id)
    return false;
  return false;
}
template <typename StructPtrType>
RedirectGetParamsPtr RedirectGetParams::Clone() const {
  return New(
      mojo::Clone(url)
  );
}

template <typename T, RedirectGetParams::EnableIfSame<T>*>
bool RedirectGetParams::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->url, other_struct.url))
    return false;
  return true;
}

template <typename T, RedirectGetParams::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.url < rhs.url)
    return true;
  if (rhs.url < lhs.url)
    return false;
  return false;
}
template <typename StructPtrType>
RedirectPostParamsPtr RedirectPostParams::Clone() const {
  return New(
      mojo::Clone(url),
      mojo::Clone(request_body)
  );
}

template <typename T, RedirectPostParams::EnableIfSame<T>*>
bool RedirectPostParams::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->url, other_struct.url))
    return false;
  if (!mojo::Equals(this->request_body, other_struct.request_body))
    return false;
  return true;
}

template <typename T, RedirectPostParams::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.url < rhs.url)
    return true;
  if (rhs.url < lhs.url)
    return false;
  if (lhs.request_body < rhs.request_body)
    return true;
  if (rhs.request_body < lhs.request_body)
    return false;
  return false;
}
template <typename StructPtrType>
IdentityProviderRequestOptionsPtr IdentityProviderRequestOptions::Clone() const {
  return New(
      mojo::Clone(config),
      mojo::Clone(nonce),
      mojo::Clone(login_hint),
      mojo::Clone(domain_hint),
      mojo::Clone(fields),
      mojo::Clone(params_json),
      mojo::Clone(format)
  );
}

template <typename T, IdentityProviderRequestOptions::EnableIfSame<T>*>
bool IdentityProviderRequestOptions::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->config, other_struct.config))
    return false;
  if (!mojo::Equals(this->nonce, other_struct.nonce))
    return false;
  if (!mojo::Equals(this->login_hint, other_struct.login_hint))
    return false;
  if (!mojo::Equals(this->domain_hint, other_struct.domain_hint))
    return false;
  if (!mojo::Equals(this->fields, other_struct.fields))
    return false;
  if (!mojo::Equals(this->params_json, other_struct.params_json))
    return false;
  if (!mojo::Equals(this->format, other_struct.format))
    return false;
  return true;
}

template <typename T, IdentityProviderRequestOptions::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.config < rhs.config)
    return true;
  if (rhs.config < lhs.config)
    return false;
  if (lhs.nonce < rhs.nonce)
    return true;
  if (rhs.nonce < lhs.nonce)
    return false;
  if (lhs.login_hint < rhs.login_hint)
    return true;
  if (rhs.login_hint < lhs.login_hint)
    return false;
  if (lhs.domain_hint < rhs.domain_hint)
    return true;
  if (rhs.domain_hint < lhs.domain_hint)
    return false;
  if (lhs.fields < rhs.fields)
    return true;
  if (rhs.fields < lhs.fields)
    return false;
  if (lhs.params_json < rhs.params_json)
    return true;
  if (rhs.params_json < lhs.params_json)
    return false;
  if (lhs.format < rhs.format)
    return true;
  if (rhs.format < lhs.format)
    return false;
  return false;
}
template <typename StructPtrType>
IdentityCredentialDisconnectOptionsPtr IdentityCredentialDisconnectOptions::Clone() const {
  return New(
      mojo::Clone(config),
      mojo::Clone(account_hint)
  );
}

template <typename T, IdentityCredentialDisconnectOptions::EnableIfSame<T>*>
bool IdentityCredentialDisconnectOptions::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->config, other_struct.config))
    return false;
  if (!mojo::Equals(this->account_hint, other_struct.account_hint))
    return false;
  return true;
}

template <typename T, IdentityCredentialDisconnectOptions::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.config < rhs.config)
    return true;
  if (rhs.config < lhs.config)
    return false;
  if (lhs.account_hint < rhs.account_hint)
    return true;
  if (rhs.account_hint < lhs.account_hint)
    return false;
  return false;
}
template <typename StructPtrType>
IdentityUserInfoPtr IdentityUserInfo::Clone() const {
  return New(
      mojo::Clone(email),
      mojo::Clone(given_name),
      mojo::Clone(name),
      mojo::Clone(picture)
  );
}

template <typename T, IdentityUserInfo::EnableIfSame<T>*>
bool IdentityUserInfo::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->email, other_struct.email))
    return false;
  if (!mojo::Equals(this->given_name, other_struct.given_name))
    return false;
  if (!mojo::Equals(this->name, other_struct.name))
    return false;
  if (!mojo::Equals(this->picture, other_struct.picture))
    return false;
  return true;
}

template <typename T, IdentityUserInfo::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.email < rhs.email)
    return true;
  if (rhs.email < lhs.email)
    return false;
  if (lhs.given_name < rhs.given_name)
    return true;
  if (rhs.given_name < lhs.given_name)
    return false;
  if (lhs.name < rhs.name)
    return true;
  if (rhs.name < lhs.name)
    return false;
  if (lhs.picture < rhs.picture)
    return true;
  if (rhs.picture < lhs.picture)
    return false;
  return false;
}
template <typename StructPtrType>
LoginStatusAccountPtr LoginStatusAccount::Clone() const {
  return New(
      mojo::Clone(id),
      mojo::Clone(email),
      mojo::Clone(name),
      mojo::Clone(given_name),
      mojo::Clone(picture)
  );
}

template <typename T, LoginStatusAccount::EnableIfSame<T>*>
bool LoginStatusAccount::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->id, other_struct.id))
    return false;
  if (!mojo::Equals(this->email, other_struct.email))
    return false;
  if (!mojo::Equals(this->name, other_struct.name))
    return false;
  if (!mojo::Equals(this->given_name, other_struct.given_name))
    return false;
  if (!mojo::Equals(this->picture, other_struct.picture))
    return false;
  return true;
}

template <typename T, LoginStatusAccount::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.id < rhs.id)
    return true;
  if (rhs.id < lhs.id)
    return false;
  if (lhs.email < rhs.email)
    return true;
  if (rhs.email < lhs.email)
    return false;
  if (lhs.name < rhs.name)
    return true;
  if (rhs.name < lhs.name)
    return false;
  if (lhs.given_name < rhs.given_name)
    return true;
  if (rhs.given_name < lhs.given_name)
    return false;
  if (lhs.picture < rhs.picture)
    return true;
  if (rhs.picture < lhs.picture)
    return false;
  return false;
}
template <typename StructPtrType>
LoginStatusOptionsPtr LoginStatusOptions::Clone() const {
  return New(
      mojo::Clone(accounts),
      mojo::Clone(expiration)
  );
}

template <typename T, LoginStatusOptions::EnableIfSame<T>*>
bool LoginStatusOptions::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->accounts, other_struct.accounts))
    return false;
  if (!mojo::Equals(this->expiration, other_struct.expiration))
    return false;
  return true;
}

template <typename T, LoginStatusOptions::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.accounts < rhs.accounts)
    return true;
  if (rhs.accounts < lhs.accounts)
    return false;
  if (lhs.expiration < rhs.expiration)
    return true;
  if (rhs.expiration < lhs.expiration)
    return false;
  return false;
}
template <typename StructPtrType>
IdentityProviderGetParametersPtr IdentityProviderGetParameters::Clone() const {
  return New(
      mojo::Clone(providers),
      mojo::Clone(context),
      mojo::Clone(mode)
  );
}

template <typename T, IdentityProviderGetParameters::EnableIfSame<T>*>
bool IdentityProviderGetParameters::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->providers, other_struct.providers))
    return false;
  if (!mojo::Equals(this->context, other_struct.context))
    return false;
  if (!mojo::Equals(this->mode, other_struct.mode))
    return false;
  return true;
}

template <typename T, IdentityProviderGetParameters::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.providers < rhs.providers)
    return true;
  if (rhs.providers < lhs.providers)
    return false;
  if (lhs.context < rhs.context)
    return true;
  if (rhs.context < lhs.context)
    return false;
  if (lhs.mode < rhs.mode)
    return true;
  if (rhs.mode < lhs.mode)
    return false;
  return false;
}
template <typename StructPtrType>
TokenErrorPtr TokenError::Clone() const {
  return New(
      mojo::Clone(code),
      mojo::Clone(url)
  );
}

template <typename T, TokenError::EnableIfSame<T>*>
bool TokenError::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->code, other_struct.code))
    return false;
  if (!mojo::Equals(this->url, other_struct.url))
    return false;
  return true;
}

template <typename T, TokenError::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.code < rhs.code)
    return true;
  if (rhs.code < lhs.code)
    return false;
  if (lhs.url < rhs.url)
    return true;
  if (rhs.url < lhs.url)
    return false;
  return false;
}
template <typename StructPtrType>
TokenRequestSuccessPtr TokenRequestSuccess::Clone() const {
  return New(
      mojo::Clone(selected_idp_config_url),
      mojo::Clone(token),
      mojo::Clone(is_auto_selected)
  );
}

template <typename T, TokenRequestSuccess::EnableIfSame<T>*>
bool TokenRequestSuccess::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->selected_idp_config_url, other_struct.selected_idp_config_url))
    return false;
  if (!mojo::Equals(this->token, other_struct.token))
    return false;
  if (!mojo::Equals(this->is_auto_selected, other_struct.is_auto_selected))
    return false;
  return true;
}

template <typename T, TokenRequestSuccess::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.selected_idp_config_url < rhs.selected_idp_config_url)
    return true;
  if (rhs.selected_idp_config_url < lhs.selected_idp_config_url)
    return false;
  if (lhs.token < rhs.token)
    return true;
  if (rhs.token < lhs.token)
    return false;
  if (lhs.is_auto_selected < rhs.is_auto_selected)
    return true;
  if (rhs.is_auto_selected < lhs.is_auto_selected)
    return false;
  return false;
}
template <typename StructPtrType>
TokenRequestFailurePtr TokenRequestFailure::Clone() const {
  return New(
      mojo::Clone(status),
      mojo::Clone(error)
  );
}

template <typename T, TokenRequestFailure::EnableIfSame<T>*>
bool TokenRequestFailure::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->status, other_struct.status))
    return false;
  if (!mojo::Equals(this->error, other_struct.error))
    return false;
  return true;
}

template <typename T, TokenRequestFailure::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.status < rhs.status)
    return true;
  if (rhs.status < lhs.status)
    return false;
  if (lhs.error < rhs.error)
    return true;
  if (rhs.error < lhs.error)
    return false;
  return false;
}


}  // blink::mojom

namespace mojo {


template <>
struct BLINK_COMMON_EXPORT StructTraits<::blink::mojom::IdentityProviderConfig::DataView,
                                         ::blink::mojom::IdentityProviderConfigPtr> {
  static bool IsNull(const ::blink::mojom::IdentityProviderConfigPtr& input) { return !input; }
  static void SetToNull(::blink::mojom::IdentityProviderConfigPtr* output) { output->reset(); }

  static const decltype(::blink::mojom::IdentityProviderConfig::config_url)& config_url(
      const ::blink::mojom::IdentityProviderConfigPtr& input) {
    return input->config_url;
  }

  static decltype(::blink::mojom::IdentityProviderConfig::from_idp_registration_api) from_idp_registration_api(
      const ::blink::mojom::IdentityProviderConfigPtr& input) {
    return input->from_idp_registration_api;
  }

  static const decltype(::blink::mojom::IdentityProviderConfig::type)& type(
      const ::blink::mojom::IdentityProviderConfigPtr& input) {
    return input->type;
  }

  static const decltype(::blink::mojom::IdentityProviderConfig::client_id)& client_id(
      const ::blink::mojom::IdentityProviderConfigPtr& input) {
    return input->client_id;
  }

  static bool Read(::blink::mojom::IdentityProviderConfig::DataView input, ::blink::mojom::IdentityProviderConfigPtr* output);
};


template <>
struct BLINK_COMMON_EXPORT StructTraits<::blink::mojom::RedirectGetParams::DataView,
                                         ::blink::mojom::RedirectGetParamsPtr> {
  static bool IsNull(const ::blink::mojom::RedirectGetParamsPtr& input) { return !input; }
  static void SetToNull(::blink::mojom::RedirectGetParamsPtr* output) { output->reset(); }

  static const decltype(::blink::mojom::RedirectGetParams::url)& url(
      const ::blink::mojom::RedirectGetParamsPtr& input) {
    return input->url;
  }

  static bool Read(::blink::mojom::RedirectGetParams::DataView input, ::blink::mojom::RedirectGetParamsPtr* output);
};


template <>
struct BLINK_COMMON_EXPORT StructTraits<::blink::mojom::RedirectPostParams::DataView,
                                         ::blink::mojom::RedirectPostParamsPtr> {
  static bool IsNull(const ::blink::mojom::RedirectPostParamsPtr& input) { return !input; }
  static void SetToNull(::blink::mojom::RedirectPostParamsPtr* output) { output->reset(); }

  static const decltype(::blink::mojom::RedirectPostParams::url)& url(
      const ::blink::mojom::RedirectPostParamsPtr& input) {
    return input->url;
  }

  static const decltype(::blink::mojom::RedirectPostParams::request_body)& request_body(
      const ::blink::mojom::RedirectPostParamsPtr& input) {
    return input->request_body;
  }

  static bool Read(::blink::mojom::RedirectPostParams::DataView input, ::blink::mojom::RedirectPostParamsPtr* output);
};


template <>
struct BLINK_COMMON_EXPORT StructTraits<::blink::mojom::IdentityProviderRequestOptions::DataView,
                                         ::blink::mojom::IdentityProviderRequestOptionsPtr> {
  static bool IsNull(const ::blink::mojom::IdentityProviderRequestOptionsPtr& input) { return !input; }
  static void SetToNull(::blink::mojom::IdentityProviderRequestOptionsPtr* output) { output->reset(); }

  static const decltype(::blink::mojom::IdentityProviderRequestOptions::config)& config(
      const ::blink::mojom::IdentityProviderRequestOptionsPtr& input) {
    return input->config;
  }

  static const decltype(::blink::mojom::IdentityProviderRequestOptions::nonce)& nonce(
      const ::blink::mojom::IdentityProviderRequestOptionsPtr& input) {
    return input->nonce;
  }

  static const decltype(::blink::mojom::IdentityProviderRequestOptions::login_hint)& login_hint(
      const ::blink::mojom::IdentityProviderRequestOptionsPtr& input) {
    return input->login_hint;
  }

  static const decltype(::blink::mojom::IdentityProviderRequestOptions::domain_hint)& domain_hint(
      const ::blink::mojom::IdentityProviderRequestOptionsPtr& input) {
    return input->domain_hint;
  }

  static const decltype(::blink::mojom::IdentityProviderRequestOptions::fields)& fields(
      const ::blink::mojom::IdentityProviderRequestOptionsPtr& input) {
    return input->fields;
  }

  static const decltype(::blink::mojom::IdentityProviderRequestOptions::params_json)& params_json(
      const ::blink::mojom::IdentityProviderRequestOptionsPtr& input) {
    return input->params_json;
  }

  static decltype(::blink::mojom::IdentityProviderRequestOptions::format) format(
      const ::blink::mojom::IdentityProviderRequestOptionsPtr& input) {
    return input->format;
  }

  static bool Read(::blink::mojom::IdentityProviderRequestOptions::DataView input, ::blink::mojom::IdentityProviderRequestOptionsPtr* output);
};


template <>
struct BLINK_COMMON_EXPORT StructTraits<::blink::mojom::IdentityCredentialDisconnectOptions::DataView,
                                         ::blink::mojom::IdentityCredentialDisconnectOptionsPtr> {
  static bool IsNull(const ::blink::mojom::IdentityCredentialDisconnectOptionsPtr& input) { return !input; }
  static void SetToNull(::blink::mojom::IdentityCredentialDisconnectOptionsPtr* output) { output->reset(); }

  static const decltype(::blink::mojom::IdentityCredentialDisconnectOptions::config)& config(
      const ::blink::mojom::IdentityCredentialDisconnectOptionsPtr& input) {
    return input->config;
  }

  static const decltype(::blink::mojom::IdentityCredentialDisconnectOptions::account_hint)& account_hint(
      const ::blink::mojom::IdentityCredentialDisconnectOptionsPtr& input) {
    return input->account_hint;
  }

  static bool Read(::blink::mojom::IdentityCredentialDisconnectOptions::DataView input, ::blink::mojom::IdentityCredentialDisconnectOptionsPtr* output);
};


template <>
struct BLINK_COMMON_EXPORT StructTraits<::blink::mojom::IdentityUserInfo::DataView,
                                         ::blink::mojom::IdentityUserInfoPtr> {
  static bool IsNull(const ::blink::mojom::IdentityUserInfoPtr& input) { return !input; }
  static void SetToNull(::blink::mojom::IdentityUserInfoPtr* output) { output->reset(); }

  static const decltype(::blink::mojom::IdentityUserInfo::email)& email(
      const ::blink::mojom::IdentityUserInfoPtr& input) {
    return input->email;
  }

  static const decltype(::blink::mojom::IdentityUserInfo::given_name)& given_name(
      const ::blink::mojom::IdentityUserInfoPtr& input) {
    return input->given_name;
  }

  static const decltype(::blink::mojom::IdentityUserInfo::name)& name(
      const ::blink::mojom::IdentityUserInfoPtr& input) {
    return input->name;
  }

  static const decltype(::blink::mojom::IdentityUserInfo::picture)& picture(
      const ::blink::mojom::IdentityUserInfoPtr& input) {
    return input->picture;
  }

  static bool Read(::blink::mojom::IdentityUserInfo::DataView input, ::blink::mojom::IdentityUserInfoPtr* output);
};


template <>
struct BLINK_COMMON_EXPORT StructTraits<::blink::mojom::LoginStatusAccount::DataView,
                                         ::blink::mojom::LoginStatusAccountPtr> {
  static bool IsNull(const ::blink::mojom::LoginStatusAccountPtr& input) { return !input; }
  static void SetToNull(::blink::mojom::LoginStatusAccountPtr* output) { output->reset(); }

  static const decltype(::blink::mojom::LoginStatusAccount::id)& id(
      const ::blink::mojom::LoginStatusAccountPtr& input) {
    return input->id;
  }

  static const decltype(::blink::mojom::LoginStatusAccount::email)& email(
      const ::blink::mojom::LoginStatusAccountPtr& input) {
    return input->email;
  }

  static const decltype(::blink::mojom::LoginStatusAccount::name)& name(
      const ::blink::mojom::LoginStatusAccountPtr& input) {
    return input->name;
  }

  static const decltype(::blink::mojom::LoginStatusAccount::given_name)& given_name(
      const ::blink::mojom::LoginStatusAccountPtr& input) {
    return input->given_name;
  }

  static const decltype(::blink::mojom::LoginStatusAccount::picture)& picture(
      const ::blink::mojom::LoginStatusAccountPtr& input) {
    return input->picture;
  }

  static bool Read(::blink::mojom::LoginStatusAccount::DataView input, ::blink::mojom::LoginStatusAccountPtr* output);
};


template <>
struct BLINK_COMMON_EXPORT StructTraits<::blink::mojom::LoginStatusOptions::DataView,
                                         ::blink::mojom::LoginStatusOptionsPtr> {
  static bool IsNull(const ::blink::mojom::LoginStatusOptionsPtr& input) { return !input; }
  static void SetToNull(::blink::mojom::LoginStatusOptionsPtr* output) { output->reset(); }

  static const decltype(::blink::mojom::LoginStatusOptions::accounts)& accounts(
      const ::blink::mojom::LoginStatusOptionsPtr& input) {
    return input->accounts;
  }

  static const decltype(::blink::mojom::LoginStatusOptions::expiration)& expiration(
      const ::blink::mojom::LoginStatusOptionsPtr& input) {
    return input->expiration;
  }

  static bool Read(::blink::mojom::LoginStatusOptions::DataView input, ::blink::mojom::LoginStatusOptionsPtr* output);
};


template <>
struct BLINK_COMMON_EXPORT StructTraits<::blink::mojom::IdentityProviderGetParameters::DataView,
                                         ::blink::mojom::IdentityProviderGetParametersPtr> {
  static bool IsNull(const ::blink::mojom::IdentityProviderGetParametersPtr& input) { return !input; }
  static void SetToNull(::blink::mojom::IdentityProviderGetParametersPtr* output) { output->reset(); }

  static const decltype(::blink::mojom::IdentityProviderGetParameters::providers)& providers(
      const ::blink::mojom::IdentityProviderGetParametersPtr& input) {
    return input->providers;
  }

  static decltype(::blink::mojom::IdentityProviderGetParameters::context) context(
      const ::blink::mojom::IdentityProviderGetParametersPtr& input) {
    return input->context;
  }

  static decltype(::blink::mojom::IdentityProviderGetParameters::mode) mode(
      const ::blink::mojom::IdentityProviderGetParametersPtr& input) {
    return input->mode;
  }

  static bool Read(::blink::mojom::IdentityProviderGetParameters::DataView input, ::blink::mojom::IdentityProviderGetParametersPtr* output);
};


template <>
struct BLINK_COMMON_EXPORT StructTraits<::blink::mojom::TokenError::DataView,
                                         ::blink::mojom::TokenErrorPtr> {
  static bool IsNull(const ::blink::mojom::TokenErrorPtr& input) { return !input; }
  static void SetToNull(::blink::mojom::TokenErrorPtr* output) { output->reset(); }

  static const decltype(::blink::mojom::TokenError::code)& code(
      const ::blink::mojom::TokenErrorPtr& input) {
    return input->code;
  }

  static const decltype(::blink::mojom::TokenError::url)& url(
      const ::blink::mojom::TokenErrorPtr& input) {
    return input->url;
  }

  static bool Read(::blink::mojom::TokenError::DataView input, ::blink::mojom::TokenErrorPtr* output);
};


template <>
struct BLINK_COMMON_EXPORT StructTraits<::blink::mojom::TokenRequestSuccess::DataView,
                                         ::blink::mojom::TokenRequestSuccessPtr> {
  static bool IsNull(const ::blink::mojom::TokenRequestSuccessPtr& input) { return !input; }
  static void SetToNull(::blink::mojom::TokenRequestSuccessPtr* output) { output->reset(); }

  static const decltype(::blink::mojom::TokenRequestSuccess::selected_idp_config_url)& selected_idp_config_url(
      const ::blink::mojom::TokenRequestSuccessPtr& input) {
    return input->selected_idp_config_url;
  }

  static const decltype(::blink::mojom::TokenRequestSuccess::token)& token(
      const ::blink::mojom::TokenRequestSuccessPtr& input) {
    return input->token;
  }

  static decltype(::blink::mojom::TokenRequestSuccess::is_auto_selected) is_auto_selected(
      const ::blink::mojom::TokenRequestSuccessPtr& input) {
    return input->is_auto_selected;
  }

  static bool Read(::blink::mojom::TokenRequestSuccess::DataView input, ::blink::mojom::TokenRequestSuccessPtr* output);
};


template <>
struct BLINK_COMMON_EXPORT StructTraits<::blink::mojom::TokenRequestFailure::DataView,
                                         ::blink::mojom::TokenRequestFailurePtr> {
  static bool IsNull(const ::blink::mojom::TokenRequestFailurePtr& input) { return !input; }
  static void SetToNull(::blink::mojom::TokenRequestFailurePtr* output) { output->reset(); }

  static decltype(::blink::mojom::TokenRequestFailure::status) status(
      const ::blink::mojom::TokenRequestFailurePtr& input) {
    return input->status;
  }

  static const decltype(::blink::mojom::TokenRequestFailure::error)& error(
      const ::blink::mojom::TokenRequestFailurePtr& input) {
    return input->error;
  }

  static bool Read(::blink::mojom::TokenRequestFailure::DataView input, ::blink::mojom::TokenRequestFailurePtr* output);
};


template <>
struct BLINK_COMMON_EXPORT UnionTraits<::blink::mojom::RedirectParams::DataView,
                                        ::blink::mojom::RedirectParamsPtr> {
  static bool IsNull(const ::blink::mojom::RedirectParamsPtr& input) { return !input; }
  static void SetToNull(::blink::mojom::RedirectParamsPtr* output) { output->reset(); }

  static ::blink::mojom::RedirectParams::Tag GetTag(const ::blink::mojom::RedirectParamsPtr& input) {
    return input->which();
  }

  static const ::blink::mojom::RedirectGetParamsPtr& get(const ::blink::mojom::RedirectParamsPtr& input) {
    return input->get_get();
  }

  static const ::blink::mojom::RedirectPostParamsPtr& post(const ::blink::mojom::RedirectParamsPtr& input) {
    return input->get_post();
  }

  static bool Read(::blink::mojom::RedirectParams::DataView input, ::blink::mojom::RedirectParamsPtr* output);
};


template <>
struct BLINK_COMMON_EXPORT UnionTraits<::blink::mojom::ResolveTokenParams::DataView,
                                        ::blink::mojom::ResolveTokenParamsPtr> {
  static bool IsNull(const ::blink::mojom::ResolveTokenParamsPtr& input) { return !input; }
  static void SetToNull(::blink::mojom::ResolveTokenParamsPtr* output) { output->reset(); }

  static ::blink::mojom::ResolveTokenParams::Tag GetTag(const ::blink::mojom::ResolveTokenParamsPtr& input) {
    return input->which();
  }

  static const ::base::Value& token(const ::blink::mojom::ResolveTokenParamsPtr& input) {
    return input->get_token();
  }

  static const ::blink::mojom::RedirectParamsPtr& redirect_to(const ::blink::mojom::ResolveTokenParamsPtr& input) {
    return input->get_redirect_to();
  }

  static bool Read(::blink::mojom::ResolveTokenParams::DataView input, ::blink::mojom::ResolveTokenParamsPtr* output);
};


template <>
struct BLINK_COMMON_EXPORT UnionTraits<::blink::mojom::RequestUserInfoResult::DataView,
                                        ::blink::mojom::RequestUserInfoResultPtr> {
  static bool IsNull(const ::blink::mojom::RequestUserInfoResultPtr& input) { return !input; }
  static void SetToNull(::blink::mojom::RequestUserInfoResultPtr* output) { output->reset(); }

  static ::blink::mojom::RequestUserInfoResult::Tag GetTag(const ::blink::mojom::RequestUserInfoResultPtr& input) {
    return input->which();
  }

  static  ::blink::mojom::RequestUserInfoStatus status(const ::blink::mojom::RequestUserInfoResultPtr& input) {
    return input->get_status();
  }

  static const std::vector<::blink::mojom::IdentityUserInfoPtr>& user_info(const ::blink::mojom::RequestUserInfoResultPtr& input) {
    return input->get_user_info();
  }

  static bool Read(::blink::mojom::RequestUserInfoResult::DataView input, ::blink::mojom::RequestUserInfoResultPtr* output);
};


template <>
struct BLINK_COMMON_EXPORT UnionTraits<::blink::mojom::FederatedRequestService_StartTokenRequest_ResponseParam_Result::DataView,
                                        ::blink::mojom::FederatedRequestService_StartTokenRequest_ResponseParam_ResultPtr> {
  static bool IsNull(const ::blink::mojom::FederatedRequestService_StartTokenRequest_ResponseParam_ResultPtr& input) { return !input; }
  static void SetToNull(::blink::mojom::FederatedRequestService_StartTokenRequest_ResponseParam_ResultPtr* output) { output->reset(); }

  static ::blink::mojom::FederatedRequestService_StartTokenRequest_ResponseParam_Result::Tag GetTag(const ::blink::mojom::FederatedRequestService_StartTokenRequest_ResponseParam_ResultPtr& input) {
    return input->which();
  }

  static const ::blink::mojom::TokenRequestSuccessPtr& success(const ::blink::mojom::FederatedRequestService_StartTokenRequest_ResponseParam_ResultPtr& input) {
    return input->get_success();
  }

  static const ::blink::mojom::TokenRequestFailurePtr& failure(const ::blink::mojom::FederatedRequestService_StartTokenRequest_ResponseParam_ResultPtr& input) {
    return input->get_failure();
  }

  static bool Read(::blink::mojom::FederatedRequestService_StartTokenRequest_ResponseParam_Result::DataView input, ::blink::mojom::FederatedRequestService_StartTokenRequest_ResponseParam_ResultPtr* output);
};

}  // namespace mojo

#endif  // THIRD_PARTY_BLINK_PUBLIC_MOJOM_WEBID_FEDERATED_REQUEST_MOJOM_H_