text: // Generated by the protocol buffer compiler.  DO NOT EDIT!
  // source: Departments/DepartmentToUpdate.proto
  
  #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
  #include "Departments/DepartmentToUpdate.pb.h"
  
  #include <algorithm>
  
  #include <google/protobuf/stubs/common.h>
  #include <google/protobuf/stubs/once.h>
  #include <google/protobuf/io/coded_stream.h>
  #include <google/protobuf/wire_format_lite_inl.h>
  #include <google/protobuf/descriptor.h>
  #include <google/protobuf/generated_message_reflection.h>
  #include <google/protobuf/reflection_ops.h>
  #include <google/protobuf/wire_format.h>
  // @@protoc_insertion_point(includes)
  
  namespace Diadoc {
  namespace Api {
  namespace Proto {
  namespace Departments {
  
  namespace {
  
  const ::google::protobuf::Descriptor* DepartmentToUpdate_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    DepartmentToUpdate_reflection_ = NULL;
  const ::google::protobuf::Descriptor* ParentDepartmentPatch_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    ParentDepartmentPatch_reflection_ = NULL;
  const ::google::protobuf::Descriptor* DepartmentNamingPatch_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    DepartmentNamingPatch_reflection_ = NULL;
  const ::google::protobuf::Descriptor* DepartmentKppPatch_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    DepartmentKppPatch_reflection_ = NULL;
  const ::google::protobuf::Descriptor* DepartmentAddressPatch_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    DepartmentAddressPatch_reflection_ = NULL;
  const ::google::protobuf::Descriptor* DepartmentRoutingPatch_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    DepartmentRoutingPatch_reflection_ = NULL;
  
  }  // namespace
  
  
  void protobuf_AssignDesc_Departments_2fDepartmentToUpdate_2eproto() {
    protobuf_AddDesc_Departments_2fDepartmentToUpdate_2eproto();
    const ::google::protobuf::FileDescriptor* file =
      ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
        "Departments/DepartmentToUpdate.proto");
    GOOGLE_CHECK(file != NULL);
    DepartmentToUpdate_descriptor_ = file->message_type(0);
    static const int DepartmentToUpdate_offsets_[5] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentToUpdate, parentdepartment_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentToUpdate, departmentnaming_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentToUpdate, kpp_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentToUpdate, address_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentToUpdate, routing_),
    };
    DepartmentToUpdate_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        DepartmentToUpdate_descriptor_,
        DepartmentToUpdate::default_instance_,
        DepartmentToUpdate_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentToUpdate, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentToUpdate, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(DepartmentToUpdate));
    ParentDepartmentPatch_descriptor_ = file->message_type(1);
    static const int ParentDepartmentPatch_offsets_[1] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParentDepartmentPatch, parentdepartmentid_),
    };
    ParentDepartmentPatch_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        ParentDepartmentPatch_descriptor_,
        ParentDepartmentPatch::default_instance_,
        ParentDepartmentPatch_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParentDepartmentPatch, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParentDepartmentPatch, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(ParentDepartmentPatch));
    DepartmentNamingPatch_descriptor_ = file->message_type(2);
    static const int DepartmentNamingPatch_offsets_[2] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentNamingPatch, name_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentNamingPatch, abbreviation_),
    };
    DepartmentNamingPatch_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        DepartmentNamingPatch_descriptor_,
        DepartmentNamingPatch::default_instance_,
        DepartmentNamingPatch_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentNamingPatch, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentNamingPatch, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(DepartmentNamingPatch));
    DepartmentKppPatch_descriptor_ = file->message_type(3);
    static const int DepartmentKppPatch_offsets_[1] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentKppPatch, kpp_),
    };
    DepartmentKppPatch_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        DepartmentKppPatch_descriptor_,
        DepartmentKppPatch::default_instance_,
        DepartmentKppPatch_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentKppPatch, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentKppPatch, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(DepartmentKppPatch));
    DepartmentAddressPatch_descriptor_ = file->message_type(4);
    static const int DepartmentAddressPatch_offsets_[1] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentAddressPatch, address_),
    };
    DepartmentAddressPatch_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        DepartmentAddressPatch_descriptor_,
        DepartmentAddressPatch::default_instance_,
        DepartmentAddressPatch_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentAddressPatch, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentAddressPatch, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(DepartmentAddressPatch));
    DepartmentRoutingPatch_descriptor_ = file->message_type(5);
    static const int DepartmentRoutingPatch_offsets_[2] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentRoutingPatch, kpp_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentRoutingPatch, address_),
    };
    DepartmentRoutingPatch_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        DepartmentRoutingPatch_descriptor_,
        DepartmentRoutingPatch::default_instance_,
        DepartmentRoutingPatch_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentRoutingPatch, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DepartmentRoutingPatch, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(DepartmentRoutingPatch));
  }
  
  namespace {
  
  GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
  inline void protobuf_AssignDescriptorsOnce() {
    ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
                   &protobuf_AssignDesc_Departments_2fDepartmentToUpdate_2eproto);
  }
  
  void protobuf_RegisterTypes(const ::std::string&) {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      DepartmentToUpdate_descriptor_, &DepartmentToUpdate::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      ParentDepartmentPatch_descriptor_, &ParentDepartmentPatch::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      DepartmentNamingPatch_descriptor_, &DepartmentNamingPatch::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      DepartmentKppPatch_descriptor_, &DepartmentKppPatch::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      DepartmentAddressPatch_descriptor_, &DepartmentAddressPatch::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      DepartmentRoutingPatch_descriptor_, &DepartmentRoutingPatch::default_instance());
  }
  
  }  // namespace
  
  void protobuf_ShutdownFile_Departments_2fDepartmentToUpdate_2eproto() {
    delete DepartmentToUpdate::default_instance_;
    delete DepartmentToUpdate_reflection_;
    delete ParentDepartmentPatch::default_instance_;
    delete ParentDepartmentPatch_reflection_;
    delete DepartmentNamingPatch::default_instance_;
    delete DepartmentNamingPatch_reflection_;
    delete DepartmentKppPatch::default_instance_;
    delete DepartmentKppPatch_reflection_;
    delete DepartmentAddressPatch::default_instance_;
    delete DepartmentAddressPatch_reflection_;
    delete DepartmentRoutingPatch::default_instance_;
    delete DepartmentRoutingPatch_reflection_;
  }
  
  void protobuf_AddDesc_Departments_2fDepartmentToUpdate_2eproto() {
    static bool already_here = false;
    if (already_here) return;
    already_here = true;
    GOOGLE_PROTOBUF_VERIFY_VERSION;
  
    ::Diadoc::Api::Proto::protobuf_AddDesc_Address_2eproto();
    ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
      "\n$Departments/DepartmentToUpdate.proto\022\034"
      "Diadoc.Api.Proto.Departments\032\rAddress.pr"
      "oto\"\377\002\n\022DepartmentToUpdate\022M\n\020ParentDepa"
      "rtment\030\001 \001(\01323.Diadoc.Api.Proto.Departme"
      "nts.ParentDepartmentPatch\022M\n\020DepartmentN"
      "aming\030\002 \001(\01323.Diadoc.Api.Proto.Departmen"
      "ts.DepartmentNamingPatch\022=\n\003Kpp\030\003 \001(\01320."
      "Diadoc.Api.Proto.Departments.DepartmentK"
      "ppPatch\022E\n\007Address\030\004 \001(\01324.Diadoc.Api.Pr"
      "oto.Departments.DepartmentAddressPatch\022E"
      "\n\007Routing\030\005 \001(\01324.Diadoc.Api.Proto.Depar"
      "tments.DepartmentRoutingPatch\"3\n\025ParentD"
      "epartmentPatch\022\032\n\022ParentDepartmentId\030\001 \002"
      "(\t\";\n\025DepartmentNamingPatch\022\014\n\004Name\030\001 \002("
      "\t\022\024\n\014Abbreviation\030\002 \002(\t\"!\n\022DepartmentKpp"
      "Patch\022\013\n\003Kpp\030\001 \001(\t\"D\n\026DepartmentAddressP"
      "atch\022*\n\007Address\030\001 \001(\0132\031.Diadoc.Api.Proto"
      ".Address\"6\n\026DepartmentRoutingPatch\022\013\n\003Kp"
      "p\030\001 \002(\010\022\017\n\007Address\030\002 \002(\010", 744);
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
      "Departments/DepartmentToUpdate.proto", &protobuf_RegisterTypes);
    DepartmentToUpdate::default_instance_ = new DepartmentToUpdate();
    ParentDepartmentPatch::default_instance_ = new ParentDepartmentPatch();
    DepartmentNamingPatch::default_instance_ = new DepartmentNamingPatch();
    DepartmentKppPatch::default_instance_ = new DepartmentKppPatch();
    DepartmentAddressPatch::default_instance_ = new DepartmentAddressPatch();
    DepartmentRoutingPatch::default_instance_ = new DepartmentRoutingPatch();
    DepartmentToUpdate::default_instance_->InitAsDefaultInstance();
    ParentDepartmentPatch::default_instance_->InitAsDefaultInstance();
    DepartmentNamingPatch::default_instance_->InitAsDefaultInstance();
    DepartmentKppPatch::default_instance_->InitAsDefaultInstance();
    DepartmentAddressPatch::default_instance_->InitAsDefaultInstance();
    DepartmentRoutingPatch::default_instance_->InitAsDefaultInstance();
    ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_Departments_2fDepartmentToUpdate_2eproto);
  }
  
  // Force AddDescriptors() to be called at static initialization time.
  struct StaticDescriptorInitializer_Departments_2fDepartmentToUpdate_2eproto {
    StaticDescriptorInitializer_Departments_2fDepartmentToUpdate_2eproto() {
      protobuf_AddDesc_Departments_2fDepartmentToUpdate_2eproto();
    }
  } static_descriptor_initializer_Departments_2fDepartmentToUpdate_2eproto_;
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int DepartmentToUpdate::kParentDepartmentFieldNumber;
  const int DepartmentToUpdate::kDepartmentNamingFieldNumber;
  const int DepartmentToUpdate::kKppFieldNumber;
  const int DepartmentToUpdate::kAddressFieldNumber;
  const int DepartmentToUpdate::kRoutingFieldNumber;
  #endif  // !_MSC_VER
  
  DepartmentToUpdate::DepartmentToUpdate()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:Diadoc.Api.Proto.Departments.DepartmentToUpdate)
  }
  
  void DepartmentToUpdate::InitAsDefaultInstance() {
    parentdepartment_ = const_cast< ::Diadoc::Api::Proto::Departments::ParentDepartmentPatch*>(&::Diadoc::Api::Proto::Departments::ParentDepartmentPatch::default_instance());
    departmentnaming_ = const_cast< ::Diadoc::Api::Proto::Departments::DepartmentNamingPatch*>(&::Diadoc::Api::Proto::Departments::DepartmentNamingPatch::default_instance());
    kpp_ = const_cast< ::Diadoc::Api::Proto::Departments::DepartmentKppPatch*>(&::Diadoc::Api::Proto::Departments::DepartmentKppPatch::default_instance());
    address_ = const_cast< ::Diadoc::Api::Proto::Departments::DepartmentAddressPatch*>(&::Diadoc::Api::Proto::Departments::DepartmentAddressPatch::default_instance());
    routing_ = const_cast< ::Diadoc::Api::Proto::Departments::DepartmentRoutingPatch*>(&::Diadoc::Api::Proto::Departments::DepartmentRoutingPatch::default_instance());
  }
  
  DepartmentToUpdate::DepartmentToUpdate(const DepartmentToUpdate& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:Diadoc.Api.Proto.Departments.DepartmentToUpdate)
  }
  
  void DepartmentToUpdate::SharedCtor() {
    _cached_size_ = 0;
    parentdepartment_ = NULL;
    departmentnaming_ = NULL;
    kpp_ = NULL;
    address_ = NULL;
    routing_ = NULL;
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  DepartmentToUpdate::~DepartmentToUpdate() {
    // @@protoc_insertion_point(destructor:Diadoc.Api.Proto.Departments.DepartmentToUpdate)
    SharedDtor();
  }
  
  void DepartmentToUpdate::SharedDtor() {
    if (this != default_instance_) {
      delete parentdepartment_;
      delete departmentnaming_;
      delete kpp_;
      delete address_;
      delete routing_;
    }
  }
  
  void DepartmentToUpdate::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* DepartmentToUpdate::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return DepartmentToUpdate_descriptor_;
  }
  
  const DepartmentToUpdate& DepartmentToUpdate::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_Departments_2fDepartmentToUpdate_2eproto();
    return *default_instance_;
  }
  
  DepartmentToUpdate* DepartmentToUpdate::default_instance_ = NULL;
  
  DepartmentToUpdate* DepartmentToUpdate::New() const {
    return new DepartmentToUpdate;
  }
  
  void DepartmentToUpdate::Clear() {
    if (_has_bits_[0 / 32] & 31) {
      if (has_parentdepartment()) {
        if (parentdepartment_ != NULL) parentdepartment_->::Diadoc::Api::Proto::Departments::ParentDepartmentPatch::Clear();
      }
      if (has_departmentnaming()) {
        if (departmentnaming_ != NULL) departmentnaming_->::Diadoc::Api::Proto::Departments::DepartmentNamingPatch::Clear();
      }
      if (has_kpp()) {
        if (kpp_ != NULL) kpp_->::Diadoc::Api::Proto::Departments::DepartmentKppPatch::Clear();
      }
      if (has_address()) {
        if (address_ != NULL) address_->::Diadoc::Api::Proto::Departments::DepartmentAddressPatch::Clear();
      }
      if (has_routing()) {
        if (routing_ != NULL) routing_->::Diadoc::Api::Proto::Departments::DepartmentRoutingPatch::Clear();
      }
    }
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool DepartmentToUpdate::MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input) {
  #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
    ::google::protobuf::uint32 tag;
    // @@protoc_insertion_point(parse_start:Diadoc.Api.Proto.Departments.DepartmentToUpdate)
    for (;;) {
      ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
      tag = p.first;
      if (!p.second) goto handle_unusual;
      switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
        // optional .Diadoc.Api.Proto.Departments.ParentDepartmentPatch ParentDepartment = 1;
        case 1: {
          if (tag == 10) {
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_parentdepartment()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_DepartmentNaming;
          break;
        }
  
        // optional .Diadoc.Api.Proto.Departments.DepartmentNamingPatch DepartmentNaming = 2;
        case 2: {
          if (tag == 18) {
           parse_DepartmentNaming:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_departmentnaming()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(26)) goto parse_Kpp;
          break;
        }
  
        // optional .Diadoc.Api.Proto.Departments.DepartmentKppPatch Kpp = 3;
        case 3: {
          if (tag == 26) {
           parse_Kpp:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_kpp()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(34)) goto parse_Address;
          break;
        }
  
        // optional .Diadoc.Api.Proto.Departments.DepartmentAddressPatch Address = 4;
        case 4: {
          if (tag == 34) {
           parse_Address:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_address()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(42)) goto parse_Routing;
          break;
        }
  
        // optional .Diadoc.Api.Proto.Departments.DepartmentRoutingPatch Routing = 5;
        case 5: {
          if (tag == 42) {
           parse_Routing:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_routing()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectAtEnd()) goto success;
          break;
        }
  
        default: {
        handle_unusual:
          if (tag == 0 ||
              ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
              ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
            goto success;
          }
          DO_(::google::protobuf::internal::WireFormat::SkipField(
                input, tag, mutable_unknown_fields()));
          break;
        }
      }
    }
  success:
    // @@protoc_insertion_point(parse_success:Diadoc.Api.Proto.Departments.DepartmentToUpdate)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:Diadoc.Api.Proto.Departments.DepartmentToUpdate)
    return false;
  #undef DO_
  }
  
  void DepartmentToUpdate::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:Diadoc.Api.Proto.Departments.DepartmentToUpdate)
    // optional .Diadoc.Api.Proto.Departments.ParentDepartmentPatch ParentDepartment = 1;
    if (has_parentdepartment()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        1, this->parentdepartment(), output);
    }
  
    // optional .Diadoc.Api.Proto.Departments.DepartmentNamingPatch DepartmentNaming = 2;
    if (has_departmentnaming()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        2, this->departmentnaming(), output);
    }
  
    // optional .Diadoc.Api.Proto.Departments.DepartmentKppPatch Kpp = 3;
    if (has_kpp()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        3, this->kpp(), output);
    }
  
    // optional .Diadoc.Api.Proto.Departments.DepartmentAddressPatch Address = 4;
    if (has_address()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        4, this->address(), output);
    }
  
    // optional .Diadoc.Api.Proto.Departments.DepartmentRoutingPatch Routing = 5;
    if (has_routing()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        5, this->routing(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:Diadoc.Api.Proto.Departments.DepartmentToUpdate)
  }
  
  ::google::protobuf::uint8* DepartmentToUpdate::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:Diadoc.Api.Proto.Departments.DepartmentToUpdate)
    // optional .Diadoc.Api.Proto.Departments.ParentDepartmentPatch ParentDepartment = 1;
    if (has_parentdepartment()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          1, this->parentdepartment(), target);
    }
  
    // optional .Diadoc.Api.Proto.Departments.DepartmentNamingPatch DepartmentNaming = 2;
    if (has_departmentnaming()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          2, this->departmentnaming(), target);
    }
  
    // optional .Diadoc.Api.Proto.Departments.DepartmentKppPatch Kpp = 3;
    if (has_kpp()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          3, this->kpp(), target);
    }
  
    // optional .Diadoc.Api.Proto.Departments.DepartmentAddressPatch Address = 4;
    if (has_address()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          4, this->address(), target);
    }
  
    // optional .Diadoc.Api.Proto.Departments.DepartmentRoutingPatch Routing = 5;
    if (has_routing()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          5, this->routing(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:Diadoc.Api.Proto.Departments.DepartmentToUpdate)
    return target;
  }
  
  int DepartmentToUpdate::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // optional .Diadoc.Api.Proto.Departments.ParentDepartmentPatch ParentDepartment = 1;
      if (has_parentdepartment()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->parentdepartment());
      }
  
      // optional .Diadoc.Api.Proto.Departments.DepartmentNamingPatch DepartmentNaming = 2;
      if (has_departmentnaming()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->departmentnaming());
      }
  
      // optional .Diadoc.Api.Proto.Departments.DepartmentKppPatch Kpp = 3;
      if (has_kpp()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->kpp());
      }
  
      // optional .Diadoc.Api.Proto.Departments.DepartmentAddressPatch Address = 4;
      if (has_address()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->address());
      }
  
      // optional .Diadoc.Api.Proto.Departments.DepartmentRoutingPatch Routing = 5;
      if (has_routing()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->routing());
      }
  
    }
    if (!unknown_fields().empty()) {
      total_size +=
        ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
          unknown_fields());
    }
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = total_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    return total_size;
  }
  
  void DepartmentToUpdate::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const DepartmentToUpdate* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const DepartmentToUpdate*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void DepartmentToUpdate::MergeFrom(const DepartmentToUpdate& from) {
    GOOGLE_CHECK_NE(&from, this);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_parentdepartment()) {
        mutable_parentdepartment()->::Diadoc::Api::Proto::Departments::ParentDepartmentPatch::MergeFrom(from.parentdepartment());
      }
      if (from.has_departmentnaming()) {
        mutable_departmentnaming()->::Diadoc::Api::Proto::Departments::DepartmentNamingPatch::MergeFrom(from.departmentnaming());
      }
      if (from.has_kpp()) {
        mutable_kpp()->::Diadoc::Api::Proto::Departments::DepartmentKppPatch::MergeFrom(from.kpp());
      }
      if (from.has_address()) {
        mutable_address()->::Diadoc::Api::Proto::Departments::DepartmentAddressPatch::MergeFrom(from.address());
      }
      if (from.has_routing()) {
        mutable_routing()->::Diadoc::Api::Proto::Departments::DepartmentRoutingPatch::MergeFrom(from.routing());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void DepartmentToUpdate::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void DepartmentToUpdate::CopyFrom(const DepartmentToUpdate& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool DepartmentToUpdate::IsInitialized() const {
  
    if (has_parentdepartment()) {
      if (!this->parentdepartment().IsInitialized()) return false;
    }
    if (has_departmentnaming()) {
      if (!this->departmentnaming().IsInitialized()) return false;
    }
    if (has_address()) {
      if (!this->address().IsInitialized()) return false;
    }
    if (has_routing()) {
      if (!this->routing().IsInitialized()) return false;
    }
    return true;
  }
  
  void DepartmentToUpdate::Swap(DepartmentToUpdate* other) {
    if (other != this) {
      std::swap(parentdepartment_, other->parentdepartment_);
      std::swap(departmentnaming_, other->departmentnaming_);
      std::swap(kpp_, other->kpp_);
      std::swap(address_, other->address_);
      std::swap(routing_, other->routing_);
      std::swap(_has_bits_[0], other->_has_bits_[0]);
      _unknown_fields_.Swap(&other->_unknown_fields_);
      std::swap(_cached_size_, other->_cached_size_);
    }
  }
  
  ::google::protobuf::Metadata DepartmentToUpdate::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = DepartmentToUpdate_descriptor_;
    metadata.reflection = DepartmentToUpdate_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int ParentDepartmentPatch::kParentDepartmentIdFieldNumber;
  #endif  // !_MSC_VER
  
  ParentDepartmentPatch::ParentDepartmentPatch()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:Diadoc.Api.Proto.Departments.ParentDepartmentPatch)
  }
  
  void ParentDepartmentPatch::InitAsDefaultInstance() {
  }
  
  ParentDepartmentPatch::ParentDepartmentPatch(const ParentDepartmentPatch& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:Diadoc.Api.Proto.Departments.ParentDepartmentPatch)
  }
  
  void ParentDepartmentPatch::SharedCtor() {
    ::google::protobuf::internal::GetEmptyString();
    _cached_size_ = 0;
    parentdepartmentid_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  ParentDepartmentPatch::~ParentDepartmentPatch() {
    // @@protoc_insertion_point(destructor:Diadoc.Api.Proto.Departments.ParentDepartmentPatch)
    SharedDtor();
  }
  
  void ParentDepartmentPatch::SharedDtor() {
    if (parentdepartmentid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete parentdepartmentid_;
    }
    if (this != default_instance_) {
    }
  }
  
  void ParentDepartmentPatch::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* ParentDepartmentPatch::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return ParentDepartmentPatch_descriptor_;
  }
  
  const ParentDepartmentPatch& ParentDepartmentPatch::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_Departments_2fDepartmentToUpdate_2eproto();
    return *default_instance_;
  }
  
  ParentDepartmentPatch* ParentDepartmentPatch::default_instance_ = NULL;
  
  ParentDepartmentPatch* ParentDepartmentPatch::New() const {
    return new ParentDepartmentPatch;
  }
  
  void ParentDepartmentPatch::Clear() {
    if (has_parentdepartmentid()) {
      if (parentdepartmentid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
        parentdepartmentid_->clear();
      }
    }
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool ParentDepartmentPatch::MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input) {
  #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
    ::google::protobuf::uint32 tag;
    // @@protoc_insertion_point(parse_start:Diadoc.Api.Proto.Departments.ParentDepartmentPatch)
    for (;;) {
      ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
      tag = p.first;
      if (!p.second) goto handle_unusual;
      switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
        // required string ParentDepartmentId = 1;
        case 1: {
          if (tag == 10) {
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_parentdepartmentid()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->parentdepartmentid().data(), this->parentdepartmentid().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "parentdepartmentid");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectAtEnd()) goto success;
          break;
        }
  
        default: {
        handle_unusual:
          if (tag == 0 ||
              ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
              ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
            goto success;
          }
          DO_(::google::protobuf::internal::WireFormat::SkipField(
                input, tag, mutable_unknown_fields()));
          break;
        }
      }
    }
  success:
    // @@protoc_insertion_point(parse_success:Diadoc.Api.Proto.Departments.ParentDepartmentPatch)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:Diadoc.Api.Proto.Departments.ParentDepartmentPatch)
    return false;
  #undef DO_
  }
  
  void ParentDepartmentPatch::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:Diadoc.Api.Proto.Departments.ParentDepartmentPatch)
    // required string ParentDepartmentId = 1;
    if (has_parentdepartmentid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->parentdepartmentid().data(), this->parentdepartmentid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "parentdepartmentid");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        1, this->parentdepartmentid(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:Diadoc.Api.Proto.Departments.ParentDepartmentPatch)
  }
  
  ::google::protobuf::uint8* ParentDepartmentPatch::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:Diadoc.Api.Proto.Departments.ParentDepartmentPatch)
    // required string ParentDepartmentId = 1;
    if (has_parentdepartmentid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->parentdepartmentid().data(), this->parentdepartmentid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "parentdepartmentid");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          1, this->parentdepartmentid(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:Diadoc.Api.Proto.Departments.ParentDepartmentPatch)
    return target;
  }
  
  int ParentDepartmentPatch::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // required string ParentDepartmentId = 1;
      if (has_parentdepartmentid()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->parentdepartmentid());
      }
  
    }
    if (!unknown_fields().empty()) {
      total_size +=
        ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
          unknown_fields());
    }
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = total_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    return total_size;
  }
  
  void ParentDepartmentPatch::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const ParentDepartmentPatch* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const ParentDepartmentPatch*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void ParentDepartmentPatch::MergeFrom(const ParentDepartmentPatch& from) {
    GOOGLE_CHECK_NE(&from, this);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_parentdepartmentid()) {
        set_parentdepartmentid(from.parentdepartmentid());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void ParentDepartmentPatch::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void ParentDepartmentPatch::CopyFrom(const ParentDepartmentPatch& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool ParentDepartmentPatch::IsInitialized() const {
    if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
  
    return true;
  }
  
  void ParentDepartmentPatch::Swap(ParentDepartmentPatch* other) {
    if (other != this) {
      std::swap(parentdepartmentid_, other->parentdepartmentid_);
      std::swap(_has_bits_[0], other->_has_bits_[0]);
      _unknown_fields_.Swap(&other->_unknown_fields_);
      std::swap(_cached_size_, other->_cached_size_);
    }
  }
  
  ::google::protobuf::Metadata ParentDepartmentPatch::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = ParentDepartmentPatch_descriptor_;
    metadata.reflection = ParentDepartmentPatch_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int DepartmentNamingPatch::kNameFieldNumber;
  const int DepartmentNamingPatch::kAbbreviationFieldNumber;
  #endif  // !_MSC_VER
  
  DepartmentNamingPatch::DepartmentNamingPatch()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:Diadoc.Api.Proto.Departments.DepartmentNamingPatch)
  }
  
  void DepartmentNamingPatch::InitAsDefaultInstance() {
  }
  
  DepartmentNamingPatch::DepartmentNamingPatch(const DepartmentNamingPatch& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:Diadoc.Api.Proto.Departments.DepartmentNamingPatch)
  }
  
  void DepartmentNamingPatch::SharedCtor() {
    ::google::protobuf::internal::GetEmptyString();
    _cached_size_ = 0;
    name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    abbreviation_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  DepartmentNamingPatch::~DepartmentNamingPatch() {
    // @@protoc_insertion_point(destructor:Diadoc.Api.Proto.Departments.DepartmentNamingPatch)
    SharedDtor();
  }
  
  void DepartmentNamingPatch::SharedDtor() {
    if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete name_;
    }
    if (abbreviation_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete abbreviation_;
    }
    if (this != default_instance_) {
    }
  }
  
  void DepartmentNamingPatch::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* DepartmentNamingPatch::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return DepartmentNamingPatch_descriptor_;
  }
  
  const DepartmentNamingPatch& DepartmentNamingPatch::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_Departments_2fDepartmentToUpdate_2eproto();
    return *default_instance_;
  }
  
  DepartmentNamingPatch* DepartmentNamingPatch::default_instance_ = NULL;
  
  DepartmentNamingPatch* DepartmentNamingPatch::New() const {
    return new DepartmentNamingPatch;
  }
  
  void DepartmentNamingPatch::Clear() {
    if (_has_bits_[0 / 32] & 3) {
      if (has_name()) {
        if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          name_->clear();
        }
      }
      if (has_abbreviation()) {
        if (abbreviation_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          abbreviation_->clear();
        }
      }
    }
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool DepartmentNamingPatch::MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input) {
  #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
    ::google::protobuf::uint32 tag;
    // @@protoc_insertion_point(parse_start:Diadoc.Api.Proto.Departments.DepartmentNamingPatch)
    for (;;) {
      ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
      tag = p.first;
      if (!p.second) goto handle_unusual;
      switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
        // required string Name = 1;
        case 1: {
          if (tag == 10) {
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_name()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->name().data(), this->name().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "name");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_Abbreviation;
          break;
        }
  
        // required string Abbreviation = 2;
        case 2: {
          if (tag == 18) {
           parse_Abbreviation:
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_abbreviation()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->abbreviation().data(), this->abbreviation().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "abbreviation");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectAtEnd()) goto success;
          break;
        }
  
        default: {
        handle_unusual:
          if (tag == 0 ||
              ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
              ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
            goto success;
          }
          DO_(::google::protobuf::internal::WireFormat::SkipField(
                input, tag, mutable_unknown_fields()));
          break;
        }
      }
    }
  success:
    // @@protoc_insertion_point(parse_success:Diadoc.Api.Proto.Departments.DepartmentNamingPatch)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:Diadoc.Api.Proto.Departments.DepartmentNamingPatch)
    return false;
  #undef DO_
  }
  
  void DepartmentNamingPatch::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:Diadoc.Api.Proto.Departments.DepartmentNamingPatch)
    // required string Name = 1;
    if (has_name()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->name().data(), this->name().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "name");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        1, this->name(), output);
    }
  
    // required string Abbreviation = 2;
    if (has_abbreviation()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->abbreviation().data(), this->abbreviation().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "abbreviation");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        2, this->abbreviation(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:Diadoc.Api.Proto.Departments.DepartmentNamingPatch)
  }
  
  ::google::protobuf::uint8* DepartmentNamingPatch::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:Diadoc.Api.Proto.Departments.DepartmentNamingPatch)
    // required string Name = 1;
    if (has_name()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->name().data(), this->name().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "name");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          1, this->name(), target);
    }
  
    // required string Abbreviation = 2;
    if (has_abbreviation()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->abbreviation().data(), this->abbreviation().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "abbreviation");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          2, this->abbreviation(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:Diadoc.Api.Proto.Departments.DepartmentNamingPatch)
    return target;
  }
  
  int DepartmentNamingPatch::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // required string Name = 1;
      if (has_name()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->name());
      }
  
      // required string Abbreviation = 2;
      if (has_abbreviation()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->abbreviation());
      }
  
    }
    if (!unknown_fields().empty()) {
      total_size +=
        ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
          unknown_fields());
    }
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = total_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    return total_size;
  }
  
  void DepartmentNamingPatch::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const DepartmentNamingPatch* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const DepartmentNamingPatch*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void DepartmentNamingPatch::MergeFrom(const DepartmentNamingPatch& from) {
    GOOGLE_CHECK_NE(&from, this);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_name()) {
        set_name(from.name());
      }
      if (from.has_abbreviation()) {
        set_abbreviation(from.abbreviation());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void DepartmentNamingPatch::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void DepartmentNamingPatch::CopyFrom(const DepartmentNamingPatch& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool DepartmentNamingPatch::IsInitialized() const {
    if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
  
    return true;
  }
  
  void DepartmentNamingPatch::Swap(DepartmentNamingPatch* other) {
    if (other != this) {
      std::swap(name_, other->name_);
      std::swap(abbreviation_, other->abbreviation_);
      std::swap(_has_bits_[0], other->_has_bits_[0]);
      _unknown_fields_.Swap(&other->_unknown_fields_);
      std::swap(_cached_size_, other->_cached_size_);
    }
  }
  
  ::google::protobuf::Metadata DepartmentNamingPatch::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = DepartmentNamingPatch_descriptor_;
    metadata.reflection = DepartmentNamingPatch_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int DepartmentKppPatch::kKppFieldNumber;
  #endif  // !_MSC_VER
  
  DepartmentKppPatch::DepartmentKppPatch()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:Diadoc.Api.Proto.Departments.DepartmentKppPatch)
  }
  
  void DepartmentKppPatch::InitAsDefaultInstance() {
  }
  
  DepartmentKppPatch::DepartmentKppPatch(const DepartmentKppPatch& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:Diadoc.Api.Proto.Departments.DepartmentKppPatch)
  }
  
  void DepartmentKppPatch::SharedCtor() {
    ::google::protobuf::internal::GetEmptyString();
    _cached_size_ = 0;
    kpp_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  DepartmentKppPatch::~DepartmentKppPatch() {
    // @@protoc_insertion_point(destructor:Diadoc.Api.Proto.Departments.DepartmentKppPatch)
    SharedDtor();
  }
  
  void DepartmentKppPatch::SharedDtor() {
    if (kpp_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete kpp_;
    }
    if (this != default_instance_) {
    }
  }
  
  void DepartmentKppPatch::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* DepartmentKppPatch::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return DepartmentKppPatch_descriptor_;
  }
  
  const DepartmentKppPatch& DepartmentKppPatch::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_Departments_2fDepartmentToUpdate_2eproto();
    return *default_instance_;
  }
  
  DepartmentKppPatch* DepartmentKppPatch::default_instance_ = NULL;
  
  DepartmentKppPatch* DepartmentKppPatch::New() const {
    return new DepartmentKppPatch;
  }
  
  void DepartmentKppPatch::Clear() {
    if (has_kpp()) {
      if (kpp_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
        kpp_->clear();
      }
    }
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool DepartmentKppPatch::MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input) {
  #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
    ::google::protobuf::uint32 tag;
    // @@protoc_insertion_point(parse_start:Diadoc.Api.Proto.Departments.DepartmentKppPatch)
    for (;;) {
      ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
      tag = p.first;
      if (!p.second) goto handle_unusual;
      switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
        // optional string Kpp = 1;
        case 1: {
          if (tag == 10) {
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_kpp()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->kpp().data(), this->kpp().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "kpp");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectAtEnd()) goto success;
          break;
        }
  
        default: {
        handle_unusual:
          if (tag == 0 ||
              ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
              ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
            goto success;
          }
          DO_(::google::protobuf::internal::WireFormat::SkipField(
                input, tag, mutable_unknown_fields()));
          break;
        }
      }
    }
  success:
    // @@protoc_insertion_point(parse_success:Diadoc.Api.Proto.Departments.DepartmentKppPatch)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:Diadoc.Api.Proto.Departments.DepartmentKppPatch)
    return false;
  #undef DO_
  }
  
  void DepartmentKppPatch::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:Diadoc.Api.Proto.Departments.DepartmentKppPatch)
    // optional string Kpp = 1;
    if (has_kpp()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->kpp().data(), this->kpp().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "kpp");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        1, this->kpp(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:Diadoc.Api.Proto.Departments.DepartmentKppPatch)
  }
  
  ::google::protobuf::uint8* DepartmentKppPatch::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:Diadoc.Api.Proto.Departments.DepartmentKppPatch)
    // optional string Kpp = 1;
    if (has_kpp()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->kpp().data(), this->kpp().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "kpp");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          1, this->kpp(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:Diadoc.Api.Proto.Departments.DepartmentKppPatch)
    return target;
  }
  
  int DepartmentKppPatch::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // optional string Kpp = 1;
      if (has_kpp()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->kpp());
      }
  
    }
    if (!unknown_fields().empty()) {
      total_size +=
        ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
          unknown_fields());
    }
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = total_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    return total_size;
  }
  
  void DepartmentKppPatch::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const DepartmentKppPatch* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const DepartmentKppPatch*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void DepartmentKppPatch::MergeFrom(const DepartmentKppPatch& from) {
    GOOGLE_CHECK_NE(&from, this);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_kpp()) {
        set_kpp(from.kpp());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void DepartmentKppPatch::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void DepartmentKppPatch::CopyFrom(const DepartmentKppPatch& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool DepartmentKppPatch::IsInitialized() const {
  
    return true;
  }
  
  void DepartmentKppPatch::Swap(DepartmentKppPatch* other) {
    if (other != this) {
      std::swap(kpp_, other->kpp_);
      std::swap(_has_bits_[0], other->_has_bits_[0]);
      _unknown_fields_.Swap(&other->_unknown_fields_);
      std::swap(_cached_size_, other->_cached_size_);
    }
  }
  
  ::google::protobuf::Metadata DepartmentKppPatch::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = DepartmentKppPatch_descriptor_;
    metadata.reflection = DepartmentKppPatch_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int DepartmentAddressPatch::kAddressFieldNumber;
  #endif  // !_MSC_VER
  
  DepartmentAddressPatch::DepartmentAddressPatch()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:Diadoc.Api.Proto.Departments.DepartmentAddressPatch)
  }
  
  void DepartmentAddressPatch::InitAsDefaultInstance() {
    address_ = const_cast< ::Diadoc::Api::Proto::Address*>(&::Diadoc::Api::Proto::Address::default_instance());
  }
  
  DepartmentAddressPatch::DepartmentAddressPatch(const DepartmentAddressPatch& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:Diadoc.Api.Proto.Departments.DepartmentAddressPatch)
  }
  
  void DepartmentAddressPatch::SharedCtor() {
    _cached_size_ = 0;
    address_ = NULL;
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  DepartmentAddressPatch::~DepartmentAddressPatch() {
    // @@protoc_insertion_point(destructor:Diadoc.Api.Proto.Departments.DepartmentAddressPatch)
    SharedDtor();
  }
  
  void DepartmentAddressPatch::SharedDtor() {
    if (this != default_instance_) {
      delete address_;
    }
  }
  
  void DepartmentAddressPatch::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* DepartmentAddressPatch::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return DepartmentAddressPatch_descriptor_;
  }
  
  const DepartmentAddressPatch& DepartmentAddressPatch::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_Departments_2fDepartmentToUpdate_2eproto();
    return *default_instance_;
  }
  
  DepartmentAddressPatch* DepartmentAddressPatch::default_instance_ = NULL;
  
  DepartmentAddressPatch* DepartmentAddressPatch::New() const {
    return new DepartmentAddressPatch;
  }
  
  void DepartmentAddressPatch::Clear() {
    if (has_address()) {
      if (address_ != NULL) address_->::Diadoc::Api::Proto::Address::Clear();
    }
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool DepartmentAddressPatch::MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input) {
  #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
    ::google::protobuf::uint32 tag;
    // @@protoc_insertion_point(parse_start:Diadoc.Api.Proto.Departments.DepartmentAddressPatch)
    for (;;) {
      ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
      tag = p.first;
      if (!p.second) goto handle_unusual;
      switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
        // optional .Diadoc.Api.Proto.Address Address = 1;
        case 1: {
          if (tag == 10) {
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_address()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectAtEnd()) goto success;
          break;
        }
  
        default: {
        handle_unusual:
          if (tag == 0 ||
              ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
              ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
            goto success;
          }
          DO_(::google::protobuf::internal::WireFormat::SkipField(
                input, tag, mutable_unknown_fields()));
          break;
        }
      }
    }
  success:
    // @@protoc_insertion_point(parse_success:Diadoc.Api.Proto.Departments.DepartmentAddressPatch)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:Diadoc.Api.Proto.Departments.DepartmentAddressPatch)
    return false;
  #undef DO_
  }
  
  void DepartmentAddressPatch::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:Diadoc.Api.Proto.Departments.DepartmentAddressPatch)
    // optional .Diadoc.Api.Proto.Address Address = 1;
    if (has_address()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        1, this->address(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:Diadoc.Api.Proto.Departments.DepartmentAddressPatch)
  }
  
  ::google::protobuf::uint8* DepartmentAddressPatch::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:Diadoc.Api.Proto.Departments.DepartmentAddressPatch)
    // optional .Diadoc.Api.Proto.Address Address = 1;
    if (has_address()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          1, this->address(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:Diadoc.Api.Proto.Departments.DepartmentAddressPatch)
    return target;
  }
  
  int DepartmentAddressPatch::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // optional .Diadoc.Api.Proto.Address Address = 1;
      if (has_address()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->address());
      }
  
    }
    if (!unknown_fields().empty()) {
      total_size +=
        ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
          unknown_fields());
    }
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = total_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    return total_size;
  }
  
  void DepartmentAddressPatch::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const DepartmentAddressPatch* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const DepartmentAddressPatch*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void DepartmentAddressPatch::MergeFrom(const DepartmentAddressPatch& from) {
    GOOGLE_CHECK_NE(&from, this);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_address()) {
        mutable_address()->::Diadoc::Api::Proto::Address::MergeFrom(from.address());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void DepartmentAddressPatch::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void DepartmentAddressPatch::CopyFrom(const DepartmentAddressPatch& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool DepartmentAddressPatch::IsInitialized() const {
  
    if (has_address()) {
      if (!this->address().IsInitialized()) return false;
    }
    return true;
  }
  
  void DepartmentAddressPatch::Swap(DepartmentAddressPatch* other) {
    if (other != this) {
      std::swap(address_, other->address_);
      std::swap(_has_bits_[0], other->_has_bits_[0]);
      _unknown_fields_.Swap(&other->_unknown_fields_);
      std::swap(_cached_size_, other->_cached_size_);
    }
  }
  
  ::google::protobuf::Metadata DepartmentAddressPatch::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = DepartmentAddressPatch_descriptor_;
    metadata.reflection = DepartmentAddressPatch_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int DepartmentRoutingPatch::kKppFieldNumber;
  const int DepartmentRoutingPatch::kAddressFieldNumber;
  #endif  // !_MSC_VER
  
  DepartmentRoutingPatch::DepartmentRoutingPatch()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:Diadoc.Api.Proto.Departments.DepartmentRoutingPatch)
  }
  
  void DepartmentRoutingPatch::InitAsDefaultInstance() {
  }
  
  DepartmentRoutingPatch::DepartmentRoutingPatch(const DepartmentRoutingPatch& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:Diadoc.Api.Proto.Departments.DepartmentRoutingPatch)
  }
  
  void DepartmentRoutingPatch::SharedCtor() {
    _cached_size_ = 0;
    kpp_ = false;
    address_ = false;
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  DepartmentRoutingPatch::~DepartmentRoutingPatch() {
    // @@protoc_insertion_point(destructor:Diadoc.Api.Proto.Departments.DepartmentRoutingPatch)
    SharedDtor();
  }
  
  void DepartmentRoutingPatch::SharedDtor() {
    if (this != default_instance_) {
    }
  }
  
  void DepartmentRoutingPatch::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* DepartmentRoutingPatch::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return DepartmentRoutingPatch_descriptor_;
  }
  
  const DepartmentRoutingPatch& DepartmentRoutingPatch::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_Departments_2fDepartmentToUpdate_2eproto();
    return *default_instance_;
  }
  
  DepartmentRoutingPatch* DepartmentRoutingPatch::default_instance_ = NULL;
  
  DepartmentRoutingPatch* DepartmentRoutingPatch::New() const {
    return new DepartmentRoutingPatch;
  }
  
  void DepartmentRoutingPatch::Clear() {
  #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>(      \
    &reinterpret_cast<DepartmentRoutingPatch*>(16)->f) - \
     reinterpret_cast<char*>(16))
  
  #define ZR_(first, last) do {                              \
      size_t f = OFFSET_OF_FIELD_(first);                    \
      size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last);  \
      ::memset(&first, 0, n);                                \
    } while (0)
  
    ZR_(kpp_, address_);
  
  #undef OFFSET_OF_FIELD_
  #undef ZR_
  
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool DepartmentRoutingPatch::MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input) {
  #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
    ::google::protobuf::uint32 tag;
    // @@protoc_insertion_point(parse_start:Diadoc.Api.Proto.Departments.DepartmentRoutingPatch)
    for (;;) {
      ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
      tag = p.first;
      if (!p.second) goto handle_unusual;
      switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
        // required bool Kpp = 1;
        case 1: {
          if (tag == 8) {
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                   input, &kpp_)));
            set_has_kpp();
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(16)) goto parse_Address;
          break;
        }
  
        // required bool Address = 2;
        case 2: {
          if (tag == 16) {
           parse_Address:
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                   input, &address_)));
            set_has_address();
          } else {
            goto handle_unusual;
          }
          if (input->ExpectAtEnd()) goto success;
          break;
        }
  
        default: {
        handle_unusual:
          if (tag == 0 ||
              ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
              ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
            goto success;
          }
          DO_(::google::protobuf::internal::WireFormat::SkipField(
                input, tag, mutable_unknown_fields()));
          break;
        }
      }
    }
  success:
    // @@protoc_insertion_point(parse_success:Diadoc.Api.Proto.Departments.DepartmentRoutingPatch)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:Diadoc.Api.Proto.Departments.DepartmentRoutingPatch)
    return false;
  #undef DO_
  }
  
  void DepartmentRoutingPatch::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:Diadoc.Api.Proto.Departments.DepartmentRoutingPatch)
    // required bool Kpp = 1;
    if (has_kpp()) {
      ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->kpp(), output);
    }
  
    // required bool Address = 2;
    if (has_address()) {
      ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->address(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:Diadoc.Api.Proto.Departments.DepartmentRoutingPatch)
  }
  
  ::google::protobuf::uint8* DepartmentRoutingPatch::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:Diadoc.Api.Proto.Departments.DepartmentRoutingPatch)
    // required bool Kpp = 1;
    if (has_kpp()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->kpp(), target);
    }
  
    // required bool Address = 2;
    if (has_address()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->address(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:Diadoc.Api.Proto.Departments.DepartmentRoutingPatch)
    return target;
  }
  
  int DepartmentRoutingPatch::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // required bool Kpp = 1;
      if (has_kpp()) {
        total_size += 1 + 1;
      }
  
      // required bool Address = 2;
      if (has_address()) {
        total_size += 1 + 1;
      }
  
    }
    if (!unknown_fields().empty()) {
      total_size +=
        ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
          unknown_fields());
    }
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = total_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    return total_size;
  }
  
  void DepartmentRoutingPatch::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const DepartmentRoutingPatch* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const DepartmentRoutingPatch*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void DepartmentRoutingPatch::MergeFrom(const DepartmentRoutingPatch& from) {
    GOOGLE_CHECK_NE(&from, this);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_kpp()) {
        set_kpp(from.kpp());
      }
      if (from.has_address()) {
        set_address(from.address());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void DepartmentRoutingPatch::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void DepartmentRoutingPatch::CopyFrom(const DepartmentRoutingPatch& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool DepartmentRoutingPatch::IsInitialized() const {
    if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
  
    return true;
  }
  
  void DepartmentRoutingPatch::Swap(DepartmentRoutingPatch* other) {
    if (other != this) {
      std::swap(kpp_, other->kpp_);
      std::swap(address_, other->address_);
      std::swap(_has_bits_[0], other->_has_bits_[0]);
      _unknown_fields_.Swap(&other->_unknown_fields_);
      std::swap(_cached_size_, other->_cached_size_);
    }
  }
  
  ::google::protobuf::Metadata DepartmentRoutingPatch::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = DepartmentRoutingPatch_descriptor_;
    metadata.reflection = DepartmentRoutingPatch_reflection_;
    return metadata;
  }
  
  
  // @@protoc_insertion_point(namespace_scope)
  
  }  // namespace Departments
  }  // namespace Proto
  }  // namespace Api
  }  // namespace Diadoc
  
  // @@protoc_insertion_point(global_scope)
  