// components/skills/public/skill.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 COMPONENTS_SKILLS_PUBLIC_SKILL_MOJOM_H_
#define COMPONENTS_SKILLS_PUBLIC_SKILL_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 "components/skills/public/skill.mojom-features.h"  // IWYU pragma: export
#include "components/skills/public/skill.mojom-shared.h"  // IWYU pragma: export
#include "components/skills/public/skill.mojom-forward.h"  // IWYU pragma: export
#include "mojo/public/mojom/base/time.mojom.h"
#include "url/mojom/url.mojom.h"
#include <string>
#include <vector>




#include "components/skills/public/skills_mojom_traits.h"




namespace skills::mojom {






class  TopicInfo {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<TopicInfo, T>::value>;
  using DataView = TopicInfoDataView;
  using Data_ = internal::TopicInfo_Data;

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

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

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


  TopicInfo();

  TopicInfo(
      const std::string& category_name,
      const std::string& display_name);


  ~TopicInfo();

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

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

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

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

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

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

  
  std::string category_name;
  
  std::string display_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, TopicInfo::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

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

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

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







class  Skill {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<Skill, T>::value>;
  using DataView = SkillDataView;
  using Data_ = internal::Skill_Data;

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

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

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


  Skill();

  Skill(
      const std::string& id,
      const std::optional<std::string>& source_skill_id,
      const std::string& name,
      const std::string& icon,
      const std::string& prompt,
      SkillSource source,
      const std::string& description,
      const std::optional<std::string>& curated_by,
      const std::optional<::GURL>& image_url,
      ::base::Time creation_time,
      ::base::Time last_update_time,
      const std::optional<std::string>& category);


  ~Skill();

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

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

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

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

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

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

  
  std::string id;
  
  std::optional<std::string> source_skill_id;
  
  std::string name;
  
  std::string icon;
  
  std::string prompt;
  
  SkillSource source;
  
  std::string description;
  
  std::optional<std::string> curated_by;
  
  std::optional<::GURL> image_url;
  
  ::base::Time creation_time;
  
  ::base::Time last_update_time;
  
  std::optional<std::string> category;

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

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

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

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


template <typename StructPtrType>
SkillPtr Skill::Clone() const {
  return New(
      mojo::Clone(id),
      mojo::Clone(source_skill_id),
      mojo::Clone(name),
      mojo::Clone(icon),
      mojo::Clone(prompt),
      mojo::Clone(source),
      mojo::Clone(description),
      mojo::Clone(curated_by),
      mojo::Clone(image_url),
      mojo::Clone(creation_time),
      mojo::Clone(last_update_time),
      mojo::Clone(category)
  );
}

template <typename T, Skill::EnableIfSame<T>*>
bool Skill::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->id, other_struct.id))
    return false;
  if (!mojo::Equals(this->source_skill_id, other_struct.source_skill_id))
    return false;
  if (!mojo::Equals(this->name, other_struct.name))
    return false;
  if (!mojo::Equals(this->icon, other_struct.icon))
    return false;
  if (!mojo::Equals(this->prompt, other_struct.prompt))
    return false;
  if (!mojo::Equals(this->source, other_struct.source))
    return false;
  if (!mojo::Equals(this->description, other_struct.description))
    return false;
  if (!mojo::Equals(this->curated_by, other_struct.curated_by))
    return false;
  if (!mojo::Equals(this->image_url, other_struct.image_url))
    return false;
  if (!mojo::Equals(this->creation_time, other_struct.creation_time))
    return false;
  if (!mojo::Equals(this->last_update_time, other_struct.last_update_time))
    return false;
  if (!mojo::Equals(this->category, other_struct.category))
    return false;
  return true;
}

