diff --git a/pom.xml b/pom.xml index 04da5511..2b02abf1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 ru.kontur.diadoc diadocsdk - 5.11.0 + 5.12.0 jar diff --git a/proto/SecurityEvents/SecurityEventList.proto b/proto/SecurityEvents/SecurityEventList.proto new file mode 100644 index 00000000..bb8170c2 --- /dev/null +++ b/proto/SecurityEvents/SecurityEventList.proto @@ -0,0 +1,36 @@ +package Diadoc.Api.Proto; +option java_outer_classname = "SecurityEventListProtos"; + +message SecurityEventList { + repeated SecurityEvent Events = 1; + optional string LastIndexKey = 2; +} + +message SecurityEvent { + required string EventId = 1; + required SecurityEventType EventType = 2; + required SecurityEventTarget Target = 3; + required sfixed64 TimestampTicks = 4; + required string Details = 5; + required string IndexKey = 6; +} + +message SecurityEventTarget { + required SecurityEventTargetType Type = 1; + optional DocumentTarget Document = 2; +} + +message DocumentTarget { + required string LetterId = 1; + required string DocumentId = 2; +} + +enum SecurityEventTargetType { + UnknownTargetType = 0; + Document = 1; +} + +enum SecurityEventType { + UnknownEventType = 0; + MalwareDetected = 1; +} \ No newline at end of file diff --git a/src/main/java/Diadoc/Api/DiadocApi.java b/src/main/java/Diadoc/Api/DiadocApi.java index 3d36f80e..d5f12557 100644 --- a/src/main/java/Diadoc/Api/DiadocApi.java +++ b/src/main/java/Diadoc/Api/DiadocApi.java @@ -21,6 +21,7 @@ import Diadoc.Api.parse.ParseClient; import Diadoc.Api.powersOfAttorney.PowerOfAttorneyClient; import Diadoc.Api.print.PrintFormClient; +import Diadoc.Api.security.SecurityClient; import Diadoc.Api.shelf.ShelfClient; import Diadoc.Api.sign.SignClient; import Diadoc.Api.template.TemplateClient; @@ -56,6 +57,7 @@ public class DiadocApi { private final DocumentWorkflowClient documentWorkflowClient; private final OperatorClient operatorClient; private final PartnerEventsClient partnerEventsClient; + private final SecurityClient securityClient; private final DiadocHttpClient diadocHttpClient; public DiadocApi(String apiClientId, String url, @Nullable HttpHost proxyHost, @Nullable ConnectionSettings connectionSettings) { @@ -96,6 +98,7 @@ private DiadocApi(IAuthManager authManager, String url, @Nullable HttpHost proxy documentWorkflowClient = new DocumentWorkflowClient(diadocHttpClient); operatorClient = new OperatorClient(diadocHttpClient); partnerEventsClient = new PartnerEventsClient(diadocHttpClient); + securityClient = new SecurityClient(diadocHttpClient); } public DiadocApi(String apiClientId, String url) { @@ -213,6 +216,8 @@ public OperatorClient getOperatorClient() { public PartnerEventsClient getPartnerEventsClient() { return partnerEventsClient; } + public SecurityClient getSecurityClient() { return securityClient; } + public DiadocHttpClient getDiadocHttpClient() { return diadocHttpClient; } diff --git a/src/main/java/Diadoc/Api/Proto/SecurityEventListProtos.java b/src/main/java/Diadoc/Api/Proto/SecurityEventListProtos.java new file mode 100644 index 00000000..6d1c2bcd --- /dev/null +++ b/src/main/java/Diadoc/Api/Proto/SecurityEventListProtos.java @@ -0,0 +1,4034 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: SecurityEvents/SecurityEventList.proto +// Protobuf Java Version: 4.28.3 + +package Diadoc.Api.Proto; + +public final class SecurityEventListProtos { + private SecurityEventListProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SecurityEventListProtos.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code Diadoc.Api.Proto.SecurityEventTargetType} + */ + public enum SecurityEventTargetType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * UnknownTargetType = 0; + */ + UnknownTargetType(0), + /** + * Document = 1; + */ + Document(1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SecurityEventTargetType.class.getName()); + } + /** + * UnknownTargetType = 0; + */ + public static final int UnknownTargetType_VALUE = 0; + /** + * Document = 1; + */ + public static final int Document_VALUE = 1; + + + public final int getNumber() { + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SecurityEventTargetType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SecurityEventTargetType forNumber(int value) { + switch (value) { + case 0: return UnknownTargetType; + case 1: return Document; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + SecurityEventTargetType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SecurityEventTargetType findValueByNumber(int number) { + return SecurityEventTargetType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return Diadoc.Api.Proto.SecurityEventListProtos.getDescriptor().getEnumTypes().get(0); + } + + private static final SecurityEventTargetType[] VALUES = values(); + + public static SecurityEventTargetType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SecurityEventTargetType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:Diadoc.Api.Proto.SecurityEventTargetType) + } + + /** + * Protobuf enum {@code Diadoc.Api.Proto.SecurityEventType} + */ + public enum SecurityEventType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * UnknownEventType = 0; + */ + UnknownEventType(0), + /** + * MalwareDetected = 1; + */ + MalwareDetected(1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SecurityEventType.class.getName()); + } + /** + * UnknownEventType = 0; + */ + public static final int UnknownEventType_VALUE = 0; + /** + * MalwareDetected = 1; + */ + public static final int MalwareDetected_VALUE = 1; + + + public final int getNumber() { + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SecurityEventType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SecurityEventType forNumber(int value) { + switch (value) { + case 0: return UnknownEventType; + case 1: return MalwareDetected; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + SecurityEventType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SecurityEventType findValueByNumber(int number) { + return SecurityEventType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return Diadoc.Api.Proto.SecurityEventListProtos.getDescriptor().getEnumTypes().get(1); + } + + private static final SecurityEventType[] VALUES = values(); + + public static SecurityEventType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SecurityEventType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:Diadoc.Api.Proto.SecurityEventType) + } + + public interface SecurityEventListOrBuilder extends + // @@protoc_insertion_point(interface_extends:Diadoc.Api.Proto.SecurityEventList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + java.util.List + getEventsList(); + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent getEvents(int index); + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + int getEventsCount(); + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + java.util.List + getEventsOrBuilderList(); + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventOrBuilder getEventsOrBuilder( + int index); + + /** + * optional string LastIndexKey = 2; + * @return Whether the lastIndexKey field is set. + */ + boolean hasLastIndexKey(); + /** + * optional string LastIndexKey = 2; + * @return The lastIndexKey. + */ + java.lang.String getLastIndexKey(); + /** + * optional string LastIndexKey = 2; + * @return The bytes for lastIndexKey. + */ + com.google.protobuf.ByteString + getLastIndexKeyBytes(); + } + /** + * Protobuf type {@code Diadoc.Api.Proto.SecurityEventList} + */ + public static final class SecurityEventList extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:Diadoc.Api.Proto.SecurityEventList) + SecurityEventListOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SecurityEventList.class.getName()); + } + // Use SecurityEventList.newBuilder() to construct. + private SecurityEventList(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SecurityEventList() { + events_ = java.util.Collections.emptyList(); + lastIndexKey_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_SecurityEventList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_SecurityEventList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList.class, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList.Builder.class); + } + + private int bitField0_; + public static final int EVENTS_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List events_; + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + @java.lang.Override + public java.util.List getEventsList() { + return events_; + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + @java.lang.Override + public java.util.List + getEventsOrBuilderList() { + return events_; + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + @java.lang.Override + public int getEventsCount() { + return events_.size(); + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent getEvents(int index) { + return events_.get(index); + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventOrBuilder getEventsOrBuilder( + int index) { + return events_.get(index); + } + + public static final int LASTINDEXKEY_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object lastIndexKey_ = ""; + /** + * optional string LastIndexKey = 2; + * @return Whether the lastIndexKey field is set. + */ + @java.lang.Override + public boolean hasLastIndexKey() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string LastIndexKey = 2; + * @return The lastIndexKey. + */ + @java.lang.Override + public java.lang.String getLastIndexKey() { + java.lang.Object ref = lastIndexKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + lastIndexKey_ = s; + } + return s; + } + } + /** + * optional string LastIndexKey = 2; + * @return The bytes for lastIndexKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLastIndexKeyBytes() { + java.lang.Object ref = lastIndexKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + lastIndexKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + for (int i = 0; i < getEventsCount(); i++) { + if (!getEvents(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < events_.size(); i++) { + output.writeMessage(1, events_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, lastIndexKey_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < events_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, events_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, lastIndexKey_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList)) { + return super.equals(obj); + } + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList other = (Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList) obj; + + if (!getEventsList() + .equals(other.getEventsList())) return false; + if (hasLastIndexKey() != other.hasLastIndexKey()) return false; + if (hasLastIndexKey()) { + if (!getLastIndexKey() + .equals(other.getLastIndexKey())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getEventsCount() > 0) { + hash = (37 * hash) + EVENTS_FIELD_NUMBER; + hash = (53 * hash) + getEventsList().hashCode(); + } + if (hasLastIndexKey()) { + hash = (37 * hash) + LASTINDEXKEY_FIELD_NUMBER; + hash = (53 * hash) + getLastIndexKey().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Diadoc.Api.Proto.SecurityEventList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:Diadoc.Api.Proto.SecurityEventList) + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_SecurityEventList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_SecurityEventList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList.class, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList.Builder.class); + } + + // Construct using Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (eventsBuilder_ == null) { + events_ = java.util.Collections.emptyList(); + } else { + events_ = null; + eventsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + lastIndexKey_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_SecurityEventList_descriptor; + } + + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList getDefaultInstanceForType() { + return Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList.getDefaultInstance(); + } + + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList build() { + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList buildPartial() { + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList result = new Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList result) { + if (eventsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + events_ = java.util.Collections.unmodifiableList(events_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.events_ = events_; + } else { + result.events_ = eventsBuilder_.build(); + } + } + + private void buildPartial0(Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.lastIndexKey_ = lastIndexKey_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList) { + return mergeFrom((Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList other) { + if (other == Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList.getDefaultInstance()) return this; + if (eventsBuilder_ == null) { + if (!other.events_.isEmpty()) { + if (events_.isEmpty()) { + events_ = other.events_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEventsIsMutable(); + events_.addAll(other.events_); + } + onChanged(); + } + } else { + if (!other.events_.isEmpty()) { + if (eventsBuilder_.isEmpty()) { + eventsBuilder_.dispose(); + eventsBuilder_ = null; + events_ = other.events_; + bitField0_ = (bitField0_ & ~0x00000001); + eventsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getEventsFieldBuilder() : null; + } else { + eventsBuilder_.addAllMessages(other.events_); + } + } + } + if (other.hasLastIndexKey()) { + lastIndexKey_ = other.lastIndexKey_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + for (int i = 0; i < getEventsCount(); i++) { + if (!getEvents(i).isInitialized()) { + return false; + } + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent m = + input.readMessage( + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.parser(), + extensionRegistry); + if (eventsBuilder_ == null) { + ensureEventsIsMutable(); + events_.add(m); + } else { + eventsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: { + lastIndexKey_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List events_ = + java.util.Collections.emptyList(); + private void ensureEventsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + events_ = new java.util.ArrayList(events_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.Builder, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventOrBuilder> eventsBuilder_; + + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + public java.util.List getEventsList() { + if (eventsBuilder_ == null) { + return java.util.Collections.unmodifiableList(events_); + } else { + return eventsBuilder_.getMessageList(); + } + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + public int getEventsCount() { + if (eventsBuilder_ == null) { + return events_.size(); + } else { + return eventsBuilder_.getCount(); + } + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent getEvents(int index) { + if (eventsBuilder_ == null) { + return events_.get(index); + } else { + return eventsBuilder_.getMessage(index); + } + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + public Builder setEvents( + int index, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent value) { + if (eventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventsIsMutable(); + events_.set(index, value); + onChanged(); + } else { + eventsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + public Builder setEvents( + int index, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.Builder builderForValue) { + if (eventsBuilder_ == null) { + ensureEventsIsMutable(); + events_.set(index, builderForValue.build()); + onChanged(); + } else { + eventsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + public Builder addEvents(Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent value) { + if (eventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventsIsMutable(); + events_.add(value); + onChanged(); + } else { + eventsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + public Builder addEvents( + int index, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent value) { + if (eventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventsIsMutable(); + events_.add(index, value); + onChanged(); + } else { + eventsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + public Builder addEvents( + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.Builder builderForValue) { + if (eventsBuilder_ == null) { + ensureEventsIsMutable(); + events_.add(builderForValue.build()); + onChanged(); + } else { + eventsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + public Builder addEvents( + int index, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.Builder builderForValue) { + if (eventsBuilder_ == null) { + ensureEventsIsMutable(); + events_.add(index, builderForValue.build()); + onChanged(); + } else { + eventsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + public Builder addAllEvents( + java.lang.Iterable values) { + if (eventsBuilder_ == null) { + ensureEventsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, events_); + onChanged(); + } else { + eventsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + public Builder clearEvents() { + if (eventsBuilder_ == null) { + events_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + eventsBuilder_.clear(); + } + return this; + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + public Builder removeEvents(int index) { + if (eventsBuilder_ == null) { + ensureEventsIsMutable(); + events_.remove(index); + onChanged(); + } else { + eventsBuilder_.remove(index); + } + return this; + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.Builder getEventsBuilder( + int index) { + return getEventsFieldBuilder().getBuilder(index); + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventOrBuilder getEventsOrBuilder( + int index) { + if (eventsBuilder_ == null) { + return events_.get(index); } else { + return eventsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + public java.util.List + getEventsOrBuilderList() { + if (eventsBuilder_ != null) { + return eventsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(events_); + } + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.Builder addEventsBuilder() { + return getEventsFieldBuilder().addBuilder( + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.getDefaultInstance()); + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.Builder addEventsBuilder( + int index) { + return getEventsFieldBuilder().addBuilder( + index, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.getDefaultInstance()); + } + /** + * repeated .Diadoc.Api.Proto.SecurityEvent Events = 1; + */ + public java.util.List + getEventsBuilderList() { + return getEventsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.Builder, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventOrBuilder> + getEventsFieldBuilder() { + if (eventsBuilder_ == null) { + eventsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.Builder, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventOrBuilder>( + events_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + events_ = null; + } + return eventsBuilder_; + } + + private java.lang.Object lastIndexKey_ = ""; + /** + * optional string LastIndexKey = 2; + * @return Whether the lastIndexKey field is set. + */ + public boolean hasLastIndexKey() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional string LastIndexKey = 2; + * @return The lastIndexKey. + */ + public java.lang.String getLastIndexKey() { + java.lang.Object ref = lastIndexKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + lastIndexKey_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string LastIndexKey = 2; + * @return The bytes for lastIndexKey. + */ + public com.google.protobuf.ByteString + getLastIndexKeyBytes() { + java.lang.Object ref = lastIndexKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + lastIndexKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string LastIndexKey = 2; + * @param value The lastIndexKey to set. + * @return This builder for chaining. + */ + public Builder setLastIndexKey( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + lastIndexKey_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * optional string LastIndexKey = 2; + * @return This builder for chaining. + */ + public Builder clearLastIndexKey() { + lastIndexKey_ = getDefaultInstance().getLastIndexKey(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * optional string LastIndexKey = 2; + * @param value The bytes for lastIndexKey to set. + * @return This builder for chaining. + */ + public Builder setLastIndexKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + lastIndexKey_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:Diadoc.Api.Proto.SecurityEventList) + } + + // @@protoc_insertion_point(class_scope:Diadoc.Api.Proto.SecurityEventList) + private static final Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList(); + } + + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecurityEventList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SecurityEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:Diadoc.Api.Proto.SecurityEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * required string EventId = 1; + * @return Whether the eventId field is set. + */ + boolean hasEventId(); + /** + * required string EventId = 1; + * @return The eventId. + */ + java.lang.String getEventId(); + /** + * required string EventId = 1; + * @return The bytes for eventId. + */ + com.google.protobuf.ByteString + getEventIdBytes(); + + /** + * required .Diadoc.Api.Proto.SecurityEventType EventType = 2; + * @return Whether the eventType field is set. + */ + boolean hasEventType(); + /** + * required .Diadoc.Api.Proto.SecurityEventType EventType = 2; + * @return The eventType. + */ + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventType getEventType(); + + /** + * required .Diadoc.Api.Proto.SecurityEventTarget Target = 3; + * @return Whether the target field is set. + */ + boolean hasTarget(); + /** + * required .Diadoc.Api.Proto.SecurityEventTarget Target = 3; + * @return The target. + */ + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget getTarget(); + /** + * required .Diadoc.Api.Proto.SecurityEventTarget Target = 3; + */ + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetOrBuilder getTargetOrBuilder(); + + /** + * required sfixed64 TimestampTicks = 4; + * @return Whether the timestampTicks field is set. + */ + boolean hasTimestampTicks(); + /** + * required sfixed64 TimestampTicks = 4; + * @return The timestampTicks. + */ + long getTimestampTicks(); + + /** + * required string Details = 5; + * @return Whether the details field is set. + */ + boolean hasDetails(); + /** + * required string Details = 5; + * @return The details. + */ + java.lang.String getDetails(); + /** + * required string Details = 5; + * @return The bytes for details. + */ + com.google.protobuf.ByteString + getDetailsBytes(); + + /** + * required string IndexKey = 6; + * @return Whether the indexKey field is set. + */ + boolean hasIndexKey(); + /** + * required string IndexKey = 6; + * @return The indexKey. + */ + java.lang.String getIndexKey(); + /** + * required string IndexKey = 6; + * @return The bytes for indexKey. + */ + com.google.protobuf.ByteString + getIndexKeyBytes(); + } + /** + * Protobuf type {@code Diadoc.Api.Proto.SecurityEvent} + */ + public static final class SecurityEvent extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:Diadoc.Api.Proto.SecurityEvent) + SecurityEventOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SecurityEvent.class.getName()); + } + // Use SecurityEvent.newBuilder() to construct. + private SecurityEvent(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SecurityEvent() { + eventId_ = ""; + eventType_ = 0; + details_ = ""; + indexKey_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_SecurityEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_SecurityEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.class, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.Builder.class); + } + + private int bitField0_; + public static final int EVENTID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object eventId_ = ""; + /** + * required string EventId = 1; + * @return Whether the eventId field is set. + */ + @java.lang.Override + public boolean hasEventId() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required string EventId = 1; + * @return The eventId. + */ + @java.lang.Override + public java.lang.String getEventId() { + java.lang.Object ref = eventId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + eventId_ = s; + } + return s; + } + } + /** + * required string EventId = 1; + * @return The bytes for eventId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getEventIdBytes() { + java.lang.Object ref = eventId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + eventId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVENTTYPE_FIELD_NUMBER = 2; + private int eventType_ = 0; + /** + * required .Diadoc.Api.Proto.SecurityEventType EventType = 2; + * @return Whether the eventType field is set. + */ + @java.lang.Override public boolean hasEventType() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * required .Diadoc.Api.Proto.SecurityEventType EventType = 2; + * @return The eventType. + */ + @java.lang.Override public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventType getEventType() { + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventType result = Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventType.forNumber(eventType_); + return result == null ? Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventType.UnknownEventType : result; + } + + public static final int TARGET_FIELD_NUMBER = 3; + private Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget target_; + /** + * required .Diadoc.Api.Proto.SecurityEventTarget Target = 3; + * @return Whether the target field is set. + */ + @java.lang.Override + public boolean hasTarget() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * required .Diadoc.Api.Proto.SecurityEventTarget Target = 3; + * @return The target. + */ + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget getTarget() { + return target_ == null ? Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget.getDefaultInstance() : target_; + } + /** + * required .Diadoc.Api.Proto.SecurityEventTarget Target = 3; + */ + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetOrBuilder getTargetOrBuilder() { + return target_ == null ? Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget.getDefaultInstance() : target_; + } + + public static final int TIMESTAMPTICKS_FIELD_NUMBER = 4; + private long timestampTicks_ = 0L; + /** + * required sfixed64 TimestampTicks = 4; + * @return Whether the timestampTicks field is set. + */ + @java.lang.Override + public boolean hasTimestampTicks() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * required sfixed64 TimestampTicks = 4; + * @return The timestampTicks. + */ + @java.lang.Override + public long getTimestampTicks() { + return timestampTicks_; + } + + public static final int DETAILS_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object details_ = ""; + /** + * required string Details = 5; + * @return Whether the details field is set. + */ + @java.lang.Override + public boolean hasDetails() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * required string Details = 5; + * @return The details. + */ + @java.lang.Override + public java.lang.String getDetails() { + java.lang.Object ref = details_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + details_ = s; + } + return s; + } + } + /** + * required string Details = 5; + * @return The bytes for details. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDetailsBytes() { + java.lang.Object ref = details_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + details_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INDEXKEY_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object indexKey_ = ""; + /** + * required string IndexKey = 6; + * @return Whether the indexKey field is set. + */ + @java.lang.Override + public boolean hasIndexKey() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * required string IndexKey = 6; + * @return The indexKey. + */ + @java.lang.Override + public java.lang.String getIndexKey() { + java.lang.Object ref = indexKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + indexKey_ = s; + } + return s; + } + } + /** + * required string IndexKey = 6; + * @return The bytes for indexKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIndexKeyBytes() { + java.lang.Object ref = indexKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + indexKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasEventId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasEventType()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasTarget()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasTimestampTicks()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasDetails()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasIndexKey()) { + memoizedIsInitialized = 0; + return false; + } + if (!getTarget().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, eventId_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeEnum(2, eventType_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getTarget()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeSFixed64(4, timestampTicks_); + } + if (((bitField0_ & 0x00000010) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, details_); + } + if (((bitField0_ & 0x00000020) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, indexKey_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, eventId_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, eventType_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getTarget()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeSFixed64Size(4, timestampTicks_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, details_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, indexKey_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent)) { + return super.equals(obj); + } + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent other = (Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent) obj; + + if (hasEventId() != other.hasEventId()) return false; + if (hasEventId()) { + if (!getEventId() + .equals(other.getEventId())) return false; + } + if (hasEventType() != other.hasEventType()) return false; + if (hasEventType()) { + if (eventType_ != other.eventType_) return false; + } + if (hasTarget() != other.hasTarget()) return false; + if (hasTarget()) { + if (!getTarget() + .equals(other.getTarget())) return false; + } + if (hasTimestampTicks() != other.hasTimestampTicks()) return false; + if (hasTimestampTicks()) { + if (getTimestampTicks() + != other.getTimestampTicks()) return false; + } + if (hasDetails() != other.hasDetails()) return false; + if (hasDetails()) { + if (!getDetails() + .equals(other.getDetails())) return false; + } + if (hasIndexKey() != other.hasIndexKey()) return false; + if (hasIndexKey()) { + if (!getIndexKey() + .equals(other.getIndexKey())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEventId()) { + hash = (37 * hash) + EVENTID_FIELD_NUMBER; + hash = (53 * hash) + getEventId().hashCode(); + } + if (hasEventType()) { + hash = (37 * hash) + EVENTTYPE_FIELD_NUMBER; + hash = (53 * hash) + eventType_; + } + if (hasTarget()) { + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + } + if (hasTimestampTicks()) { + hash = (37 * hash) + TIMESTAMPTICKS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestampTicks()); + } + if (hasDetails()) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetails().hashCode(); + } + if (hasIndexKey()) { + hash = (37 * hash) + INDEXKEY_FIELD_NUMBER; + hash = (53 * hash) + getIndexKey().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Diadoc.Api.Proto.SecurityEvent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:Diadoc.Api.Proto.SecurityEvent) + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_SecurityEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_SecurityEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.class, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.Builder.class); + } + + // Construct using Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getTargetFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + eventId_ = ""; + eventType_ = 0; + target_ = null; + if (targetBuilder_ != null) { + targetBuilder_.dispose(); + targetBuilder_ = null; + } + timestampTicks_ = 0L; + details_ = ""; + indexKey_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_SecurityEvent_descriptor; + } + + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent getDefaultInstanceForType() { + return Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.getDefaultInstance(); + } + + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent build() { + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent buildPartial() { + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent result = new Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.eventId_ = eventId_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.eventType_ = eventType_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.target_ = targetBuilder_ == null + ? target_ + : targetBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.timestampTicks_ = timestampTicks_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.details_ = details_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.indexKey_ = indexKey_; + to_bitField0_ |= 0x00000020; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent) { + return mergeFrom((Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent other) { + if (other == Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent.getDefaultInstance()) return this; + if (other.hasEventId()) { + eventId_ = other.eventId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasEventType()) { + setEventType(other.getEventType()); + } + if (other.hasTarget()) { + mergeTarget(other.getTarget()); + } + if (other.hasTimestampTicks()) { + setTimestampTicks(other.getTimestampTicks()); + } + if (other.hasDetails()) { + details_ = other.details_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasIndexKey()) { + indexKey_ = other.indexKey_; + bitField0_ |= 0x00000020; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + if (!hasEventId()) { + return false; + } + if (!hasEventType()) { + return false; + } + if (!hasTarget()) { + return false; + } + if (!hasTimestampTicks()) { + return false; + } + if (!hasDetails()) { + return false; + } + if (!hasIndexKey()) { + return false; + } + if (!getTarget().isInitialized()) { + return false; + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + eventId_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + int tmpRaw = input.readEnum(); + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventType tmpValue = + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventType.forNumber(tmpRaw); + if (tmpValue == null) { + mergeUnknownVarintField(2, tmpRaw); + } else { + eventType_ = tmpRaw; + bitField0_ |= 0x00000002; + } + break; + } // case 16 + case 26: { + input.readMessage( + getTargetFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 33: { + timestampTicks_ = input.readSFixed64(); + bitField0_ |= 0x00000008; + break; + } // case 33 + case 42: { + details_ = input.readBytes(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + indexKey_ = input.readBytes(); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object eventId_ = ""; + /** + * required string EventId = 1; + * @return Whether the eventId field is set. + */ + public boolean hasEventId() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required string EventId = 1; + * @return The eventId. + */ + public java.lang.String getEventId() { + java.lang.Object ref = eventId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + eventId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string EventId = 1; + * @return The bytes for eventId. + */ + public com.google.protobuf.ByteString + getEventIdBytes() { + java.lang.Object ref = eventId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + eventId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string EventId = 1; + * @param value The eventId to set. + * @return This builder for chaining. + */ + public Builder setEventId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + eventId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * required string EventId = 1; + * @return This builder for chaining. + */ + public Builder clearEventId() { + eventId_ = getDefaultInstance().getEventId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * required string EventId = 1; + * @param value The bytes for eventId to set. + * @return This builder for chaining. + */ + public Builder setEventIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + eventId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int eventType_ = 0; + /** + * required .Diadoc.Api.Proto.SecurityEventType EventType = 2; + * @return Whether the eventType field is set. + */ + @java.lang.Override public boolean hasEventType() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * required .Diadoc.Api.Proto.SecurityEventType EventType = 2; + * @return The eventType. + */ + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventType getEventType() { + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventType result = Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventType.forNumber(eventType_); + return result == null ? Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventType.UnknownEventType : result; + } + /** + * required .Diadoc.Api.Proto.SecurityEventType EventType = 2; + * @param value The eventType to set. + * @return This builder for chaining. + */ + public Builder setEventType(Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + eventType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * required .Diadoc.Api.Proto.SecurityEventType EventType = 2; + * @return This builder for chaining. + */ + public Builder clearEventType() { + bitField0_ = (bitField0_ & ~0x00000002); + eventType_ = 0; + onChanged(); + return this; + } + + private Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget target_; + private com.google.protobuf.SingleFieldBuilder< + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget.Builder, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetOrBuilder> targetBuilder_; + /** + * required .Diadoc.Api.Proto.SecurityEventTarget Target = 3; + * @return Whether the target field is set. + */ + public boolean hasTarget() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * required .Diadoc.Api.Proto.SecurityEventTarget Target = 3; + * @return The target. + */ + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget getTarget() { + if (targetBuilder_ == null) { + return target_ == null ? Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget.getDefaultInstance() : target_; + } else { + return targetBuilder_.getMessage(); + } + } + /** + * required .Diadoc.Api.Proto.SecurityEventTarget Target = 3; + */ + public Builder setTarget(Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget value) { + if (targetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + } else { + targetBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * required .Diadoc.Api.Proto.SecurityEventTarget Target = 3; + */ + public Builder setTarget( + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget.Builder builderForValue) { + if (targetBuilder_ == null) { + target_ = builderForValue.build(); + } else { + targetBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * required .Diadoc.Api.Proto.SecurityEventTarget Target = 3; + */ + public Builder mergeTarget(Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget value) { + if (targetBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + target_ != null && + target_ != Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget.getDefaultInstance()) { + getTargetBuilder().mergeFrom(value); + } else { + target_ = value; + } + } else { + targetBuilder_.mergeFrom(value); + } + if (target_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * required .Diadoc.Api.Proto.SecurityEventTarget Target = 3; + */ + public Builder clearTarget() { + bitField0_ = (bitField0_ & ~0x00000004); + target_ = null; + if (targetBuilder_ != null) { + targetBuilder_.dispose(); + targetBuilder_ = null; + } + onChanged(); + return this; + } + /** + * required .Diadoc.Api.Proto.SecurityEventTarget Target = 3; + */ + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget.Builder getTargetBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getTargetFieldBuilder().getBuilder(); + } + /** + * required .Diadoc.Api.Proto.SecurityEventTarget Target = 3; + */ + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetOrBuilder getTargetOrBuilder() { + if (targetBuilder_ != null) { + return targetBuilder_.getMessageOrBuilder(); + } else { + return target_ == null ? + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget.getDefaultInstance() : target_; + } + } + /** + * required .Diadoc.Api.Proto.SecurityEventTarget Target = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget.Builder, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetOrBuilder> + getTargetFieldBuilder() { + if (targetBuilder_ == null) { + targetBuilder_ = new com.google.protobuf.SingleFieldBuilder< + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget.Builder, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetOrBuilder>( + getTarget(), + getParentForChildren(), + isClean()); + target_ = null; + } + return targetBuilder_; + } + + private long timestampTicks_ ; + /** + * required sfixed64 TimestampTicks = 4; + * @return Whether the timestampTicks field is set. + */ + @java.lang.Override + public boolean hasTimestampTicks() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * required sfixed64 TimestampTicks = 4; + * @return The timestampTicks. + */ + @java.lang.Override + public long getTimestampTicks() { + return timestampTicks_; + } + /** + * required sfixed64 TimestampTicks = 4; + * @param value The timestampTicks to set. + * @return This builder for chaining. + */ + public Builder setTimestampTicks(long value) { + + timestampTicks_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * required sfixed64 TimestampTicks = 4; + * @return This builder for chaining. + */ + public Builder clearTimestampTicks() { + bitField0_ = (bitField0_ & ~0x00000008); + timestampTicks_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object details_ = ""; + /** + * required string Details = 5; + * @return Whether the details field is set. + */ + public boolean hasDetails() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * required string Details = 5; + * @return The details. + */ + public java.lang.String getDetails() { + java.lang.Object ref = details_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + details_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string Details = 5; + * @return The bytes for details. + */ + public com.google.protobuf.ByteString + getDetailsBytes() { + java.lang.Object ref = details_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + details_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string Details = 5; + * @param value The details to set. + * @return This builder for chaining. + */ + public Builder setDetails( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + details_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * required string Details = 5; + * @return This builder for chaining. + */ + public Builder clearDetails() { + details_ = getDefaultInstance().getDetails(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * required string Details = 5; + * @param value The bytes for details to set. + * @return This builder for chaining. + */ + public Builder setDetailsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + details_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object indexKey_ = ""; + /** + * required string IndexKey = 6; + * @return Whether the indexKey field is set. + */ + public boolean hasIndexKey() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * required string IndexKey = 6; + * @return The indexKey. + */ + public java.lang.String getIndexKey() { + java.lang.Object ref = indexKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + indexKey_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string IndexKey = 6; + * @return The bytes for indexKey. + */ + public com.google.protobuf.ByteString + getIndexKeyBytes() { + java.lang.Object ref = indexKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + indexKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string IndexKey = 6; + * @param value The indexKey to set. + * @return This builder for chaining. + */ + public Builder setIndexKey( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + indexKey_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * required string IndexKey = 6; + * @return This builder for chaining. + */ + public Builder clearIndexKey() { + indexKey_ = getDefaultInstance().getIndexKey(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * required string IndexKey = 6; + * @param value The bytes for indexKey to set. + * @return This builder for chaining. + */ + public Builder setIndexKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + indexKey_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:Diadoc.Api.Proto.SecurityEvent) + } + + // @@protoc_insertion_point(class_scope:Diadoc.Api.Proto.SecurityEvent) + private static final Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent(); + } + + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecurityEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SecurityEventTargetOrBuilder extends + // @@protoc_insertion_point(interface_extends:Diadoc.Api.Proto.SecurityEventTarget) + com.google.protobuf.MessageOrBuilder { + + /** + * required .Diadoc.Api.Proto.SecurityEventTargetType Type = 1; + * @return Whether the type field is set. + */ + boolean hasType(); + /** + * required .Diadoc.Api.Proto.SecurityEventTargetType Type = 1; + * @return The type. + */ + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetType getType(); + + /** + * optional .Diadoc.Api.Proto.DocumentTarget Document = 2; + * @return Whether the document field is set. + */ + boolean hasDocument(); + /** + * optional .Diadoc.Api.Proto.DocumentTarget Document = 2; + * @return The document. + */ + Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget getDocument(); + /** + * optional .Diadoc.Api.Proto.DocumentTarget Document = 2; + */ + Diadoc.Api.Proto.SecurityEventListProtos.DocumentTargetOrBuilder getDocumentOrBuilder(); + } + /** + * Protobuf type {@code Diadoc.Api.Proto.SecurityEventTarget} + */ + public static final class SecurityEventTarget extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:Diadoc.Api.Proto.SecurityEventTarget) + SecurityEventTargetOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SecurityEventTarget.class.getName()); + } + // Use SecurityEventTarget.newBuilder() to construct. + private SecurityEventTarget(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SecurityEventTarget() { + type_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_SecurityEventTarget_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_SecurityEventTarget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget.class, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget.Builder.class); + } + + private int bitField0_; + public static final int TYPE_FIELD_NUMBER = 1; + private int type_ = 0; + /** + * required .Diadoc.Api.Proto.SecurityEventTargetType Type = 1; + * @return Whether the type field is set. + */ + @java.lang.Override public boolean hasType() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required .Diadoc.Api.Proto.SecurityEventTargetType Type = 1; + * @return The type. + */ + @java.lang.Override public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetType getType() { + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetType result = Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetType.forNumber(type_); + return result == null ? Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetType.UnknownTargetType : result; + } + + public static final int DOCUMENT_FIELD_NUMBER = 2; + private Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget document_; + /** + * optional .Diadoc.Api.Proto.DocumentTarget Document = 2; + * @return Whether the document field is set. + */ + @java.lang.Override + public boolean hasDocument() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional .Diadoc.Api.Proto.DocumentTarget Document = 2; + * @return The document. + */ + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget getDocument() { + return document_ == null ? Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget.getDefaultInstance() : document_; + } + /** + * optional .Diadoc.Api.Proto.DocumentTarget Document = 2; + */ + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.DocumentTargetOrBuilder getDocumentOrBuilder() { + return document_ == null ? Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget.getDefaultInstance() : document_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasType()) { + memoizedIsInitialized = 0; + return false; + } + if (hasDocument()) { + if (!getDocument().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeEnum(1, type_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getDocument()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, type_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getDocument()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget)) { + return super.equals(obj); + } + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget other = (Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget) obj; + + if (hasType() != other.hasType()) return false; + if (hasType()) { + if (type_ != other.type_) return false; + } + if (hasDocument() != other.hasDocument()) return false; + if (hasDocument()) { + if (!getDocument() + .equals(other.getDocument())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasType()) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + } + if (hasDocument()) { + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Diadoc.Api.Proto.SecurityEventTarget} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:Diadoc.Api.Proto.SecurityEventTarget) + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_SecurityEventTarget_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_SecurityEventTarget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget.class, Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget.Builder.class); + } + + // Construct using Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getDocumentFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = 0; + document_ = null; + if (documentBuilder_ != null) { + documentBuilder_.dispose(); + documentBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_SecurityEventTarget_descriptor; + } + + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget getDefaultInstanceForType() { + return Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget.getDefaultInstance(); + } + + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget build() { + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget buildPartial() { + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget result = new Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.document_ = documentBuilder_ == null + ? document_ + : documentBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget) { + return mergeFrom((Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget other) { + if (other == Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget.getDefaultInstance()) return this; + if (other.hasType()) { + setType(other.getType()); + } + if (other.hasDocument()) { + mergeDocument(other.getDocument()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + if (!hasType()) { + return false; + } + if (hasDocument()) { + if (!getDocument().isInitialized()) { + return false; + } + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int tmpRaw = input.readEnum(); + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetType tmpValue = + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetType.forNumber(tmpRaw); + if (tmpValue == null) { + mergeUnknownVarintField(1, tmpRaw); + } else { + type_ = tmpRaw; + bitField0_ |= 0x00000001; + } + break; + } // case 8 + case 18: { + input.readMessage( + getDocumentFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int type_ = 0; + /** + * required .Diadoc.Api.Proto.SecurityEventTargetType Type = 1; + * @return Whether the type field is set. + */ + @java.lang.Override public boolean hasType() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required .Diadoc.Api.Proto.SecurityEventTargetType Type = 1; + * @return The type. + */ + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetType getType() { + Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetType result = Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetType.forNumber(type_); + return result == null ? Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetType.UnknownTargetType : result; + } + /** + * required .Diadoc.Api.Proto.SecurityEventTargetType Type = 1; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTargetType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * required .Diadoc.Api.Proto.SecurityEventTargetType Type = 1; + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } + + private Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget document_; + private com.google.protobuf.SingleFieldBuilder< + Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget, Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget.Builder, Diadoc.Api.Proto.SecurityEventListProtos.DocumentTargetOrBuilder> documentBuilder_; + /** + * optional .Diadoc.Api.Proto.DocumentTarget Document = 2; + * @return Whether the document field is set. + */ + public boolean hasDocument() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional .Diadoc.Api.Proto.DocumentTarget Document = 2; + * @return The document. + */ + public Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget getDocument() { + if (documentBuilder_ == null) { + return document_ == null ? Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget.getDefaultInstance() : document_; + } else { + return documentBuilder_.getMessage(); + } + } + /** + * optional .Diadoc.Api.Proto.DocumentTarget Document = 2; + */ + public Builder setDocument(Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget value) { + if (documentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + document_ = value; + } else { + documentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * optional .Diadoc.Api.Proto.DocumentTarget Document = 2; + */ + public Builder setDocument( + Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget.Builder builderForValue) { + if (documentBuilder_ == null) { + document_ = builderForValue.build(); + } else { + documentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * optional .Diadoc.Api.Proto.DocumentTarget Document = 2; + */ + public Builder mergeDocument(Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget value) { + if (documentBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + document_ != null && + document_ != Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget.getDefaultInstance()) { + getDocumentBuilder().mergeFrom(value); + } else { + document_ = value; + } + } else { + documentBuilder_.mergeFrom(value); + } + if (document_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * optional .Diadoc.Api.Proto.DocumentTarget Document = 2; + */ + public Builder clearDocument() { + bitField0_ = (bitField0_ & ~0x00000002); + document_ = null; + if (documentBuilder_ != null) { + documentBuilder_.dispose(); + documentBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .Diadoc.Api.Proto.DocumentTarget Document = 2; + */ + public Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget.Builder getDocumentBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getDocumentFieldBuilder().getBuilder(); + } + /** + * optional .Diadoc.Api.Proto.DocumentTarget Document = 2; + */ + public Diadoc.Api.Proto.SecurityEventListProtos.DocumentTargetOrBuilder getDocumentOrBuilder() { + if (documentBuilder_ != null) { + return documentBuilder_.getMessageOrBuilder(); + } else { + return document_ == null ? + Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget.getDefaultInstance() : document_; + } + } + /** + * optional .Diadoc.Api.Proto.DocumentTarget Document = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget, Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget.Builder, Diadoc.Api.Proto.SecurityEventListProtos.DocumentTargetOrBuilder> + getDocumentFieldBuilder() { + if (documentBuilder_ == null) { + documentBuilder_ = new com.google.protobuf.SingleFieldBuilder< + Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget, Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget.Builder, Diadoc.Api.Proto.SecurityEventListProtos.DocumentTargetOrBuilder>( + getDocument(), + getParentForChildren(), + isClean()); + document_ = null; + } + return documentBuilder_; + } + + // @@protoc_insertion_point(builder_scope:Diadoc.Api.Proto.SecurityEventTarget) + } + + // @@protoc_insertion_point(class_scope:Diadoc.Api.Proto.SecurityEventTarget) + private static final Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget(); + } + + public static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecurityEventTarget parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventTarget getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DocumentTargetOrBuilder extends + // @@protoc_insertion_point(interface_extends:Diadoc.Api.Proto.DocumentTarget) + com.google.protobuf.MessageOrBuilder { + + /** + * required string LetterId = 1; + * @return Whether the letterId field is set. + */ + boolean hasLetterId(); + /** + * required string LetterId = 1; + * @return The letterId. + */ + java.lang.String getLetterId(); + /** + * required string LetterId = 1; + * @return The bytes for letterId. + */ + com.google.protobuf.ByteString + getLetterIdBytes(); + + /** + * required string DocumentId = 2; + * @return Whether the documentId field is set. + */ + boolean hasDocumentId(); + /** + * required string DocumentId = 2; + * @return The documentId. + */ + java.lang.String getDocumentId(); + /** + * required string DocumentId = 2; + * @return The bytes for documentId. + */ + com.google.protobuf.ByteString + getDocumentIdBytes(); + } + /** + * Protobuf type {@code Diadoc.Api.Proto.DocumentTarget} + */ + public static final class DocumentTarget extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:Diadoc.Api.Proto.DocumentTarget) + DocumentTargetOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DocumentTarget.class.getName()); + } + // Use DocumentTarget.newBuilder() to construct. + private DocumentTarget(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DocumentTarget() { + letterId_ = ""; + documentId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_DocumentTarget_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_DocumentTarget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget.class, Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget.Builder.class); + } + + private int bitField0_; + public static final int LETTERID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object letterId_ = ""; + /** + * required string LetterId = 1; + * @return Whether the letterId field is set. + */ + @java.lang.Override + public boolean hasLetterId() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required string LetterId = 1; + * @return The letterId. + */ + @java.lang.Override + public java.lang.String getLetterId() { + java.lang.Object ref = letterId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + letterId_ = s; + } + return s; + } + } + /** + * required string LetterId = 1; + * @return The bytes for letterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLetterIdBytes() { + java.lang.Object ref = letterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + letterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOCUMENTID_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object documentId_ = ""; + /** + * required string DocumentId = 2; + * @return Whether the documentId field is set. + */ + @java.lang.Override + public boolean hasDocumentId() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * required string DocumentId = 2; + * @return The documentId. + */ + @java.lang.Override + public java.lang.String getDocumentId() { + java.lang.Object ref = documentId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + documentId_ = s; + } + return s; + } + } + /** + * required string DocumentId = 2; + * @return The bytes for documentId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDocumentIdBytes() { + java.lang.Object ref = documentId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + documentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasLetterId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasDocumentId()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, letterId_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, documentId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, letterId_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, documentId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget)) { + return super.equals(obj); + } + Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget other = (Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget) obj; + + if (hasLetterId() != other.hasLetterId()) return false; + if (hasLetterId()) { + if (!getLetterId() + .equals(other.getLetterId())) return false; + } + if (hasDocumentId() != other.hasDocumentId()) return false; + if (hasDocumentId()) { + if (!getDocumentId() + .equals(other.getDocumentId())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasLetterId()) { + hash = (37 * hash) + LETTERID_FIELD_NUMBER; + hash = (53 * hash) + getLetterId().hashCode(); + } + if (hasDocumentId()) { + hash = (37 * hash) + DOCUMENTID_FIELD_NUMBER; + hash = (53 * hash) + getDocumentId().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Diadoc.Api.Proto.DocumentTarget} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:Diadoc.Api.Proto.DocumentTarget) + Diadoc.Api.Proto.SecurityEventListProtos.DocumentTargetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_DocumentTarget_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_DocumentTarget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget.class, Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget.Builder.class); + } + + // Construct using Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + letterId_ = ""; + documentId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return Diadoc.Api.Proto.SecurityEventListProtos.internal_static_Diadoc_Api_Proto_DocumentTarget_descriptor; + } + + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget getDefaultInstanceForType() { + return Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget.getDefaultInstance(); + } + + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget build() { + Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget buildPartial() { + Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget result = new Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.letterId_ = letterId_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.documentId_ = documentId_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget) { + return mergeFrom((Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget other) { + if (other == Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget.getDefaultInstance()) return this; + if (other.hasLetterId()) { + letterId_ = other.letterId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasDocumentId()) { + documentId_ = other.documentId_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + if (!hasLetterId()) { + return false; + } + if (!hasDocumentId()) { + return false; + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + letterId_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + documentId_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object letterId_ = ""; + /** + * required string LetterId = 1; + * @return Whether the letterId field is set. + */ + public boolean hasLetterId() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required string LetterId = 1; + * @return The letterId. + */ + public java.lang.String getLetterId() { + java.lang.Object ref = letterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + letterId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string LetterId = 1; + * @return The bytes for letterId. + */ + public com.google.protobuf.ByteString + getLetterIdBytes() { + java.lang.Object ref = letterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + letterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string LetterId = 1; + * @param value The letterId to set. + * @return This builder for chaining. + */ + public Builder setLetterId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + letterId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * required string LetterId = 1; + * @return This builder for chaining. + */ + public Builder clearLetterId() { + letterId_ = getDefaultInstance().getLetterId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * required string LetterId = 1; + * @param value The bytes for letterId to set. + * @return This builder for chaining. + */ + public Builder setLetterIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + letterId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object documentId_ = ""; + /** + * required string DocumentId = 2; + * @return Whether the documentId field is set. + */ + public boolean hasDocumentId() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * required string DocumentId = 2; + * @return The documentId. + */ + public java.lang.String getDocumentId() { + java.lang.Object ref = documentId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + documentId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string DocumentId = 2; + * @return The bytes for documentId. + */ + public com.google.protobuf.ByteString + getDocumentIdBytes() { + java.lang.Object ref = documentId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + documentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string DocumentId = 2; + * @param value The documentId to set. + * @return This builder for chaining. + */ + public Builder setDocumentId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + documentId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * required string DocumentId = 2; + * @return This builder for chaining. + */ + public Builder clearDocumentId() { + documentId_ = getDefaultInstance().getDocumentId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * required string DocumentId = 2; + * @param value The bytes for documentId to set. + * @return This builder for chaining. + */ + public Builder setDocumentIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + documentId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:Diadoc.Api.Proto.DocumentTarget) + } + + // @@protoc_insertion_point(class_scope:Diadoc.Api.Proto.DocumentTarget) + private static final Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget(); + } + + public static Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentTarget parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public Diadoc.Api.Proto.SecurityEventListProtos.DocumentTarget getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Diadoc_Api_Proto_SecurityEventList_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_Diadoc_Api_Proto_SecurityEventList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Diadoc_Api_Proto_SecurityEvent_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_Diadoc_Api_Proto_SecurityEvent_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Diadoc_Api_Proto_SecurityEventTarget_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_Diadoc_Api_Proto_SecurityEventTarget_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Diadoc_Api_Proto_DocumentTarget_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_Diadoc_Api_Proto_DocumentTarget_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n&SecurityEvents/SecurityEventList.proto" + + "\022\020Diadoc.Api.Proto\"Z\n\021SecurityEventList\022" + + "/\n\006Events\030\001 \003(\0132\037.Diadoc.Api.Proto.Secur" + + "ityEvent\022\024\n\014LastIndexKey\030\002 \001(\t\"\312\001\n\rSecur" + + "ityEvent\022\017\n\007EventId\030\001 \002(\t\0226\n\tEventType\030\002" + + " \002(\0162#.Diadoc.Api.Proto.SecurityEventTyp" + + "e\0225\n\006Target\030\003 \002(\0132%.Diadoc.Api.Proto.Sec" + + "urityEventTarget\022\026\n\016TimestampTicks\030\004 \002(\020" + + "\022\017\n\007Details\030\005 \002(\t\022\020\n\010IndexKey\030\006 \002(\t\"\202\001\n\023" + + "SecurityEventTarget\0227\n\004Type\030\001 \002(\0162).Diad" + + "oc.Api.Proto.SecurityEventTargetType\0222\n\010" + + "Document\030\002 \001(\0132 .Diadoc.Api.Proto.Docume" + + "ntTarget\"6\n\016DocumentTarget\022\020\n\010LetterId\030\001" + + " \002(\t\022\022\n\nDocumentId\030\002 \002(\t*>\n\027SecurityEven" + + "tTargetType\022\025\n\021UnknownTargetType\020\000\022\014\n\010Do" + + "cument\020\001*>\n\021SecurityEventType\022\024\n\020Unknown" + + "EventType\020\000\022\023\n\017MalwareDetected\020\001B\031B\027Secu" + + "rityEventListProtos" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_Diadoc_Api_Proto_SecurityEventList_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Diadoc_Api_Proto_SecurityEventList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_Diadoc_Api_Proto_SecurityEventList_descriptor, + new java.lang.String[] { "Events", "LastIndexKey", }); + internal_static_Diadoc_Api_Proto_SecurityEvent_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_Diadoc_Api_Proto_SecurityEvent_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_Diadoc_Api_Proto_SecurityEvent_descriptor, + new java.lang.String[] { "EventId", "EventType", "Target", "TimestampTicks", "Details", "IndexKey", }); + internal_static_Diadoc_Api_Proto_SecurityEventTarget_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_Diadoc_Api_Proto_SecurityEventTarget_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_Diadoc_Api_Proto_SecurityEventTarget_descriptor, + new java.lang.String[] { "Type", "Document", }); + internal_static_Diadoc_Api_Proto_DocumentTarget_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_Diadoc_Api_Proto_DocumentTarget_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_Diadoc_Api_Proto_DocumentTarget_descriptor, + new java.lang.String[] { "LetterId", "DocumentId", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/Diadoc/Api/security/SecurityClient.java b/src/main/java/Diadoc/Api/security/SecurityClient.java new file mode 100644 index 00000000..6397e48d --- /dev/null +++ b/src/main/java/Diadoc/Api/security/SecurityClient.java @@ -0,0 +1,45 @@ +package Diadoc.Api.security; + +import Diadoc.Api.exceptions.DiadocSdkException; +import Diadoc.Api.httpClient.DiadocHttpClient; +import org.apache.http.client.methods.RequestBuilder; +import org.apache.http.client.utils.URIBuilder; +import org.jetbrains.annotations.Nullable; + +import java.io.IOException; +import java.net.URISyntaxException; + +import static Diadoc.Api.helpers.Tools.addParameterIfNotNull; +import static Diadoc.Api.Proto.SecurityEventListProtos.SecurityEventList; + +public class SecurityClient { + private final DiadocHttpClient diadocHttpClient; + + public SecurityClient(DiadocHttpClient diadocHttpClient) { + this.diadocHttpClient = diadocHttpClient; + } + + public SecurityEventList getSecurityEvents( + String boxId, + @Nullable String afterIndexKey, + @Nullable Integer count + ) throws DiadocSdkException { + if (boxId == null) { + throw new IllegalArgumentException("boxId"); + } + + try { + var uri = new URIBuilder(diadocHttpClient.getBaseUrl()) + .setPath("/V1/GetSecurityEvents") + .addParameter("boxId", boxId); + + addParameterIfNotNull(uri, "afterIndexKey", afterIndexKey); + addParameterIfNotNull(uri, "count", count); + + var request = RequestBuilder.get(uri.build()); + return SecurityEventList.parseFrom(diadocHttpClient.performRequest(request)); + } catch (URISyntaxException | IOException e) { + throw new DiadocSdkException(e); + } + } +}