// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.

#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_OBSERVABLE_EVENTS_PROTO_H_
#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_OBSERVABLE_EVENTS_PROTO_H_

#include <stddef.h>
#include <stdint.h>

#include "perfetto/protozero/field_writer.h"
#include "perfetto/protozero/message.h"
#include "perfetto/protozero/packed_repeated_fields.h"
#include "perfetto/protozero/proto_decoder.h"
#include "perfetto/protozero/proto_utils.h"

namespace perfetto {
namespace protos {
namespace pbzero {
class ObservableEvents_CloneTriggerHit;
class ObservableEvents_DataSourceInstanceStateChange;
namespace perfetto_pbzero_enum_ObservableEvents {
enum DataSourceInstanceState : int32_t;
}  // namespace perfetto_pbzero_enum_ObservableEvents
using ObservableEvents_DataSourceInstanceState = perfetto_pbzero_enum_ObservableEvents::DataSourceInstanceState;
} // Namespace pbzero.
} // Namespace protos.
} // Namespace perfetto.

namespace perfetto {
namespace protos {
namespace pbzero {

namespace perfetto_pbzero_enum_ObservableEvents {
enum Type : int32_t {
  TYPE_UNSPECIFIED = 0,
  TYPE_DATA_SOURCES_INSTANCES = 1,
  TYPE_ALL_DATA_SOURCES_STARTED = 2,
  TYPE_CLONE_TRIGGER_HIT = 4,
};
} // namespace perfetto_pbzero_enum_ObservableEvents
using ObservableEvents_Type = perfetto_pbzero_enum_ObservableEvents::Type;


constexpr ObservableEvents_Type ObservableEvents_Type_MIN = ObservableEvents_Type::TYPE_UNSPECIFIED;
constexpr ObservableEvents_Type ObservableEvents_Type_MAX = ObservableEvents_Type::TYPE_CLONE_TRIGGER_HIT;


PERFETTO_PROTOZERO_CONSTEXPR14_OR_INLINE
const char* ObservableEvents_Type_Name(::perfetto::protos::pbzero::ObservableEvents_Type value) {
  switch (value) {
  case ::perfetto::protos::pbzero::ObservableEvents_Type::TYPE_UNSPECIFIED:
    return "TYPE_UNSPECIFIED";

  case ::perfetto::protos::pbzero::ObservableEvents_Type::TYPE_DATA_SOURCES_INSTANCES:
    return "TYPE_DATA_SOURCES_INSTANCES";

  case ::perfetto::protos::pbzero::ObservableEvents_Type::TYPE_ALL_DATA_SOURCES_STARTED:
    return "TYPE_ALL_DATA_SOURCES_STARTED";

  case ::perfetto::protos::pbzero::ObservableEvents_Type::TYPE_CLONE_TRIGGER_HIT:
    return "TYPE_CLONE_TRIGGER_HIT";
  }
  return "PBZERO_UNKNOWN_ENUM_VALUE";
}

namespace perfetto_pbzero_enum_ObservableEvents {
enum DataSourceInstanceState : int32_t {
  DATA_SOURCE_INSTANCE_STATE_STOPPED = 1,
  DATA_SOURCE_INSTANCE_STATE_STARTED = 2,
};
} // namespace perfetto_pbzero_enum_ObservableEvents
using ObservableEvents_DataSourceInstanceState = perfetto_pbzero_enum_ObservableEvents::DataSourceInstanceState;


constexpr ObservableEvents_DataSourceInstanceState ObservableEvents_DataSourceInstanceState_MIN = ObservableEvents_DataSourceInstanceState::DATA_SOURCE_INSTANCE_STATE_STOPPED;
constexpr ObservableEvents_DataSourceInstanceState ObservableEvents_DataSourceInstanceState_MAX = ObservableEvents_DataSourceInstanceState::DATA_SOURCE_INSTANCE_STATE_STARTED;


PERFETTO_PROTOZERO_CONSTEXPR14_OR_INLINE
const char* ObservableEvents_DataSourceInstanceState_Name(::perfetto::protos::pbzero::ObservableEvents_DataSourceInstanceState value) {
  switch (value) {
  case ::perfetto::protos::pbzero::ObservableEvents_DataSourceInstanceState::DATA_SOURCE_INSTANCE_STATE_STOPPED:
    return "DATA_SOURCE_INSTANCE_STATE_STOPPED";

  case ::perfetto::protos::pbzero::ObservableEvents_DataSourceInstanceState::DATA_SOURCE_INSTANCE_STATE_STARTED:
    return "DATA_SOURCE_INSTANCE_STATE_STARTED";
  }
  return "PBZERO_UNKNOWN_ENUM_VALUE";
}

class ObservableEvents_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
 public:
  ObservableEvents_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
  explicit ObservableEvents_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
  explicit ObservableEvents_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
  bool has_instance_state_changes() const { return at<1>().valid(); }
  ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> instance_state_changes() const { return GetRepeated<::protozero::ConstBytes>(1); }
  bool has_all_data_sources_started() const { return at<2>().valid(); }
  bool all_data_sources_started() const { return at<2>().as_bool(); }
  bool has_clone_trigger_hit() const { return at<3>().valid(); }
  ::protozero::ConstBytes clone_trigger_hit() const { return at<3>().as_bytes(); }
};

class ObservableEvents : public ::protozero::Message {
 public:
  using Decoder = ObservableEvents_Decoder;
  enum : int32_t {
    kInstanceStateChangesFieldNumber = 1,
    kAllDataSourcesStartedFieldNumber = 2,
    kCloneTriggerHitFieldNumber = 3,
  };
  static constexpr const char* GetName() { return ".perfetto.protos.ObservableEvents"; }

