// third_party/blink/public/mojom/subapps/sub_apps_service.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_SUBAPPS_SUB_APPS_SERVICE_MOJOM_H_
#define THIRD_PARTY_BLINK_PUBLIC_MOJOM_SUBAPPS_SUB_APPS_SERVICE_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/subapps/sub_apps_service.mojom-features.h"  // IWYU pragma: export
#include "third_party/blink/public/mojom/subapps/sub_apps_service.mojom-shared.h"  // IWYU pragma: export
#include "third_party/blink/public/mojom/subapps/sub_apps_service.mojom-forward.h"  // IWYU pragma: export
#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/common_export.h"




namespace blink::mojom {

class SubAppsServiceProxy;

template <typename ImplRefTraits>
class SubAppsServiceStub;

class SubAppsServiceRequestValidator;
class SubAppsServiceResponseValidator;


class BLINK_COMMON_EXPORT SubAppsService
    : public SubAppsServiceInterfaceBase {
 public:
  using IPCStableHashFunction = uint32_t(*)();
  static constexpr const char* Name_ = "blink.mojom.SubAppsService";
  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_ = SubAppsServiceInterfaceBase;
  using Proxy_ = SubAppsServiceProxy;

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

  using RequestValidator_ = SubAppsServiceRequestValidator;
  using ResponseValidator_ = SubAppsServiceResponseValidator;
  enum MethodMinVersions : uint32_t {
    kAddMinVersion = 0,
    kListMinVersion = 0,
    kRemoveMinVersion = 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 Add_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct List_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
  struct Remove_Sym {
    NOINLINE static uint32_t IPCStableHash();
  };
#endif // !BUILDFLAG(IS_FUCHSIA)
  virtual ~SubAppsService() = default;

  using AddCallback = base::OnceCallback<void(base::expected<
  std::vector<SubAppsServiceAddResultPtr>,
  SubAppsServiceResultCode>)>;
  using AddResult = base::expected<
  std::vector<SubAppsServiceAddResultPtr>,
  SubAppsServiceResultCode>;
  using AddMojoCallback = base::OnceCallback<void(SubAppsService_Add_ResponseParam_ResultPtr)>;

  virtual void Add(const std::vector<std::string>& install_paths, AddCallback callback) = 0;

  using ListCallback = base::OnceCallback<void(base::expected<
  std::vector<SubAppsServiceListResultEntryPtr>,
  SubAppsServiceResultCode>)>;
  using ListResult = base::expected<
  std::vector<SubAppsServiceListResultEntryPtr>,
  SubAppsServiceResultCode>;
  using ListMojoCallback = base::OnceCallback<void(SubAppsService_List_ResponseParam_ResultPtr)>;

  virtual void List(ListCallback callback) = 0;

  using RemoveCallback = base::OnceCallback<void(base::expected<
  std::vector<SubAppsServiceRemoveResultPtr>,
  SubAppsServiceResultCode>)>;
  using RemoveResult = base::expected<
  std::vector<SubAppsServiceRemoveResultPtr>,
  SubAppsServiceResultCode>;
  using RemoveMojoCallback = base::OnceCallback<void(SubAppsService_Remove_ResponseParam_ResultPtr)>;

  virtual void Remove(const std::vector<std::string>& manifest_ids, RemoveCallback callback) = 0;
};



class BLINK_COMMON_EXPORT SubAppsServiceProxy
    : public SubAppsService {
 public:
  using InterfaceType = SubAppsService;

  explicit SubAppsServiceProxy(mojo::MessageReceiverWithResponder* receiver);
  
  void Add(const std::vector<std::string>& install_paths, AddCallback callback) final;
  
  void List(ListCallback callback) final;
  
  void Remove(const std::vector<std::string>& manifest_ids, RemoveCallback callback) final;

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

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

  SubAppsServiceStub() = default;
  ~SubAppsServiceStub() 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 SubAppsServiceStubDispatch::Accept(
        ImplRefTraits::GetRawPointer(&sink_), message);
  }

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

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





class BLINK_COMMON_EXPORT SubAppsServiceAddResult {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<SubAppsServiceAddResult, T>::value>;
  using DataView = SubAppsServiceAddResultDataView;
  using Data_ = internal::SubAppsServiceAddResult_Data;

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

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

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


  SubAppsServiceAddResult();

  SubAppsServiceAddResult(
      const std::string& install_path,
      const std::optional<std::string>& manifest_id,
      SubAppsServiceAddResultType result_type);


  ~SubAppsServiceAddResult();

  // 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 = SubAppsServiceAddResultPtr>
  SubAppsServiceAddResultPtr 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, SubAppsServiceAddResult::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, SubAppsServiceAddResult::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<
        SubAppsServiceAddResult::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        SubAppsServiceAddResult::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::SubAppsServiceAddResult_UnserializedMessageContext<
            UserType, SubAppsServiceAddResult::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<SubAppsServiceAddResult::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return SubAppsServiceAddResult::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::SubAppsServiceAddResult_UnserializedMessageContext<
            UserType, SubAppsServiceAddResult::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<SubAppsServiceAddResult::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::string install_path;
  
  std::optional<std::string> manifest_id;
  
  SubAppsServiceAddResultType result_type;

  // 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, SubAppsServiceAddResult::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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





class BLINK_COMMON_EXPORT SubAppsServiceListResultEntry {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<SubAppsServiceListResultEntry, T>::value>;
  using DataView = SubAppsServiceListResultEntryDataView;
  using Data_ = internal::SubAppsServiceListResultEntry_Data;

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

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

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


  SubAppsServiceListResultEntry();

  SubAppsServiceListResultEntry(
      const std::string& manifest_id,
      const std::string& app_name);


  ~SubAppsServiceListResultEntry();

  // 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 = SubAppsServiceListResultEntryPtr>
  SubAppsServiceListResultEntryPtr 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, SubAppsServiceListResultEntry::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, SubAppsServiceListResultEntry::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<
        SubAppsServiceListResultEntry::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        SubAppsServiceListResultEntry::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::SubAppsServiceListResultEntry_UnserializedMessageContext<
            UserType, SubAppsServiceListResultEntry::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<SubAppsServiceListResultEntry::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return SubAppsServiceListResultEntry::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::SubAppsServiceListResultEntry_UnserializedMessageContext<
            UserType, SubAppsServiceListResultEntry::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<SubAppsServiceListResultEntry::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::string manifest_id;
  
  std::string app_name;

  // 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, SubAppsServiceListResultEntry::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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





class BLINK_COMMON_EXPORT SubAppsServiceRemoveResult {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<SubAppsServiceRemoveResult, T>::value>;
  using DataView = SubAppsServiceRemoveResultDataView;
  using Data_ = internal::SubAppsServiceRemoveResult_Data;

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

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

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


  SubAppsServiceRemoveResult();

  SubAppsServiceRemoveResult(
      const std::string& manifest_id,
      SubAppsServiceRemoveResultType result_type);


  ~SubAppsServiceRemoveResult();

  // 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 = SubAppsServiceRemoveResultPtr>
  SubAppsServiceRemoveResultPtr 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, SubAppsServiceRemoveResult::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

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

  template <typename T, SubAppsServiceRemoveResult::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<
        SubAppsServiceRemoveResult::DataView, std::vector<uint8_t>, send_validation>(input);
  }

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

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        SubAppsServiceRemoveResult::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::SubAppsServiceRemoveResult_UnserializedMessageContext<
            UserType, SubAppsServiceRemoveResult::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<SubAppsServiceRemoveResult::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return SubAppsServiceRemoveResult::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::SubAppsServiceRemoveResult_UnserializedMessageContext<
            UserType, SubAppsServiceRemoveResult::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<SubAppsServiceRemoveResult::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::string manifest_id;
  
  SubAppsServiceRemoveResultType result_type;

  // 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, SubAppsServiceRemoveResult::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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





class BLINK_COMMON_EXPORT SubAppsService_Add_ResponseParam_Result {
 public:
  using DataView = SubAppsService_Add_ResponseParam_ResultDataView;
  using Data_ = internal::SubAppsService_Add_ResponseParam_Result_Data;
  using Tag = Data_::SubAppsService_Add_ResponseParam_Result_Tag;

  template <typename... Args>
  static SubAppsService_Add_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 SubAppsService_Add_ResponseParam_ResultPtr NewSuccess(
      std::vector<SubAppsServiceAddResultPtr> value);
  // Construct an instance holding |failure|.
  static SubAppsService_Add_ResponseParam_ResultPtr NewFailure(
      SubAppsServiceResultCode value);

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

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

  // Delete the copy constructor and copy assignment operators because `data_`
  // contains raw pointers that must not be copied.
  SubAppsService_Add_ResponseParam_Result(const SubAppsService_Add_ResponseParam_Result& other) = delete;
  SubAppsService_Add_ResponseParam_Result& operator=(const SubAppsService_Add_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 = SubAppsService_Add_ResponseParam_ResultPtr>
  SubAppsService_Add_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, SubAppsService_Add_ResponseParam_Result>::value>::type* = nullptr>
  bool Equals(const T& other) const;

  template <typename T,
            typename std::enable_if<std::is_same<
                T, SubAppsService_Add_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 std::vector<SubAppsServiceAddResultPtr>& get_success() const {
    CHECK(tag_ == Tag::kSuccess);
    return data_.success;
  }
  std::vector<SubAppsServiceAddResultPtr>& get_success() {
    CHECK(tag_ == Tag::kSuccess);
    return data_.success;
  }
  void set_success(std::vector<SubAppsServiceAddResultPtr> success);

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

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

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    return mojo::internal::DeserializeImpl<SubAppsService_Add_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)>,
        std::vector<SubAppsServiceAddResultPtr> value);
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kFailure)>,
        SubAppsServiceResultCode value);
    // The contents of the union are explicitly destroyed by `DestroyActive()`.
    ~Union_() {}

    std::vector<SubAppsServiceAddResultPtr> success;
    SubAppsServiceResultCode failure;
  };

