// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: printer_event.proto

#include "printer_event.pb.h"

#include <algorithm>

#include <google/protobuf/stubs/common.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
namespace metrics {
class PrinterEventProtoDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<PrinterEventProto> _instance;
} _PrinterEventProto_default_instance_;
}  // namespace metrics
static void InitDefaultsscc_info_PrinterEventProto_printer_5fevent_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::metrics::_PrinterEventProto_default_instance_;
    new (ptr) ::metrics::PrinterEventProto();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::metrics::PrinterEventProto::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PrinterEventProto_printer_5fevent_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_PrinterEventProto_printer_5fevent_2eproto}, {}};

namespace metrics {
bool PrinterEventProto_EventType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
    case 3:
    case 4:
      return true;
    default:
      return false;
  }
}

static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> PrinterEventProto_EventType_strings[5] = {};

static const char PrinterEventProto_EventType_names[] =
  "PRINTER_DELETED"
  "SETUP_ABANDONED"
  "SETUP_AUTOMATIC"
  "SETUP_MANUAL"
  "UNKNOWN";

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry PrinterEventProto_EventType_entries[] = {
  { {PrinterEventProto_EventType_names + 0, 15}, 4 },
  { {PrinterEventProto_EventType_names + 15, 15}, 3 },
  { {PrinterEventProto_EventType_names + 30, 15}, 1 },
  { {PrinterEventProto_EventType_names + 45, 12}, 2 },
  { {PrinterEventProto_EventType_names + 57, 7}, 0 },
};

static const int PrinterEventProto_EventType_entries_by_number[] = {
  4, // 0 -> UNKNOWN
  2, // 1 -> SETUP_AUTOMATIC
  3, // 2 -> SETUP_MANUAL
  1, // 3 -> SETUP_ABANDONED
  0, // 4 -> PRINTER_DELETED
};

const std::string& PrinterEventProto_EventType_Name(
    PrinterEventProto_EventType value) {
  static const bool dummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          PrinterEventProto_EventType_entries,
          PrinterEventProto_EventType_entries_by_number,
          5, PrinterEventProto_EventType_strings);
  (void) dummy;
  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      PrinterEventProto_EventType_entries,
      PrinterEventProto_EventType_entries_by_number,
      5, value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
                     PrinterEventProto_EventType_strings[idx].get();
}
bool PrinterEventProto_EventType_Parse(
    const std::string& name, PrinterEventProto_EventType* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      PrinterEventProto_EventType_entries, 5, name, &int_value);
  if (success) {
    *value = static_cast<PrinterEventProto_EventType>(int_value);
  }
  return success;
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
constexpr PrinterEventProto_EventType PrinterEventProto::UNKNOWN;
constexpr PrinterEventProto_EventType PrinterEventProto::SETUP_AUTOMATIC;
constexpr PrinterEventProto_EventType PrinterEventProto::SETUP_MANUAL;
constexpr PrinterEventProto_EventType PrinterEventProto::SETUP_ABANDONED;
constexpr PrinterEventProto_EventType PrinterEventProto::PRINTER_DELETED;
constexpr PrinterEventProto_EventType PrinterEventProto::EventType_MIN;
constexpr PrinterEventProto_EventType PrinterEventProto::EventType_MAX;
constexpr int PrinterEventProto::EventType_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)

// ===================================================================

void PrinterEventProto::InitAsDefaultInstance() {
}
class PrinterEventProto::_Internal {
 public:
  using HasBits = decltype(std::declval<PrinterEventProto>()._has_bits_);
  static void set_has_usb_printer_manufacturer(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_usb_printer_model(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_usb_vendor_id(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_usb_model_id(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_ipp_make_and_model(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_user_ppd(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static void set_has_ppd_identifier(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_event_type(HasBits* has_bits) {
    (*has_bits)[0] |= 128u;
  }
};

PrinterEventProto::PrinterEventProto()
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:metrics.PrinterEventProto)
}
PrinterEventProto::PrinterEventProto(const PrinterEventProto& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _internal_metadata_(nullptr),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  usb_printer_manufacturer_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_usb_printer_manufacturer()) {
    usb_printer_manufacturer_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.usb_printer_manufacturer_);
  }
  usb_printer_model_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_usb_printer_model()) {
    usb_printer_model_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.usb_printer_model_);
  }
  ipp_make_and_model_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_ipp_make_and_model()) {
    ipp_make_and_model_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.ipp_make_and_model_);
  }
  ppd_identifier_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_ppd_identifier()) {
    ppd_identifier_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.ppd_identifier_);
  }
  ::memcpy(&usb_vendor_id_, &from.usb_vendor_id_,
    static_cast<size_t>(reinterpret_cast<char*>(&event_type_) -
    reinterpret_cast<char*>(&usb_vendor_id_)) + sizeof(event_type_));
  // @@protoc_insertion_point(copy_constructor:metrics.PrinterEventProto)
}