  using DataSourceInstanceStateChange = ::perfetto::protos::pbzero::ObservableEvents_DataSourceInstanceStateChange;
  using CloneTriggerHit = ::perfetto::protos::pbzero::ObservableEvents_CloneTriggerHit;

  using Type = ::perfetto::protos::pbzero::ObservableEvents_Type;
  static inline const char* Type_Name(Type value) {
    return ::perfetto::protos::pbzero::ObservableEvents_Type_Name(value);
  }

  using DataSourceInstanceState = ::perfetto::protos::pbzero::ObservableEvents_DataSourceInstanceState;
  static inline const char* DataSourceInstanceState_Name(DataSourceInstanceState value) {
    return ::perfetto::protos::pbzero::ObservableEvents_DataSourceInstanceState_Name(value);
  }
  static inline const Type TYPE_UNSPECIFIED = Type::TYPE_UNSPECIFIED;
  static inline const Type TYPE_DATA_SOURCES_INSTANCES = Type::TYPE_DATA_SOURCES_INSTANCES;
  static inline const Type TYPE_ALL_DATA_SOURCES_STARTED = Type::TYPE_ALL_DATA_SOURCES_STARTED;
  static inline const Type TYPE_CLONE_TRIGGER_HIT = Type::TYPE_CLONE_TRIGGER_HIT;
  static inline const DataSourceInstanceState DATA_SOURCE_INSTANCE_STATE_STOPPED = DataSourceInstanceState::DATA_SOURCE_INSTANCE_STATE_STOPPED;
  static inline const DataSourceInstanceState DATA_SOURCE_INSTANCE_STATE_STARTED = DataSourceInstanceState::DATA_SOURCE_INSTANCE_STATE_STARTED;

  using FieldMetadata_InstanceStateChanges =
    ::protozero::proto_utils::FieldMetadata<
      1,
      ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
      ::protozero::proto_utils::ProtoSchemaType::kMessage,
      ObservableEvents_DataSourceInstanceStateChange,
      ObservableEvents>;

  static constexpr FieldMetadata_InstanceStateChanges kInstanceStateChanges{};
  template <typename T = ObservableEvents_DataSourceInstanceStateChange> T* add_instance_state_changes() {
    return BeginNestedMessage<T>(1);
  }


  using FieldMetadata_AllDataSourcesStarted =
    ::protozero::proto_utils::FieldMetadata<
      2,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kBool,
      bool,
      ObservableEvents>;

  static constexpr FieldMetadata_AllDataSourcesStarted kAllDataSourcesStarted{};
  void set_all_data_sources_started(bool value) {
    static constexpr uint32_t field_id = FieldMetadata_AllDataSourcesStarted::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kBool>
        ::Append(*this, field_id, value);
  }

  using FieldMetadata_CloneTriggerHit =
    ::protozero::proto_utils::FieldMetadata<
      3,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kMessage,
      ObservableEvents_CloneTriggerHit,
      ObservableEvents>;