  SubAppsService_Add_ResponseParam_Result(
      std::in_place_index_t<static_cast<size_t>(Tag::kSuccess)>,
      std::vector<SubAppsServiceAddResultPtr> value);
  SubAppsService_Add_ResponseParam_Result(
      std::in_place_index_t<static_cast<size_t>(Tag::kFailure)>,
      SubAppsServiceResultCode value);

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

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



class BLINK_COMMON_EXPORT SubAppsService_List_ResponseParam_Result {
 public:
  using DataView = SubAppsService_List_ResponseParam_ResultDataView;
  using Data_ = internal::SubAppsService_List_ResponseParam_Result_Data;
  using Tag = Data_::SubAppsService_List_ResponseParam_Result_Tag;

  template <typename... Args>
  static SubAppsService_List_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 SubAppsService_List_ResponseParam_ResultPtr NewSuccess(
      std::vector<SubAppsServiceListResultEntryPtr> value);
  // Construct an instance holding |failure|.
  static SubAppsService_List_ResponseParam_ResultPtr NewFailure(
      SubAppsServiceResultCode value);

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

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

  // Delete the copy constructor and copy assignment operators because `data_`
  // contains raw pointers that must not be copied.
  SubAppsService_List_ResponseParam_Result(const SubAppsService_List_ResponseParam_Result& other) = delete;
  SubAppsService_List_ResponseParam_Result& operator=(const SubAppsService_List_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 = SubAppsService_List_ResponseParam_ResultPtr>
  SubAppsService_List_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, SubAppsService_List_ResponseParam_Result>::value>::type* = nullptr>
  bool Equals(const T& other) const;

  template <typename T,
            typename std::enable_if<std::is_same<
                T, SubAppsService_List_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 std::vector<SubAppsServiceListResultEntryPtr>& get_success() const {
    CHECK(tag_ == Tag::kSuccess);
    return data_.success;
  }
  std::vector<SubAppsServiceListResultEntryPtr>& get_success() {
    CHECK(tag_ == Tag::kSuccess);
    return data_.success;
  }
  void set_success(std::vector<SubAppsServiceListResultEntryPtr> success);

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

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

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    return mojo::internal::DeserializeImpl<SubAppsService_List_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)>,
        std::vector<SubAppsServiceListResultEntryPtr> value);
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kFailure)>,
        SubAppsServiceResultCode value);
    // The contents of the union are explicitly destroyed by `DestroyActive()`.
    ~Union_() {}

    std::vector<SubAppsServiceListResultEntryPtr> success;
    SubAppsServiceResultCode failure;
  };

  SubAppsService_List_ResponseParam_Result(
      std::in_place_index_t<static_cast<size_t>(Tag::kSuccess)>,
      std::vector<SubAppsServiceListResultEntryPtr> value);
  SubAppsService_List_ResponseParam_Result(
      std::in_place_index_t<static_cast<size_t>(Tag::kFailure)>,
      SubAppsServiceResultCode value);

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

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