void PrinterEventProto::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_PrinterEventProto_printer_5fevent_2eproto.base);
  usb_printer_manufacturer_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  usb_printer_model_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  ipp_make_and_model_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  ppd_identifier_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  ::memset(&usb_vendor_id_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&event_type_) -
      reinterpret_cast<char*>(&usb_vendor_id_)) + sizeof(event_type_));
}

PrinterEventProto::~PrinterEventProto() {
  // @@protoc_insertion_point(destructor:metrics.PrinterEventProto)
  SharedDtor();
}

void PrinterEventProto::SharedDtor() {
  usb_printer_manufacturer_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  usb_printer_model_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  ipp_make_and_model_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  ppd_identifier_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void PrinterEventProto::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const PrinterEventProto& PrinterEventProto::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PrinterEventProto_printer_5fevent_2eproto.base);
  return *internal_default_instance();
}


void PrinterEventProto::Clear() {
// @@protoc_insertion_point(message_clear_start:metrics.PrinterEventProto)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      usb_printer_manufacturer_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000002u) {
      usb_printer_model_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000004u) {
      ipp_make_and_model_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000008u) {
      ppd_identifier_.ClearNonDefaultToEmptyNoArena();
    }
  }
  if (cached_has_bits & 0x000000f0u) {
    ::memset(&usb_vendor_id_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&event_type_) -
        reinterpret_cast<char*>(&usb_vendor_id_)) + sizeof(event_type_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* PrinterEventProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // optional string usb_printer_manufacturer = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_usb_printer_manufacturer(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional string usb_printer_model = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_usb_printer_model(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional int32 usb_vendor_id = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
          _Internal::set_has_usb_vendor_id(&has_bits);
          usb_vendor_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional int32 usb_model_id = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
          _Internal::set_has_usb_model_id(&has_bits);
          usb_model_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional string ipp_make_and_model = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_ipp_make_and_model(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional bool user_ppd = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
          _Internal::set_has_user_ppd(&has_bits);
          user_ppd_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional string ppd_identifier = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_ppd_identifier(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional .metrics.PrinterEventProto.EventType event_type = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) {
          ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::metrics::PrinterEventProto_EventType_IsValid(val))) {
            set_event_type(static_cast<::metrics::PrinterEventProto_EventType>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(8, val, mutable_unknown_fields());
          }
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}
#else  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
bool PrinterEventProto::MergePartialFromCodedStream(
    ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  ::PROTOBUF_NAMESPACE_ID::internal::LiteUnknownFieldSetter unknown_fields_setter(
      &_internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::io::StringOutputStream unknown_fields_output(
      unknown_fields_setter.buffer());
  ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream unknown_fields_stream(
      &unknown_fields_output, false);
  // @@protoc_insertion_point(parse_start:metrics.PrinterEventProto)
  for (;;) {
    ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional string usb_printer_manufacturer = 1;
      case 1: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
                input, this->mutable_usb_printer_manufacturer()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string usb_printer_model = 2;
      case 2: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
                input, this->mutable_usb_printer_model()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int32 usb_vendor_id = 3;
      case 3: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
          _Internal::set_has_usb_vendor_id(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
                 input, &usb_vendor_id_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int32 usb_model_id = 4;
      case 4: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) {
          _Internal::set_has_usb_model_id(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
                 input, &usb_model_id_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string ipp_make_and_model = 5;
      case 5: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
                input, this->mutable_ipp_make_and_model()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bool user_ppd = 6;
      case 6: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (48 & 0xFF)) {
          _Internal::set_has_user_ppd(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
                 input, &user_ppd_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string ppd_identifier = 7;
      case 7: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (58 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
                input, this->mutable_ppd_identifier()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .metrics.PrinterEventProto.EventType event_type = 8;
      case 8: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (64 & 0xFF)) {
          int value = 0;
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::metrics::PrinterEventProto_EventType_IsValid(value)) {
            set_event_type(static_cast< ::metrics::PrinterEventProto_EventType >(value));
          } else {
            unknown_fields_stream.WriteVarint32(64u);
            unknown_fields_stream.WriteVarint32(
                static_cast<::PROTOBUF_NAMESPACE_ID::uint32>(value));
          }
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SkipField(
            input, tag, &unknown_fields_stream));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:metrics.PrinterEventProto)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:metrics.PrinterEventProto)
  return false;
#undef DO_
}
#endif  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER

void PrinterEventProto::SerializeWithCachedSizes(
    ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:metrics.PrinterEventProto)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string usb_printer_manufacturer = 1;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->usb_printer_manufacturer(), output);
  }

  // optional string usb_printer_model = 2;
  if (cached_has_bits & 0x00000002u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
      2, this->usb_printer_model(), output);
  }

  // optional int32 usb_vendor_id = 3;
  if (cached_has_bits & 0x00000010u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(3, this->usb_vendor_id(), output);
  }

  // optional int32 usb_model_id = 4;
  if (cached_has_bits & 0x00000020u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(4, this->usb_model_id(), output);
  }

  // optional string ipp_make_and_model = 5;
  if (cached_has_bits & 0x00000004u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
      5, this->ipp_make_and_model(), output);
  }

  // optional bool user_ppd = 6;
  if (cached_has_bits & 0x00000040u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(6, this->user_ppd(), output);
  }

  // optional string ppd_identifier = 7;
  if (cached_has_bits & 0x00000008u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
      7, this->ppd_identifier(), output);
  }

  // optional .metrics.PrinterEventProto.EventType event_type = 8;
  if (cached_has_bits & 0x00000080u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
      8, this->event_type(), output);
  }

  output->WriteRaw(_internal_metadata_.unknown_fields().data(),
                   static_cast<int>(_internal_metadata_.unknown_fields().size()));
  // @@protoc_insertion_point(serialize_end:metrics.PrinterEventProto)
}