  static constexpr FieldMetadata_CloneTriggerHit kCloneTriggerHit{};
  template <typename T = ObservableEvents_CloneTriggerHit> T* set_clone_trigger_hit() {
    return BeginNestedMessage<T>(3);
  }

};

class ObservableEvents_CloneTriggerHit_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
 public:
  ObservableEvents_CloneTriggerHit_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
  explicit ObservableEvents_CloneTriggerHit_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
  explicit ObservableEvents_CloneTriggerHit_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
  bool has_tracing_session_id() const { return at<1>().valid(); }
  int64_t tracing_session_id() const { return at<1>().as_int64(); }
  bool has_trigger_name() const { return at<2>().valid(); }
  ::protozero::ConstChars trigger_name() const { return at<2>().as_string(); }
  bool has_producer_name() const { return at<3>().valid(); }
  ::protozero::ConstChars producer_name() const { return at<3>().as_string(); }
  bool has_producer_uid() const { return at<4>().valid(); }
  uint32_t producer_uid() const { return at<4>().as_uint32(); }
  bool has_boot_time_ns() const { return at<5>().valid(); }
  uint64_t boot_time_ns() const { return at<5>().as_uint64(); }
  bool has_trigger_delay_ms() const { return at<6>().valid(); }
  uint64_t trigger_delay_ms() const { return at<6>().as_uint64(); }
};

class ObservableEvents_CloneTriggerHit : public ::protozero::Message {
 public:
  using Decoder = ObservableEvents_CloneTriggerHit_Decoder;
  enum : int32_t {
    kTracingSessionIdFieldNumber = 1,
    kTriggerNameFieldNumber = 2,
    kProducerNameFieldNumber = 3,
    kProducerUidFieldNumber = 4,
    kBootTimeNsFieldNumber = 5,
    kTriggerDelayMsFieldNumber = 6,
  };
  static constexpr const char* GetName() { return ".perfetto.protos.ObservableEvents.CloneTriggerHit"; }


  using FieldMetadata_TracingSessionId =
    ::protozero::proto_utils::FieldMetadata<
      1,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kInt64,
      int64_t,
      ObservableEvents_CloneTriggerHit>;

  static constexpr FieldMetadata_TracingSessionId kTracingSessionId{};
  void set_tracing_session_id(int64_t value) {
    static constexpr uint32_t field_id = FieldMetadata_TracingSessionId::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kInt64>
        ::Append(*this, field_id, value);
  }

  using FieldMetadata_TriggerName =
    ::protozero::proto_utils::FieldMetadata<
      2,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kString,
      std::string,
      ObservableEvents_CloneTriggerHit>;

  static constexpr FieldMetadata_TriggerName kTriggerName{};
  void set_trigger_name(const char* data, size_t size) {
    AppendBytes(FieldMetadata_TriggerName::kFieldId, data, size);
  }
  void set_trigger_name(::protozero::ConstChars chars) {
    AppendBytes(FieldMetadata_TriggerName::kFieldId, chars.data, chars.size);
  }
  void set_trigger_name(std::string value) {
    static constexpr uint32_t field_id = FieldMetadata_TriggerName::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kString>
        ::Append(*this, field_id, value);
  }

  using FieldMetadata_ProducerName =
    ::protozero::proto_utils::FieldMetadata<
      3,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kString,
      std::string,
      ObservableEvents_CloneTriggerHit>;

  static constexpr FieldMetadata_ProducerName kProducerName{};
  void set_producer_name(const char* data, size_t size) {
    AppendBytes(FieldMetadata_ProducerName::kFieldId, data, size);
  }
  void set_producer_name(::protozero::ConstChars chars) {
    AppendBytes(FieldMetadata_ProducerName::kFieldId, chars.data, chars.size);
  }
  void set_producer_name(std::string value) {
    static constexpr uint32_t field_id = FieldMetadata_ProducerName::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kString>
        ::Append(*this, field_id, value);
  }

  using FieldMetadata_ProducerUid =
    ::protozero::proto_utils::FieldMetadata<
      4,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kUint32,
      uint32_t,
      ObservableEvents_CloneTriggerHit>;

  static constexpr FieldMetadata_ProducerUid kProducerUid{};
  void set_producer_uid(uint32_t value) {
    static constexpr uint32_t field_id = FieldMetadata_ProducerUid::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kUint32>
        ::Append(*this, field_id, value);
  }