class BLINK_COMMON_EXPORT SubAppsService_Remove_ResponseParam_Result {
 public:
  using DataView = SubAppsService_Remove_ResponseParam_ResultDataView;
  using Data_ = internal::SubAppsService_Remove_ResponseParam_Result_Data;
  using Tag = Data_::SubAppsService_Remove_ResponseParam_Result_Tag;

  template <typename... Args>
  static SubAppsService_Remove_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 SubAppsService_Remove_ResponseParam_ResultPtr NewSuccess(
      std::vector<SubAppsServiceRemoveResultPtr> value);
  // Construct an instance holding |failure|.
  static SubAppsService_Remove_ResponseParam_ResultPtr NewFailure(
      SubAppsServiceResultCode value);

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

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

  // Delete the copy constructor and copy assignment operators because `data_`
  // contains raw pointers that must not be copied.
  SubAppsService_Remove_ResponseParam_Result(const SubAppsService_Remove_ResponseParam_Result& other) = delete;
  SubAppsService_Remove_ResponseParam_Result& operator=(const SubAppsService_Remove_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 = SubAppsService_Remove_ResponseParam_ResultPtr>
  SubAppsService_Remove_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, SubAppsService_Remove_ResponseParam_Result>::value>::type* = nullptr>
  bool Equals(const T& other) const;

  template <typename T,
            typename std::enable_if<std::is_same<
                T, SubAppsService_Remove_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 std::vector<SubAppsServiceRemoveResultPtr>& get_success() const {
    CHECK(tag_ == Tag::kSuccess);
    return data_.success;
  }
  std::vector<SubAppsServiceRemoveResultPtr>& get_success() {
    CHECK(tag_ == Tag::kSuccess);
    return data_.success;
  }
  void set_success(std::vector<SubAppsServiceRemoveResultPtr> success);

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

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

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    return mojo::internal::DeserializeImpl<SubAppsService_Remove_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)>,
        std::vector<SubAppsServiceRemoveResultPtr> value);
    Union_(
        std::in_place_index_t<static_cast<size_t>(Tag::kFailure)>,
        SubAppsServiceResultCode value);
    // The contents of the union are explicitly destroyed by `DestroyActive()`.
    ~Union_() {}

    std::vector<SubAppsServiceRemoveResultPtr> success;
    SubAppsServiceResultCode failure;
  };

  SubAppsService_Remove_ResponseParam_Result(
      std::in_place_index_t<static_cast<size_t>(Tag::kSuccess)>,
      std::vector<SubAppsServiceRemoveResultPtr> value);
  SubAppsService_Remove_ResponseParam_Result(
      std::in_place_index_t<static_cast<size_t>(Tag::kFailure)>,
      SubAppsServiceResultCode value);

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

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