template <typename T, Skill::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.source_skill_id < rhs.source_skill_id)
    return true;
  if (rhs.source_skill_id < lhs.source_skill_id)
    return false;
  if (lhs.name < rhs.name)
    return true;
  if (rhs.name < lhs.name)
    return false;
  if (lhs.icon < rhs.icon)
    return true;
  if (rhs.icon < lhs.icon)
    return false;
  if (lhs.prompt < rhs.prompt)
    return true;
  if (rhs.prompt < lhs.prompt)
    return false;
  if (lhs.source < rhs.source)
    return true;
  if (rhs.source < lhs.source)
    return false;
  if (lhs.description < rhs.description)
    return true;
  if (rhs.description < lhs.description)
    return false;
  if (lhs.curated_by < rhs.curated_by)
    return true;
  if (rhs.curated_by < lhs.curated_by)
    return false;
  if (lhs.image_url < rhs.image_url)
    return true;
  if (rhs.image_url < lhs.image_url)
    return false;
  if (lhs.creation_time < rhs.creation_time)
    return true;
  if (rhs.creation_time < lhs.creation_time)
    return false;
  if (lhs.last_update_time < rhs.last_update_time)
    return true;
  if (rhs.last_update_time < lhs.last_update_time)
    return false;
  if (lhs.category < rhs.category)
    return true;
  if (rhs.category < lhs.category)
    return false;
  return false;
}
template <typename StructPtrType>
TopicInfoPtr TopicInfo::Clone() const {
  return New(
      mojo::Clone(category_name),
      mojo::Clone(display_name)
  );
}

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

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


}  // skills::mojom

namespace mojo {


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

  static const decltype(::skills::mojom::Skill::id)& id(
      const ::skills::mojom::SkillPtr& input) {
    return input->id;
  }

  static const decltype(::skills::mojom::Skill::source_skill_id)& source_skill_id(
      const ::skills::mojom::SkillPtr& input) {
    return input->source_skill_id;
  }

  static const decltype(::skills::mojom::Skill::name)& name(
      const ::skills::mojom::SkillPtr& input) {
    return input->name;
  }

  static const decltype(::skills::mojom::Skill::icon)& icon(
      const ::skills::mojom::SkillPtr& input) {
    return input->icon;
  }

  static const decltype(::skills::mojom::Skill::prompt)& prompt(
      const ::skills::mojom::SkillPtr& input) {
    return input->prompt;
  }

  static decltype(::skills::mojom::Skill::source) source(
      const ::skills::mojom::SkillPtr& input) {
    return input->source;
  }

  static const decltype(::skills::mojom::Skill::description)& description(
      const ::skills::mojom::SkillPtr& input) {
    return input->description;
  }

  static const decltype(::skills::mojom::Skill::curated_by)& curated_by(
      const ::skills::mojom::SkillPtr& input) {
    return input->curated_by;
  }

  static const decltype(::skills::mojom::Skill::image_url)& image_url(
      const ::skills::mojom::SkillPtr& input) {
    return input->image_url;
  }

  static const decltype(::skills::mojom::Skill::creation_time)& creation_time(
      const ::skills::mojom::SkillPtr& input) {
    return input->creation_time;
  }

  static const decltype(::skills::mojom::Skill::last_update_time)& last_update_time(
      const ::skills::mojom::SkillPtr& input) {
    return input->last_update_time;
  }

  static const decltype(::skills::mojom::Skill::category)& category(
      const ::skills::mojom::SkillPtr& input) {
    return input->category;
  }

  static bool Read(::skills::mojom::Skill::DataView input, ::skills::mojom::SkillPtr* output);
};


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

  static const decltype(::skills::mojom::TopicInfo::category_name)& category_name(
      const ::skills::mojom::TopicInfoPtr& input) {
    return input->category_name;
  }

  static const decltype(::skills::mojom::TopicInfo::display_name)& display_name(
      const ::skills::mojom::TopicInfoPtr& input) {
    return input->display_name;
  }

  static bool Read(::skills::mojom::TopicInfo::DataView input, ::skills::mojom::TopicInfoPtr* output);
};

}  // namespace mojo

#endif  // COMPONENTS_SKILLS_PUBLIC_SKILL_MOJOM_H_