size_t PrinterEventProto::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:metrics.PrinterEventProto)
  size_t total_size = 0;

  total_size += _internal_metadata_.unknown_fields().size();

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    // optional string usb_printer_manufacturer = 1;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->usb_printer_manufacturer());
    }

    // optional string usb_printer_model = 2;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->usb_printer_model());
    }

    // optional string ipp_make_and_model = 5;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->ipp_make_and_model());
    }

    // optional string ppd_identifier = 7;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->ppd_identifier());
    }

    // optional int32 usb_vendor_id = 3;
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
          this->usb_vendor_id());
    }

    // optional int32 usb_model_id = 4;
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
          this->usb_model_id());
    }

    // optional bool user_ppd = 6;
    if (cached_has_bits & 0x00000040u) {
      total_size += 1 + 1;
    }

    // optional .metrics.PrinterEventProto.EventType event_type = 8;
    if (cached_has_bits & 0x00000080u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->event_type());
    }

  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void PrinterEventProto::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const PrinterEventProto*>(
      &from));
}

void PrinterEventProto::MergeFrom(const PrinterEventProto& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:metrics.PrinterEventProto)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    if (cached_has_bits & 0x00000001u) {
      _has_bits_[0] |= 0x00000001u;
      usb_printer_manufacturer_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.usb_printer_manufacturer_);
    }
    if (cached_has_bits & 0x00000002u) {
      _has_bits_[0] |= 0x00000002u;
      usb_printer_model_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.usb_printer_model_);
    }
    if (cached_has_bits & 0x00000004u) {
      _has_bits_[0] |= 0x00000004u;
      ipp_make_and_model_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.ipp_make_and_model_);
    }
    if (cached_has_bits & 0x00000008u) {
      _has_bits_[0] |= 0x00000008u;
      ppd_identifier_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.ppd_identifier_);
    }
    if (cached_has_bits & 0x00000010u) {
      usb_vendor_id_ = from.usb_vendor_id_;
    }
    if (cached_has_bits & 0x00000020u) {
      usb_model_id_ = from.usb_model_id_;
    }
    if (cached_has_bits & 0x00000040u) {
      user_ppd_ = from.user_ppd_;
    }
    if (cached_has_bits & 0x00000080u) {
      event_type_ = from.event_type_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void PrinterEventProto::CopyFrom(const PrinterEventProto& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:metrics.PrinterEventProto)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool PrinterEventProto::IsInitialized() const {
  return true;
}

void PrinterEventProto::InternalSwap(PrinterEventProto* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  usb_printer_manufacturer_.Swap(&other->usb_printer_manufacturer_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  usb_printer_model_.Swap(&other->usb_printer_model_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  ipp_make_and_model_.Swap(&other->ipp_make_and_model_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  ppd_identifier_.Swap(&other->ppd_identifier_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(usb_vendor_id_, other->usb_vendor_id_);
  swap(usb_model_id_, other->usb_model_id_);
  swap(user_ppd_, other->user_ppd_);
  swap(event_type_, other->event_type_);
}

std::string PrinterEventProto::GetTypeName() const {
  return "metrics.PrinterEventProto";
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace metrics
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::metrics::PrinterEventProto* Arena::CreateMaybeMessage< ::metrics::PrinterEventProto >(Arena* arena) {
  return Arena::CreateInternal< ::metrics::PrinterEventProto >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