template <typename UnionPtrType>
SubAppsService_Add_ResponseParam_ResultPtr SubAppsService_Add_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, SubAppsService_Add_ResponseParam_Result>::value>::type*>
bool SubAppsService_Add_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 UnionPtrType>
SubAppsService_List_ResponseParam_ResultPtr SubAppsService_List_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, SubAppsService_List_ResponseParam_Result>::value>::type*>
bool SubAppsService_List_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 UnionPtrType>
SubAppsService_Remove_ResponseParam_ResultPtr SubAppsService_Remove_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, SubAppsService_Remove_ResponseParam_Result>::value>::type*>
bool SubAppsService_Remove_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>
SubAppsServiceAddResultPtr SubAppsServiceAddResult::Clone() const {
  return New(
      mojo::Clone(install_path),
      mojo::Clone(manifest_id),
      mojo::Clone(result_type)
  );
}

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

template <typename T, SubAppsServiceAddResult::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.install_path < rhs.install_path)
    return true;
  if (rhs.install_path < lhs.install_path)
    return false;
  if (lhs.manifest_id < rhs.manifest_id)
    return true;
  if (rhs.manifest_id < lhs.manifest_id)
    return false;
  if (lhs.result_type < rhs.result_type)
    return true;
  if (rhs.result_type < lhs.result_type)
    return false;
  return false;
}
template <typename StructPtrType>
SubAppsServiceListResultEntryPtr SubAppsServiceListResultEntry::Clone() const {
  return New(
      mojo::Clone(manifest_id),
      mojo::Clone(app_name)
  );
}

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