  using FieldMetadata_BootTimeNs =
    ::protozero::proto_utils::FieldMetadata<
      5,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kUint64,
      uint64_t,
      ObservableEvents_CloneTriggerHit>;

  static constexpr FieldMetadata_BootTimeNs kBootTimeNs{};
  void set_boot_time_ns(uint64_t value) {
    static constexpr uint32_t field_id = FieldMetadata_BootTimeNs::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kUint64>
        ::Append(*this, field_id, value);
  }

  using FieldMetadata_TriggerDelayMs =
    ::protozero::proto_utils::FieldMetadata<
      6,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kUint64,
      uint64_t,
      ObservableEvents_CloneTriggerHit>;

  static constexpr FieldMetadata_TriggerDelayMs kTriggerDelayMs{};
  void set_trigger_delay_ms(uint64_t value) {
    static constexpr uint32_t field_id = FieldMetadata_TriggerDelayMs::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kUint64>
        ::Append(*this, field_id, value);
  }
};

class ObservableEvents_DataSourceInstanceStateChange_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
 public:
  ObservableEvents_DataSourceInstanceStateChange_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
  explicit ObservableEvents_DataSourceInstanceStateChange_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
  explicit ObservableEvents_DataSourceInstanceStateChange_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
  bool has_producer_name() const { return at<1>().valid(); }
  ::protozero::ConstChars producer_name() const { return at<1>().as_string(); }
  bool has_data_source_name() const { return at<2>().valid(); }
  ::protozero::ConstChars data_source_name() const { return at<2>().as_string(); }
  bool has_state() const { return at<3>().valid(); }
  int32_t state() const { return at<3>().as_int32(); }
};

class ObservableEvents_DataSourceInstanceStateChange : public ::protozero::Message {
 public:
  using Decoder = ObservableEvents_DataSourceInstanceStateChange_Decoder;
  enum : int32_t {
    kProducerNameFieldNumber = 1,
    kDataSourceNameFieldNumber = 2,
    kStateFieldNumber = 3,
  };
  static constexpr const char* GetName() { return ".perfetto.protos.ObservableEvents.DataSourceInstanceStateChange"; }


  using FieldMetadata_ProducerName =
    ::protozero::proto_utils::FieldMetadata<
      1,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kString,
      std::string,
      ObservableEvents_DataSourceInstanceStateChange>;

  static constexpr FieldMetadata_ProducerName kProducerName{};
  void set_producer_name(const char* data, size_t size) {
    AppendBytes(FieldMetadata_ProducerName::kFieldId, data, size);
  }
  void set_producer_name(::protozero::ConstChars chars) {
    AppendBytes(FieldMetadata_ProducerName::kFieldId, chars.data, chars.size);
  }
  void set_producer_name(std::string value) {
    static constexpr uint32_t field_id = FieldMetadata_ProducerName::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kString>
        ::Append(*this, field_id, value);
  }

  using FieldMetadata_DataSourceName =
    ::protozero::proto_utils::FieldMetadata<
      2,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kString,
      std::string,
      ObservableEvents_DataSourceInstanceStateChange>;

  static constexpr FieldMetadata_DataSourceName kDataSourceName{};
  void set_data_source_name(const char* data, size_t size) {
    AppendBytes(FieldMetadata_DataSourceName::kFieldId, data, size);
  }
  void set_data_source_name(::protozero::ConstChars chars) {
    AppendBytes(FieldMetadata_DataSourceName::kFieldId, chars.data, chars.size);
  }
  void set_data_source_name(std::string value) {
    static constexpr uint32_t field_id = FieldMetadata_DataSourceName::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kString>
        ::Append(*this, field_id, value);
  }

  using FieldMetadata_State =
    ::protozero::proto_utils::FieldMetadata<
      3,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kEnum,
      ObservableEvents_DataSourceInstanceState,
      ObservableEvents_DataSourceInstanceStateChange>;

  static constexpr FieldMetadata_State kState{};
  void set_state(ObservableEvents_DataSourceInstanceState value) {
    static constexpr uint32_t field_id = FieldMetadata_State::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kEnum>
        ::Append(*this, field_id, value);
  }
};

} // Namespace.
} // Namespace.
} // Namespace.
#endif  // Include guard.
