text: // Generated by the protocol buffer compiler.  DO NOT EDIT!
  // source: Docflow/DocumentInfoV3.proto
  
  #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
  #include "Docflow/DocumentInfoV3.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 Docflow {
  
  namespace {
  
  const ::google::protobuf::Descriptor* DocumentInfoV3_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    DocumentInfoV3_reflection_ = NULL;
  const ::google::protobuf::Descriptor* DocumentParticipants_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    DocumentParticipants_reflection_ = NULL;
  const ::google::protobuf::Descriptor* DocumentParticipant_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    DocumentParticipant_reflection_ = NULL;
  const ::google::protobuf::Descriptor* DocumentLinks_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    DocumentLinks_reflection_ = NULL;
  const ::google::protobuf::Descriptor* PacketInfo_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    PacketInfo_reflection_ = NULL;
  const ::google::protobuf::Descriptor* DocumentLetterInfo_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    DocumentLetterInfo_reflection_ = NULL;
  const ::google::protobuf::Descriptor* DocumentDraftInfo_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    DocumentDraftInfo_reflection_ = NULL;
  const ::google::protobuf::Descriptor* DocumentTemplateInfo_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    DocumentTemplateInfo_reflection_ = NULL;
  const ::google::protobuf::Descriptor* TemplateTransformationInfo_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    TemplateTransformationInfo_reflection_ = NULL;
  const ::google::protobuf::Descriptor* TemplateRefusalInfo_descriptor_ = NULL;
  const ::google::protobuf::internal::GeneratedMessageReflection*
    TemplateRefusalInfo_reflection_ = NULL;
  
  }  // namespace
  
  
  void protobuf_AssignDesc_Docflow_2fDocumentInfoV3_2eproto() {
    protobuf_AddDesc_Docflow_2fDocumentInfoV3_2eproto();
    const ::google::protobuf::FileDescriptor* file =
      ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
        "Docflow/DocumentInfoV3.proto");
    GOOGLE_CHECK(file != NULL);
    DocumentInfoV3_descriptor_ = file->message_type(0);
    static const int DocumentInfoV3_offsets_[19] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, fullversion_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, messagetype_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, workflowid_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, participants_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, documentdirection_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, departmentid_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, customdocumentid_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, metadata_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, customdata_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, documentlinks_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, packetinfo_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, isread_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, isdeleted_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, isinvitation_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, letterinfo_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, draftinfo_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, templateinfo_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, origin_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, editingsettingid_),
    };
    DocumentInfoV3_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        DocumentInfoV3_descriptor_,
        DocumentInfoV3::default_instance_,
        DocumentInfoV3_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentInfoV3, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(DocumentInfoV3));
    DocumentParticipants_descriptor_ = file->message_type(1);
    static const int DocumentParticipants_offsets_[4] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentParticipants, sender_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentParticipants, proxy_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentParticipants, recipient_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentParticipants, isinternal_),
    };
    DocumentParticipants_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        DocumentParticipants_descriptor_,
        DocumentParticipants::default_instance_,
        DocumentParticipants_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentParticipants, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentParticipants, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(DocumentParticipants));
    DocumentParticipant_descriptor_ = file->message_type(2);
    static const int DocumentParticipant_offsets_[2] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentParticipant, boxid_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentParticipant, departmentid_),
    };
    DocumentParticipant_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        DocumentParticipant_descriptor_,
        DocumentParticipant::default_instance_,
        DocumentParticipant_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentParticipant, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentParticipant, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(DocumentParticipant));
    DocumentLinks_descriptor_ = file->message_type(3);
    static const int DocumentLinks_offsets_[2] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentLinks, initialids_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentLinks, subordinateids_),
    };
    DocumentLinks_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        DocumentLinks_descriptor_,
        DocumentLinks::default_instance_,
        DocumentLinks_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentLinks, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentLinks, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(DocumentLinks));
    PacketInfo_descriptor_ = file->message_type(4);
    static const int PacketInfo_offsets_[3] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PacketInfo, lockmode_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PacketInfo, packetid_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PacketInfo, addedat_),
    };
    PacketInfo_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        PacketInfo_descriptor_,
        PacketInfo::default_instance_,
        PacketInfo_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PacketInfo, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PacketInfo, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(PacketInfo));
    DocumentLetterInfo_descriptor_ = file->message_type(5);
    static const int DocumentLetterInfo_offsets_[3] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentLetterInfo, isencrypted_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentLetterInfo, forwarddocumentevents_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentLetterInfo, istest_),
    };
    DocumentLetterInfo_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        DocumentLetterInfo_descriptor_,
        DocumentLetterInfo::default_instance_,
        DocumentLetterInfo_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentLetterInfo, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentLetterInfo, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(DocumentLetterInfo));
    DocumentDraftInfo_descriptor_ = file->message_type(6);
    static const int DocumentDraftInfo_offsets_[3] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentDraftInfo, isrecycled_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentDraftInfo, islocked_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentDraftInfo, transformedtoletterids_),
    };
    DocumentDraftInfo_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        DocumentDraftInfo_descriptor_,
        DocumentDraftInfo::default_instance_,
        DocumentDraftInfo_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentDraftInfo, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentDraftInfo, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(DocumentDraftInfo));
    DocumentTemplateInfo_descriptor_ = file->message_type(7);
    static const int DocumentTemplateInfo_offsets_[5] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentTemplateInfo, letterparticipants_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentTemplateInfo, transformedtoletterids_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentTemplateInfo, templatetransformationinfos_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentTemplateInfo, templaterefusalinfo_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentTemplateInfo, isreusable_),
    };
    DocumentTemplateInfo_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        DocumentTemplateInfo_descriptor_,
        DocumentTemplateInfo::default_instance_,
        DocumentTemplateInfo_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentTemplateInfo, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DocumentTemplateInfo, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(DocumentTemplateInfo));
    TemplateTransformationInfo_descriptor_ = file->message_type(8);
    static const int TemplateTransformationInfo_offsets_[3] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TemplateTransformationInfo, transformationid_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TemplateTransformationInfo, transformedtodocumentid_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TemplateTransformationInfo, authoruserid_),
    };
    TemplateTransformationInfo_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        TemplateTransformationInfo_descriptor_,
        TemplateTransformationInfo::default_instance_,
        TemplateTransformationInfo_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TemplateTransformationInfo, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TemplateTransformationInfo, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(TemplateTransformationInfo));
    TemplateRefusalInfo_descriptor_ = file->message_type(9);
    static const int TemplateRefusalInfo_offsets_[3] = {
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TemplateRefusalInfo, boxid_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TemplateRefusalInfo, authoruserid_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TemplateRefusalInfo, comment_),
    };
    TemplateRefusalInfo_reflection_ =
      new ::google::protobuf::internal::GeneratedMessageReflection(
        TemplateRefusalInfo_descriptor_,
        TemplateRefusalInfo::default_instance_,
        TemplateRefusalInfo_offsets_,
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TemplateRefusalInfo, _has_bits_[0]),
        GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TemplateRefusalInfo, _unknown_fields_),
        -1,
        ::google::protobuf::DescriptorPool::generated_pool(),
        ::google::protobuf::MessageFactory::generated_factory(),
        sizeof(TemplateRefusalInfo));
  }
  
  namespace {
  
  GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
  inline void protobuf_AssignDescriptorsOnce() {
    ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
                   &protobuf_AssignDesc_Docflow_2fDocumentInfoV3_2eproto);
  }
  
  void protobuf_RegisterTypes(const ::std::string&) {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      DocumentInfoV3_descriptor_, &DocumentInfoV3::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      DocumentParticipants_descriptor_, &DocumentParticipants::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      DocumentParticipant_descriptor_, &DocumentParticipant::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      DocumentLinks_descriptor_, &DocumentLinks::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      PacketInfo_descriptor_, &PacketInfo::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      DocumentLetterInfo_descriptor_, &DocumentLetterInfo::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      DocumentDraftInfo_descriptor_, &DocumentDraftInfo::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      DocumentTemplateInfo_descriptor_, &DocumentTemplateInfo::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      TemplateTransformationInfo_descriptor_, &TemplateTransformationInfo::default_instance());
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      TemplateRefusalInfo_descriptor_, &TemplateRefusalInfo::default_instance());
  }
  
  }  // namespace
  
  void protobuf_ShutdownFile_Docflow_2fDocumentInfoV3_2eproto() {
    delete DocumentInfoV3::default_instance_;
    delete DocumentInfoV3_reflection_;
    delete DocumentParticipants::default_instance_;
    delete DocumentParticipants_reflection_;
    delete DocumentParticipant::default_instance_;
    delete DocumentParticipant_reflection_;
    delete DocumentLinks::default_instance_;
    delete DocumentLinks_reflection_;
    delete PacketInfo::default_instance_;
    delete PacketInfo_reflection_;
    delete DocumentLetterInfo::default_instance_;
    delete DocumentLetterInfo_reflection_;
    delete DocumentDraftInfo::default_instance_;
    delete DocumentDraftInfo_reflection_;
    delete DocumentTemplateInfo::default_instance_;
    delete DocumentTemplateInfo_reflection_;
    delete TemplateTransformationInfo::default_instance_;
    delete TemplateTransformationInfo_reflection_;
    delete TemplateRefusalInfo::default_instance_;
    delete TemplateRefusalInfo_reflection_;
  }
  
  void protobuf_AddDesc_Docflow_2fDocumentInfoV3_2eproto() {
    static bool already_here = false;
    if (already_here) return;
    already_here = true;
    GOOGLE_PROTOBUF_VERIFY_VERSION;
  
    ::Diadoc::Api::Proto::protobuf_AddDesc_FullVersion_2eproto();
    ::Diadoc::Api::Proto::protobuf_AddDesc_DocumentId_2eproto();
    ::Diadoc::Api::Proto::protobuf_AddDesc_Timestamp_2eproto();
    ::Diadoc::Api::Proto::Documents::protobuf_AddDesc_Documents_2fDocument_2eproto();
    ::Diadoc::Api::Proto::protobuf_AddDesc_LockMode_2eproto();
    ::Diadoc::Api::Proto::protobuf_AddDesc_ForwardDocumentEvent_2eproto();
    ::Diadoc::Api::Proto::protobuf_AddDesc_DocumentDirection_2eproto();
    ::Diadoc::Api::Proto::Events::protobuf_AddDesc_Events_2fDiadocMessage_2dPostApi_2eproto();
    ::Diadoc::Api::Proto::protobuf_AddDesc_CustomDataItem_2eproto();
    ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
      "\n\034Docflow/DocumentInfoV3.proto\022\030Diadoc.A"
      "pi.Proto.Docflow\032\021FullVersion.proto\032\020Doc"
      "umentId.proto\032\017Timestamp.proto\032\030Document"
      "s/Document.proto\032\016LockMode.proto\032\032Forwar"
      "dDocumentEvent.proto\032\027DocumentDirection."
      "proto\032\"Events/DiadocMessage-PostApi.prot"
      "o\032\024CustomDataItem.proto\"\206\007\n\016DocumentInfo"
      "V3\0222\n\013FullVersion\030\001 \002(\0132\035.Diadoc.Api.Pro"
      "to.FullVersion\022<\n\013MessageType\030\002 \002(\0162\'.Di"
      "adoc.Api.Proto.Documents.MessageType\022\022\n\n"
      "WorkflowId\030\003 \002(\005\022D\n\014Participants\030\004 \002(\0132."
      ".Diadoc.Api.Proto.Docflow.DocumentPartic"
      "ipants\022>\n\021DocumentDirection\030\005 \002(\0162#.Diad"
      "oc.Api.Proto.DocumentDirection\022\024\n\014Depart"
      "mentId\030\006 \002(\t\022\030\n\020CustomDocumentId\030\007 \001(\t\0227"
      "\n\010Metadata\030\010 \003(\0132%.Diadoc.Api.Proto.Even"
      "ts.MetadataItem\0224\n\nCustomData\030\t \003(\0132 .Di"
      "adoc.Api.Proto.CustomDataItem\022>\n\rDocumen"
      "tLinks\030\n \002(\0132\'.Diadoc.Api.Proto.Docflow."
      "DocumentLinks\0228\n\nPacketInfo\030\013 \002(\0132$.Diad"
      "oc.Api.Proto.Docflow.PacketInfo\022\016\n\006IsRea"
      "d\030\014 \002(\010\022\021\n\tIsDeleted\030\r \002(\010\022\024\n\014IsInvitati"
      "on\030\016 \002(\010\022@\n\nLetterInfo\030\017 \001(\0132,.Diadoc.Ap"
      "i.Proto.Docflow.DocumentLetterInfo\022>\n\tDr"
      "aftInfo\030\020 \001(\0132+.Diadoc.Api.Proto.Docflow"
      ".DocumentDraftInfo\022D\n\014TemplateInfo\030\021 \001(\013"
      "2..Diadoc.Api.Proto.Docflow.DocumentTemp"
      "lateInfo\0222\n\006Origin\030\022 \001(\0132\".Diadoc.Api.Pr"
      "oto.Documents.Origin\022\032\n\020EditingSettingId"
      "\030\023 \001(\t:\000\"\351\001\n\024DocumentParticipants\022=\n\006Sen"
      "der\030\001 \002(\0132-.Diadoc.Api.Proto.Docflow.Doc"
      "umentParticipant\022<\n\005Proxy\030\002 \001(\0132-.Diadoc"
      ".Api.Proto.Docflow.DocumentParticipant\022@"
      "\n\tRecipient\030\003 \001(\0132-.Diadoc.Api.Proto.Doc"
      "flow.DocumentParticipant\022\022\n\nIsInternal\030\004"
      " \002(\010\":\n\023DocumentParticipant\022\r\n\005BoxId\030\001 \002"
      "(\t\022\024\n\014DepartmentId\030\002 \001(\t\"w\n\rDocumentLink"
      "s\0220\n\nInitialIds\030\001 \003(\0132\034.Diadoc.Api.Proto"
      ".DocumentId\0224\n\016SubordinateIds\030\002 \003(\0132\034.Di"
      "adoc.Api.Proto.DocumentId\"z\n\nPacketInfo\022"
      ",\n\010LockMode\030\001 \002(\0162\032.Diadoc.Api.Proto.Loc"
      "kMode\022\020\n\010PacketId\030\002 \001(\t\022,\n\007AddedAt\030\003 \001(\013"
      "2\033.Diadoc.Api.Proto.Timestamp\"\200\001\n\022Docume"
      "ntLetterInfo\022\023\n\013IsEncrypted\030\001 \002(\010\022E\n\025For"
      "wardDocumentEvents\030\002 \003(\0132&.Diadoc.Api.Pr"
      "oto.ForwardDocumentEvent\022\016\n\006IsTest\030\003 \002(\010"
      "\"Y\n\021DocumentDraftInfo\022\022\n\nIsRecycled\030\001 \002("
      "\010\022\020\n\010IsLocked\030\002 \002(\010\022\036\n\026TransformedToLett"
      "erIds\030\003 \003(\t\"\304\002\n\024DocumentTemplateInfo\022J\n\022"
      "LetterParticipants\030\001 \002(\0132..Diadoc.Api.Pr"
      "oto.Docflow.DocumentParticipants\022\036\n\026Tran"
      "sformedToLetterIds\030\002 \003(\t\022Y\n\033TemplateTran"
      "sformationInfos\030\003 \003(\01324.Diadoc.Api.Proto"
      ".Docflow.TemplateTransformationInfo\022J\n\023T"
      "emplateRefusalInfo\030\004 \001(\0132-.Diadoc.Api.Pr"
      "oto.Docflow.TemplateRefusalInfo\022\031\n\nIsReu"
      "sable\030\005 \001(\010:\005false\"\213\001\n\032TemplateTransform"
      "ationInfo\022\030\n\020TransformationId\030\001 \002(\t\022=\n\027T"
      "ransformedToDocumentId\030\002 \001(\0132\034.Diadoc.Ap"
      "i.Proto.DocumentId\022\024\n\014AuthorUserId\030\003 \001(\t"
      "\"K\n\023TemplateRefusalInfo\022\r\n\005BoxId\030\001 \002(\t\022\024"
      "\n\014AuthorUserId\030\002 \001(\t\022\017\n\007Comment\030\003 \001(\t", 2477);
    ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
      "Docflow/DocumentInfoV3.proto", &protobuf_RegisterTypes);
    DocumentInfoV3::default_instance_ = new DocumentInfoV3();
    DocumentParticipants::default_instance_ = new DocumentParticipants();
    DocumentParticipant::default_instance_ = new DocumentParticipant();
    DocumentLinks::default_instance_ = new DocumentLinks();
    PacketInfo::default_instance_ = new PacketInfo();
    DocumentLetterInfo::default_instance_ = new DocumentLetterInfo();
    DocumentDraftInfo::default_instance_ = new DocumentDraftInfo();
    DocumentTemplateInfo::default_instance_ = new DocumentTemplateInfo();
    TemplateTransformationInfo::default_instance_ = new TemplateTransformationInfo();
    TemplateRefusalInfo::default_instance_ = new TemplateRefusalInfo();
    DocumentInfoV3::default_instance_->InitAsDefaultInstance();
    DocumentParticipants::default_instance_->InitAsDefaultInstance();
    DocumentParticipant::default_instance_->InitAsDefaultInstance();
    DocumentLinks::default_instance_->InitAsDefaultInstance();
    PacketInfo::default_instance_->InitAsDefaultInstance();
    DocumentLetterInfo::default_instance_->InitAsDefaultInstance();
    DocumentDraftInfo::default_instance_->InitAsDefaultInstance();
    DocumentTemplateInfo::default_instance_->InitAsDefaultInstance();
    TemplateTransformationInfo::default_instance_->InitAsDefaultInstance();
    TemplateRefusalInfo::default_instance_->InitAsDefaultInstance();
    ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_Docflow_2fDocumentInfoV3_2eproto);
  }
  
  // Force AddDescriptors() to be called at static initialization time.
  struct StaticDescriptorInitializer_Docflow_2fDocumentInfoV3_2eproto {
    StaticDescriptorInitializer_Docflow_2fDocumentInfoV3_2eproto() {
      protobuf_AddDesc_Docflow_2fDocumentInfoV3_2eproto();
    }
  } static_descriptor_initializer_Docflow_2fDocumentInfoV3_2eproto_;
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int DocumentInfoV3::kFullVersionFieldNumber;
  const int DocumentInfoV3::kMessageTypeFieldNumber;
  const int DocumentInfoV3::kWorkflowIdFieldNumber;
  const int DocumentInfoV3::kParticipantsFieldNumber;
  const int DocumentInfoV3::kDocumentDirectionFieldNumber;
  const int DocumentInfoV3::kDepartmentIdFieldNumber;
  const int DocumentInfoV3::kCustomDocumentIdFieldNumber;
  const int DocumentInfoV3::kMetadataFieldNumber;
  const int DocumentInfoV3::kCustomDataFieldNumber;
  const int DocumentInfoV3::kDocumentLinksFieldNumber;
  const int DocumentInfoV3::kPacketInfoFieldNumber;
  const int DocumentInfoV3::kIsReadFieldNumber;
  const int DocumentInfoV3::kIsDeletedFieldNumber;
  const int DocumentInfoV3::kIsInvitationFieldNumber;
  const int DocumentInfoV3::kLetterInfoFieldNumber;
  const int DocumentInfoV3::kDraftInfoFieldNumber;
  const int DocumentInfoV3::kTemplateInfoFieldNumber;
  const int DocumentInfoV3::kOriginFieldNumber;
  const int DocumentInfoV3::kEditingSettingIdFieldNumber;
  #endif  // !_MSC_VER
  
  DocumentInfoV3::DocumentInfoV3()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:Diadoc.Api.Proto.Docflow.DocumentInfoV3)
  }
  
  void DocumentInfoV3::InitAsDefaultInstance() {
    fullversion_ = const_cast< ::Diadoc::Api::Proto::FullVersion*>(&::Diadoc::Api::Proto::FullVersion::default_instance());
    participants_ = const_cast< ::Diadoc::Api::Proto::Docflow::DocumentParticipants*>(&::Diadoc::Api::Proto::Docflow::DocumentParticipants::default_instance());
    documentlinks_ = const_cast< ::Diadoc::Api::Proto::Docflow::DocumentLinks*>(&::Diadoc::Api::Proto::Docflow::DocumentLinks::default_instance());
    packetinfo_ = const_cast< ::Diadoc::Api::Proto::Docflow::PacketInfo*>(&::Diadoc::Api::Proto::Docflow::PacketInfo::default_instance());
    letterinfo_ = const_cast< ::Diadoc::Api::Proto::Docflow::DocumentLetterInfo*>(&::Diadoc::Api::Proto::Docflow::DocumentLetterInfo::default_instance());
    draftinfo_ = const_cast< ::Diadoc::Api::Proto::Docflow::DocumentDraftInfo*>(&::Diadoc::Api::Proto::Docflow::DocumentDraftInfo::default_instance());
    templateinfo_ = const_cast< ::Diadoc::Api::Proto::Docflow::DocumentTemplateInfo*>(&::Diadoc::Api::Proto::Docflow::DocumentTemplateInfo::default_instance());
    origin_ = const_cast< ::Diadoc::Api::Proto::Documents::Origin*>(&::Diadoc::Api::Proto::Documents::Origin::default_instance());
  }
  
  DocumentInfoV3::DocumentInfoV3(const DocumentInfoV3& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:Diadoc.Api.Proto.Docflow.DocumentInfoV3)
  }
  
  void DocumentInfoV3::SharedCtor() {
    ::google::protobuf::internal::GetEmptyString();
    _cached_size_ = 0;
    fullversion_ = NULL;
    messagetype_ = 0;
    workflowid_ = 0;
    participants_ = NULL;
    documentdirection_ = 0;
    departmentid_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    customdocumentid_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    documentlinks_ = NULL;
    packetinfo_ = NULL;
    isread_ = false;
    isdeleted_ = false;
    isinvitation_ = false;
    letterinfo_ = NULL;
    draftinfo_ = NULL;
    templateinfo_ = NULL;
    origin_ = NULL;
    editingsettingid_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  DocumentInfoV3::~DocumentInfoV3() {
    // @@protoc_insertion_point(destructor:Diadoc.Api.Proto.Docflow.DocumentInfoV3)
    SharedDtor();
  }
  
  void DocumentInfoV3::SharedDtor() {
    if (departmentid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete departmentid_;
    }
    if (customdocumentid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete customdocumentid_;
    }
    if (editingsettingid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete editingsettingid_;
    }
    if (this != default_instance_) {
      delete fullversion_;
      delete participants_;
      delete documentlinks_;
      delete packetinfo_;
      delete letterinfo_;
      delete draftinfo_;
      delete templateinfo_;
      delete origin_;
    }
  }
  
  void DocumentInfoV3::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* DocumentInfoV3::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return DocumentInfoV3_descriptor_;
  }
  
  const DocumentInfoV3& DocumentInfoV3::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_Docflow_2fDocumentInfoV3_2eproto();
    return *default_instance_;
  }
  
  DocumentInfoV3* DocumentInfoV3::default_instance_ = NULL;
  
  DocumentInfoV3* DocumentInfoV3::New() const {
    return new DocumentInfoV3;
  }
  
  void DocumentInfoV3::Clear() {
  #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>(      \
    &reinterpret_cast<DocumentInfoV3*>(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)
  
    if (_has_bits_[0 / 32] & 127) {
      ZR_(messagetype_, workflowid_);
      if (has_fullversion()) {
        if (fullversion_ != NULL) fullversion_->::Diadoc::Api::Proto::FullVersion::Clear();
      }
      if (has_participants()) {
        if (participants_ != NULL) participants_->::Diadoc::Api::Proto::Docflow::DocumentParticipants::Clear();
      }
      documentdirection_ = 0;
      if (has_departmentid()) {
        if (departmentid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          departmentid_->clear();
        }
      }
      if (has_customdocumentid()) {
        if (customdocumentid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          customdocumentid_->clear();
        }
      }
    }
    if (_has_bits_[8 / 32] & 65024) {
      ZR_(isread_, isinvitation_);
      if (has_documentlinks()) {
        if (documentlinks_ != NULL) documentlinks_->::Diadoc::Api::Proto::Docflow::DocumentLinks::Clear();
      }
      if (has_packetinfo()) {
        if (packetinfo_ != NULL) packetinfo_->::Diadoc::Api::Proto::Docflow::PacketInfo::Clear();
      }
      if (has_letterinfo()) {
        if (letterinfo_ != NULL) letterinfo_->::Diadoc::Api::Proto::Docflow::DocumentLetterInfo::Clear();
      }
      if (has_draftinfo()) {
        if (draftinfo_ != NULL) draftinfo_->::Diadoc::Api::Proto::Docflow::DocumentDraftInfo::Clear();
      }
    }
    if (_has_bits_[16 / 32] & 458752) {
      if (has_templateinfo()) {
        if (templateinfo_ != NULL) templateinfo_->::Diadoc::Api::Proto::Docflow::DocumentTemplateInfo::Clear();
      }
      if (has_origin()) {
        if (origin_ != NULL) origin_->::Diadoc::Api::Proto::Documents::Origin::Clear();
      }
      if (has_editingsettingid()) {
        if (editingsettingid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          editingsettingid_->clear();
        }
      }
    }
  
  #undef OFFSET_OF_FIELD_
  #undef ZR_
  
    metadata_.Clear();
    customdata_.Clear();
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool DocumentInfoV3::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.Docflow.DocumentInfoV3)
    for (;;) {
      ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383);
      tag = p.first;
      if (!p.second) goto handle_unusual;
      switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
        // required .Diadoc.Api.Proto.FullVersion FullVersion = 1;
        case 1: {
          if (tag == 10) {
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_fullversion()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(16)) goto parse_MessageType;
          break;
        }
  
        // required .Diadoc.Api.Proto.Documents.MessageType MessageType = 2;
        case 2: {
          if (tag == 16) {
           parse_MessageType:
            int value;
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                   input, &value)));
            if (::Diadoc::Api::Proto::Documents::MessageType_IsValid(value)) {
              set_messagetype(static_cast< ::Diadoc::Api::Proto::Documents::MessageType >(value));
            } else {
              mutable_unknown_fields()->AddVarint(2, value);
            }
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(24)) goto parse_WorkflowId;
          break;
        }
  
        // required int32 WorkflowId = 3;
        case 3: {
          if (tag == 24) {
           parse_WorkflowId:
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                   input, &workflowid_)));
            set_has_workflowid();
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(34)) goto parse_Participants;
          break;
        }
  
        // required .Diadoc.Api.Proto.Docflow.DocumentParticipants Participants = 4;
        case 4: {
          if (tag == 34) {
           parse_Participants:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_participants()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(40)) goto parse_DocumentDirection;
          break;
        }
  
        // required .Diadoc.Api.Proto.DocumentDirection DocumentDirection = 5;
        case 5: {
          if (tag == 40) {
           parse_DocumentDirection:
            int value;
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                   input, &value)));
            if (::Diadoc::Api::Proto::DocumentDirection_IsValid(value)) {
              set_documentdirection(static_cast< ::Diadoc::Api::Proto::DocumentDirection >(value));
            } else {
              mutable_unknown_fields()->AddVarint(5, value);
            }
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(50)) goto parse_DepartmentId;
          break;
        }
  
        // required string DepartmentId = 6;
        case 6: {
          if (tag == 50) {
           parse_DepartmentId:
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_departmentid()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->departmentid().data(), this->departmentid().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "departmentid");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(58)) goto parse_CustomDocumentId;
          break;
        }
  
        // optional string CustomDocumentId = 7;
        case 7: {
          if (tag == 58) {
           parse_CustomDocumentId:
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_customdocumentid()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->customdocumentid().data(), this->customdocumentid().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "customdocumentid");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(66)) goto parse_Metadata;
          break;
        }
  
        // repeated .Diadoc.Api.Proto.Events.MetadataItem Metadata = 8;
        case 8: {
          if (tag == 66) {
           parse_Metadata:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                  input, add_metadata()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(66)) goto parse_Metadata;
          if (input->ExpectTag(74)) goto parse_CustomData;
          break;
        }
  
        // repeated .Diadoc.Api.Proto.CustomDataItem CustomData = 9;
        case 9: {
          if (tag == 74) {
           parse_CustomData:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                  input, add_customdata()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(74)) goto parse_CustomData;
          if (input->ExpectTag(82)) goto parse_DocumentLinks;
          break;
        }
  
        // required .Diadoc.Api.Proto.Docflow.DocumentLinks DocumentLinks = 10;
        case 10: {
          if (tag == 82) {
           parse_DocumentLinks:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_documentlinks()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(90)) goto parse_PacketInfo;
          break;
        }
  
        // required .Diadoc.Api.Proto.Docflow.PacketInfo PacketInfo = 11;
        case 11: {
          if (tag == 90) {
           parse_PacketInfo:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_packetinfo()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(96)) goto parse_IsRead;
          break;
        }
  
        // required bool IsRead = 12;
        case 12: {
          if (tag == 96) {
           parse_IsRead:
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                   input, &isread_)));
            set_has_isread();
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(104)) goto parse_IsDeleted;
          break;
        }
  
        // required bool IsDeleted = 13;
        case 13: {
          if (tag == 104) {
           parse_IsDeleted:
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                   input, &isdeleted_)));
            set_has_isdeleted();
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(112)) goto parse_IsInvitation;
          break;
        }
  
        // required bool IsInvitation = 14;
        case 14: {
          if (tag == 112) {
           parse_IsInvitation:
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                   input, &isinvitation_)));
            set_has_isinvitation();
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(122)) goto parse_LetterInfo;
          break;
        }
  
        // optional .Diadoc.Api.Proto.Docflow.DocumentLetterInfo LetterInfo = 15;
        case 15: {
          if (tag == 122) {
           parse_LetterInfo:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_letterinfo()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(130)) goto parse_DraftInfo;
          break;
        }
  
        // optional .Diadoc.Api.Proto.Docflow.DocumentDraftInfo DraftInfo = 16;
        case 16: {
          if (tag == 130) {
           parse_DraftInfo:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_draftinfo()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(138)) goto parse_TemplateInfo;
          break;
        }
  
        // optional .Diadoc.Api.Proto.Docflow.DocumentTemplateInfo TemplateInfo = 17;
        case 17: {
          if (tag == 138) {
           parse_TemplateInfo:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_templateinfo()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(146)) goto parse_Origin;
          break;
        }
  
        // optional .Diadoc.Api.Proto.Documents.Origin Origin = 18;
        case 18: {
          if (tag == 146) {
           parse_Origin:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_origin()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(154)) goto parse_EditingSettingId;
          break;
        }
  
        // optional string EditingSettingId = 19 [default = ""];
        case 19: {
          if (tag == 154) {
           parse_EditingSettingId:
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_editingsettingid()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->editingsettingid().data(), this->editingsettingid().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "editingsettingid");
          } 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.Docflow.DocumentInfoV3)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:Diadoc.Api.Proto.Docflow.DocumentInfoV3)
    return false;
  #undef DO_
  }
  
  void DocumentInfoV3::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:Diadoc.Api.Proto.Docflow.DocumentInfoV3)
    // required .Diadoc.Api.Proto.FullVersion FullVersion = 1;
    if (has_fullversion()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        1, this->fullversion(), output);
    }
  
    // required .Diadoc.Api.Proto.Documents.MessageType MessageType = 2;
    if (has_messagetype()) {
      ::google::protobuf::internal::WireFormatLite::WriteEnum(
        2, this->messagetype(), output);
    }
  
    // required int32 WorkflowId = 3;
    if (has_workflowid()) {
      ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->workflowid(), output);
    }
  
    // required .Diadoc.Api.Proto.Docflow.DocumentParticipants Participants = 4;
    if (has_participants()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        4, this->participants(), output);
    }
  
    // required .Diadoc.Api.Proto.DocumentDirection DocumentDirection = 5;
    if (has_documentdirection()) {
      ::google::protobuf::internal::WireFormatLite::WriteEnum(
        5, this->documentdirection(), output);
    }
  
    // required string DepartmentId = 6;
    if (has_departmentid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->departmentid().data(), this->departmentid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "departmentid");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        6, this->departmentid(), output);
    }
  
    // optional string CustomDocumentId = 7;
    if (has_customdocumentid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->customdocumentid().data(), this->customdocumentid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "customdocumentid");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        7, this->customdocumentid(), output);
    }
  
    // repeated .Diadoc.Api.Proto.Events.MetadataItem Metadata = 8;
    for (int i = 0; i < this->metadata_size(); i++) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        8, this->metadata(i), output);
    }
  
    // repeated .Diadoc.Api.Proto.CustomDataItem CustomData = 9;
    for (int i = 0; i < this->customdata_size(); i++) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        9, this->customdata(i), output);
    }
  
    // required .Diadoc.Api.Proto.Docflow.DocumentLinks DocumentLinks = 10;
    if (has_documentlinks()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        10, this->documentlinks(), output);
    }
  
    // required .Diadoc.Api.Proto.Docflow.PacketInfo PacketInfo = 11;
    if (has_packetinfo()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        11, this->packetinfo(), output);
    }
  
    // required bool IsRead = 12;
    if (has_isread()) {
      ::google::protobuf::internal::WireFormatLite::WriteBool(12, this->isread(), output);
    }
  
    // required bool IsDeleted = 13;
    if (has_isdeleted()) {
      ::google::protobuf::internal::WireFormatLite::WriteBool(13, this->isdeleted(), output);
    }
  
    // required bool IsInvitation = 14;
    if (has_isinvitation()) {
      ::google::protobuf::internal::WireFormatLite::WriteBool(14, this->isinvitation(), output);
    }
  
    // optional .Diadoc.Api.Proto.Docflow.DocumentLetterInfo LetterInfo = 15;
    if (has_letterinfo()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        15, this->letterinfo(), output);
    }
  
    // optional .Diadoc.Api.Proto.Docflow.DocumentDraftInfo DraftInfo = 16;
    if (has_draftinfo()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        16, this->draftinfo(), output);
    }
  
    // optional .Diadoc.Api.Proto.Docflow.DocumentTemplateInfo TemplateInfo = 17;
    if (has_templateinfo()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        17, this->templateinfo(), output);
    }
  
    // optional .Diadoc.Api.Proto.Documents.Origin Origin = 18;
    if (has_origin()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        18, this->origin(), output);
    }
  
    // optional string EditingSettingId = 19 [default = ""];
    if (has_editingsettingid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->editingsettingid().data(), this->editingsettingid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "editingsettingid");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        19, this->editingsettingid(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:Diadoc.Api.Proto.Docflow.DocumentInfoV3)
  }
  
  ::google::protobuf::uint8* DocumentInfoV3::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:Diadoc.Api.Proto.Docflow.DocumentInfoV3)
    // required .Diadoc.Api.Proto.FullVersion FullVersion = 1;
    if (has_fullversion()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          1, this->fullversion(), target);
    }
  
    // required .Diadoc.Api.Proto.Documents.MessageType MessageType = 2;
    if (has_messagetype()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
        2, this->messagetype(), target);
    }
  
    // required int32 WorkflowId = 3;
    if (has_workflowid()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->workflowid(), target);
    }
  
    // required .Diadoc.Api.Proto.Docflow.DocumentParticipants Participants = 4;
    if (has_participants()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          4, this->participants(), target);
    }
  
    // required .Diadoc.Api.Proto.DocumentDirection DocumentDirection = 5;
    if (has_documentdirection()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
        5, this->documentdirection(), target);
    }
  
    // required string DepartmentId = 6;
    if (has_departmentid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->departmentid().data(), this->departmentid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "departmentid");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          6, this->departmentid(), target);
    }
  
    // optional string CustomDocumentId = 7;
    if (has_customdocumentid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->customdocumentid().data(), this->customdocumentid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "customdocumentid");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          7, this->customdocumentid(), target);
    }
  
    // repeated .Diadoc.Api.Proto.Events.MetadataItem Metadata = 8;
    for (int i = 0; i < this->metadata_size(); i++) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          8, this->metadata(i), target);
    }
  
    // repeated .Diadoc.Api.Proto.CustomDataItem CustomData = 9;
    for (int i = 0; i < this->customdata_size(); i++) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          9, this->customdata(i), target);
    }
  
    // required .Diadoc.Api.Proto.Docflow.DocumentLinks DocumentLinks = 10;
    if (has_documentlinks()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          10, this->documentlinks(), target);
    }
  
    // required .Diadoc.Api.Proto.Docflow.PacketInfo PacketInfo = 11;
    if (has_packetinfo()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          11, this->packetinfo(), target);
    }
  
    // required bool IsRead = 12;
    if (has_isread()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(12, this->isread(), target);
    }
  
    // required bool IsDeleted = 13;
    if (has_isdeleted()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(13, this->isdeleted(), target);
    }
  
    // required bool IsInvitation = 14;
    if (has_isinvitation()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(14, this->isinvitation(), target);
    }
  
    // optional .Diadoc.Api.Proto.Docflow.DocumentLetterInfo LetterInfo = 15;
    if (has_letterinfo()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          15, this->letterinfo(), target);
    }
  
    // optional .Diadoc.Api.Proto.Docflow.DocumentDraftInfo DraftInfo = 16;
    if (has_draftinfo()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          16, this->draftinfo(), target);
    }
  
    // optional .Diadoc.Api.Proto.Docflow.DocumentTemplateInfo TemplateInfo = 17;
    if (has_templateinfo()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          17, this->templateinfo(), target);
    }
  
    // optional .Diadoc.Api.Proto.Documents.Origin Origin = 18;
    if (has_origin()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          18, this->origin(), target);
    }
  
    // optional string EditingSettingId = 19 [default = ""];
    if (has_editingsettingid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->editingsettingid().data(), this->editingsettingid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "editingsettingid");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          19, this->editingsettingid(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:Diadoc.Api.Proto.Docflow.DocumentInfoV3)
    return target;
  }
  
  int DocumentInfoV3::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // required .Diadoc.Api.Proto.FullVersion FullVersion = 1;
      if (has_fullversion()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->fullversion());
      }
  
      // required .Diadoc.Api.Proto.Documents.MessageType MessageType = 2;
      if (has_messagetype()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::EnumSize(this->messagetype());
      }
  
      // required int32 WorkflowId = 3;
      if (has_workflowid()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::Int32Size(
            this->workflowid());
      }
  
      // required .Diadoc.Api.Proto.Docflow.DocumentParticipants Participants = 4;
      if (has_participants()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->participants());
      }
  
      // required .Diadoc.Api.Proto.DocumentDirection DocumentDirection = 5;
      if (has_documentdirection()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::EnumSize(this->documentdirection());
      }
  
      // required string DepartmentId = 6;
      if (has_departmentid()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->departmentid());
      }
  
      // optional string CustomDocumentId = 7;
      if (has_customdocumentid()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->customdocumentid());
      }
  
    }
    if (_has_bits_[9 / 32] & (0xffu << (9 % 32))) {
      // required .Diadoc.Api.Proto.Docflow.DocumentLinks DocumentLinks = 10;
      if (has_documentlinks()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->documentlinks());
      }
  
      // required .Diadoc.Api.Proto.Docflow.PacketInfo PacketInfo = 11;
      if (has_packetinfo()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->packetinfo());
      }
  
      // required bool IsRead = 12;
      if (has_isread()) {
        total_size += 1 + 1;
      }
  
      // required bool IsDeleted = 13;
      if (has_isdeleted()) {
        total_size += 1 + 1;
      }
  
      // required bool IsInvitation = 14;
      if (has_isinvitation()) {
        total_size += 1 + 1;
      }
  
      // optional .Diadoc.Api.Proto.Docflow.DocumentLetterInfo LetterInfo = 15;
      if (has_letterinfo()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->letterinfo());
      }
  
      // optional .Diadoc.Api.Proto.Docflow.DocumentDraftInfo DraftInfo = 16;
      if (has_draftinfo()) {
        total_size += 2 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->draftinfo());
      }
  
    }
    if (_has_bits_[16 / 32] & (0xffu << (16 % 32))) {
      // optional .Diadoc.Api.Proto.Docflow.DocumentTemplateInfo TemplateInfo = 17;
      if (has_templateinfo()) {
        total_size += 2 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->templateinfo());
      }
  
      // optional .Diadoc.Api.Proto.Documents.Origin Origin = 18;
      if (has_origin()) {
        total_size += 2 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->origin());
      }
  
      // optional string EditingSettingId = 19 [default = ""];
      if (has_editingsettingid()) {
        total_size += 2 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->editingsettingid());
      }
  
    }
    // repeated .Diadoc.Api.Proto.Events.MetadataItem Metadata = 8;
    total_size += 1 * this->metadata_size();
    for (int i = 0; i < this->metadata_size(); i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->metadata(i));
    }
  
    // repeated .Diadoc.Api.Proto.CustomDataItem CustomData = 9;
    total_size += 1 * this->customdata_size();
    for (int i = 0; i < this->customdata_size(); i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->customdata(i));
    }
  
    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 DocumentInfoV3::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const DocumentInfoV3* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const DocumentInfoV3*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void DocumentInfoV3::MergeFrom(const DocumentInfoV3& from) {
    GOOGLE_CHECK_NE(&from, this);
    metadata_.MergeFrom(from.metadata_);
    customdata_.MergeFrom(from.customdata_);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_fullversion()) {
        mutable_fullversion()->::Diadoc::Api::Proto::FullVersion::MergeFrom(from.fullversion());
      }
      if (from.has_messagetype()) {
        set_messagetype(from.messagetype());
      }
      if (from.has_workflowid()) {
        set_workflowid(from.workflowid());
      }
      if (from.has_participants()) {
        mutable_participants()->::Diadoc::Api::Proto::Docflow::DocumentParticipants::MergeFrom(from.participants());
      }
      if (from.has_documentdirection()) {
        set_documentdirection(from.documentdirection());
      }
      if (from.has_departmentid()) {
        set_departmentid(from.departmentid());
      }
      if (from.has_customdocumentid()) {
        set_customdocumentid(from.customdocumentid());
      }
    }
    if (from._has_bits_[9 / 32] & (0xffu << (9 % 32))) {
      if (from.has_documentlinks()) {
        mutable_documentlinks()->::Diadoc::Api::Proto::Docflow::DocumentLinks::MergeFrom(from.documentlinks());
      }
      if (from.has_packetinfo()) {
        mutable_packetinfo()->::Diadoc::Api::Proto::Docflow::PacketInfo::MergeFrom(from.packetinfo());
      }
      if (from.has_isread()) {
        set_isread(from.isread());
      }
      if (from.has_isdeleted()) {
        set_isdeleted(from.isdeleted());
      }
      if (from.has_isinvitation()) {
        set_isinvitation(from.isinvitation());
      }
      if (from.has_letterinfo()) {
        mutable_letterinfo()->::Diadoc::Api::Proto::Docflow::DocumentLetterInfo::MergeFrom(from.letterinfo());
      }
      if (from.has_draftinfo()) {
        mutable_draftinfo()->::Diadoc::Api::Proto::Docflow::DocumentDraftInfo::MergeFrom(from.draftinfo());
      }
    }
    if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) {
      if (from.has_templateinfo()) {
        mutable_templateinfo()->::Diadoc::Api::Proto::Docflow::DocumentTemplateInfo::MergeFrom(from.templateinfo());
      }
      if (from.has_origin()) {
        mutable_origin()->::Diadoc::Api::Proto::Documents::Origin::MergeFrom(from.origin());
      }
      if (from.has_editingsettingid()) {
        set_editingsettingid(from.editingsettingid());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void DocumentInfoV3::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void DocumentInfoV3::CopyFrom(const DocumentInfoV3& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool DocumentInfoV3::IsInitialized() const {
    if ((_has_bits_[0] & 0x00003e3f) != 0x00003e3f) return false;
  
    if (has_fullversion()) {
      if (!this->fullversion().IsInitialized()) return false;
    }
    if (has_participants()) {
      if (!this->participants().IsInitialized()) return false;
    }
    if (!::google::protobuf::internal::AllAreInitialized(this->metadata())) return false;
    if (!::google::protobuf::internal::AllAreInitialized(this->customdata())) return false;
    if (has_documentlinks()) {
      if (!this->documentlinks().IsInitialized()) return false;
    }
    if (has_packetinfo()) {
      if (!this->packetinfo().IsInitialized()) return false;
    }
    if (has_letterinfo()) {
      if (!this->letterinfo().IsInitialized()) return false;
    }
    if (has_draftinfo()) {
      if (!this->draftinfo().IsInitialized()) return false;
    }
    if (has_templateinfo()) {
      if (!this->templateinfo().IsInitialized()) return false;
    }
    if (has_origin()) {
      if (!this->origin().IsInitialized()) return false;
    }
    return true;
  }
  
  void DocumentInfoV3::Swap(DocumentInfoV3* other) {
    if (other != this) {
      std::swap(fullversion_, other->fullversion_);
      std::swap(messagetype_, other->messagetype_);
      std::swap(workflowid_, other->workflowid_);
      std::swap(participants_, other->participants_);
      std::swap(documentdirection_, other->documentdirection_);
      std::swap(departmentid_, other->departmentid_);
      std::swap(customdocumentid_, other->customdocumentid_);
      metadata_.Swap(&other->metadata_);
      customdata_.Swap(&other->customdata_);
      std::swap(documentlinks_, other->documentlinks_);
      std::swap(packetinfo_, other->packetinfo_);
      std::swap(isread_, other->isread_);
      std::swap(isdeleted_, other->isdeleted_);
      std::swap(isinvitation_, other->isinvitation_);
      std::swap(letterinfo_, other->letterinfo_);
      std::swap(draftinfo_, other->draftinfo_);
      std::swap(templateinfo_, other->templateinfo_);
      std::swap(origin_, other->origin_);
      std::swap(editingsettingid_, other->editingsettingid_);
      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 DocumentInfoV3::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = DocumentInfoV3_descriptor_;
    metadata.reflection = DocumentInfoV3_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int DocumentParticipants::kSenderFieldNumber;
  const int DocumentParticipants::kProxyFieldNumber;
  const int DocumentParticipants::kRecipientFieldNumber;
  const int DocumentParticipants::kIsInternalFieldNumber;
  #endif  // !_MSC_VER
  
  DocumentParticipants::DocumentParticipants()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:Diadoc.Api.Proto.Docflow.DocumentParticipants)
  }
  
  void DocumentParticipants::InitAsDefaultInstance() {
    sender_ = const_cast< ::Diadoc::Api::Proto::Docflow::DocumentParticipant*>(&::Diadoc::Api::Proto::Docflow::DocumentParticipant::default_instance());
    proxy_ = const_cast< ::Diadoc::Api::Proto::Docflow::DocumentParticipant*>(&::Diadoc::Api::Proto::Docflow::DocumentParticipant::default_instance());
    recipient_ = const_cast< ::Diadoc::Api::Proto::Docflow::DocumentParticipant*>(&::Diadoc::Api::Proto::Docflow::DocumentParticipant::default_instance());
  }
  
  DocumentParticipants::DocumentParticipants(const DocumentParticipants& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:Diadoc.Api.Proto.Docflow.DocumentParticipants)
  }
  
  void DocumentParticipants::SharedCtor() {
    _cached_size_ = 0;
    sender_ = NULL;
    proxy_ = NULL;
    recipient_ = NULL;
    isinternal_ = false;
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  DocumentParticipants::~DocumentParticipants() {
    // @@protoc_insertion_point(destructor:Diadoc.Api.Proto.Docflow.DocumentParticipants)
    SharedDtor();
  }
  
  void DocumentParticipants::SharedDtor() {
    if (this != default_instance_) {
      delete sender_;
      delete proxy_;
      delete recipient_;
    }
  }
  
  void DocumentParticipants::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* DocumentParticipants::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return DocumentParticipants_descriptor_;
  }
  
  const DocumentParticipants& DocumentParticipants::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_Docflow_2fDocumentInfoV3_2eproto();
    return *default_instance_;
  }
  
  DocumentParticipants* DocumentParticipants::default_instance_ = NULL;
  
  DocumentParticipants* DocumentParticipants::New() const {
    return new DocumentParticipants;
  }
  
  void DocumentParticipants::Clear() {
    if (_has_bits_[0 / 32] & 15) {
      if (has_sender()) {
        if (sender_ != NULL) sender_->::Diadoc::Api::Proto::Docflow::DocumentParticipant::Clear();
      }
      if (has_proxy()) {
        if (proxy_ != NULL) proxy_->::Diadoc::Api::Proto::Docflow::DocumentParticipant::Clear();
      }
      if (has_recipient()) {
        if (recipient_ != NULL) recipient_->::Diadoc::Api::Proto::Docflow::DocumentParticipant::Clear();
      }
      isinternal_ = false;
    }
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool DocumentParticipants::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.Docflow.DocumentParticipants)
    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 .Diadoc.Api.Proto.Docflow.DocumentParticipant Sender = 1;
        case 1: {
          if (tag == 10) {
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_sender()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_Proxy;
          break;
        }
  
        // optional .Diadoc.Api.Proto.Docflow.DocumentParticipant Proxy = 2;
        case 2: {
          if (tag == 18) {
           parse_Proxy:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_proxy()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(26)) goto parse_Recipient;
          break;
        }
  
        // optional .Diadoc.Api.Proto.Docflow.DocumentParticipant Recipient = 3;
        case 3: {
          if (tag == 26) {
           parse_Recipient:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_recipient()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(32)) goto parse_IsInternal;
          break;
        }
  
        // required bool IsInternal = 4;
        case 4: {
          if (tag == 32) {
           parse_IsInternal:
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                   input, &isinternal_)));
            set_has_isinternal();
          } 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.Docflow.DocumentParticipants)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:Diadoc.Api.Proto.Docflow.DocumentParticipants)
    return false;
  #undef DO_
  }
  
  void DocumentParticipants::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:Diadoc.Api.Proto.Docflow.DocumentParticipants)
    // required .Diadoc.Api.Proto.Docflow.DocumentParticipant Sender = 1;
    if (has_sender()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        1, this->sender(), output);
    }
  
    // optional .Diadoc.Api.Proto.Docflow.DocumentParticipant Proxy = 2;
    if (has_proxy()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        2, this->proxy(), output);
    }
  
    // optional .Diadoc.Api.Proto.Docflow.DocumentParticipant Recipient = 3;
    if (has_recipient()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        3, this->recipient(), output);
    }
  
    // required bool IsInternal = 4;
    if (has_isinternal()) {
      ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->isinternal(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:Diadoc.Api.Proto.Docflow.DocumentParticipants)
  }
  
  ::google::protobuf::uint8* DocumentParticipants::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:Diadoc.Api.Proto.Docflow.DocumentParticipants)
    // required .Diadoc.Api.Proto.Docflow.DocumentParticipant Sender = 1;
    if (has_sender()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          1, this->sender(), target);
    }
  
    // optional .Diadoc.Api.Proto.Docflow.DocumentParticipant Proxy = 2;
    if (has_proxy()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          2, this->proxy(), target);
    }
  
    // optional .Diadoc.Api.Proto.Docflow.DocumentParticipant Recipient = 3;
    if (has_recipient()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          3, this->recipient(), target);
    }
  
    // required bool IsInternal = 4;
    if (has_isinternal()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->isinternal(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:Diadoc.Api.Proto.Docflow.DocumentParticipants)
    return target;
  }
  
  int DocumentParticipants::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // required .Diadoc.Api.Proto.Docflow.DocumentParticipant Sender = 1;
      if (has_sender()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->sender());
      }
  
      // optional .Diadoc.Api.Proto.Docflow.DocumentParticipant Proxy = 2;
      if (has_proxy()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->proxy());
      }
  
      // optional .Diadoc.Api.Proto.Docflow.DocumentParticipant Recipient = 3;
      if (has_recipient()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->recipient());
      }
  
      // required bool IsInternal = 4;
      if (has_isinternal()) {
        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 DocumentParticipants::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const DocumentParticipants* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const DocumentParticipants*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void DocumentParticipants::MergeFrom(const DocumentParticipants& from) {
    GOOGLE_CHECK_NE(&from, this);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_sender()) {
        mutable_sender()->::Diadoc::Api::Proto::Docflow::DocumentParticipant::MergeFrom(from.sender());
      }
      if (from.has_proxy()) {
        mutable_proxy()->::Diadoc::Api::Proto::Docflow::DocumentParticipant::MergeFrom(from.proxy());
      }
      if (from.has_recipient()) {
        mutable_recipient()->::Diadoc::Api::Proto::Docflow::DocumentParticipant::MergeFrom(from.recipient());
      }
      if (from.has_isinternal()) {
        set_isinternal(from.isinternal());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void DocumentParticipants::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void DocumentParticipants::CopyFrom(const DocumentParticipants& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool DocumentParticipants::IsInitialized() const {
    if ((_has_bits_[0] & 0x00000009) != 0x00000009) return false;
  
    if (has_sender()) {
      if (!this->sender().IsInitialized()) return false;
    }
    if (has_proxy()) {
      if (!this->proxy().IsInitialized()) return false;
    }
    if (has_recipient()) {
      if (!this->recipient().IsInitialized()) return false;
    }
    return true;
  }
  
  void DocumentParticipants::Swap(DocumentParticipants* other) {
    if (other != this) {
      std::swap(sender_, other->sender_);
      std::swap(proxy_, other->proxy_);
      std::swap(recipient_, other->recipient_);
      std::swap(isinternal_, other->isinternal_);
      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 DocumentParticipants::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = DocumentParticipants_descriptor_;
    metadata.reflection = DocumentParticipants_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int DocumentParticipant::kBoxIdFieldNumber;
  const int DocumentParticipant::kDepartmentIdFieldNumber;
  #endif  // !_MSC_VER
  
  DocumentParticipant::DocumentParticipant()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:Diadoc.Api.Proto.Docflow.DocumentParticipant)
  }
  
  void DocumentParticipant::InitAsDefaultInstance() {
  }
  
  DocumentParticipant::DocumentParticipant(const DocumentParticipant& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:Diadoc.Api.Proto.Docflow.DocumentParticipant)
  }
  
  void DocumentParticipant::SharedCtor() {
    ::google::protobuf::internal::GetEmptyString();
    _cached_size_ = 0;
    boxid_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    departmentid_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  DocumentParticipant::~DocumentParticipant() {
    // @@protoc_insertion_point(destructor:Diadoc.Api.Proto.Docflow.DocumentParticipant)
    SharedDtor();
  }
  
  void DocumentParticipant::SharedDtor() {
    if (boxid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete boxid_;
    }
    if (departmentid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete departmentid_;
    }
    if (this != default_instance_) {
    }
  }
  
  void DocumentParticipant::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* DocumentParticipant::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return DocumentParticipant_descriptor_;
  }
  
  const DocumentParticipant& DocumentParticipant::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_Docflow_2fDocumentInfoV3_2eproto();
    return *default_instance_;
  }
  
  DocumentParticipant* DocumentParticipant::default_instance_ = NULL;
  
  DocumentParticipant* DocumentParticipant::New() const {
    return new DocumentParticipant;
  }
  
  void DocumentParticipant::Clear() {
    if (_has_bits_[0 / 32] & 3) {
      if (has_boxid()) {
        if (boxid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          boxid_->clear();
        }
      }
      if (has_departmentid()) {
        if (departmentid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          departmentid_->clear();
        }
      }
    }
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool DocumentParticipant::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.Docflow.DocumentParticipant)
    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 BoxId = 1;
        case 1: {
          if (tag == 10) {
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_boxid()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->boxid().data(), this->boxid().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "boxid");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_DepartmentId;
          break;
        }
  
        // optional string DepartmentId = 2;
        case 2: {
          if (tag == 18) {
           parse_DepartmentId:
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_departmentid()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->departmentid().data(), this->departmentid().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "departmentid");
          } 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.Docflow.DocumentParticipant)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:Diadoc.Api.Proto.Docflow.DocumentParticipant)
    return false;
  #undef DO_
  }
  
  void DocumentParticipant::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:Diadoc.Api.Proto.Docflow.DocumentParticipant)
    // required string BoxId = 1;
    if (has_boxid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->boxid().data(), this->boxid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "boxid");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        1, this->boxid(), output);
    }
  
    // optional string DepartmentId = 2;
    if (has_departmentid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->departmentid().data(), this->departmentid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "departmentid");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        2, this->departmentid(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:Diadoc.Api.Proto.Docflow.DocumentParticipant)
  }
  
  ::google::protobuf::uint8* DocumentParticipant::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:Diadoc.Api.Proto.Docflow.DocumentParticipant)
    // required string BoxId = 1;
    if (has_boxid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->boxid().data(), this->boxid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "boxid");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          1, this->boxid(), target);
    }
  
    // optional string DepartmentId = 2;
    if (has_departmentid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->departmentid().data(), this->departmentid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "departmentid");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          2, this->departmentid(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:Diadoc.Api.Proto.Docflow.DocumentParticipant)
    return target;
  }
  
  int DocumentParticipant::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // required string BoxId = 1;
      if (has_boxid()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->boxid());
      }
  
      // optional string DepartmentId = 2;
      if (has_departmentid()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->departmentid());
      }
  
    }
    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 DocumentParticipant::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const DocumentParticipant* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const DocumentParticipant*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void DocumentParticipant::MergeFrom(const DocumentParticipant& from) {
    GOOGLE_CHECK_NE(&from, this);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_boxid()) {
        set_boxid(from.boxid());
      }
      if (from.has_departmentid()) {
        set_departmentid(from.departmentid());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void DocumentParticipant::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void DocumentParticipant::CopyFrom(const DocumentParticipant& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool DocumentParticipant::IsInitialized() const {
    if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
  
    return true;
  }
  
  void DocumentParticipant::Swap(DocumentParticipant* other) {
    if (other != this) {
      std::swap(boxid_, other->boxid_);
      std::swap(departmentid_, other->departmentid_);
      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 DocumentParticipant::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = DocumentParticipant_descriptor_;
    metadata.reflection = DocumentParticipant_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int DocumentLinks::kInitialIdsFieldNumber;
  const int DocumentLinks::kSubordinateIdsFieldNumber;
  #endif  // !_MSC_VER
  
  DocumentLinks::DocumentLinks()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:Diadoc.Api.Proto.Docflow.DocumentLinks)
  }
  
  void DocumentLinks::InitAsDefaultInstance() {
  }
  
  DocumentLinks::DocumentLinks(const DocumentLinks& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:Diadoc.Api.Proto.Docflow.DocumentLinks)
  }
  
  void DocumentLinks::SharedCtor() {
    _cached_size_ = 0;
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  DocumentLinks::~DocumentLinks() {
    // @@protoc_insertion_point(destructor:Diadoc.Api.Proto.Docflow.DocumentLinks)
    SharedDtor();
  }
  
  void DocumentLinks::SharedDtor() {
    if (this != default_instance_) {
    }
  }
  
  void DocumentLinks::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* DocumentLinks::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return DocumentLinks_descriptor_;
  }
  
  const DocumentLinks& DocumentLinks::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_Docflow_2fDocumentInfoV3_2eproto();
    return *default_instance_;
  }
  
  DocumentLinks* DocumentLinks::default_instance_ = NULL;
  
  DocumentLinks* DocumentLinks::New() const {
    return new DocumentLinks;
  }
  
  void DocumentLinks::Clear() {
    initialids_.Clear();
    subordinateids_.Clear();
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool DocumentLinks::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.Docflow.DocumentLinks)
    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)) {
        // repeated .Diadoc.Api.Proto.DocumentId InitialIds = 1;
        case 1: {
          if (tag == 10) {
           parse_InitialIds:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                  input, add_initialids()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(10)) goto parse_InitialIds;
          if (input->ExpectTag(18)) goto parse_SubordinateIds;
          break;
        }
  
        // repeated .Diadoc.Api.Proto.DocumentId SubordinateIds = 2;
        case 2: {
          if (tag == 18) {
           parse_SubordinateIds:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                  input, add_subordinateids()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_SubordinateIds;
          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.Docflow.DocumentLinks)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:Diadoc.Api.Proto.Docflow.DocumentLinks)
    return false;
  #undef DO_
  }
  
  void DocumentLinks::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:Diadoc.Api.Proto.Docflow.DocumentLinks)
    // repeated .Diadoc.Api.Proto.DocumentId InitialIds = 1;
    for (int i = 0; i < this->initialids_size(); i++) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        1, this->initialids(i), output);
    }
  
    // repeated .Diadoc.Api.Proto.DocumentId SubordinateIds = 2;
    for (int i = 0; i < this->subordinateids_size(); i++) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        2, this->subordinateids(i), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:Diadoc.Api.Proto.Docflow.DocumentLinks)
  }
  
  ::google::protobuf::uint8* DocumentLinks::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:Diadoc.Api.Proto.Docflow.DocumentLinks)
    // repeated .Diadoc.Api.Proto.DocumentId InitialIds = 1;
    for (int i = 0; i < this->initialids_size(); i++) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          1, this->initialids(i), target);
    }
  
    // repeated .Diadoc.Api.Proto.DocumentId SubordinateIds = 2;
    for (int i = 0; i < this->subordinateids_size(); i++) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          2, this->subordinateids(i), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:Diadoc.Api.Proto.Docflow.DocumentLinks)
    return target;
  }
  
  int DocumentLinks::ByteSize() const {
    int total_size = 0;
  
    // repeated .Diadoc.Api.Proto.DocumentId InitialIds = 1;
    total_size += 1 * this->initialids_size();
    for (int i = 0; i < this->initialids_size(); i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->initialids(i));
    }
  
    // repeated .Diadoc.Api.Proto.DocumentId SubordinateIds = 2;
    total_size += 1 * this->subordinateids_size();
    for (int i = 0; i < this->subordinateids_size(); i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->subordinateids(i));
    }
  
    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 DocumentLinks::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const DocumentLinks* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const DocumentLinks*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void DocumentLinks::MergeFrom(const DocumentLinks& from) {
    GOOGLE_CHECK_NE(&from, this);
    initialids_.MergeFrom(from.initialids_);
    subordinateids_.MergeFrom(from.subordinateids_);
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void DocumentLinks::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void DocumentLinks::CopyFrom(const DocumentLinks& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool DocumentLinks::IsInitialized() const {
  
    if (!::google::protobuf::internal::AllAreInitialized(this->initialids())) return false;
    if (!::google::protobuf::internal::AllAreInitialized(this->subordinateids())) return false;
    return true;
  }
  
  void DocumentLinks::Swap(DocumentLinks* other) {
    if (other != this) {
      initialids_.Swap(&other->initialids_);
      subordinateids_.Swap(&other->subordinateids_);
      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 DocumentLinks::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = DocumentLinks_descriptor_;
    metadata.reflection = DocumentLinks_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int PacketInfo::kLockModeFieldNumber;
  const int PacketInfo::kPacketIdFieldNumber;
  const int PacketInfo::kAddedAtFieldNumber;
  #endif  // !_MSC_VER
  
  PacketInfo::PacketInfo()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:Diadoc.Api.Proto.Docflow.PacketInfo)
  }
  
  void PacketInfo::InitAsDefaultInstance() {
    addedat_ = const_cast< ::Diadoc::Api::Proto::Timestamp*>(&::Diadoc::Api::Proto::Timestamp::default_instance());
  }
  
  PacketInfo::PacketInfo(const PacketInfo& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:Diadoc.Api.Proto.Docflow.PacketInfo)
  }
  
  void PacketInfo::SharedCtor() {
    ::google::protobuf::internal::GetEmptyString();
    _cached_size_ = 0;
    lockmode_ = 0;
    packetid_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    addedat_ = NULL;
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  PacketInfo::~PacketInfo() {
    // @@protoc_insertion_point(destructor:Diadoc.Api.Proto.Docflow.PacketInfo)
    SharedDtor();
  }
  
  void PacketInfo::SharedDtor() {
    if (packetid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete packetid_;
    }
    if (this != default_instance_) {
      delete addedat_;
    }
  }
  
  void PacketInfo::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* PacketInfo::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return PacketInfo_descriptor_;
  }
  
  const PacketInfo& PacketInfo::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_Docflow_2fDocumentInfoV3_2eproto();
    return *default_instance_;
  }
  
  PacketInfo* PacketInfo::default_instance_ = NULL;
  
  PacketInfo* PacketInfo::New() const {
    return new PacketInfo;
  }
  
  void PacketInfo::Clear() {
    if (_has_bits_[0 / 32] & 7) {
      lockmode_ = 0;
      if (has_packetid()) {
        if (packetid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          packetid_->clear();
        }
      }
      if (has_addedat()) {
        if (addedat_ != NULL) addedat_->::Diadoc::Api::Proto::Timestamp::Clear();
      }
    }
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool PacketInfo::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.Docflow.PacketInfo)
    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 .Diadoc.Api.Proto.LockMode LockMode = 1;
        case 1: {
          if (tag == 8) {
            int value;
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                   input, &value)));
            if (::Diadoc::Api::Proto::LockMode_IsValid(value)) {
              set_lockmode(static_cast< ::Diadoc::Api::Proto::LockMode >(value));
            } else {
              mutable_unknown_fields()->AddVarint(1, value);
            }
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_PacketId;
          break;
        }
  
        // optional string PacketId = 2;
        case 2: {
          if (tag == 18) {
           parse_PacketId:
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_packetid()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->packetid().data(), this->packetid().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "packetid");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(26)) goto parse_AddedAt;
          break;
        }
  
        // optional .Diadoc.Api.Proto.Timestamp AddedAt = 3;
        case 3: {
          if (tag == 26) {
           parse_AddedAt:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_addedat()));
          } 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.Docflow.PacketInfo)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:Diadoc.Api.Proto.Docflow.PacketInfo)
    return false;
  #undef DO_
  }
  
  void PacketInfo::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:Diadoc.Api.Proto.Docflow.PacketInfo)
    // required .Diadoc.Api.Proto.LockMode LockMode = 1;
    if (has_lockmode()) {
      ::google::protobuf::internal::WireFormatLite::WriteEnum(
        1, this->lockmode(), output);
    }
  
    // optional string PacketId = 2;
    if (has_packetid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->packetid().data(), this->packetid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "packetid");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        2, this->packetid(), output);
    }
  
    // optional .Diadoc.Api.Proto.Timestamp AddedAt = 3;
    if (has_addedat()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        3, this->addedat(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:Diadoc.Api.Proto.Docflow.PacketInfo)
  }
  
  ::google::protobuf::uint8* PacketInfo::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:Diadoc.Api.Proto.Docflow.PacketInfo)
    // required .Diadoc.Api.Proto.LockMode LockMode = 1;
    if (has_lockmode()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
        1, this->lockmode(), target);
    }
  
    // optional string PacketId = 2;
    if (has_packetid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->packetid().data(), this->packetid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "packetid");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          2, this->packetid(), target);
    }
  
    // optional .Diadoc.Api.Proto.Timestamp AddedAt = 3;
    if (has_addedat()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          3, this->addedat(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:Diadoc.Api.Proto.Docflow.PacketInfo)
    return target;
  }
  
  int PacketInfo::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // required .Diadoc.Api.Proto.LockMode LockMode = 1;
      if (has_lockmode()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::EnumSize(this->lockmode());
      }
  
      // optional string PacketId = 2;
      if (has_packetid()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->packetid());
      }
  
      // optional .Diadoc.Api.Proto.Timestamp AddedAt = 3;
      if (has_addedat()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->addedat());
      }
  
    }
    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 PacketInfo::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const PacketInfo* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const PacketInfo*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void PacketInfo::MergeFrom(const PacketInfo& from) {
    GOOGLE_CHECK_NE(&from, this);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_lockmode()) {
        set_lockmode(from.lockmode());
      }
      if (from.has_packetid()) {
        set_packetid(from.packetid());
      }
      if (from.has_addedat()) {
        mutable_addedat()->::Diadoc::Api::Proto::Timestamp::MergeFrom(from.addedat());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void PacketInfo::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void PacketInfo::CopyFrom(const PacketInfo& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool PacketInfo::IsInitialized() const {
    if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
  
    if (has_addedat()) {
      if (!this->addedat().IsInitialized()) return false;
    }
    return true;
  }
  
  void PacketInfo::Swap(PacketInfo* other) {
    if (other != this) {
      std::swap(lockmode_, other->lockmode_);
      std::swap(packetid_, other->packetid_);
      std::swap(addedat_, other->addedat_);
      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 PacketInfo::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = PacketInfo_descriptor_;
    metadata.reflection = PacketInfo_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int DocumentLetterInfo::kIsEncryptedFieldNumber;
  const int DocumentLetterInfo::kForwardDocumentEventsFieldNumber;
  const int DocumentLetterInfo::kIsTestFieldNumber;
  #endif  // !_MSC_VER
  
  DocumentLetterInfo::DocumentLetterInfo()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:Diadoc.Api.Proto.Docflow.DocumentLetterInfo)
  }
  
  void DocumentLetterInfo::InitAsDefaultInstance() {
  }
  
  DocumentLetterInfo::DocumentLetterInfo(const DocumentLetterInfo& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:Diadoc.Api.Proto.Docflow.DocumentLetterInfo)
  }
  
  void DocumentLetterInfo::SharedCtor() {
    _cached_size_ = 0;
    isencrypted_ = false;
    istest_ = false;
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  DocumentLetterInfo::~DocumentLetterInfo() {
    // @@protoc_insertion_point(destructor:Diadoc.Api.Proto.Docflow.DocumentLetterInfo)
    SharedDtor();
  }
  
  void DocumentLetterInfo::SharedDtor() {
    if (this != default_instance_) {
    }
  }
  
  void DocumentLetterInfo::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* DocumentLetterInfo::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return DocumentLetterInfo_descriptor_;
  }
  
  const DocumentLetterInfo& DocumentLetterInfo::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_Docflow_2fDocumentInfoV3_2eproto();
    return *default_instance_;
  }
  
  DocumentLetterInfo* DocumentLetterInfo::default_instance_ = NULL;
  
  DocumentLetterInfo* DocumentLetterInfo::New() const {
    return new DocumentLetterInfo;
  }
  
  void DocumentLetterInfo::Clear() {
  #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>(      \
    &reinterpret_cast<DocumentLetterInfo*>(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_(isencrypted_, istest_);
  
  #undef OFFSET_OF_FIELD_
  #undef ZR_
  
    forwarddocumentevents_.Clear();
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool DocumentLetterInfo::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.Docflow.DocumentLetterInfo)
    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 IsEncrypted = 1;
        case 1: {
          if (tag == 8) {
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                   input, &isencrypted_)));
            set_has_isencrypted();
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_ForwardDocumentEvents;
          break;
        }
  
        // repeated .Diadoc.Api.Proto.ForwardDocumentEvent ForwardDocumentEvents = 2;
        case 2: {
          if (tag == 18) {
           parse_ForwardDocumentEvents:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                  input, add_forwarddocumentevents()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_ForwardDocumentEvents;
          if (input->ExpectTag(24)) goto parse_IsTest;
          break;
        }
  
        // required bool IsTest = 3;
        case 3: {
          if (tag == 24) {
           parse_IsTest:
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                   input, &istest_)));
            set_has_istest();
          } 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.Docflow.DocumentLetterInfo)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:Diadoc.Api.Proto.Docflow.DocumentLetterInfo)
    return false;
  #undef DO_
  }
  
  void DocumentLetterInfo::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:Diadoc.Api.Proto.Docflow.DocumentLetterInfo)
    // required bool IsEncrypted = 1;
    if (has_isencrypted()) {
      ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->isencrypted(), output);
    }
  
    // repeated .Diadoc.Api.Proto.ForwardDocumentEvent ForwardDocumentEvents = 2;
    for (int i = 0; i < this->forwarddocumentevents_size(); i++) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        2, this->forwarddocumentevents(i), output);
    }
  
    // required bool IsTest = 3;
    if (has_istest()) {
      ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->istest(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:Diadoc.Api.Proto.Docflow.DocumentLetterInfo)
  }
  
  ::google::protobuf::uint8* DocumentLetterInfo::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:Diadoc.Api.Proto.Docflow.DocumentLetterInfo)
    // required bool IsEncrypted = 1;
    if (has_isencrypted()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->isencrypted(), target);
    }
  
    // repeated .Diadoc.Api.Proto.ForwardDocumentEvent ForwardDocumentEvents = 2;
    for (int i = 0; i < this->forwarddocumentevents_size(); i++) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          2, this->forwarddocumentevents(i), target);
    }
  
    // required bool IsTest = 3;
    if (has_istest()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->istest(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:Diadoc.Api.Proto.Docflow.DocumentLetterInfo)
    return target;
  }
  
  int DocumentLetterInfo::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // required bool IsEncrypted = 1;
      if (has_isencrypted()) {
        total_size += 1 + 1;
      }
  
      // required bool IsTest = 3;
      if (has_istest()) {
        total_size += 1 + 1;
      }
  
    }
    // repeated .Diadoc.Api.Proto.ForwardDocumentEvent ForwardDocumentEvents = 2;
    total_size += 1 * this->forwarddocumentevents_size();
    for (int i = 0; i < this->forwarddocumentevents_size(); i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->forwarddocumentevents(i));
    }
  
    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 DocumentLetterInfo::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const DocumentLetterInfo* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const DocumentLetterInfo*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void DocumentLetterInfo::MergeFrom(const DocumentLetterInfo& from) {
    GOOGLE_CHECK_NE(&from, this);
    forwarddocumentevents_.MergeFrom(from.forwarddocumentevents_);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_isencrypted()) {
        set_isencrypted(from.isencrypted());
      }
      if (from.has_istest()) {
        set_istest(from.istest());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void DocumentLetterInfo::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void DocumentLetterInfo::CopyFrom(const DocumentLetterInfo& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool DocumentLetterInfo::IsInitialized() const {
    if ((_has_bits_[0] & 0x00000005) != 0x00000005) return false;
  
    if (!::google::protobuf::internal::AllAreInitialized(this->forwarddocumentevents())) return false;
    return true;
  }
  
  void DocumentLetterInfo::Swap(DocumentLetterInfo* other) {
    if (other != this) {
      std::swap(isencrypted_, other->isencrypted_);
      forwarddocumentevents_.Swap(&other->forwarddocumentevents_);
      std::swap(istest_, other->istest_);
      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 DocumentLetterInfo::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = DocumentLetterInfo_descriptor_;
    metadata.reflection = DocumentLetterInfo_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int DocumentDraftInfo::kIsRecycledFieldNumber;
  const int DocumentDraftInfo::kIsLockedFieldNumber;
  const int DocumentDraftInfo::kTransformedToLetterIdsFieldNumber;
  #endif  // !_MSC_VER
  
  DocumentDraftInfo::DocumentDraftInfo()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:Diadoc.Api.Proto.Docflow.DocumentDraftInfo)
  }
  
  void DocumentDraftInfo::InitAsDefaultInstance() {
  }
  
  DocumentDraftInfo::DocumentDraftInfo(const DocumentDraftInfo& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:Diadoc.Api.Proto.Docflow.DocumentDraftInfo)
  }
  
  void DocumentDraftInfo::SharedCtor() {
    ::google::protobuf::internal::GetEmptyString();
    _cached_size_ = 0;
    isrecycled_ = false;
    islocked_ = false;
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  DocumentDraftInfo::~DocumentDraftInfo() {
    // @@protoc_insertion_point(destructor:Diadoc.Api.Proto.Docflow.DocumentDraftInfo)
    SharedDtor();
  }
  
  void DocumentDraftInfo::SharedDtor() {
    if (this != default_instance_) {
    }
  }
  
  void DocumentDraftInfo::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* DocumentDraftInfo::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return DocumentDraftInfo_descriptor_;
  }
  
  const DocumentDraftInfo& DocumentDraftInfo::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_Docflow_2fDocumentInfoV3_2eproto();
    return *default_instance_;
  }
  
  DocumentDraftInfo* DocumentDraftInfo::default_instance_ = NULL;
  
  DocumentDraftInfo* DocumentDraftInfo::New() const {
    return new DocumentDraftInfo;
  }
  
  void DocumentDraftInfo::Clear() {
  #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>(      \
    &reinterpret_cast<DocumentDraftInfo*>(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_(isrecycled_, islocked_);
  
  #undef OFFSET_OF_FIELD_
  #undef ZR_
  
    transformedtoletterids_.Clear();
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool DocumentDraftInfo::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.Docflow.DocumentDraftInfo)
    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 IsRecycled = 1;
        case 1: {
          if (tag == 8) {
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                   input, &isrecycled_)));
            set_has_isrecycled();
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(16)) goto parse_IsLocked;
          break;
        }
  
        // required bool IsLocked = 2;
        case 2: {
          if (tag == 16) {
           parse_IsLocked:
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                   input, &islocked_)));
            set_has_islocked();
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(26)) goto parse_TransformedToLetterIds;
          break;
        }
  
        // repeated string TransformedToLetterIds = 3;
        case 3: {
          if (tag == 26) {
           parse_TransformedToLetterIds:
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->add_transformedtoletterids()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->transformedtoletterids(this->transformedtoletterids_size() - 1).data(),
              this->transformedtoletterids(this->transformedtoletterids_size() - 1).length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "transformedtoletterids");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(26)) goto parse_TransformedToLetterIds;
          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.Docflow.DocumentDraftInfo)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:Diadoc.Api.Proto.Docflow.DocumentDraftInfo)
    return false;
  #undef DO_
  }
  
  void DocumentDraftInfo::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:Diadoc.Api.Proto.Docflow.DocumentDraftInfo)
    // required bool IsRecycled = 1;
    if (has_isrecycled()) {
      ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->isrecycled(), output);
    }
  
    // required bool IsLocked = 2;
    if (has_islocked()) {
      ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->islocked(), output);
    }
  
    // repeated string TransformedToLetterIds = 3;
    for (int i = 0; i < this->transformedtoletterids_size(); i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->transformedtoletterids(i).data(), this->transformedtoletterids(i).length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "transformedtoletterids");
      ::google::protobuf::internal::WireFormatLite::WriteString(
        3, this->transformedtoletterids(i), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:Diadoc.Api.Proto.Docflow.DocumentDraftInfo)
  }
  
  ::google::protobuf::uint8* DocumentDraftInfo::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:Diadoc.Api.Proto.Docflow.DocumentDraftInfo)
    // required bool IsRecycled = 1;
    if (has_isrecycled()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->isrecycled(), target);
    }
  
    // required bool IsLocked = 2;
    if (has_islocked()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->islocked(), target);
    }
  
    // repeated string TransformedToLetterIds = 3;
    for (int i = 0; i < this->transformedtoletterids_size(); i++) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->transformedtoletterids(i).data(), this->transformedtoletterids(i).length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "transformedtoletterids");
      target = ::google::protobuf::internal::WireFormatLite::
        WriteStringToArray(3, this->transformedtoletterids(i), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:Diadoc.Api.Proto.Docflow.DocumentDraftInfo)
    return target;
  }
  
  int DocumentDraftInfo::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // required bool IsRecycled = 1;
      if (has_isrecycled()) {
        total_size += 1 + 1;
      }
  
      // required bool IsLocked = 2;
      if (has_islocked()) {
        total_size += 1 + 1;
      }
  
    }
    // repeated string TransformedToLetterIds = 3;
    total_size += 1 * this->transformedtoletterids_size();
    for (int i = 0; i < this->transformedtoletterids_size(); i++) {
      total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
        this->transformedtoletterids(i));
    }
  
    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 DocumentDraftInfo::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const DocumentDraftInfo* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const DocumentDraftInfo*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void DocumentDraftInfo::MergeFrom(const DocumentDraftInfo& from) {
    GOOGLE_CHECK_NE(&from, this);
    transformedtoletterids_.MergeFrom(from.transformedtoletterids_);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_isrecycled()) {
        set_isrecycled(from.isrecycled());
      }
      if (from.has_islocked()) {
        set_islocked(from.islocked());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void DocumentDraftInfo::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void DocumentDraftInfo::CopyFrom(const DocumentDraftInfo& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool DocumentDraftInfo::IsInitialized() const {
    if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
  
    return true;
  }
  
  void DocumentDraftInfo::Swap(DocumentDraftInfo* other) {
    if (other != this) {
      std::swap(isrecycled_, other->isrecycled_);
      std::swap(islocked_, other->islocked_);
      transformedtoletterids_.Swap(&other->transformedtoletterids_);
      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 DocumentDraftInfo::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = DocumentDraftInfo_descriptor_;
    metadata.reflection = DocumentDraftInfo_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int DocumentTemplateInfo::kLetterParticipantsFieldNumber;
  const int DocumentTemplateInfo::kTransformedToLetterIdsFieldNumber;
  const int DocumentTemplateInfo::kTemplateTransformationInfosFieldNumber;
  const int DocumentTemplateInfo::kTemplateRefusalInfoFieldNumber;
  const int DocumentTemplateInfo::kIsReusableFieldNumber;
  #endif  // !_MSC_VER
  
  DocumentTemplateInfo::DocumentTemplateInfo()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:Diadoc.Api.Proto.Docflow.DocumentTemplateInfo)
  }
  
  void DocumentTemplateInfo::InitAsDefaultInstance() {
    letterparticipants_ = const_cast< ::Diadoc::Api::Proto::Docflow::DocumentParticipants*>(&::Diadoc::Api::Proto::Docflow::DocumentParticipants::default_instance());
    templaterefusalinfo_ = const_cast< ::Diadoc::Api::Proto::Docflow::TemplateRefusalInfo*>(&::Diadoc::Api::Proto::Docflow::TemplateRefusalInfo::default_instance());
  }
  
  DocumentTemplateInfo::DocumentTemplateInfo(const DocumentTemplateInfo& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:Diadoc.Api.Proto.Docflow.DocumentTemplateInfo)
  }
  
  void DocumentTemplateInfo::SharedCtor() {
    ::google::protobuf::internal::GetEmptyString();
    _cached_size_ = 0;
    letterparticipants_ = NULL;
    templaterefusalinfo_ = NULL;
    isreusable_ = false;
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  DocumentTemplateInfo::~DocumentTemplateInfo() {
    // @@protoc_insertion_point(destructor:Diadoc.Api.Proto.Docflow.DocumentTemplateInfo)
    SharedDtor();
  }
  
  void DocumentTemplateInfo::SharedDtor() {
    if (this != default_instance_) {
      delete letterparticipants_;
      delete templaterefusalinfo_;
    }
  }
  
  void DocumentTemplateInfo::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* DocumentTemplateInfo::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return DocumentTemplateInfo_descriptor_;
  }
  
  const DocumentTemplateInfo& DocumentTemplateInfo::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_Docflow_2fDocumentInfoV3_2eproto();
    return *default_instance_;
  }
  
  DocumentTemplateInfo* DocumentTemplateInfo::default_instance_ = NULL;
  
  DocumentTemplateInfo* DocumentTemplateInfo::New() const {
    return new DocumentTemplateInfo;
  }
  
  void DocumentTemplateInfo::Clear() {
    if (_has_bits_[0 / 32] & 25) {
      if (has_letterparticipants()) {
        if (letterparticipants_ != NULL) letterparticipants_->::Diadoc::Api::Proto::Docflow::DocumentParticipants::Clear();
      }
      if (has_templaterefusalinfo()) {
        if (templaterefusalinfo_ != NULL) templaterefusalinfo_->::Diadoc::Api::Proto::Docflow::TemplateRefusalInfo::Clear();
      }
      isreusable_ = false;
    }
    transformedtoletterids_.Clear();
    templatetransformationinfos_.Clear();
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool DocumentTemplateInfo::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.Docflow.DocumentTemplateInfo)
    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 .Diadoc.Api.Proto.Docflow.DocumentParticipants LetterParticipants = 1;
        case 1: {
          if (tag == 10) {
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_letterparticipants()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_TransformedToLetterIds;
          break;
        }
  
        // repeated string TransformedToLetterIds = 2;
        case 2: {
          if (tag == 18) {
           parse_TransformedToLetterIds:
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->add_transformedtoletterids()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->transformedtoletterids(this->transformedtoletterids_size() - 1).data(),
              this->transformedtoletterids(this->transformedtoletterids_size() - 1).length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "transformedtoletterids");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_TransformedToLetterIds;
          if (input->ExpectTag(26)) goto parse_TemplateTransformationInfos;
          break;
        }
  
        // repeated .Diadoc.Api.Proto.Docflow.TemplateTransformationInfo TemplateTransformationInfos = 3;
        case 3: {
          if (tag == 26) {
           parse_TemplateTransformationInfos:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                  input, add_templatetransformationinfos()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(26)) goto parse_TemplateTransformationInfos;
          if (input->ExpectTag(34)) goto parse_TemplateRefusalInfo;
          break;
        }
  
        // optional .Diadoc.Api.Proto.Docflow.TemplateRefusalInfo TemplateRefusalInfo = 4;
        case 4: {
          if (tag == 34) {
           parse_TemplateRefusalInfo:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_templaterefusalinfo()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(40)) goto parse_IsReusable;
          break;
        }
  
        // optional bool IsReusable = 5 [default = false];
        case 5: {
          if (tag == 40) {
           parse_IsReusable:
            DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                     bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                   input, &isreusable_)));
            set_has_isreusable();
          } 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.Docflow.DocumentTemplateInfo)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:Diadoc.Api.Proto.Docflow.DocumentTemplateInfo)
    return false;
  #undef DO_
  }
  
  void DocumentTemplateInfo::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:Diadoc.Api.Proto.Docflow.DocumentTemplateInfo)
    // required .Diadoc.Api.Proto.Docflow.DocumentParticipants LetterParticipants = 1;
    if (has_letterparticipants()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        1, this->letterparticipants(), output);
    }
  
    // repeated string TransformedToLetterIds = 2;
    for (int i = 0; i < this->transformedtoletterids_size(); i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->transformedtoletterids(i).data(), this->transformedtoletterids(i).length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "transformedtoletterids");
      ::google::protobuf::internal::WireFormatLite::WriteString(
        2, this->transformedtoletterids(i), output);
    }
  
    // repeated .Diadoc.Api.Proto.Docflow.TemplateTransformationInfo TemplateTransformationInfos = 3;
    for (int i = 0; i < this->templatetransformationinfos_size(); i++) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        3, this->templatetransformationinfos(i), output);
    }
  
    // optional .Diadoc.Api.Proto.Docflow.TemplateRefusalInfo TemplateRefusalInfo = 4;
    if (has_templaterefusalinfo()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        4, this->templaterefusalinfo(), output);
    }
  
    // optional bool IsReusable = 5 [default = false];
    if (has_isreusable()) {
      ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->isreusable(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:Diadoc.Api.Proto.Docflow.DocumentTemplateInfo)
  }
  
  ::google::protobuf::uint8* DocumentTemplateInfo::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:Diadoc.Api.Proto.Docflow.DocumentTemplateInfo)
    // required .Diadoc.Api.Proto.Docflow.DocumentParticipants LetterParticipants = 1;
    if (has_letterparticipants()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          1, this->letterparticipants(), target);
    }
  
    // repeated string TransformedToLetterIds = 2;
    for (int i = 0; i < this->transformedtoletterids_size(); i++) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->transformedtoletterids(i).data(), this->transformedtoletterids(i).length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "transformedtoletterids");
      target = ::google::protobuf::internal::WireFormatLite::
        WriteStringToArray(2, this->transformedtoletterids(i), target);
    }
  
    // repeated .Diadoc.Api.Proto.Docflow.TemplateTransformationInfo TemplateTransformationInfos = 3;
    for (int i = 0; i < this->templatetransformationinfos_size(); i++) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          3, this->templatetransformationinfos(i), target);
    }
  
    // optional .Diadoc.Api.Proto.Docflow.TemplateRefusalInfo TemplateRefusalInfo = 4;
    if (has_templaterefusalinfo()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          4, this->templaterefusalinfo(), target);
    }
  
    // optional bool IsReusable = 5 [default = false];
    if (has_isreusable()) {
      target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->isreusable(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:Diadoc.Api.Proto.Docflow.DocumentTemplateInfo)
    return target;
  }
  
  int DocumentTemplateInfo::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // required .Diadoc.Api.Proto.Docflow.DocumentParticipants LetterParticipants = 1;
      if (has_letterparticipants()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->letterparticipants());
      }
  
      // optional .Diadoc.Api.Proto.Docflow.TemplateRefusalInfo TemplateRefusalInfo = 4;
      if (has_templaterefusalinfo()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->templaterefusalinfo());
      }
  
      // optional bool IsReusable = 5 [default = false];
      if (has_isreusable()) {
        total_size += 1 + 1;
      }
  
    }
    // repeated string TransformedToLetterIds = 2;
    total_size += 1 * this->transformedtoletterids_size();
    for (int i = 0; i < this->transformedtoletterids_size(); i++) {
      total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
        this->transformedtoletterids(i));
    }
  
    // repeated .Diadoc.Api.Proto.Docflow.TemplateTransformationInfo TemplateTransformationInfos = 3;
    total_size += 1 * this->templatetransformationinfos_size();
    for (int i = 0; i < this->templatetransformationinfos_size(); i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->templatetransformationinfos(i));
    }
  
    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 DocumentTemplateInfo::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const DocumentTemplateInfo* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const DocumentTemplateInfo*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void DocumentTemplateInfo::MergeFrom(const DocumentTemplateInfo& from) {
    GOOGLE_CHECK_NE(&from, this);
    transformedtoletterids_.MergeFrom(from.transformedtoletterids_);
    templatetransformationinfos_.MergeFrom(from.templatetransformationinfos_);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_letterparticipants()) {
        mutable_letterparticipants()->::Diadoc::Api::Proto::Docflow::DocumentParticipants::MergeFrom(from.letterparticipants());
      }
      if (from.has_templaterefusalinfo()) {
        mutable_templaterefusalinfo()->::Diadoc::Api::Proto::Docflow::TemplateRefusalInfo::MergeFrom(from.templaterefusalinfo());
      }
      if (from.has_isreusable()) {
        set_isreusable(from.isreusable());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void DocumentTemplateInfo::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void DocumentTemplateInfo::CopyFrom(const DocumentTemplateInfo& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool DocumentTemplateInfo::IsInitialized() const {
    if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
  
    if (has_letterparticipants()) {
      if (!this->letterparticipants().IsInitialized()) return false;
    }
    if (!::google::protobuf::internal::AllAreInitialized(this->templatetransformationinfos())) return false;
    if (has_templaterefusalinfo()) {
      if (!this->templaterefusalinfo().IsInitialized()) return false;
    }
    return true;
  }
  
  void DocumentTemplateInfo::Swap(DocumentTemplateInfo* other) {
    if (other != this) {
      std::swap(letterparticipants_, other->letterparticipants_);
      transformedtoletterids_.Swap(&other->transformedtoletterids_);
      templatetransformationinfos_.Swap(&other->templatetransformationinfos_);
      std::swap(templaterefusalinfo_, other->templaterefusalinfo_);
      std::swap(isreusable_, other->isreusable_);
      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 DocumentTemplateInfo::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = DocumentTemplateInfo_descriptor_;
    metadata.reflection = DocumentTemplateInfo_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int TemplateTransformationInfo::kTransformationIdFieldNumber;
  const int TemplateTransformationInfo::kTransformedToDocumentIdFieldNumber;
  const int TemplateTransformationInfo::kAuthorUserIdFieldNumber;
  #endif  // !_MSC_VER
  
  TemplateTransformationInfo::TemplateTransformationInfo()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:Diadoc.Api.Proto.Docflow.TemplateTransformationInfo)
  }
  
  void TemplateTransformationInfo::InitAsDefaultInstance() {
    transformedtodocumentid_ = const_cast< ::Diadoc::Api::Proto::DocumentId*>(&::Diadoc::Api::Proto::DocumentId::default_instance());
  }
  
  TemplateTransformationInfo::TemplateTransformationInfo(const TemplateTransformationInfo& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:Diadoc.Api.Proto.Docflow.TemplateTransformationInfo)
  }
  
  void TemplateTransformationInfo::SharedCtor() {
    ::google::protobuf::internal::GetEmptyString();
    _cached_size_ = 0;
    transformationid_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    transformedtodocumentid_ = NULL;
    authoruserid_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  TemplateTransformationInfo::~TemplateTransformationInfo() {
    // @@protoc_insertion_point(destructor:Diadoc.Api.Proto.Docflow.TemplateTransformationInfo)
    SharedDtor();
  }
  
  void TemplateTransformationInfo::SharedDtor() {
    if (transformationid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete transformationid_;
    }
    if (authoruserid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete authoruserid_;
    }
    if (this != default_instance_) {
      delete transformedtodocumentid_;
    }
  }
  
  void TemplateTransformationInfo::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* TemplateTransformationInfo::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return TemplateTransformationInfo_descriptor_;
  }
  
  const TemplateTransformationInfo& TemplateTransformationInfo::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_Docflow_2fDocumentInfoV3_2eproto();
    return *default_instance_;
  }
  
  TemplateTransformationInfo* TemplateTransformationInfo::default_instance_ = NULL;
  
  TemplateTransformationInfo* TemplateTransformationInfo::New() const {
    return new TemplateTransformationInfo;
  }
  
  void TemplateTransformationInfo::Clear() {
    if (_has_bits_[0 / 32] & 7) {
      if (has_transformationid()) {
        if (transformationid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          transformationid_->clear();
        }
      }
      if (has_transformedtodocumentid()) {
        if (transformedtodocumentid_ != NULL) transformedtodocumentid_->::Diadoc::Api::Proto::DocumentId::Clear();
      }
      if (has_authoruserid()) {
        if (authoruserid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          authoruserid_->clear();
        }
      }
    }
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool TemplateTransformationInfo::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.Docflow.TemplateTransformationInfo)
    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 TransformationId = 1;
        case 1: {
          if (tag == 10) {
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_transformationid()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->transformationid().data(), this->transformationid().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "transformationid");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_TransformedToDocumentId;
          break;
        }
  
        // optional .Diadoc.Api.Proto.DocumentId TransformedToDocumentId = 2;
        case 2: {
          if (tag == 18) {
           parse_TransformedToDocumentId:
            DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                 input, mutable_transformedtodocumentid()));
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(26)) goto parse_AuthorUserId;
          break;
        }
  
        // optional string AuthorUserId = 3;
        case 3: {
          if (tag == 26) {
           parse_AuthorUserId:
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_authoruserid()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->authoruserid().data(), this->authoruserid().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "authoruserid");
          } 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.Docflow.TemplateTransformationInfo)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:Diadoc.Api.Proto.Docflow.TemplateTransformationInfo)
    return false;
  #undef DO_
  }
  
  void TemplateTransformationInfo::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:Diadoc.Api.Proto.Docflow.TemplateTransformationInfo)
    // required string TransformationId = 1;
    if (has_transformationid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->transformationid().data(), this->transformationid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "transformationid");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        1, this->transformationid(), output);
    }
  
    // optional .Diadoc.Api.Proto.DocumentId TransformedToDocumentId = 2;
    if (has_transformedtodocumentid()) {
      ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        2, this->transformedtodocumentid(), output);
    }
  
    // optional string AuthorUserId = 3;
    if (has_authoruserid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->authoruserid().data(), this->authoruserid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "authoruserid");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        3, this->authoruserid(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:Diadoc.Api.Proto.Docflow.TemplateTransformationInfo)
  }
  
  ::google::protobuf::uint8* TemplateTransformationInfo::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:Diadoc.Api.Proto.Docflow.TemplateTransformationInfo)
    // required string TransformationId = 1;
    if (has_transformationid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->transformationid().data(), this->transformationid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "transformationid");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          1, this->transformationid(), target);
    }
  
    // optional .Diadoc.Api.Proto.DocumentId TransformedToDocumentId = 2;
    if (has_transformedtodocumentid()) {
      target = ::google::protobuf::internal::WireFormatLite::
        WriteMessageNoVirtualToArray(
          2, this->transformedtodocumentid(), target);
    }
  
    // optional string AuthorUserId = 3;
    if (has_authoruserid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->authoruserid().data(), this->authoruserid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "authoruserid");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          3, this->authoruserid(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:Diadoc.Api.Proto.Docflow.TemplateTransformationInfo)
    return target;
  }
  
  int TemplateTransformationInfo::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // required string TransformationId = 1;
      if (has_transformationid()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->transformationid());
      }
  
      // optional .Diadoc.Api.Proto.DocumentId TransformedToDocumentId = 2;
      if (has_transformedtodocumentid()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
            this->transformedtodocumentid());
      }
  
      // optional string AuthorUserId = 3;
      if (has_authoruserid()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->authoruserid());
      }
  
    }
    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 TemplateTransformationInfo::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const TemplateTransformationInfo* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const TemplateTransformationInfo*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void TemplateTransformationInfo::MergeFrom(const TemplateTransformationInfo& from) {
    GOOGLE_CHECK_NE(&from, this);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_transformationid()) {
        set_transformationid(from.transformationid());
      }
      if (from.has_transformedtodocumentid()) {
        mutable_transformedtodocumentid()->::Diadoc::Api::Proto::DocumentId::MergeFrom(from.transformedtodocumentid());
      }
      if (from.has_authoruserid()) {
        set_authoruserid(from.authoruserid());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void TemplateTransformationInfo::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void TemplateTransformationInfo::CopyFrom(const TemplateTransformationInfo& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool TemplateTransformationInfo::IsInitialized() const {
    if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
  
    if (has_transformedtodocumentid()) {
      if (!this->transformedtodocumentid().IsInitialized()) return false;
    }
    return true;
  }
  
  void TemplateTransformationInfo::Swap(TemplateTransformationInfo* other) {
    if (other != this) {
      std::swap(transformationid_, other->transformationid_);
      std::swap(transformedtodocumentid_, other->transformedtodocumentid_);
      std::swap(authoruserid_, other->authoruserid_);
      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 TemplateTransformationInfo::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = TemplateTransformationInfo_descriptor_;
    metadata.reflection = TemplateTransformationInfo_reflection_;
    return metadata;
  }
  
  
  // ===================================================================
  
  #ifndef _MSC_VER
  const int TemplateRefusalInfo::kBoxIdFieldNumber;
  const int TemplateRefusalInfo::kAuthorUserIdFieldNumber;
  const int TemplateRefusalInfo::kCommentFieldNumber;
  #endif  // !_MSC_VER
  
  TemplateRefusalInfo::TemplateRefusalInfo()
    : ::google::protobuf::Message() {
    SharedCtor();
    // @@protoc_insertion_point(constructor:Diadoc.Api.Proto.Docflow.TemplateRefusalInfo)
  }
  
  void TemplateRefusalInfo::InitAsDefaultInstance() {
  }
  
  TemplateRefusalInfo::TemplateRefusalInfo(const TemplateRefusalInfo& from)
    : ::google::protobuf::Message() {
    SharedCtor();
    MergeFrom(from);
    // @@protoc_insertion_point(copy_constructor:Diadoc.Api.Proto.Docflow.TemplateRefusalInfo)
  }
  
  void TemplateRefusalInfo::SharedCtor() {
    ::google::protobuf::internal::GetEmptyString();
    _cached_size_ = 0;
    boxid_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    authoruserid_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    comment_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
  }
  
  TemplateRefusalInfo::~TemplateRefusalInfo() {
    // @@protoc_insertion_point(destructor:Diadoc.Api.Proto.Docflow.TemplateRefusalInfo)
    SharedDtor();
  }
  
  void TemplateRefusalInfo::SharedDtor() {
    if (boxid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete boxid_;
    }
    if (authoruserid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete authoruserid_;
    }
    if (comment_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      delete comment_;
    }
    if (this != default_instance_) {
    }
  }
  
  void TemplateRefusalInfo::SetCachedSize(int size) const {
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _cached_size_ = size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
  }
  const ::google::protobuf::Descriptor* TemplateRefusalInfo::descriptor() {
    protobuf_AssignDescriptorsOnce();
    return TemplateRefusalInfo_descriptor_;
  }
  
  const TemplateRefusalInfo& TemplateRefusalInfo::default_instance() {
    if (default_instance_ == NULL) protobuf_AddDesc_Docflow_2fDocumentInfoV3_2eproto();
    return *default_instance_;
  }
  
  TemplateRefusalInfo* TemplateRefusalInfo::default_instance_ = NULL;
  
  TemplateRefusalInfo* TemplateRefusalInfo::New() const {
    return new TemplateRefusalInfo;
  }
  
  void TemplateRefusalInfo::Clear() {
    if (_has_bits_[0 / 32] & 7) {
      if (has_boxid()) {
        if (boxid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          boxid_->clear();
        }
      }
      if (has_authoruserid()) {
        if (authoruserid_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          authoruserid_->clear();
        }
      }
      if (has_comment()) {
        if (comment_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
          comment_->clear();
        }
      }
    }
    ::memset(_has_bits_, 0, sizeof(_has_bits_));
    mutable_unknown_fields()->Clear();
  }
  
  bool TemplateRefusalInfo::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.Docflow.TemplateRefusalInfo)
    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 BoxId = 1;
        case 1: {
          if (tag == 10) {
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_boxid()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->boxid().data(), this->boxid().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "boxid");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(18)) goto parse_AuthorUserId;
          break;
        }
  
        // optional string AuthorUserId = 2;
        case 2: {
          if (tag == 18) {
           parse_AuthorUserId:
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_authoruserid()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->authoruserid().data(), this->authoruserid().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "authoruserid");
          } else {
            goto handle_unusual;
          }
          if (input->ExpectTag(26)) goto parse_Comment;
          break;
        }
  
        // optional string Comment = 3;
        case 3: {
          if (tag == 26) {
           parse_Comment:
            DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                  input, this->mutable_comment()));
            ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
              this->comment().data(), this->comment().length(),
              ::google::protobuf::internal::WireFormat::PARSE,
              "comment");
          } 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.Docflow.TemplateRefusalInfo)
    return true;
  failure:
    // @@protoc_insertion_point(parse_failure:Diadoc.Api.Proto.Docflow.TemplateRefusalInfo)
    return false;
  #undef DO_
  }
  
  void TemplateRefusalInfo::SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const {
    // @@protoc_insertion_point(serialize_start:Diadoc.Api.Proto.Docflow.TemplateRefusalInfo)
    // required string BoxId = 1;
    if (has_boxid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->boxid().data(), this->boxid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "boxid");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        1, this->boxid(), output);
    }
  
    // optional string AuthorUserId = 2;
    if (has_authoruserid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->authoruserid().data(), this->authoruserid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "authoruserid");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        2, this->authoruserid(), output);
    }
  
    // optional string Comment = 3;
    if (has_comment()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->comment().data(), this->comment().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "comment");
      ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
        3, this->comment(), output);
    }
  
    if (!unknown_fields().empty()) {
      ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
          unknown_fields(), output);
    }
    // @@protoc_insertion_point(serialize_end:Diadoc.Api.Proto.Docflow.TemplateRefusalInfo)
  }
  
  ::google::protobuf::uint8* TemplateRefusalInfo::SerializeWithCachedSizesToArray(
      ::google::protobuf::uint8* target) const {
    // @@protoc_insertion_point(serialize_to_array_start:Diadoc.Api.Proto.Docflow.TemplateRefusalInfo)
    // required string BoxId = 1;
    if (has_boxid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->boxid().data(), this->boxid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "boxid");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          1, this->boxid(), target);
    }
  
    // optional string AuthorUserId = 2;
    if (has_authoruserid()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->authoruserid().data(), this->authoruserid().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "authoruserid");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          2, this->authoruserid(), target);
    }
  
    // optional string Comment = 3;
    if (has_comment()) {
      ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
        this->comment().data(), this->comment().length(),
        ::google::protobuf::internal::WireFormat::SERIALIZE,
        "comment");
      target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
          3, this->comment(), target);
    }
  
    if (!unknown_fields().empty()) {
      target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
          unknown_fields(), target);
    }
    // @@protoc_insertion_point(serialize_to_array_end:Diadoc.Api.Proto.Docflow.TemplateRefusalInfo)
    return target;
  }
  
  int TemplateRefusalInfo::ByteSize() const {
    int total_size = 0;
  
    if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      // required string BoxId = 1;
      if (has_boxid()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->boxid());
      }
  
      // optional string AuthorUserId = 2;
      if (has_authoruserid()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->authoruserid());
      }
  
      // optional string Comment = 3;
      if (has_comment()) {
        total_size += 1 +
          ::google::protobuf::internal::WireFormatLite::StringSize(
            this->comment());
      }
  
    }
    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 TemplateRefusalInfo::MergeFrom(const ::google::protobuf::Message& from) {
    GOOGLE_CHECK_NE(&from, this);
    const TemplateRefusalInfo* source =
      ::google::protobuf::internal::dynamic_cast_if_available<const TemplateRefusalInfo*>(
        &from);
    if (source == NULL) {
      ::google::protobuf::internal::ReflectionOps::Merge(from, this);
    } else {
      MergeFrom(*source);
    }
  }
  
  void TemplateRefusalInfo::MergeFrom(const TemplateRefusalInfo& from) {
    GOOGLE_CHECK_NE(&from, this);
    if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
      if (from.has_boxid()) {
        set_boxid(from.boxid());
      }
      if (from.has_authoruserid()) {
        set_authoruserid(from.authoruserid());
      }
      if (from.has_comment()) {
        set_comment(from.comment());
      }
    }
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
  
  void TemplateRefusalInfo::CopyFrom(const ::google::protobuf::Message& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  void TemplateRefusalInfo::CopyFrom(const TemplateRefusalInfo& from) {
    if (&from == this) return;
    Clear();
    MergeFrom(from);
  }
  
  bool TemplateRefusalInfo::IsInitialized() const {
    if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
  
    return true;
  }
  
  void TemplateRefusalInfo::Swap(TemplateRefusalInfo* other) {
    if (other != this) {
      std::swap(boxid_, other->boxid_);
      std::swap(authoruserid_, other->authoruserid_);
      std::swap(comment_, other->comment_);
      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 TemplateRefusalInfo::GetMetadata() const {
    protobuf_AssignDescriptorsOnce();
    ::google::protobuf::Metadata metadata;
    metadata.descriptor = TemplateRefusalInfo_descriptor_;
    metadata.reflection = TemplateRefusalInfo_reflection_;
    return metadata;
  }
  
  
  // @@protoc_insertion_point(namespace_scope)
  
  }  // namespace Docflow
  }  // namespace Proto
  }  // namespace Api
  }  // namespace Diadoc
  
  // @@protoc_insertion_point(global_scope)
  