template <typename T, SubAppsServiceListResultEntry::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.manifest_id < rhs.manifest_id)
    return true;
  if (rhs.manifest_id < lhs.manifest_id)
    return false;
  if (lhs.app_name < rhs.app_name)
    return true;
  if (rhs.app_name < lhs.app_name)
    return false;
  return false;
}
template <typename StructPtrType>
SubAppsServiceRemoveResultPtr SubAppsServiceRemoveResult::Clone() const {
  return New(
      mojo::Clone(manifest_id),
      mojo::Clone(result_type)
  );
}

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

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


}  // blink::mojom

namespace mojo {


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

  static const decltype(::blink::mojom::SubAppsServiceAddResult::install_path)& install_path(
      const ::blink::mojom::SubAppsServiceAddResultPtr& input) {
    return input->install_path;
  }

  static const decltype(::blink::mojom::SubAppsServiceAddResult::manifest_id)& manifest_id(
      const ::blink::mojom::SubAppsServiceAddResultPtr& input) {
    return input->manifest_id;
  }

  static decltype(::blink::mojom::SubAppsServiceAddResult::result_type) result_type(
      const ::blink::mojom::SubAppsServiceAddResultPtr& input) {
    return input->result_type;
  }

  static bool Read(::blink::mojom::SubAppsServiceAddResult::DataView input, ::blink::mojom::SubAppsServiceAddResultPtr* output);
};


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

  static const decltype(::blink::mojom::SubAppsServiceListResultEntry::manifest_id)& manifest_id(
      const ::blink::mojom::SubAppsServiceListResultEntryPtr& input) {
    return input->manifest_id;
  }

  static const decltype(::blink::mojom::SubAppsServiceListResultEntry::app_name)& app_name(
      const ::blink::mojom::SubAppsServiceListResultEntryPtr& input) {
    return input->app_name;
  }

  static bool Read(::blink::mojom::SubAppsServiceListResultEntry::DataView input, ::blink::mojom::SubAppsServiceListResultEntryPtr* output);
};


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

  static const decltype(::blink::mojom::SubAppsServiceRemoveResult::manifest_id)& manifest_id(
      const ::blink::mojom::SubAppsServiceRemoveResultPtr& input) {
    return input->manifest_id;
  }

  static decltype(::blink::mojom::SubAppsServiceRemoveResult::result_type) result_type(
      const ::blink::mojom::SubAppsServiceRemoveResultPtr& input) {
    return input->result_type;
  }

  static bool Read(::blink::mojom::SubAppsServiceRemoveResult::DataView input, ::blink::mojom::SubAppsServiceRemoveResultPtr* output);
};


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

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

  static const std::vector<::blink::mojom::SubAppsServiceAddResultPtr>& success(const ::blink::mojom::SubAppsService_Add_ResponseParam_ResultPtr& input) {
    return input->get_success();
  }

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

  static bool Read(::blink::mojom::SubAppsService_Add_ResponseParam_Result::DataView input, ::blink::mojom::SubAppsService_Add_ResponseParam_ResultPtr* output);
};


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

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

  static const std::vector<::blink::mojom::SubAppsServiceListResultEntryPtr>& success(const ::blink::mojom::SubAppsService_List_ResponseParam_ResultPtr& input) {
    return input->get_success();
  }

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

  static bool Read(::blink::mojom::SubAppsService_List_ResponseParam_Result::DataView input, ::blink::mojom::SubAppsService_List_ResponseParam_ResultPtr* output);
};


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

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

  static const std::vector<::blink::mojom::SubAppsServiceRemoveResultPtr>& success(const ::blink::mojom::SubAppsService_Remove_ResponseParam_ResultPtr& input) {
    return input->get_success();
  }

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

  static bool Read(::blink::mojom::SubAppsService_Remove_ResponseParam_Result::DataView input, ::blink::mojom::SubAppsService_Remove_ResponseParam_ResultPtr* output);
};

}  // namespace mojo

#endif  // THIRD_PARTY_BLINK_PUBLIC_MOJOM_SUBAPPS_SUB_APPS_SERVICE_MOJOM_H_