diff --git a/src/main/java/io/grafeas/v1/Attestation.java b/src/main/java/io/grafeas/v1/Attestation.java index 71c126ec..86329e52 100644 --- a/src/main/java/io/grafeas/v1/Attestation.java +++ b/src/main/java/io/grafeas/v1/Attestation.java @@ -36,6 +36,9 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_grafeas_v1_AttestationNote_Hint_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_grafeas_v1_AttestationNote_Hint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor internal_static_grafeas_v1_Jwt_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_Jwt_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_grafeas_v1_AttestationOccurrence_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -53,11 +56,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "v1\032\027grafeas/v1/common.proto\"f\n\017Attestati" + "onNote\022.\n\004hint\030\001 \001(\0132 .grafeas.v1.Attest" + "ationNote.Hint\032#\n\004Hint\022\033\n\023human_readable" - + "_name\030\001 \001(\t\"^\n\025AttestationOccurrence\022\032\n\022" - + "serialized_payload\030\001 \001(\014\022)\n\nsignatures\030\002" - + " \003(\0132\025.grafeas.v1.SignatureBQ\n\rio.grafea" - + "s.v1P\001Z8google.golang.org/genproto/googl" - + "eapis/grafeas/v1;grafeas\242\002\003GRAb\006proto3" + + "_name\030\001 \001(\t\"\032\n\003Jwt\022\023\n\013compact_jwt\030\001 \001(\t\"" + + "}\n\025AttestationOccurrence\022\032\n\022serialized_p" + + "ayload\030\001 \001(\014\022)\n\nsignatures\030\002 \003(\0132\025.grafe" + + "as.v1.Signature\022\035\n\004jwts\030\003 \003(\0132\017.grafeas." + + "v1.JwtBQ\n\rio.grafeas.v1P\001Z8google.golang" + + ".org/genproto/googleapis/grafeas/v1;graf" + + "eas\242\002\003GRAb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -81,13 +86,20 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "HumanReadableName", }); + internal_static_grafeas_v1_Jwt_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_grafeas_v1_Jwt_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_Jwt_descriptor, + new java.lang.String[] { + "CompactJwt", + }); internal_static_grafeas_v1_AttestationOccurrence_descriptor = - getDescriptor().getMessageTypes().get(1); + getDescriptor().getMessageTypes().get(2); internal_static_grafeas_v1_AttestationOccurrence_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_grafeas_v1_AttestationOccurrence_descriptor, new java.lang.String[] { - "SerializedPayload", "Signatures", + "SerializedPayload", "Signatures", "Jwts", }); io.grafeas.v1.Common.getDescriptor(); } diff --git a/src/main/java/io/grafeas/v1/AttestationOccurrence.java b/src/main/java/io/grafeas/v1/AttestationOccurrence.java index 28d6972a..dc6f44a5 100644 --- a/src/main/java/io/grafeas/v1/AttestationOccurrence.java +++ b/src/main/java/io/grafeas/v1/AttestationOccurrence.java @@ -48,6 +48,7 @@ private AttestationOccurrence(com.google.protobuf.GeneratedMessageV3.Builder private AttestationOccurrence() { serializedPayload_ = com.google.protobuf.ByteString.EMPTY; signatures_ = java.util.Collections.emptyList(); + jwts_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -95,6 +96,15 @@ private AttestationOccurrence( input.readMessage(io.grafeas.v1.Signature.parser(), extensionRegistry)); break; } + case 26: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + jwts_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + jwts_.add(input.readMessage(io.grafeas.v1.Jwt.parser(), extensionRegistry)); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -112,6 +122,9 @@ private AttestationOccurrence( if (((mutable_bitField0_ & 0x00000001) != 0)) { signatures_ = java.util.Collections.unmodifiableList(signatures_); } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + jwts_ = java.util.Collections.unmodifiableList(jwts_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -233,6 +246,114 @@ public io.grafeas.v1.SignatureOrBuilder getSignaturesOrBuilder(int index) { return signatures_.get(index); } + public static final int JWTS_FIELD_NUMBER = 3; + private java.util.List jwts_; + /** + * + * + *
+   * One or more JWTs encoding a self-contained attestation.
+   * Each JWT encodes the payload that it verifies within the JWT itself.
+   * Verifier implementation SHOULD ignore the `serialized_payload` field
+   * when verifying these JWTs.
+   * If only JWTs are present on this AttestationOccurrence, then the
+   * `serialized_payload` SHOULD be left empty.
+   * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+   * Occurrence, but this is not validated by Grafeas metadata API
+   * implementations.  The JWT itself is opaque to Grafeas.
+   * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + @java.lang.Override + public java.util.List getJwtsList() { + return jwts_; + } + /** + * + * + *
+   * One or more JWTs encoding a self-contained attestation.
+   * Each JWT encodes the payload that it verifies within the JWT itself.
+   * Verifier implementation SHOULD ignore the `serialized_payload` field
+   * when verifying these JWTs.
+   * If only JWTs are present on this AttestationOccurrence, then the
+   * `serialized_payload` SHOULD be left empty.
+   * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+   * Occurrence, but this is not validated by Grafeas metadata API
+   * implementations.  The JWT itself is opaque to Grafeas.
+   * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + @java.lang.Override + public java.util.List getJwtsOrBuilderList() { + return jwts_; + } + /** + * + * + *
+   * One or more JWTs encoding a self-contained attestation.
+   * Each JWT encodes the payload that it verifies within the JWT itself.
+   * Verifier implementation SHOULD ignore the `serialized_payload` field
+   * when verifying these JWTs.
+   * If only JWTs are present on this AttestationOccurrence, then the
+   * `serialized_payload` SHOULD be left empty.
+   * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+   * Occurrence, but this is not validated by Grafeas metadata API
+   * implementations.  The JWT itself is opaque to Grafeas.
+   * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + @java.lang.Override + public int getJwtsCount() { + return jwts_.size(); + } + /** + * + * + *
+   * One or more JWTs encoding a self-contained attestation.
+   * Each JWT encodes the payload that it verifies within the JWT itself.
+   * Verifier implementation SHOULD ignore the `serialized_payload` field
+   * when verifying these JWTs.
+   * If only JWTs are present on this AttestationOccurrence, then the
+   * `serialized_payload` SHOULD be left empty.
+   * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+   * Occurrence, but this is not validated by Grafeas metadata API
+   * implementations.  The JWT itself is opaque to Grafeas.
+   * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + @java.lang.Override + public io.grafeas.v1.Jwt getJwts(int index) { + return jwts_.get(index); + } + /** + * + * + *
+   * One or more JWTs encoding a self-contained attestation.
+   * Each JWT encodes the payload that it verifies within the JWT itself.
+   * Verifier implementation SHOULD ignore the `serialized_payload` field
+   * when verifying these JWTs.
+   * If only JWTs are present on this AttestationOccurrence, then the
+   * `serialized_payload` SHOULD be left empty.
+   * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+   * Occurrence, but this is not validated by Grafeas metadata API
+   * implementations.  The JWT itself is opaque to Grafeas.
+   * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + @java.lang.Override + public io.grafeas.v1.JwtOrBuilder getJwtsOrBuilder(int index) { + return jwts_.get(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -253,6 +374,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < signatures_.size(); i++) { output.writeMessage(2, signatures_.get(i)); } + for (int i = 0; i < jwts_.size(); i++) { + output.writeMessage(3, jwts_.get(i)); + } unknownFields.writeTo(output); } @@ -268,6 +392,9 @@ public int getSerializedSize() { for (int i = 0; i < signatures_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, signatures_.get(i)); } + for (int i = 0; i < jwts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, jwts_.get(i)); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -285,6 +412,7 @@ public boolean equals(final java.lang.Object obj) { if (!getSerializedPayload().equals(other.getSerializedPayload())) return false; if (!getSignaturesList().equals(other.getSignaturesList())) return false; + if (!getJwtsList().equals(other.getJwtsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -302,6 +430,10 @@ public int hashCode() { hash = (37 * hash) + SIGNATURES_FIELD_NUMBER; hash = (53 * hash) + getSignaturesList().hashCode(); } + if (getJwtsCount() > 0) { + hash = (37 * hash) + JWTS_FIELD_NUMBER; + hash = (53 * hash) + getJwtsList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -448,6 +580,7 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getSignaturesFieldBuilder(); + getJwtsFieldBuilder(); } } @@ -462,6 +595,12 @@ public Builder clear() { } else { signaturesBuilder_.clear(); } + if (jwtsBuilder_ == null) { + jwts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + jwtsBuilder_.clear(); + } return this; } @@ -498,6 +637,15 @@ public io.grafeas.v1.AttestationOccurrence buildPartial() { } else { result.signatures_ = signaturesBuilder_.build(); } + if (jwtsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + jwts_ = java.util.Collections.unmodifiableList(jwts_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.jwts_ = jwts_; + } else { + result.jwts_ = jwtsBuilder_.build(); + } onBuilt(); return result; } @@ -577,6 +725,33 @@ public Builder mergeFrom(io.grafeas.v1.AttestationOccurrence other) { } } } + if (jwtsBuilder_ == null) { + if (!other.jwts_.isEmpty()) { + if (jwts_.isEmpty()) { + jwts_ = other.jwts_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureJwtsIsMutable(); + jwts_.addAll(other.jwts_); + } + onChanged(); + } + } else { + if (!other.jwts_.isEmpty()) { + if (jwtsBuilder_.isEmpty()) { + jwtsBuilder_.dispose(); + jwtsBuilder_ = null; + jwts_ = other.jwts_; + bitField0_ = (bitField0_ & ~0x00000002); + jwtsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getJwtsFieldBuilder() + : null; + } else { + jwtsBuilder_.addAllMessages(other.jwts_); + } + } + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1063,6 +1238,485 @@ public java.util.List getSignaturesBuilderList( return signaturesBuilder_; } + private java.util.List jwts_ = java.util.Collections.emptyList(); + + private void ensureJwtsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + jwts_ = new java.util.ArrayList(jwts_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1.Jwt, io.grafeas.v1.Jwt.Builder, io.grafeas.v1.JwtOrBuilder> + jwtsBuilder_; + + /** + * + * + *
+     * One or more JWTs encoding a self-contained attestation.
+     * Each JWT encodes the payload that it verifies within the JWT itself.
+     * Verifier implementation SHOULD ignore the `serialized_payload` field
+     * when verifying these JWTs.
+     * If only JWTs are present on this AttestationOccurrence, then the
+     * `serialized_payload` SHOULD be left empty.
+     * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+     * Occurrence, but this is not validated by Grafeas metadata API
+     * implementations.  The JWT itself is opaque to Grafeas.
+     * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + public java.util.List getJwtsList() { + if (jwtsBuilder_ == null) { + return java.util.Collections.unmodifiableList(jwts_); + } else { + return jwtsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * One or more JWTs encoding a self-contained attestation.
+     * Each JWT encodes the payload that it verifies within the JWT itself.
+     * Verifier implementation SHOULD ignore the `serialized_payload` field
+     * when verifying these JWTs.
+     * If only JWTs are present on this AttestationOccurrence, then the
+     * `serialized_payload` SHOULD be left empty.
+     * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+     * Occurrence, but this is not validated by Grafeas metadata API
+     * implementations.  The JWT itself is opaque to Grafeas.
+     * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + public int getJwtsCount() { + if (jwtsBuilder_ == null) { + return jwts_.size(); + } else { + return jwtsBuilder_.getCount(); + } + } + /** + * + * + *
+     * One or more JWTs encoding a self-contained attestation.
+     * Each JWT encodes the payload that it verifies within the JWT itself.
+     * Verifier implementation SHOULD ignore the `serialized_payload` field
+     * when verifying these JWTs.
+     * If only JWTs are present on this AttestationOccurrence, then the
+     * `serialized_payload` SHOULD be left empty.
+     * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+     * Occurrence, but this is not validated by Grafeas metadata API
+     * implementations.  The JWT itself is opaque to Grafeas.
+     * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + public io.grafeas.v1.Jwt getJwts(int index) { + if (jwtsBuilder_ == null) { + return jwts_.get(index); + } else { + return jwtsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * One or more JWTs encoding a self-contained attestation.
+     * Each JWT encodes the payload that it verifies within the JWT itself.
+     * Verifier implementation SHOULD ignore the `serialized_payload` field
+     * when verifying these JWTs.
+     * If only JWTs are present on this AttestationOccurrence, then the
+     * `serialized_payload` SHOULD be left empty.
+     * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+     * Occurrence, but this is not validated by Grafeas metadata API
+     * implementations.  The JWT itself is opaque to Grafeas.
+     * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + public Builder setJwts(int index, io.grafeas.v1.Jwt value) { + if (jwtsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureJwtsIsMutable(); + jwts_.set(index, value); + onChanged(); + } else { + jwtsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * One or more JWTs encoding a self-contained attestation.
+     * Each JWT encodes the payload that it verifies within the JWT itself.
+     * Verifier implementation SHOULD ignore the `serialized_payload` field
+     * when verifying these JWTs.
+     * If only JWTs are present on this AttestationOccurrence, then the
+     * `serialized_payload` SHOULD be left empty.
+     * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+     * Occurrence, but this is not validated by Grafeas metadata API
+     * implementations.  The JWT itself is opaque to Grafeas.
+     * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + public Builder setJwts(int index, io.grafeas.v1.Jwt.Builder builderForValue) { + if (jwtsBuilder_ == null) { + ensureJwtsIsMutable(); + jwts_.set(index, builderForValue.build()); + onChanged(); + } else { + jwtsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * One or more JWTs encoding a self-contained attestation.
+     * Each JWT encodes the payload that it verifies within the JWT itself.
+     * Verifier implementation SHOULD ignore the `serialized_payload` field
+     * when verifying these JWTs.
+     * If only JWTs are present on this AttestationOccurrence, then the
+     * `serialized_payload` SHOULD be left empty.
+     * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+     * Occurrence, but this is not validated by Grafeas metadata API
+     * implementations.  The JWT itself is opaque to Grafeas.
+     * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + public Builder addJwts(io.grafeas.v1.Jwt value) { + if (jwtsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureJwtsIsMutable(); + jwts_.add(value); + onChanged(); + } else { + jwtsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * One or more JWTs encoding a self-contained attestation.
+     * Each JWT encodes the payload that it verifies within the JWT itself.
+     * Verifier implementation SHOULD ignore the `serialized_payload` field
+     * when verifying these JWTs.
+     * If only JWTs are present on this AttestationOccurrence, then the
+     * `serialized_payload` SHOULD be left empty.
+     * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+     * Occurrence, but this is not validated by Grafeas metadata API
+     * implementations.  The JWT itself is opaque to Grafeas.
+     * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + public Builder addJwts(int index, io.grafeas.v1.Jwt value) { + if (jwtsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureJwtsIsMutable(); + jwts_.add(index, value); + onChanged(); + } else { + jwtsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * One or more JWTs encoding a self-contained attestation.
+     * Each JWT encodes the payload that it verifies within the JWT itself.
+     * Verifier implementation SHOULD ignore the `serialized_payload` field
+     * when verifying these JWTs.
+     * If only JWTs are present on this AttestationOccurrence, then the
+     * `serialized_payload` SHOULD be left empty.
+     * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+     * Occurrence, but this is not validated by Grafeas metadata API
+     * implementations.  The JWT itself is opaque to Grafeas.
+     * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + public Builder addJwts(io.grafeas.v1.Jwt.Builder builderForValue) { + if (jwtsBuilder_ == null) { + ensureJwtsIsMutable(); + jwts_.add(builderForValue.build()); + onChanged(); + } else { + jwtsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * One or more JWTs encoding a self-contained attestation.
+     * Each JWT encodes the payload that it verifies within the JWT itself.
+     * Verifier implementation SHOULD ignore the `serialized_payload` field
+     * when verifying these JWTs.
+     * If only JWTs are present on this AttestationOccurrence, then the
+     * `serialized_payload` SHOULD be left empty.
+     * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+     * Occurrence, but this is not validated by Grafeas metadata API
+     * implementations.  The JWT itself is opaque to Grafeas.
+     * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + public Builder addJwts(int index, io.grafeas.v1.Jwt.Builder builderForValue) { + if (jwtsBuilder_ == null) { + ensureJwtsIsMutable(); + jwts_.add(index, builderForValue.build()); + onChanged(); + } else { + jwtsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * One or more JWTs encoding a self-contained attestation.
+     * Each JWT encodes the payload that it verifies within the JWT itself.
+     * Verifier implementation SHOULD ignore the `serialized_payload` field
+     * when verifying these JWTs.
+     * If only JWTs are present on this AttestationOccurrence, then the
+     * `serialized_payload` SHOULD be left empty.
+     * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+     * Occurrence, but this is not validated by Grafeas metadata API
+     * implementations.  The JWT itself is opaque to Grafeas.
+     * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + public Builder addAllJwts(java.lang.Iterable values) { + if (jwtsBuilder_ == null) { + ensureJwtsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, jwts_); + onChanged(); + } else { + jwtsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * One or more JWTs encoding a self-contained attestation.
+     * Each JWT encodes the payload that it verifies within the JWT itself.
+     * Verifier implementation SHOULD ignore the `serialized_payload` field
+     * when verifying these JWTs.
+     * If only JWTs are present on this AttestationOccurrence, then the
+     * `serialized_payload` SHOULD be left empty.
+     * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+     * Occurrence, but this is not validated by Grafeas metadata API
+     * implementations.  The JWT itself is opaque to Grafeas.
+     * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + public Builder clearJwts() { + if (jwtsBuilder_ == null) { + jwts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + jwtsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * One or more JWTs encoding a self-contained attestation.
+     * Each JWT encodes the payload that it verifies within the JWT itself.
+     * Verifier implementation SHOULD ignore the `serialized_payload` field
+     * when verifying these JWTs.
+     * If only JWTs are present on this AttestationOccurrence, then the
+     * `serialized_payload` SHOULD be left empty.
+     * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+     * Occurrence, but this is not validated by Grafeas metadata API
+     * implementations.  The JWT itself is opaque to Grafeas.
+     * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + public Builder removeJwts(int index) { + if (jwtsBuilder_ == null) { + ensureJwtsIsMutable(); + jwts_.remove(index); + onChanged(); + } else { + jwtsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * One or more JWTs encoding a self-contained attestation.
+     * Each JWT encodes the payload that it verifies within the JWT itself.
+     * Verifier implementation SHOULD ignore the `serialized_payload` field
+     * when verifying these JWTs.
+     * If only JWTs are present on this AttestationOccurrence, then the
+     * `serialized_payload` SHOULD be left empty.
+     * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+     * Occurrence, but this is not validated by Grafeas metadata API
+     * implementations.  The JWT itself is opaque to Grafeas.
+     * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + public io.grafeas.v1.Jwt.Builder getJwtsBuilder(int index) { + return getJwtsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * One or more JWTs encoding a self-contained attestation.
+     * Each JWT encodes the payload that it verifies within the JWT itself.
+     * Verifier implementation SHOULD ignore the `serialized_payload` field
+     * when verifying these JWTs.
+     * If only JWTs are present on this AttestationOccurrence, then the
+     * `serialized_payload` SHOULD be left empty.
+     * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+     * Occurrence, but this is not validated by Grafeas metadata API
+     * implementations.  The JWT itself is opaque to Grafeas.
+     * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + public io.grafeas.v1.JwtOrBuilder getJwtsOrBuilder(int index) { + if (jwtsBuilder_ == null) { + return jwts_.get(index); + } else { + return jwtsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * One or more JWTs encoding a self-contained attestation.
+     * Each JWT encodes the payload that it verifies within the JWT itself.
+     * Verifier implementation SHOULD ignore the `serialized_payload` field
+     * when verifying these JWTs.
+     * If only JWTs are present on this AttestationOccurrence, then the
+     * `serialized_payload` SHOULD be left empty.
+     * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+     * Occurrence, but this is not validated by Grafeas metadata API
+     * implementations.  The JWT itself is opaque to Grafeas.
+     * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + public java.util.List getJwtsOrBuilderList() { + if (jwtsBuilder_ != null) { + return jwtsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(jwts_); + } + } + /** + * + * + *
+     * One or more JWTs encoding a self-contained attestation.
+     * Each JWT encodes the payload that it verifies within the JWT itself.
+     * Verifier implementation SHOULD ignore the `serialized_payload` field
+     * when verifying these JWTs.
+     * If only JWTs are present on this AttestationOccurrence, then the
+     * `serialized_payload` SHOULD be left empty.
+     * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+     * Occurrence, but this is not validated by Grafeas metadata API
+     * implementations.  The JWT itself is opaque to Grafeas.
+     * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + public io.grafeas.v1.Jwt.Builder addJwtsBuilder() { + return getJwtsFieldBuilder().addBuilder(io.grafeas.v1.Jwt.getDefaultInstance()); + } + /** + * + * + *
+     * One or more JWTs encoding a self-contained attestation.
+     * Each JWT encodes the payload that it verifies within the JWT itself.
+     * Verifier implementation SHOULD ignore the `serialized_payload` field
+     * when verifying these JWTs.
+     * If only JWTs are present on this AttestationOccurrence, then the
+     * `serialized_payload` SHOULD be left empty.
+     * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+     * Occurrence, but this is not validated by Grafeas metadata API
+     * implementations.  The JWT itself is opaque to Grafeas.
+     * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + public io.grafeas.v1.Jwt.Builder addJwtsBuilder(int index) { + return getJwtsFieldBuilder().addBuilder(index, io.grafeas.v1.Jwt.getDefaultInstance()); + } + /** + * + * + *
+     * One or more JWTs encoding a self-contained attestation.
+     * Each JWT encodes the payload that it verifies within the JWT itself.
+     * Verifier implementation SHOULD ignore the `serialized_payload` field
+     * when verifying these JWTs.
+     * If only JWTs are present on this AttestationOccurrence, then the
+     * `serialized_payload` SHOULD be left empty.
+     * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+     * Occurrence, but this is not validated by Grafeas metadata API
+     * implementations.  The JWT itself is opaque to Grafeas.
+     * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + public java.util.List getJwtsBuilderList() { + return getJwtsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1.Jwt, io.grafeas.v1.Jwt.Builder, io.grafeas.v1.JwtOrBuilder> + getJwtsFieldBuilder() { + if (jwtsBuilder_ == null) { + jwtsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1.Jwt, io.grafeas.v1.Jwt.Builder, io.grafeas.v1.JwtOrBuilder>( + jwts_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + jwts_ = null; + } + return jwtsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/src/main/java/io/grafeas/v1/AttestationOccurrenceOrBuilder.java b/src/main/java/io/grafeas/v1/AttestationOccurrenceOrBuilder.java index 7b6ab22c..3818daeb 100644 --- a/src/main/java/io/grafeas/v1/AttestationOccurrenceOrBuilder.java +++ b/src/main/java/io/grafeas/v1/AttestationOccurrenceOrBuilder.java @@ -103,4 +103,95 @@ public interface AttestationOccurrenceOrBuilder * repeated .grafeas.v1.Signature signatures = 2; */ io.grafeas.v1.SignatureOrBuilder getSignaturesOrBuilder(int index); + + /** + * + * + *
+   * One or more JWTs encoding a self-contained attestation.
+   * Each JWT encodes the payload that it verifies within the JWT itself.
+   * Verifier implementation SHOULD ignore the `serialized_payload` field
+   * when verifying these JWTs.
+   * If only JWTs are present on this AttestationOccurrence, then the
+   * `serialized_payload` SHOULD be left empty.
+   * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+   * Occurrence, but this is not validated by Grafeas metadata API
+   * implementations.  The JWT itself is opaque to Grafeas.
+   * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + java.util.List getJwtsList(); + /** + * + * + *
+   * One or more JWTs encoding a self-contained attestation.
+   * Each JWT encodes the payload that it verifies within the JWT itself.
+   * Verifier implementation SHOULD ignore the `serialized_payload` field
+   * when verifying these JWTs.
+   * If only JWTs are present on this AttestationOccurrence, then the
+   * `serialized_payload` SHOULD be left empty.
+   * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+   * Occurrence, but this is not validated by Grafeas metadata API
+   * implementations.  The JWT itself is opaque to Grafeas.
+   * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + io.grafeas.v1.Jwt getJwts(int index); + /** + * + * + *
+   * One or more JWTs encoding a self-contained attestation.
+   * Each JWT encodes the payload that it verifies within the JWT itself.
+   * Verifier implementation SHOULD ignore the `serialized_payload` field
+   * when verifying these JWTs.
+   * If only JWTs are present on this AttestationOccurrence, then the
+   * `serialized_payload` SHOULD be left empty.
+   * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+   * Occurrence, but this is not validated by Grafeas metadata API
+   * implementations.  The JWT itself is opaque to Grafeas.
+   * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + int getJwtsCount(); + /** + * + * + *
+   * One or more JWTs encoding a self-contained attestation.
+   * Each JWT encodes the payload that it verifies within the JWT itself.
+   * Verifier implementation SHOULD ignore the `serialized_payload` field
+   * when verifying these JWTs.
+   * If only JWTs are present on this AttestationOccurrence, then the
+   * `serialized_payload` SHOULD be left empty.
+   * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+   * Occurrence, but this is not validated by Grafeas metadata API
+   * implementations.  The JWT itself is opaque to Grafeas.
+   * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + java.util.List getJwtsOrBuilderList(); + /** + * + * + *
+   * One or more JWTs encoding a self-contained attestation.
+   * Each JWT encodes the payload that it verifies within the JWT itself.
+   * Verifier implementation SHOULD ignore the `serialized_payload` field
+   * when verifying these JWTs.
+   * If only JWTs are present on this AttestationOccurrence, then the
+   * `serialized_payload` SHOULD be left empty.
+   * Each JWT SHOULD encode a claim specific to the `resource_uri` of this
+   * Occurrence, but this is not validated by Grafeas metadata API
+   * implementations.  The JWT itself is opaque to Grafeas.
+   * 
+ * + * repeated .grafeas.v1.Jwt jwts = 3; + */ + io.grafeas.v1.JwtOrBuilder getJwtsOrBuilder(int index); } diff --git a/src/main/java/io/grafeas/v1/Build.java b/src/main/java/io/grafeas/v1/Build.java index 200e101b..44537c07 100644 --- a/src/main/java/io/grafeas/v1/Build.java +++ b/src/main/java/io/grafeas/v1/Build.java @@ -45,19 +45,25 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\026grafeas/v1/build.proto\022\ngrafeas.v1\032\033gr" - + "afeas/v1/provenance.proto\"$\n\tBuildNote\022\027" - + "\n\017builder_version\030\001 \001(\t\"\\\n\017BuildOccurren" - + "ce\022/\n\nprovenance\030\001 \001(\0132\033.grafeas.v1.Buil" - + "dProvenance\022\030\n\020provenance_bytes\030\002 \001(\tBQ\n" - + "\rio.grafeas.v1P\001Z8google.golang.org/genp" - + "roto/googleapis/grafeas/v1;grafeas\242\002\003GRA" - + "b\006proto3" + "\n\026grafeas/v1/build.proto\022\ngrafeas.v1\032\"gr" + + "afeas/v1/intoto_provenance.proto\032!grafea" + + "s/v1/intoto_statement.proto\032\033grafeas/v1/" + + "provenance.proto\"$\n\tBuildNote\022\027\n\017builder" + + "_version\030\001 \001(\t\"\314\001\n\017BuildOccurrence\022/\n\npr" + + "ovenance\030\001 \001(\0132\033.grafeas.v1.BuildProvena" + + "nce\022\030\n\020provenance_bytes\030\002 \001(\t\0227\n\021intoto_" + + "provenance\030\003 \001(\0132\034.grafeas.v1.InTotoProv" + + "enance\0225\n\020intoto_statement\030\004 \001(\0132\033.grafe" + + "as.v1.InTotoStatementBQ\n\rio.grafeas.v1P\001" + + "Z8google.golang.org/genproto/googleapis/" + + "grafeas/v1;grafeas\242\002\003GRAb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { + io.grafeas.v1.InTotoProvenanceProto.getDescriptor(), + io.grafeas.v1.InTotoStatementProto.getDescriptor(), io.grafeas.v1.Provenance.getDescriptor(), }); internal_static_grafeas_v1_BuildNote_descriptor = getDescriptor().getMessageTypes().get(0); @@ -73,8 +79,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_grafeas_v1_BuildOccurrence_descriptor, new java.lang.String[] { - "Provenance", "ProvenanceBytes", + "Provenance", "ProvenanceBytes", "IntotoProvenance", "IntotoStatement", }); + io.grafeas.v1.InTotoProvenanceProto.getDescriptor(); + io.grafeas.v1.InTotoStatementProto.getDescriptor(); io.grafeas.v1.Provenance.getDescriptor(); } diff --git a/src/main/java/io/grafeas/v1/BuildOccurrence.java b/src/main/java/io/grafeas/v1/BuildOccurrence.java index 51747de5..0ed38f75 100644 --- a/src/main/java/io/grafeas/v1/BuildOccurrence.java +++ b/src/main/java/io/grafeas/v1/BuildOccurrence.java @@ -91,6 +91,36 @@ private BuildOccurrence( java.lang.String s = input.readStringRequireUtf8(); provenanceBytes_ = s; + break; + } + case 26: + { + io.grafeas.v1.InTotoProvenance.Builder subBuilder = null; + if (intotoProvenance_ != null) { + subBuilder = intotoProvenance_.toBuilder(); + } + intotoProvenance_ = + input.readMessage(io.grafeas.v1.InTotoProvenance.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(intotoProvenance_); + intotoProvenance_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + io.grafeas.v1.InTotoStatement.Builder subBuilder = null; + if (intotoStatement_ != null) { + subBuilder = intotoStatement_.toBuilder(); + } + intotoStatement_ = + input.readMessage(io.grafeas.v1.InTotoStatement.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(intotoStatement_); + intotoStatement_ = subBuilder.buildPartial(); + } + break; } default: @@ -130,7 +160,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The actual provenance for the build.
+   * The actual provenance for the build.
    * 
* * .grafeas.v1.BuildProvenance provenance = 1; @@ -145,7 +175,7 @@ public boolean hasProvenance() { * * *
-   * Required. The actual provenance for the build.
+   * The actual provenance for the build.
    * 
* * .grafeas.v1.BuildProvenance provenance = 1; @@ -160,7 +190,7 @@ public io.grafeas.v1.BuildProvenance getProvenance() { * * *
-   * Required. The actual provenance for the build.
+   * The actual provenance for the build.
    * 
* * .grafeas.v1.BuildProvenance provenance = 1; @@ -237,6 +267,114 @@ public com.google.protobuf.ByteString getProvenanceBytesBytes() { } } + public static final int INTOTO_PROVENANCE_FIELD_NUMBER = 3; + private io.grafeas.v1.InTotoProvenance intotoProvenance_; + /** + * + * + *
+   * Deprecated. See InTotoStatement for the replacement.
+   * In-toto Provenance representation as defined in spec.
+   * 
+ * + * .grafeas.v1.InTotoProvenance intoto_provenance = 3; + * + * @return Whether the intotoProvenance field is set. + */ + @java.lang.Override + public boolean hasIntotoProvenance() { + return intotoProvenance_ != null; + } + /** + * + * + *
+   * Deprecated. See InTotoStatement for the replacement.
+   * In-toto Provenance representation as defined in spec.
+   * 
+ * + * .grafeas.v1.InTotoProvenance intoto_provenance = 3; + * + * @return The intotoProvenance. + */ + @java.lang.Override + public io.grafeas.v1.InTotoProvenance getIntotoProvenance() { + return intotoProvenance_ == null + ? io.grafeas.v1.InTotoProvenance.getDefaultInstance() + : intotoProvenance_; + } + /** + * + * + *
+   * Deprecated. See InTotoStatement for the replacement.
+   * In-toto Provenance representation as defined in spec.
+   * 
+ * + * .grafeas.v1.InTotoProvenance intoto_provenance = 3; + */ + @java.lang.Override + public io.grafeas.v1.InTotoProvenanceOrBuilder getIntotoProvenanceOrBuilder() { + return getIntotoProvenance(); + } + + public static final int INTOTO_STATEMENT_FIELD_NUMBER = 4; + private io.grafeas.v1.InTotoStatement intotoStatement_; + /** + * + * + *
+   * In-toto Statement representation as defined in spec.
+   * The intoto_statement can contain any type of provenance. The serialized
+   * payload of the statement can be stored and signed in the Occurrence's
+   * envelope.
+   * 
+ * + * .grafeas.v1.InTotoStatement intoto_statement = 4; + * + * @return Whether the intotoStatement field is set. + */ + @java.lang.Override + public boolean hasIntotoStatement() { + return intotoStatement_ != null; + } + /** + * + * + *
+   * In-toto Statement representation as defined in spec.
+   * The intoto_statement can contain any type of provenance. The serialized
+   * payload of the statement can be stored and signed in the Occurrence's
+   * envelope.
+   * 
+ * + * .grafeas.v1.InTotoStatement intoto_statement = 4; + * + * @return The intotoStatement. + */ + @java.lang.Override + public io.grafeas.v1.InTotoStatement getIntotoStatement() { + return intotoStatement_ == null + ? io.grafeas.v1.InTotoStatement.getDefaultInstance() + : intotoStatement_; + } + /** + * + * + *
+   * In-toto Statement representation as defined in spec.
+   * The intoto_statement can contain any type of provenance. The serialized
+   * payload of the statement can be stored and signed in the Occurrence's
+   * envelope.
+   * 
+ * + * .grafeas.v1.InTotoStatement intoto_statement = 4; + */ + @java.lang.Override + public io.grafeas.v1.InTotoStatementOrBuilder getIntotoStatementOrBuilder() { + return getIntotoStatement(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -257,6 +395,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(provenanceBytes_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, provenanceBytes_); } + if (intotoProvenance_ != null) { + output.writeMessage(3, getIntotoProvenance()); + } + if (intotoStatement_ != null) { + output.writeMessage(4, getIntotoStatement()); + } unknownFields.writeTo(output); } @@ -272,6 +416,12 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(provenanceBytes_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, provenanceBytes_); } + if (intotoProvenance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getIntotoProvenance()); + } + if (intotoStatement_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getIntotoStatement()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -292,6 +442,14 @@ public boolean equals(final java.lang.Object obj) { if (!getProvenance().equals(other.getProvenance())) return false; } if (!getProvenanceBytes().equals(other.getProvenanceBytes())) return false; + if (hasIntotoProvenance() != other.hasIntotoProvenance()) return false; + if (hasIntotoProvenance()) { + if (!getIntotoProvenance().equals(other.getIntotoProvenance())) return false; + } + if (hasIntotoStatement() != other.hasIntotoStatement()) return false; + if (hasIntotoStatement()) { + if (!getIntotoStatement().equals(other.getIntotoStatement())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -309,6 +467,14 @@ public int hashCode() { } hash = (37 * hash) + PROVENANCE_BYTES_FIELD_NUMBER; hash = (53 * hash) + getProvenanceBytes().hashCode(); + if (hasIntotoProvenance()) { + hash = (37 * hash) + INTOTO_PROVENANCE_FIELD_NUMBER; + hash = (53 * hash) + getIntotoProvenance().hashCode(); + } + if (hasIntotoStatement()) { + hash = (37 * hash) + INTOTO_STATEMENT_FIELD_NUMBER; + hash = (53 * hash) + getIntotoStatement().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -458,6 +624,18 @@ public Builder clear() { } provenanceBytes_ = ""; + if (intotoProvenanceBuilder_ == null) { + intotoProvenance_ = null; + } else { + intotoProvenance_ = null; + intotoProvenanceBuilder_ = null; + } + if (intotoStatementBuilder_ == null) { + intotoStatement_ = null; + } else { + intotoStatement_ = null; + intotoStatementBuilder_ = null; + } return this; } @@ -489,6 +667,16 @@ public io.grafeas.v1.BuildOccurrence buildPartial() { result.provenance_ = provenanceBuilder_.build(); } result.provenanceBytes_ = provenanceBytes_; + if (intotoProvenanceBuilder_ == null) { + result.intotoProvenance_ = intotoProvenance_; + } else { + result.intotoProvenance_ = intotoProvenanceBuilder_.build(); + } + if (intotoStatementBuilder_ == null) { + result.intotoStatement_ = intotoStatement_; + } else { + result.intotoStatement_ = intotoStatementBuilder_.build(); + } onBuilt(); return result; } @@ -545,6 +733,12 @@ public Builder mergeFrom(io.grafeas.v1.BuildOccurrence other) { provenanceBytes_ = other.provenanceBytes_; onChanged(); } + if (other.hasIntotoProvenance()) { + mergeIntotoProvenance(other.getIntotoProvenance()); + } + if (other.hasIntotoStatement()) { + mergeIntotoStatement(other.getIntotoStatement()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -584,7 +778,7 @@ public Builder mergeFrom( * * *
-     * Required. The actual provenance for the build.
+     * The actual provenance for the build.
      * 
* * .grafeas.v1.BuildProvenance provenance = 1; @@ -598,7 +792,7 @@ public boolean hasProvenance() { * * *
-     * Required. The actual provenance for the build.
+     * The actual provenance for the build.
      * 
* * .grafeas.v1.BuildProvenance provenance = 1; @@ -618,7 +812,7 @@ public io.grafeas.v1.BuildProvenance getProvenance() { * * *
-     * Required. The actual provenance for the build.
+     * The actual provenance for the build.
      * 
* * .grafeas.v1.BuildProvenance provenance = 1; @@ -640,7 +834,7 @@ public Builder setProvenance(io.grafeas.v1.BuildProvenance value) { * * *
-     * Required. The actual provenance for the build.
+     * The actual provenance for the build.
      * 
* * .grafeas.v1.BuildProvenance provenance = 1; @@ -659,7 +853,7 @@ public Builder setProvenance(io.grafeas.v1.BuildProvenance.Builder builderForVal * * *
-     * Required. The actual provenance for the build.
+     * The actual provenance for the build.
      * 
* * .grafeas.v1.BuildProvenance provenance = 1; @@ -683,7 +877,7 @@ public Builder mergeProvenance(io.grafeas.v1.BuildProvenance value) { * * *
-     * Required. The actual provenance for the build.
+     * The actual provenance for the build.
      * 
* * .grafeas.v1.BuildProvenance provenance = 1; @@ -703,7 +897,7 @@ public Builder clearProvenance() { * * *
-     * Required. The actual provenance for the build.
+     * The actual provenance for the build.
      * 
* * .grafeas.v1.BuildProvenance provenance = 1; @@ -717,7 +911,7 @@ public io.grafeas.v1.BuildProvenance.Builder getProvenanceBuilder() { * * *
-     * Required. The actual provenance for the build.
+     * The actual provenance for the build.
      * 
* * .grafeas.v1.BuildProvenance provenance = 1; @@ -735,7 +929,7 @@ public io.grafeas.v1.BuildProvenanceOrBuilder getProvenanceOrBuilder() { * * *
-     * Required. The actual provenance for the build.
+     * The actual provenance for the build.
      * 
* * .grafeas.v1.BuildProvenance provenance = 1; @@ -908,6 +1102,412 @@ public Builder setProvenanceBytesBytes(com.google.protobuf.ByteString value) { return this; } + private io.grafeas.v1.InTotoProvenance intotoProvenance_; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.InTotoProvenance, + io.grafeas.v1.InTotoProvenance.Builder, + io.grafeas.v1.InTotoProvenanceOrBuilder> + intotoProvenanceBuilder_; + /** + * + * + *
+     * Deprecated. See InTotoStatement for the replacement.
+     * In-toto Provenance representation as defined in spec.
+     * 
+ * + * .grafeas.v1.InTotoProvenance intoto_provenance = 3; + * + * @return Whether the intotoProvenance field is set. + */ + public boolean hasIntotoProvenance() { + return intotoProvenanceBuilder_ != null || intotoProvenance_ != null; + } + /** + * + * + *
+     * Deprecated. See InTotoStatement for the replacement.
+     * In-toto Provenance representation as defined in spec.
+     * 
+ * + * .grafeas.v1.InTotoProvenance intoto_provenance = 3; + * + * @return The intotoProvenance. + */ + public io.grafeas.v1.InTotoProvenance getIntotoProvenance() { + if (intotoProvenanceBuilder_ == null) { + return intotoProvenance_ == null + ? io.grafeas.v1.InTotoProvenance.getDefaultInstance() + : intotoProvenance_; + } else { + return intotoProvenanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Deprecated. See InTotoStatement for the replacement.
+     * In-toto Provenance representation as defined in spec.
+     * 
+ * + * .grafeas.v1.InTotoProvenance intoto_provenance = 3; + */ + public Builder setIntotoProvenance(io.grafeas.v1.InTotoProvenance value) { + if (intotoProvenanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + intotoProvenance_ = value; + onChanged(); + } else { + intotoProvenanceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Deprecated. See InTotoStatement for the replacement.
+     * In-toto Provenance representation as defined in spec.
+     * 
+ * + * .grafeas.v1.InTotoProvenance intoto_provenance = 3; + */ + public Builder setIntotoProvenance(io.grafeas.v1.InTotoProvenance.Builder builderForValue) { + if (intotoProvenanceBuilder_ == null) { + intotoProvenance_ = builderForValue.build(); + onChanged(); + } else { + intotoProvenanceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Deprecated. See InTotoStatement for the replacement.
+     * In-toto Provenance representation as defined in spec.
+     * 
+ * + * .grafeas.v1.InTotoProvenance intoto_provenance = 3; + */ + public Builder mergeIntotoProvenance(io.grafeas.v1.InTotoProvenance value) { + if (intotoProvenanceBuilder_ == null) { + if (intotoProvenance_ != null) { + intotoProvenance_ = + io.grafeas.v1.InTotoProvenance.newBuilder(intotoProvenance_) + .mergeFrom(value) + .buildPartial(); + } else { + intotoProvenance_ = value; + } + onChanged(); + } else { + intotoProvenanceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Deprecated. See InTotoStatement for the replacement.
+     * In-toto Provenance representation as defined in spec.
+     * 
+ * + * .grafeas.v1.InTotoProvenance intoto_provenance = 3; + */ + public Builder clearIntotoProvenance() { + if (intotoProvenanceBuilder_ == null) { + intotoProvenance_ = null; + onChanged(); + } else { + intotoProvenance_ = null; + intotoProvenanceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Deprecated. See InTotoStatement for the replacement.
+     * In-toto Provenance representation as defined in spec.
+     * 
+ * + * .grafeas.v1.InTotoProvenance intoto_provenance = 3; + */ + public io.grafeas.v1.InTotoProvenance.Builder getIntotoProvenanceBuilder() { + + onChanged(); + return getIntotoProvenanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Deprecated. See InTotoStatement for the replacement.
+     * In-toto Provenance representation as defined in spec.
+     * 
+ * + * .grafeas.v1.InTotoProvenance intoto_provenance = 3; + */ + public io.grafeas.v1.InTotoProvenanceOrBuilder getIntotoProvenanceOrBuilder() { + if (intotoProvenanceBuilder_ != null) { + return intotoProvenanceBuilder_.getMessageOrBuilder(); + } else { + return intotoProvenance_ == null + ? io.grafeas.v1.InTotoProvenance.getDefaultInstance() + : intotoProvenance_; + } + } + /** + * + * + *
+     * Deprecated. See InTotoStatement for the replacement.
+     * In-toto Provenance representation as defined in spec.
+     * 
+ * + * .grafeas.v1.InTotoProvenance intoto_provenance = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.InTotoProvenance, + io.grafeas.v1.InTotoProvenance.Builder, + io.grafeas.v1.InTotoProvenanceOrBuilder> + getIntotoProvenanceFieldBuilder() { + if (intotoProvenanceBuilder_ == null) { + intotoProvenanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.InTotoProvenance, + io.grafeas.v1.InTotoProvenance.Builder, + io.grafeas.v1.InTotoProvenanceOrBuilder>( + getIntotoProvenance(), getParentForChildren(), isClean()); + intotoProvenance_ = null; + } + return intotoProvenanceBuilder_; + } + + private io.grafeas.v1.InTotoStatement intotoStatement_; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.InTotoStatement, + io.grafeas.v1.InTotoStatement.Builder, + io.grafeas.v1.InTotoStatementOrBuilder> + intotoStatementBuilder_; + /** + * + * + *
+     * In-toto Statement representation as defined in spec.
+     * The intoto_statement can contain any type of provenance. The serialized
+     * payload of the statement can be stored and signed in the Occurrence's
+     * envelope.
+     * 
+ * + * .grafeas.v1.InTotoStatement intoto_statement = 4; + * + * @return Whether the intotoStatement field is set. + */ + public boolean hasIntotoStatement() { + return intotoStatementBuilder_ != null || intotoStatement_ != null; + } + /** + * + * + *
+     * In-toto Statement representation as defined in spec.
+     * The intoto_statement can contain any type of provenance. The serialized
+     * payload of the statement can be stored and signed in the Occurrence's
+     * envelope.
+     * 
+ * + * .grafeas.v1.InTotoStatement intoto_statement = 4; + * + * @return The intotoStatement. + */ + public io.grafeas.v1.InTotoStatement getIntotoStatement() { + if (intotoStatementBuilder_ == null) { + return intotoStatement_ == null + ? io.grafeas.v1.InTotoStatement.getDefaultInstance() + : intotoStatement_; + } else { + return intotoStatementBuilder_.getMessage(); + } + } + /** + * + * + *
+     * In-toto Statement representation as defined in spec.
+     * The intoto_statement can contain any type of provenance. The serialized
+     * payload of the statement can be stored and signed in the Occurrence's
+     * envelope.
+     * 
+ * + * .grafeas.v1.InTotoStatement intoto_statement = 4; + */ + public Builder setIntotoStatement(io.grafeas.v1.InTotoStatement value) { + if (intotoStatementBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + intotoStatement_ = value; + onChanged(); + } else { + intotoStatementBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * In-toto Statement representation as defined in spec.
+     * The intoto_statement can contain any type of provenance. The serialized
+     * payload of the statement can be stored and signed in the Occurrence's
+     * envelope.
+     * 
+ * + * .grafeas.v1.InTotoStatement intoto_statement = 4; + */ + public Builder setIntotoStatement(io.grafeas.v1.InTotoStatement.Builder builderForValue) { + if (intotoStatementBuilder_ == null) { + intotoStatement_ = builderForValue.build(); + onChanged(); + } else { + intotoStatementBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * In-toto Statement representation as defined in spec.
+     * The intoto_statement can contain any type of provenance. The serialized
+     * payload of the statement can be stored and signed in the Occurrence's
+     * envelope.
+     * 
+ * + * .grafeas.v1.InTotoStatement intoto_statement = 4; + */ + public Builder mergeIntotoStatement(io.grafeas.v1.InTotoStatement value) { + if (intotoStatementBuilder_ == null) { + if (intotoStatement_ != null) { + intotoStatement_ = + io.grafeas.v1.InTotoStatement.newBuilder(intotoStatement_) + .mergeFrom(value) + .buildPartial(); + } else { + intotoStatement_ = value; + } + onChanged(); + } else { + intotoStatementBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * In-toto Statement representation as defined in spec.
+     * The intoto_statement can contain any type of provenance. The serialized
+     * payload of the statement can be stored and signed in the Occurrence's
+     * envelope.
+     * 
+ * + * .grafeas.v1.InTotoStatement intoto_statement = 4; + */ + public Builder clearIntotoStatement() { + if (intotoStatementBuilder_ == null) { + intotoStatement_ = null; + onChanged(); + } else { + intotoStatement_ = null; + intotoStatementBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * In-toto Statement representation as defined in spec.
+     * The intoto_statement can contain any type of provenance. The serialized
+     * payload of the statement can be stored and signed in the Occurrence's
+     * envelope.
+     * 
+ * + * .grafeas.v1.InTotoStatement intoto_statement = 4; + */ + public io.grafeas.v1.InTotoStatement.Builder getIntotoStatementBuilder() { + + onChanged(); + return getIntotoStatementFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * In-toto Statement representation as defined in spec.
+     * The intoto_statement can contain any type of provenance. The serialized
+     * payload of the statement can be stored and signed in the Occurrence's
+     * envelope.
+     * 
+ * + * .grafeas.v1.InTotoStatement intoto_statement = 4; + */ + public io.grafeas.v1.InTotoStatementOrBuilder getIntotoStatementOrBuilder() { + if (intotoStatementBuilder_ != null) { + return intotoStatementBuilder_.getMessageOrBuilder(); + } else { + return intotoStatement_ == null + ? io.grafeas.v1.InTotoStatement.getDefaultInstance() + : intotoStatement_; + } + } + /** + * + * + *
+     * In-toto Statement representation as defined in spec.
+     * The intoto_statement can contain any type of provenance. The serialized
+     * payload of the statement can be stored and signed in the Occurrence's
+     * envelope.
+     * 
+ * + * .grafeas.v1.InTotoStatement intoto_statement = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.InTotoStatement, + io.grafeas.v1.InTotoStatement.Builder, + io.grafeas.v1.InTotoStatementOrBuilder> + getIntotoStatementFieldBuilder() { + if (intotoStatementBuilder_ == null) { + intotoStatementBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.InTotoStatement, + io.grafeas.v1.InTotoStatement.Builder, + io.grafeas.v1.InTotoStatementOrBuilder>( + getIntotoStatement(), getParentForChildren(), isClean()); + intotoStatement_ = null; + } + return intotoStatementBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/src/main/java/io/grafeas/v1/BuildOccurrenceOrBuilder.java b/src/main/java/io/grafeas/v1/BuildOccurrenceOrBuilder.java index 8feacd89..bb644f3e 100644 --- a/src/main/java/io/grafeas/v1/BuildOccurrenceOrBuilder.java +++ b/src/main/java/io/grafeas/v1/BuildOccurrenceOrBuilder.java @@ -28,7 +28,7 @@ public interface BuildOccurrenceOrBuilder * * *
-   * Required. The actual provenance for the build.
+   * The actual provenance for the build.
    * 
* * .grafeas.v1.BuildProvenance provenance = 1; @@ -40,7 +40,7 @@ public interface BuildOccurrenceOrBuilder * * *
-   * Required. The actual provenance for the build.
+   * The actual provenance for the build.
    * 
* * .grafeas.v1.BuildProvenance provenance = 1; @@ -52,7 +52,7 @@ public interface BuildOccurrenceOrBuilder * * *
-   * Required. The actual provenance for the build.
+   * The actual provenance for the build.
    * 
* * .grafeas.v1.BuildProvenance provenance = 1; @@ -101,4 +101,86 @@ public interface BuildOccurrenceOrBuilder * @return The bytes for provenanceBytes. */ com.google.protobuf.ByteString getProvenanceBytesBytes(); + + /** + * + * + *
+   * Deprecated. See InTotoStatement for the replacement.
+   * In-toto Provenance representation as defined in spec.
+   * 
+ * + * .grafeas.v1.InTotoProvenance intoto_provenance = 3; + * + * @return Whether the intotoProvenance field is set. + */ + boolean hasIntotoProvenance(); + /** + * + * + *
+   * Deprecated. See InTotoStatement for the replacement.
+   * In-toto Provenance representation as defined in spec.
+   * 
+ * + * .grafeas.v1.InTotoProvenance intoto_provenance = 3; + * + * @return The intotoProvenance. + */ + io.grafeas.v1.InTotoProvenance getIntotoProvenance(); + /** + * + * + *
+   * Deprecated. See InTotoStatement for the replacement.
+   * In-toto Provenance representation as defined in spec.
+   * 
+ * + * .grafeas.v1.InTotoProvenance intoto_provenance = 3; + */ + io.grafeas.v1.InTotoProvenanceOrBuilder getIntotoProvenanceOrBuilder(); + + /** + * + * + *
+   * In-toto Statement representation as defined in spec.
+   * The intoto_statement can contain any type of provenance. The serialized
+   * payload of the statement can be stored and signed in the Occurrence's
+   * envelope.
+   * 
+ * + * .grafeas.v1.InTotoStatement intoto_statement = 4; + * + * @return Whether the intotoStatement field is set. + */ + boolean hasIntotoStatement(); + /** + * + * + *
+   * In-toto Statement representation as defined in spec.
+   * The intoto_statement can contain any type of provenance. The serialized
+   * payload of the statement can be stored and signed in the Occurrence's
+   * envelope.
+   * 
+ * + * .grafeas.v1.InTotoStatement intoto_statement = 4; + * + * @return The intotoStatement. + */ + io.grafeas.v1.InTotoStatement getIntotoStatement(); + /** + * + * + *
+   * In-toto Statement representation as defined in spec.
+   * The intoto_statement can contain any type of provenance. The serialized
+   * payload of the statement can be stored and signed in the Occurrence's
+   * envelope.
+   * 
+ * + * .grafeas.v1.InTotoStatement intoto_statement = 4; + */ + io.grafeas.v1.InTotoStatementOrBuilder getIntotoStatementOrBuilder(); } diff --git a/src/main/java/io/grafeas/v1/BuilderConfig.java b/src/main/java/io/grafeas/v1/BuilderConfig.java new file mode 100644 index 00000000..55d0ef3c --- /dev/null +++ b/src/main/java/io/grafeas/v1/BuilderConfig.java @@ -0,0 +1,571 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/intoto_provenance.proto + +package io.grafeas.v1; + +/** Protobuf type {@code grafeas.v1.BuilderConfig} */ +public final class BuilderConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.BuilderConfig) + BuilderConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use BuilderConfig.newBuilder() to construct. + private BuilderConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BuilderConfig() { + id_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BuilderConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BuilderConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + id_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.InTotoProvenanceProto.internal_static_grafeas_v1_BuilderConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.InTotoProvenanceProto + .internal_static_grafeas_v1_BuilderConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.BuilderConfig.class, io.grafeas.v1.BuilderConfig.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = 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; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.BuilderConfig)) { + return super.equals(obj); + } + io.grafeas.v1.BuilderConfig other = (io.grafeas.v1.BuilderConfig) obj; + + if (!getId().equals(other.getId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.BuilderConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.BuilderConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.BuilderConfig parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.BuilderConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.BuilderConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.BuilderConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.BuilderConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.BuilderConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.BuilderConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.BuilderConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.BuilderConfig parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.BuilderConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.BuilderConfig 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code grafeas.v1.BuilderConfig} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.BuilderConfig) + io.grafeas.v1.BuilderConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.InTotoProvenanceProto + .internal_static_grafeas_v1_BuilderConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.InTotoProvenanceProto + .internal_static_grafeas_v1_BuilderConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.BuilderConfig.class, io.grafeas.v1.BuilderConfig.Builder.class); + } + + // Construct using io.grafeas.v1.BuilderConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.InTotoProvenanceProto + .internal_static_grafeas_v1_BuilderConfig_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.BuilderConfig getDefaultInstanceForType() { + return io.grafeas.v1.BuilderConfig.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.BuilderConfig build() { + io.grafeas.v1.BuilderConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.BuilderConfig buildPartial() { + io.grafeas.v1.BuilderConfig result = new io.grafeas.v1.BuilderConfig(this); + result.id_ = id_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.BuilderConfig) { + return mergeFrom((io.grafeas.v1.BuilderConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.BuilderConfig other) { + if (other == io.grafeas.v1.BuilderConfig.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.BuilderConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.BuilderConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object id_ = ""; + /** + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.BuilderConfig) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.BuilderConfig) + private static final io.grafeas.v1.BuilderConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.BuilderConfig(); + } + + public static io.grafeas.v1.BuilderConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BuilderConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BuilderConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.BuilderConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/src/main/java/io/grafeas/v1/BuilderConfigOrBuilder.java b/src/main/java/io/grafeas/v1/BuilderConfigOrBuilder.java new file mode 100644 index 00000000..fefd5079 --- /dev/null +++ b/src/main/java/io/grafeas/v1/BuilderConfigOrBuilder.java @@ -0,0 +1,39 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/intoto_provenance.proto + +package io.grafeas.v1; + +public interface BuilderConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.BuilderConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); +} diff --git a/src/main/java/io/grafeas/v1/Common.java b/src/main/java/io/grafeas/v1/Common.java index 22345a3c..cdb3ebb1 100644 --- a/src/main/java/io/grafeas/v1/Common.java +++ b/src/main/java/io/grafeas/v1/Common.java @@ -36,6 +36,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_grafeas_v1_Signature_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_grafeas_v1_Signature_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_Envelope_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_Envelope_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_EnvelopeSignature_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_EnvelopeSignature_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -48,13 +56,18 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n\027grafeas/v1/common.proto\022\ngrafeas.v1\"(\n" + "\nRelatedUrl\022\013\n\003url\030\001 \001(\t\022\r\n\005label\030\002 \001(\t\"" + "5\n\tSignature\022\021\n\tsignature\030\001 \001(\014\022\025\n\rpubli" - + "c_key_id\030\002 \001(\t*\230\001\n\010NoteKind\022\031\n\025NOTE_KIND" - + "_UNSPECIFIED\020\000\022\021\n\rVULNERABILITY\020\001\022\t\n\005BUI" - + "LD\020\002\022\t\n\005IMAGE\020\003\022\013\n\007PACKAGE\020\004\022\016\n\nDEPLOYME" - + "NT\020\005\022\r\n\tDISCOVERY\020\006\022\017\n\013ATTESTATION\020\007\022\013\n\007" - + "UPGRADE\020\010BQ\n\rio.grafeas.v1P\001Z8google.gol" - + "ang.org/genproto/googleapis/grafeas/v1;g" - + "rafeas\242\002\003GRAb\006proto3" + + "c_key_id\030\002 \001(\t\"d\n\010Envelope\022\017\n\007payload\030\001 " + + "\001(\014\022\024\n\014payload_type\030\002 \001(\t\0221\n\nsignatures\030" + + "\003 \003(\0132\035.grafeas.v1.EnvelopeSignature\"/\n\021" + + "EnvelopeSignature\022\013\n\003sig\030\001 \001(\014\022\r\n\005keyid\030" + + "\002 \001(\t*\276\001\n\010NoteKind\022\031\n\025NOTE_KIND_UNSPECIF" + + "IED\020\000\022\021\n\rVULNERABILITY\020\001\022\t\n\005BUILD\020\002\022\t\n\005I" + + "MAGE\020\003\022\013\n\007PACKAGE\020\004\022\016\n\nDEPLOYMENT\020\005\022\r\n\tD" + + "ISCOVERY\020\006\022\017\n\013ATTESTATION\020\007\022\013\n\007UPGRADE\020\010" + + "\022\016\n\nCOMPLIANCE\020\t\022\024\n\020DSSE_ATTESTATION\020\nBQ" + + "\n\rio.grafeas.v1P\001Z8google.golang.org/gen" + + "proto/googleapis/grafeas/v1;grafeas\242\002\003GR" + + "Ab\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -73,6 +86,21 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Signature", "PublicKeyId", }); + internal_static_grafeas_v1_Envelope_descriptor = getDescriptor().getMessageTypes().get(2); + internal_static_grafeas_v1_Envelope_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_Envelope_descriptor, + new java.lang.String[] { + "Payload", "PayloadType", "Signatures", + }); + internal_static_grafeas_v1_EnvelopeSignature_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_grafeas_v1_EnvelopeSignature_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_EnvelopeSignature_descriptor, + new java.lang.String[] { + "Sig", "Keyid", + }); } // @@protoc_insertion_point(outer_class_scope) diff --git a/src/main/java/io/grafeas/v1/Completeness.java b/src/main/java/io/grafeas/v1/Completeness.java new file mode 100644 index 00000000..3afec234 --- /dev/null +++ b/src/main/java/io/grafeas/v1/Completeness.java @@ -0,0 +1,731 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/intoto_provenance.proto + +package io.grafeas.v1; + +/** + * + * + *
+ * Indicates that the builder claims certain fields in this message to be
+ * complete.
+ * 
+ * + * Protobuf type {@code grafeas.v1.Completeness} + */ +public final class Completeness extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.Completeness) + CompletenessOrBuilder { + private static final long serialVersionUID = 0L; + // Use Completeness.newBuilder() to construct. + private Completeness(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Completeness() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Completeness(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Completeness( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + arguments_ = input.readBool(); + break; + } + case 16: + { + environment_ = input.readBool(); + break; + } + case 24: + { + materials_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.InTotoProvenanceProto.internal_static_grafeas_v1_Completeness_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.InTotoProvenanceProto + .internal_static_grafeas_v1_Completeness_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.Completeness.class, io.grafeas.v1.Completeness.Builder.class); + } + + public static final int ARGUMENTS_FIELD_NUMBER = 1; + private boolean arguments_; + /** + * + * + *
+   * If true, the builder claims that recipe.arguments is complete, meaning that
+   * all external inputs are properly captured in the recipe.
+   * 
+ * + * bool arguments = 1; + * + * @return The arguments. + */ + @java.lang.Override + public boolean getArguments() { + return arguments_; + } + + public static final int ENVIRONMENT_FIELD_NUMBER = 2; + private boolean environment_; + /** + * + * + *
+   * If true, the builder claims that recipe.environment is claimed to be
+   * complete.
+   * 
+ * + * bool environment = 2; + * + * @return The environment. + */ + @java.lang.Override + public boolean getEnvironment() { + return environment_; + } + + public static final int MATERIALS_FIELD_NUMBER = 3; + private boolean materials_; + /** + * + * + *
+   * If true, the builder claims that materials are complete, usually through
+   * some controls to prevent network access. Sometimes called "hermetic".
+   * 
+ * + * bool materials = 3; + * + * @return The materials. + */ + @java.lang.Override + public boolean getMaterials() { + return materials_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (arguments_ != false) { + output.writeBool(1, arguments_); + } + if (environment_ != false) { + output.writeBool(2, environment_); + } + if (materials_ != false) { + output.writeBool(3, materials_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (arguments_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, arguments_); + } + if (environment_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, environment_); + } + if (materials_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, materials_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.Completeness)) { + return super.equals(obj); + } + io.grafeas.v1.Completeness other = (io.grafeas.v1.Completeness) obj; + + if (getArguments() != other.getArguments()) return false; + if (getEnvironment() != other.getEnvironment()) return false; + if (getMaterials() != other.getMaterials()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ARGUMENTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getArguments()); + hash = (37 * hash) + ENVIRONMENT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnvironment()); + hash = (37 * hash) + MATERIALS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getMaterials()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.Completeness parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.Completeness parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.Completeness parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.Completeness parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.Completeness parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.Completeness parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.Completeness parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.Completeness parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.Completeness parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.Completeness parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.Completeness parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.Completeness parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.Completeness 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Indicates that the builder claims certain fields in this message to be
+   * complete.
+   * 
+ * + * Protobuf type {@code grafeas.v1.Completeness} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.Completeness) + io.grafeas.v1.CompletenessOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.InTotoProvenanceProto.internal_static_grafeas_v1_Completeness_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.InTotoProvenanceProto + .internal_static_grafeas_v1_Completeness_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.Completeness.class, io.grafeas.v1.Completeness.Builder.class); + } + + // Construct using io.grafeas.v1.Completeness.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + arguments_ = false; + + environment_ = false; + + materials_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.InTotoProvenanceProto.internal_static_grafeas_v1_Completeness_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.Completeness getDefaultInstanceForType() { + return io.grafeas.v1.Completeness.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.Completeness build() { + io.grafeas.v1.Completeness result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.Completeness buildPartial() { + io.grafeas.v1.Completeness result = new io.grafeas.v1.Completeness(this); + result.arguments_ = arguments_; + result.environment_ = environment_; + result.materials_ = materials_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.Completeness) { + return mergeFrom((io.grafeas.v1.Completeness) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.Completeness other) { + if (other == io.grafeas.v1.Completeness.getDefaultInstance()) return this; + if (other.getArguments() != false) { + setArguments(other.getArguments()); + } + if (other.getEnvironment() != false) { + setEnvironment(other.getEnvironment()); + } + if (other.getMaterials() != false) { + setMaterials(other.getMaterials()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.Completeness parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.Completeness) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean arguments_; + /** + * + * + *
+     * If true, the builder claims that recipe.arguments is complete, meaning that
+     * all external inputs are properly captured in the recipe.
+     * 
+ * + * bool arguments = 1; + * + * @return The arguments. + */ + @java.lang.Override + public boolean getArguments() { + return arguments_; + } + /** + * + * + *
+     * If true, the builder claims that recipe.arguments is complete, meaning that
+     * all external inputs are properly captured in the recipe.
+     * 
+ * + * bool arguments = 1; + * + * @param value The arguments to set. + * @return This builder for chaining. + */ + public Builder setArguments(boolean value) { + + arguments_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If true, the builder claims that recipe.arguments is complete, meaning that
+     * all external inputs are properly captured in the recipe.
+     * 
+ * + * bool arguments = 1; + * + * @return This builder for chaining. + */ + public Builder clearArguments() { + + arguments_ = false; + onChanged(); + return this; + } + + private boolean environment_; + /** + * + * + *
+     * If true, the builder claims that recipe.environment is claimed to be
+     * complete.
+     * 
+ * + * bool environment = 2; + * + * @return The environment. + */ + @java.lang.Override + public boolean getEnvironment() { + return environment_; + } + /** + * + * + *
+     * If true, the builder claims that recipe.environment is claimed to be
+     * complete.
+     * 
+ * + * bool environment = 2; + * + * @param value The environment to set. + * @return This builder for chaining. + */ + public Builder setEnvironment(boolean value) { + + environment_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If true, the builder claims that recipe.environment is claimed to be
+     * complete.
+     * 
+ * + * bool environment = 2; + * + * @return This builder for chaining. + */ + public Builder clearEnvironment() { + + environment_ = false; + onChanged(); + return this; + } + + private boolean materials_; + /** + * + * + *
+     * If true, the builder claims that materials are complete, usually through
+     * some controls to prevent network access. Sometimes called "hermetic".
+     * 
+ * + * bool materials = 3; + * + * @return The materials. + */ + @java.lang.Override + public boolean getMaterials() { + return materials_; + } + /** + * + * + *
+     * If true, the builder claims that materials are complete, usually through
+     * some controls to prevent network access. Sometimes called "hermetic".
+     * 
+ * + * bool materials = 3; + * + * @param value The materials to set. + * @return This builder for chaining. + */ + public Builder setMaterials(boolean value) { + + materials_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If true, the builder claims that materials are complete, usually through
+     * some controls to prevent network access. Sometimes called "hermetic".
+     * 
+ * + * bool materials = 3; + * + * @return This builder for chaining. + */ + public Builder clearMaterials() { + + materials_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.Completeness) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.Completeness) + private static final io.grafeas.v1.Completeness DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.Completeness(); + } + + public static io.grafeas.v1.Completeness getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Completeness parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Completeness(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.Completeness getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/src/main/java/io/grafeas/v1/CompletenessOrBuilder.java b/src/main/java/io/grafeas/v1/CompletenessOrBuilder.java new file mode 100644 index 00000000..dc5a3463 --- /dev/null +++ b/src/main/java/io/grafeas/v1/CompletenessOrBuilder.java @@ -0,0 +1,68 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/intoto_provenance.proto + +package io.grafeas.v1; + +public interface CompletenessOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.Completeness) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If true, the builder claims that recipe.arguments is complete, meaning that
+   * all external inputs are properly captured in the recipe.
+   * 
+ * + * bool arguments = 1; + * + * @return The arguments. + */ + boolean getArguments(); + + /** + * + * + *
+   * If true, the builder claims that recipe.environment is claimed to be
+   * complete.
+   * 
+ * + * bool environment = 2; + * + * @return The environment. + */ + boolean getEnvironment(); + + /** + * + * + *
+   * If true, the builder claims that materials are complete, usually through
+   * some controls to prevent network access. Sometimes called "hermetic".
+   * 
+ * + * bool materials = 3; + * + * @return The materials. + */ + boolean getMaterials(); +} diff --git a/src/main/java/io/grafeas/v1/Compliance.java b/src/main/java/io/grafeas/v1/Compliance.java new file mode 100644 index 00000000..979e40be --- /dev/null +++ b/src/main/java/io/grafeas/v1/Compliance.java @@ -0,0 +1,136 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/compliance.proto + +package io.grafeas.v1; + +public final class Compliance { + private Compliance() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_ComplianceNote_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_ComplianceNote_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_ComplianceNote_CisBenchmark_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_ComplianceNote_CisBenchmark_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_ComplianceVersion_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_ComplianceVersion_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_ComplianceOccurrence_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_ComplianceOccurrence_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_NonCompliantFile_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_NonCompliantFile_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\033grafeas/v1/compliance.proto\022\ngrafeas.v" + + "1\032\036grafeas/v1/vulnerability.proto\"\313\002\n\016Co" + + "mplianceNote\022\r\n\005title\030\001 \001(\t\022\023\n\013descripti" + + "on\030\002 \001(\t\022.\n\007version\030\003 \003(\0132\035.grafeas.v1.C" + + "omplianceVersion\022\021\n\trationale\030\004 \001(\t\022\023\n\013r" + + "emediation\030\005 \001(\t\022@\n\rcis_benchmark\030\006 \001(\0132" + + "\'.grafeas.v1.ComplianceNote.CisBenchmark" + + "H\000\022\031\n\021scan_instructions\030\007 \001(\014\032M\n\014CisBenc" + + "hmark\022\025\n\rprofile_level\030\001 \001(\005\022&\n\010severity" + + "\030\002 \001(\0162\024.grafeas.v1.SeverityB\021\n\017complian" + + "ce_type\"5\n\021ComplianceVersion\022\017\n\007cpe_uri\030" + + "\001 \001(\t\022\017\n\007version\030\002 \001(\t\"p\n\024ComplianceOccu" + + "rrence\0229\n\023non_compliant_files\030\002 \003(\0132\034.gr" + + "afeas.v1.NonCompliantFile\022\035\n\025non_complia" + + "nce_reason\030\003 \001(\t\"I\n\020NonCompliantFile\022\014\n\004" + + "path\030\001 \001(\t\022\027\n\017display_command\030\002 \001(\t\022\016\n\006r" + + "eason\030\003 \001(\tBQ\n\rio.grafeas.v1P\001Z8google.g" + + "olang.org/genproto/googleapis/grafeas/v1" + + ";grafeas\242\002\003GRAb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + io.grafeas.v1.Vulnerability.getDescriptor(), + }); + internal_static_grafeas_v1_ComplianceNote_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_grafeas_v1_ComplianceNote_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_ComplianceNote_descriptor, + new java.lang.String[] { + "Title", + "Description", + "Version", + "Rationale", + "Remediation", + "CisBenchmark", + "ScanInstructions", + "ComplianceType", + }); + internal_static_grafeas_v1_ComplianceNote_CisBenchmark_descriptor = + internal_static_grafeas_v1_ComplianceNote_descriptor.getNestedTypes().get(0); + internal_static_grafeas_v1_ComplianceNote_CisBenchmark_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_ComplianceNote_CisBenchmark_descriptor, + new java.lang.String[] { + "ProfileLevel", "Severity", + }); + internal_static_grafeas_v1_ComplianceVersion_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_grafeas_v1_ComplianceVersion_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_ComplianceVersion_descriptor, + new java.lang.String[] { + "CpeUri", "Version", + }); + internal_static_grafeas_v1_ComplianceOccurrence_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_grafeas_v1_ComplianceOccurrence_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_ComplianceOccurrence_descriptor, + new java.lang.String[] { + "NonCompliantFiles", "NonComplianceReason", + }); + internal_static_grafeas_v1_NonCompliantFile_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_grafeas_v1_NonCompliantFile_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_NonCompliantFile_descriptor, + new java.lang.String[] { + "Path", "DisplayCommand", "Reason", + }); + io.grafeas.v1.Vulnerability.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/io/grafeas/v1/ComplianceNote.java b/src/main/java/io/grafeas/v1/ComplianceNote.java new file mode 100644 index 00000000..215de2f5 --- /dev/null +++ b/src/main/java/io/grafeas/v1/ComplianceNote.java @@ -0,0 +1,2658 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/compliance.proto + +package io.grafeas.v1; + +/** Protobuf type {@code grafeas.v1.ComplianceNote} */ +public final class ComplianceNote extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.ComplianceNote) + ComplianceNoteOrBuilder { + private static final long serialVersionUID = 0L; + // Use ComplianceNote.newBuilder() to construct. + private ComplianceNote(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ComplianceNote() { + title_ = ""; + description_ = ""; + version_ = java.util.Collections.emptyList(); + rationale_ = ""; + remediation_ = ""; + scanInstructions_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ComplianceNote(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ComplianceNote( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + title_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + version_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + version_.add( + input.readMessage(io.grafeas.v1.ComplianceVersion.parser(), extensionRegistry)); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + rationale_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + remediation_ = s; + break; + } + case 50: + { + io.grafeas.v1.ComplianceNote.CisBenchmark.Builder subBuilder = null; + if (complianceTypeCase_ == 6) { + subBuilder = + ((io.grafeas.v1.ComplianceNote.CisBenchmark) complianceType_).toBuilder(); + } + complianceType_ = + input.readMessage( + io.grafeas.v1.ComplianceNote.CisBenchmark.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1.ComplianceNote.CisBenchmark) complianceType_); + complianceType_ = subBuilder.buildPartial(); + } + complianceTypeCase_ = 6; + break; + } + case 58: + { + scanInstructions_ = input.readBytes(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + version_ = java.util.Collections.unmodifiableList(version_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Compliance.internal_static_grafeas_v1_ComplianceNote_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Compliance.internal_static_grafeas_v1_ComplianceNote_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.ComplianceNote.class, io.grafeas.v1.ComplianceNote.Builder.class); + } + + public interface CisBenchmarkOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.ComplianceNote.CisBenchmark) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 profile_level = 1; + * + * @return The profileLevel. + */ + int getProfileLevel(); + + /** + * .grafeas.v1.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + /** + * .grafeas.v1.Severity severity = 2; + * + * @return The severity. + */ + io.grafeas.v1.Severity getSeverity(); + } + /** + * + * + *
+   * A compliance check that is a CIS benchmark.
+   * 
+ * + * Protobuf type {@code grafeas.v1.ComplianceNote.CisBenchmark} + */ + public static final class CisBenchmark extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.ComplianceNote.CisBenchmark) + CisBenchmarkOrBuilder { + private static final long serialVersionUID = 0L; + // Use CisBenchmark.newBuilder() to construct. + private CisBenchmark(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CisBenchmark() { + severity_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CisBenchmark(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CisBenchmark( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + profileLevel_ = input.readInt32(); + break; + } + case 16: + { + int rawValue = input.readEnum(); + + severity_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Compliance + .internal_static_grafeas_v1_ComplianceNote_CisBenchmark_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Compliance + .internal_static_grafeas_v1_ComplianceNote_CisBenchmark_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.ComplianceNote.CisBenchmark.class, + io.grafeas.v1.ComplianceNote.CisBenchmark.Builder.class); + } + + public static final int PROFILE_LEVEL_FIELD_NUMBER = 1; + private int profileLevel_; + /** + * int32 profile_level = 1; + * + * @return The profileLevel. + */ + @java.lang.Override + public int getProfileLevel() { + return profileLevel_; + } + + public static final int SEVERITY_FIELD_NUMBER = 2; + private int severity_; + /** + * .grafeas.v1.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * .grafeas.v1.Severity severity = 2; + * + * @return The severity. + */ + @java.lang.Override + public io.grafeas.v1.Severity getSeverity() { + @SuppressWarnings("deprecation") + io.grafeas.v1.Severity result = io.grafeas.v1.Severity.valueOf(severity_); + return result == null ? io.grafeas.v1.Severity.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (profileLevel_ != 0) { + output.writeInt32(1, profileLevel_); + } + if (severity_ != io.grafeas.v1.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + output.writeEnum(2, severity_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (profileLevel_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, profileLevel_); + } + if (severity_ != io.grafeas.v1.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, severity_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.ComplianceNote.CisBenchmark)) { + return super.equals(obj); + } + io.grafeas.v1.ComplianceNote.CisBenchmark other = + (io.grafeas.v1.ComplianceNote.CisBenchmark) obj; + + if (getProfileLevel() != other.getProfileLevel()) return false; + if (severity_ != other.severity_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PROFILE_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getProfileLevel(); + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.ComplianceNote.CisBenchmark parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.ComplianceNote.CisBenchmark parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceNote.CisBenchmark parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.ComplianceNote.CisBenchmark parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceNote.CisBenchmark parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.ComplianceNote.CisBenchmark parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceNote.CisBenchmark parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.ComplianceNote.CisBenchmark parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceNote.CisBenchmark parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.ComplianceNote.CisBenchmark parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceNote.CisBenchmark parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.ComplianceNote.CisBenchmark parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.ComplianceNote.CisBenchmark 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * A compliance check that is a CIS benchmark.
+     * 
+ * + * Protobuf type {@code grafeas.v1.ComplianceNote.CisBenchmark} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.ComplianceNote.CisBenchmark) + io.grafeas.v1.ComplianceNote.CisBenchmarkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Compliance + .internal_static_grafeas_v1_ComplianceNote_CisBenchmark_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Compliance + .internal_static_grafeas_v1_ComplianceNote_CisBenchmark_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.ComplianceNote.CisBenchmark.class, + io.grafeas.v1.ComplianceNote.CisBenchmark.Builder.class); + } + + // Construct using io.grafeas.v1.ComplianceNote.CisBenchmark.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + profileLevel_ = 0; + + severity_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.Compliance + .internal_static_grafeas_v1_ComplianceNote_CisBenchmark_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.ComplianceNote.CisBenchmark getDefaultInstanceForType() { + return io.grafeas.v1.ComplianceNote.CisBenchmark.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.ComplianceNote.CisBenchmark build() { + io.grafeas.v1.ComplianceNote.CisBenchmark result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.ComplianceNote.CisBenchmark buildPartial() { + io.grafeas.v1.ComplianceNote.CisBenchmark result = + new io.grafeas.v1.ComplianceNote.CisBenchmark(this); + result.profileLevel_ = profileLevel_; + result.severity_ = severity_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.ComplianceNote.CisBenchmark) { + return mergeFrom((io.grafeas.v1.ComplianceNote.CisBenchmark) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.ComplianceNote.CisBenchmark other) { + if (other == io.grafeas.v1.ComplianceNote.CisBenchmark.getDefaultInstance()) return this; + if (other.getProfileLevel() != 0) { + setProfileLevel(other.getProfileLevel()); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.ComplianceNote.CisBenchmark parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.ComplianceNote.CisBenchmark) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int profileLevel_; + /** + * int32 profile_level = 1; + * + * @return The profileLevel. + */ + @java.lang.Override + public int getProfileLevel() { + return profileLevel_; + } + /** + * int32 profile_level = 1; + * + * @param value The profileLevel to set. + * @return This builder for chaining. + */ + public Builder setProfileLevel(int value) { + + profileLevel_ = value; + onChanged(); + return this; + } + /** + * int32 profile_level = 1; + * + * @return This builder for chaining. + */ + public Builder clearProfileLevel() { + + profileLevel_ = 0; + onChanged(); + return this; + } + + private int severity_ = 0; + /** + * .grafeas.v1.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * .grafeas.v1.Severity severity = 2; + * + * @param value The enum numeric value on the wire for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityValue(int value) { + + severity_ = value; + onChanged(); + return this; + } + /** + * .grafeas.v1.Severity severity = 2; + * + * @return The severity. + */ + @java.lang.Override + public io.grafeas.v1.Severity getSeverity() { + @SuppressWarnings("deprecation") + io.grafeas.v1.Severity result = io.grafeas.v1.Severity.valueOf(severity_); + return result == null ? io.grafeas.v1.Severity.UNRECOGNIZED : result; + } + /** + * .grafeas.v1.Severity severity = 2; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(io.grafeas.v1.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .grafeas.v1.Severity severity = 2; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + + severity_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.ComplianceNote.CisBenchmark) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.ComplianceNote.CisBenchmark) + private static final io.grafeas.v1.ComplianceNote.CisBenchmark DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.ComplianceNote.CisBenchmark(); + } + + public static io.grafeas.v1.ComplianceNote.CisBenchmark getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CisBenchmark parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CisBenchmark(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.ComplianceNote.CisBenchmark getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int complianceTypeCase_ = 0; + private java.lang.Object complianceType_; + + public enum ComplianceTypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CIS_BENCHMARK(6), + COMPLIANCETYPE_NOT_SET(0); + private final int value; + + private ComplianceTypeCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ComplianceTypeCase valueOf(int value) { + return forNumber(value); + } + + public static ComplianceTypeCase forNumber(int value) { + switch (value) { + case 6: + return CIS_BENCHMARK; + case 0: + return COMPLIANCETYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ComplianceTypeCase getComplianceTypeCase() { + return ComplianceTypeCase.forNumber(complianceTypeCase_); + } + + public static final int TITLE_FIELD_NUMBER = 1; + private volatile java.lang.Object title_; + /** + * + * + *
+   * The title that identifies this compliance check.
+   * 
+ * + * string title = 1; + * + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + java.lang.Object ref = title_; + 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(); + title_ = s; + return s; + } + } + /** + * + * + *
+   * The title that identifies this compliance check.
+   * 
+ * + * string title = 1; + * + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * A description about this compliance check.
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * A description about this compliance check.
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_FIELD_NUMBER = 3; + private java.util.List version_; + /** + * + * + *
+   * The OS and config versions the benchmark applies to.
+   * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + @java.lang.Override + public java.util.List getVersionList() { + return version_; + } + /** + * + * + *
+   * The OS and config versions the benchmark applies to.
+   * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + @java.lang.Override + public java.util.List + getVersionOrBuilderList() { + return version_; + } + /** + * + * + *
+   * The OS and config versions the benchmark applies to.
+   * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + @java.lang.Override + public int getVersionCount() { + return version_.size(); + } + /** + * + * + *
+   * The OS and config versions the benchmark applies to.
+   * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + @java.lang.Override + public io.grafeas.v1.ComplianceVersion getVersion(int index) { + return version_.get(index); + } + /** + * + * + *
+   * The OS and config versions the benchmark applies to.
+   * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + @java.lang.Override + public io.grafeas.v1.ComplianceVersionOrBuilder getVersionOrBuilder(int index) { + return version_.get(index); + } + + public static final int RATIONALE_FIELD_NUMBER = 4; + private volatile java.lang.Object rationale_; + /** + * + * + *
+   * A rationale for the existence of this compliance check.
+   * 
+ * + * string rationale = 4; + * + * @return The rationale. + */ + @java.lang.Override + public java.lang.String getRationale() { + java.lang.Object ref = rationale_; + 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(); + rationale_ = s; + return s; + } + } + /** + * + * + *
+   * A rationale for the existence of this compliance check.
+   * 
+ * + * string rationale = 4; + * + * @return The bytes for rationale. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRationaleBytes() { + java.lang.Object ref = rationale_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rationale_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REMEDIATION_FIELD_NUMBER = 5; + private volatile java.lang.Object remediation_; + /** + * + * + *
+   * A description of remediation steps if the compliance check fails.
+   * 
+ * + * string remediation = 5; + * + * @return The remediation. + */ + @java.lang.Override + public java.lang.String getRemediation() { + java.lang.Object ref = remediation_; + 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(); + remediation_ = s; + return s; + } + } + /** + * + * + *
+   * A description of remediation steps if the compliance check fails.
+   * 
+ * + * string remediation = 5; + * + * @return The bytes for remediation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRemediationBytes() { + java.lang.Object ref = remediation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + remediation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CIS_BENCHMARK_FIELD_NUMBER = 6; + /** + * .grafeas.v1.ComplianceNote.CisBenchmark cis_benchmark = 6; + * + * @return Whether the cisBenchmark field is set. + */ + @java.lang.Override + public boolean hasCisBenchmark() { + return complianceTypeCase_ == 6; + } + /** + * .grafeas.v1.ComplianceNote.CisBenchmark cis_benchmark = 6; + * + * @return The cisBenchmark. + */ + @java.lang.Override + public io.grafeas.v1.ComplianceNote.CisBenchmark getCisBenchmark() { + if (complianceTypeCase_ == 6) { + return (io.grafeas.v1.ComplianceNote.CisBenchmark) complianceType_; + } + return io.grafeas.v1.ComplianceNote.CisBenchmark.getDefaultInstance(); + } + /** .grafeas.v1.ComplianceNote.CisBenchmark cis_benchmark = 6; */ + @java.lang.Override + public io.grafeas.v1.ComplianceNote.CisBenchmarkOrBuilder getCisBenchmarkOrBuilder() { + if (complianceTypeCase_ == 6) { + return (io.grafeas.v1.ComplianceNote.CisBenchmark) complianceType_; + } + return io.grafeas.v1.ComplianceNote.CisBenchmark.getDefaultInstance(); + } + + public static final int SCAN_INSTRUCTIONS_FIELD_NUMBER = 7; + private com.google.protobuf.ByteString scanInstructions_; + /** + * + * + *
+   * Serialized scan instructions with a predefined format.
+   * 
+ * + * bytes scan_instructions = 7; + * + * @return The scanInstructions. + */ + @java.lang.Override + public com.google.protobuf.ByteString getScanInstructions() { + return scanInstructions_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, title_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + for (int i = 0; i < version_.size(); i++) { + output.writeMessage(3, version_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rationale_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, rationale_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(remediation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, remediation_); + } + if (complianceTypeCase_ == 6) { + output.writeMessage(6, (io.grafeas.v1.ComplianceNote.CisBenchmark) complianceType_); + } + if (!scanInstructions_.isEmpty()) { + output.writeBytes(7, scanInstructions_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, title_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + for (int i = 0; i < version_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, version_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rationale_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, rationale_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(remediation_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, remediation_); + } + if (complianceTypeCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (io.grafeas.v1.ComplianceNote.CisBenchmark) complianceType_); + } + if (!scanInstructions_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(7, scanInstructions_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.ComplianceNote)) { + return super.equals(obj); + } + io.grafeas.v1.ComplianceNote other = (io.grafeas.v1.ComplianceNote) obj; + + if (!getTitle().equals(other.getTitle())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getVersionList().equals(other.getVersionList())) return false; + if (!getRationale().equals(other.getRationale())) return false; + if (!getRemediation().equals(other.getRemediation())) return false; + if (!getScanInstructions().equals(other.getScanInstructions())) return false; + if (!getComplianceTypeCase().equals(other.getComplianceTypeCase())) return false; + switch (complianceTypeCase_) { + case 6: + if (!getCisBenchmark().equals(other.getCisBenchmark())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getVersionCount() > 0) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersionList().hashCode(); + } + hash = (37 * hash) + RATIONALE_FIELD_NUMBER; + hash = (53 * hash) + getRationale().hashCode(); + hash = (37 * hash) + REMEDIATION_FIELD_NUMBER; + hash = (53 * hash) + getRemediation().hashCode(); + hash = (37 * hash) + SCAN_INSTRUCTIONS_FIELD_NUMBER; + hash = (53 * hash) + getScanInstructions().hashCode(); + switch (complianceTypeCase_) { + case 6: + hash = (37 * hash) + CIS_BENCHMARK_FIELD_NUMBER; + hash = (53 * hash) + getCisBenchmark().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.ComplianceNote parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.ComplianceNote parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceNote parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.ComplianceNote parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceNote parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.ComplianceNote parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceNote parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.ComplianceNote parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceNote parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.ComplianceNote parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceNote parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.ComplianceNote parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.ComplianceNote 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code grafeas.v1.ComplianceNote} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.ComplianceNote) + io.grafeas.v1.ComplianceNoteOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Compliance.internal_static_grafeas_v1_ComplianceNote_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Compliance.internal_static_grafeas_v1_ComplianceNote_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.ComplianceNote.class, io.grafeas.v1.ComplianceNote.Builder.class); + } + + // Construct using io.grafeas.v1.ComplianceNote.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getVersionFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + title_ = ""; + + description_ = ""; + + if (versionBuilder_ == null) { + version_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + versionBuilder_.clear(); + } + rationale_ = ""; + + remediation_ = ""; + + scanInstructions_ = com.google.protobuf.ByteString.EMPTY; + + complianceTypeCase_ = 0; + complianceType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.Compliance.internal_static_grafeas_v1_ComplianceNote_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.ComplianceNote getDefaultInstanceForType() { + return io.grafeas.v1.ComplianceNote.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.ComplianceNote build() { + io.grafeas.v1.ComplianceNote result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.ComplianceNote buildPartial() { + io.grafeas.v1.ComplianceNote result = new io.grafeas.v1.ComplianceNote(this); + int from_bitField0_ = bitField0_; + result.title_ = title_; + result.description_ = description_; + if (versionBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + version_ = java.util.Collections.unmodifiableList(version_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.version_ = version_; + } else { + result.version_ = versionBuilder_.build(); + } + result.rationale_ = rationale_; + result.remediation_ = remediation_; + if (complianceTypeCase_ == 6) { + if (cisBenchmarkBuilder_ == null) { + result.complianceType_ = complianceType_; + } else { + result.complianceType_ = cisBenchmarkBuilder_.build(); + } + } + result.scanInstructions_ = scanInstructions_; + result.complianceTypeCase_ = complianceTypeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.ComplianceNote) { + return mergeFrom((io.grafeas.v1.ComplianceNote) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.ComplianceNote other) { + if (other == io.grafeas.v1.ComplianceNote.getDefaultInstance()) return this; + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (versionBuilder_ == null) { + if (!other.version_.isEmpty()) { + if (version_.isEmpty()) { + version_ = other.version_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureVersionIsMutable(); + version_.addAll(other.version_); + } + onChanged(); + } + } else { + if (!other.version_.isEmpty()) { + if (versionBuilder_.isEmpty()) { + versionBuilder_.dispose(); + versionBuilder_ = null; + version_ = other.version_; + bitField0_ = (bitField0_ & ~0x00000001); + versionBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getVersionFieldBuilder() + : null; + } else { + versionBuilder_.addAllMessages(other.version_); + } + } + } + if (!other.getRationale().isEmpty()) { + rationale_ = other.rationale_; + onChanged(); + } + if (!other.getRemediation().isEmpty()) { + remediation_ = other.remediation_; + onChanged(); + } + if (other.getScanInstructions() != com.google.protobuf.ByteString.EMPTY) { + setScanInstructions(other.getScanInstructions()); + } + switch (other.getComplianceTypeCase()) { + case CIS_BENCHMARK: + { + mergeCisBenchmark(other.getCisBenchmark()); + break; + } + case COMPLIANCETYPE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.ComplianceNote parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.ComplianceNote) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int complianceTypeCase_ = 0; + private java.lang.Object complianceType_; + + public ComplianceTypeCase getComplianceTypeCase() { + return ComplianceTypeCase.forNumber(complianceTypeCase_); + } + + public Builder clearComplianceType() { + complianceTypeCase_ = 0; + complianceType_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object title_ = ""; + /** + * + * + *
+     * The title that identifies this compliance check.
+     * 
+ * + * string title = 1; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The title that identifies this compliance check.
+     * 
+ * + * string title = 1; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The title that identifies this compliance check.
+     * 
+ * + * string title = 1; + * + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The title that identifies this compliance check.
+     * 
+ * + * string title = 1; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * + * + *
+     * The title that identifies this compliance check.
+     * 
+ * + * string title = 1; + * + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * A description about this compliance check.
+     * 
+ * + * string description = 2; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A description about this compliance check.
+     * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A description about this compliance check.
+     * 
+ * + * string description = 2; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A description about this compliance check.
+     * 
+ * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * A description about this compliance check.
+     * 
+ * + * string description = 2; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.util.List version_ = + java.util.Collections.emptyList(); + + private void ensureVersionIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + version_ = new java.util.ArrayList(version_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1.ComplianceVersion, + io.grafeas.v1.ComplianceVersion.Builder, + io.grafeas.v1.ComplianceVersionOrBuilder> + versionBuilder_; + + /** + * + * + *
+     * The OS and config versions the benchmark applies to.
+     * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + public java.util.List getVersionList() { + if (versionBuilder_ == null) { + return java.util.Collections.unmodifiableList(version_); + } else { + return versionBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The OS and config versions the benchmark applies to.
+     * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + public int getVersionCount() { + if (versionBuilder_ == null) { + return version_.size(); + } else { + return versionBuilder_.getCount(); + } + } + /** + * + * + *
+     * The OS and config versions the benchmark applies to.
+     * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + public io.grafeas.v1.ComplianceVersion getVersion(int index) { + if (versionBuilder_ == null) { + return version_.get(index); + } else { + return versionBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The OS and config versions the benchmark applies to.
+     * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + public Builder setVersion(int index, io.grafeas.v1.ComplianceVersion value) { + if (versionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionIsMutable(); + version_.set(index, value); + onChanged(); + } else { + versionBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The OS and config versions the benchmark applies to.
+     * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + public Builder setVersion(int index, io.grafeas.v1.ComplianceVersion.Builder builderForValue) { + if (versionBuilder_ == null) { + ensureVersionIsMutable(); + version_.set(index, builderForValue.build()); + onChanged(); + } else { + versionBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The OS and config versions the benchmark applies to.
+     * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + public Builder addVersion(io.grafeas.v1.ComplianceVersion value) { + if (versionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionIsMutable(); + version_.add(value); + onChanged(); + } else { + versionBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The OS and config versions the benchmark applies to.
+     * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + public Builder addVersion(int index, io.grafeas.v1.ComplianceVersion value) { + if (versionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionIsMutable(); + version_.add(index, value); + onChanged(); + } else { + versionBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The OS and config versions the benchmark applies to.
+     * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + public Builder addVersion(io.grafeas.v1.ComplianceVersion.Builder builderForValue) { + if (versionBuilder_ == null) { + ensureVersionIsMutable(); + version_.add(builderForValue.build()); + onChanged(); + } else { + versionBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The OS and config versions the benchmark applies to.
+     * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + public Builder addVersion(int index, io.grafeas.v1.ComplianceVersion.Builder builderForValue) { + if (versionBuilder_ == null) { + ensureVersionIsMutable(); + version_.add(index, builderForValue.build()); + onChanged(); + } else { + versionBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The OS and config versions the benchmark applies to.
+     * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + public Builder addAllVersion( + java.lang.Iterable values) { + if (versionBuilder_ == null) { + ensureVersionIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, version_); + onChanged(); + } else { + versionBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The OS and config versions the benchmark applies to.
+     * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + public Builder clearVersion() { + if (versionBuilder_ == null) { + version_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + versionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The OS and config versions the benchmark applies to.
+     * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + public Builder removeVersion(int index) { + if (versionBuilder_ == null) { + ensureVersionIsMutable(); + version_.remove(index); + onChanged(); + } else { + versionBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The OS and config versions the benchmark applies to.
+     * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + public io.grafeas.v1.ComplianceVersion.Builder getVersionBuilder(int index) { + return getVersionFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The OS and config versions the benchmark applies to.
+     * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + public io.grafeas.v1.ComplianceVersionOrBuilder getVersionOrBuilder(int index) { + if (versionBuilder_ == null) { + return version_.get(index); + } else { + return versionBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The OS and config versions the benchmark applies to.
+     * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + public java.util.List + getVersionOrBuilderList() { + if (versionBuilder_ != null) { + return versionBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(version_); + } + } + /** + * + * + *
+     * The OS and config versions the benchmark applies to.
+     * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + public io.grafeas.v1.ComplianceVersion.Builder addVersionBuilder() { + return getVersionFieldBuilder() + .addBuilder(io.grafeas.v1.ComplianceVersion.getDefaultInstance()); + } + /** + * + * + *
+     * The OS and config versions the benchmark applies to.
+     * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + public io.grafeas.v1.ComplianceVersion.Builder addVersionBuilder(int index) { + return getVersionFieldBuilder() + .addBuilder(index, io.grafeas.v1.ComplianceVersion.getDefaultInstance()); + } + /** + * + * + *
+     * The OS and config versions the benchmark applies to.
+     * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + public java.util.List getVersionBuilderList() { + return getVersionFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1.ComplianceVersion, + io.grafeas.v1.ComplianceVersion.Builder, + io.grafeas.v1.ComplianceVersionOrBuilder> + getVersionFieldBuilder() { + if (versionBuilder_ == null) { + versionBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1.ComplianceVersion, + io.grafeas.v1.ComplianceVersion.Builder, + io.grafeas.v1.ComplianceVersionOrBuilder>( + version_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + version_ = null; + } + return versionBuilder_; + } + + private java.lang.Object rationale_ = ""; + /** + * + * + *
+     * A rationale for the existence of this compliance check.
+     * 
+ * + * string rationale = 4; + * + * @return The rationale. + */ + public java.lang.String getRationale() { + java.lang.Object ref = rationale_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rationale_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A rationale for the existence of this compliance check.
+     * 
+ * + * string rationale = 4; + * + * @return The bytes for rationale. + */ + public com.google.protobuf.ByteString getRationaleBytes() { + java.lang.Object ref = rationale_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rationale_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A rationale for the existence of this compliance check.
+     * 
+ * + * string rationale = 4; + * + * @param value The rationale to set. + * @return This builder for chaining. + */ + public Builder setRationale(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + rationale_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A rationale for the existence of this compliance check.
+     * 
+ * + * string rationale = 4; + * + * @return This builder for chaining. + */ + public Builder clearRationale() { + + rationale_ = getDefaultInstance().getRationale(); + onChanged(); + return this; + } + /** + * + * + *
+     * A rationale for the existence of this compliance check.
+     * 
+ * + * string rationale = 4; + * + * @param value The bytes for rationale to set. + * @return This builder for chaining. + */ + public Builder setRationaleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + rationale_ = value; + onChanged(); + return this; + } + + private java.lang.Object remediation_ = ""; + /** + * + * + *
+     * A description of remediation steps if the compliance check fails.
+     * 
+ * + * string remediation = 5; + * + * @return The remediation. + */ + public java.lang.String getRemediation() { + java.lang.Object ref = remediation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + remediation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A description of remediation steps if the compliance check fails.
+     * 
+ * + * string remediation = 5; + * + * @return The bytes for remediation. + */ + public com.google.protobuf.ByteString getRemediationBytes() { + java.lang.Object ref = remediation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + remediation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A description of remediation steps if the compliance check fails.
+     * 
+ * + * string remediation = 5; + * + * @param value The remediation to set. + * @return This builder for chaining. + */ + public Builder setRemediation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + remediation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A description of remediation steps if the compliance check fails.
+     * 
+ * + * string remediation = 5; + * + * @return This builder for chaining. + */ + public Builder clearRemediation() { + + remediation_ = getDefaultInstance().getRemediation(); + onChanged(); + return this; + } + /** + * + * + *
+     * A description of remediation steps if the compliance check fails.
+     * 
+ * + * string remediation = 5; + * + * @param value The bytes for remediation to set. + * @return This builder for chaining. + */ + public Builder setRemediationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + remediation_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.ComplianceNote.CisBenchmark, + io.grafeas.v1.ComplianceNote.CisBenchmark.Builder, + io.grafeas.v1.ComplianceNote.CisBenchmarkOrBuilder> + cisBenchmarkBuilder_; + /** + * .grafeas.v1.ComplianceNote.CisBenchmark cis_benchmark = 6; + * + * @return Whether the cisBenchmark field is set. + */ + @java.lang.Override + public boolean hasCisBenchmark() { + return complianceTypeCase_ == 6; + } + /** + * .grafeas.v1.ComplianceNote.CisBenchmark cis_benchmark = 6; + * + * @return The cisBenchmark. + */ + @java.lang.Override + public io.grafeas.v1.ComplianceNote.CisBenchmark getCisBenchmark() { + if (cisBenchmarkBuilder_ == null) { + if (complianceTypeCase_ == 6) { + return (io.grafeas.v1.ComplianceNote.CisBenchmark) complianceType_; + } + return io.grafeas.v1.ComplianceNote.CisBenchmark.getDefaultInstance(); + } else { + if (complianceTypeCase_ == 6) { + return cisBenchmarkBuilder_.getMessage(); + } + return io.grafeas.v1.ComplianceNote.CisBenchmark.getDefaultInstance(); + } + } + /** .grafeas.v1.ComplianceNote.CisBenchmark cis_benchmark = 6; */ + public Builder setCisBenchmark(io.grafeas.v1.ComplianceNote.CisBenchmark value) { + if (cisBenchmarkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + complianceType_ = value; + onChanged(); + } else { + cisBenchmarkBuilder_.setMessage(value); + } + complianceTypeCase_ = 6; + return this; + } + /** .grafeas.v1.ComplianceNote.CisBenchmark cis_benchmark = 6; */ + public Builder setCisBenchmark( + io.grafeas.v1.ComplianceNote.CisBenchmark.Builder builderForValue) { + if (cisBenchmarkBuilder_ == null) { + complianceType_ = builderForValue.build(); + onChanged(); + } else { + cisBenchmarkBuilder_.setMessage(builderForValue.build()); + } + complianceTypeCase_ = 6; + return this; + } + /** .grafeas.v1.ComplianceNote.CisBenchmark cis_benchmark = 6; */ + public Builder mergeCisBenchmark(io.grafeas.v1.ComplianceNote.CisBenchmark value) { + if (cisBenchmarkBuilder_ == null) { + if (complianceTypeCase_ == 6 + && complianceType_ != io.grafeas.v1.ComplianceNote.CisBenchmark.getDefaultInstance()) { + complianceType_ = + io.grafeas.v1.ComplianceNote.CisBenchmark.newBuilder( + (io.grafeas.v1.ComplianceNote.CisBenchmark) complianceType_) + .mergeFrom(value) + .buildPartial(); + } else { + complianceType_ = value; + } + onChanged(); + } else { + if (complianceTypeCase_ == 6) { + cisBenchmarkBuilder_.mergeFrom(value); + } + cisBenchmarkBuilder_.setMessage(value); + } + complianceTypeCase_ = 6; + return this; + } + /** .grafeas.v1.ComplianceNote.CisBenchmark cis_benchmark = 6; */ + public Builder clearCisBenchmark() { + if (cisBenchmarkBuilder_ == null) { + if (complianceTypeCase_ == 6) { + complianceTypeCase_ = 0; + complianceType_ = null; + onChanged(); + } + } else { + if (complianceTypeCase_ == 6) { + complianceTypeCase_ = 0; + complianceType_ = null; + } + cisBenchmarkBuilder_.clear(); + } + return this; + } + /** .grafeas.v1.ComplianceNote.CisBenchmark cis_benchmark = 6; */ + public io.grafeas.v1.ComplianceNote.CisBenchmark.Builder getCisBenchmarkBuilder() { + return getCisBenchmarkFieldBuilder().getBuilder(); + } + /** .grafeas.v1.ComplianceNote.CisBenchmark cis_benchmark = 6; */ + @java.lang.Override + public io.grafeas.v1.ComplianceNote.CisBenchmarkOrBuilder getCisBenchmarkOrBuilder() { + if ((complianceTypeCase_ == 6) && (cisBenchmarkBuilder_ != null)) { + return cisBenchmarkBuilder_.getMessageOrBuilder(); + } else { + if (complianceTypeCase_ == 6) { + return (io.grafeas.v1.ComplianceNote.CisBenchmark) complianceType_; + } + return io.grafeas.v1.ComplianceNote.CisBenchmark.getDefaultInstance(); + } + } + /** .grafeas.v1.ComplianceNote.CisBenchmark cis_benchmark = 6; */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.ComplianceNote.CisBenchmark, + io.grafeas.v1.ComplianceNote.CisBenchmark.Builder, + io.grafeas.v1.ComplianceNote.CisBenchmarkOrBuilder> + getCisBenchmarkFieldBuilder() { + if (cisBenchmarkBuilder_ == null) { + if (!(complianceTypeCase_ == 6)) { + complianceType_ = io.grafeas.v1.ComplianceNote.CisBenchmark.getDefaultInstance(); + } + cisBenchmarkBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.ComplianceNote.CisBenchmark, + io.grafeas.v1.ComplianceNote.CisBenchmark.Builder, + io.grafeas.v1.ComplianceNote.CisBenchmarkOrBuilder>( + (io.grafeas.v1.ComplianceNote.CisBenchmark) complianceType_, + getParentForChildren(), + isClean()); + complianceType_ = null; + } + complianceTypeCase_ = 6; + onChanged(); + ; + return cisBenchmarkBuilder_; + } + + private com.google.protobuf.ByteString scanInstructions_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * Serialized scan instructions with a predefined format.
+     * 
+ * + * bytes scan_instructions = 7; + * + * @return The scanInstructions. + */ + @java.lang.Override + public com.google.protobuf.ByteString getScanInstructions() { + return scanInstructions_; + } + /** + * + * + *
+     * Serialized scan instructions with a predefined format.
+     * 
+ * + * bytes scan_instructions = 7; + * + * @param value The scanInstructions to set. + * @return This builder for chaining. + */ + public Builder setScanInstructions(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + scanInstructions_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Serialized scan instructions with a predefined format.
+     * 
+ * + * bytes scan_instructions = 7; + * + * @return This builder for chaining. + */ + public Builder clearScanInstructions() { + + scanInstructions_ = getDefaultInstance().getScanInstructions(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.ComplianceNote) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.ComplianceNote) + private static final io.grafeas.v1.ComplianceNote DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.ComplianceNote(); + } + + public static io.grafeas.v1.ComplianceNote getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceNote parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ComplianceNote(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.ComplianceNote getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/src/main/java/io/grafeas/v1/ComplianceNoteOrBuilder.java b/src/main/java/io/grafeas/v1/ComplianceNoteOrBuilder.java new file mode 100644 index 00000000..b74c39d9 --- /dev/null +++ b/src/main/java/io/grafeas/v1/ComplianceNoteOrBuilder.java @@ -0,0 +1,207 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/compliance.proto + +package io.grafeas.v1; + +public interface ComplianceNoteOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.ComplianceNote) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The title that identifies this compliance check.
+   * 
+ * + * string title = 1; + * + * @return The title. + */ + java.lang.String getTitle(); + /** + * + * + *
+   * The title that identifies this compliance check.
+   * 
+ * + * string title = 1; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + + /** + * + * + *
+   * A description about this compliance check.
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * A description about this compliance check.
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * The OS and config versions the benchmark applies to.
+   * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + java.util.List getVersionList(); + /** + * + * + *
+   * The OS and config versions the benchmark applies to.
+   * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + io.grafeas.v1.ComplianceVersion getVersion(int index); + /** + * + * + *
+   * The OS and config versions the benchmark applies to.
+   * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + int getVersionCount(); + /** + * + * + *
+   * The OS and config versions the benchmark applies to.
+   * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + java.util.List getVersionOrBuilderList(); + /** + * + * + *
+   * The OS and config versions the benchmark applies to.
+   * 
+ * + * repeated .grafeas.v1.ComplianceVersion version = 3; + */ + io.grafeas.v1.ComplianceVersionOrBuilder getVersionOrBuilder(int index); + + /** + * + * + *
+   * A rationale for the existence of this compliance check.
+   * 
+ * + * string rationale = 4; + * + * @return The rationale. + */ + java.lang.String getRationale(); + /** + * + * + *
+   * A rationale for the existence of this compliance check.
+   * 
+ * + * string rationale = 4; + * + * @return The bytes for rationale. + */ + com.google.protobuf.ByteString getRationaleBytes(); + + /** + * + * + *
+   * A description of remediation steps if the compliance check fails.
+   * 
+ * + * string remediation = 5; + * + * @return The remediation. + */ + java.lang.String getRemediation(); + /** + * + * + *
+   * A description of remediation steps if the compliance check fails.
+   * 
+ * + * string remediation = 5; + * + * @return The bytes for remediation. + */ + com.google.protobuf.ByteString getRemediationBytes(); + + /** + * .grafeas.v1.ComplianceNote.CisBenchmark cis_benchmark = 6; + * + * @return Whether the cisBenchmark field is set. + */ + boolean hasCisBenchmark(); + /** + * .grafeas.v1.ComplianceNote.CisBenchmark cis_benchmark = 6; + * + * @return The cisBenchmark. + */ + io.grafeas.v1.ComplianceNote.CisBenchmark getCisBenchmark(); + /** .grafeas.v1.ComplianceNote.CisBenchmark cis_benchmark = 6; */ + io.grafeas.v1.ComplianceNote.CisBenchmarkOrBuilder getCisBenchmarkOrBuilder(); + + /** + * + * + *
+   * Serialized scan instructions with a predefined format.
+   * 
+ * + * bytes scan_instructions = 7; + * + * @return The scanInstructions. + */ + com.google.protobuf.ByteString getScanInstructions(); + + public io.grafeas.v1.ComplianceNote.ComplianceTypeCase getComplianceTypeCase(); +} diff --git a/src/main/java/io/grafeas/v1/ComplianceOccurrence.java b/src/main/java/io/grafeas/v1/ComplianceOccurrence.java new file mode 100644 index 00000000..86114bd4 --- /dev/null +++ b/src/main/java/io/grafeas/v1/ComplianceOccurrence.java @@ -0,0 +1,901 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/compliance.proto + +package io.grafeas.v1; + +/** + * + * + *
+ * An indication that the compliance checks in the associated ComplianceNote
+ * were not satisfied for particular resources or a specified reason.
+ * 
+ * + * Protobuf type {@code grafeas.v1.ComplianceOccurrence} + */ +public final class ComplianceOccurrence extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.ComplianceOccurrence) + ComplianceOccurrenceOrBuilder { + private static final long serialVersionUID = 0L; + // Use ComplianceOccurrence.newBuilder() to construct. + private ComplianceOccurrence(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ComplianceOccurrence() { + nonCompliantFiles_ = java.util.Collections.emptyList(); + nonComplianceReason_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ComplianceOccurrence(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ComplianceOccurrence( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + nonCompliantFiles_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + nonCompliantFiles_.add( + input.readMessage(io.grafeas.v1.NonCompliantFile.parser(), extensionRegistry)); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + nonComplianceReason_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + nonCompliantFiles_ = java.util.Collections.unmodifiableList(nonCompliantFiles_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Compliance.internal_static_grafeas_v1_ComplianceOccurrence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Compliance + .internal_static_grafeas_v1_ComplianceOccurrence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.ComplianceOccurrence.class, + io.grafeas.v1.ComplianceOccurrence.Builder.class); + } + + public static final int NON_COMPLIANT_FILES_FIELD_NUMBER = 2; + private java.util.List nonCompliantFiles_; + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + @java.lang.Override + public java.util.List getNonCompliantFilesList() { + return nonCompliantFiles_; + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + @java.lang.Override + public java.util.List + getNonCompliantFilesOrBuilderList() { + return nonCompliantFiles_; + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + @java.lang.Override + public int getNonCompliantFilesCount() { + return nonCompliantFiles_.size(); + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + @java.lang.Override + public io.grafeas.v1.NonCompliantFile getNonCompliantFiles(int index) { + return nonCompliantFiles_.get(index); + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + @java.lang.Override + public io.grafeas.v1.NonCompliantFileOrBuilder getNonCompliantFilesOrBuilder(int index) { + return nonCompliantFiles_.get(index); + } + + public static final int NON_COMPLIANCE_REASON_FIELD_NUMBER = 3; + private volatile java.lang.Object nonComplianceReason_; + /** + * string non_compliance_reason = 3; + * + * @return The nonComplianceReason. + */ + @java.lang.Override + public java.lang.String getNonComplianceReason() { + java.lang.Object ref = nonComplianceReason_; + 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(); + nonComplianceReason_ = s; + return s; + } + } + /** + * string non_compliance_reason = 3; + * + * @return The bytes for nonComplianceReason. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNonComplianceReasonBytes() { + java.lang.Object ref = nonComplianceReason_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nonComplianceReason_ = 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; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < nonCompliantFiles_.size(); i++) { + output.writeMessage(2, nonCompliantFiles_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nonComplianceReason_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nonComplianceReason_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < nonCompliantFiles_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, nonCompliantFiles_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nonComplianceReason_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nonComplianceReason_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.ComplianceOccurrence)) { + return super.equals(obj); + } + io.grafeas.v1.ComplianceOccurrence other = (io.grafeas.v1.ComplianceOccurrence) obj; + + if (!getNonCompliantFilesList().equals(other.getNonCompliantFilesList())) return false; + if (!getNonComplianceReason().equals(other.getNonComplianceReason())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNonCompliantFilesCount() > 0) { + hash = (37 * hash) + NON_COMPLIANT_FILES_FIELD_NUMBER; + hash = (53 * hash) + getNonCompliantFilesList().hashCode(); + } + hash = (37 * hash) + NON_COMPLIANCE_REASON_FIELD_NUMBER; + hash = (53 * hash) + getNonComplianceReason().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.ComplianceOccurrence parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.ComplianceOccurrence parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceOccurrence parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.ComplianceOccurrence parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceOccurrence parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.ComplianceOccurrence parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceOccurrence parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.ComplianceOccurrence parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceOccurrence parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.ComplianceOccurrence parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceOccurrence parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.ComplianceOccurrence parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.ComplianceOccurrence 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * An indication that the compliance checks in the associated ComplianceNote
+   * were not satisfied for particular resources or a specified reason.
+   * 
+ * + * Protobuf type {@code grafeas.v1.ComplianceOccurrence} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.ComplianceOccurrence) + io.grafeas.v1.ComplianceOccurrenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Compliance.internal_static_grafeas_v1_ComplianceOccurrence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Compliance + .internal_static_grafeas_v1_ComplianceOccurrence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.ComplianceOccurrence.class, + io.grafeas.v1.ComplianceOccurrence.Builder.class); + } + + // Construct using io.grafeas.v1.ComplianceOccurrence.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getNonCompliantFilesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (nonCompliantFilesBuilder_ == null) { + nonCompliantFiles_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + nonCompliantFilesBuilder_.clear(); + } + nonComplianceReason_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.Compliance.internal_static_grafeas_v1_ComplianceOccurrence_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.ComplianceOccurrence getDefaultInstanceForType() { + return io.grafeas.v1.ComplianceOccurrence.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.ComplianceOccurrence build() { + io.grafeas.v1.ComplianceOccurrence result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.ComplianceOccurrence buildPartial() { + io.grafeas.v1.ComplianceOccurrence result = new io.grafeas.v1.ComplianceOccurrence(this); + int from_bitField0_ = bitField0_; + if (nonCompliantFilesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + nonCompliantFiles_ = java.util.Collections.unmodifiableList(nonCompliantFiles_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.nonCompliantFiles_ = nonCompliantFiles_; + } else { + result.nonCompliantFiles_ = nonCompliantFilesBuilder_.build(); + } + result.nonComplianceReason_ = nonComplianceReason_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.ComplianceOccurrence) { + return mergeFrom((io.grafeas.v1.ComplianceOccurrence) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.ComplianceOccurrence other) { + if (other == io.grafeas.v1.ComplianceOccurrence.getDefaultInstance()) return this; + if (nonCompliantFilesBuilder_ == null) { + if (!other.nonCompliantFiles_.isEmpty()) { + if (nonCompliantFiles_.isEmpty()) { + nonCompliantFiles_ = other.nonCompliantFiles_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNonCompliantFilesIsMutable(); + nonCompliantFiles_.addAll(other.nonCompliantFiles_); + } + onChanged(); + } + } else { + if (!other.nonCompliantFiles_.isEmpty()) { + if (nonCompliantFilesBuilder_.isEmpty()) { + nonCompliantFilesBuilder_.dispose(); + nonCompliantFilesBuilder_ = null; + nonCompliantFiles_ = other.nonCompliantFiles_; + bitField0_ = (bitField0_ & ~0x00000001); + nonCompliantFilesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNonCompliantFilesFieldBuilder() + : null; + } else { + nonCompliantFilesBuilder_.addAllMessages(other.nonCompliantFiles_); + } + } + } + if (!other.getNonComplianceReason().isEmpty()) { + nonComplianceReason_ = other.nonComplianceReason_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.ComplianceOccurrence parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.ComplianceOccurrence) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List nonCompliantFiles_ = + java.util.Collections.emptyList(); + + private void ensureNonCompliantFilesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + nonCompliantFiles_ = + new java.util.ArrayList(nonCompliantFiles_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1.NonCompliantFile, + io.grafeas.v1.NonCompliantFile.Builder, + io.grafeas.v1.NonCompliantFileOrBuilder> + nonCompliantFilesBuilder_; + + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + public java.util.List getNonCompliantFilesList() { + if (nonCompliantFilesBuilder_ == null) { + return java.util.Collections.unmodifiableList(nonCompliantFiles_); + } else { + return nonCompliantFilesBuilder_.getMessageList(); + } + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + public int getNonCompliantFilesCount() { + if (nonCompliantFilesBuilder_ == null) { + return nonCompliantFiles_.size(); + } else { + return nonCompliantFilesBuilder_.getCount(); + } + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + public io.grafeas.v1.NonCompliantFile getNonCompliantFiles(int index) { + if (nonCompliantFilesBuilder_ == null) { + return nonCompliantFiles_.get(index); + } else { + return nonCompliantFilesBuilder_.getMessage(index); + } + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + public Builder setNonCompliantFiles(int index, io.grafeas.v1.NonCompliantFile value) { + if (nonCompliantFilesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNonCompliantFilesIsMutable(); + nonCompliantFiles_.set(index, value); + onChanged(); + } else { + nonCompliantFilesBuilder_.setMessage(index, value); + } + return this; + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + public Builder setNonCompliantFiles( + int index, io.grafeas.v1.NonCompliantFile.Builder builderForValue) { + if (nonCompliantFilesBuilder_ == null) { + ensureNonCompliantFilesIsMutable(); + nonCompliantFiles_.set(index, builderForValue.build()); + onChanged(); + } else { + nonCompliantFilesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + public Builder addNonCompliantFiles(io.grafeas.v1.NonCompliantFile value) { + if (nonCompliantFilesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNonCompliantFilesIsMutable(); + nonCompliantFiles_.add(value); + onChanged(); + } else { + nonCompliantFilesBuilder_.addMessage(value); + } + return this; + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + public Builder addNonCompliantFiles(int index, io.grafeas.v1.NonCompliantFile value) { + if (nonCompliantFilesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNonCompliantFilesIsMutable(); + nonCompliantFiles_.add(index, value); + onChanged(); + } else { + nonCompliantFilesBuilder_.addMessage(index, value); + } + return this; + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + public Builder addNonCompliantFiles(io.grafeas.v1.NonCompliantFile.Builder builderForValue) { + if (nonCompliantFilesBuilder_ == null) { + ensureNonCompliantFilesIsMutable(); + nonCompliantFiles_.add(builderForValue.build()); + onChanged(); + } else { + nonCompliantFilesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + public Builder addNonCompliantFiles( + int index, io.grafeas.v1.NonCompliantFile.Builder builderForValue) { + if (nonCompliantFilesBuilder_ == null) { + ensureNonCompliantFilesIsMutable(); + nonCompliantFiles_.add(index, builderForValue.build()); + onChanged(); + } else { + nonCompliantFilesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + public Builder addAllNonCompliantFiles( + java.lang.Iterable values) { + if (nonCompliantFilesBuilder_ == null) { + ensureNonCompliantFilesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, nonCompliantFiles_); + onChanged(); + } else { + nonCompliantFilesBuilder_.addAllMessages(values); + } + return this; + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + public Builder clearNonCompliantFiles() { + if (nonCompliantFilesBuilder_ == null) { + nonCompliantFiles_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + nonCompliantFilesBuilder_.clear(); + } + return this; + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + public Builder removeNonCompliantFiles(int index) { + if (nonCompliantFilesBuilder_ == null) { + ensureNonCompliantFilesIsMutable(); + nonCompliantFiles_.remove(index); + onChanged(); + } else { + nonCompliantFilesBuilder_.remove(index); + } + return this; + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + public io.grafeas.v1.NonCompliantFile.Builder getNonCompliantFilesBuilder(int index) { + return getNonCompliantFilesFieldBuilder().getBuilder(index); + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + public io.grafeas.v1.NonCompliantFileOrBuilder getNonCompliantFilesOrBuilder(int index) { + if (nonCompliantFilesBuilder_ == null) { + return nonCompliantFiles_.get(index); + } else { + return nonCompliantFilesBuilder_.getMessageOrBuilder(index); + } + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + public java.util.List + getNonCompliantFilesOrBuilderList() { + if (nonCompliantFilesBuilder_ != null) { + return nonCompliantFilesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nonCompliantFiles_); + } + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + public io.grafeas.v1.NonCompliantFile.Builder addNonCompliantFilesBuilder() { + return getNonCompliantFilesFieldBuilder() + .addBuilder(io.grafeas.v1.NonCompliantFile.getDefaultInstance()); + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + public io.grafeas.v1.NonCompliantFile.Builder addNonCompliantFilesBuilder(int index) { + return getNonCompliantFilesFieldBuilder() + .addBuilder(index, io.grafeas.v1.NonCompliantFile.getDefaultInstance()); + } + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + public java.util.List + getNonCompliantFilesBuilderList() { + return getNonCompliantFilesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1.NonCompliantFile, + io.grafeas.v1.NonCompliantFile.Builder, + io.grafeas.v1.NonCompliantFileOrBuilder> + getNonCompliantFilesFieldBuilder() { + if (nonCompliantFilesBuilder_ == null) { + nonCompliantFilesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1.NonCompliantFile, + io.grafeas.v1.NonCompliantFile.Builder, + io.grafeas.v1.NonCompliantFileOrBuilder>( + nonCompliantFiles_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + nonCompliantFiles_ = null; + } + return nonCompliantFilesBuilder_; + } + + private java.lang.Object nonComplianceReason_ = ""; + /** + * string non_compliance_reason = 3; + * + * @return The nonComplianceReason. + */ + public java.lang.String getNonComplianceReason() { + java.lang.Object ref = nonComplianceReason_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nonComplianceReason_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string non_compliance_reason = 3; + * + * @return The bytes for nonComplianceReason. + */ + public com.google.protobuf.ByteString getNonComplianceReasonBytes() { + java.lang.Object ref = nonComplianceReason_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nonComplianceReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string non_compliance_reason = 3; + * + * @param value The nonComplianceReason to set. + * @return This builder for chaining. + */ + public Builder setNonComplianceReason(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nonComplianceReason_ = value; + onChanged(); + return this; + } + /** + * string non_compliance_reason = 3; + * + * @return This builder for chaining. + */ + public Builder clearNonComplianceReason() { + + nonComplianceReason_ = getDefaultInstance().getNonComplianceReason(); + onChanged(); + return this; + } + /** + * string non_compliance_reason = 3; + * + * @param value The bytes for nonComplianceReason to set. + * @return This builder for chaining. + */ + public Builder setNonComplianceReasonBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nonComplianceReason_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.ComplianceOccurrence) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.ComplianceOccurrence) + private static final io.grafeas.v1.ComplianceOccurrence DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.ComplianceOccurrence(); + } + + public static io.grafeas.v1.ComplianceOccurrence getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceOccurrence parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ComplianceOccurrence(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.ComplianceOccurrence getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/src/main/java/io/grafeas/v1/ComplianceOccurrenceOrBuilder.java b/src/main/java/io/grafeas/v1/ComplianceOccurrenceOrBuilder.java new file mode 100644 index 00000000..5580767d --- /dev/null +++ b/src/main/java/io/grafeas/v1/ComplianceOccurrenceOrBuilder.java @@ -0,0 +1,51 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/compliance.proto + +package io.grafeas.v1; + +public interface ComplianceOccurrenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.ComplianceOccurrence) + com.google.protobuf.MessageOrBuilder { + + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + java.util.List getNonCompliantFilesList(); + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + io.grafeas.v1.NonCompliantFile getNonCompliantFiles(int index); + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + int getNonCompliantFilesCount(); + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + java.util.List + getNonCompliantFilesOrBuilderList(); + /** repeated .grafeas.v1.NonCompliantFile non_compliant_files = 2; */ + io.grafeas.v1.NonCompliantFileOrBuilder getNonCompliantFilesOrBuilder(int index); + + /** + * string non_compliance_reason = 3; + * + * @return The nonComplianceReason. + */ + java.lang.String getNonComplianceReason(); + /** + * string non_compliance_reason = 3; + * + * @return The bytes for nonComplianceReason. + */ + com.google.protobuf.ByteString getNonComplianceReasonBytes(); +} diff --git a/src/main/java/io/grafeas/v1/ComplianceVersion.java b/src/main/java/io/grafeas/v1/ComplianceVersion.java new file mode 100644 index 00000000..cc1e108f --- /dev/null +++ b/src/main/java/io/grafeas/v1/ComplianceVersion.java @@ -0,0 +1,821 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/compliance.proto + +package io.grafeas.v1; + +/** + * + * + *
+ * Describes the CIS benchmark version that is applicable to a given OS and
+ * os version.
+ * 
+ * + * Protobuf type {@code grafeas.v1.ComplianceVersion} + */ +public final class ComplianceVersion extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.ComplianceVersion) + ComplianceVersionOrBuilder { + private static final long serialVersionUID = 0L; + // Use ComplianceVersion.newBuilder() to construct. + private ComplianceVersion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ComplianceVersion() { + cpeUri_ = ""; + version_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ComplianceVersion(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ComplianceVersion( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + cpeUri_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + version_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Compliance.internal_static_grafeas_v1_ComplianceVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Compliance.internal_static_grafeas_v1_ComplianceVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.ComplianceVersion.class, io.grafeas.v1.ComplianceVersion.Builder.class); + } + + public static final int CPE_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object cpeUri_; + /** + * + * + *
+   * The CPE URI (https://cpe.mitre.org/specification/) this benchmark is
+   * applicable to.
+   * 
+ * + * string cpe_uri = 1; + * + * @return The cpeUri. + */ + @java.lang.Override + public java.lang.String getCpeUri() { + java.lang.Object ref = cpeUri_; + 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(); + cpeUri_ = s; + return s; + } + } + /** + * + * + *
+   * The CPE URI (https://cpe.mitre.org/specification/) this benchmark is
+   * applicable to.
+   * 
+ * + * string cpe_uri = 1; + * + * @return The bytes for cpeUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCpeUriBytes() { + java.lang.Object ref = cpeUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cpeUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_FIELD_NUMBER = 2; + private volatile java.lang.Object version_; + /** + * + * + *
+   * The version of the benchmark. This is set to the version of the OS-specific
+   * CIS document the benchmark is defined in.
+   * 
+ * + * string version = 2; + * + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + 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(); + version_ = s; + return s; + } + } + /** + * + * + *
+   * The version of the benchmark. This is set to the version of the OS-specific
+   * CIS document the benchmark is defined in.
+   * 
+ * + * string version = 2; + * + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = 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; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cpeUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cpeUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, version_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cpeUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, cpeUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, version_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.ComplianceVersion)) { + return super.equals(obj); + } + io.grafeas.v1.ComplianceVersion other = (io.grafeas.v1.ComplianceVersion) obj; + + if (!getCpeUri().equals(other.getCpeUri())) return false; + if (!getVersion().equals(other.getVersion())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CPE_URI_FIELD_NUMBER; + hash = (53 * hash) + getCpeUri().hashCode(); + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.ComplianceVersion parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.ComplianceVersion parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceVersion parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.ComplianceVersion parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceVersion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.ComplianceVersion parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceVersion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.ComplianceVersion parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceVersion parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.ComplianceVersion parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.ComplianceVersion parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.ComplianceVersion parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.ComplianceVersion 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes the CIS benchmark version that is applicable to a given OS and
+   * os version.
+   * 
+ * + * Protobuf type {@code grafeas.v1.ComplianceVersion} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.ComplianceVersion) + io.grafeas.v1.ComplianceVersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Compliance.internal_static_grafeas_v1_ComplianceVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Compliance + .internal_static_grafeas_v1_ComplianceVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.ComplianceVersion.class, io.grafeas.v1.ComplianceVersion.Builder.class); + } + + // Construct using io.grafeas.v1.ComplianceVersion.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + cpeUri_ = ""; + + version_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.Compliance.internal_static_grafeas_v1_ComplianceVersion_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.ComplianceVersion getDefaultInstanceForType() { + return io.grafeas.v1.ComplianceVersion.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.ComplianceVersion build() { + io.grafeas.v1.ComplianceVersion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.ComplianceVersion buildPartial() { + io.grafeas.v1.ComplianceVersion result = new io.grafeas.v1.ComplianceVersion(this); + result.cpeUri_ = cpeUri_; + result.version_ = version_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.ComplianceVersion) { + return mergeFrom((io.grafeas.v1.ComplianceVersion) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.ComplianceVersion other) { + if (other == io.grafeas.v1.ComplianceVersion.getDefaultInstance()) return this; + if (!other.getCpeUri().isEmpty()) { + cpeUri_ = other.cpeUri_; + onChanged(); + } + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.ComplianceVersion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.ComplianceVersion) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object cpeUri_ = ""; + /** + * + * + *
+     * The CPE URI (https://cpe.mitre.org/specification/) this benchmark is
+     * applicable to.
+     * 
+ * + * string cpe_uri = 1; + * + * @return The cpeUri. + */ + public java.lang.String getCpeUri() { + java.lang.Object ref = cpeUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cpeUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The CPE URI (https://cpe.mitre.org/specification/) this benchmark is
+     * applicable to.
+     * 
+ * + * string cpe_uri = 1; + * + * @return The bytes for cpeUri. + */ + public com.google.protobuf.ByteString getCpeUriBytes() { + java.lang.Object ref = cpeUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cpeUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The CPE URI (https://cpe.mitre.org/specification/) this benchmark is
+     * applicable to.
+     * 
+ * + * string cpe_uri = 1; + * + * @param value The cpeUri to set. + * @return This builder for chaining. + */ + public Builder setCpeUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cpeUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The CPE URI (https://cpe.mitre.org/specification/) this benchmark is
+     * applicable to.
+     * 
+ * + * string cpe_uri = 1; + * + * @return This builder for chaining. + */ + public Builder clearCpeUri() { + + cpeUri_ = getDefaultInstance().getCpeUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * The CPE URI (https://cpe.mitre.org/specification/) this benchmark is
+     * applicable to.
+     * 
+ * + * string cpe_uri = 1; + * + * @param value The bytes for cpeUri to set. + * @return This builder for chaining. + */ + public Builder setCpeUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cpeUri_ = value; + onChanged(); + return this; + } + + private java.lang.Object version_ = ""; + /** + * + * + *
+     * The version of the benchmark. This is set to the version of the OS-specific
+     * CIS document the benchmark is defined in.
+     * 
+ * + * string version = 2; + * + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The version of the benchmark. This is set to the version of the OS-specific
+     * CIS document the benchmark is defined in.
+     * 
+ * + * string version = 2; + * + * @return The bytes for version. + */ + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The version of the benchmark. This is set to the version of the OS-specific
+     * CIS document the benchmark is defined in.
+     * 
+ * + * string version = 2; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The version of the benchmark. This is set to the version of the OS-specific
+     * CIS document the benchmark is defined in.
+     * 
+ * + * string version = 2; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * The version of the benchmark. This is set to the version of the OS-specific
+     * CIS document the benchmark is defined in.
+     * 
+ * + * string version = 2; + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + version_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.ComplianceVersion) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.ComplianceVersion) + private static final io.grafeas.v1.ComplianceVersion DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.ComplianceVersion(); + } + + public static io.grafeas.v1.ComplianceVersion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceVersion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ComplianceVersion(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.ComplianceVersion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/src/main/java/io/grafeas/v1/ComplianceVersionOrBuilder.java b/src/main/java/io/grafeas/v1/ComplianceVersionOrBuilder.java new file mode 100644 index 00000000..ddc67875 --- /dev/null +++ b/src/main/java/io/grafeas/v1/ComplianceVersionOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/compliance.proto + +package io.grafeas.v1; + +public interface ComplianceVersionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.ComplianceVersion) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The CPE URI (https://cpe.mitre.org/specification/) this benchmark is
+   * applicable to.
+   * 
+ * + * string cpe_uri = 1; + * + * @return The cpeUri. + */ + java.lang.String getCpeUri(); + /** + * + * + *
+   * The CPE URI (https://cpe.mitre.org/specification/) this benchmark is
+   * applicable to.
+   * 
+ * + * string cpe_uri = 1; + * + * @return The bytes for cpeUri. + */ + com.google.protobuf.ByteString getCpeUriBytes(); + + /** + * + * + *
+   * The version of the benchmark. This is set to the version of the OS-specific
+   * CIS document the benchmark is defined in.
+   * 
+ * + * string version = 2; + * + * @return The version. + */ + java.lang.String getVersion(); + /** + * + * + *
+   * The version of the benchmark. This is set to the version of the OS-specific
+   * CIS document the benchmark is defined in.
+   * 
+ * + * string version = 2; + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); +} diff --git a/src/main/java/io/grafeas/v1/DSSEAttestationNote.java b/src/main/java/io/grafeas/v1/DSSEAttestationNote.java new file mode 100644 index 00000000..fae33c2f --- /dev/null +++ b/src/main/java/io/grafeas/v1/DSSEAttestationNote.java @@ -0,0 +1,1381 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/dsse_attestation.proto + +package io.grafeas.v1; + +/** Protobuf type {@code grafeas.v1.DSSEAttestationNote} */ +public final class DSSEAttestationNote extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.DSSEAttestationNote) + DSSEAttestationNoteOrBuilder { + private static final long serialVersionUID = 0L; + // Use DSSEAttestationNote.newBuilder() to construct. + private DSSEAttestationNote(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DSSEAttestationNote() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DSSEAttestationNote(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DSSEAttestationNote( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + io.grafeas.v1.DSSEAttestationNote.DSSEHint.Builder subBuilder = null; + if (hint_ != null) { + subBuilder = hint_.toBuilder(); + } + hint_ = + input.readMessage( + io.grafeas.v1.DSSEAttestationNote.DSSEHint.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(hint_); + hint_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.DsseAttestation.internal_static_grafeas_v1_DSSEAttestationNote_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.DsseAttestation + .internal_static_grafeas_v1_DSSEAttestationNote_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.DSSEAttestationNote.class, + io.grafeas.v1.DSSEAttestationNote.Builder.class); + } + + public interface DSSEHintOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.DSSEAttestationNote.DSSEHint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The human readable name of this attestation authority, for
+     * example "cloudbuild-prod".
+     * 
+ * + * string human_readable_name = 1; + * + * @return The humanReadableName. + */ + java.lang.String getHumanReadableName(); + /** + * + * + *
+     * Required. The human readable name of this attestation authority, for
+     * example "cloudbuild-prod".
+     * 
+ * + * string human_readable_name = 1; + * + * @return The bytes for humanReadableName. + */ + com.google.protobuf.ByteString getHumanReadableNameBytes(); + } + /** + * + * + *
+   * This submessage provides human-readable hints about the purpose of the
+   * authority. Because the name of a note acts as its resource reference, it is
+   * important to disambiguate the canonical name of the Note (which might be a
+   * UUID for security purposes) from "readable" names more suitable for debug
+   * output. Note that these hints should not be used to look up authorities in
+   * security sensitive contexts, such as when looking up attestations to
+   * verify.
+   * 
+ * + * Protobuf type {@code grafeas.v1.DSSEAttestationNote.DSSEHint} + */ + public static final class DSSEHint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.DSSEAttestationNote.DSSEHint) + DSSEHintOrBuilder { + private static final long serialVersionUID = 0L; + // Use DSSEHint.newBuilder() to construct. + private DSSEHint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DSSEHint() { + humanReadableName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DSSEHint(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DSSEHint( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + humanReadableName_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.DsseAttestation + .internal_static_grafeas_v1_DSSEAttestationNote_DSSEHint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.DsseAttestation + .internal_static_grafeas_v1_DSSEAttestationNote_DSSEHint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.DSSEAttestationNote.DSSEHint.class, + io.grafeas.v1.DSSEAttestationNote.DSSEHint.Builder.class); + } + + public static final int HUMAN_READABLE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object humanReadableName_; + /** + * + * + *
+     * Required. The human readable name of this attestation authority, for
+     * example "cloudbuild-prod".
+     * 
+ * + * string human_readable_name = 1; + * + * @return The humanReadableName. + */ + @java.lang.Override + public java.lang.String getHumanReadableName() { + java.lang.Object ref = humanReadableName_; + 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(); + humanReadableName_ = s; + return s; + } + } + /** + * + * + *
+     * Required. The human readable name of this attestation authority, for
+     * example "cloudbuild-prod".
+     * 
+ * + * string human_readable_name = 1; + * + * @return The bytes for humanReadableName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHumanReadableNameBytes() { + java.lang.Object ref = humanReadableName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + humanReadableName_ = 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; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(humanReadableName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, humanReadableName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(humanReadableName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, humanReadableName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.DSSEAttestationNote.DSSEHint)) { + return super.equals(obj); + } + io.grafeas.v1.DSSEAttestationNote.DSSEHint other = + (io.grafeas.v1.DSSEAttestationNote.DSSEHint) obj; + + if (!getHumanReadableName().equals(other.getHumanReadableName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HUMAN_READABLE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getHumanReadableName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.DSSEAttestationNote.DSSEHint parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.DSSEAttestationNote.DSSEHint parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.DSSEAttestationNote.DSSEHint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.DSSEAttestationNote.DSSEHint parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.DSSEAttestationNote.DSSEHint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.DSSEAttestationNote.DSSEHint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.DSSEAttestationNote.DSSEHint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.DSSEAttestationNote.DSSEHint parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.DSSEAttestationNote.DSSEHint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.DSSEAttestationNote.DSSEHint parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.DSSEAttestationNote.DSSEHint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.DSSEAttestationNote.DSSEHint parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.DSSEAttestationNote.DSSEHint 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * This submessage provides human-readable hints about the purpose of the
+     * authority. Because the name of a note acts as its resource reference, it is
+     * important to disambiguate the canonical name of the Note (which might be a
+     * UUID for security purposes) from "readable" names more suitable for debug
+     * output. Note that these hints should not be used to look up authorities in
+     * security sensitive contexts, such as when looking up attestations to
+     * verify.
+     * 
+ * + * Protobuf type {@code grafeas.v1.DSSEAttestationNote.DSSEHint} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.DSSEAttestationNote.DSSEHint) + io.grafeas.v1.DSSEAttestationNote.DSSEHintOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.DsseAttestation + .internal_static_grafeas_v1_DSSEAttestationNote_DSSEHint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.DsseAttestation + .internal_static_grafeas_v1_DSSEAttestationNote_DSSEHint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.DSSEAttestationNote.DSSEHint.class, + io.grafeas.v1.DSSEAttestationNote.DSSEHint.Builder.class); + } + + // Construct using io.grafeas.v1.DSSEAttestationNote.DSSEHint.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + humanReadableName_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.DsseAttestation + .internal_static_grafeas_v1_DSSEAttestationNote_DSSEHint_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.DSSEAttestationNote.DSSEHint getDefaultInstanceForType() { + return io.grafeas.v1.DSSEAttestationNote.DSSEHint.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.DSSEAttestationNote.DSSEHint build() { + io.grafeas.v1.DSSEAttestationNote.DSSEHint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.DSSEAttestationNote.DSSEHint buildPartial() { + io.grafeas.v1.DSSEAttestationNote.DSSEHint result = + new io.grafeas.v1.DSSEAttestationNote.DSSEHint(this); + result.humanReadableName_ = humanReadableName_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.DSSEAttestationNote.DSSEHint) { + return mergeFrom((io.grafeas.v1.DSSEAttestationNote.DSSEHint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.DSSEAttestationNote.DSSEHint other) { + if (other == io.grafeas.v1.DSSEAttestationNote.DSSEHint.getDefaultInstance()) return this; + if (!other.getHumanReadableName().isEmpty()) { + humanReadableName_ = other.humanReadableName_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.DSSEAttestationNote.DSSEHint parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.DSSEAttestationNote.DSSEHint) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object humanReadableName_ = ""; + /** + * + * + *
+       * Required. The human readable name of this attestation authority, for
+       * example "cloudbuild-prod".
+       * 
+ * + * string human_readable_name = 1; + * + * @return The humanReadableName. + */ + public java.lang.String getHumanReadableName() { + java.lang.Object ref = humanReadableName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + humanReadableName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. The human readable name of this attestation authority, for
+       * example "cloudbuild-prod".
+       * 
+ * + * string human_readable_name = 1; + * + * @return The bytes for humanReadableName. + */ + public com.google.protobuf.ByteString getHumanReadableNameBytes() { + java.lang.Object ref = humanReadableName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + humanReadableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. The human readable name of this attestation authority, for
+       * example "cloudbuild-prod".
+       * 
+ * + * string human_readable_name = 1; + * + * @param value The humanReadableName to set. + * @return This builder for chaining. + */ + public Builder setHumanReadableName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + humanReadableName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The human readable name of this attestation authority, for
+       * example "cloudbuild-prod".
+       * 
+ * + * string human_readable_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearHumanReadableName() { + + humanReadableName_ = getDefaultInstance().getHumanReadableName(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The human readable name of this attestation authority, for
+       * example "cloudbuild-prod".
+       * 
+ * + * string human_readable_name = 1; + * + * @param value The bytes for humanReadableName to set. + * @return This builder for chaining. + */ + public Builder setHumanReadableNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + humanReadableName_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.DSSEAttestationNote.DSSEHint) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.DSSEAttestationNote.DSSEHint) + private static final io.grafeas.v1.DSSEAttestationNote.DSSEHint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.DSSEAttestationNote.DSSEHint(); + } + + public static io.grafeas.v1.DSSEAttestationNote.DSSEHint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DSSEHint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DSSEHint(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.DSSEAttestationNote.DSSEHint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int HINT_FIELD_NUMBER = 1; + private io.grafeas.v1.DSSEAttestationNote.DSSEHint hint_; + /** + * + * + *
+   * DSSEHint hints at the purpose of the attestation authority.
+   * 
+ * + * .grafeas.v1.DSSEAttestationNote.DSSEHint hint = 1; + * + * @return Whether the hint field is set. + */ + @java.lang.Override + public boolean hasHint() { + return hint_ != null; + } + /** + * + * + *
+   * DSSEHint hints at the purpose of the attestation authority.
+   * 
+ * + * .grafeas.v1.DSSEAttestationNote.DSSEHint hint = 1; + * + * @return The hint. + */ + @java.lang.Override + public io.grafeas.v1.DSSEAttestationNote.DSSEHint getHint() { + return hint_ == null ? io.grafeas.v1.DSSEAttestationNote.DSSEHint.getDefaultInstance() : hint_; + } + /** + * + * + *
+   * DSSEHint hints at the purpose of the attestation authority.
+   * 
+ * + * .grafeas.v1.DSSEAttestationNote.DSSEHint hint = 1; + */ + @java.lang.Override + public io.grafeas.v1.DSSEAttestationNote.DSSEHintOrBuilder getHintOrBuilder() { + return getHint(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (hint_ != null) { + output.writeMessage(1, getHint()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (hint_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getHint()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.DSSEAttestationNote)) { + return super.equals(obj); + } + io.grafeas.v1.DSSEAttestationNote other = (io.grafeas.v1.DSSEAttestationNote) obj; + + if (hasHint() != other.hasHint()) return false; + if (hasHint()) { + if (!getHint().equals(other.getHint())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasHint()) { + hash = (37 * hash) + HINT_FIELD_NUMBER; + hash = (53 * hash) + getHint().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.DSSEAttestationNote parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.DSSEAttestationNote parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.DSSEAttestationNote parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.DSSEAttestationNote parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.DSSEAttestationNote parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.DSSEAttestationNote parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.DSSEAttestationNote parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.DSSEAttestationNote parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.DSSEAttestationNote parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.DSSEAttestationNote parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.DSSEAttestationNote parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.DSSEAttestationNote parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.DSSEAttestationNote 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code grafeas.v1.DSSEAttestationNote} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.DSSEAttestationNote) + io.grafeas.v1.DSSEAttestationNoteOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.DsseAttestation + .internal_static_grafeas_v1_DSSEAttestationNote_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.DsseAttestation + .internal_static_grafeas_v1_DSSEAttestationNote_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.DSSEAttestationNote.class, + io.grafeas.v1.DSSEAttestationNote.Builder.class); + } + + // Construct using io.grafeas.v1.DSSEAttestationNote.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (hintBuilder_ == null) { + hint_ = null; + } else { + hint_ = null; + hintBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.DsseAttestation + .internal_static_grafeas_v1_DSSEAttestationNote_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.DSSEAttestationNote getDefaultInstanceForType() { + return io.grafeas.v1.DSSEAttestationNote.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.DSSEAttestationNote build() { + io.grafeas.v1.DSSEAttestationNote result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.DSSEAttestationNote buildPartial() { + io.grafeas.v1.DSSEAttestationNote result = new io.grafeas.v1.DSSEAttestationNote(this); + if (hintBuilder_ == null) { + result.hint_ = hint_; + } else { + result.hint_ = hintBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.DSSEAttestationNote) { + return mergeFrom((io.grafeas.v1.DSSEAttestationNote) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.DSSEAttestationNote other) { + if (other == io.grafeas.v1.DSSEAttestationNote.getDefaultInstance()) return this; + if (other.hasHint()) { + mergeHint(other.getHint()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.DSSEAttestationNote parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.DSSEAttestationNote) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private io.grafeas.v1.DSSEAttestationNote.DSSEHint hint_; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.DSSEAttestationNote.DSSEHint, + io.grafeas.v1.DSSEAttestationNote.DSSEHint.Builder, + io.grafeas.v1.DSSEAttestationNote.DSSEHintOrBuilder> + hintBuilder_; + /** + * + * + *
+     * DSSEHint hints at the purpose of the attestation authority.
+     * 
+ * + * .grafeas.v1.DSSEAttestationNote.DSSEHint hint = 1; + * + * @return Whether the hint field is set. + */ + public boolean hasHint() { + return hintBuilder_ != null || hint_ != null; + } + /** + * + * + *
+     * DSSEHint hints at the purpose of the attestation authority.
+     * 
+ * + * .grafeas.v1.DSSEAttestationNote.DSSEHint hint = 1; + * + * @return The hint. + */ + public io.grafeas.v1.DSSEAttestationNote.DSSEHint getHint() { + if (hintBuilder_ == null) { + return hint_ == null + ? io.grafeas.v1.DSSEAttestationNote.DSSEHint.getDefaultInstance() + : hint_; + } else { + return hintBuilder_.getMessage(); + } + } + /** + * + * + *
+     * DSSEHint hints at the purpose of the attestation authority.
+     * 
+ * + * .grafeas.v1.DSSEAttestationNote.DSSEHint hint = 1; + */ + public Builder setHint(io.grafeas.v1.DSSEAttestationNote.DSSEHint value) { + if (hintBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + hint_ = value; + onChanged(); + } else { + hintBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * DSSEHint hints at the purpose of the attestation authority.
+     * 
+ * + * .grafeas.v1.DSSEAttestationNote.DSSEHint hint = 1; + */ + public Builder setHint(io.grafeas.v1.DSSEAttestationNote.DSSEHint.Builder builderForValue) { + if (hintBuilder_ == null) { + hint_ = builderForValue.build(); + onChanged(); + } else { + hintBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * DSSEHint hints at the purpose of the attestation authority.
+     * 
+ * + * .grafeas.v1.DSSEAttestationNote.DSSEHint hint = 1; + */ + public Builder mergeHint(io.grafeas.v1.DSSEAttestationNote.DSSEHint value) { + if (hintBuilder_ == null) { + if (hint_ != null) { + hint_ = + io.grafeas.v1.DSSEAttestationNote.DSSEHint.newBuilder(hint_) + .mergeFrom(value) + .buildPartial(); + } else { + hint_ = value; + } + onChanged(); + } else { + hintBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * DSSEHint hints at the purpose of the attestation authority.
+     * 
+ * + * .grafeas.v1.DSSEAttestationNote.DSSEHint hint = 1; + */ + public Builder clearHint() { + if (hintBuilder_ == null) { + hint_ = null; + onChanged(); + } else { + hint_ = null; + hintBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * DSSEHint hints at the purpose of the attestation authority.
+     * 
+ * + * .grafeas.v1.DSSEAttestationNote.DSSEHint hint = 1; + */ + public io.grafeas.v1.DSSEAttestationNote.DSSEHint.Builder getHintBuilder() { + + onChanged(); + return getHintFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * DSSEHint hints at the purpose of the attestation authority.
+     * 
+ * + * .grafeas.v1.DSSEAttestationNote.DSSEHint hint = 1; + */ + public io.grafeas.v1.DSSEAttestationNote.DSSEHintOrBuilder getHintOrBuilder() { + if (hintBuilder_ != null) { + return hintBuilder_.getMessageOrBuilder(); + } else { + return hint_ == null + ? io.grafeas.v1.DSSEAttestationNote.DSSEHint.getDefaultInstance() + : hint_; + } + } + /** + * + * + *
+     * DSSEHint hints at the purpose of the attestation authority.
+     * 
+ * + * .grafeas.v1.DSSEAttestationNote.DSSEHint hint = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.DSSEAttestationNote.DSSEHint, + io.grafeas.v1.DSSEAttestationNote.DSSEHint.Builder, + io.grafeas.v1.DSSEAttestationNote.DSSEHintOrBuilder> + getHintFieldBuilder() { + if (hintBuilder_ == null) { + hintBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.DSSEAttestationNote.DSSEHint, + io.grafeas.v1.DSSEAttestationNote.DSSEHint.Builder, + io.grafeas.v1.DSSEAttestationNote.DSSEHintOrBuilder>( + getHint(), getParentForChildren(), isClean()); + hint_ = null; + } + return hintBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.DSSEAttestationNote) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.DSSEAttestationNote) + private static final io.grafeas.v1.DSSEAttestationNote DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.DSSEAttestationNote(); + } + + public static io.grafeas.v1.DSSEAttestationNote getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DSSEAttestationNote parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DSSEAttestationNote(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.DSSEAttestationNote getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/src/main/java/io/grafeas/v1/DSSEAttestationNoteOrBuilder.java b/src/main/java/io/grafeas/v1/DSSEAttestationNoteOrBuilder.java new file mode 100644 index 00000000..e58b0c96 --- /dev/null +++ b/src/main/java/io/grafeas/v1/DSSEAttestationNoteOrBuilder.java @@ -0,0 +1,61 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/dsse_attestation.proto + +package io.grafeas.v1; + +public interface DSSEAttestationNoteOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.DSSEAttestationNote) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * DSSEHint hints at the purpose of the attestation authority.
+   * 
+ * + * .grafeas.v1.DSSEAttestationNote.DSSEHint hint = 1; + * + * @return Whether the hint field is set. + */ + boolean hasHint(); + /** + * + * + *
+   * DSSEHint hints at the purpose of the attestation authority.
+   * 
+ * + * .grafeas.v1.DSSEAttestationNote.DSSEHint hint = 1; + * + * @return The hint. + */ + io.grafeas.v1.DSSEAttestationNote.DSSEHint getHint(); + /** + * + * + *
+   * DSSEHint hints at the purpose of the attestation authority.
+   * 
+ * + * .grafeas.v1.DSSEAttestationNote.DSSEHint hint = 1; + */ + io.grafeas.v1.DSSEAttestationNote.DSSEHintOrBuilder getHintOrBuilder(); +} diff --git a/src/main/java/io/grafeas/v1/DSSEAttestationOccurrence.java b/src/main/java/io/grafeas/v1/DSSEAttestationOccurrence.java new file mode 100644 index 00000000..e9350e55 --- /dev/null +++ b/src/main/java/io/grafeas/v1/DSSEAttestationOccurrence.java @@ -0,0 +1,1016 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/dsse_attestation.proto + +package io.grafeas.v1; + +/** + * + * + *
+ * Deprecated. Prefer to use a regular Occurrence, and populate the
+ * Envelope at the top level of the Occurrence.
+ * 
+ * + * Protobuf type {@code grafeas.v1.DSSEAttestationOccurrence} + */ +public final class DSSEAttestationOccurrence extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.DSSEAttestationOccurrence) + DSSEAttestationOccurrenceOrBuilder { + private static final long serialVersionUID = 0L; + // Use DSSEAttestationOccurrence.newBuilder() to construct. + private DSSEAttestationOccurrence(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DSSEAttestationOccurrence() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DSSEAttestationOccurrence(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DSSEAttestationOccurrence( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + io.grafeas.v1.Envelope.Builder subBuilder = null; + if (envelope_ != null) { + subBuilder = envelope_.toBuilder(); + } + envelope_ = input.readMessage(io.grafeas.v1.Envelope.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(envelope_); + envelope_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + io.grafeas.v1.InTotoStatement.Builder subBuilder = null; + if (decodedPayloadCase_ == 2) { + subBuilder = ((io.grafeas.v1.InTotoStatement) decodedPayload_).toBuilder(); + } + decodedPayload_ = + input.readMessage(io.grafeas.v1.InTotoStatement.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1.InTotoStatement) decodedPayload_); + decodedPayload_ = subBuilder.buildPartial(); + } + decodedPayloadCase_ = 2; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.DsseAttestation + .internal_static_grafeas_v1_DSSEAttestationOccurrence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.DsseAttestation + .internal_static_grafeas_v1_DSSEAttestationOccurrence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.DSSEAttestationOccurrence.class, + io.grafeas.v1.DSSEAttestationOccurrence.Builder.class); + } + + private int decodedPayloadCase_ = 0; + private java.lang.Object decodedPayload_; + + public enum DecodedPayloadCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STATEMENT(2), + DECODEDPAYLOAD_NOT_SET(0); + private final int value; + + private DecodedPayloadCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DecodedPayloadCase valueOf(int value) { + return forNumber(value); + } + + public static DecodedPayloadCase forNumber(int value) { + switch (value) { + case 2: + return STATEMENT; + case 0: + return DECODEDPAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DecodedPayloadCase getDecodedPayloadCase() { + return DecodedPayloadCase.forNumber(decodedPayloadCase_); + } + + public static final int ENVELOPE_FIELD_NUMBER = 1; + private io.grafeas.v1.Envelope envelope_; + /** + * + * + *
+   * If doing something security critical, make sure to verify the signatures in
+   * this metadata.
+   * 
+ * + * .grafeas.v1.Envelope envelope = 1; + * + * @return Whether the envelope field is set. + */ + @java.lang.Override + public boolean hasEnvelope() { + return envelope_ != null; + } + /** + * + * + *
+   * If doing something security critical, make sure to verify the signatures in
+   * this metadata.
+   * 
+ * + * .grafeas.v1.Envelope envelope = 1; + * + * @return The envelope. + */ + @java.lang.Override + public io.grafeas.v1.Envelope getEnvelope() { + return envelope_ == null ? io.grafeas.v1.Envelope.getDefaultInstance() : envelope_; + } + /** + * + * + *
+   * If doing something security critical, make sure to verify the signatures in
+   * this metadata.
+   * 
+ * + * .grafeas.v1.Envelope envelope = 1; + */ + @java.lang.Override + public io.grafeas.v1.EnvelopeOrBuilder getEnvelopeOrBuilder() { + return getEnvelope(); + } + + public static final int STATEMENT_FIELD_NUMBER = 2; + /** + * .grafeas.v1.InTotoStatement statement = 2; + * + * @return Whether the statement field is set. + */ + @java.lang.Override + public boolean hasStatement() { + return decodedPayloadCase_ == 2; + } + /** + * .grafeas.v1.InTotoStatement statement = 2; + * + * @return The statement. + */ + @java.lang.Override + public io.grafeas.v1.InTotoStatement getStatement() { + if (decodedPayloadCase_ == 2) { + return (io.grafeas.v1.InTotoStatement) decodedPayload_; + } + return io.grafeas.v1.InTotoStatement.getDefaultInstance(); + } + /** .grafeas.v1.InTotoStatement statement = 2; */ + @java.lang.Override + public io.grafeas.v1.InTotoStatementOrBuilder getStatementOrBuilder() { + if (decodedPayloadCase_ == 2) { + return (io.grafeas.v1.InTotoStatement) decodedPayload_; + } + return io.grafeas.v1.InTotoStatement.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (envelope_ != null) { + output.writeMessage(1, getEnvelope()); + } + if (decodedPayloadCase_ == 2) { + output.writeMessage(2, (io.grafeas.v1.InTotoStatement) decodedPayload_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (envelope_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEnvelope()); + } + if (decodedPayloadCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (io.grafeas.v1.InTotoStatement) decodedPayload_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.DSSEAttestationOccurrence)) { + return super.equals(obj); + } + io.grafeas.v1.DSSEAttestationOccurrence other = (io.grafeas.v1.DSSEAttestationOccurrence) obj; + + if (hasEnvelope() != other.hasEnvelope()) return false; + if (hasEnvelope()) { + if (!getEnvelope().equals(other.getEnvelope())) return false; + } + if (!getDecodedPayloadCase().equals(other.getDecodedPayloadCase())) return false; + switch (decodedPayloadCase_) { + case 2: + if (!getStatement().equals(other.getStatement())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEnvelope()) { + hash = (37 * hash) + ENVELOPE_FIELD_NUMBER; + hash = (53 * hash) + getEnvelope().hashCode(); + } + switch (decodedPayloadCase_) { + case 2: + hash = (37 * hash) + STATEMENT_FIELD_NUMBER; + hash = (53 * hash) + getStatement().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.DSSEAttestationOccurrence parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.DSSEAttestationOccurrence parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.DSSEAttestationOccurrence parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.DSSEAttestationOccurrence parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.DSSEAttestationOccurrence parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.DSSEAttestationOccurrence parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.DSSEAttestationOccurrence parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.DSSEAttestationOccurrence parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.DSSEAttestationOccurrence parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.DSSEAttestationOccurrence parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.DSSEAttestationOccurrence parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.DSSEAttestationOccurrence parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.DSSEAttestationOccurrence 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Deprecated. Prefer to use a regular Occurrence, and populate the
+   * Envelope at the top level of the Occurrence.
+   * 
+ * + * Protobuf type {@code grafeas.v1.DSSEAttestationOccurrence} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.DSSEAttestationOccurrence) + io.grafeas.v1.DSSEAttestationOccurrenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.DsseAttestation + .internal_static_grafeas_v1_DSSEAttestationOccurrence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.DsseAttestation + .internal_static_grafeas_v1_DSSEAttestationOccurrence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.DSSEAttestationOccurrence.class, + io.grafeas.v1.DSSEAttestationOccurrence.Builder.class); + } + + // Construct using io.grafeas.v1.DSSEAttestationOccurrence.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (envelopeBuilder_ == null) { + envelope_ = null; + } else { + envelope_ = null; + envelopeBuilder_ = null; + } + decodedPayloadCase_ = 0; + decodedPayload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.DsseAttestation + .internal_static_grafeas_v1_DSSEAttestationOccurrence_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.DSSEAttestationOccurrence getDefaultInstanceForType() { + return io.grafeas.v1.DSSEAttestationOccurrence.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.DSSEAttestationOccurrence build() { + io.grafeas.v1.DSSEAttestationOccurrence result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.DSSEAttestationOccurrence buildPartial() { + io.grafeas.v1.DSSEAttestationOccurrence result = + new io.grafeas.v1.DSSEAttestationOccurrence(this); + if (envelopeBuilder_ == null) { + result.envelope_ = envelope_; + } else { + result.envelope_ = envelopeBuilder_.build(); + } + if (decodedPayloadCase_ == 2) { + if (statementBuilder_ == null) { + result.decodedPayload_ = decodedPayload_; + } else { + result.decodedPayload_ = statementBuilder_.build(); + } + } + result.decodedPayloadCase_ = decodedPayloadCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.DSSEAttestationOccurrence) { + return mergeFrom((io.grafeas.v1.DSSEAttestationOccurrence) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.DSSEAttestationOccurrence other) { + if (other == io.grafeas.v1.DSSEAttestationOccurrence.getDefaultInstance()) return this; + if (other.hasEnvelope()) { + mergeEnvelope(other.getEnvelope()); + } + switch (other.getDecodedPayloadCase()) { + case STATEMENT: + { + mergeStatement(other.getStatement()); + break; + } + case DECODEDPAYLOAD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.DSSEAttestationOccurrence parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.DSSEAttestationOccurrence) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int decodedPayloadCase_ = 0; + private java.lang.Object decodedPayload_; + + public DecodedPayloadCase getDecodedPayloadCase() { + return DecodedPayloadCase.forNumber(decodedPayloadCase_); + } + + public Builder clearDecodedPayload() { + decodedPayloadCase_ = 0; + decodedPayload_ = null; + onChanged(); + return this; + } + + private io.grafeas.v1.Envelope envelope_; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.Envelope, io.grafeas.v1.Envelope.Builder, io.grafeas.v1.EnvelopeOrBuilder> + envelopeBuilder_; + /** + * + * + *
+     * If doing something security critical, make sure to verify the signatures in
+     * this metadata.
+     * 
+ * + * .grafeas.v1.Envelope envelope = 1; + * + * @return Whether the envelope field is set. + */ + public boolean hasEnvelope() { + return envelopeBuilder_ != null || envelope_ != null; + } + /** + * + * + *
+     * If doing something security critical, make sure to verify the signatures in
+     * this metadata.
+     * 
+ * + * .grafeas.v1.Envelope envelope = 1; + * + * @return The envelope. + */ + public io.grafeas.v1.Envelope getEnvelope() { + if (envelopeBuilder_ == null) { + return envelope_ == null ? io.grafeas.v1.Envelope.getDefaultInstance() : envelope_; + } else { + return envelopeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * If doing something security critical, make sure to verify the signatures in
+     * this metadata.
+     * 
+ * + * .grafeas.v1.Envelope envelope = 1; + */ + public Builder setEnvelope(io.grafeas.v1.Envelope value) { + if (envelopeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + envelope_ = value; + onChanged(); + } else { + envelopeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * If doing something security critical, make sure to verify the signatures in
+     * this metadata.
+     * 
+ * + * .grafeas.v1.Envelope envelope = 1; + */ + public Builder setEnvelope(io.grafeas.v1.Envelope.Builder builderForValue) { + if (envelopeBuilder_ == null) { + envelope_ = builderForValue.build(); + onChanged(); + } else { + envelopeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * If doing something security critical, make sure to verify the signatures in
+     * this metadata.
+     * 
+ * + * .grafeas.v1.Envelope envelope = 1; + */ + public Builder mergeEnvelope(io.grafeas.v1.Envelope value) { + if (envelopeBuilder_ == null) { + if (envelope_ != null) { + envelope_ = io.grafeas.v1.Envelope.newBuilder(envelope_).mergeFrom(value).buildPartial(); + } else { + envelope_ = value; + } + onChanged(); + } else { + envelopeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * If doing something security critical, make sure to verify the signatures in
+     * this metadata.
+     * 
+ * + * .grafeas.v1.Envelope envelope = 1; + */ + public Builder clearEnvelope() { + if (envelopeBuilder_ == null) { + envelope_ = null; + onChanged(); + } else { + envelope_ = null; + envelopeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * If doing something security critical, make sure to verify the signatures in
+     * this metadata.
+     * 
+ * + * .grafeas.v1.Envelope envelope = 1; + */ + public io.grafeas.v1.Envelope.Builder getEnvelopeBuilder() { + + onChanged(); + return getEnvelopeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If doing something security critical, make sure to verify the signatures in
+     * this metadata.
+     * 
+ * + * .grafeas.v1.Envelope envelope = 1; + */ + public io.grafeas.v1.EnvelopeOrBuilder getEnvelopeOrBuilder() { + if (envelopeBuilder_ != null) { + return envelopeBuilder_.getMessageOrBuilder(); + } else { + return envelope_ == null ? io.grafeas.v1.Envelope.getDefaultInstance() : envelope_; + } + } + /** + * + * + *
+     * If doing something security critical, make sure to verify the signatures in
+     * this metadata.
+     * 
+ * + * .grafeas.v1.Envelope envelope = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.Envelope, io.grafeas.v1.Envelope.Builder, io.grafeas.v1.EnvelopeOrBuilder> + getEnvelopeFieldBuilder() { + if (envelopeBuilder_ == null) { + envelopeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.Envelope, + io.grafeas.v1.Envelope.Builder, + io.grafeas.v1.EnvelopeOrBuilder>(getEnvelope(), getParentForChildren(), isClean()); + envelope_ = null; + } + return envelopeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.InTotoStatement, + io.grafeas.v1.InTotoStatement.Builder, + io.grafeas.v1.InTotoStatementOrBuilder> + statementBuilder_; + /** + * .grafeas.v1.InTotoStatement statement = 2; + * + * @return Whether the statement field is set. + */ + @java.lang.Override + public boolean hasStatement() { + return decodedPayloadCase_ == 2; + } + /** + * .grafeas.v1.InTotoStatement statement = 2; + * + * @return The statement. + */ + @java.lang.Override + public io.grafeas.v1.InTotoStatement getStatement() { + if (statementBuilder_ == null) { + if (decodedPayloadCase_ == 2) { + return (io.grafeas.v1.InTotoStatement) decodedPayload_; + } + return io.grafeas.v1.InTotoStatement.getDefaultInstance(); + } else { + if (decodedPayloadCase_ == 2) { + return statementBuilder_.getMessage(); + } + return io.grafeas.v1.InTotoStatement.getDefaultInstance(); + } + } + /** .grafeas.v1.InTotoStatement statement = 2; */ + public Builder setStatement(io.grafeas.v1.InTotoStatement value) { + if (statementBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + decodedPayload_ = value; + onChanged(); + } else { + statementBuilder_.setMessage(value); + } + decodedPayloadCase_ = 2; + return this; + } + /** .grafeas.v1.InTotoStatement statement = 2; */ + public Builder setStatement(io.grafeas.v1.InTotoStatement.Builder builderForValue) { + if (statementBuilder_ == null) { + decodedPayload_ = builderForValue.build(); + onChanged(); + } else { + statementBuilder_.setMessage(builderForValue.build()); + } + decodedPayloadCase_ = 2; + return this; + } + /** .grafeas.v1.InTotoStatement statement = 2; */ + public Builder mergeStatement(io.grafeas.v1.InTotoStatement value) { + if (statementBuilder_ == null) { + if (decodedPayloadCase_ == 2 + && decodedPayload_ != io.grafeas.v1.InTotoStatement.getDefaultInstance()) { + decodedPayload_ = + io.grafeas.v1.InTotoStatement.newBuilder( + (io.grafeas.v1.InTotoStatement) decodedPayload_) + .mergeFrom(value) + .buildPartial(); + } else { + decodedPayload_ = value; + } + onChanged(); + } else { + if (decodedPayloadCase_ == 2) { + statementBuilder_.mergeFrom(value); + } + statementBuilder_.setMessage(value); + } + decodedPayloadCase_ = 2; + return this; + } + /** .grafeas.v1.InTotoStatement statement = 2; */ + public Builder clearStatement() { + if (statementBuilder_ == null) { + if (decodedPayloadCase_ == 2) { + decodedPayloadCase_ = 0; + decodedPayload_ = null; + onChanged(); + } + } else { + if (decodedPayloadCase_ == 2) { + decodedPayloadCase_ = 0; + decodedPayload_ = null; + } + statementBuilder_.clear(); + } + return this; + } + /** .grafeas.v1.InTotoStatement statement = 2; */ + public io.grafeas.v1.InTotoStatement.Builder getStatementBuilder() { + return getStatementFieldBuilder().getBuilder(); + } + /** .grafeas.v1.InTotoStatement statement = 2; */ + @java.lang.Override + public io.grafeas.v1.InTotoStatementOrBuilder getStatementOrBuilder() { + if ((decodedPayloadCase_ == 2) && (statementBuilder_ != null)) { + return statementBuilder_.getMessageOrBuilder(); + } else { + if (decodedPayloadCase_ == 2) { + return (io.grafeas.v1.InTotoStatement) decodedPayload_; + } + return io.grafeas.v1.InTotoStatement.getDefaultInstance(); + } + } + /** .grafeas.v1.InTotoStatement statement = 2; */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.InTotoStatement, + io.grafeas.v1.InTotoStatement.Builder, + io.grafeas.v1.InTotoStatementOrBuilder> + getStatementFieldBuilder() { + if (statementBuilder_ == null) { + if (!(decodedPayloadCase_ == 2)) { + decodedPayload_ = io.grafeas.v1.InTotoStatement.getDefaultInstance(); + } + statementBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.InTotoStatement, + io.grafeas.v1.InTotoStatement.Builder, + io.grafeas.v1.InTotoStatementOrBuilder>( + (io.grafeas.v1.InTotoStatement) decodedPayload_, getParentForChildren(), isClean()); + decodedPayload_ = null; + } + decodedPayloadCase_ = 2; + onChanged(); + ; + return statementBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.DSSEAttestationOccurrence) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.DSSEAttestationOccurrence) + private static final io.grafeas.v1.DSSEAttestationOccurrence DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.DSSEAttestationOccurrence(); + } + + public static io.grafeas.v1.DSSEAttestationOccurrence getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DSSEAttestationOccurrence parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DSSEAttestationOccurrence(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.DSSEAttestationOccurrence getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/src/main/java/io/grafeas/v1/DSSEAttestationOccurrenceOrBuilder.java b/src/main/java/io/grafeas/v1/DSSEAttestationOccurrenceOrBuilder.java new file mode 100644 index 00000000..914c1304 --- /dev/null +++ b/src/main/java/io/grafeas/v1/DSSEAttestationOccurrenceOrBuilder.java @@ -0,0 +1,81 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/dsse_attestation.proto + +package io.grafeas.v1; + +public interface DSSEAttestationOccurrenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.DSSEAttestationOccurrence) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If doing something security critical, make sure to verify the signatures in
+   * this metadata.
+   * 
+ * + * .grafeas.v1.Envelope envelope = 1; + * + * @return Whether the envelope field is set. + */ + boolean hasEnvelope(); + /** + * + * + *
+   * If doing something security critical, make sure to verify the signatures in
+   * this metadata.
+   * 
+ * + * .grafeas.v1.Envelope envelope = 1; + * + * @return The envelope. + */ + io.grafeas.v1.Envelope getEnvelope(); + /** + * + * + *
+   * If doing something security critical, make sure to verify the signatures in
+   * this metadata.
+   * 
+ * + * .grafeas.v1.Envelope envelope = 1; + */ + io.grafeas.v1.EnvelopeOrBuilder getEnvelopeOrBuilder(); + + /** + * .grafeas.v1.InTotoStatement statement = 2; + * + * @return Whether the statement field is set. + */ + boolean hasStatement(); + /** + * .grafeas.v1.InTotoStatement statement = 2; + * + * @return The statement. + */ + io.grafeas.v1.InTotoStatement getStatement(); + /** .grafeas.v1.InTotoStatement statement = 2; */ + io.grafeas.v1.InTotoStatementOrBuilder getStatementOrBuilder(); + + public io.grafeas.v1.DSSEAttestationOccurrence.DecodedPayloadCase getDecodedPayloadCase(); +} diff --git a/src/main/java/io/grafeas/v1/DsseAttestation.java b/src/main/java/io/grafeas/v1/DsseAttestation.java new file mode 100644 index 00000000..3974d25c --- /dev/null +++ b/src/main/java/io/grafeas/v1/DsseAttestation.java @@ -0,0 +1,101 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/dsse_attestation.proto + +package io.grafeas.v1; + +public final class DsseAttestation { + private DsseAttestation() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_DSSEAttestationNote_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_DSSEAttestationNote_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_DSSEAttestationNote_DSSEHint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_DSSEAttestationNote_DSSEHint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_DSSEAttestationOccurrence_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_DSSEAttestationOccurrence_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!grafeas/v1/dsse_attestation.proto\022\ngra" + + "feas.v1\032\027grafeas/v1/common.proto\032!grafea" + + "s/v1/intoto_statement.proto\"v\n\023DSSEAttes" + + "tationNote\0226\n\004hint\030\001 \001(\0132(.grafeas.v1.DS" + + "SEAttestationNote.DSSEHint\032\'\n\010DSSEHint\022\033" + + "\n\023human_readable_name\030\001 \001(\t\"\210\001\n\031DSSEAtte" + + "stationOccurrence\022&\n\010envelope\030\001 \001(\0132\024.gr" + + "afeas.v1.Envelope\0220\n\tstatement\030\002 \001(\0132\033.g" + + "rafeas.v1.InTotoStatementH\000B\021\n\017decoded_p" + + "ayloadBQ\n\rio.grafeas.v1P\001Z8google.golang" + + ".org/genproto/googleapis/grafeas/v1;graf" + + "eas\242\002\003GRAb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + io.grafeas.v1.Common.getDescriptor(), + io.grafeas.v1.InTotoStatementProto.getDescriptor(), + }); + internal_static_grafeas_v1_DSSEAttestationNote_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_grafeas_v1_DSSEAttestationNote_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_DSSEAttestationNote_descriptor, + new java.lang.String[] { + "Hint", + }); + internal_static_grafeas_v1_DSSEAttestationNote_DSSEHint_descriptor = + internal_static_grafeas_v1_DSSEAttestationNote_descriptor.getNestedTypes().get(0); + internal_static_grafeas_v1_DSSEAttestationNote_DSSEHint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_DSSEAttestationNote_DSSEHint_descriptor, + new java.lang.String[] { + "HumanReadableName", + }); + internal_static_grafeas_v1_DSSEAttestationOccurrence_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_grafeas_v1_DSSEAttestationOccurrence_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_DSSEAttestationOccurrence_descriptor, + new java.lang.String[] { + "Envelope", "Statement", "DecodedPayload", + }); + io.grafeas.v1.Common.getDescriptor(); + io.grafeas.v1.InTotoStatementProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/io/grafeas/v1/Envelope.java b/src/main/java/io/grafeas/v1/Envelope.java new file mode 100644 index 00000000..5d3edcf8 --- /dev/null +++ b/src/main/java/io/grafeas/v1/Envelope.java @@ -0,0 +1,963 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/common.proto + +package io.grafeas.v1; + +/** + * + * + *
+ * MUST match
+ * https://github.com/secure-systems-lab/dsse/blob/master/envelope.proto. An
+ * authenticated message of arbitrary type.
+ * 
+ * + * Protobuf type {@code grafeas.v1.Envelope} + */ +public final class Envelope extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.Envelope) + EnvelopeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Envelope.newBuilder() to construct. + private Envelope(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Envelope() { + payload_ = com.google.protobuf.ByteString.EMPTY; + payloadType_ = ""; + signatures_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Envelope(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Envelope( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + payload_ = input.readBytes(); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + payloadType_ = s; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + signatures_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + signatures_.add( + input.readMessage(io.grafeas.v1.EnvelopeSignature.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + signatures_ = java.util.Collections.unmodifiableList(signatures_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Common.internal_static_grafeas_v1_Envelope_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Common.internal_static_grafeas_v1_Envelope_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.Envelope.class, io.grafeas.v1.Envelope.Builder.class); + } + + public static final int PAYLOAD_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString payload_; + /** + * bytes payload = 1; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + public static final int PAYLOAD_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object payloadType_; + /** + * string payload_type = 2; + * + * @return The payloadType. + */ + @java.lang.Override + public java.lang.String getPayloadType() { + java.lang.Object ref = payloadType_; + 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(); + payloadType_ = s; + return s; + } + } + /** + * string payload_type = 2; + * + * @return The bytes for payloadType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayloadTypeBytes() { + java.lang.Object ref = payloadType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + payloadType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SIGNATURES_FIELD_NUMBER = 3; + private java.util.List signatures_; + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + @java.lang.Override + public java.util.List getSignaturesList() { + return signatures_; + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + @java.lang.Override + public java.util.List + getSignaturesOrBuilderList() { + return signatures_; + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + @java.lang.Override + public int getSignaturesCount() { + return signatures_.size(); + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + @java.lang.Override + public io.grafeas.v1.EnvelopeSignature getSignatures(int index) { + return signatures_.get(index); + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + @java.lang.Override + public io.grafeas.v1.EnvelopeSignatureOrBuilder getSignaturesOrBuilder(int index) { + return signatures_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!payload_.isEmpty()) { + output.writeBytes(1, payload_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(payloadType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, payloadType_); + } + for (int i = 0; i < signatures_.size(); i++) { + output.writeMessage(3, signatures_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!payload_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, payload_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(payloadType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, payloadType_); + } + for (int i = 0; i < signatures_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, signatures_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.Envelope)) { + return super.equals(obj); + } + io.grafeas.v1.Envelope other = (io.grafeas.v1.Envelope) obj; + + if (!getPayload().equals(other.getPayload())) return false; + if (!getPayloadType().equals(other.getPayloadType())) return false; + if (!getSignaturesList().equals(other.getSignaturesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + hash = (37 * hash) + PAYLOAD_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getPayloadType().hashCode(); + if (getSignaturesCount() > 0) { + hash = (37 * hash) + SIGNATURES_FIELD_NUMBER; + hash = (53 * hash) + getSignaturesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.Envelope parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.Envelope parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.Envelope parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.Envelope parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.Envelope parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.Envelope parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.Envelope parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.Envelope parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.Envelope parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.Envelope parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.Envelope parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.Envelope parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.Envelope 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * MUST match
+   * https://github.com/secure-systems-lab/dsse/blob/master/envelope.proto. An
+   * authenticated message of arbitrary type.
+   * 
+ * + * Protobuf type {@code grafeas.v1.Envelope} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.Envelope) + io.grafeas.v1.EnvelopeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Common.internal_static_grafeas_v1_Envelope_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Common.internal_static_grafeas_v1_Envelope_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.Envelope.class, io.grafeas.v1.Envelope.Builder.class); + } + + // Construct using io.grafeas.v1.Envelope.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSignaturesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + payload_ = com.google.protobuf.ByteString.EMPTY; + + payloadType_ = ""; + + if (signaturesBuilder_ == null) { + signatures_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + signaturesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.Common.internal_static_grafeas_v1_Envelope_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.Envelope getDefaultInstanceForType() { + return io.grafeas.v1.Envelope.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.Envelope build() { + io.grafeas.v1.Envelope result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.Envelope buildPartial() { + io.grafeas.v1.Envelope result = new io.grafeas.v1.Envelope(this); + int from_bitField0_ = bitField0_; + result.payload_ = payload_; + result.payloadType_ = payloadType_; + if (signaturesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + signatures_ = java.util.Collections.unmodifiableList(signatures_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.signatures_ = signatures_; + } else { + result.signatures_ = signaturesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.Envelope) { + return mergeFrom((io.grafeas.v1.Envelope) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.Envelope other) { + if (other == io.grafeas.v1.Envelope.getDefaultInstance()) return this; + if (other.getPayload() != com.google.protobuf.ByteString.EMPTY) { + setPayload(other.getPayload()); + } + if (!other.getPayloadType().isEmpty()) { + payloadType_ = other.payloadType_; + onChanged(); + } + if (signaturesBuilder_ == null) { + if (!other.signatures_.isEmpty()) { + if (signatures_.isEmpty()) { + signatures_ = other.signatures_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSignaturesIsMutable(); + signatures_.addAll(other.signatures_); + } + onChanged(); + } + } else { + if (!other.signatures_.isEmpty()) { + if (signaturesBuilder_.isEmpty()) { + signaturesBuilder_.dispose(); + signaturesBuilder_ = null; + signatures_ = other.signatures_; + bitField0_ = (bitField0_ & ~0x00000001); + signaturesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSignaturesFieldBuilder() + : null; + } else { + signaturesBuilder_.addAllMessages(other.signatures_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.Envelope parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.Envelope) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes payload = 1; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + /** + * bytes payload = 1; + * + * @param value The payload to set. + * @return This builder for chaining. + */ + public Builder setPayload(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + payload_ = value; + onChanged(); + return this; + } + /** + * bytes payload = 1; + * + * @return This builder for chaining. + */ + public Builder clearPayload() { + + payload_ = getDefaultInstance().getPayload(); + onChanged(); + return this; + } + + private java.lang.Object payloadType_ = ""; + /** + * string payload_type = 2; + * + * @return The payloadType. + */ + public java.lang.String getPayloadType() { + java.lang.Object ref = payloadType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + payloadType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string payload_type = 2; + * + * @return The bytes for payloadType. + */ + public com.google.protobuf.ByteString getPayloadTypeBytes() { + java.lang.Object ref = payloadType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + payloadType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string payload_type = 2; + * + * @param value The payloadType to set. + * @return This builder for chaining. + */ + public Builder setPayloadType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + payloadType_ = value; + onChanged(); + return this; + } + /** + * string payload_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearPayloadType() { + + payloadType_ = getDefaultInstance().getPayloadType(); + onChanged(); + return this; + } + /** + * string payload_type = 2; + * + * @param value The bytes for payloadType to set. + * @return This builder for chaining. + */ + public Builder setPayloadTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + payloadType_ = value; + onChanged(); + return this; + } + + private java.util.List signatures_ = + java.util.Collections.emptyList(); + + private void ensureSignaturesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + signatures_ = new java.util.ArrayList(signatures_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1.EnvelopeSignature, + io.grafeas.v1.EnvelopeSignature.Builder, + io.grafeas.v1.EnvelopeSignatureOrBuilder> + signaturesBuilder_; + + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + public java.util.List getSignaturesList() { + if (signaturesBuilder_ == null) { + return java.util.Collections.unmodifiableList(signatures_); + } else { + return signaturesBuilder_.getMessageList(); + } + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + public int getSignaturesCount() { + if (signaturesBuilder_ == null) { + return signatures_.size(); + } else { + return signaturesBuilder_.getCount(); + } + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + public io.grafeas.v1.EnvelopeSignature getSignatures(int index) { + if (signaturesBuilder_ == null) { + return signatures_.get(index); + } else { + return signaturesBuilder_.getMessage(index); + } + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + public Builder setSignatures(int index, io.grafeas.v1.EnvelopeSignature value) { + if (signaturesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSignaturesIsMutable(); + signatures_.set(index, value); + onChanged(); + } else { + signaturesBuilder_.setMessage(index, value); + } + return this; + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + public Builder setSignatures( + int index, io.grafeas.v1.EnvelopeSignature.Builder builderForValue) { + if (signaturesBuilder_ == null) { + ensureSignaturesIsMutable(); + signatures_.set(index, builderForValue.build()); + onChanged(); + } else { + signaturesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + public Builder addSignatures(io.grafeas.v1.EnvelopeSignature value) { + if (signaturesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSignaturesIsMutable(); + signatures_.add(value); + onChanged(); + } else { + signaturesBuilder_.addMessage(value); + } + return this; + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + public Builder addSignatures(int index, io.grafeas.v1.EnvelopeSignature value) { + if (signaturesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSignaturesIsMutable(); + signatures_.add(index, value); + onChanged(); + } else { + signaturesBuilder_.addMessage(index, value); + } + return this; + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + public Builder addSignatures(io.grafeas.v1.EnvelopeSignature.Builder builderForValue) { + if (signaturesBuilder_ == null) { + ensureSignaturesIsMutable(); + signatures_.add(builderForValue.build()); + onChanged(); + } else { + signaturesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + public Builder addSignatures( + int index, io.grafeas.v1.EnvelopeSignature.Builder builderForValue) { + if (signaturesBuilder_ == null) { + ensureSignaturesIsMutable(); + signatures_.add(index, builderForValue.build()); + onChanged(); + } else { + signaturesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + public Builder addAllSignatures( + java.lang.Iterable values) { + if (signaturesBuilder_ == null) { + ensureSignaturesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, signatures_); + onChanged(); + } else { + signaturesBuilder_.addAllMessages(values); + } + return this; + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + public Builder clearSignatures() { + if (signaturesBuilder_ == null) { + signatures_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + signaturesBuilder_.clear(); + } + return this; + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + public Builder removeSignatures(int index) { + if (signaturesBuilder_ == null) { + ensureSignaturesIsMutable(); + signatures_.remove(index); + onChanged(); + } else { + signaturesBuilder_.remove(index); + } + return this; + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + public io.grafeas.v1.EnvelopeSignature.Builder getSignaturesBuilder(int index) { + return getSignaturesFieldBuilder().getBuilder(index); + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + public io.grafeas.v1.EnvelopeSignatureOrBuilder getSignaturesOrBuilder(int index) { + if (signaturesBuilder_ == null) { + return signatures_.get(index); + } else { + return signaturesBuilder_.getMessageOrBuilder(index); + } + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + public java.util.List + getSignaturesOrBuilderList() { + if (signaturesBuilder_ != null) { + return signaturesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(signatures_); + } + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + public io.grafeas.v1.EnvelopeSignature.Builder addSignaturesBuilder() { + return getSignaturesFieldBuilder() + .addBuilder(io.grafeas.v1.EnvelopeSignature.getDefaultInstance()); + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + public io.grafeas.v1.EnvelopeSignature.Builder addSignaturesBuilder(int index) { + return getSignaturesFieldBuilder() + .addBuilder(index, io.grafeas.v1.EnvelopeSignature.getDefaultInstance()); + } + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + public java.util.List getSignaturesBuilderList() { + return getSignaturesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1.EnvelopeSignature, + io.grafeas.v1.EnvelopeSignature.Builder, + io.grafeas.v1.EnvelopeSignatureOrBuilder> + getSignaturesFieldBuilder() { + if (signaturesBuilder_ == null) { + signaturesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1.EnvelopeSignature, + io.grafeas.v1.EnvelopeSignature.Builder, + io.grafeas.v1.EnvelopeSignatureOrBuilder>( + signatures_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + signatures_ = null; + } + return signaturesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.Envelope) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.Envelope) + private static final io.grafeas.v1.Envelope DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.Envelope(); + } + + public static io.grafeas.v1.Envelope getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Envelope parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Envelope(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.Envelope getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/src/main/java/io/grafeas/v1/EnvelopeOrBuilder.java b/src/main/java/io/grafeas/v1/EnvelopeOrBuilder.java new file mode 100644 index 00000000..19c3e6dd --- /dev/null +++ b/src/main/java/io/grafeas/v1/EnvelopeOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/common.proto + +package io.grafeas.v1; + +public interface EnvelopeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.Envelope) + com.google.protobuf.MessageOrBuilder { + + /** + * bytes payload = 1; + * + * @return The payload. + */ + com.google.protobuf.ByteString getPayload(); + + /** + * string payload_type = 2; + * + * @return The payloadType. + */ + java.lang.String getPayloadType(); + /** + * string payload_type = 2; + * + * @return The bytes for payloadType. + */ + com.google.protobuf.ByteString getPayloadTypeBytes(); + + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + java.util.List getSignaturesList(); + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + io.grafeas.v1.EnvelopeSignature getSignatures(int index); + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + int getSignaturesCount(); + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + java.util.List getSignaturesOrBuilderList(); + /** repeated .grafeas.v1.EnvelopeSignature signatures = 3; */ + io.grafeas.v1.EnvelopeSignatureOrBuilder getSignaturesOrBuilder(int index); +} diff --git a/src/main/java/io/grafeas/v1/EnvelopeSignature.java b/src/main/java/io/grafeas/v1/EnvelopeSignature.java new file mode 100644 index 00000000..251314b3 --- /dev/null +++ b/src/main/java/io/grafeas/v1/EnvelopeSignature.java @@ -0,0 +1,637 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/common.proto + +package io.grafeas.v1; + +/** Protobuf type {@code grafeas.v1.EnvelopeSignature} */ +public final class EnvelopeSignature extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.EnvelopeSignature) + EnvelopeSignatureOrBuilder { + private static final long serialVersionUID = 0L; + // Use EnvelopeSignature.newBuilder() to construct. + private EnvelopeSignature(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EnvelopeSignature() { + sig_ = com.google.protobuf.ByteString.EMPTY; + keyid_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EnvelopeSignature(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EnvelopeSignature( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + sig_ = input.readBytes(); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + keyid_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Common.internal_static_grafeas_v1_EnvelopeSignature_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Common.internal_static_grafeas_v1_EnvelopeSignature_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.EnvelopeSignature.class, io.grafeas.v1.EnvelopeSignature.Builder.class); + } + + public static final int SIG_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString sig_; + /** + * bytes sig = 1; + * + * @return The sig. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSig() { + return sig_; + } + + public static final int KEYID_FIELD_NUMBER = 2; + private volatile java.lang.Object keyid_; + /** + * string keyid = 2; + * + * @return The keyid. + */ + @java.lang.Override + public java.lang.String getKeyid() { + java.lang.Object ref = keyid_; + 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(); + keyid_ = s; + return s; + } + } + /** + * string keyid = 2; + * + * @return The bytes for keyid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyidBytes() { + java.lang.Object ref = keyid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + keyid_ = 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; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!sig_.isEmpty()) { + output.writeBytes(1, sig_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(keyid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, keyid_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!sig_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, sig_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(keyid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, keyid_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.EnvelopeSignature)) { + return super.equals(obj); + } + io.grafeas.v1.EnvelopeSignature other = (io.grafeas.v1.EnvelopeSignature) obj; + + if (!getSig().equals(other.getSig())) return false; + if (!getKeyid().equals(other.getKeyid())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SIG_FIELD_NUMBER; + hash = (53 * hash) + getSig().hashCode(); + hash = (37 * hash) + KEYID_FIELD_NUMBER; + hash = (53 * hash) + getKeyid().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.EnvelopeSignature parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.EnvelopeSignature parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.EnvelopeSignature parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.EnvelopeSignature parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.EnvelopeSignature parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.EnvelopeSignature parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.EnvelopeSignature parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.EnvelopeSignature parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.EnvelopeSignature parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.EnvelopeSignature parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.EnvelopeSignature parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.EnvelopeSignature parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.EnvelopeSignature 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code grafeas.v1.EnvelopeSignature} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.EnvelopeSignature) + io.grafeas.v1.EnvelopeSignatureOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Common.internal_static_grafeas_v1_EnvelopeSignature_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Common.internal_static_grafeas_v1_EnvelopeSignature_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.EnvelopeSignature.class, io.grafeas.v1.EnvelopeSignature.Builder.class); + } + + // Construct using io.grafeas.v1.EnvelopeSignature.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + sig_ = com.google.protobuf.ByteString.EMPTY; + + keyid_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.Common.internal_static_grafeas_v1_EnvelopeSignature_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.EnvelopeSignature getDefaultInstanceForType() { + return io.grafeas.v1.EnvelopeSignature.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.EnvelopeSignature build() { + io.grafeas.v1.EnvelopeSignature result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.EnvelopeSignature buildPartial() { + io.grafeas.v1.EnvelopeSignature result = new io.grafeas.v1.EnvelopeSignature(this); + result.sig_ = sig_; + result.keyid_ = keyid_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.EnvelopeSignature) { + return mergeFrom((io.grafeas.v1.EnvelopeSignature) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.EnvelopeSignature other) { + if (other == io.grafeas.v1.EnvelopeSignature.getDefaultInstance()) return this; + if (other.getSig() != com.google.protobuf.ByteString.EMPTY) { + setSig(other.getSig()); + } + if (!other.getKeyid().isEmpty()) { + keyid_ = other.keyid_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.EnvelopeSignature parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.EnvelopeSignature) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.ByteString sig_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes sig = 1; + * + * @return The sig. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSig() { + return sig_; + } + /** + * bytes sig = 1; + * + * @param value The sig to set. + * @return This builder for chaining. + */ + public Builder setSig(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + sig_ = value; + onChanged(); + return this; + } + /** + * bytes sig = 1; + * + * @return This builder for chaining. + */ + public Builder clearSig() { + + sig_ = getDefaultInstance().getSig(); + onChanged(); + return this; + } + + private java.lang.Object keyid_ = ""; + /** + * string keyid = 2; + * + * @return The keyid. + */ + public java.lang.String getKeyid() { + java.lang.Object ref = keyid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + keyid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string keyid = 2; + * + * @return The bytes for keyid. + */ + public com.google.protobuf.ByteString getKeyidBytes() { + java.lang.Object ref = keyid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + keyid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string keyid = 2; + * + * @param value The keyid to set. + * @return This builder for chaining. + */ + public Builder setKeyid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + keyid_ = value; + onChanged(); + return this; + } + /** + * string keyid = 2; + * + * @return This builder for chaining. + */ + public Builder clearKeyid() { + + keyid_ = getDefaultInstance().getKeyid(); + onChanged(); + return this; + } + /** + * string keyid = 2; + * + * @param value The bytes for keyid to set. + * @return This builder for chaining. + */ + public Builder setKeyidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + keyid_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.EnvelopeSignature) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.EnvelopeSignature) + private static final io.grafeas.v1.EnvelopeSignature DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.EnvelopeSignature(); + } + + public static io.grafeas.v1.EnvelopeSignature getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnvelopeSignature parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EnvelopeSignature(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.EnvelopeSignature getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/src/main/java/io/grafeas/v1/EnvelopeSignatureOrBuilder.java b/src/main/java/io/grafeas/v1/EnvelopeSignatureOrBuilder.java new file mode 100644 index 00000000..3f45fc1b --- /dev/null +++ b/src/main/java/io/grafeas/v1/EnvelopeSignatureOrBuilder.java @@ -0,0 +1,46 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/common.proto + +package io.grafeas.v1; + +public interface EnvelopeSignatureOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.EnvelopeSignature) + com.google.protobuf.MessageOrBuilder { + + /** + * bytes sig = 1; + * + * @return The sig. + */ + com.google.protobuf.ByteString getSig(); + + /** + * string keyid = 2; + * + * @return The keyid. + */ + java.lang.String getKeyid(); + /** + * string keyid = 2; + * + * @return The bytes for keyid. + */ + com.google.protobuf.ByteString getKeyidBytes(); +} diff --git a/src/main/java/io/grafeas/v1/GrafeasGrpc.java b/src/main/java/io/grafeas/v1/GrafeasGrpc.java index 3ec20591..1f5ee5b6 100644 --- a/src/main/java/io/grafeas/v1/GrafeasGrpc.java +++ b/src/main/java/io/grafeas/v1/GrafeasGrpc.java @@ -38,6 +38,7 @@ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: grafeas/v1/grafeas.proto") +@io.grpc.stub.annotations.GrpcGenerated public final class GrafeasGrpc { private GrafeasGrpc() {} diff --git a/src/main/java/io/grafeas/v1/GrafeasOuterClass.java b/src/main/java/io/grafeas/v1/GrafeasOuterClass.java index 0980e29e..6be00a97 100644 --- a/src/main/java/io/grafeas/v1/GrafeasOuterClass.java +++ b/src/main/java/io/grafeas/v1/GrafeasOuterClass.java @@ -133,154 +133,162 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "field_mask.proto\032\037google/protobuf/timest" + "amp.proto\032\034grafeas/v1/attestation.proto\032" + "\026grafeas/v1/build.proto\032\027grafeas/v1/comm" - + "on.proto\032\033grafeas/v1/deployment.proto\032\032g" - + "rafeas/v1/discovery.proto\032\026grafeas/v1/im" - + "age.proto\032\030grafeas/v1/package.proto\032\030gra" - + "feas/v1/upgrade.proto\032\036grafeas/v1/vulner" - + "ability.proto\"\330\005\n\nOccurrence\022\014\n\004name\030\001 \001" - + "(\t\022\024\n\014resource_uri\030\002 \001(\t\022\021\n\tnote_name\030\003 " - + "\001(\t\022\"\n\004kind\030\004 \001(\0162\024.grafeas.v1.NoteKind\022" - + "\023\n\013remediation\030\005 \001(\t\022/\n\013create_time\030\006 \001(" - + "\0132\032.google.protobuf.Timestamp\022/\n\013update_" - + "time\030\007 \001(\0132\032.google.protobuf.Timestamp\022<" - + "\n\rvulnerability\030\010 \001(\0132#.grafeas.v1.Vulne" - + "rabilityOccurrenceH\000\022,\n\005build\030\t \001(\0132\033.gr" - + "afeas.v1.BuildOccurrenceH\000\022,\n\005image\030\n \001(" - + "\0132\033.grafeas.v1.ImageOccurrenceH\000\0220\n\007pack" - + "age\030\013 \001(\0132\035.grafeas.v1.PackageOccurrence" - + "H\000\0226\n\ndeployment\030\014 \001(\0132 .grafeas.v1.Depl" - + "oymentOccurrenceH\000\0224\n\tdiscovery\030\r \001(\0132\037." - + "grafeas.v1.DiscoveryOccurrenceH\000\0228\n\013atte" - + "station\030\016 \001(\0132!.grafeas.v1.AttestationOc" - + "currenceH\000\0220\n\007upgrade\030\017 \001(\0132\035.grafeas.v1" - + ".UpgradeOccurrenceH\000:G\352AD\n\025grafeas.io/Oc" - + "currence\022+projects/{project}/occurrences" - + "/{occurrence}B\t\n\007details\"\202\006\n\004Note\022\014\n\004nam" - + "e\030\001 \001(\t\022\031\n\021short_description\030\002 \001(\t\022\030\n\020lo" - + "ng_description\030\003 \001(\t\022\"\n\004kind\030\004 \001(\0162\024.gra" - + "feas.v1.NoteKind\022+\n\013related_url\030\005 \003(\0132\026." - + "grafeas.v1.RelatedUrl\0223\n\017expiration_time" - + "\030\006 \001(\0132\032.google.protobuf.Timestamp\022/\n\013cr" - + "eate_time\030\007 \001(\0132\032.google.protobuf.Timest" - + "amp\022/\n\013update_time\030\010 \001(\0132\032.google.protob" - + "uf.Timestamp\022\032\n\022related_note_names\030\t \003(\t" - + "\0226\n\rvulnerability\030\n \001(\0132\035.grafeas.v1.Vul" - + "nerabilityNoteH\000\022&\n\005build\030\013 \001(\0132\025.grafea" - + "s.v1.BuildNoteH\000\022&\n\005image\030\014 \001(\0132\025.grafea" - + "s.v1.ImageNoteH\000\022*\n\007package\030\r \001(\0132\027.graf" - + "eas.v1.PackageNoteH\000\0220\n\ndeployment\030\016 \001(\013" - + "2\032.grafeas.v1.DeploymentNoteH\000\022.\n\tdiscov" - + "ery\030\017 \001(\0132\031.grafeas.v1.DiscoveryNoteH\000\0222" - + "\n\013attestation\030\020 \001(\0132\033.grafeas.v1.Attesta" - + "tionNoteH\000\022*\n\007upgrade\030\021 \001(\0132\027.grafeas.v1" - + ".UpgradeNoteH\000:5\352A2\n\017grafeas.io/Note\022\037pr" - + "ojects/{project}/notes/{note}B\006\n\004type\"C\n" - + "\024GetOccurrenceRequest\022+\n\004name\030\001 \001(\tB\035\340A\002" - + "\372A\027\n\025grafeas.io/Occurrence\"{\n\026ListOccurr" - + "encesRequest\022*\n\006parent\030\001 \001(\tB\032\340A\002\372A\024\n\022gr" - + "afeas.io/Project\022\016\n\006filter\030\002 \001(\t\022\021\n\tpage" - + "_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"_\n\027ListO" - + "ccurrencesResponse\022+\n\013occurrences\030\001 \003(\0132" - + "\026.grafeas.v1.Occurrence\022\027\n\017next_page_tok" - + "en\030\002 \001(\t\"F\n\027DeleteOccurrenceRequest\022+\n\004n" - + "ame\030\001 \001(\tB\035\340A\002\372A\027\n\025grafeas.io/Occurrence" - + "\"v\n\027CreateOccurrenceRequest\022*\n\006parent\030\001 " - + "\001(\tB\032\340A\002\372A\024\n\022grafeas.io/Project\022/\n\noccur" - + "rence\030\002 \001(\0132\026.grafeas.v1.OccurrenceB\003\340A\002" - + "\"\250\001\n\027UpdateOccurrenceRequest\022+\n\004name\030\001 \001" - + "(\tB\035\340A\002\372A\027\n\025grafeas.io/Occurrence\022/\n\nocc" - + "urrence\030\002 \001(\0132\026.grafeas.v1.OccurrenceB\003\340" - + "A\002\022/\n\013update_mask\030\003 \001(\0132\032.google.protobu" - + "f.FieldMask\"7\n\016GetNoteRequest\022%\n\004name\030\001 " - + "\001(\tB\027\340A\002\372A\021\n\017grafeas.io/Note\"G\n\030GetOccur" - + "renceNoteRequest\022+\n\004name\030\001 \001(\tB\035\340A\002\372A\027\n\025" - + "grafeas.io/Occurrence\"u\n\020ListNotesReques" - + "t\022*\n\006parent\030\001 \001(\tB\032\340A\002\372A\024\n\022grafeas.io/Pr" - + "oject\022\016\n\006filter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005" - + "\022\022\n\npage_token\030\004 \001(\t\"M\n\021ListNotesRespons" - + "e\022\037\n\005notes\030\001 \003(\0132\020.grafeas.v1.Note\022\027\n\017ne" - + "xt_page_token\030\002 \001(\t\":\n\021DeleteNoteRequest" - + "\022%\n\004name\030\001 \001(\tB\027\340A\002\372A\021\n\017grafeas.io/Note\"" - + "z\n\021CreateNoteRequest\022*\n\006parent\030\001 \001(\tB\032\340A" - + "\002\372A\024\n\022grafeas.io/Project\022\024\n\007note_id\030\002 \001(" - + "\tB\003\340A\002\022#\n\004note\030\003 \001(\0132\020.grafeas.v1.NoteB\003" - + "\340A\002\"\220\001\n\021UpdateNoteRequest\022%\n\004name\030\001 \001(\tB" - + "\027\340A\002\372A\021\n\017grafeas.io/Note\022#\n\004note\030\002 \001(\0132\020" - + ".grafeas.v1.NoteB\003\340A\002\022/\n\013update_mask\030\003 \001" - + "(\0132\032.google.protobuf.FieldMask\"z\n\032ListNo" - + "teOccurrencesRequest\022%\n\004name\030\001 \001(\tB\027\340A\002\372" - + "A\021\n\017grafeas.io/Note\022\016\n\006filter\030\002 \001(\t\022\021\n\tp" - + "age_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"c\n\033Li" - + "stNoteOccurrencesResponse\022+\n\013occurrences" - + "\030\001 \003(\0132\026.grafeas.v1.Occurrence\022\027\n\017next_p" - + "age_token\030\002 \001(\t\"\311\001\n\027BatchCreateNotesRequ" - + "est\022*\n\006parent\030\001 \001(\tB\032\340A\002\372A\024\n\022grafeas.io/" - + "Project\022B\n\005notes\030\002 \003(\0132..grafeas.v1.Batc" - + "hCreateNotesRequest.NotesEntryB\003\340A\002\032>\n\nN" - + "otesEntry\022\013\n\003key\030\001 \001(\t\022\037\n\005value\030\002 \001(\0132\020." - + "grafeas.v1.Note:\0028\001\";\n\030BatchCreateNotesR" - + "esponse\022\037\n\005notes\030\001 \003(\0132\020.grafeas.v1.Note" - + "\"}\n\035BatchCreateOccurrencesRequest\022*\n\006par" - + "ent\030\001 \001(\tB\032\340A\002\372A\024\n\022grafeas.io/Project\0220\n" - + "\013occurrences\030\002 \003(\0132\026.grafeas.v1.Occurren" - + "ceB\003\340A\002\"M\n\036BatchCreateOccurrencesRespons" - + "e\022+\n\013occurrences\030\001 \003(\0132\026.grafeas.v1.Occu" - + "rrence2\222\020\n\007Grafeas\022}\n\rGetOccurrence\022 .gr" - + "afeas.v1.GetOccurrenceRequest\032\026.grafeas." - + "v1.Occurrence\"2\202\323\344\223\002%\022#/v1/{name=project" - + "s/*/occurrences/*}\332A\004name\022\227\001\n\017ListOccurr" - + "ences\022\".grafeas.v1.ListOccurrencesReques" - + "t\032#.grafeas.v1.ListOccurrencesResponse\";" - + "\202\323\344\223\002%\022#/v1/{parent=projects/*}/occurren" - + "ces\332A\rparent,filter\022\203\001\n\020DeleteOccurrence" - + "\022#.grafeas.v1.DeleteOccurrenceRequest\032\026." - + "google.protobuf.Empty\"2\202\323\344\223\002%*#/v1/{name" - + "=projects/*/occurrences/*}\332A\004name\022\234\001\n\020Cr" - + "eateOccurrence\022#.grafeas.v1.CreateOccurr" - + "enceRequest\032\026.grafeas.v1.Occurrence\"K\202\323\344" - + "\223\0021\"#/v1/{parent=projects/*}/occurrences" - + ":\noccurrence\332A\021parent,occurrence\022\300\001\n\026Bat" - + "chCreateOccurrences\022).grafeas.v1.BatchCr" - + "eateOccurrencesRequest\032*.grafeas.v1.Batc" - + "hCreateOccurrencesResponse\"O\202\323\344\223\0024\"//v1/" - + "{parent=projects/*}/occurrences:batchCre" - + "ate:\001*\332A\022parent,occurrences\022\246\001\n\020UpdateOc" - + "currence\022#.grafeas.v1.UpdateOccurrenceRe" - + "quest\032\026.grafeas.v1.Occurrence\"U\202\323\344\223\00212#/" - + "v1/{name=projects/*/occurrences/*}:\noccu" - + "rrence\332A\033name,occurrence,update_mask\022\205\001\n" - + "\021GetOccurrenceNote\022$.grafeas.v1.GetOccur" - + "renceNoteRequest\032\020.grafeas.v1.Note\"8\202\323\344\223" - + "\002+\022)/v1/{name=projects/*/occurrences/*}/" - + "notes\332A\004name\022e\n\007GetNote\022\032.grafeas.v1.Get" - + "NoteRequest\032\020.grafeas.v1.Note\",\202\323\344\223\002\037\022\035/" - + "v1/{name=projects/*/notes/*}\332A\004name\022\177\n\tL" - + "istNotes\022\034.grafeas.v1.ListNotesRequest\032\035" - + ".grafeas.v1.ListNotesResponse\"5\202\323\344\223\002\037\022\035/" - + "v1/{parent=projects/*}/notes\332A\rparent,fi" - + "lter\022q\n\nDeleteNote\022\035.grafeas.v1.DeleteNo" - + "teRequest\032\026.google.protobuf.Empty\",\202\323\344\223\002" - + "\037*\035/v1/{name=projects/*/notes/*}\332A\004name\022" - + "\200\001\n\nCreateNote\022\035.grafeas.v1.CreateNoteRe" - + "quest\032\020.grafeas.v1.Note\"A\202\323\344\223\002%\"\035/v1/{pa" - + "rent=projects/*}/notes:\004note\332A\023parent,no" - + "te_id,note\022\242\001\n\020BatchCreateNotes\022#.grafea" - + "s.v1.BatchCreateNotesRequest\032$.grafeas.v" - + "1.BatchCreateNotesResponse\"C\202\323\344\223\002.\")/v1/" - + "{parent=projects/*}/notes:batchCreate:\001*" - + "\332A\014parent,notes\022\202\001\n\nUpdateNote\022\035.grafeas" - + ".v1.UpdateNoteRequest\032\020.grafeas.v1.Note\"" - + "C\202\323\344\223\002%2\035/v1/{name=projects/*/notes/*}:\004" - + "note\332A\025name,note,update_mask\022\247\001\n\023ListNot" - + "eOccurrences\022&.grafeas.v1.ListNoteOccurr" - + "encesRequest\032\'.grafeas.v1.ListNoteOccurr" - + "encesResponse\"?\202\323\344\223\002+\022)/v1/{name=project" - + "s/*/notes/*}/occurrences\332A\013name,filter\032#" - + "\312A containeranalysis.googleapis.comB|\n\ri" - + "o.grafeas.v1P\001Z8google.golang.org/genpro" - + "to/googleapis/grafeas/v1;grafeas\242\002\003GRA\352A" - + "(\n\022grafeas.io/Project\022\022projects/{project" - + "}b\006proto3" + + "on.proto\032\033grafeas/v1/compliance.proto\032\033g" + + "rafeas/v1/deployment.proto\032\032grafeas/v1/d" + + "iscovery.proto\032!grafeas/v1/dsse_attestat" + + "ion.proto\032\026grafeas/v1/image.proto\032\030grafe" + + "as/v1/package.proto\032\030grafeas/v1/upgrade." + + "proto\032\036grafeas/v1/vulnerability.proto\"\373\006" + + "\n\nOccurrence\022\014\n\004name\030\001 \001(\t\022\024\n\014resource_u" + + "ri\030\002 \001(\t\022\021\n\tnote_name\030\003 \001(\t\022\"\n\004kind\030\004 \001(" + + "\0162\024.grafeas.v1.NoteKind\022\023\n\013remediation\030\005" + + " \001(\t\022/\n\013create_time\030\006 \001(\0132\032.google.proto" + + "buf.Timestamp\022/\n\013update_time\030\007 \001(\0132\032.goo" + + "gle.protobuf.Timestamp\022<\n\rvulnerability\030" + + "\010 \001(\0132#.grafeas.v1.VulnerabilityOccurren" + + "ceH\000\022,\n\005build\030\t \001(\0132\033.grafeas.v1.BuildOc" + + "currenceH\000\022,\n\005image\030\n \001(\0132\033.grafeas.v1.I" + + "mageOccurrenceH\000\0220\n\007package\030\013 \001(\0132\035.graf" + + "eas.v1.PackageOccurrenceH\000\0226\n\ndeployment" + + "\030\014 \001(\0132 .grafeas.v1.DeploymentOccurrence" + + "H\000\0224\n\tdiscovery\030\r \001(\0132\037.grafeas.v1.Disco" + + "veryOccurrenceH\000\0228\n\013attestation\030\016 \001(\0132!." + + "grafeas.v1.AttestationOccurrenceH\000\0220\n\007up" + + "grade\030\017 \001(\0132\035.grafeas.v1.UpgradeOccurren" + + "ceH\000\0226\n\ncompliance\030\020 \001(\0132 .grafeas.v1.Co" + + "mplianceOccurrenceH\000\022A\n\020dsse_attestation" + + "\030\021 \001(\0132%.grafeas.v1.DSSEAttestationOccur" + + "renceH\000\022&\n\010envelope\030\022 \001(\0132\024.grafeas.v1.E" + + "nvelope:G\352AD\n\025grafeas.io/Occurrence\022+pro" + + "jects/{project}/occurrences/{occurrence}" + + "B\t\n\007details\"\361\006\n\004Note\022\014\n\004name\030\001 \001(\t\022\031\n\021sh" + + "ort_description\030\002 \001(\t\022\030\n\020long_descriptio" + + "n\030\003 \001(\t\022\"\n\004kind\030\004 \001(\0162\024.grafeas.v1.NoteK" + + "ind\022+\n\013related_url\030\005 \003(\0132\026.grafeas.v1.Re" + + "latedUrl\0223\n\017expiration_time\030\006 \001(\0132\032.goog" + + "le.protobuf.Timestamp\022/\n\013create_time\030\007 \001" + + "(\0132\032.google.protobuf.Timestamp\022/\n\013update" + + "_time\030\010 \001(\0132\032.google.protobuf.Timestamp\022" + + "\032\n\022related_note_names\030\t \003(\t\0226\n\rvulnerabi" + + "lity\030\n \001(\0132\035.grafeas.v1.VulnerabilityNot" + + "eH\000\022&\n\005build\030\013 \001(\0132\025.grafeas.v1.BuildNot" + + "eH\000\022&\n\005image\030\014 \001(\0132\025.grafeas.v1.ImageNot" + + "eH\000\022*\n\007package\030\r \001(\0132\027.grafeas.v1.Packag" + + "eNoteH\000\0220\n\ndeployment\030\016 \001(\0132\032.grafeas.v1" + + ".DeploymentNoteH\000\022.\n\tdiscovery\030\017 \001(\0132\031.g" + + "rafeas.v1.DiscoveryNoteH\000\0222\n\013attestation" + + "\030\020 \001(\0132\033.grafeas.v1.AttestationNoteH\000\022*\n" + + "\007upgrade\030\021 \001(\0132\027.grafeas.v1.UpgradeNoteH" + + "\000\0220\n\ncompliance\030\022 \001(\0132\032.grafeas.v1.Compl" + + "ianceNoteH\000\022;\n\020dsse_attestation\030\023 \001(\0132\037." + + "grafeas.v1.DSSEAttestationNoteH\000:5\352A2\n\017g" + + "rafeas.io/Note\022\037projects/{project}/notes" + + "/{note}B\006\n\004type\"C\n\024GetOccurrenceRequest\022" + + "+\n\004name\030\001 \001(\tB\035\340A\002\372A\027\n\025grafeas.io/Occurr" + + "ence\"{\n\026ListOccurrencesRequest\022*\n\006parent" + + "\030\001 \001(\tB\032\340A\002\372A\024\n\022grafeas.io/Project\022\016\n\006fi" + + "lter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_to" + + "ken\030\004 \001(\t\"_\n\027ListOccurrencesResponse\022+\n\013" + + "occurrences\030\001 \003(\0132\026.grafeas.v1.Occurrenc" + + "e\022\027\n\017next_page_token\030\002 \001(\t\"F\n\027DeleteOccu" + + "rrenceRequest\022+\n\004name\030\001 \001(\tB\035\340A\002\372A\027\n\025gra" + + "feas.io/Occurrence\"v\n\027CreateOccurrenceRe" + + "quest\022*\n\006parent\030\001 \001(\tB\032\340A\002\372A\024\n\022grafeas.i" + + "o/Project\022/\n\noccurrence\030\002 \001(\0132\026.grafeas." + + "v1.OccurrenceB\003\340A\002\"\250\001\n\027UpdateOccurrenceR" + + "equest\022+\n\004name\030\001 \001(\tB\035\340A\002\372A\027\n\025grafeas.io" + + "/Occurrence\022/\n\noccurrence\030\002 \001(\0132\026.grafea" + + "s.v1.OccurrenceB\003\340A\002\022/\n\013update_mask\030\003 \001(" + + "\0132\032.google.protobuf.FieldMask\"7\n\016GetNote" + + "Request\022%\n\004name\030\001 \001(\tB\027\340A\002\372A\021\n\017grafeas.i" + + "o/Note\"G\n\030GetOccurrenceNoteRequest\022+\n\004na" + + "me\030\001 \001(\tB\035\340A\002\372A\027\n\025grafeas.io/Occurrence\"" + + "u\n\020ListNotesRequest\022*\n\006parent\030\001 \001(\tB\032\340A\002" + + "\372A\024\n\022grafeas.io/Project\022\016\n\006filter\030\002 \001(\t\022" + + "\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"M" + + "\n\021ListNotesResponse\022\037\n\005notes\030\001 \003(\0132\020.gra" + + "feas.v1.Note\022\027\n\017next_page_token\030\002 \001(\t\":\n" + + "\021DeleteNoteRequest\022%\n\004name\030\001 \001(\tB\027\340A\002\372A\021" + + "\n\017grafeas.io/Note\"z\n\021CreateNoteRequest\022*" + + "\n\006parent\030\001 \001(\tB\032\340A\002\372A\024\n\022grafeas.io/Proje" + + "ct\022\024\n\007note_id\030\002 \001(\tB\003\340A\002\022#\n\004note\030\003 \001(\0132\020" + + ".grafeas.v1.NoteB\003\340A\002\"\220\001\n\021UpdateNoteRequ" + + "est\022%\n\004name\030\001 \001(\tB\027\340A\002\372A\021\n\017grafeas.io/No" + + "te\022#\n\004note\030\002 \001(\0132\020.grafeas.v1.NoteB\003\340A\002\022" + + "/\n\013update_mask\030\003 \001(\0132\032.google.protobuf.F" + + "ieldMask\"z\n\032ListNoteOccurrencesRequest\022%" + + "\n\004name\030\001 \001(\tB\027\340A\002\372A\021\n\017grafeas.io/Note\022\016\n" + + "\006filter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage" + + "_token\030\004 \001(\t\"c\n\033ListNoteOccurrencesRespo" + + "nse\022+\n\013occurrences\030\001 \003(\0132\026.grafeas.v1.Oc" + + "currence\022\027\n\017next_page_token\030\002 \001(\t\"\311\001\n\027Ba" + + "tchCreateNotesRequest\022*\n\006parent\030\001 \001(\tB\032\340" + + "A\002\372A\024\n\022grafeas.io/Project\022B\n\005notes\030\002 \003(\013" + + "2..grafeas.v1.BatchCreateNotesRequest.No" + + "tesEntryB\003\340A\002\032>\n\nNotesEntry\022\013\n\003key\030\001 \001(\t" + + "\022\037\n\005value\030\002 \001(\0132\020.grafeas.v1.Note:\0028\001\";\n" + + "\030BatchCreateNotesResponse\022\037\n\005notes\030\001 \003(\013" + + "2\020.grafeas.v1.Note\"}\n\035BatchCreateOccurre" + + "ncesRequest\022*\n\006parent\030\001 \001(\tB\032\340A\002\372A\024\n\022gra" + + "feas.io/Project\0220\n\013occurrences\030\002 \003(\0132\026.g" + + "rafeas.v1.OccurrenceB\003\340A\002\"M\n\036BatchCreate" + + "OccurrencesResponse\022+\n\013occurrences\030\001 \003(\013" + + "2\026.grafeas.v1.Occurrence2\222\020\n\007Grafeas\022}\n\r" + + "GetOccurrence\022 .grafeas.v1.GetOccurrence" + + "Request\032\026.grafeas.v1.Occurrence\"2\202\323\344\223\002%\022" + + "#/v1/{name=projects/*/occurrences/*}\332A\004n" + + "ame\022\227\001\n\017ListOccurrences\022\".grafeas.v1.Lis" + + "tOccurrencesRequest\032#.grafeas.v1.ListOcc" + + "urrencesResponse\";\202\323\344\223\002%\022#/v1/{parent=pr" + + "ojects/*}/occurrences\332A\rparent,filter\022\203\001" + + "\n\020DeleteOccurrence\022#.grafeas.v1.DeleteOc" + + "currenceRequest\032\026.google.protobuf.Empty\"" + + "2\202\323\344\223\002%*#/v1/{name=projects/*/occurrence" + + "s/*}\332A\004name\022\234\001\n\020CreateOccurrence\022#.grafe" + + "as.v1.CreateOccurrenceRequest\032\026.grafeas." + + "v1.Occurrence\"K\202\323\344\223\0021\"#/v1/{parent=proje" + + "cts/*}/occurrences:\noccurrence\332A\021parent," + + "occurrence\022\300\001\n\026BatchCreateOccurrences\022)." + + "grafeas.v1.BatchCreateOccurrencesRequest" + + "\032*.grafeas.v1.BatchCreateOccurrencesResp" + + "onse\"O\202\323\344\223\0024\"//v1/{parent=projects/*}/oc" + + "currences:batchCreate:\001*\332A\022parent,occurr" + + "ences\022\246\001\n\020UpdateOccurrence\022#.grafeas.v1." + + "UpdateOccurrenceRequest\032\026.grafeas.v1.Occ" + + "urrence\"U\202\323\344\223\00212#/v1/{name=projects/*/oc" + + "currences/*}:\noccurrence\332A\033name,occurren" + + "ce,update_mask\022\205\001\n\021GetOccurrenceNote\022$.g" + + "rafeas.v1.GetOccurrenceNoteRequest\032\020.gra" + + "feas.v1.Note\"8\202\323\344\223\002+\022)/v1/{name=projects" + + "/*/occurrences/*}/notes\332A\004name\022e\n\007GetNot" + + "e\022\032.grafeas.v1.GetNoteRequest\032\020.grafeas." + + "v1.Note\",\202\323\344\223\002\037\022\035/v1/{name=projects/*/no" + + "tes/*}\332A\004name\022\177\n\tListNotes\022\034.grafeas.v1." + + "ListNotesRequest\032\035.grafeas.v1.ListNotesR" + + "esponse\"5\202\323\344\223\002\037\022\035/v1/{parent=projects/*}" + + "/notes\332A\rparent,filter\022q\n\nDeleteNote\022\035.g" + + "rafeas.v1.DeleteNoteRequest\032\026.google.pro" + + "tobuf.Empty\",\202\323\344\223\002\037*\035/v1/{name=projects/" + + "*/notes/*}\332A\004name\022\200\001\n\nCreateNote\022\035.grafe" + + "as.v1.CreateNoteRequest\032\020.grafeas.v1.Not" + + "e\"A\202\323\344\223\002%\"\035/v1/{parent=projects/*}/notes" + + ":\004note\332A\023parent,note_id,note\022\242\001\n\020BatchCr" + + "eateNotes\022#.grafeas.v1.BatchCreateNotesR" + + "equest\032$.grafeas.v1.BatchCreateNotesResp" + + "onse\"C\202\323\344\223\002.\")/v1/{parent=projects/*}/no" + + "tes:batchCreate:\001*\332A\014parent,notes\022\202\001\n\nUp" + + "dateNote\022\035.grafeas.v1.UpdateNoteRequest\032" + + "\020.grafeas.v1.Note\"C\202\323\344\223\002%2\035/v1/{name=pro" + + "jects/*/notes/*}:\004note\332A\025name,note,updat" + + "e_mask\022\247\001\n\023ListNoteOccurrences\022&.grafeas" + + ".v1.ListNoteOccurrencesRequest\032\'.grafeas" + + ".v1.ListNoteOccurrencesResponse\"?\202\323\344\223\002+\022" + + ")/v1/{name=projects/*/notes/*}/occurrenc" + + "es\332A\013name,filter\032#\312A containeranalysis.g" + + "oogleapis.comB|\n\rio.grafeas.v1P\001Z8google" + + ".golang.org/genproto/googleapis/grafeas/" + + "v1;grafeas\242\002\003GRA\352A(\n\022grafeas.io/Project\022" + + "\022projects/{project}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -296,8 +304,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { io.grafeas.v1.Attestation.getDescriptor(), io.grafeas.v1.Build.getDescriptor(), io.grafeas.v1.Common.getDescriptor(), + io.grafeas.v1.Compliance.getDescriptor(), io.grafeas.v1.Deployment.getDescriptor(), io.grafeas.v1.Discovery.getDescriptor(), + io.grafeas.v1.DsseAttestation.getDescriptor(), io.grafeas.v1.Image.getDescriptor(), io.grafeas.v1.Package.getDescriptor(), io.grafeas.v1.Upgrade.getDescriptor(), @@ -323,6 +333,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Discovery", "Attestation", "Upgrade", + "Compliance", + "DsseAttestation", + "Envelope", "Details", }); internal_static_grafeas_v1_Note_descriptor = getDescriptor().getMessageTypes().get(1); @@ -347,6 +360,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Discovery", "Attestation", "Upgrade", + "Compliance", + "DsseAttestation", "Type", }); internal_static_grafeas_v1_GetOccurrenceRequest_descriptor = @@ -529,8 +544,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { io.grafeas.v1.Attestation.getDescriptor(); io.grafeas.v1.Build.getDescriptor(); io.grafeas.v1.Common.getDescriptor(); + io.grafeas.v1.Compliance.getDescriptor(); io.grafeas.v1.Deployment.getDescriptor(); io.grafeas.v1.Discovery.getDescriptor(); + io.grafeas.v1.DsseAttestation.getDescriptor(); io.grafeas.v1.Image.getDescriptor(); io.grafeas.v1.Package.getDescriptor(); io.grafeas.v1.Upgrade.getDescriptor(); diff --git a/src/main/java/io/grafeas/v1/InTotoProvenance.java b/src/main/java/io/grafeas/v1/InTotoProvenance.java new file mode 100644 index 00000000..3e4a9323 --- /dev/null +++ b/src/main/java/io/grafeas/v1/InTotoProvenance.java @@ -0,0 +1,1499 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/intoto_provenance.proto + +package io.grafeas.v1; + +/** Protobuf type {@code grafeas.v1.InTotoProvenance} */ +public final class InTotoProvenance extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.InTotoProvenance) + InTotoProvenanceOrBuilder { + private static final long serialVersionUID = 0L; + // Use InTotoProvenance.newBuilder() to construct. + private InTotoProvenance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InTotoProvenance() { + materials_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InTotoProvenance(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private InTotoProvenance( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + io.grafeas.v1.BuilderConfig.Builder subBuilder = null; + if (builderConfig_ != null) { + subBuilder = builderConfig_.toBuilder(); + } + builderConfig_ = + input.readMessage(io.grafeas.v1.BuilderConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(builderConfig_); + builderConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + io.grafeas.v1.Recipe.Builder subBuilder = null; + if (recipe_ != null) { + subBuilder = recipe_.toBuilder(); + } + recipe_ = input.readMessage(io.grafeas.v1.Recipe.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(recipe_); + recipe_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + io.grafeas.v1.Metadata.Builder subBuilder = null; + if (metadata_ != null) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = input.readMessage(io.grafeas.v1.Metadata.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + materials_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + materials_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + materials_ = materials_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.InTotoProvenanceProto + .internal_static_grafeas_v1_InTotoProvenance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.InTotoProvenanceProto + .internal_static_grafeas_v1_InTotoProvenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.InTotoProvenance.class, io.grafeas.v1.InTotoProvenance.Builder.class); + } + + public static final int BUILDER_CONFIG_FIELD_NUMBER = 1; + private io.grafeas.v1.BuilderConfig builderConfig_; + /** + * + * + *
+   * required
+   * 
+ * + * .grafeas.v1.BuilderConfig builder_config = 1; + * + * @return Whether the builderConfig field is set. + */ + @java.lang.Override + public boolean hasBuilderConfig() { + return builderConfig_ != null; + } + /** + * + * + *
+   * required
+   * 
+ * + * .grafeas.v1.BuilderConfig builder_config = 1; + * + * @return The builderConfig. + */ + @java.lang.Override + public io.grafeas.v1.BuilderConfig getBuilderConfig() { + return builderConfig_ == null + ? io.grafeas.v1.BuilderConfig.getDefaultInstance() + : builderConfig_; + } + /** + * + * + *
+   * required
+   * 
+ * + * .grafeas.v1.BuilderConfig builder_config = 1; + */ + @java.lang.Override + public io.grafeas.v1.BuilderConfigOrBuilder getBuilderConfigOrBuilder() { + return getBuilderConfig(); + } + + public static final int RECIPE_FIELD_NUMBER = 2; + private io.grafeas.v1.Recipe recipe_; + /** + * + * + *
+   * Identifies the configuration used for the build.
+   * When combined with materials, this SHOULD fully describe the build,
+   * such that re-running this recipe results in bit-for-bit identical output
+   * (if the build is reproducible).
+   * 
+ * + * .grafeas.v1.Recipe recipe = 2; + * + * @return Whether the recipe field is set. + */ + @java.lang.Override + public boolean hasRecipe() { + return recipe_ != null; + } + /** + * + * + *
+   * Identifies the configuration used for the build.
+   * When combined with materials, this SHOULD fully describe the build,
+   * such that re-running this recipe results in bit-for-bit identical output
+   * (if the build is reproducible).
+   * 
+ * + * .grafeas.v1.Recipe recipe = 2; + * + * @return The recipe. + */ + @java.lang.Override + public io.grafeas.v1.Recipe getRecipe() { + return recipe_ == null ? io.grafeas.v1.Recipe.getDefaultInstance() : recipe_; + } + /** + * + * + *
+   * Identifies the configuration used for the build.
+   * When combined with materials, this SHOULD fully describe the build,
+   * such that re-running this recipe results in bit-for-bit identical output
+   * (if the build is reproducible).
+   * 
+ * + * .grafeas.v1.Recipe recipe = 2; + */ + @java.lang.Override + public io.grafeas.v1.RecipeOrBuilder getRecipeOrBuilder() { + return getRecipe(); + } + + public static final int METADATA_FIELD_NUMBER = 3; + private io.grafeas.v1.Metadata metadata_; + /** + * .grafeas.v1.Metadata metadata = 3; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + * .grafeas.v1.Metadata metadata = 3; + * + * @return The metadata. + */ + @java.lang.Override + public io.grafeas.v1.Metadata getMetadata() { + return metadata_ == null ? io.grafeas.v1.Metadata.getDefaultInstance() : metadata_; + } + /** .grafeas.v1.Metadata metadata = 3; */ + @java.lang.Override + public io.grafeas.v1.MetadataOrBuilder getMetadataOrBuilder() { + return getMetadata(); + } + + public static final int MATERIALS_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList materials_; + /** + * + * + *
+   * The collection of artifacts that influenced the build including sources,
+   * dependencies, build tools, base images, and so on. This is considered to be
+   * incomplete unless metadata.completeness.materials is true. Unset or null is
+   * equivalent to empty.
+   * 
+ * + * repeated string materials = 4; + * + * @return A list containing the materials. + */ + public com.google.protobuf.ProtocolStringList getMaterialsList() { + return materials_; + } + /** + * + * + *
+   * The collection of artifacts that influenced the build including sources,
+   * dependencies, build tools, base images, and so on. This is considered to be
+   * incomplete unless metadata.completeness.materials is true. Unset or null is
+   * equivalent to empty.
+   * 
+ * + * repeated string materials = 4; + * + * @return The count of materials. + */ + public int getMaterialsCount() { + return materials_.size(); + } + /** + * + * + *
+   * The collection of artifacts that influenced the build including sources,
+   * dependencies, build tools, base images, and so on. This is considered to be
+   * incomplete unless metadata.completeness.materials is true. Unset or null is
+   * equivalent to empty.
+   * 
+ * + * repeated string materials = 4; + * + * @param index The index of the element to return. + * @return The materials at the given index. + */ + public java.lang.String getMaterials(int index) { + return materials_.get(index); + } + /** + * + * + *
+   * The collection of artifacts that influenced the build including sources,
+   * dependencies, build tools, base images, and so on. This is considered to be
+   * incomplete unless metadata.completeness.materials is true. Unset or null is
+   * equivalent to empty.
+   * 
+ * + * repeated string materials = 4; + * + * @param index The index of the value to return. + * @return The bytes of the materials at the given index. + */ + public com.google.protobuf.ByteString getMaterialsBytes(int index) { + return materials_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (builderConfig_ != null) { + output.writeMessage(1, getBuilderConfig()); + } + if (recipe_ != null) { + output.writeMessage(2, getRecipe()); + } + if (metadata_ != null) { + output.writeMessage(3, getMetadata()); + } + for (int i = 0; i < materials_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, materials_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (builderConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBuilderConfig()); + } + if (recipe_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRecipe()); + } + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMetadata()); + } + { + int dataSize = 0; + for (int i = 0; i < materials_.size(); i++) { + dataSize += computeStringSizeNoTag(materials_.getRaw(i)); + } + size += dataSize; + size += 1 * getMaterialsList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.InTotoProvenance)) { + return super.equals(obj); + } + io.grafeas.v1.InTotoProvenance other = (io.grafeas.v1.InTotoProvenance) obj; + + if (hasBuilderConfig() != other.hasBuilderConfig()) return false; + if (hasBuilderConfig()) { + if (!getBuilderConfig().equals(other.getBuilderConfig())) return false; + } + if (hasRecipe() != other.hasRecipe()) return false; + if (hasRecipe()) { + if (!getRecipe().equals(other.getRecipe())) return false; + } + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!getMaterialsList().equals(other.getMaterialsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBuilderConfig()) { + hash = (37 * hash) + BUILDER_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getBuilderConfig().hashCode(); + } + if (hasRecipe()) { + hash = (37 * hash) + RECIPE_FIELD_NUMBER; + hash = (53 * hash) + getRecipe().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (getMaterialsCount() > 0) { + hash = (37 * hash) + MATERIALS_FIELD_NUMBER; + hash = (53 * hash) + getMaterialsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.InTotoProvenance parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.InTotoProvenance parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.InTotoProvenance parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.InTotoProvenance parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.InTotoProvenance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.InTotoProvenance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.InTotoProvenance parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.InTotoProvenance parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.InTotoProvenance parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.InTotoProvenance parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.InTotoProvenance parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.InTotoProvenance parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.InTotoProvenance 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code grafeas.v1.InTotoProvenance} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.InTotoProvenance) + io.grafeas.v1.InTotoProvenanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.InTotoProvenanceProto + .internal_static_grafeas_v1_InTotoProvenance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.InTotoProvenanceProto + .internal_static_grafeas_v1_InTotoProvenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.InTotoProvenance.class, io.grafeas.v1.InTotoProvenance.Builder.class); + } + + // Construct using io.grafeas.v1.InTotoProvenance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (builderConfigBuilder_ == null) { + builderConfig_ = null; + } else { + builderConfig_ = null; + builderConfigBuilder_ = null; + } + if (recipeBuilder_ == null) { + recipe_ = null; + } else { + recipe_ = null; + recipeBuilder_ = null; + } + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadata_ = null; + metadataBuilder_ = null; + } + materials_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.InTotoProvenanceProto + .internal_static_grafeas_v1_InTotoProvenance_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.InTotoProvenance getDefaultInstanceForType() { + return io.grafeas.v1.InTotoProvenance.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.InTotoProvenance build() { + io.grafeas.v1.InTotoProvenance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.InTotoProvenance buildPartial() { + io.grafeas.v1.InTotoProvenance result = new io.grafeas.v1.InTotoProvenance(this); + int from_bitField0_ = bitField0_; + if (builderConfigBuilder_ == null) { + result.builderConfig_ = builderConfig_; + } else { + result.builderConfig_ = builderConfigBuilder_.build(); + } + if (recipeBuilder_ == null) { + result.recipe_ = recipe_; + } else { + result.recipe_ = recipeBuilder_.build(); + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + if (((bitField0_ & 0x00000001) != 0)) { + materials_ = materials_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.materials_ = materials_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.InTotoProvenance) { + return mergeFrom((io.grafeas.v1.InTotoProvenance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.InTotoProvenance other) { + if (other == io.grafeas.v1.InTotoProvenance.getDefaultInstance()) return this; + if (other.hasBuilderConfig()) { + mergeBuilderConfig(other.getBuilderConfig()); + } + if (other.hasRecipe()) { + mergeRecipe(other.getRecipe()); + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (!other.materials_.isEmpty()) { + if (materials_.isEmpty()) { + materials_ = other.materials_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMaterialsIsMutable(); + materials_.addAll(other.materials_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.InTotoProvenance parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.InTotoProvenance) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private io.grafeas.v1.BuilderConfig builderConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.BuilderConfig, + io.grafeas.v1.BuilderConfig.Builder, + io.grafeas.v1.BuilderConfigOrBuilder> + builderConfigBuilder_; + /** + * + * + *
+     * required
+     * 
+ * + * .grafeas.v1.BuilderConfig builder_config = 1; + * + * @return Whether the builderConfig field is set. + */ + public boolean hasBuilderConfig() { + return builderConfigBuilder_ != null || builderConfig_ != null; + } + /** + * + * + *
+     * required
+     * 
+ * + * .grafeas.v1.BuilderConfig builder_config = 1; + * + * @return The builderConfig. + */ + public io.grafeas.v1.BuilderConfig getBuilderConfig() { + if (builderConfigBuilder_ == null) { + return builderConfig_ == null + ? io.grafeas.v1.BuilderConfig.getDefaultInstance() + : builderConfig_; + } else { + return builderConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * required
+     * 
+ * + * .grafeas.v1.BuilderConfig builder_config = 1; + */ + public Builder setBuilderConfig(io.grafeas.v1.BuilderConfig value) { + if (builderConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + builderConfig_ = value; + onChanged(); + } else { + builderConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * required
+     * 
+ * + * .grafeas.v1.BuilderConfig builder_config = 1; + */ + public Builder setBuilderConfig(io.grafeas.v1.BuilderConfig.Builder builderForValue) { + if (builderConfigBuilder_ == null) { + builderConfig_ = builderForValue.build(); + onChanged(); + } else { + builderConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * required
+     * 
+ * + * .grafeas.v1.BuilderConfig builder_config = 1; + */ + public Builder mergeBuilderConfig(io.grafeas.v1.BuilderConfig value) { + if (builderConfigBuilder_ == null) { + if (builderConfig_ != null) { + builderConfig_ = + io.grafeas.v1.BuilderConfig.newBuilder(builderConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + builderConfig_ = value; + } + onChanged(); + } else { + builderConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * required
+     * 
+ * + * .grafeas.v1.BuilderConfig builder_config = 1; + */ + public Builder clearBuilderConfig() { + if (builderConfigBuilder_ == null) { + builderConfig_ = null; + onChanged(); + } else { + builderConfig_ = null; + builderConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * required
+     * 
+ * + * .grafeas.v1.BuilderConfig builder_config = 1; + */ + public io.grafeas.v1.BuilderConfig.Builder getBuilderConfigBuilder() { + + onChanged(); + return getBuilderConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * required
+     * 
+ * + * .grafeas.v1.BuilderConfig builder_config = 1; + */ + public io.grafeas.v1.BuilderConfigOrBuilder getBuilderConfigOrBuilder() { + if (builderConfigBuilder_ != null) { + return builderConfigBuilder_.getMessageOrBuilder(); + } else { + return builderConfig_ == null + ? io.grafeas.v1.BuilderConfig.getDefaultInstance() + : builderConfig_; + } + } + /** + * + * + *
+     * required
+     * 
+ * + * .grafeas.v1.BuilderConfig builder_config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.BuilderConfig, + io.grafeas.v1.BuilderConfig.Builder, + io.grafeas.v1.BuilderConfigOrBuilder> + getBuilderConfigFieldBuilder() { + if (builderConfigBuilder_ == null) { + builderConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.BuilderConfig, + io.grafeas.v1.BuilderConfig.Builder, + io.grafeas.v1.BuilderConfigOrBuilder>( + getBuilderConfig(), getParentForChildren(), isClean()); + builderConfig_ = null; + } + return builderConfigBuilder_; + } + + private io.grafeas.v1.Recipe recipe_; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.Recipe, io.grafeas.v1.Recipe.Builder, io.grafeas.v1.RecipeOrBuilder> + recipeBuilder_; + /** + * + * + *
+     * Identifies the configuration used for the build.
+     * When combined with materials, this SHOULD fully describe the build,
+     * such that re-running this recipe results in bit-for-bit identical output
+     * (if the build is reproducible).
+     * 
+ * + * .grafeas.v1.Recipe recipe = 2; + * + * @return Whether the recipe field is set. + */ + public boolean hasRecipe() { + return recipeBuilder_ != null || recipe_ != null; + } + /** + * + * + *
+     * Identifies the configuration used for the build.
+     * When combined with materials, this SHOULD fully describe the build,
+     * such that re-running this recipe results in bit-for-bit identical output
+     * (if the build is reproducible).
+     * 
+ * + * .grafeas.v1.Recipe recipe = 2; + * + * @return The recipe. + */ + public io.grafeas.v1.Recipe getRecipe() { + if (recipeBuilder_ == null) { + return recipe_ == null ? io.grafeas.v1.Recipe.getDefaultInstance() : recipe_; + } else { + return recipeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Identifies the configuration used for the build.
+     * When combined with materials, this SHOULD fully describe the build,
+     * such that re-running this recipe results in bit-for-bit identical output
+     * (if the build is reproducible).
+     * 
+ * + * .grafeas.v1.Recipe recipe = 2; + */ + public Builder setRecipe(io.grafeas.v1.Recipe value) { + if (recipeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + recipe_ = value; + onChanged(); + } else { + recipeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Identifies the configuration used for the build.
+     * When combined with materials, this SHOULD fully describe the build,
+     * such that re-running this recipe results in bit-for-bit identical output
+     * (if the build is reproducible).
+     * 
+ * + * .grafeas.v1.Recipe recipe = 2; + */ + public Builder setRecipe(io.grafeas.v1.Recipe.Builder builderForValue) { + if (recipeBuilder_ == null) { + recipe_ = builderForValue.build(); + onChanged(); + } else { + recipeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Identifies the configuration used for the build.
+     * When combined with materials, this SHOULD fully describe the build,
+     * such that re-running this recipe results in bit-for-bit identical output
+     * (if the build is reproducible).
+     * 
+ * + * .grafeas.v1.Recipe recipe = 2; + */ + public Builder mergeRecipe(io.grafeas.v1.Recipe value) { + if (recipeBuilder_ == null) { + if (recipe_ != null) { + recipe_ = io.grafeas.v1.Recipe.newBuilder(recipe_).mergeFrom(value).buildPartial(); + } else { + recipe_ = value; + } + onChanged(); + } else { + recipeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Identifies the configuration used for the build.
+     * When combined with materials, this SHOULD fully describe the build,
+     * such that re-running this recipe results in bit-for-bit identical output
+     * (if the build is reproducible).
+     * 
+ * + * .grafeas.v1.Recipe recipe = 2; + */ + public Builder clearRecipe() { + if (recipeBuilder_ == null) { + recipe_ = null; + onChanged(); + } else { + recipe_ = null; + recipeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Identifies the configuration used for the build.
+     * When combined with materials, this SHOULD fully describe the build,
+     * such that re-running this recipe results in bit-for-bit identical output
+     * (if the build is reproducible).
+     * 
+ * + * .grafeas.v1.Recipe recipe = 2; + */ + public io.grafeas.v1.Recipe.Builder getRecipeBuilder() { + + onChanged(); + return getRecipeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Identifies the configuration used for the build.
+     * When combined with materials, this SHOULD fully describe the build,
+     * such that re-running this recipe results in bit-for-bit identical output
+     * (if the build is reproducible).
+     * 
+ * + * .grafeas.v1.Recipe recipe = 2; + */ + public io.grafeas.v1.RecipeOrBuilder getRecipeOrBuilder() { + if (recipeBuilder_ != null) { + return recipeBuilder_.getMessageOrBuilder(); + } else { + return recipe_ == null ? io.grafeas.v1.Recipe.getDefaultInstance() : recipe_; + } + } + /** + * + * + *
+     * Identifies the configuration used for the build.
+     * When combined with materials, this SHOULD fully describe the build,
+     * such that re-running this recipe results in bit-for-bit identical output
+     * (if the build is reproducible).
+     * 
+ * + * .grafeas.v1.Recipe recipe = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.Recipe, io.grafeas.v1.Recipe.Builder, io.grafeas.v1.RecipeOrBuilder> + getRecipeFieldBuilder() { + if (recipeBuilder_ == null) { + recipeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.Recipe, io.grafeas.v1.Recipe.Builder, io.grafeas.v1.RecipeOrBuilder>( + getRecipe(), getParentForChildren(), isClean()); + recipe_ = null; + } + return recipeBuilder_; + } + + private io.grafeas.v1.Metadata metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.Metadata, io.grafeas.v1.Metadata.Builder, io.grafeas.v1.MetadataOrBuilder> + metadataBuilder_; + /** + * .grafeas.v1.Metadata metadata = 3; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return metadataBuilder_ != null || metadata_ != null; + } + /** + * .grafeas.v1.Metadata metadata = 3; + * + * @return The metadata. + */ + public io.grafeas.v1.Metadata getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null ? io.grafeas.v1.Metadata.getDefaultInstance() : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** .grafeas.v1.Metadata metadata = 3; */ + public Builder setMetadata(io.grafeas.v1.Metadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + + return this; + } + /** .grafeas.v1.Metadata metadata = 3; */ + public Builder setMetadata(io.grafeas.v1.Metadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** .grafeas.v1.Metadata metadata = 3; */ + public Builder mergeMetadata(io.grafeas.v1.Metadata value) { + if (metadataBuilder_ == null) { + if (metadata_ != null) { + metadata_ = io.grafeas.v1.Metadata.newBuilder(metadata_).mergeFrom(value).buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + + return this; + } + /** .grafeas.v1.Metadata metadata = 3; */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadata_ = null; + metadataBuilder_ = null; + } + + return this; + } + /** .grafeas.v1.Metadata metadata = 3; */ + public io.grafeas.v1.Metadata.Builder getMetadataBuilder() { + + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** .grafeas.v1.Metadata metadata = 3; */ + public io.grafeas.v1.MetadataOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null ? io.grafeas.v1.Metadata.getDefaultInstance() : metadata_; + } + } + /** .grafeas.v1.Metadata metadata = 3; */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.Metadata, io.grafeas.v1.Metadata.Builder, io.grafeas.v1.MetadataOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.Metadata, + io.grafeas.v1.Metadata.Builder, + io.grafeas.v1.MetadataOrBuilder>(getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private com.google.protobuf.LazyStringList materials_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureMaterialsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + materials_ = new com.google.protobuf.LazyStringArrayList(materials_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated string materials = 4; + * + * @return A list containing the materials. + */ + public com.google.protobuf.ProtocolStringList getMaterialsList() { + return materials_.getUnmodifiableView(); + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated string materials = 4; + * + * @return The count of materials. + */ + public int getMaterialsCount() { + return materials_.size(); + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated string materials = 4; + * + * @param index The index of the element to return. + * @return The materials at the given index. + */ + public java.lang.String getMaterials(int index) { + return materials_.get(index); + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated string materials = 4; + * + * @param index The index of the value to return. + * @return The bytes of the materials at the given index. + */ + public com.google.protobuf.ByteString getMaterialsBytes(int index) { + return materials_.getByteString(index); + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated string materials = 4; + * + * @param index The index to set the value at. + * @param value The materials to set. + * @return This builder for chaining. + */ + public Builder setMaterials(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMaterialsIsMutable(); + materials_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated string materials = 4; + * + * @param value The materials to add. + * @return This builder for chaining. + */ + public Builder addMaterials(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMaterialsIsMutable(); + materials_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated string materials = 4; + * + * @param values The materials to add. + * @return This builder for chaining. + */ + public Builder addAllMaterials(java.lang.Iterable values) { + ensureMaterialsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, materials_); + onChanged(); + return this; + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated string materials = 4; + * + * @return This builder for chaining. + */ + public Builder clearMaterials() { + materials_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated string materials = 4; + * + * @param value The bytes of the materials to add. + * @return This builder for chaining. + */ + public Builder addMaterialsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMaterialsIsMutable(); + materials_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.InTotoProvenance) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.InTotoProvenance) + private static final io.grafeas.v1.InTotoProvenance DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.InTotoProvenance(); + } + + public static io.grafeas.v1.InTotoProvenance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InTotoProvenance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new InTotoProvenance(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.InTotoProvenance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/src/main/java/io/grafeas/v1/InTotoProvenanceOrBuilder.java b/src/main/java/io/grafeas/v1/InTotoProvenanceOrBuilder.java new file mode 100644 index 00000000..cbe3e27f --- /dev/null +++ b/src/main/java/io/grafeas/v1/InTotoProvenanceOrBuilder.java @@ -0,0 +1,183 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/intoto_provenance.proto + +package io.grafeas.v1; + +public interface InTotoProvenanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.InTotoProvenance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * required
+   * 
+ * + * .grafeas.v1.BuilderConfig builder_config = 1; + * + * @return Whether the builderConfig field is set. + */ + boolean hasBuilderConfig(); + /** + * + * + *
+   * required
+   * 
+ * + * .grafeas.v1.BuilderConfig builder_config = 1; + * + * @return The builderConfig. + */ + io.grafeas.v1.BuilderConfig getBuilderConfig(); + /** + * + * + *
+   * required
+   * 
+ * + * .grafeas.v1.BuilderConfig builder_config = 1; + */ + io.grafeas.v1.BuilderConfigOrBuilder getBuilderConfigOrBuilder(); + + /** + * + * + *
+   * Identifies the configuration used for the build.
+   * When combined with materials, this SHOULD fully describe the build,
+   * such that re-running this recipe results in bit-for-bit identical output
+   * (if the build is reproducible).
+   * 
+ * + * .grafeas.v1.Recipe recipe = 2; + * + * @return Whether the recipe field is set. + */ + boolean hasRecipe(); + /** + * + * + *
+   * Identifies the configuration used for the build.
+   * When combined with materials, this SHOULD fully describe the build,
+   * such that re-running this recipe results in bit-for-bit identical output
+   * (if the build is reproducible).
+   * 
+ * + * .grafeas.v1.Recipe recipe = 2; + * + * @return The recipe. + */ + io.grafeas.v1.Recipe getRecipe(); + /** + * + * + *
+   * Identifies the configuration used for the build.
+   * When combined with materials, this SHOULD fully describe the build,
+   * such that re-running this recipe results in bit-for-bit identical output
+   * (if the build is reproducible).
+   * 
+ * + * .grafeas.v1.Recipe recipe = 2; + */ + io.grafeas.v1.RecipeOrBuilder getRecipeOrBuilder(); + + /** + * .grafeas.v1.Metadata metadata = 3; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * .grafeas.v1.Metadata metadata = 3; + * + * @return The metadata. + */ + io.grafeas.v1.Metadata getMetadata(); + /** .grafeas.v1.Metadata metadata = 3; */ + io.grafeas.v1.MetadataOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+   * The collection of artifacts that influenced the build including sources,
+   * dependencies, build tools, base images, and so on. This is considered to be
+   * incomplete unless metadata.completeness.materials is true. Unset or null is
+   * equivalent to empty.
+   * 
+ * + * repeated string materials = 4; + * + * @return A list containing the materials. + */ + java.util.List getMaterialsList(); + /** + * + * + *
+   * The collection of artifacts that influenced the build including sources,
+   * dependencies, build tools, base images, and so on. This is considered to be
+   * incomplete unless metadata.completeness.materials is true. Unset or null is
+   * equivalent to empty.
+   * 
+ * + * repeated string materials = 4; + * + * @return The count of materials. + */ + int getMaterialsCount(); + /** + * + * + *
+   * The collection of artifacts that influenced the build including sources,
+   * dependencies, build tools, base images, and so on. This is considered to be
+   * incomplete unless metadata.completeness.materials is true. Unset or null is
+   * equivalent to empty.
+   * 
+ * + * repeated string materials = 4; + * + * @param index The index of the element to return. + * @return The materials at the given index. + */ + java.lang.String getMaterials(int index); + /** + * + * + *
+   * The collection of artifacts that influenced the build including sources,
+   * dependencies, build tools, base images, and so on. This is considered to be
+   * incomplete unless metadata.completeness.materials is true. Unset or null is
+   * equivalent to empty.
+   * 
+ * + * repeated string materials = 4; + * + * @param index The index of the value to return. + * @return The bytes of the materials at the given index. + */ + com.google.protobuf.ByteString getMaterialsBytes(int index); +} diff --git a/src/main/java/io/grafeas/v1/InTotoProvenanceProto.java b/src/main/java/io/grafeas/v1/InTotoProvenanceProto.java new file mode 100644 index 00000000..361e3086 --- /dev/null +++ b/src/main/java/io/grafeas/v1/InTotoProvenanceProto.java @@ -0,0 +1,135 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/intoto_provenance.proto + +package io.grafeas.v1; + +public final class InTotoProvenanceProto { + private InTotoProvenanceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_Recipe_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_Recipe_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_Completeness_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_Completeness_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_Metadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_Metadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_BuilderConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_BuilderConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_InTotoProvenance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_InTotoProvenance_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\"grafeas/v1/intoto_provenance.proto\022\ngr" + + "afeas.v1\032\031google/protobuf/any.proto\032\037goo" + + "gle/protobuf/timestamp.proto\"\234\001\n\006Recipe\022" + + "\014\n\004type\030\001 \001(\t\022\033\n\023defined_in_material\030\002 \001" + + "(\003\022\023\n\013entry_point\030\003 \001(\t\022\'\n\targuments\030\004 \003" + + "(\0132\024.google.protobuf.Any\022)\n\013environment\030" + + "\005 \003(\0132\024.google.protobuf.Any\"I\n\014Completen" + + "ess\022\021\n\targuments\030\001 \001(\010\022\023\n\013environment\030\002 " + + "\001(\010\022\021\n\tmaterials\030\003 \001(\010\"\332\001\n\010Metadata\022\033\n\023b" + + "uild_invocation_id\030\001 \001(\t\0224\n\020build_starte" + + "d_on\030\002 \001(\0132\032.google.protobuf.Timestamp\0225" + + "\n\021build_finished_on\030\003 \001(\0132\032.google.proto" + + "buf.Timestamp\022.\n\014completeness\030\004 \001(\0132\030.gr" + + "afeas.v1.Completeness\022\024\n\014reproducible\030\005 " + + "\001(\010\"\033\n\rBuilderConfig\022\n\n\002id\030\001 \001(\t\"\244\001\n\020InT" + + "otoProvenance\0221\n\016builder_config\030\001 \001(\0132\031." + + "grafeas.v1.BuilderConfig\022\"\n\006recipe\030\002 \001(\013" + + "2\022.grafeas.v1.Recipe\022&\n\010metadata\030\003 \001(\0132\024" + + ".grafeas.v1.Metadata\022\021\n\tmaterials\030\004 \003(\tB" + + "h\n\rio.grafeas.v1B\025InTotoProvenanceProtoP" + + "\001Z8google.golang.org/genproto/googleapis" + + "/grafeas/v1;grafeas\242\002\003GRAb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.AnyProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_grafeas_v1_Recipe_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_grafeas_v1_Recipe_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_Recipe_descriptor, + new java.lang.String[] { + "Type", "DefinedInMaterial", "EntryPoint", "Arguments", "Environment", + }); + internal_static_grafeas_v1_Completeness_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_grafeas_v1_Completeness_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_Completeness_descriptor, + new java.lang.String[] { + "Arguments", "Environment", "Materials", + }); + internal_static_grafeas_v1_Metadata_descriptor = getDescriptor().getMessageTypes().get(2); + internal_static_grafeas_v1_Metadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_Metadata_descriptor, + new java.lang.String[] { + "BuildInvocationId", + "BuildStartedOn", + "BuildFinishedOn", + "Completeness", + "Reproducible", + }); + internal_static_grafeas_v1_BuilderConfig_descriptor = getDescriptor().getMessageTypes().get(3); + internal_static_grafeas_v1_BuilderConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_BuilderConfig_descriptor, + new java.lang.String[] { + "Id", + }); + internal_static_grafeas_v1_InTotoProvenance_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_grafeas_v1_InTotoProvenance_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_InTotoProvenance_descriptor, + new java.lang.String[] { + "BuilderConfig", "Recipe", "Metadata", "Materials", + }); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/io/grafeas/v1/InTotoStatement.java b/src/main/java/io/grafeas/v1/InTotoStatement.java new file mode 100644 index 00000000..8c0a2fa8 --- /dev/null +++ b/src/main/java/io/grafeas/v1/InTotoStatement.java @@ -0,0 +1,1606 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/intoto_statement.proto + +package io.grafeas.v1; + +/** + * + * + *
+ * Spec defined at
+ * https://github.com/in-toto/attestation/tree/main/spec#statement The
+ * serialized InTotoStatement will be stored as Envelope.payload.
+ * Envelope.payloadType is always "application/vnd.in-toto+json".
+ * 
+ * + * Protobuf type {@code grafeas.v1.InTotoStatement} + */ +public final class InTotoStatement extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.InTotoStatement) + InTotoStatementOrBuilder { + private static final long serialVersionUID = 0L; + // Use InTotoStatement.newBuilder() to construct. + private InTotoStatement(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InTotoStatement() { + type_ = ""; + subject_ = java.util.Collections.emptyList(); + predicateType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InTotoStatement(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private InTotoStatement( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + subject_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + subject_.add(input.readMessage(io.grafeas.v1.Subject.parser(), extensionRegistry)); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + predicateType_ = s; + break; + } + case 34: + { + io.grafeas.v1.InTotoProvenance.Builder subBuilder = null; + if (predicateCase_ == 4) { + subBuilder = ((io.grafeas.v1.InTotoProvenance) predicate_).toBuilder(); + } + predicate_ = + input.readMessage(io.grafeas.v1.InTotoProvenance.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1.InTotoProvenance) predicate_); + predicate_ = subBuilder.buildPartial(); + } + predicateCase_ = 4; + break; + } + case 42: + { + io.grafeas.v1.SlsaProvenance.Builder subBuilder = null; + if (predicateCase_ == 5) { + subBuilder = ((io.grafeas.v1.SlsaProvenance) predicate_).toBuilder(); + } + predicate_ = + input.readMessage(io.grafeas.v1.SlsaProvenance.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1.SlsaProvenance) predicate_); + predicate_ = subBuilder.buildPartial(); + } + predicateCase_ = 5; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + subject_ = java.util.Collections.unmodifiableList(subject_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.InTotoStatementProto.internal_static_grafeas_v1_InTotoStatement_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.InTotoStatementProto + .internal_static_grafeas_v1_InTotoStatement_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.InTotoStatement.class, io.grafeas.v1.InTotoStatement.Builder.class); + } + + private int predicateCase_ = 0; + private java.lang.Object predicate_; + + public enum PredicateCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PROVENANCE(4), + SLSA_PROVENANCE(5), + PREDICATE_NOT_SET(0); + private final int value; + + private PredicateCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PredicateCase valueOf(int value) { + return forNumber(value); + } + + public static PredicateCase forNumber(int value) { + switch (value) { + case 4: + return PROVENANCE; + case 5: + return SLSA_PROVENANCE; + case 0: + return PREDICATE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PredicateCase getPredicateCase() { + return PredicateCase.forNumber(predicateCase_); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object type_; + /** + * + * + *
+   * Always `https://in-toto.io/Statement/v0.1`.
+   * 
+ * + * string type = 1 [json_name = "_type"]; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + 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(); + type_ = s; + return s; + } + } + /** + * + * + *
+   * Always `https://in-toto.io/Statement/v0.1`.
+   * 
+ * + * string type = 1 [json_name = "_type"]; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SUBJECT_FIELD_NUMBER = 2; + private java.util.List subject_; + /** repeated .grafeas.v1.Subject subject = 2; */ + @java.lang.Override + public java.util.List getSubjectList() { + return subject_; + } + /** repeated .grafeas.v1.Subject subject = 2; */ + @java.lang.Override + public java.util.List getSubjectOrBuilderList() { + return subject_; + } + /** repeated .grafeas.v1.Subject subject = 2; */ + @java.lang.Override + public int getSubjectCount() { + return subject_.size(); + } + /** repeated .grafeas.v1.Subject subject = 2; */ + @java.lang.Override + public io.grafeas.v1.Subject getSubject(int index) { + return subject_.get(index); + } + /** repeated .grafeas.v1.Subject subject = 2; */ + @java.lang.Override + public io.grafeas.v1.SubjectOrBuilder getSubjectOrBuilder(int index) { + return subject_.get(index); + } + + public static final int PREDICATE_TYPE_FIELD_NUMBER = 3; + private volatile java.lang.Object predicateType_; + /** + * + * + *
+   * `https://slsa.dev/provenance/v0.1` for SlsaProvenance.
+   * 
+ * + * string predicate_type = 3; + * + * @return The predicateType. + */ + @java.lang.Override + public java.lang.String getPredicateType() { + java.lang.Object ref = predicateType_; + 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(); + predicateType_ = s; + return s; + } + } + /** + * + * + *
+   * `https://slsa.dev/provenance/v0.1` for SlsaProvenance.
+   * 
+ * + * string predicate_type = 3; + * + * @return The bytes for predicateType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPredicateTypeBytes() { + java.lang.Object ref = predicateType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + predicateType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROVENANCE_FIELD_NUMBER = 4; + /** + * .grafeas.v1.InTotoProvenance provenance = 4; + * + * @return Whether the provenance field is set. + */ + @java.lang.Override + public boolean hasProvenance() { + return predicateCase_ == 4; + } + /** + * .grafeas.v1.InTotoProvenance provenance = 4; + * + * @return The provenance. + */ + @java.lang.Override + public io.grafeas.v1.InTotoProvenance getProvenance() { + if (predicateCase_ == 4) { + return (io.grafeas.v1.InTotoProvenance) predicate_; + } + return io.grafeas.v1.InTotoProvenance.getDefaultInstance(); + } + /** .grafeas.v1.InTotoProvenance provenance = 4; */ + @java.lang.Override + public io.grafeas.v1.InTotoProvenanceOrBuilder getProvenanceOrBuilder() { + if (predicateCase_ == 4) { + return (io.grafeas.v1.InTotoProvenance) predicate_; + } + return io.grafeas.v1.InTotoProvenance.getDefaultInstance(); + } + + public static final int SLSA_PROVENANCE_FIELD_NUMBER = 5; + /** + * .grafeas.v1.SlsaProvenance slsa_provenance = 5; + * + * @return Whether the slsaProvenance field is set. + */ + @java.lang.Override + public boolean hasSlsaProvenance() { + return predicateCase_ == 5; + } + /** + * .grafeas.v1.SlsaProvenance slsa_provenance = 5; + * + * @return The slsaProvenance. + */ + @java.lang.Override + public io.grafeas.v1.SlsaProvenance getSlsaProvenance() { + if (predicateCase_ == 5) { + return (io.grafeas.v1.SlsaProvenance) predicate_; + } + return io.grafeas.v1.SlsaProvenance.getDefaultInstance(); + } + /** .grafeas.v1.SlsaProvenance slsa_provenance = 5; */ + @java.lang.Override + public io.grafeas.v1.SlsaProvenanceOrBuilder getSlsaProvenanceOrBuilder() { + if (predicateCase_ == 5) { + return (io.grafeas.v1.SlsaProvenance) predicate_; + } + return io.grafeas.v1.SlsaProvenance.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); + } + for (int i = 0; i < subject_.size(); i++) { + output.writeMessage(2, subject_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(predicateType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, predicateType_); + } + if (predicateCase_ == 4) { + output.writeMessage(4, (io.grafeas.v1.InTotoProvenance) predicate_); + } + if (predicateCase_ == 5) { + output.writeMessage(5, (io.grafeas.v1.SlsaProvenance) predicate_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); + } + for (int i = 0; i < subject_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, subject_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(predicateType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, predicateType_); + } + if (predicateCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (io.grafeas.v1.InTotoProvenance) predicate_); + } + if (predicateCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (io.grafeas.v1.SlsaProvenance) predicate_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.InTotoStatement)) { + return super.equals(obj); + } + io.grafeas.v1.InTotoStatement other = (io.grafeas.v1.InTotoStatement) obj; + + if (!getType().equals(other.getType())) return false; + if (!getSubjectList().equals(other.getSubjectList())) return false; + if (!getPredicateType().equals(other.getPredicateType())) return false; + if (!getPredicateCase().equals(other.getPredicateCase())) return false; + switch (predicateCase_) { + case 4: + if (!getProvenance().equals(other.getProvenance())) return false; + break; + case 5: + if (!getSlsaProvenance().equals(other.getSlsaProvenance())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + if (getSubjectCount() > 0) { + hash = (37 * hash) + SUBJECT_FIELD_NUMBER; + hash = (53 * hash) + getSubjectList().hashCode(); + } + hash = (37 * hash) + PREDICATE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getPredicateType().hashCode(); + switch (predicateCase_) { + case 4: + hash = (37 * hash) + PROVENANCE_FIELD_NUMBER; + hash = (53 * hash) + getProvenance().hashCode(); + break; + case 5: + hash = (37 * hash) + SLSA_PROVENANCE_FIELD_NUMBER; + hash = (53 * hash) + getSlsaProvenance().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.InTotoStatement parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.InTotoStatement parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.InTotoStatement parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.InTotoStatement parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.InTotoStatement parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.InTotoStatement parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.InTotoStatement parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.InTotoStatement parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.InTotoStatement parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.InTotoStatement parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.InTotoStatement parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.InTotoStatement parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.InTotoStatement 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Spec defined at
+   * https://github.com/in-toto/attestation/tree/main/spec#statement The
+   * serialized InTotoStatement will be stored as Envelope.payload.
+   * Envelope.payloadType is always "application/vnd.in-toto+json".
+   * 
+ * + * Protobuf type {@code grafeas.v1.InTotoStatement} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.InTotoStatement) + io.grafeas.v1.InTotoStatementOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.InTotoStatementProto + .internal_static_grafeas_v1_InTotoStatement_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.InTotoStatementProto + .internal_static_grafeas_v1_InTotoStatement_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.InTotoStatement.class, io.grafeas.v1.InTotoStatement.Builder.class); + } + + // Construct using io.grafeas.v1.InTotoStatement.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSubjectFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = ""; + + if (subjectBuilder_ == null) { + subject_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + subjectBuilder_.clear(); + } + predicateType_ = ""; + + predicateCase_ = 0; + predicate_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.InTotoStatementProto + .internal_static_grafeas_v1_InTotoStatement_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.InTotoStatement getDefaultInstanceForType() { + return io.grafeas.v1.InTotoStatement.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.InTotoStatement build() { + io.grafeas.v1.InTotoStatement result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.InTotoStatement buildPartial() { + io.grafeas.v1.InTotoStatement result = new io.grafeas.v1.InTotoStatement(this); + int from_bitField0_ = bitField0_; + result.type_ = type_; + if (subjectBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + subject_ = java.util.Collections.unmodifiableList(subject_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.subject_ = subject_; + } else { + result.subject_ = subjectBuilder_.build(); + } + result.predicateType_ = predicateType_; + if (predicateCase_ == 4) { + if (provenanceBuilder_ == null) { + result.predicate_ = predicate_; + } else { + result.predicate_ = provenanceBuilder_.build(); + } + } + if (predicateCase_ == 5) { + if (slsaProvenanceBuilder_ == null) { + result.predicate_ = predicate_; + } else { + result.predicate_ = slsaProvenanceBuilder_.build(); + } + } + result.predicateCase_ = predicateCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.InTotoStatement) { + return mergeFrom((io.grafeas.v1.InTotoStatement) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.InTotoStatement other) { + if (other == io.grafeas.v1.InTotoStatement.getDefaultInstance()) return this; + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (subjectBuilder_ == null) { + if (!other.subject_.isEmpty()) { + if (subject_.isEmpty()) { + subject_ = other.subject_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSubjectIsMutable(); + subject_.addAll(other.subject_); + } + onChanged(); + } + } else { + if (!other.subject_.isEmpty()) { + if (subjectBuilder_.isEmpty()) { + subjectBuilder_.dispose(); + subjectBuilder_ = null; + subject_ = other.subject_; + bitField0_ = (bitField0_ & ~0x00000001); + subjectBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSubjectFieldBuilder() + : null; + } else { + subjectBuilder_.addAllMessages(other.subject_); + } + } + } + if (!other.getPredicateType().isEmpty()) { + predicateType_ = other.predicateType_; + onChanged(); + } + switch (other.getPredicateCase()) { + case PROVENANCE: + { + mergeProvenance(other.getProvenance()); + break; + } + case SLSA_PROVENANCE: + { + mergeSlsaProvenance(other.getSlsaProvenance()); + break; + } + case PREDICATE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.InTotoStatement parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.InTotoStatement) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int predicateCase_ = 0; + private java.lang.Object predicate_; + + public PredicateCase getPredicateCase() { + return PredicateCase.forNumber(predicateCase_); + } + + public Builder clearPredicate() { + predicateCase_ = 0; + predicate_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * Always `https://in-toto.io/Statement/v0.1`.
+     * 
+ * + * string type = 1 [json_name = "_type"]; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Always `https://in-toto.io/Statement/v0.1`.
+     * 
+ * + * string type = 1 [json_name = "_type"]; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Always `https://in-toto.io/Statement/v0.1`.
+     * 
+ * + * string type = 1 [json_name = "_type"]; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Always `https://in-toto.io/Statement/v0.1`.
+     * 
+ * + * string type = 1 [json_name = "_type"]; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Always `https://in-toto.io/Statement/v0.1`.
+     * 
+ * + * string type = 1 [json_name = "_type"]; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private java.util.List subject_ = java.util.Collections.emptyList(); + + private void ensureSubjectIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + subject_ = new java.util.ArrayList(subject_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1.Subject, io.grafeas.v1.Subject.Builder, io.grafeas.v1.SubjectOrBuilder> + subjectBuilder_; + + /** repeated .grafeas.v1.Subject subject = 2; */ + public java.util.List getSubjectList() { + if (subjectBuilder_ == null) { + return java.util.Collections.unmodifiableList(subject_); + } else { + return subjectBuilder_.getMessageList(); + } + } + /** repeated .grafeas.v1.Subject subject = 2; */ + public int getSubjectCount() { + if (subjectBuilder_ == null) { + return subject_.size(); + } else { + return subjectBuilder_.getCount(); + } + } + /** repeated .grafeas.v1.Subject subject = 2; */ + public io.grafeas.v1.Subject getSubject(int index) { + if (subjectBuilder_ == null) { + return subject_.get(index); + } else { + return subjectBuilder_.getMessage(index); + } + } + /** repeated .grafeas.v1.Subject subject = 2; */ + public Builder setSubject(int index, io.grafeas.v1.Subject value) { + if (subjectBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubjectIsMutable(); + subject_.set(index, value); + onChanged(); + } else { + subjectBuilder_.setMessage(index, value); + } + return this; + } + /** repeated .grafeas.v1.Subject subject = 2; */ + public Builder setSubject(int index, io.grafeas.v1.Subject.Builder builderForValue) { + if (subjectBuilder_ == null) { + ensureSubjectIsMutable(); + subject_.set(index, builderForValue.build()); + onChanged(); + } else { + subjectBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** repeated .grafeas.v1.Subject subject = 2; */ + public Builder addSubject(io.grafeas.v1.Subject value) { + if (subjectBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubjectIsMutable(); + subject_.add(value); + onChanged(); + } else { + subjectBuilder_.addMessage(value); + } + return this; + } + /** repeated .grafeas.v1.Subject subject = 2; */ + public Builder addSubject(int index, io.grafeas.v1.Subject value) { + if (subjectBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubjectIsMutable(); + subject_.add(index, value); + onChanged(); + } else { + subjectBuilder_.addMessage(index, value); + } + return this; + } + /** repeated .grafeas.v1.Subject subject = 2; */ + public Builder addSubject(io.grafeas.v1.Subject.Builder builderForValue) { + if (subjectBuilder_ == null) { + ensureSubjectIsMutable(); + subject_.add(builderForValue.build()); + onChanged(); + } else { + subjectBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** repeated .grafeas.v1.Subject subject = 2; */ + public Builder addSubject(int index, io.grafeas.v1.Subject.Builder builderForValue) { + if (subjectBuilder_ == null) { + ensureSubjectIsMutable(); + subject_.add(index, builderForValue.build()); + onChanged(); + } else { + subjectBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** repeated .grafeas.v1.Subject subject = 2; */ + public Builder addAllSubject(java.lang.Iterable values) { + if (subjectBuilder_ == null) { + ensureSubjectIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, subject_); + onChanged(); + } else { + subjectBuilder_.addAllMessages(values); + } + return this; + } + /** repeated .grafeas.v1.Subject subject = 2; */ + public Builder clearSubject() { + if (subjectBuilder_ == null) { + subject_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + subjectBuilder_.clear(); + } + return this; + } + /** repeated .grafeas.v1.Subject subject = 2; */ + public Builder removeSubject(int index) { + if (subjectBuilder_ == null) { + ensureSubjectIsMutable(); + subject_.remove(index); + onChanged(); + } else { + subjectBuilder_.remove(index); + } + return this; + } + /** repeated .grafeas.v1.Subject subject = 2; */ + public io.grafeas.v1.Subject.Builder getSubjectBuilder(int index) { + return getSubjectFieldBuilder().getBuilder(index); + } + /** repeated .grafeas.v1.Subject subject = 2; */ + public io.grafeas.v1.SubjectOrBuilder getSubjectOrBuilder(int index) { + if (subjectBuilder_ == null) { + return subject_.get(index); + } else { + return subjectBuilder_.getMessageOrBuilder(index); + } + } + /** repeated .grafeas.v1.Subject subject = 2; */ + public java.util.List getSubjectOrBuilderList() { + if (subjectBuilder_ != null) { + return subjectBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(subject_); + } + } + /** repeated .grafeas.v1.Subject subject = 2; */ + public io.grafeas.v1.Subject.Builder addSubjectBuilder() { + return getSubjectFieldBuilder().addBuilder(io.grafeas.v1.Subject.getDefaultInstance()); + } + /** repeated .grafeas.v1.Subject subject = 2; */ + public io.grafeas.v1.Subject.Builder addSubjectBuilder(int index) { + return getSubjectFieldBuilder().addBuilder(index, io.grafeas.v1.Subject.getDefaultInstance()); + } + /** repeated .grafeas.v1.Subject subject = 2; */ + public java.util.List getSubjectBuilderList() { + return getSubjectFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1.Subject, io.grafeas.v1.Subject.Builder, io.grafeas.v1.SubjectOrBuilder> + getSubjectFieldBuilder() { + if (subjectBuilder_ == null) { + subjectBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1.Subject, + io.grafeas.v1.Subject.Builder, + io.grafeas.v1.SubjectOrBuilder>( + subject_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + subject_ = null; + } + return subjectBuilder_; + } + + private java.lang.Object predicateType_ = ""; + /** + * + * + *
+     * `https://slsa.dev/provenance/v0.1` for SlsaProvenance.
+     * 
+ * + * string predicate_type = 3; + * + * @return The predicateType. + */ + public java.lang.String getPredicateType() { + java.lang.Object ref = predicateType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + predicateType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * `https://slsa.dev/provenance/v0.1` for SlsaProvenance.
+     * 
+ * + * string predicate_type = 3; + * + * @return The bytes for predicateType. + */ + public com.google.protobuf.ByteString getPredicateTypeBytes() { + java.lang.Object ref = predicateType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + predicateType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * `https://slsa.dev/provenance/v0.1` for SlsaProvenance.
+     * 
+ * + * string predicate_type = 3; + * + * @param value The predicateType to set. + * @return This builder for chaining. + */ + public Builder setPredicateType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + predicateType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * `https://slsa.dev/provenance/v0.1` for SlsaProvenance.
+     * 
+ * + * string predicate_type = 3; + * + * @return This builder for chaining. + */ + public Builder clearPredicateType() { + + predicateType_ = getDefaultInstance().getPredicateType(); + onChanged(); + return this; + } + /** + * + * + *
+     * `https://slsa.dev/provenance/v0.1` for SlsaProvenance.
+     * 
+ * + * string predicate_type = 3; + * + * @param value The bytes for predicateType to set. + * @return This builder for chaining. + */ + public Builder setPredicateTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + predicateType_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.InTotoProvenance, + io.grafeas.v1.InTotoProvenance.Builder, + io.grafeas.v1.InTotoProvenanceOrBuilder> + provenanceBuilder_; + /** + * .grafeas.v1.InTotoProvenance provenance = 4; + * + * @return Whether the provenance field is set. + */ + @java.lang.Override + public boolean hasProvenance() { + return predicateCase_ == 4; + } + /** + * .grafeas.v1.InTotoProvenance provenance = 4; + * + * @return The provenance. + */ + @java.lang.Override + public io.grafeas.v1.InTotoProvenance getProvenance() { + if (provenanceBuilder_ == null) { + if (predicateCase_ == 4) { + return (io.grafeas.v1.InTotoProvenance) predicate_; + } + return io.grafeas.v1.InTotoProvenance.getDefaultInstance(); + } else { + if (predicateCase_ == 4) { + return provenanceBuilder_.getMessage(); + } + return io.grafeas.v1.InTotoProvenance.getDefaultInstance(); + } + } + /** .grafeas.v1.InTotoProvenance provenance = 4; */ + public Builder setProvenance(io.grafeas.v1.InTotoProvenance value) { + if (provenanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + predicate_ = value; + onChanged(); + } else { + provenanceBuilder_.setMessage(value); + } + predicateCase_ = 4; + return this; + } + /** .grafeas.v1.InTotoProvenance provenance = 4; */ + public Builder setProvenance(io.grafeas.v1.InTotoProvenance.Builder builderForValue) { + if (provenanceBuilder_ == null) { + predicate_ = builderForValue.build(); + onChanged(); + } else { + provenanceBuilder_.setMessage(builderForValue.build()); + } + predicateCase_ = 4; + return this; + } + /** .grafeas.v1.InTotoProvenance provenance = 4; */ + public Builder mergeProvenance(io.grafeas.v1.InTotoProvenance value) { + if (provenanceBuilder_ == null) { + if (predicateCase_ == 4 + && predicate_ != io.grafeas.v1.InTotoProvenance.getDefaultInstance()) { + predicate_ = + io.grafeas.v1.InTotoProvenance.newBuilder((io.grafeas.v1.InTotoProvenance) predicate_) + .mergeFrom(value) + .buildPartial(); + } else { + predicate_ = value; + } + onChanged(); + } else { + if (predicateCase_ == 4) { + provenanceBuilder_.mergeFrom(value); + } + provenanceBuilder_.setMessage(value); + } + predicateCase_ = 4; + return this; + } + /** .grafeas.v1.InTotoProvenance provenance = 4; */ + public Builder clearProvenance() { + if (provenanceBuilder_ == null) { + if (predicateCase_ == 4) { + predicateCase_ = 0; + predicate_ = null; + onChanged(); + } + } else { + if (predicateCase_ == 4) { + predicateCase_ = 0; + predicate_ = null; + } + provenanceBuilder_.clear(); + } + return this; + } + /** .grafeas.v1.InTotoProvenance provenance = 4; */ + public io.grafeas.v1.InTotoProvenance.Builder getProvenanceBuilder() { + return getProvenanceFieldBuilder().getBuilder(); + } + /** .grafeas.v1.InTotoProvenance provenance = 4; */ + @java.lang.Override + public io.grafeas.v1.InTotoProvenanceOrBuilder getProvenanceOrBuilder() { + if ((predicateCase_ == 4) && (provenanceBuilder_ != null)) { + return provenanceBuilder_.getMessageOrBuilder(); + } else { + if (predicateCase_ == 4) { + return (io.grafeas.v1.InTotoProvenance) predicate_; + } + return io.grafeas.v1.InTotoProvenance.getDefaultInstance(); + } + } + /** .grafeas.v1.InTotoProvenance provenance = 4; */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.InTotoProvenance, + io.grafeas.v1.InTotoProvenance.Builder, + io.grafeas.v1.InTotoProvenanceOrBuilder> + getProvenanceFieldBuilder() { + if (provenanceBuilder_ == null) { + if (!(predicateCase_ == 4)) { + predicate_ = io.grafeas.v1.InTotoProvenance.getDefaultInstance(); + } + provenanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.InTotoProvenance, + io.grafeas.v1.InTotoProvenance.Builder, + io.grafeas.v1.InTotoProvenanceOrBuilder>( + (io.grafeas.v1.InTotoProvenance) predicate_, getParentForChildren(), isClean()); + predicate_ = null; + } + predicateCase_ = 4; + onChanged(); + ; + return provenanceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.SlsaProvenance, + io.grafeas.v1.SlsaProvenance.Builder, + io.grafeas.v1.SlsaProvenanceOrBuilder> + slsaProvenanceBuilder_; + /** + * .grafeas.v1.SlsaProvenance slsa_provenance = 5; + * + * @return Whether the slsaProvenance field is set. + */ + @java.lang.Override + public boolean hasSlsaProvenance() { + return predicateCase_ == 5; + } + /** + * .grafeas.v1.SlsaProvenance slsa_provenance = 5; + * + * @return The slsaProvenance. + */ + @java.lang.Override + public io.grafeas.v1.SlsaProvenance getSlsaProvenance() { + if (slsaProvenanceBuilder_ == null) { + if (predicateCase_ == 5) { + return (io.grafeas.v1.SlsaProvenance) predicate_; + } + return io.grafeas.v1.SlsaProvenance.getDefaultInstance(); + } else { + if (predicateCase_ == 5) { + return slsaProvenanceBuilder_.getMessage(); + } + return io.grafeas.v1.SlsaProvenance.getDefaultInstance(); + } + } + /** .grafeas.v1.SlsaProvenance slsa_provenance = 5; */ + public Builder setSlsaProvenance(io.grafeas.v1.SlsaProvenance value) { + if (slsaProvenanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + predicate_ = value; + onChanged(); + } else { + slsaProvenanceBuilder_.setMessage(value); + } + predicateCase_ = 5; + return this; + } + /** .grafeas.v1.SlsaProvenance slsa_provenance = 5; */ + public Builder setSlsaProvenance(io.grafeas.v1.SlsaProvenance.Builder builderForValue) { + if (slsaProvenanceBuilder_ == null) { + predicate_ = builderForValue.build(); + onChanged(); + } else { + slsaProvenanceBuilder_.setMessage(builderForValue.build()); + } + predicateCase_ = 5; + return this; + } + /** .grafeas.v1.SlsaProvenance slsa_provenance = 5; */ + public Builder mergeSlsaProvenance(io.grafeas.v1.SlsaProvenance value) { + if (slsaProvenanceBuilder_ == null) { + if (predicateCase_ == 5 + && predicate_ != io.grafeas.v1.SlsaProvenance.getDefaultInstance()) { + predicate_ = + io.grafeas.v1.SlsaProvenance.newBuilder((io.grafeas.v1.SlsaProvenance) predicate_) + .mergeFrom(value) + .buildPartial(); + } else { + predicate_ = value; + } + onChanged(); + } else { + if (predicateCase_ == 5) { + slsaProvenanceBuilder_.mergeFrom(value); + } + slsaProvenanceBuilder_.setMessage(value); + } + predicateCase_ = 5; + return this; + } + /** .grafeas.v1.SlsaProvenance slsa_provenance = 5; */ + public Builder clearSlsaProvenance() { + if (slsaProvenanceBuilder_ == null) { + if (predicateCase_ == 5) { + predicateCase_ = 0; + predicate_ = null; + onChanged(); + } + } else { + if (predicateCase_ == 5) { + predicateCase_ = 0; + predicate_ = null; + } + slsaProvenanceBuilder_.clear(); + } + return this; + } + /** .grafeas.v1.SlsaProvenance slsa_provenance = 5; */ + public io.grafeas.v1.SlsaProvenance.Builder getSlsaProvenanceBuilder() { + return getSlsaProvenanceFieldBuilder().getBuilder(); + } + /** .grafeas.v1.SlsaProvenance slsa_provenance = 5; */ + @java.lang.Override + public io.grafeas.v1.SlsaProvenanceOrBuilder getSlsaProvenanceOrBuilder() { + if ((predicateCase_ == 5) && (slsaProvenanceBuilder_ != null)) { + return slsaProvenanceBuilder_.getMessageOrBuilder(); + } else { + if (predicateCase_ == 5) { + return (io.grafeas.v1.SlsaProvenance) predicate_; + } + return io.grafeas.v1.SlsaProvenance.getDefaultInstance(); + } + } + /** .grafeas.v1.SlsaProvenance slsa_provenance = 5; */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.SlsaProvenance, + io.grafeas.v1.SlsaProvenance.Builder, + io.grafeas.v1.SlsaProvenanceOrBuilder> + getSlsaProvenanceFieldBuilder() { + if (slsaProvenanceBuilder_ == null) { + if (!(predicateCase_ == 5)) { + predicate_ = io.grafeas.v1.SlsaProvenance.getDefaultInstance(); + } + slsaProvenanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.SlsaProvenance, + io.grafeas.v1.SlsaProvenance.Builder, + io.grafeas.v1.SlsaProvenanceOrBuilder>( + (io.grafeas.v1.SlsaProvenance) predicate_, getParentForChildren(), isClean()); + predicate_ = null; + } + predicateCase_ = 5; + onChanged(); + ; + return slsaProvenanceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.InTotoStatement) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.InTotoStatement) + private static final io.grafeas.v1.InTotoStatement DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.InTotoStatement(); + } + + public static io.grafeas.v1.InTotoStatement getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InTotoStatement parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new InTotoStatement(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.InTotoStatement getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/src/main/java/io/grafeas/v1/InTotoStatementOrBuilder.java b/src/main/java/io/grafeas/v1/InTotoStatementOrBuilder.java new file mode 100644 index 00000000..0d45b314 --- /dev/null +++ b/src/main/java/io/grafeas/v1/InTotoStatementOrBuilder.java @@ -0,0 +1,119 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/intoto_statement.proto + +package io.grafeas.v1; + +public interface InTotoStatementOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.InTotoStatement) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Always `https://in-toto.io/Statement/v0.1`.
+   * 
+ * + * string type = 1 [json_name = "_type"]; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * Always `https://in-toto.io/Statement/v0.1`.
+   * 
+ * + * string type = 1 [json_name = "_type"]; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** repeated .grafeas.v1.Subject subject = 2; */ + java.util.List getSubjectList(); + /** repeated .grafeas.v1.Subject subject = 2; */ + io.grafeas.v1.Subject getSubject(int index); + /** repeated .grafeas.v1.Subject subject = 2; */ + int getSubjectCount(); + /** repeated .grafeas.v1.Subject subject = 2; */ + java.util.List getSubjectOrBuilderList(); + /** repeated .grafeas.v1.Subject subject = 2; */ + io.grafeas.v1.SubjectOrBuilder getSubjectOrBuilder(int index); + + /** + * + * + *
+   * `https://slsa.dev/provenance/v0.1` for SlsaProvenance.
+   * 
+ * + * string predicate_type = 3; + * + * @return The predicateType. + */ + java.lang.String getPredicateType(); + /** + * + * + *
+   * `https://slsa.dev/provenance/v0.1` for SlsaProvenance.
+   * 
+ * + * string predicate_type = 3; + * + * @return The bytes for predicateType. + */ + com.google.protobuf.ByteString getPredicateTypeBytes(); + + /** + * .grafeas.v1.InTotoProvenance provenance = 4; + * + * @return Whether the provenance field is set. + */ + boolean hasProvenance(); + /** + * .grafeas.v1.InTotoProvenance provenance = 4; + * + * @return The provenance. + */ + io.grafeas.v1.InTotoProvenance getProvenance(); + /** .grafeas.v1.InTotoProvenance provenance = 4; */ + io.grafeas.v1.InTotoProvenanceOrBuilder getProvenanceOrBuilder(); + + /** + * .grafeas.v1.SlsaProvenance slsa_provenance = 5; + * + * @return Whether the slsaProvenance field is set. + */ + boolean hasSlsaProvenance(); + /** + * .grafeas.v1.SlsaProvenance slsa_provenance = 5; + * + * @return The slsaProvenance. + */ + io.grafeas.v1.SlsaProvenance getSlsaProvenance(); + /** .grafeas.v1.SlsaProvenance slsa_provenance = 5; */ + io.grafeas.v1.SlsaProvenanceOrBuilder getSlsaProvenanceOrBuilder(); + + public io.grafeas.v1.InTotoStatement.PredicateCase getPredicateCase(); +} diff --git a/src/main/java/io/grafeas/v1/InTotoStatementProto.java b/src/main/java/io/grafeas/v1/InTotoStatementProto.java new file mode 100644 index 00000000..ac917230 --- /dev/null +++ b/src/main/java/io/grafeas/v1/InTotoStatementProto.java @@ -0,0 +1,103 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/intoto_statement.proto + +package io.grafeas.v1; + +public final class InTotoStatementProto { + private InTotoStatementProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_InTotoStatement_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_InTotoStatement_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_Subject_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_Subject_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_Subject_DigestEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_Subject_DigestEntry_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!grafeas/v1/intoto_statement.proto\022\ngra" + + "feas.v1\032\"grafeas/v1/intoto_provenance.pr" + + "oto\032 grafeas/v1/slsa_provenance.proto\"\334\001" + + "\n\017InTotoStatement\022\023\n\004type\030\001 \001(\tR\005_type\022$" + + "\n\007subject\030\002 \003(\0132\023.grafeas.v1.Subject\022\026\n\016" + + "predicate_type\030\003 \001(\t\0222\n\nprovenance\030\004 \001(\013" + + "2\034.grafeas.v1.InTotoProvenanceH\000\0225\n\017slsa" + + "_provenance\030\005 \001(\0132\032.grafeas.v1.SlsaProve" + + "nanceH\000B\013\n\tpredicate\"w\n\007Subject\022\014\n\004name\030" + + "\001 \001(\t\022/\n\006digest\030\002 \003(\0132\037.grafeas.v1.Subje" + + "ct.DigestEntry\032-\n\013DigestEntry\022\013\n\003key\030\001 \001" + + "(\t\022\r\n\005value\030\002 \001(\t:\0028\001Bg\n\rio.grafeas.v1B\024" + + "InTotoStatementProtoP\001Z8google.golang.or" + + "g/genproto/googleapis/grafeas/v1;grafeas" + + "\242\002\003GRAb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + io.grafeas.v1.InTotoProvenanceProto.getDescriptor(), + io.grafeas.v1.SlsaProvenanceOuterClass.getDescriptor(), + }); + internal_static_grafeas_v1_InTotoStatement_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_grafeas_v1_InTotoStatement_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_InTotoStatement_descriptor, + new java.lang.String[] { + "Type", "Subject", "PredicateType", "Provenance", "SlsaProvenance", "Predicate", + }); + internal_static_grafeas_v1_Subject_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_grafeas_v1_Subject_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_Subject_descriptor, + new java.lang.String[] { + "Name", "Digest", + }); + internal_static_grafeas_v1_Subject_DigestEntry_descriptor = + internal_static_grafeas_v1_Subject_descriptor.getNestedTypes().get(0); + internal_static_grafeas_v1_Subject_DigestEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_Subject_DigestEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + io.grafeas.v1.InTotoProvenanceProto.getDescriptor(); + io.grafeas.v1.SlsaProvenanceOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/io/grafeas/v1/Jwt.java b/src/main/java/io/grafeas/v1/Jwt.java new file mode 100644 index 00000000..c06835ab --- /dev/null +++ b/src/main/java/io/grafeas/v1/Jwt.java @@ -0,0 +1,621 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/attestation.proto + +package io.grafeas.v1; + +/** Protobuf type {@code grafeas.v1.Jwt} */ +public final class Jwt extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.Jwt) + JwtOrBuilder { + private static final long serialVersionUID = 0L; + // Use Jwt.newBuilder() to construct. + private Jwt(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Jwt() { + compactJwt_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Jwt(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Jwt( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + compactJwt_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Attestation.internal_static_grafeas_v1_Jwt_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Attestation.internal_static_grafeas_v1_Jwt_fieldAccessorTable + .ensureFieldAccessorsInitialized(io.grafeas.v1.Jwt.class, io.grafeas.v1.Jwt.Builder.class); + } + + public static final int COMPACT_JWT_FIELD_NUMBER = 1; + private volatile java.lang.Object compactJwt_; + /** + * + * + *
+   * The compact encoding of a JWS, which is always three base64 encoded strings
+   * joined by periods. For details, see:
+   * https://tools.ietf.org/html/rfc7515.html#section-3.1
+   * 
+ * + * string compact_jwt = 1; + * + * @return The compactJwt. + */ + @java.lang.Override + public java.lang.String getCompactJwt() { + java.lang.Object ref = compactJwt_; + 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(); + compactJwt_ = s; + return s; + } + } + /** + * + * + *
+   * The compact encoding of a JWS, which is always three base64 encoded strings
+   * joined by periods. For details, see:
+   * https://tools.ietf.org/html/rfc7515.html#section-3.1
+   * 
+ * + * string compact_jwt = 1; + * + * @return The bytes for compactJwt. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCompactJwtBytes() { + java.lang.Object ref = compactJwt_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + compactJwt_ = 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; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(compactJwt_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, compactJwt_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(compactJwt_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, compactJwt_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.Jwt)) { + return super.equals(obj); + } + io.grafeas.v1.Jwt other = (io.grafeas.v1.Jwt) obj; + + if (!getCompactJwt().equals(other.getCompactJwt())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + COMPACT_JWT_FIELD_NUMBER; + hash = (53 * hash) + getCompactJwt().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.Jwt parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.Jwt parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.Jwt parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.Jwt parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.Jwt parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.Jwt parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.Jwt parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.Jwt parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.Jwt parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.Jwt parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.Jwt parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.Jwt parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.Jwt 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code grafeas.v1.Jwt} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.Jwt) + io.grafeas.v1.JwtOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Attestation.internal_static_grafeas_v1_Jwt_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Attestation.internal_static_grafeas_v1_Jwt_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.Jwt.class, io.grafeas.v1.Jwt.Builder.class); + } + + // Construct using io.grafeas.v1.Jwt.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + compactJwt_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.Attestation.internal_static_grafeas_v1_Jwt_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.Jwt getDefaultInstanceForType() { + return io.grafeas.v1.Jwt.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.Jwt build() { + io.grafeas.v1.Jwt result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.Jwt buildPartial() { + io.grafeas.v1.Jwt result = new io.grafeas.v1.Jwt(this); + result.compactJwt_ = compactJwt_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.Jwt) { + return mergeFrom((io.grafeas.v1.Jwt) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.Jwt other) { + if (other == io.grafeas.v1.Jwt.getDefaultInstance()) return this; + if (!other.getCompactJwt().isEmpty()) { + compactJwt_ = other.compactJwt_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.Jwt parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.Jwt) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object compactJwt_ = ""; + /** + * + * + *
+     * The compact encoding of a JWS, which is always three base64 encoded strings
+     * joined by periods. For details, see:
+     * https://tools.ietf.org/html/rfc7515.html#section-3.1
+     * 
+ * + * string compact_jwt = 1; + * + * @return The compactJwt. + */ + public java.lang.String getCompactJwt() { + java.lang.Object ref = compactJwt_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + compactJwt_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The compact encoding of a JWS, which is always three base64 encoded strings
+     * joined by periods. For details, see:
+     * https://tools.ietf.org/html/rfc7515.html#section-3.1
+     * 
+ * + * string compact_jwt = 1; + * + * @return The bytes for compactJwt. + */ + public com.google.protobuf.ByteString getCompactJwtBytes() { + java.lang.Object ref = compactJwt_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + compactJwt_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The compact encoding of a JWS, which is always three base64 encoded strings
+     * joined by periods. For details, see:
+     * https://tools.ietf.org/html/rfc7515.html#section-3.1
+     * 
+ * + * string compact_jwt = 1; + * + * @param value The compactJwt to set. + * @return This builder for chaining. + */ + public Builder setCompactJwt(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + compactJwt_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The compact encoding of a JWS, which is always three base64 encoded strings
+     * joined by periods. For details, see:
+     * https://tools.ietf.org/html/rfc7515.html#section-3.1
+     * 
+ * + * string compact_jwt = 1; + * + * @return This builder for chaining. + */ + public Builder clearCompactJwt() { + + compactJwt_ = getDefaultInstance().getCompactJwt(); + onChanged(); + return this; + } + /** + * + * + *
+     * The compact encoding of a JWS, which is always three base64 encoded strings
+     * joined by periods. For details, see:
+     * https://tools.ietf.org/html/rfc7515.html#section-3.1
+     * 
+ * + * string compact_jwt = 1; + * + * @param value The bytes for compactJwt to set. + * @return This builder for chaining. + */ + public Builder setCompactJwtBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + compactJwt_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.Jwt) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.Jwt) + private static final io.grafeas.v1.Jwt DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.Jwt(); + } + + public static io.grafeas.v1.Jwt getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Jwt parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Jwt(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.Jwt getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/src/main/java/io/grafeas/v1/JwtOrBuilder.java b/src/main/java/io/grafeas/v1/JwtOrBuilder.java new file mode 100644 index 00000000..81a7dc79 --- /dev/null +++ b/src/main/java/io/grafeas/v1/JwtOrBuilder.java @@ -0,0 +1,55 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/attestation.proto + +package io.grafeas.v1; + +public interface JwtOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.Jwt) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The compact encoding of a JWS, which is always three base64 encoded strings
+   * joined by periods. For details, see:
+   * https://tools.ietf.org/html/rfc7515.html#section-3.1
+   * 
+ * + * string compact_jwt = 1; + * + * @return The compactJwt. + */ + java.lang.String getCompactJwt(); + /** + * + * + *
+   * The compact encoding of a JWS, which is always three base64 encoded strings
+   * joined by periods. For details, see:
+   * https://tools.ietf.org/html/rfc7515.html#section-3.1
+   * 
+ * + * string compact_jwt = 1; + * + * @return The bytes for compactJwt. + */ + com.google.protobuf.ByteString getCompactJwtBytes(); +} diff --git a/src/main/java/io/grafeas/v1/Metadata.java b/src/main/java/io/grafeas/v1/Metadata.java new file mode 100644 index 00000000..762cfd58 --- /dev/null +++ b/src/main/java/io/grafeas/v1/Metadata.java @@ -0,0 +1,1571 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/intoto_provenance.proto + +package io.grafeas.v1; + +/** + * + * + *
+ * Other properties of the build.
+ * 
+ * + * Protobuf type {@code grafeas.v1.Metadata} + */ +public final class Metadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.Metadata) + MetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use Metadata.newBuilder() to construct. + private Metadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Metadata() { + buildInvocationId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Metadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Metadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + buildInvocationId_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (buildStartedOn_ != null) { + subBuilder = buildStartedOn_.toBuilder(); + } + buildStartedOn_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(buildStartedOn_); + buildStartedOn_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (buildFinishedOn_ != null) { + subBuilder = buildFinishedOn_.toBuilder(); + } + buildFinishedOn_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(buildFinishedOn_); + buildFinishedOn_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + io.grafeas.v1.Completeness.Builder subBuilder = null; + if (completeness_ != null) { + subBuilder = completeness_.toBuilder(); + } + completeness_ = + input.readMessage(io.grafeas.v1.Completeness.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(completeness_); + completeness_ = subBuilder.buildPartial(); + } + + break; + } + case 40: + { + reproducible_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.InTotoProvenanceProto.internal_static_grafeas_v1_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.InTotoProvenanceProto + .internal_static_grafeas_v1_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.Metadata.class, io.grafeas.v1.Metadata.Builder.class); + } + + public static final int BUILD_INVOCATION_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object buildInvocationId_; + /** + * + * + *
+   * Identifies the particular build invocation, which can be useful for finding
+   * associated logs or other ad-hoc analysis. The value SHOULD be globally
+   * unique, per in-toto Provenance spec.
+   * 
+ * + * string build_invocation_id = 1; + * + * @return The buildInvocationId. + */ + @java.lang.Override + public java.lang.String getBuildInvocationId() { + java.lang.Object ref = buildInvocationId_; + 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(); + buildInvocationId_ = s; + return s; + } + } + /** + * + * + *
+   * Identifies the particular build invocation, which can be useful for finding
+   * associated logs or other ad-hoc analysis. The value SHOULD be globally
+   * unique, per in-toto Provenance spec.
+   * 
+ * + * string build_invocation_id = 1; + * + * @return The bytes for buildInvocationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBuildInvocationIdBytes() { + java.lang.Object ref = buildInvocationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + buildInvocationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUILD_STARTED_ON_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp buildStartedOn_; + /** + * + * + *
+   * The timestamp of when the build started.
+   * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + * + * @return Whether the buildStartedOn field is set. + */ + @java.lang.Override + public boolean hasBuildStartedOn() { + return buildStartedOn_ != null; + } + /** + * + * + *
+   * The timestamp of when the build started.
+   * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + * + * @return The buildStartedOn. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getBuildStartedOn() { + return buildStartedOn_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : buildStartedOn_; + } + /** + * + * + *
+   * The timestamp of when the build started.
+   * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getBuildStartedOnOrBuilder() { + return getBuildStartedOn(); + } + + public static final int BUILD_FINISHED_ON_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp buildFinishedOn_; + /** + * + * + *
+   * The timestamp of when the build completed.
+   * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + * + * @return Whether the buildFinishedOn field is set. + */ + @java.lang.Override + public boolean hasBuildFinishedOn() { + return buildFinishedOn_ != null; + } + /** + * + * + *
+   * The timestamp of when the build completed.
+   * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + * + * @return The buildFinishedOn. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getBuildFinishedOn() { + return buildFinishedOn_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : buildFinishedOn_; + } + /** + * + * + *
+   * The timestamp of when the build completed.
+   * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getBuildFinishedOnOrBuilder() { + return getBuildFinishedOn(); + } + + public static final int COMPLETENESS_FIELD_NUMBER = 4; + private io.grafeas.v1.Completeness completeness_; + /** + * + * + *
+   * Indicates that the builder claims certain fields in this message to be
+   * complete.
+   * 
+ * + * .grafeas.v1.Completeness completeness = 4; + * + * @return Whether the completeness field is set. + */ + @java.lang.Override + public boolean hasCompleteness() { + return completeness_ != null; + } + /** + * + * + *
+   * Indicates that the builder claims certain fields in this message to be
+   * complete.
+   * 
+ * + * .grafeas.v1.Completeness completeness = 4; + * + * @return The completeness. + */ + @java.lang.Override + public io.grafeas.v1.Completeness getCompleteness() { + return completeness_ == null ? io.grafeas.v1.Completeness.getDefaultInstance() : completeness_; + } + /** + * + * + *
+   * Indicates that the builder claims certain fields in this message to be
+   * complete.
+   * 
+ * + * .grafeas.v1.Completeness completeness = 4; + */ + @java.lang.Override + public io.grafeas.v1.CompletenessOrBuilder getCompletenessOrBuilder() { + return getCompleteness(); + } + + public static final int REPRODUCIBLE_FIELD_NUMBER = 5; + private boolean reproducible_; + /** + * + * + *
+   * If true, the builder claims that running the recipe on materials will
+   * produce bit-for-bit identical output.
+   * 
+ * + * bool reproducible = 5; + * + * @return The reproducible. + */ + @java.lang.Override + public boolean getReproducible() { + return reproducible_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(buildInvocationId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, buildInvocationId_); + } + if (buildStartedOn_ != null) { + output.writeMessage(2, getBuildStartedOn()); + } + if (buildFinishedOn_ != null) { + output.writeMessage(3, getBuildFinishedOn()); + } + if (completeness_ != null) { + output.writeMessage(4, getCompleteness()); + } + if (reproducible_ != false) { + output.writeBool(5, reproducible_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(buildInvocationId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, buildInvocationId_); + } + if (buildStartedOn_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBuildStartedOn()); + } + if (buildFinishedOn_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBuildFinishedOn()); + } + if (completeness_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCompleteness()); + } + if (reproducible_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, reproducible_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.Metadata)) { + return super.equals(obj); + } + io.grafeas.v1.Metadata other = (io.grafeas.v1.Metadata) obj; + + if (!getBuildInvocationId().equals(other.getBuildInvocationId())) return false; + if (hasBuildStartedOn() != other.hasBuildStartedOn()) return false; + if (hasBuildStartedOn()) { + if (!getBuildStartedOn().equals(other.getBuildStartedOn())) return false; + } + if (hasBuildFinishedOn() != other.hasBuildFinishedOn()) return false; + if (hasBuildFinishedOn()) { + if (!getBuildFinishedOn().equals(other.getBuildFinishedOn())) return false; + } + if (hasCompleteness() != other.hasCompleteness()) return false; + if (hasCompleteness()) { + if (!getCompleteness().equals(other.getCompleteness())) return false; + } + if (getReproducible() != other.getReproducible()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BUILD_INVOCATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getBuildInvocationId().hashCode(); + if (hasBuildStartedOn()) { + hash = (37 * hash) + BUILD_STARTED_ON_FIELD_NUMBER; + hash = (53 * hash) + getBuildStartedOn().hashCode(); + } + if (hasBuildFinishedOn()) { + hash = (37 * hash) + BUILD_FINISHED_ON_FIELD_NUMBER; + hash = (53 * hash) + getBuildFinishedOn().hashCode(); + } + if (hasCompleteness()) { + hash = (37 * hash) + COMPLETENESS_FIELD_NUMBER; + hash = (53 * hash) + getCompleteness().hashCode(); + } + hash = (37 * hash) + REPRODUCIBLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReproducible()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.Metadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.Metadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.Metadata parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.Metadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.Metadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.Metadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.Metadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.Metadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.Metadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.Metadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.Metadata parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.Metadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.Metadata 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Other properties of the build.
+   * 
+ * + * Protobuf type {@code grafeas.v1.Metadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.Metadata) + io.grafeas.v1.MetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.InTotoProvenanceProto.internal_static_grafeas_v1_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.InTotoProvenanceProto + .internal_static_grafeas_v1_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.Metadata.class, io.grafeas.v1.Metadata.Builder.class); + } + + // Construct using io.grafeas.v1.Metadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + buildInvocationId_ = ""; + + if (buildStartedOnBuilder_ == null) { + buildStartedOn_ = null; + } else { + buildStartedOn_ = null; + buildStartedOnBuilder_ = null; + } + if (buildFinishedOnBuilder_ == null) { + buildFinishedOn_ = null; + } else { + buildFinishedOn_ = null; + buildFinishedOnBuilder_ = null; + } + if (completenessBuilder_ == null) { + completeness_ = null; + } else { + completeness_ = null; + completenessBuilder_ = null; + } + reproducible_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.InTotoProvenanceProto.internal_static_grafeas_v1_Metadata_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.Metadata getDefaultInstanceForType() { + return io.grafeas.v1.Metadata.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.Metadata build() { + io.grafeas.v1.Metadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.Metadata buildPartial() { + io.grafeas.v1.Metadata result = new io.grafeas.v1.Metadata(this); + result.buildInvocationId_ = buildInvocationId_; + if (buildStartedOnBuilder_ == null) { + result.buildStartedOn_ = buildStartedOn_; + } else { + result.buildStartedOn_ = buildStartedOnBuilder_.build(); + } + if (buildFinishedOnBuilder_ == null) { + result.buildFinishedOn_ = buildFinishedOn_; + } else { + result.buildFinishedOn_ = buildFinishedOnBuilder_.build(); + } + if (completenessBuilder_ == null) { + result.completeness_ = completeness_; + } else { + result.completeness_ = completenessBuilder_.build(); + } + result.reproducible_ = reproducible_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.Metadata) { + return mergeFrom((io.grafeas.v1.Metadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.Metadata other) { + if (other == io.grafeas.v1.Metadata.getDefaultInstance()) return this; + if (!other.getBuildInvocationId().isEmpty()) { + buildInvocationId_ = other.buildInvocationId_; + onChanged(); + } + if (other.hasBuildStartedOn()) { + mergeBuildStartedOn(other.getBuildStartedOn()); + } + if (other.hasBuildFinishedOn()) { + mergeBuildFinishedOn(other.getBuildFinishedOn()); + } + if (other.hasCompleteness()) { + mergeCompleteness(other.getCompleteness()); + } + if (other.getReproducible() != false) { + setReproducible(other.getReproducible()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.Metadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.Metadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object buildInvocationId_ = ""; + /** + * + * + *
+     * Identifies the particular build invocation, which can be useful for finding
+     * associated logs or other ad-hoc analysis. The value SHOULD be globally
+     * unique, per in-toto Provenance spec.
+     * 
+ * + * string build_invocation_id = 1; + * + * @return The buildInvocationId. + */ + public java.lang.String getBuildInvocationId() { + java.lang.Object ref = buildInvocationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + buildInvocationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identifies the particular build invocation, which can be useful for finding
+     * associated logs or other ad-hoc analysis. The value SHOULD be globally
+     * unique, per in-toto Provenance spec.
+     * 
+ * + * string build_invocation_id = 1; + * + * @return The bytes for buildInvocationId. + */ + public com.google.protobuf.ByteString getBuildInvocationIdBytes() { + java.lang.Object ref = buildInvocationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + buildInvocationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identifies the particular build invocation, which can be useful for finding
+     * associated logs or other ad-hoc analysis. The value SHOULD be globally
+     * unique, per in-toto Provenance spec.
+     * 
+ * + * string build_invocation_id = 1; + * + * @param value The buildInvocationId to set. + * @return This builder for chaining. + */ + public Builder setBuildInvocationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + buildInvocationId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifies the particular build invocation, which can be useful for finding
+     * associated logs or other ad-hoc analysis. The value SHOULD be globally
+     * unique, per in-toto Provenance spec.
+     * 
+ * + * string build_invocation_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearBuildInvocationId() { + + buildInvocationId_ = getDefaultInstance().getBuildInvocationId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifies the particular build invocation, which can be useful for finding
+     * associated logs or other ad-hoc analysis. The value SHOULD be globally
+     * unique, per in-toto Provenance spec.
+     * 
+ * + * string build_invocation_id = 1; + * + * @param value The bytes for buildInvocationId to set. + * @return This builder for chaining. + */ + public Builder setBuildInvocationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + buildInvocationId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp buildStartedOn_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + buildStartedOnBuilder_; + /** + * + * + *
+     * The timestamp of when the build started.
+     * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + * + * @return Whether the buildStartedOn field is set. + */ + public boolean hasBuildStartedOn() { + return buildStartedOnBuilder_ != null || buildStartedOn_ != null; + } + /** + * + * + *
+     * The timestamp of when the build started.
+     * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + * + * @return The buildStartedOn. + */ + public com.google.protobuf.Timestamp getBuildStartedOn() { + if (buildStartedOnBuilder_ == null) { + return buildStartedOn_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : buildStartedOn_; + } else { + return buildStartedOnBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The timestamp of when the build started.
+     * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + */ + public Builder setBuildStartedOn(com.google.protobuf.Timestamp value) { + if (buildStartedOnBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + buildStartedOn_ = value; + onChanged(); + } else { + buildStartedOnBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp of when the build started.
+     * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + */ + public Builder setBuildStartedOn(com.google.protobuf.Timestamp.Builder builderForValue) { + if (buildStartedOnBuilder_ == null) { + buildStartedOn_ = builderForValue.build(); + onChanged(); + } else { + buildStartedOnBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The timestamp of when the build started.
+     * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + */ + public Builder mergeBuildStartedOn(com.google.protobuf.Timestamp value) { + if (buildStartedOnBuilder_ == null) { + if (buildStartedOn_ != null) { + buildStartedOn_ = + com.google.protobuf.Timestamp.newBuilder(buildStartedOn_) + .mergeFrom(value) + .buildPartial(); + } else { + buildStartedOn_ = value; + } + onChanged(); + } else { + buildStartedOnBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp of when the build started.
+     * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + */ + public Builder clearBuildStartedOn() { + if (buildStartedOnBuilder_ == null) { + buildStartedOn_ = null; + onChanged(); + } else { + buildStartedOn_ = null; + buildStartedOnBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The timestamp of when the build started.
+     * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + */ + public com.google.protobuf.Timestamp.Builder getBuildStartedOnBuilder() { + + onChanged(); + return getBuildStartedOnFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The timestamp of when the build started.
+     * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + */ + public com.google.protobuf.TimestampOrBuilder getBuildStartedOnOrBuilder() { + if (buildStartedOnBuilder_ != null) { + return buildStartedOnBuilder_.getMessageOrBuilder(); + } else { + return buildStartedOn_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : buildStartedOn_; + } + } + /** + * + * + *
+     * The timestamp of when the build started.
+     * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getBuildStartedOnFieldBuilder() { + if (buildStartedOnBuilder_ == null) { + buildStartedOnBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getBuildStartedOn(), getParentForChildren(), isClean()); + buildStartedOn_ = null; + } + return buildStartedOnBuilder_; + } + + private com.google.protobuf.Timestamp buildFinishedOn_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + buildFinishedOnBuilder_; + /** + * + * + *
+     * The timestamp of when the build completed.
+     * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + * + * @return Whether the buildFinishedOn field is set. + */ + public boolean hasBuildFinishedOn() { + return buildFinishedOnBuilder_ != null || buildFinishedOn_ != null; + } + /** + * + * + *
+     * The timestamp of when the build completed.
+     * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + * + * @return The buildFinishedOn. + */ + public com.google.protobuf.Timestamp getBuildFinishedOn() { + if (buildFinishedOnBuilder_ == null) { + return buildFinishedOn_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : buildFinishedOn_; + } else { + return buildFinishedOnBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The timestamp of when the build completed.
+     * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + */ + public Builder setBuildFinishedOn(com.google.protobuf.Timestamp value) { + if (buildFinishedOnBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + buildFinishedOn_ = value; + onChanged(); + } else { + buildFinishedOnBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp of when the build completed.
+     * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + */ + public Builder setBuildFinishedOn(com.google.protobuf.Timestamp.Builder builderForValue) { + if (buildFinishedOnBuilder_ == null) { + buildFinishedOn_ = builderForValue.build(); + onChanged(); + } else { + buildFinishedOnBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The timestamp of when the build completed.
+     * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + */ + public Builder mergeBuildFinishedOn(com.google.protobuf.Timestamp value) { + if (buildFinishedOnBuilder_ == null) { + if (buildFinishedOn_ != null) { + buildFinishedOn_ = + com.google.protobuf.Timestamp.newBuilder(buildFinishedOn_) + .mergeFrom(value) + .buildPartial(); + } else { + buildFinishedOn_ = value; + } + onChanged(); + } else { + buildFinishedOnBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The timestamp of when the build completed.
+     * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + */ + public Builder clearBuildFinishedOn() { + if (buildFinishedOnBuilder_ == null) { + buildFinishedOn_ = null; + onChanged(); + } else { + buildFinishedOn_ = null; + buildFinishedOnBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The timestamp of when the build completed.
+     * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + */ + public com.google.protobuf.Timestamp.Builder getBuildFinishedOnBuilder() { + + onChanged(); + return getBuildFinishedOnFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The timestamp of when the build completed.
+     * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + */ + public com.google.protobuf.TimestampOrBuilder getBuildFinishedOnOrBuilder() { + if (buildFinishedOnBuilder_ != null) { + return buildFinishedOnBuilder_.getMessageOrBuilder(); + } else { + return buildFinishedOn_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : buildFinishedOn_; + } + } + /** + * + * + *
+     * The timestamp of when the build completed.
+     * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getBuildFinishedOnFieldBuilder() { + if (buildFinishedOnBuilder_ == null) { + buildFinishedOnBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getBuildFinishedOn(), getParentForChildren(), isClean()); + buildFinishedOn_ = null; + } + return buildFinishedOnBuilder_; + } + + private io.grafeas.v1.Completeness completeness_; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.Completeness, + io.grafeas.v1.Completeness.Builder, + io.grafeas.v1.CompletenessOrBuilder> + completenessBuilder_; + /** + * + * + *
+     * Indicates that the builder claims certain fields in this message to be
+     * complete.
+     * 
+ * + * .grafeas.v1.Completeness completeness = 4; + * + * @return Whether the completeness field is set. + */ + public boolean hasCompleteness() { + return completenessBuilder_ != null || completeness_ != null; + } + /** + * + * + *
+     * Indicates that the builder claims certain fields in this message to be
+     * complete.
+     * 
+ * + * .grafeas.v1.Completeness completeness = 4; + * + * @return The completeness. + */ + public io.grafeas.v1.Completeness getCompleteness() { + if (completenessBuilder_ == null) { + return completeness_ == null + ? io.grafeas.v1.Completeness.getDefaultInstance() + : completeness_; + } else { + return completenessBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Indicates that the builder claims certain fields in this message to be
+     * complete.
+     * 
+ * + * .grafeas.v1.Completeness completeness = 4; + */ + public Builder setCompleteness(io.grafeas.v1.Completeness value) { + if (completenessBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + completeness_ = value; + onChanged(); + } else { + completenessBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Indicates that the builder claims certain fields in this message to be
+     * complete.
+     * 
+ * + * .grafeas.v1.Completeness completeness = 4; + */ + public Builder setCompleteness(io.grafeas.v1.Completeness.Builder builderForValue) { + if (completenessBuilder_ == null) { + completeness_ = builderForValue.build(); + onChanged(); + } else { + completenessBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates that the builder claims certain fields in this message to be
+     * complete.
+     * 
+ * + * .grafeas.v1.Completeness completeness = 4; + */ + public Builder mergeCompleteness(io.grafeas.v1.Completeness value) { + if (completenessBuilder_ == null) { + if (completeness_ != null) { + completeness_ = + io.grafeas.v1.Completeness.newBuilder(completeness_).mergeFrom(value).buildPartial(); + } else { + completeness_ = value; + } + onChanged(); + } else { + completenessBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Indicates that the builder claims certain fields in this message to be
+     * complete.
+     * 
+ * + * .grafeas.v1.Completeness completeness = 4; + */ + public Builder clearCompleteness() { + if (completenessBuilder_ == null) { + completeness_ = null; + onChanged(); + } else { + completeness_ = null; + completenessBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates that the builder claims certain fields in this message to be
+     * complete.
+     * 
+ * + * .grafeas.v1.Completeness completeness = 4; + */ + public io.grafeas.v1.Completeness.Builder getCompletenessBuilder() { + + onChanged(); + return getCompletenessFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates that the builder claims certain fields in this message to be
+     * complete.
+     * 
+ * + * .grafeas.v1.Completeness completeness = 4; + */ + public io.grafeas.v1.CompletenessOrBuilder getCompletenessOrBuilder() { + if (completenessBuilder_ != null) { + return completenessBuilder_.getMessageOrBuilder(); + } else { + return completeness_ == null + ? io.grafeas.v1.Completeness.getDefaultInstance() + : completeness_; + } + } + /** + * + * + *
+     * Indicates that the builder claims certain fields in this message to be
+     * complete.
+     * 
+ * + * .grafeas.v1.Completeness completeness = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.Completeness, + io.grafeas.v1.Completeness.Builder, + io.grafeas.v1.CompletenessOrBuilder> + getCompletenessFieldBuilder() { + if (completenessBuilder_ == null) { + completenessBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.Completeness, + io.grafeas.v1.Completeness.Builder, + io.grafeas.v1.CompletenessOrBuilder>( + getCompleteness(), getParentForChildren(), isClean()); + completeness_ = null; + } + return completenessBuilder_; + } + + private boolean reproducible_; + /** + * + * + *
+     * If true, the builder claims that running the recipe on materials will
+     * produce bit-for-bit identical output.
+     * 
+ * + * bool reproducible = 5; + * + * @return The reproducible. + */ + @java.lang.Override + public boolean getReproducible() { + return reproducible_; + } + /** + * + * + *
+     * If true, the builder claims that running the recipe on materials will
+     * produce bit-for-bit identical output.
+     * 
+ * + * bool reproducible = 5; + * + * @param value The reproducible to set. + * @return This builder for chaining. + */ + public Builder setReproducible(boolean value) { + + reproducible_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If true, the builder claims that running the recipe on materials will
+     * produce bit-for-bit identical output.
+     * 
+ * + * bool reproducible = 5; + * + * @return This builder for chaining. + */ + public Builder clearReproducible() { + + reproducible_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.Metadata) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.Metadata) + private static final io.grafeas.v1.Metadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.Metadata(); + } + + public static io.grafeas.v1.Metadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Metadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Metadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.Metadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/src/main/java/io/grafeas/v1/MetadataOrBuilder.java b/src/main/java/io/grafeas/v1/MetadataOrBuilder.java new file mode 100644 index 00000000..7f0002ba --- /dev/null +++ b/src/main/java/io/grafeas/v1/MetadataOrBuilder.java @@ -0,0 +1,177 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/intoto_provenance.proto + +package io.grafeas.v1; + +public interface MetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.Metadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifies the particular build invocation, which can be useful for finding
+   * associated logs or other ad-hoc analysis. The value SHOULD be globally
+   * unique, per in-toto Provenance spec.
+   * 
+ * + * string build_invocation_id = 1; + * + * @return The buildInvocationId. + */ + java.lang.String getBuildInvocationId(); + /** + * + * + *
+   * Identifies the particular build invocation, which can be useful for finding
+   * associated logs or other ad-hoc analysis. The value SHOULD be globally
+   * unique, per in-toto Provenance spec.
+   * 
+ * + * string build_invocation_id = 1; + * + * @return The bytes for buildInvocationId. + */ + com.google.protobuf.ByteString getBuildInvocationIdBytes(); + + /** + * + * + *
+   * The timestamp of when the build started.
+   * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + * + * @return Whether the buildStartedOn field is set. + */ + boolean hasBuildStartedOn(); + /** + * + * + *
+   * The timestamp of when the build started.
+   * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + * + * @return The buildStartedOn. + */ + com.google.protobuf.Timestamp getBuildStartedOn(); + /** + * + * + *
+   * The timestamp of when the build started.
+   * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + */ + com.google.protobuf.TimestampOrBuilder getBuildStartedOnOrBuilder(); + + /** + * + * + *
+   * The timestamp of when the build completed.
+   * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + * + * @return Whether the buildFinishedOn field is set. + */ + boolean hasBuildFinishedOn(); + /** + * + * + *
+   * The timestamp of when the build completed.
+   * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + * + * @return The buildFinishedOn. + */ + com.google.protobuf.Timestamp getBuildFinishedOn(); + /** + * + * + *
+   * The timestamp of when the build completed.
+   * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + */ + com.google.protobuf.TimestampOrBuilder getBuildFinishedOnOrBuilder(); + + /** + * + * + *
+   * Indicates that the builder claims certain fields in this message to be
+   * complete.
+   * 
+ * + * .grafeas.v1.Completeness completeness = 4; + * + * @return Whether the completeness field is set. + */ + boolean hasCompleteness(); + /** + * + * + *
+   * Indicates that the builder claims certain fields in this message to be
+   * complete.
+   * 
+ * + * .grafeas.v1.Completeness completeness = 4; + * + * @return The completeness. + */ + io.grafeas.v1.Completeness getCompleteness(); + /** + * + * + *
+   * Indicates that the builder claims certain fields in this message to be
+   * complete.
+   * 
+ * + * .grafeas.v1.Completeness completeness = 4; + */ + io.grafeas.v1.CompletenessOrBuilder getCompletenessOrBuilder(); + + /** + * + * + *
+   * If true, the builder claims that running the recipe on materials will
+   * produce bit-for-bit identical output.
+   * 
+ * + * bool reproducible = 5; + * + * @return The reproducible. + */ + boolean getReproducible(); +} diff --git a/src/main/java/io/grafeas/v1/NonCompliantFile.java b/src/main/java/io/grafeas/v1/NonCompliantFile.java new file mode 100644 index 00000000..f9f5e38b --- /dev/null +++ b/src/main/java/io/grafeas/v1/NonCompliantFile.java @@ -0,0 +1,983 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/compliance.proto + +package io.grafeas.v1; + +/** + * + * + *
+ * Details about files that caused a compliance check to fail.
+ * 
+ * + * Protobuf type {@code grafeas.v1.NonCompliantFile} + */ +public final class NonCompliantFile extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.NonCompliantFile) + NonCompliantFileOrBuilder { + private static final long serialVersionUID = 0L; + // Use NonCompliantFile.newBuilder() to construct. + private NonCompliantFile(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NonCompliantFile() { + path_ = ""; + displayCommand_ = ""; + reason_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NonCompliantFile(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private NonCompliantFile( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + path_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayCommand_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + reason_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Compliance.internal_static_grafeas_v1_NonCompliantFile_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Compliance.internal_static_grafeas_v1_NonCompliantFile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.NonCompliantFile.class, io.grafeas.v1.NonCompliantFile.Builder.class); + } + + public static final int PATH_FIELD_NUMBER = 1; + private volatile java.lang.Object path_; + /** + * + * + *
+   * Empty if `display_command` is set.
+   * 
+ * + * string path = 1; + * + * @return The path. + */ + @java.lang.Override + public java.lang.String getPath() { + java.lang.Object ref = path_; + 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(); + path_ = s; + return s; + } + } + /** + * + * + *
+   * Empty if `display_command` is set.
+   * 
+ * + * string path = 1; + * + * @return The bytes for path. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_COMMAND_FIELD_NUMBER = 2; + private volatile java.lang.Object displayCommand_; + /** + * + * + *
+   * Command to display the non-compliant files.
+   * 
+ * + * string display_command = 2; + * + * @return The displayCommand. + */ + @java.lang.Override + public java.lang.String getDisplayCommand() { + java.lang.Object ref = displayCommand_; + 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(); + displayCommand_ = s; + return s; + } + } + /** + * + * + *
+   * Command to display the non-compliant files.
+   * 
+ * + * string display_command = 2; + * + * @return The bytes for displayCommand. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayCommandBytes() { + java.lang.Object ref = displayCommand_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayCommand_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REASON_FIELD_NUMBER = 3; + private volatile java.lang.Object reason_; + /** + * + * + *
+   * Explains why a file is non compliant for a CIS check.
+   * 
+ * + * string reason = 3; + * + * @return The reason. + */ + @java.lang.Override + public java.lang.String getReason() { + java.lang.Object ref = reason_; + 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(); + reason_ = s; + return s; + } + } + /** + * + * + *
+   * Explains why a file is non compliant for a CIS check.
+   * 
+ * + * string reason = 3; + * + * @return The bytes for reason. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReasonBytes() { + java.lang.Object ref = reason_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reason_ = 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; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, path_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayCommand_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayCommand_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(reason_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, reason_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, path_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayCommand_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayCommand_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(reason_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, reason_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.NonCompliantFile)) { + return super.equals(obj); + } + io.grafeas.v1.NonCompliantFile other = (io.grafeas.v1.NonCompliantFile) obj; + + if (!getPath().equals(other.getPath())) return false; + if (!getDisplayCommand().equals(other.getDisplayCommand())) return false; + if (!getReason().equals(other.getReason())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PATH_FIELD_NUMBER; + hash = (53 * hash) + getPath().hashCode(); + hash = (37 * hash) + DISPLAY_COMMAND_FIELD_NUMBER; + hash = (53 * hash) + getDisplayCommand().hashCode(); + hash = (37 * hash) + REASON_FIELD_NUMBER; + hash = (53 * hash) + getReason().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.NonCompliantFile parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.NonCompliantFile parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.NonCompliantFile parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.NonCompliantFile parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.NonCompliantFile parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.NonCompliantFile parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.NonCompliantFile parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.NonCompliantFile parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.NonCompliantFile parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.NonCompliantFile parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.NonCompliantFile parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.NonCompliantFile parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.NonCompliantFile 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Details about files that caused a compliance check to fail.
+   * 
+ * + * Protobuf type {@code grafeas.v1.NonCompliantFile} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.NonCompliantFile) + io.grafeas.v1.NonCompliantFileOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Compliance.internal_static_grafeas_v1_NonCompliantFile_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Compliance.internal_static_grafeas_v1_NonCompliantFile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.NonCompliantFile.class, io.grafeas.v1.NonCompliantFile.Builder.class); + } + + // Construct using io.grafeas.v1.NonCompliantFile.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + path_ = ""; + + displayCommand_ = ""; + + reason_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.Compliance.internal_static_grafeas_v1_NonCompliantFile_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.NonCompliantFile getDefaultInstanceForType() { + return io.grafeas.v1.NonCompliantFile.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.NonCompliantFile build() { + io.grafeas.v1.NonCompliantFile result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.NonCompliantFile buildPartial() { + io.grafeas.v1.NonCompliantFile result = new io.grafeas.v1.NonCompliantFile(this); + result.path_ = path_; + result.displayCommand_ = displayCommand_; + result.reason_ = reason_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.NonCompliantFile) { + return mergeFrom((io.grafeas.v1.NonCompliantFile) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.NonCompliantFile other) { + if (other == io.grafeas.v1.NonCompliantFile.getDefaultInstance()) return this; + if (!other.getPath().isEmpty()) { + path_ = other.path_; + onChanged(); + } + if (!other.getDisplayCommand().isEmpty()) { + displayCommand_ = other.displayCommand_; + onChanged(); + } + if (!other.getReason().isEmpty()) { + reason_ = other.reason_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.NonCompliantFile parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.NonCompliantFile) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object path_ = ""; + /** + * + * + *
+     * Empty if `display_command` is set.
+     * 
+ * + * string path = 1; + * + * @return The path. + */ + public java.lang.String getPath() { + java.lang.Object ref = path_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + path_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Empty if `display_command` is set.
+     * 
+ * + * string path = 1; + * + * @return The bytes for path. + */ + public com.google.protobuf.ByteString getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Empty if `display_command` is set.
+     * 
+ * + * string path = 1; + * + * @param value The path to set. + * @return This builder for chaining. + */ + public Builder setPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + path_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Empty if `display_command` is set.
+     * 
+ * + * string path = 1; + * + * @return This builder for chaining. + */ + public Builder clearPath() { + + path_ = getDefaultInstance().getPath(); + onChanged(); + return this; + } + /** + * + * + *
+     * Empty if `display_command` is set.
+     * 
+ * + * string path = 1; + * + * @param value The bytes for path to set. + * @return This builder for chaining. + */ + public Builder setPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + path_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayCommand_ = ""; + /** + * + * + *
+     * Command to display the non-compliant files.
+     * 
+ * + * string display_command = 2; + * + * @return The displayCommand. + */ + public java.lang.String getDisplayCommand() { + java.lang.Object ref = displayCommand_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayCommand_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Command to display the non-compliant files.
+     * 
+ * + * string display_command = 2; + * + * @return The bytes for displayCommand. + */ + public com.google.protobuf.ByteString getDisplayCommandBytes() { + java.lang.Object ref = displayCommand_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayCommand_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Command to display the non-compliant files.
+     * 
+ * + * string display_command = 2; + * + * @param value The displayCommand to set. + * @return This builder for chaining. + */ + public Builder setDisplayCommand(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayCommand_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Command to display the non-compliant files.
+     * 
+ * + * string display_command = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayCommand() { + + displayCommand_ = getDefaultInstance().getDisplayCommand(); + onChanged(); + return this; + } + /** + * + * + *
+     * Command to display the non-compliant files.
+     * 
+ * + * string display_command = 2; + * + * @param value The bytes for displayCommand to set. + * @return This builder for chaining. + */ + public Builder setDisplayCommandBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayCommand_ = value; + onChanged(); + return this; + } + + private java.lang.Object reason_ = ""; + /** + * + * + *
+     * Explains why a file is non compliant for a CIS check.
+     * 
+ * + * string reason = 3; + * + * @return The reason. + */ + public java.lang.String getReason() { + java.lang.Object ref = reason_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reason_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Explains why a file is non compliant for a CIS check.
+     * 
+ * + * string reason = 3; + * + * @return The bytes for reason. + */ + public com.google.protobuf.ByteString getReasonBytes() { + java.lang.Object ref = reason_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Explains why a file is non compliant for a CIS check.
+     * 
+ * + * string reason = 3; + * + * @param value The reason to set. + * @return This builder for chaining. + */ + public Builder setReason(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + reason_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Explains why a file is non compliant for a CIS check.
+     * 
+ * + * string reason = 3; + * + * @return This builder for chaining. + */ + public Builder clearReason() { + + reason_ = getDefaultInstance().getReason(); + onChanged(); + return this; + } + /** + * + * + *
+     * Explains why a file is non compliant for a CIS check.
+     * 
+ * + * string reason = 3; + * + * @param value The bytes for reason to set. + * @return This builder for chaining. + */ + public Builder setReasonBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + reason_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.NonCompliantFile) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.NonCompliantFile) + private static final io.grafeas.v1.NonCompliantFile DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.NonCompliantFile(); + } + + public static io.grafeas.v1.NonCompliantFile getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NonCompliantFile parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NonCompliantFile(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.NonCompliantFile getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/src/main/java/io/grafeas/v1/NonCompliantFileOrBuilder.java b/src/main/java/io/grafeas/v1/NonCompliantFileOrBuilder.java new file mode 100644 index 00000000..6cc70e99 --- /dev/null +++ b/src/main/java/io/grafeas/v1/NonCompliantFileOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/compliance.proto + +package io.grafeas.v1; + +public interface NonCompliantFileOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.NonCompliantFile) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Empty if `display_command` is set.
+   * 
+ * + * string path = 1; + * + * @return The path. + */ + java.lang.String getPath(); + /** + * + * + *
+   * Empty if `display_command` is set.
+   * 
+ * + * string path = 1; + * + * @return The bytes for path. + */ + com.google.protobuf.ByteString getPathBytes(); + + /** + * + * + *
+   * Command to display the non-compliant files.
+   * 
+ * + * string display_command = 2; + * + * @return The displayCommand. + */ + java.lang.String getDisplayCommand(); + /** + * + * + *
+   * Command to display the non-compliant files.
+   * 
+ * + * string display_command = 2; + * + * @return The bytes for displayCommand. + */ + com.google.protobuf.ByteString getDisplayCommandBytes(); + + /** + * + * + *
+   * Explains why a file is non compliant for a CIS check.
+   * 
+ * + * string reason = 3; + * + * @return The reason. + */ + java.lang.String getReason(); + /** + * + * + *
+   * Explains why a file is non compliant for a CIS check.
+   * 
+ * + * string reason = 3; + * + * @return The bytes for reason. + */ + com.google.protobuf.ByteString getReasonBytes(); +} diff --git a/src/main/java/io/grafeas/v1/Note.java b/src/main/java/io/grafeas/v1/Note.java index 6c738be0..a6099664 100644 --- a/src/main/java/io/grafeas/v1/Note.java +++ b/src/main/java/io/grafeas/v1/Note.java @@ -283,6 +283,35 @@ private Note( typeCase_ = 17; break; } + case 146: + { + io.grafeas.v1.ComplianceNote.Builder subBuilder = null; + if (typeCase_ == 18) { + subBuilder = ((io.grafeas.v1.ComplianceNote) type_).toBuilder(); + } + type_ = input.readMessage(io.grafeas.v1.ComplianceNote.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1.ComplianceNote) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 18; + break; + } + case 154: + { + io.grafeas.v1.DSSEAttestationNote.Builder subBuilder = null; + if (typeCase_ == 19) { + subBuilder = ((io.grafeas.v1.DSSEAttestationNote) type_).toBuilder(); + } + type_ = + input.readMessage(io.grafeas.v1.DSSEAttestationNote.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1.DSSEAttestationNote) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 19; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -335,6 +364,8 @@ public enum TypeCase DISCOVERY(15), ATTESTATION(16), UPGRADE(17), + COMPLIANCE(18), + DSSE_ATTESTATION(19), TYPE_NOT_SET(0); private final int value; @@ -369,6 +400,10 @@ public static TypeCase forNumber(int value) { return ATTESTATION; case 17: return UPGRADE; + case 18: + return COMPLIANCE; + case 19: + return DSSE_ATTESTATION; case 0: return TYPE_NOT_SET; default: @@ -1254,6 +1289,108 @@ public io.grafeas.v1.UpgradeNoteOrBuilder getUpgradeOrBuilder() { return io.grafeas.v1.UpgradeNote.getDefaultInstance(); } + public static final int COMPLIANCE_FIELD_NUMBER = 18; + /** + * + * + *
+   * A note describing a compliance check.
+   * 
+ * + * .grafeas.v1.ComplianceNote compliance = 18; + * + * @return Whether the compliance field is set. + */ + @java.lang.Override + public boolean hasCompliance() { + return typeCase_ == 18; + } + /** + * + * + *
+   * A note describing a compliance check.
+   * 
+ * + * .grafeas.v1.ComplianceNote compliance = 18; + * + * @return The compliance. + */ + @java.lang.Override + public io.grafeas.v1.ComplianceNote getCompliance() { + if (typeCase_ == 18) { + return (io.grafeas.v1.ComplianceNote) type_; + } + return io.grafeas.v1.ComplianceNote.getDefaultInstance(); + } + /** + * + * + *
+   * A note describing a compliance check.
+   * 
+ * + * .grafeas.v1.ComplianceNote compliance = 18; + */ + @java.lang.Override + public io.grafeas.v1.ComplianceNoteOrBuilder getComplianceOrBuilder() { + if (typeCase_ == 18) { + return (io.grafeas.v1.ComplianceNote) type_; + } + return io.grafeas.v1.ComplianceNote.getDefaultInstance(); + } + + public static final int DSSE_ATTESTATION_FIELD_NUMBER = 19; + /** + * + * + *
+   * A note describing a dsse attestation note.
+   * 
+ * + * .grafeas.v1.DSSEAttestationNote dsse_attestation = 19; + * + * @return Whether the dsseAttestation field is set. + */ + @java.lang.Override + public boolean hasDsseAttestation() { + return typeCase_ == 19; + } + /** + * + * + *
+   * A note describing a dsse attestation note.
+   * 
+ * + * .grafeas.v1.DSSEAttestationNote dsse_attestation = 19; + * + * @return The dsseAttestation. + */ + @java.lang.Override + public io.grafeas.v1.DSSEAttestationNote getDsseAttestation() { + if (typeCase_ == 19) { + return (io.grafeas.v1.DSSEAttestationNote) type_; + } + return io.grafeas.v1.DSSEAttestationNote.getDefaultInstance(); + } + /** + * + * + *
+   * A note describing a dsse attestation note.
+   * 
+ * + * .grafeas.v1.DSSEAttestationNote dsse_attestation = 19; + */ + @java.lang.Override + public io.grafeas.v1.DSSEAttestationNoteOrBuilder getDsseAttestationOrBuilder() { + if (typeCase_ == 19) { + return (io.grafeas.v1.DSSEAttestationNote) type_; + } + return io.grafeas.v1.DSSEAttestationNote.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1319,6 +1456,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (typeCase_ == 17) { output.writeMessage(17, (io.grafeas.v1.UpgradeNote) type_); } + if (typeCase_ == 18) { + output.writeMessage(18, (io.grafeas.v1.ComplianceNote) type_); + } + if (typeCase_ == 19) { + output.writeMessage(19, (io.grafeas.v1.DSSEAttestationNote) type_); + } unknownFields.writeTo(output); } @@ -1400,6 +1543,16 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 17, (io.grafeas.v1.UpgradeNote) type_); } + if (typeCase_ == 18) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 18, (io.grafeas.v1.ComplianceNote) type_); + } + if (typeCase_ == 19) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 19, (io.grafeas.v1.DSSEAttestationNote) type_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -1459,6 +1612,12 @@ public boolean equals(final java.lang.Object obj) { case 17: if (!getUpgrade().equals(other.getUpgrade())) return false; break; + case 18: + if (!getCompliance().equals(other.getCompliance())) return false; + break; + case 19: + if (!getDsseAttestation().equals(other.getDsseAttestation())) return false; + break; case 0: default: } @@ -1534,6 +1693,14 @@ public int hashCode() { hash = (37 * hash) + UPGRADE_FIELD_NUMBER; hash = (53 * hash) + getUpgrade().hashCode(); break; + case 18: + hash = (37 * hash) + COMPLIANCE_FIELD_NUMBER; + hash = (53 * hash) + getCompliance().hashCode(); + break; + case 19: + hash = (37 * hash) + DSSE_ATTESTATION_FIELD_NUMBER; + hash = (53 * hash) + getDsseAttestation().hashCode(); + break; case 0: default: } @@ -1830,6 +1997,20 @@ public io.grafeas.v1.Note buildPartial() { result.type_ = upgradeBuilder_.build(); } } + if (typeCase_ == 18) { + if (complianceBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = complianceBuilder_.build(); + } + } + if (typeCase_ == 19) { + if (dsseAttestationBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = dsseAttestationBuilder_.build(); + } + } result.typeCase_ = typeCase_; onBuilt(); return result; @@ -1982,6 +2163,16 @@ public Builder mergeFrom(io.grafeas.v1.Note other) { mergeUpgrade(other.getUpgrade()); break; } + case COMPLIANCE: + { + mergeCompliance(other.getCompliance()); + break; + } + case DSSE_ATTESTATION: + { + mergeDsseAttestation(other.getDsseAttestation()); + break; + } case TYPE_NOT_SET: { break; @@ -5163,6 +5354,415 @@ public io.grafeas.v1.UpgradeNoteOrBuilder getUpgradeOrBuilder() { return upgradeBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.ComplianceNote, + io.grafeas.v1.ComplianceNote.Builder, + io.grafeas.v1.ComplianceNoteOrBuilder> + complianceBuilder_; + /** + * + * + *
+     * A note describing a compliance check.
+     * 
+ * + * .grafeas.v1.ComplianceNote compliance = 18; + * + * @return Whether the compliance field is set. + */ + @java.lang.Override + public boolean hasCompliance() { + return typeCase_ == 18; + } + /** + * + * + *
+     * A note describing a compliance check.
+     * 
+ * + * .grafeas.v1.ComplianceNote compliance = 18; + * + * @return The compliance. + */ + @java.lang.Override + public io.grafeas.v1.ComplianceNote getCompliance() { + if (complianceBuilder_ == null) { + if (typeCase_ == 18) { + return (io.grafeas.v1.ComplianceNote) type_; + } + return io.grafeas.v1.ComplianceNote.getDefaultInstance(); + } else { + if (typeCase_ == 18) { + return complianceBuilder_.getMessage(); + } + return io.grafeas.v1.ComplianceNote.getDefaultInstance(); + } + } + /** + * + * + *
+     * A note describing a compliance check.
+     * 
+ * + * .grafeas.v1.ComplianceNote compliance = 18; + */ + public Builder setCompliance(io.grafeas.v1.ComplianceNote value) { + if (complianceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + complianceBuilder_.setMessage(value); + } + typeCase_ = 18; + return this; + } + /** + * + * + *
+     * A note describing a compliance check.
+     * 
+ * + * .grafeas.v1.ComplianceNote compliance = 18; + */ + public Builder setCompliance(io.grafeas.v1.ComplianceNote.Builder builderForValue) { + if (complianceBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + complianceBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 18; + return this; + } + /** + * + * + *
+     * A note describing a compliance check.
+     * 
+ * + * .grafeas.v1.ComplianceNote compliance = 18; + */ + public Builder mergeCompliance(io.grafeas.v1.ComplianceNote value) { + if (complianceBuilder_ == null) { + if (typeCase_ == 18 && type_ != io.grafeas.v1.ComplianceNote.getDefaultInstance()) { + type_ = + io.grafeas.v1.ComplianceNote.newBuilder((io.grafeas.v1.ComplianceNote) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 18) { + complianceBuilder_.mergeFrom(value); + } + complianceBuilder_.setMessage(value); + } + typeCase_ = 18; + return this; + } + /** + * + * + *
+     * A note describing a compliance check.
+     * 
+ * + * .grafeas.v1.ComplianceNote compliance = 18; + */ + public Builder clearCompliance() { + if (complianceBuilder_ == null) { + if (typeCase_ == 18) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 18) { + typeCase_ = 0; + type_ = null; + } + complianceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A note describing a compliance check.
+     * 
+ * + * .grafeas.v1.ComplianceNote compliance = 18; + */ + public io.grafeas.v1.ComplianceNote.Builder getComplianceBuilder() { + return getComplianceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A note describing a compliance check.
+     * 
+ * + * .grafeas.v1.ComplianceNote compliance = 18; + */ + @java.lang.Override + public io.grafeas.v1.ComplianceNoteOrBuilder getComplianceOrBuilder() { + if ((typeCase_ == 18) && (complianceBuilder_ != null)) { + return complianceBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 18) { + return (io.grafeas.v1.ComplianceNote) type_; + } + return io.grafeas.v1.ComplianceNote.getDefaultInstance(); + } + } + /** + * + * + *
+     * A note describing a compliance check.
+     * 
+ * + * .grafeas.v1.ComplianceNote compliance = 18; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.ComplianceNote, + io.grafeas.v1.ComplianceNote.Builder, + io.grafeas.v1.ComplianceNoteOrBuilder> + getComplianceFieldBuilder() { + if (complianceBuilder_ == null) { + if (!(typeCase_ == 18)) { + type_ = io.grafeas.v1.ComplianceNote.getDefaultInstance(); + } + complianceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.ComplianceNote, + io.grafeas.v1.ComplianceNote.Builder, + io.grafeas.v1.ComplianceNoteOrBuilder>( + (io.grafeas.v1.ComplianceNote) type_, getParentForChildren(), isClean()); + type_ = null; + } + typeCase_ = 18; + onChanged(); + ; + return complianceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.DSSEAttestationNote, + io.grafeas.v1.DSSEAttestationNote.Builder, + io.grafeas.v1.DSSEAttestationNoteOrBuilder> + dsseAttestationBuilder_; + /** + * + * + *
+     * A note describing a dsse attestation note.
+     * 
+ * + * .grafeas.v1.DSSEAttestationNote dsse_attestation = 19; + * + * @return Whether the dsseAttestation field is set. + */ + @java.lang.Override + public boolean hasDsseAttestation() { + return typeCase_ == 19; + } + /** + * + * + *
+     * A note describing a dsse attestation note.
+     * 
+ * + * .grafeas.v1.DSSEAttestationNote dsse_attestation = 19; + * + * @return The dsseAttestation. + */ + @java.lang.Override + public io.grafeas.v1.DSSEAttestationNote getDsseAttestation() { + if (dsseAttestationBuilder_ == null) { + if (typeCase_ == 19) { + return (io.grafeas.v1.DSSEAttestationNote) type_; + } + return io.grafeas.v1.DSSEAttestationNote.getDefaultInstance(); + } else { + if (typeCase_ == 19) { + return dsseAttestationBuilder_.getMessage(); + } + return io.grafeas.v1.DSSEAttestationNote.getDefaultInstance(); + } + } + /** + * + * + *
+     * A note describing a dsse attestation note.
+     * 
+ * + * .grafeas.v1.DSSEAttestationNote dsse_attestation = 19; + */ + public Builder setDsseAttestation(io.grafeas.v1.DSSEAttestationNote value) { + if (dsseAttestationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + dsseAttestationBuilder_.setMessage(value); + } + typeCase_ = 19; + return this; + } + /** + * + * + *
+     * A note describing a dsse attestation note.
+     * 
+ * + * .grafeas.v1.DSSEAttestationNote dsse_attestation = 19; + */ + public Builder setDsseAttestation(io.grafeas.v1.DSSEAttestationNote.Builder builderForValue) { + if (dsseAttestationBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + dsseAttestationBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 19; + return this; + } + /** + * + * + *
+     * A note describing a dsse attestation note.
+     * 
+ * + * .grafeas.v1.DSSEAttestationNote dsse_attestation = 19; + */ + public Builder mergeDsseAttestation(io.grafeas.v1.DSSEAttestationNote value) { + if (dsseAttestationBuilder_ == null) { + if (typeCase_ == 19 && type_ != io.grafeas.v1.DSSEAttestationNote.getDefaultInstance()) { + type_ = + io.grafeas.v1.DSSEAttestationNote.newBuilder( + (io.grafeas.v1.DSSEAttestationNote) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 19) { + dsseAttestationBuilder_.mergeFrom(value); + } + dsseAttestationBuilder_.setMessage(value); + } + typeCase_ = 19; + return this; + } + /** + * + * + *
+     * A note describing a dsse attestation note.
+     * 
+ * + * .grafeas.v1.DSSEAttestationNote dsse_attestation = 19; + */ + public Builder clearDsseAttestation() { + if (dsseAttestationBuilder_ == null) { + if (typeCase_ == 19) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 19) { + typeCase_ = 0; + type_ = null; + } + dsseAttestationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A note describing a dsse attestation note.
+     * 
+ * + * .grafeas.v1.DSSEAttestationNote dsse_attestation = 19; + */ + public io.grafeas.v1.DSSEAttestationNote.Builder getDsseAttestationBuilder() { + return getDsseAttestationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A note describing a dsse attestation note.
+     * 
+ * + * .grafeas.v1.DSSEAttestationNote dsse_attestation = 19; + */ + @java.lang.Override + public io.grafeas.v1.DSSEAttestationNoteOrBuilder getDsseAttestationOrBuilder() { + if ((typeCase_ == 19) && (dsseAttestationBuilder_ != null)) { + return dsseAttestationBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 19) { + return (io.grafeas.v1.DSSEAttestationNote) type_; + } + return io.grafeas.v1.DSSEAttestationNote.getDefaultInstance(); + } + } + /** + * + * + *
+     * A note describing a dsse attestation note.
+     * 
+ * + * .grafeas.v1.DSSEAttestationNote dsse_attestation = 19; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.DSSEAttestationNote, + io.grafeas.v1.DSSEAttestationNote.Builder, + io.grafeas.v1.DSSEAttestationNoteOrBuilder> + getDsseAttestationFieldBuilder() { + if (dsseAttestationBuilder_ == null) { + if (!(typeCase_ == 19)) { + type_ = io.grafeas.v1.DSSEAttestationNote.getDefaultInstance(); + } + dsseAttestationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.DSSEAttestationNote, + io.grafeas.v1.DSSEAttestationNote.Builder, + io.grafeas.v1.DSSEAttestationNoteOrBuilder>( + (io.grafeas.v1.DSSEAttestationNote) type_, getParentForChildren(), isClean()); + type_ = null; + } + typeCase_ = 19; + onChanged(); + ; + return dsseAttestationBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/src/main/java/io/grafeas/v1/NoteKind.java b/src/main/java/io/grafeas/v1/NoteKind.java index 2bd8acf9..d21eac6e 100644 --- a/src/main/java/io/grafeas/v1/NoteKind.java +++ b/src/main/java/io/grafeas/v1/NoteKind.java @@ -33,7 +33,7 @@ public enum NoteKind implements com.google.protobuf.ProtocolMessageEnum { * * *
-   * Unknown.
+   * Default value. This value is unused.
    * 
* * NOTE_KIND_UNSPECIFIED = 0; @@ -119,6 +119,26 @@ public enum NoteKind implements com.google.protobuf.ProtocolMessageEnum { * UPGRADE = 8; */ UPGRADE(8), + /** + * + * + *
+   * This represents a Compliance Note
+   * 
+ * + * COMPLIANCE = 9; + */ + COMPLIANCE(9), + /** + * + * + *
+   * This represents a DSSE attestation Note
+   * 
+ * + * DSSE_ATTESTATION = 10; + */ + DSSE_ATTESTATION(10), UNRECOGNIZED(-1), ; @@ -126,7 +146,7 @@ public enum NoteKind implements com.google.protobuf.ProtocolMessageEnum { * * *
-   * Unknown.
+   * Default value. This value is unused.
    * 
* * NOTE_KIND_UNSPECIFIED = 0; @@ -212,6 +232,26 @@ public enum NoteKind implements com.google.protobuf.ProtocolMessageEnum { * UPGRADE = 8; */ public static final int UPGRADE_VALUE = 8; + /** + * + * + *
+   * This represents a Compliance Note
+   * 
+ * + * COMPLIANCE = 9; + */ + public static final int COMPLIANCE_VALUE = 9; + /** + * + * + *
+   * This represents a DSSE attestation Note
+   * 
+ * + * DSSE_ATTESTATION = 10; + */ + public static final int DSSE_ATTESTATION_VALUE = 10; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -255,6 +295,10 @@ public static NoteKind forNumber(int value) { return ATTESTATION; case 8: return UPGRADE; + case 9: + return COMPLIANCE; + case 10: + return DSSE_ATTESTATION; default: return null; } diff --git a/src/main/java/io/grafeas/v1/NoteOrBuilder.java b/src/main/java/io/grafeas/v1/NoteOrBuilder.java index 5f269093..7bbaf91e 100644 --- a/src/main/java/io/grafeas/v1/NoteOrBuilder.java +++ b/src/main/java/io/grafeas/v1/NoteOrBuilder.java @@ -621,5 +621,75 @@ public interface NoteOrBuilder */ io.grafeas.v1.UpgradeNoteOrBuilder getUpgradeOrBuilder(); + /** + * + * + *
+   * A note describing a compliance check.
+   * 
+ * + * .grafeas.v1.ComplianceNote compliance = 18; + * + * @return Whether the compliance field is set. + */ + boolean hasCompliance(); + /** + * + * + *
+   * A note describing a compliance check.
+   * 
+ * + * .grafeas.v1.ComplianceNote compliance = 18; + * + * @return The compliance. + */ + io.grafeas.v1.ComplianceNote getCompliance(); + /** + * + * + *
+   * A note describing a compliance check.
+   * 
+ * + * .grafeas.v1.ComplianceNote compliance = 18; + */ + io.grafeas.v1.ComplianceNoteOrBuilder getComplianceOrBuilder(); + + /** + * + * + *
+   * A note describing a dsse attestation note.
+   * 
+ * + * .grafeas.v1.DSSEAttestationNote dsse_attestation = 19; + * + * @return Whether the dsseAttestation field is set. + */ + boolean hasDsseAttestation(); + /** + * + * + *
+   * A note describing a dsse attestation note.
+   * 
+ * + * .grafeas.v1.DSSEAttestationNote dsse_attestation = 19; + * + * @return The dsseAttestation. + */ + io.grafeas.v1.DSSEAttestationNote getDsseAttestation(); + /** + * + * + *
+   * A note describing a dsse attestation note.
+   * 
+ * + * .grafeas.v1.DSSEAttestationNote dsse_attestation = 19; + */ + io.grafeas.v1.DSSEAttestationNoteOrBuilder getDsseAttestationOrBuilder(); + public io.grafeas.v1.Note.TypeCase getTypeCase(); } diff --git a/src/main/java/io/grafeas/v1/Occurrence.java b/src/main/java/io/grafeas/v1/Occurrence.java index 788d87a9..0ab518d4 100644 --- a/src/main/java/io/grafeas/v1/Occurrence.java +++ b/src/main/java/io/grafeas/v1/Occurrence.java @@ -260,6 +260,51 @@ private Occurrence( details_ = subBuilder.buildPartial(); } detailsCase_ = 15; + break; + } + case 130: + { + io.grafeas.v1.ComplianceOccurrence.Builder subBuilder = null; + if (detailsCase_ == 16) { + subBuilder = ((io.grafeas.v1.ComplianceOccurrence) details_).toBuilder(); + } + details_ = + input.readMessage(io.grafeas.v1.ComplianceOccurrence.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1.ComplianceOccurrence) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 16; + break; + } + case 138: + { + io.grafeas.v1.DSSEAttestationOccurrence.Builder subBuilder = null; + if (detailsCase_ == 17) { + subBuilder = ((io.grafeas.v1.DSSEAttestationOccurrence) details_).toBuilder(); + } + details_ = + input.readMessage( + io.grafeas.v1.DSSEAttestationOccurrence.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1.DSSEAttestationOccurrence) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 17; + break; + } + case 146: + { + io.grafeas.v1.Envelope.Builder subBuilder = null; + if (envelope_ != null) { + subBuilder = envelope_.toBuilder(); + } + envelope_ = input.readMessage(io.grafeas.v1.Envelope.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(envelope_); + envelope_ = subBuilder.buildPartial(); + } + break; } default: @@ -308,6 +353,8 @@ public enum DetailsCase DISCOVERY(13), ATTESTATION(14), UPGRADE(15), + COMPLIANCE(16), + DSSE_ATTESTATION(17), DETAILS_NOT_SET(0); private final int value; @@ -342,6 +389,10 @@ public static DetailsCase forNumber(int value) { return ATTESTATION; case 15: return UPGRADE; + case 16: + return COMPLIANCE; + case 17: + return DSSE_ATTESTATION; case 0: return DETAILS_NOT_SET; default: @@ -1104,6 +1155,154 @@ public io.grafeas.v1.UpgradeOccurrenceOrBuilder getUpgradeOrBuilder() { return io.grafeas.v1.UpgradeOccurrence.getDefaultInstance(); } + public static final int COMPLIANCE_FIELD_NUMBER = 16; + /** + * + * + *
+   * Describes a compliance violation on a linked resource.
+   * 
+ * + * .grafeas.v1.ComplianceOccurrence compliance = 16; + * + * @return Whether the compliance field is set. + */ + @java.lang.Override + public boolean hasCompliance() { + return detailsCase_ == 16; + } + /** + * + * + *
+   * Describes a compliance violation on a linked resource.
+   * 
+ * + * .grafeas.v1.ComplianceOccurrence compliance = 16; + * + * @return The compliance. + */ + @java.lang.Override + public io.grafeas.v1.ComplianceOccurrence getCompliance() { + if (detailsCase_ == 16) { + return (io.grafeas.v1.ComplianceOccurrence) details_; + } + return io.grafeas.v1.ComplianceOccurrence.getDefaultInstance(); + } + /** + * + * + *
+   * Describes a compliance violation on a linked resource.
+   * 
+ * + * .grafeas.v1.ComplianceOccurrence compliance = 16; + */ + @java.lang.Override + public io.grafeas.v1.ComplianceOccurrenceOrBuilder getComplianceOrBuilder() { + if (detailsCase_ == 16) { + return (io.grafeas.v1.ComplianceOccurrence) details_; + } + return io.grafeas.v1.ComplianceOccurrence.getDefaultInstance(); + } + + public static final int DSSE_ATTESTATION_FIELD_NUMBER = 17; + /** + * + * + *
+   * Describes an attestation of an artifact using dsse.
+   * 
+ * + * .grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17; + * + * @return Whether the dsseAttestation field is set. + */ + @java.lang.Override + public boolean hasDsseAttestation() { + return detailsCase_ == 17; + } + /** + * + * + *
+   * Describes an attestation of an artifact using dsse.
+   * 
+ * + * .grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17; + * + * @return The dsseAttestation. + */ + @java.lang.Override + public io.grafeas.v1.DSSEAttestationOccurrence getDsseAttestation() { + if (detailsCase_ == 17) { + return (io.grafeas.v1.DSSEAttestationOccurrence) details_; + } + return io.grafeas.v1.DSSEAttestationOccurrence.getDefaultInstance(); + } + /** + * + * + *
+   * Describes an attestation of an artifact using dsse.
+   * 
+ * + * .grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17; + */ + @java.lang.Override + public io.grafeas.v1.DSSEAttestationOccurrenceOrBuilder getDsseAttestationOrBuilder() { + if (detailsCase_ == 17) { + return (io.grafeas.v1.DSSEAttestationOccurrence) details_; + } + return io.grafeas.v1.DSSEAttestationOccurrence.getDefaultInstance(); + } + + public static final int ENVELOPE_FIELD_NUMBER = 18; + private io.grafeas.v1.Envelope envelope_; + /** + * + * + *
+   * https://github.com/secure-systems-lab/dsse
+   * 
+ * + * .grafeas.v1.Envelope envelope = 18; + * + * @return Whether the envelope field is set. + */ + @java.lang.Override + public boolean hasEnvelope() { + return envelope_ != null; + } + /** + * + * + *
+   * https://github.com/secure-systems-lab/dsse
+   * 
+ * + * .grafeas.v1.Envelope envelope = 18; + * + * @return The envelope. + */ + @java.lang.Override + public io.grafeas.v1.Envelope getEnvelope() { + return envelope_ == null ? io.grafeas.v1.Envelope.getDefaultInstance() : envelope_; + } + /** + * + * + *
+   * https://github.com/secure-systems-lab/dsse
+   * 
+ * + * .grafeas.v1.Envelope envelope = 18; + */ + @java.lang.Override + public io.grafeas.v1.EnvelopeOrBuilder getEnvelopeOrBuilder() { + return getEnvelope(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1163,6 +1362,15 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (detailsCase_ == 15) { output.writeMessage(15, (io.grafeas.v1.UpgradeOccurrence) details_); } + if (detailsCase_ == 16) { + output.writeMessage(16, (io.grafeas.v1.ComplianceOccurrence) details_); + } + if (detailsCase_ == 17) { + output.writeMessage(17, (io.grafeas.v1.DSSEAttestationOccurrence) details_); + } + if (envelope_ != null) { + output.writeMessage(18, getEnvelope()); + } unknownFields.writeTo(output); } @@ -1233,6 +1441,19 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 15, (io.grafeas.v1.UpgradeOccurrence) details_); } + if (detailsCase_ == 16) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 16, (io.grafeas.v1.ComplianceOccurrence) details_); + } + if (detailsCase_ == 17) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 17, (io.grafeas.v1.DSSEAttestationOccurrence) details_); + } + if (envelope_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getEnvelope()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -1261,6 +1482,10 @@ public boolean equals(final java.lang.Object obj) { if (hasUpdateTime()) { if (!getUpdateTime().equals(other.getUpdateTime())) return false; } + if (hasEnvelope() != other.hasEnvelope()) return false; + if (hasEnvelope()) { + if (!getEnvelope().equals(other.getEnvelope())) return false; + } if (!getDetailsCase().equals(other.getDetailsCase())) return false; switch (detailsCase_) { case 8: @@ -1287,6 +1512,12 @@ public boolean equals(final java.lang.Object obj) { case 15: if (!getUpgrade().equals(other.getUpgrade())) return false; break; + case 16: + if (!getCompliance().equals(other.getCompliance())) return false; + break; + case 17: + if (!getDsseAttestation().equals(other.getDsseAttestation())) return false; + break; case 0: default: } @@ -1319,6 +1550,10 @@ public int hashCode() { hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getUpdateTime().hashCode(); } + if (hasEnvelope()) { + hash = (37 * hash) + ENVELOPE_FIELD_NUMBER; + hash = (53 * hash) + getEnvelope().hashCode(); + } switch (detailsCase_) { case 8: hash = (37 * hash) + VULNERABILITY_FIELD_NUMBER; @@ -1352,6 +1587,14 @@ public int hashCode() { hash = (37 * hash) + UPGRADE_FIELD_NUMBER; hash = (53 * hash) + getUpgrade().hashCode(); break; + case 16: + hash = (37 * hash) + COMPLIANCE_FIELD_NUMBER; + hash = (53 * hash) + getCompliance().hashCode(); + break; + case 17: + hash = (37 * hash) + DSSE_ATTESTATION_FIELD_NUMBER; + hash = (53 * hash) + getDsseAttestation().hashCode(); + break; case 0: default: } @@ -1519,6 +1762,12 @@ public Builder clear() { updateTime_ = null; updateTimeBuilder_ = null; } + if (envelopeBuilder_ == null) { + envelope_ = null; + } else { + envelope_ = null; + envelopeBuilder_ = null; + } detailsCase_ = 0; details_ = null; return this; @@ -1617,6 +1866,25 @@ public io.grafeas.v1.Occurrence buildPartial() { result.details_ = upgradeBuilder_.build(); } } + if (detailsCase_ == 16) { + if (complianceBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = complianceBuilder_.build(); + } + } + if (detailsCase_ == 17) { + if (dsseAttestationBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = dsseAttestationBuilder_.build(); + } + } + if (envelopeBuilder_ == null) { + result.envelope_ = envelope_; + } else { + result.envelope_ = envelopeBuilder_.build(); + } result.detailsCase_ = detailsCase_; onBuilt(); return result; @@ -1692,6 +1960,9 @@ public Builder mergeFrom(io.grafeas.v1.Occurrence other) { if (other.hasUpdateTime()) { mergeUpdateTime(other.getUpdateTime()); } + if (other.hasEnvelope()) { + mergeEnvelope(other.getEnvelope()); + } switch (other.getDetailsCase()) { case VULNERABILITY: { @@ -1733,6 +2004,16 @@ public Builder mergeFrom(io.grafeas.v1.Occurrence other) { mergeUpgrade(other.getUpgrade()); break; } + case COMPLIANCE: + { + mergeCompliance(other.getCompliance()); + break; + } + case DSSE_ATTESTATION: + { + mergeDsseAttestation(other.getDsseAttestation()); + break; + } case DETAILS_NOT_SET: { break; @@ -4344,6 +4625,594 @@ public io.grafeas.v1.UpgradeOccurrenceOrBuilder getUpgradeOrBuilder() { return upgradeBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.ComplianceOccurrence, + io.grafeas.v1.ComplianceOccurrence.Builder, + io.grafeas.v1.ComplianceOccurrenceOrBuilder> + complianceBuilder_; + /** + * + * + *
+     * Describes a compliance violation on a linked resource.
+     * 
+ * + * .grafeas.v1.ComplianceOccurrence compliance = 16; + * + * @return Whether the compliance field is set. + */ + @java.lang.Override + public boolean hasCompliance() { + return detailsCase_ == 16; + } + /** + * + * + *
+     * Describes a compliance violation on a linked resource.
+     * 
+ * + * .grafeas.v1.ComplianceOccurrence compliance = 16; + * + * @return The compliance. + */ + @java.lang.Override + public io.grafeas.v1.ComplianceOccurrence getCompliance() { + if (complianceBuilder_ == null) { + if (detailsCase_ == 16) { + return (io.grafeas.v1.ComplianceOccurrence) details_; + } + return io.grafeas.v1.ComplianceOccurrence.getDefaultInstance(); + } else { + if (detailsCase_ == 16) { + return complianceBuilder_.getMessage(); + } + return io.grafeas.v1.ComplianceOccurrence.getDefaultInstance(); + } + } + /** + * + * + *
+     * Describes a compliance violation on a linked resource.
+     * 
+ * + * .grafeas.v1.ComplianceOccurrence compliance = 16; + */ + public Builder setCompliance(io.grafeas.v1.ComplianceOccurrence value) { + if (complianceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + complianceBuilder_.setMessage(value); + } + detailsCase_ = 16; + return this; + } + /** + * + * + *
+     * Describes a compliance violation on a linked resource.
+     * 
+ * + * .grafeas.v1.ComplianceOccurrence compliance = 16; + */ + public Builder setCompliance(io.grafeas.v1.ComplianceOccurrence.Builder builderForValue) { + if (complianceBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + complianceBuilder_.setMessage(builderForValue.build()); + } + detailsCase_ = 16; + return this; + } + /** + * + * + *
+     * Describes a compliance violation on a linked resource.
+     * 
+ * + * .grafeas.v1.ComplianceOccurrence compliance = 16; + */ + public Builder mergeCompliance(io.grafeas.v1.ComplianceOccurrence value) { + if (complianceBuilder_ == null) { + if (detailsCase_ == 16 + && details_ != io.grafeas.v1.ComplianceOccurrence.getDefaultInstance()) { + details_ = + io.grafeas.v1.ComplianceOccurrence.newBuilder( + (io.grafeas.v1.ComplianceOccurrence) details_) + .mergeFrom(value) + .buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + if (detailsCase_ == 16) { + complianceBuilder_.mergeFrom(value); + } + complianceBuilder_.setMessage(value); + } + detailsCase_ = 16; + return this; + } + /** + * + * + *
+     * Describes a compliance violation on a linked resource.
+     * 
+ * + * .grafeas.v1.ComplianceOccurrence compliance = 16; + */ + public Builder clearCompliance() { + if (complianceBuilder_ == null) { + if (detailsCase_ == 16) { + detailsCase_ = 0; + details_ = null; + onChanged(); + } + } else { + if (detailsCase_ == 16) { + detailsCase_ = 0; + details_ = null; + } + complianceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Describes a compliance violation on a linked resource.
+     * 
+ * + * .grafeas.v1.ComplianceOccurrence compliance = 16; + */ + public io.grafeas.v1.ComplianceOccurrence.Builder getComplianceBuilder() { + return getComplianceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Describes a compliance violation on a linked resource.
+     * 
+ * + * .grafeas.v1.ComplianceOccurrence compliance = 16; + */ + @java.lang.Override + public io.grafeas.v1.ComplianceOccurrenceOrBuilder getComplianceOrBuilder() { + if ((detailsCase_ == 16) && (complianceBuilder_ != null)) { + return complianceBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 16) { + return (io.grafeas.v1.ComplianceOccurrence) details_; + } + return io.grafeas.v1.ComplianceOccurrence.getDefaultInstance(); + } + } + /** + * + * + *
+     * Describes a compliance violation on a linked resource.
+     * 
+ * + * .grafeas.v1.ComplianceOccurrence compliance = 16; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.ComplianceOccurrence, + io.grafeas.v1.ComplianceOccurrence.Builder, + io.grafeas.v1.ComplianceOccurrenceOrBuilder> + getComplianceFieldBuilder() { + if (complianceBuilder_ == null) { + if (!(detailsCase_ == 16)) { + details_ = io.grafeas.v1.ComplianceOccurrence.getDefaultInstance(); + } + complianceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.ComplianceOccurrence, + io.grafeas.v1.ComplianceOccurrence.Builder, + io.grafeas.v1.ComplianceOccurrenceOrBuilder>( + (io.grafeas.v1.ComplianceOccurrence) details_, getParentForChildren(), isClean()); + details_ = null; + } + detailsCase_ = 16; + onChanged(); + ; + return complianceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.DSSEAttestationOccurrence, + io.grafeas.v1.DSSEAttestationOccurrence.Builder, + io.grafeas.v1.DSSEAttestationOccurrenceOrBuilder> + dsseAttestationBuilder_; + /** + * + * + *
+     * Describes an attestation of an artifact using dsse.
+     * 
+ * + * .grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17; + * + * @return Whether the dsseAttestation field is set. + */ + @java.lang.Override + public boolean hasDsseAttestation() { + return detailsCase_ == 17; + } + /** + * + * + *
+     * Describes an attestation of an artifact using dsse.
+     * 
+ * + * .grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17; + * + * @return The dsseAttestation. + */ + @java.lang.Override + public io.grafeas.v1.DSSEAttestationOccurrence getDsseAttestation() { + if (dsseAttestationBuilder_ == null) { + if (detailsCase_ == 17) { + return (io.grafeas.v1.DSSEAttestationOccurrence) details_; + } + return io.grafeas.v1.DSSEAttestationOccurrence.getDefaultInstance(); + } else { + if (detailsCase_ == 17) { + return dsseAttestationBuilder_.getMessage(); + } + return io.grafeas.v1.DSSEAttestationOccurrence.getDefaultInstance(); + } + } + /** + * + * + *
+     * Describes an attestation of an artifact using dsse.
+     * 
+ * + * .grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17; + */ + public Builder setDsseAttestation(io.grafeas.v1.DSSEAttestationOccurrence value) { + if (dsseAttestationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + dsseAttestationBuilder_.setMessage(value); + } + detailsCase_ = 17; + return this; + } + /** + * + * + *
+     * Describes an attestation of an artifact using dsse.
+     * 
+ * + * .grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17; + */ + public Builder setDsseAttestation( + io.grafeas.v1.DSSEAttestationOccurrence.Builder builderForValue) { + if (dsseAttestationBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + dsseAttestationBuilder_.setMessage(builderForValue.build()); + } + detailsCase_ = 17; + return this; + } + /** + * + * + *
+     * Describes an attestation of an artifact using dsse.
+     * 
+ * + * .grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17; + */ + public Builder mergeDsseAttestation(io.grafeas.v1.DSSEAttestationOccurrence value) { + if (dsseAttestationBuilder_ == null) { + if (detailsCase_ == 17 + && details_ != io.grafeas.v1.DSSEAttestationOccurrence.getDefaultInstance()) { + details_ = + io.grafeas.v1.DSSEAttestationOccurrence.newBuilder( + (io.grafeas.v1.DSSEAttestationOccurrence) details_) + .mergeFrom(value) + .buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + if (detailsCase_ == 17) { + dsseAttestationBuilder_.mergeFrom(value); + } + dsseAttestationBuilder_.setMessage(value); + } + detailsCase_ = 17; + return this; + } + /** + * + * + *
+     * Describes an attestation of an artifact using dsse.
+     * 
+ * + * .grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17; + */ + public Builder clearDsseAttestation() { + if (dsseAttestationBuilder_ == null) { + if (detailsCase_ == 17) { + detailsCase_ = 0; + details_ = null; + onChanged(); + } + } else { + if (detailsCase_ == 17) { + detailsCase_ = 0; + details_ = null; + } + dsseAttestationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Describes an attestation of an artifact using dsse.
+     * 
+ * + * .grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17; + */ + public io.grafeas.v1.DSSEAttestationOccurrence.Builder getDsseAttestationBuilder() { + return getDsseAttestationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Describes an attestation of an artifact using dsse.
+     * 
+ * + * .grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17; + */ + @java.lang.Override + public io.grafeas.v1.DSSEAttestationOccurrenceOrBuilder getDsseAttestationOrBuilder() { + if ((detailsCase_ == 17) && (dsseAttestationBuilder_ != null)) { + return dsseAttestationBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 17) { + return (io.grafeas.v1.DSSEAttestationOccurrence) details_; + } + return io.grafeas.v1.DSSEAttestationOccurrence.getDefaultInstance(); + } + } + /** + * + * + *
+     * Describes an attestation of an artifact using dsse.
+     * 
+ * + * .grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.DSSEAttestationOccurrence, + io.grafeas.v1.DSSEAttestationOccurrence.Builder, + io.grafeas.v1.DSSEAttestationOccurrenceOrBuilder> + getDsseAttestationFieldBuilder() { + if (dsseAttestationBuilder_ == null) { + if (!(detailsCase_ == 17)) { + details_ = io.grafeas.v1.DSSEAttestationOccurrence.getDefaultInstance(); + } + dsseAttestationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.DSSEAttestationOccurrence, + io.grafeas.v1.DSSEAttestationOccurrence.Builder, + io.grafeas.v1.DSSEAttestationOccurrenceOrBuilder>( + (io.grafeas.v1.DSSEAttestationOccurrence) details_, + getParentForChildren(), + isClean()); + details_ = null; + } + detailsCase_ = 17; + onChanged(); + ; + return dsseAttestationBuilder_; + } + + private io.grafeas.v1.Envelope envelope_; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.Envelope, io.grafeas.v1.Envelope.Builder, io.grafeas.v1.EnvelopeOrBuilder> + envelopeBuilder_; + /** + * + * + *
+     * https://github.com/secure-systems-lab/dsse
+     * 
+ * + * .grafeas.v1.Envelope envelope = 18; + * + * @return Whether the envelope field is set. + */ + public boolean hasEnvelope() { + return envelopeBuilder_ != null || envelope_ != null; + } + /** + * + * + *
+     * https://github.com/secure-systems-lab/dsse
+     * 
+ * + * .grafeas.v1.Envelope envelope = 18; + * + * @return The envelope. + */ + public io.grafeas.v1.Envelope getEnvelope() { + if (envelopeBuilder_ == null) { + return envelope_ == null ? io.grafeas.v1.Envelope.getDefaultInstance() : envelope_; + } else { + return envelopeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * https://github.com/secure-systems-lab/dsse
+     * 
+ * + * .grafeas.v1.Envelope envelope = 18; + */ + public Builder setEnvelope(io.grafeas.v1.Envelope value) { + if (envelopeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + envelope_ = value; + onChanged(); + } else { + envelopeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * https://github.com/secure-systems-lab/dsse
+     * 
+ * + * .grafeas.v1.Envelope envelope = 18; + */ + public Builder setEnvelope(io.grafeas.v1.Envelope.Builder builderForValue) { + if (envelopeBuilder_ == null) { + envelope_ = builderForValue.build(); + onChanged(); + } else { + envelopeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * https://github.com/secure-systems-lab/dsse
+     * 
+ * + * .grafeas.v1.Envelope envelope = 18; + */ + public Builder mergeEnvelope(io.grafeas.v1.Envelope value) { + if (envelopeBuilder_ == null) { + if (envelope_ != null) { + envelope_ = io.grafeas.v1.Envelope.newBuilder(envelope_).mergeFrom(value).buildPartial(); + } else { + envelope_ = value; + } + onChanged(); + } else { + envelopeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * https://github.com/secure-systems-lab/dsse
+     * 
+ * + * .grafeas.v1.Envelope envelope = 18; + */ + public Builder clearEnvelope() { + if (envelopeBuilder_ == null) { + envelope_ = null; + onChanged(); + } else { + envelope_ = null; + envelopeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * https://github.com/secure-systems-lab/dsse
+     * 
+ * + * .grafeas.v1.Envelope envelope = 18; + */ + public io.grafeas.v1.Envelope.Builder getEnvelopeBuilder() { + + onChanged(); + return getEnvelopeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * https://github.com/secure-systems-lab/dsse
+     * 
+ * + * .grafeas.v1.Envelope envelope = 18; + */ + public io.grafeas.v1.EnvelopeOrBuilder getEnvelopeOrBuilder() { + if (envelopeBuilder_ != null) { + return envelopeBuilder_.getMessageOrBuilder(); + } else { + return envelope_ == null ? io.grafeas.v1.Envelope.getDefaultInstance() : envelope_; + } + } + /** + * + * + *
+     * https://github.com/secure-systems-lab/dsse
+     * 
+ * + * .grafeas.v1.Envelope envelope = 18; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.Envelope, io.grafeas.v1.Envelope.Builder, io.grafeas.v1.EnvelopeOrBuilder> + getEnvelopeFieldBuilder() { + if (envelopeBuilder_ == null) { + envelopeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.Envelope, + io.grafeas.v1.Envelope.Builder, + io.grafeas.v1.EnvelopeOrBuilder>(getEnvelope(), getParentForChildren(), isClean()); + envelope_ = null; + } + return envelopeBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/src/main/java/io/grafeas/v1/OccurrenceOrBuilder.java b/src/main/java/io/grafeas/v1/OccurrenceOrBuilder.java index 8de233c5..0782691e 100644 --- a/src/main/java/io/grafeas/v1/OccurrenceOrBuilder.java +++ b/src/main/java/io/grafeas/v1/OccurrenceOrBuilder.java @@ -514,5 +514,110 @@ public interface OccurrenceOrBuilder */ io.grafeas.v1.UpgradeOccurrenceOrBuilder getUpgradeOrBuilder(); + /** + * + * + *
+   * Describes a compliance violation on a linked resource.
+   * 
+ * + * .grafeas.v1.ComplianceOccurrence compliance = 16; + * + * @return Whether the compliance field is set. + */ + boolean hasCompliance(); + /** + * + * + *
+   * Describes a compliance violation on a linked resource.
+   * 
+ * + * .grafeas.v1.ComplianceOccurrence compliance = 16; + * + * @return The compliance. + */ + io.grafeas.v1.ComplianceOccurrence getCompliance(); + /** + * + * + *
+   * Describes a compliance violation on a linked resource.
+   * 
+ * + * .grafeas.v1.ComplianceOccurrence compliance = 16; + */ + io.grafeas.v1.ComplianceOccurrenceOrBuilder getComplianceOrBuilder(); + + /** + * + * + *
+   * Describes an attestation of an artifact using dsse.
+   * 
+ * + * .grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17; + * + * @return Whether the dsseAttestation field is set. + */ + boolean hasDsseAttestation(); + /** + * + * + *
+   * Describes an attestation of an artifact using dsse.
+   * 
+ * + * .grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17; + * + * @return The dsseAttestation. + */ + io.grafeas.v1.DSSEAttestationOccurrence getDsseAttestation(); + /** + * + * + *
+   * Describes an attestation of an artifact using dsse.
+   * 
+ * + * .grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17; + */ + io.grafeas.v1.DSSEAttestationOccurrenceOrBuilder getDsseAttestationOrBuilder(); + + /** + * + * + *
+   * https://github.com/secure-systems-lab/dsse
+   * 
+ * + * .grafeas.v1.Envelope envelope = 18; + * + * @return Whether the envelope field is set. + */ + boolean hasEnvelope(); + /** + * + * + *
+   * https://github.com/secure-systems-lab/dsse
+   * 
+ * + * .grafeas.v1.Envelope envelope = 18; + * + * @return The envelope. + */ + io.grafeas.v1.Envelope getEnvelope(); + /** + * + * + *
+   * https://github.com/secure-systems-lab/dsse
+   * 
+ * + * .grafeas.v1.Envelope envelope = 18; + */ + io.grafeas.v1.EnvelopeOrBuilder getEnvelopeOrBuilder(); + public io.grafeas.v1.Occurrence.DetailsCase getDetailsCase(); } diff --git a/src/main/java/io/grafeas/v1/Package.java b/src/main/java/io/grafeas/v1/Package.java index fe5a0214..b8a628a4 100644 --- a/src/main/java/io/grafeas/v1/Package.java +++ b/src/main/java/io/grafeas/v1/Package.java @@ -68,16 +68,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ame\030\001 \001(\t\022.\n\014distribution\030\n \003(\0132\030.grafea" + "s.v1.Distribution\"I\n\021PackageOccurrence\022\014" + "\n\004name\030\001 \001(\t\022&\n\010location\030\002 \003(\0132\024.grafeas" - + ".v1.Location\"\315\001\n\007Version\022\r\n\005epoch\030\001 \001(\005\022" - + "\014\n\004name\030\002 \001(\t\022\020\n\010revision\030\003 \001(\t\022-\n\004kind\030" - + "\004 \001(\0162\037.grafeas.v1.Version.VersionKind\022\021" - + "\n\tfull_name\030\005 \001(\t\"Q\n\013VersionKind\022\034\n\030VERS" - + "ION_KIND_UNSPECIFIED\020\000\022\n\n\006NORMAL\020\001\022\013\n\007MI" - + "NIMUM\020\002\022\013\n\007MAXIMUM\020\003*>\n\014Architecture\022\034\n\030" - + "ARCHITECTURE_UNSPECIFIED\020\000\022\007\n\003X86\020\001\022\007\n\003X" - + "64\020\002BQ\n\rio.grafeas.v1P\001Z8google.golang.o" - + "rg/genproto/googleapis/grafeas/v1;grafea" - + "s\242\002\003GRAb\006proto3" + + ".v1.Location\"\340\001\n\007Version\022\r\n\005epoch\030\001 \001(\005\022" + + "\014\n\004name\030\002 \001(\t\022\020\n\010revision\030\003 \001(\t\022\021\n\tinclu" + + "sive\030\006 \001(\010\022-\n\004kind\030\004 \001(\0162\037.grafeas.v1.Ve" + + "rsion.VersionKind\022\021\n\tfull_name\030\005 \001(\t\"Q\n\013" + + "VersionKind\022\034\n\030VERSION_KIND_UNSPECIFIED\020" + + "\000\022\n\n\006NORMAL\020\001\022\013\n\007MINIMUM\020\002\022\013\n\007MAXIMUM\020\003*" + + ">\n\014Architecture\022\034\n\030ARCHITECTURE_UNSPECIF" + + "IED\020\000\022\007\n\003X86\020\001\022\007\n\003X64\020\002BQ\n\rio.grafeas.v1" + + "P\001Z8google.golang.org/genproto/googleapi" + + "s/grafeas/v1;grafeas\242\002\003GRAb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -116,7 +116,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_grafeas_v1_Version_descriptor, new java.lang.String[] { - "Epoch", "Name", "Revision", "Kind", "FullName", + "Epoch", "Name", "Revision", "Inclusive", "Kind", "FullName", }); } diff --git a/src/main/java/io/grafeas/v1/Recipe.java b/src/main/java/io/grafeas/v1/Recipe.java new file mode 100644 index 00000000..e69853fd --- /dev/null +++ b/src/main/java/io/grafeas/v1/Recipe.java @@ -0,0 +1,2097 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/intoto_provenance.proto + +package io.grafeas.v1; + +/** + * + * + *
+ * Steps taken to build the artifact.
+ * For a TaskRun, typically each container corresponds to one step in the
+ * recipe.
+ * 
+ * + * Protobuf type {@code grafeas.v1.Recipe} + */ +public final class Recipe extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.Recipe) + RecipeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Recipe.newBuilder() to construct. + private Recipe(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Recipe() { + type_ = ""; + entryPoint_ = ""; + arguments_ = java.util.Collections.emptyList(); + environment_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Recipe(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Recipe( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 16: + { + definedInMaterial_ = input.readInt64(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + entryPoint_ = s; + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + arguments_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + arguments_.add( + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry)); + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + environment_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + environment_.add( + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + arguments_ = java.util.Collections.unmodifiableList(arguments_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + environment_ = java.util.Collections.unmodifiableList(environment_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.InTotoProvenanceProto.internal_static_grafeas_v1_Recipe_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.InTotoProvenanceProto.internal_static_grafeas_v1_Recipe_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.Recipe.class, io.grafeas.v1.Recipe.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object type_; + /** + * + * + *
+   * URI indicating what type of recipe was performed. It determines the meaning
+   * of recipe.entryPoint, recipe.arguments, recipe.environment, and materials.
+   * 
+ * + * string type = 1; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + 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(); + type_ = s; + return s; + } + } + /** + * + * + *
+   * URI indicating what type of recipe was performed. It determines the meaning
+   * of recipe.entryPoint, recipe.arguments, recipe.environment, and materials.
+   * 
+ * + * string type = 1; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEFINED_IN_MATERIAL_FIELD_NUMBER = 2; + private long definedInMaterial_; + /** + * + * + *
+   * Index in materials containing the recipe steps that are not implied by
+   * recipe.type. For example, if the recipe type were "make", then this would
+   * point to the source containing the Makefile, not the make program itself.
+   * Set to -1 if the recipe doesn't come from a material, as zero is default
+   * unset value for int64.
+   * 
+ * + * int64 defined_in_material = 2; + * + * @return The definedInMaterial. + */ + @java.lang.Override + public long getDefinedInMaterial() { + return definedInMaterial_; + } + + public static final int ENTRY_POINT_FIELD_NUMBER = 3; + private volatile java.lang.Object entryPoint_; + /** + * + * + *
+   * String identifying the entry point into the build.
+   * This is often a path to a configuration file and/or a target label within
+   * that file. The syntax and meaning are defined by recipe.type. For example,
+   * if the recipe type were "make", then this would reference the directory in
+   * which to run make as well as which target to use.
+   * 
+ * + * string entry_point = 3; + * + * @return The entryPoint. + */ + @java.lang.Override + public java.lang.String getEntryPoint() { + java.lang.Object ref = entryPoint_; + 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(); + entryPoint_ = s; + return s; + } + } + /** + * + * + *
+   * String identifying the entry point into the build.
+   * This is often a path to a configuration file and/or a target label within
+   * that file. The syntax and meaning are defined by recipe.type. For example,
+   * if the recipe type were "make", then this would reference the directory in
+   * which to run make as well as which target to use.
+   * 
+ * + * string entry_point = 3; + * + * @return The bytes for entryPoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEntryPointBytes() { + java.lang.Object ref = entryPoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entryPoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ARGUMENTS_FIELD_NUMBER = 4; + private java.util.List arguments_; + /** + * + * + *
+   * Collection of all external inputs that influenced the build on top of
+   * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+   * type were "make", then this might be the flags passed to make aside from
+   * the target, which is captured in recipe.entryPoint. Since the arguments
+   * field can greatly vary in structure, depending on the builder and recipe
+   * type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + @java.lang.Override + public java.util.List getArgumentsList() { + return arguments_; + } + /** + * + * + *
+   * Collection of all external inputs that influenced the build on top of
+   * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+   * type were "make", then this might be the flags passed to make aside from
+   * the target, which is captured in recipe.entryPoint. Since the arguments
+   * field can greatly vary in structure, depending on the builder and recipe
+   * type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + @java.lang.Override + public java.util.List getArgumentsOrBuilderList() { + return arguments_; + } + /** + * + * + *
+   * Collection of all external inputs that influenced the build on top of
+   * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+   * type were "make", then this might be the flags passed to make aside from
+   * the target, which is captured in recipe.entryPoint. Since the arguments
+   * field can greatly vary in structure, depending on the builder and recipe
+   * type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + @java.lang.Override + public int getArgumentsCount() { + return arguments_.size(); + } + /** + * + * + *
+   * Collection of all external inputs that influenced the build on top of
+   * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+   * type were "make", then this might be the flags passed to make aside from
+   * the target, which is captured in recipe.entryPoint. Since the arguments
+   * field can greatly vary in structure, depending on the builder and recipe
+   * type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + @java.lang.Override + public com.google.protobuf.Any getArguments(int index) { + return arguments_.get(index); + } + /** + * + * + *
+   * Collection of all external inputs that influenced the build on top of
+   * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+   * type were "make", then this might be the flags passed to make aside from
+   * the target, which is captured in recipe.entryPoint. Since the arguments
+   * field can greatly vary in structure, depending on the builder and recipe
+   * type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getArgumentsOrBuilder(int index) { + return arguments_.get(index); + } + + public static final int ENVIRONMENT_FIELD_NUMBER = 5; + private java.util.List environment_; + /** + * + * + *
+   * Any other builder-controlled inputs necessary for correctly evaluating the
+   * recipe. Usually only needed for reproducing the build but not evaluated as
+   * part of policy. Since the environment field can greatly vary in structure,
+   * depending on the builder and recipe type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + @java.lang.Override + public java.util.List getEnvironmentList() { + return environment_; + } + /** + * + * + *
+   * Any other builder-controlled inputs necessary for correctly evaluating the
+   * recipe. Usually only needed for reproducing the build but not evaluated as
+   * part of policy. Since the environment field can greatly vary in structure,
+   * depending on the builder and recipe type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + @java.lang.Override + public java.util.List getEnvironmentOrBuilderList() { + return environment_; + } + /** + * + * + *
+   * Any other builder-controlled inputs necessary for correctly evaluating the
+   * recipe. Usually only needed for reproducing the build but not evaluated as
+   * part of policy. Since the environment field can greatly vary in structure,
+   * depending on the builder and recipe type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + @java.lang.Override + public int getEnvironmentCount() { + return environment_.size(); + } + /** + * + * + *
+   * Any other builder-controlled inputs necessary for correctly evaluating the
+   * recipe. Usually only needed for reproducing the build but not evaluated as
+   * part of policy. Since the environment field can greatly vary in structure,
+   * depending on the builder and recipe type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + @java.lang.Override + public com.google.protobuf.Any getEnvironment(int index) { + return environment_.get(index); + } + /** + * + * + *
+   * Any other builder-controlled inputs necessary for correctly evaluating the
+   * recipe. Usually only needed for reproducing the build but not evaluated as
+   * part of policy. Since the environment field can greatly vary in structure,
+   * depending on the builder and recipe type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getEnvironmentOrBuilder(int index) { + return environment_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); + } + if (definedInMaterial_ != 0L) { + output.writeInt64(2, definedInMaterial_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entryPoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, entryPoint_); + } + for (int i = 0; i < arguments_.size(); i++) { + output.writeMessage(4, arguments_.get(i)); + } + for (int i = 0; i < environment_.size(); i++) { + output.writeMessage(5, environment_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); + } + if (definedInMaterial_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, definedInMaterial_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entryPoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, entryPoint_); + } + for (int i = 0; i < arguments_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, arguments_.get(i)); + } + for (int i = 0; i < environment_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, environment_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.Recipe)) { + return super.equals(obj); + } + io.grafeas.v1.Recipe other = (io.grafeas.v1.Recipe) obj; + + if (!getType().equals(other.getType())) return false; + if (getDefinedInMaterial() != other.getDefinedInMaterial()) return false; + if (!getEntryPoint().equals(other.getEntryPoint())) return false; + if (!getArgumentsList().equals(other.getArgumentsList())) return false; + if (!getEnvironmentList().equals(other.getEnvironmentList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + DEFINED_IN_MATERIAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getDefinedInMaterial()); + hash = (37 * hash) + ENTRY_POINT_FIELD_NUMBER; + hash = (53 * hash) + getEntryPoint().hashCode(); + if (getArgumentsCount() > 0) { + hash = (37 * hash) + ARGUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getArgumentsList().hashCode(); + } + if (getEnvironmentCount() > 0) { + hash = (37 * hash) + ENVIRONMENT_FIELD_NUMBER; + hash = (53 * hash) + getEnvironmentList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.Recipe parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.Recipe parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.Recipe parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.Recipe parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.Recipe parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.Recipe parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.Recipe parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.Recipe parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.Recipe parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.Recipe parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.Recipe parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.Recipe parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.Recipe 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Steps taken to build the artifact.
+   * For a TaskRun, typically each container corresponds to one step in the
+   * recipe.
+   * 
+ * + * Protobuf type {@code grafeas.v1.Recipe} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.Recipe) + io.grafeas.v1.RecipeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.InTotoProvenanceProto.internal_static_grafeas_v1_Recipe_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.InTotoProvenanceProto + .internal_static_grafeas_v1_Recipe_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.Recipe.class, io.grafeas.v1.Recipe.Builder.class); + } + + // Construct using io.grafeas.v1.Recipe.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getArgumentsFieldBuilder(); + getEnvironmentFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = ""; + + definedInMaterial_ = 0L; + + entryPoint_ = ""; + + if (argumentsBuilder_ == null) { + arguments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + argumentsBuilder_.clear(); + } + if (environmentBuilder_ == null) { + environment_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + environmentBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.InTotoProvenanceProto.internal_static_grafeas_v1_Recipe_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.Recipe getDefaultInstanceForType() { + return io.grafeas.v1.Recipe.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.Recipe build() { + io.grafeas.v1.Recipe result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.Recipe buildPartial() { + io.grafeas.v1.Recipe result = new io.grafeas.v1.Recipe(this); + int from_bitField0_ = bitField0_; + result.type_ = type_; + result.definedInMaterial_ = definedInMaterial_; + result.entryPoint_ = entryPoint_; + if (argumentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + arguments_ = java.util.Collections.unmodifiableList(arguments_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.arguments_ = arguments_; + } else { + result.arguments_ = argumentsBuilder_.build(); + } + if (environmentBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + environment_ = java.util.Collections.unmodifiableList(environment_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.environment_ = environment_; + } else { + result.environment_ = environmentBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.Recipe) { + return mergeFrom((io.grafeas.v1.Recipe) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.Recipe other) { + if (other == io.grafeas.v1.Recipe.getDefaultInstance()) return this; + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (other.getDefinedInMaterial() != 0L) { + setDefinedInMaterial(other.getDefinedInMaterial()); + } + if (!other.getEntryPoint().isEmpty()) { + entryPoint_ = other.entryPoint_; + onChanged(); + } + if (argumentsBuilder_ == null) { + if (!other.arguments_.isEmpty()) { + if (arguments_.isEmpty()) { + arguments_ = other.arguments_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureArgumentsIsMutable(); + arguments_.addAll(other.arguments_); + } + onChanged(); + } + } else { + if (!other.arguments_.isEmpty()) { + if (argumentsBuilder_.isEmpty()) { + argumentsBuilder_.dispose(); + argumentsBuilder_ = null; + arguments_ = other.arguments_; + bitField0_ = (bitField0_ & ~0x00000001); + argumentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getArgumentsFieldBuilder() + : null; + } else { + argumentsBuilder_.addAllMessages(other.arguments_); + } + } + } + if (environmentBuilder_ == null) { + if (!other.environment_.isEmpty()) { + if (environment_.isEmpty()) { + environment_ = other.environment_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureEnvironmentIsMutable(); + environment_.addAll(other.environment_); + } + onChanged(); + } + } else { + if (!other.environment_.isEmpty()) { + if (environmentBuilder_.isEmpty()) { + environmentBuilder_.dispose(); + environmentBuilder_ = null; + environment_ = other.environment_; + bitField0_ = (bitField0_ & ~0x00000002); + environmentBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEnvironmentFieldBuilder() + : null; + } else { + environmentBuilder_.addAllMessages(other.environment_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.Recipe parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.Recipe) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * URI indicating what type of recipe was performed. It determines the meaning
+     * of recipe.entryPoint, recipe.arguments, recipe.environment, and materials.
+     * 
+ * + * string type = 1; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * URI indicating what type of recipe was performed. It determines the meaning
+     * of recipe.entryPoint, recipe.arguments, recipe.environment, and materials.
+     * 
+ * + * string type = 1; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * URI indicating what type of recipe was performed. It determines the meaning
+     * of recipe.entryPoint, recipe.arguments, recipe.environment, and materials.
+     * 
+ * + * string type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * URI indicating what type of recipe was performed. It determines the meaning
+     * of recipe.entryPoint, recipe.arguments, recipe.environment, and materials.
+     * 
+ * + * string type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * URI indicating what type of recipe was performed. It determines the meaning
+     * of recipe.entryPoint, recipe.arguments, recipe.environment, and materials.
+     * 
+ * + * string type = 1; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private long definedInMaterial_; + /** + * + * + *
+     * Index in materials containing the recipe steps that are not implied by
+     * recipe.type. For example, if the recipe type were "make", then this would
+     * point to the source containing the Makefile, not the make program itself.
+     * Set to -1 if the recipe doesn't come from a material, as zero is default
+     * unset value for int64.
+     * 
+ * + * int64 defined_in_material = 2; + * + * @return The definedInMaterial. + */ + @java.lang.Override + public long getDefinedInMaterial() { + return definedInMaterial_; + } + /** + * + * + *
+     * Index in materials containing the recipe steps that are not implied by
+     * recipe.type. For example, if the recipe type were "make", then this would
+     * point to the source containing the Makefile, not the make program itself.
+     * Set to -1 if the recipe doesn't come from a material, as zero is default
+     * unset value for int64.
+     * 
+ * + * int64 defined_in_material = 2; + * + * @param value The definedInMaterial to set. + * @return This builder for chaining. + */ + public Builder setDefinedInMaterial(long value) { + + definedInMaterial_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Index in materials containing the recipe steps that are not implied by
+     * recipe.type. For example, if the recipe type were "make", then this would
+     * point to the source containing the Makefile, not the make program itself.
+     * Set to -1 if the recipe doesn't come from a material, as zero is default
+     * unset value for int64.
+     * 
+ * + * int64 defined_in_material = 2; + * + * @return This builder for chaining. + */ + public Builder clearDefinedInMaterial() { + + definedInMaterial_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object entryPoint_ = ""; + /** + * + * + *
+     * String identifying the entry point into the build.
+     * This is often a path to a configuration file and/or a target label within
+     * that file. The syntax and meaning are defined by recipe.type. For example,
+     * if the recipe type were "make", then this would reference the directory in
+     * which to run make as well as which target to use.
+     * 
+ * + * string entry_point = 3; + * + * @return The entryPoint. + */ + public java.lang.String getEntryPoint() { + java.lang.Object ref = entryPoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entryPoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * String identifying the entry point into the build.
+     * This is often a path to a configuration file and/or a target label within
+     * that file. The syntax and meaning are defined by recipe.type. For example,
+     * if the recipe type were "make", then this would reference the directory in
+     * which to run make as well as which target to use.
+     * 
+ * + * string entry_point = 3; + * + * @return The bytes for entryPoint. + */ + public com.google.protobuf.ByteString getEntryPointBytes() { + java.lang.Object ref = entryPoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entryPoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * String identifying the entry point into the build.
+     * This is often a path to a configuration file and/or a target label within
+     * that file. The syntax and meaning are defined by recipe.type. For example,
+     * if the recipe type were "make", then this would reference the directory in
+     * which to run make as well as which target to use.
+     * 
+ * + * string entry_point = 3; + * + * @param value The entryPoint to set. + * @return This builder for chaining. + */ + public Builder setEntryPoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + entryPoint_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * String identifying the entry point into the build.
+     * This is often a path to a configuration file and/or a target label within
+     * that file. The syntax and meaning are defined by recipe.type. For example,
+     * if the recipe type were "make", then this would reference the directory in
+     * which to run make as well as which target to use.
+     * 
+ * + * string entry_point = 3; + * + * @return This builder for chaining. + */ + public Builder clearEntryPoint() { + + entryPoint_ = getDefaultInstance().getEntryPoint(); + onChanged(); + return this; + } + /** + * + * + *
+     * String identifying the entry point into the build.
+     * This is often a path to a configuration file and/or a target label within
+     * that file. The syntax and meaning are defined by recipe.type. For example,
+     * if the recipe type were "make", then this would reference the directory in
+     * which to run make as well as which target to use.
+     * 
+ * + * string entry_point = 3; + * + * @param value The bytes for entryPoint to set. + * @return This builder for chaining. + */ + public Builder setEntryPointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + entryPoint_ = value; + onChanged(); + return this; + } + + private java.util.List arguments_ = java.util.Collections.emptyList(); + + private void ensureArgumentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + arguments_ = new java.util.ArrayList(arguments_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + argumentsBuilder_; + + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+     * type were "make", then this might be the flags passed to make aside from
+     * the target, which is captured in recipe.entryPoint. Since the arguments
+     * field can greatly vary in structure, depending on the builder and recipe
+     * type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + public java.util.List getArgumentsList() { + if (argumentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(arguments_); + } else { + return argumentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+     * type were "make", then this might be the flags passed to make aside from
+     * the target, which is captured in recipe.entryPoint. Since the arguments
+     * field can greatly vary in structure, depending on the builder and recipe
+     * type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + public int getArgumentsCount() { + if (argumentsBuilder_ == null) { + return arguments_.size(); + } else { + return argumentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+     * type were "make", then this might be the flags passed to make aside from
+     * the target, which is captured in recipe.entryPoint. Since the arguments
+     * field can greatly vary in structure, depending on the builder and recipe
+     * type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + public com.google.protobuf.Any getArguments(int index) { + if (argumentsBuilder_ == null) { + return arguments_.get(index); + } else { + return argumentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+     * type were "make", then this might be the flags passed to make aside from
+     * the target, which is captured in recipe.entryPoint. Since the arguments
+     * field can greatly vary in structure, depending on the builder and recipe
+     * type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + public Builder setArguments(int index, com.google.protobuf.Any value) { + if (argumentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgumentsIsMutable(); + arguments_.set(index, value); + onChanged(); + } else { + argumentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+     * type were "make", then this might be the flags passed to make aside from
+     * the target, which is captured in recipe.entryPoint. Since the arguments
+     * field can greatly vary in structure, depending on the builder and recipe
+     * type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + public Builder setArguments(int index, com.google.protobuf.Any.Builder builderForValue) { + if (argumentsBuilder_ == null) { + ensureArgumentsIsMutable(); + arguments_.set(index, builderForValue.build()); + onChanged(); + } else { + argumentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+     * type were "make", then this might be the flags passed to make aside from
+     * the target, which is captured in recipe.entryPoint. Since the arguments
+     * field can greatly vary in structure, depending on the builder and recipe
+     * type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + public Builder addArguments(com.google.protobuf.Any value) { + if (argumentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgumentsIsMutable(); + arguments_.add(value); + onChanged(); + } else { + argumentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+     * type were "make", then this might be the flags passed to make aside from
+     * the target, which is captured in recipe.entryPoint. Since the arguments
+     * field can greatly vary in structure, depending on the builder and recipe
+     * type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + public Builder addArguments(int index, com.google.protobuf.Any value) { + if (argumentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgumentsIsMutable(); + arguments_.add(index, value); + onChanged(); + } else { + argumentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+     * type were "make", then this might be the flags passed to make aside from
+     * the target, which is captured in recipe.entryPoint. Since the arguments
+     * field can greatly vary in structure, depending on the builder and recipe
+     * type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + public Builder addArguments(com.google.protobuf.Any.Builder builderForValue) { + if (argumentsBuilder_ == null) { + ensureArgumentsIsMutable(); + arguments_.add(builderForValue.build()); + onChanged(); + } else { + argumentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+     * type were "make", then this might be the flags passed to make aside from
+     * the target, which is captured in recipe.entryPoint. Since the arguments
+     * field can greatly vary in structure, depending on the builder and recipe
+     * type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + public Builder addArguments(int index, com.google.protobuf.Any.Builder builderForValue) { + if (argumentsBuilder_ == null) { + ensureArgumentsIsMutable(); + arguments_.add(index, builderForValue.build()); + onChanged(); + } else { + argumentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+     * type were "make", then this might be the flags passed to make aside from
+     * the target, which is captured in recipe.entryPoint. Since the arguments
+     * field can greatly vary in structure, depending on the builder and recipe
+     * type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + public Builder addAllArguments(java.lang.Iterable values) { + if (argumentsBuilder_ == null) { + ensureArgumentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, arguments_); + onChanged(); + } else { + argumentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+     * type were "make", then this might be the flags passed to make aside from
+     * the target, which is captured in recipe.entryPoint. Since the arguments
+     * field can greatly vary in structure, depending on the builder and recipe
+     * type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + public Builder clearArguments() { + if (argumentsBuilder_ == null) { + arguments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + argumentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+     * type were "make", then this might be the flags passed to make aside from
+     * the target, which is captured in recipe.entryPoint. Since the arguments
+     * field can greatly vary in structure, depending on the builder and recipe
+     * type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + public Builder removeArguments(int index) { + if (argumentsBuilder_ == null) { + ensureArgumentsIsMutable(); + arguments_.remove(index); + onChanged(); + } else { + argumentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+     * type were "make", then this might be the flags passed to make aside from
+     * the target, which is captured in recipe.entryPoint. Since the arguments
+     * field can greatly vary in structure, depending on the builder and recipe
+     * type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + public com.google.protobuf.Any.Builder getArgumentsBuilder(int index) { + return getArgumentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+     * type were "make", then this might be the flags passed to make aside from
+     * the target, which is captured in recipe.entryPoint. Since the arguments
+     * field can greatly vary in structure, depending on the builder and recipe
+     * type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + public com.google.protobuf.AnyOrBuilder getArgumentsOrBuilder(int index) { + if (argumentsBuilder_ == null) { + return arguments_.get(index); + } else { + return argumentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+     * type were "make", then this might be the flags passed to make aside from
+     * the target, which is captured in recipe.entryPoint. Since the arguments
+     * field can greatly vary in structure, depending on the builder and recipe
+     * type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + public java.util.List getArgumentsOrBuilderList() { + if (argumentsBuilder_ != null) { + return argumentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(arguments_); + } + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+     * type were "make", then this might be the flags passed to make aside from
+     * the target, which is captured in recipe.entryPoint. Since the arguments
+     * field can greatly vary in structure, depending on the builder and recipe
+     * type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + public com.google.protobuf.Any.Builder addArgumentsBuilder() { + return getArgumentsFieldBuilder().addBuilder(com.google.protobuf.Any.getDefaultInstance()); + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+     * type were "make", then this might be the flags passed to make aside from
+     * the target, which is captured in recipe.entryPoint. Since the arguments
+     * field can greatly vary in structure, depending on the builder and recipe
+     * type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + public com.google.protobuf.Any.Builder addArgumentsBuilder(int index) { + return getArgumentsFieldBuilder() + .addBuilder(index, com.google.protobuf.Any.getDefaultInstance()); + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+     * type were "make", then this might be the flags passed to make aside from
+     * the target, which is captured in recipe.entryPoint. Since the arguments
+     * field can greatly vary in structure, depending on the builder and recipe
+     * type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + public java.util.List getArgumentsBuilderList() { + return getArgumentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getArgumentsFieldBuilder() { + if (argumentsBuilder_ == null) { + argumentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>( + arguments_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + arguments_ = null; + } + return argumentsBuilder_; + } + + private java.util.List environment_ = + java.util.Collections.emptyList(); + + private void ensureEnvironmentIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + environment_ = new java.util.ArrayList(environment_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + environmentBuilder_; + + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating the
+     * recipe. Usually only needed for reproducing the build but not evaluated as
+     * part of policy. Since the environment field can greatly vary in structure,
+     * depending on the builder and recipe type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + public java.util.List getEnvironmentList() { + if (environmentBuilder_ == null) { + return java.util.Collections.unmodifiableList(environment_); + } else { + return environmentBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating the
+     * recipe. Usually only needed for reproducing the build but not evaluated as
+     * part of policy. Since the environment field can greatly vary in structure,
+     * depending on the builder and recipe type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + public int getEnvironmentCount() { + if (environmentBuilder_ == null) { + return environment_.size(); + } else { + return environmentBuilder_.getCount(); + } + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating the
+     * recipe. Usually only needed for reproducing the build but not evaluated as
+     * part of policy. Since the environment field can greatly vary in structure,
+     * depending on the builder and recipe type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + public com.google.protobuf.Any getEnvironment(int index) { + if (environmentBuilder_ == null) { + return environment_.get(index); + } else { + return environmentBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating the
+     * recipe. Usually only needed for reproducing the build but not evaluated as
+     * part of policy. Since the environment field can greatly vary in structure,
+     * depending on the builder and recipe type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + public Builder setEnvironment(int index, com.google.protobuf.Any value) { + if (environmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnvironmentIsMutable(); + environment_.set(index, value); + onChanged(); + } else { + environmentBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating the
+     * recipe. Usually only needed for reproducing the build but not evaluated as
+     * part of policy. Since the environment field can greatly vary in structure,
+     * depending on the builder and recipe type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + public Builder setEnvironment(int index, com.google.protobuf.Any.Builder builderForValue) { + if (environmentBuilder_ == null) { + ensureEnvironmentIsMutable(); + environment_.set(index, builderForValue.build()); + onChanged(); + } else { + environmentBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating the
+     * recipe. Usually only needed for reproducing the build but not evaluated as
+     * part of policy. Since the environment field can greatly vary in structure,
+     * depending on the builder and recipe type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + public Builder addEnvironment(com.google.protobuf.Any value) { + if (environmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnvironmentIsMutable(); + environment_.add(value); + onChanged(); + } else { + environmentBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating the
+     * recipe. Usually only needed for reproducing the build but not evaluated as
+     * part of policy. Since the environment field can greatly vary in structure,
+     * depending on the builder and recipe type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + public Builder addEnvironment(int index, com.google.protobuf.Any value) { + if (environmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnvironmentIsMutable(); + environment_.add(index, value); + onChanged(); + } else { + environmentBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating the
+     * recipe. Usually only needed for reproducing the build but not evaluated as
+     * part of policy. Since the environment field can greatly vary in structure,
+     * depending on the builder and recipe type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + public Builder addEnvironment(com.google.protobuf.Any.Builder builderForValue) { + if (environmentBuilder_ == null) { + ensureEnvironmentIsMutable(); + environment_.add(builderForValue.build()); + onChanged(); + } else { + environmentBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating the
+     * recipe. Usually only needed for reproducing the build but not evaluated as
+     * part of policy. Since the environment field can greatly vary in structure,
+     * depending on the builder and recipe type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + public Builder addEnvironment(int index, com.google.protobuf.Any.Builder builderForValue) { + if (environmentBuilder_ == null) { + ensureEnvironmentIsMutable(); + environment_.add(index, builderForValue.build()); + onChanged(); + } else { + environmentBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating the
+     * recipe. Usually only needed for reproducing the build but not evaluated as
+     * part of policy. Since the environment field can greatly vary in structure,
+     * depending on the builder and recipe type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + public Builder addAllEnvironment(java.lang.Iterable values) { + if (environmentBuilder_ == null) { + ensureEnvironmentIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, environment_); + onChanged(); + } else { + environmentBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating the
+     * recipe. Usually only needed for reproducing the build but not evaluated as
+     * part of policy. Since the environment field can greatly vary in structure,
+     * depending on the builder and recipe type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + public Builder clearEnvironment() { + if (environmentBuilder_ == null) { + environment_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + environmentBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating the
+     * recipe. Usually only needed for reproducing the build but not evaluated as
+     * part of policy. Since the environment field can greatly vary in structure,
+     * depending on the builder and recipe type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + public Builder removeEnvironment(int index) { + if (environmentBuilder_ == null) { + ensureEnvironmentIsMutable(); + environment_.remove(index); + onChanged(); + } else { + environmentBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating the
+     * recipe. Usually only needed for reproducing the build but not evaluated as
+     * part of policy. Since the environment field can greatly vary in structure,
+     * depending on the builder and recipe type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + public com.google.protobuf.Any.Builder getEnvironmentBuilder(int index) { + return getEnvironmentFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating the
+     * recipe. Usually only needed for reproducing the build but not evaluated as
+     * part of policy. Since the environment field can greatly vary in structure,
+     * depending on the builder and recipe type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + public com.google.protobuf.AnyOrBuilder getEnvironmentOrBuilder(int index) { + if (environmentBuilder_ == null) { + return environment_.get(index); + } else { + return environmentBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating the
+     * recipe. Usually only needed for reproducing the build but not evaluated as
+     * part of policy. Since the environment field can greatly vary in structure,
+     * depending on the builder and recipe type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + public java.util.List + getEnvironmentOrBuilderList() { + if (environmentBuilder_ != null) { + return environmentBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(environment_); + } + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating the
+     * recipe. Usually only needed for reproducing the build but not evaluated as
+     * part of policy. Since the environment field can greatly vary in structure,
+     * depending on the builder and recipe type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + public com.google.protobuf.Any.Builder addEnvironmentBuilder() { + return getEnvironmentFieldBuilder().addBuilder(com.google.protobuf.Any.getDefaultInstance()); + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating the
+     * recipe. Usually only needed for reproducing the build but not evaluated as
+     * part of policy. Since the environment field can greatly vary in structure,
+     * depending on the builder and recipe type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + public com.google.protobuf.Any.Builder addEnvironmentBuilder(int index) { + return getEnvironmentFieldBuilder() + .addBuilder(index, com.google.protobuf.Any.getDefaultInstance()); + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating the
+     * recipe. Usually only needed for reproducing the build but not evaluated as
+     * part of policy. Since the environment field can greatly vary in structure,
+     * depending on the builder and recipe type, this is of form "Any".
+     * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + public java.util.List getEnvironmentBuilderList() { + return getEnvironmentFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getEnvironmentFieldBuilder() { + if (environmentBuilder_ == null) { + environmentBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>( + environment_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + environment_ = null; + } + return environmentBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.Recipe) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.Recipe) + private static final io.grafeas.v1.Recipe DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.Recipe(); + } + + public static io.grafeas.v1.Recipe getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Recipe parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Recipe(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.Recipe getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/src/main/java/io/grafeas/v1/RecipeOrBuilder.java b/src/main/java/io/grafeas/v1/RecipeOrBuilder.java new file mode 100644 index 00000000..b32a47a5 --- /dev/null +++ b/src/main/java/io/grafeas/v1/RecipeOrBuilder.java @@ -0,0 +1,245 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/intoto_provenance.proto + +package io.grafeas.v1; + +public interface RecipeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.Recipe) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * URI indicating what type of recipe was performed. It determines the meaning
+   * of recipe.entryPoint, recipe.arguments, recipe.environment, and materials.
+   * 
+ * + * string type = 1; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * URI indicating what type of recipe was performed. It determines the meaning
+   * of recipe.entryPoint, recipe.arguments, recipe.environment, and materials.
+   * 
+ * + * string type = 1; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * Index in materials containing the recipe steps that are not implied by
+   * recipe.type. For example, if the recipe type were "make", then this would
+   * point to the source containing the Makefile, not the make program itself.
+   * Set to -1 if the recipe doesn't come from a material, as zero is default
+   * unset value for int64.
+   * 
+ * + * int64 defined_in_material = 2; + * + * @return The definedInMaterial. + */ + long getDefinedInMaterial(); + + /** + * + * + *
+   * String identifying the entry point into the build.
+   * This is often a path to a configuration file and/or a target label within
+   * that file. The syntax and meaning are defined by recipe.type. For example,
+   * if the recipe type were "make", then this would reference the directory in
+   * which to run make as well as which target to use.
+   * 
+ * + * string entry_point = 3; + * + * @return The entryPoint. + */ + java.lang.String getEntryPoint(); + /** + * + * + *
+   * String identifying the entry point into the build.
+   * This is often a path to a configuration file and/or a target label within
+   * that file. The syntax and meaning are defined by recipe.type. For example,
+   * if the recipe type were "make", then this would reference the directory in
+   * which to run make as well as which target to use.
+   * 
+ * + * string entry_point = 3; + * + * @return The bytes for entryPoint. + */ + com.google.protobuf.ByteString getEntryPointBytes(); + + /** + * + * + *
+   * Collection of all external inputs that influenced the build on top of
+   * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+   * type were "make", then this might be the flags passed to make aside from
+   * the target, which is captured in recipe.entryPoint. Since the arguments
+   * field can greatly vary in structure, depending on the builder and recipe
+   * type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + java.util.List getArgumentsList(); + /** + * + * + *
+   * Collection of all external inputs that influenced the build on top of
+   * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+   * type were "make", then this might be the flags passed to make aside from
+   * the target, which is captured in recipe.entryPoint. Since the arguments
+   * field can greatly vary in structure, depending on the builder and recipe
+   * type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + com.google.protobuf.Any getArguments(int index); + /** + * + * + *
+   * Collection of all external inputs that influenced the build on top of
+   * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+   * type were "make", then this might be the flags passed to make aside from
+   * the target, which is captured in recipe.entryPoint. Since the arguments
+   * field can greatly vary in structure, depending on the builder and recipe
+   * type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + int getArgumentsCount(); + /** + * + * + *
+   * Collection of all external inputs that influenced the build on top of
+   * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+   * type were "make", then this might be the flags passed to make aside from
+   * the target, which is captured in recipe.entryPoint. Since the arguments
+   * field can greatly vary in structure, depending on the builder and recipe
+   * type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + java.util.List getArgumentsOrBuilderList(); + /** + * + * + *
+   * Collection of all external inputs that influenced the build on top of
+   * recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe
+   * type were "make", then this might be the flags passed to make aside from
+   * the target, which is captured in recipe.entryPoint. Since the arguments
+   * field can greatly vary in structure, depending on the builder and recipe
+   * type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any arguments = 4; + */ + com.google.protobuf.AnyOrBuilder getArgumentsOrBuilder(int index); + + /** + * + * + *
+   * Any other builder-controlled inputs necessary for correctly evaluating the
+   * recipe. Usually only needed for reproducing the build but not evaluated as
+   * part of policy. Since the environment field can greatly vary in structure,
+   * depending on the builder and recipe type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + java.util.List getEnvironmentList(); + /** + * + * + *
+   * Any other builder-controlled inputs necessary for correctly evaluating the
+   * recipe. Usually only needed for reproducing the build but not evaluated as
+   * part of policy. Since the environment field can greatly vary in structure,
+   * depending on the builder and recipe type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + com.google.protobuf.Any getEnvironment(int index); + /** + * + * + *
+   * Any other builder-controlled inputs necessary for correctly evaluating the
+   * recipe. Usually only needed for reproducing the build but not evaluated as
+   * part of policy. Since the environment field can greatly vary in structure,
+   * depending on the builder and recipe type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + int getEnvironmentCount(); + /** + * + * + *
+   * Any other builder-controlled inputs necessary for correctly evaluating the
+   * recipe. Usually only needed for reproducing the build but not evaluated as
+   * part of policy. Since the environment field can greatly vary in structure,
+   * depending on the builder and recipe type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + java.util.List getEnvironmentOrBuilderList(); + /** + * + * + *
+   * Any other builder-controlled inputs necessary for correctly evaluating the
+   * recipe. Usually only needed for reproducing the build but not evaluated as
+   * part of policy. Since the environment field can greatly vary in structure,
+   * depending on the builder and recipe type, this is of form "Any".
+   * 
+ * + * repeated .google.protobuf.Any environment = 5; + */ + com.google.protobuf.AnyOrBuilder getEnvironmentOrBuilder(int index); +} diff --git a/src/main/java/io/grafeas/v1/Signature.java b/src/main/java/io/grafeas/v1/Signature.java index 6d0b9723..d1c91e81 100644 --- a/src/main/java/io/grafeas/v1/Signature.java +++ b/src/main/java/io/grafeas/v1/Signature.java @@ -165,7 +165,7 @@ public com.google.protobuf.ByteString getSignature() { *
    * The identifier for the public key that verifies this signature.
    *   * The `public_key_id` is required.
-   *   * The `public_key_id` MUST be an RFC3986 conformant URI.
+   *   * The `public_key_id` SHOULD be an RFC3986 conformant URI.
    *   * When possible, the `public_key_id` SHOULD be an immutable reference,
    *     such as a cryptographic digest.
    * Examples of valid `public_key_id`s:
@@ -201,7 +201,7 @@ public java.lang.String getPublicKeyId() {
    * 
    * The identifier for the public key that verifies this signature.
    *   * The `public_key_id` is required.
-   *   * The `public_key_id` MUST be an RFC3986 conformant URI.
+   *   * The `public_key_id` SHOULD be an RFC3986 conformant URI.
    *   * When possible, the `public_key_id` SHOULD be an immutable reference,
    *     such as a cryptographic digest.
    * Examples of valid `public_key_id`s:
@@ -652,7 +652,7 @@ public Builder clearSignature() {
      * 
      * The identifier for the public key that verifies this signature.
      *   * The `public_key_id` is required.
-     *   * The `public_key_id` MUST be an RFC3986 conformant URI.
+     *   * The `public_key_id` SHOULD be an RFC3986 conformant URI.
      *   * When possible, the `public_key_id` SHOULD be an immutable reference,
      *     such as a cryptographic digest.
      * Examples of valid `public_key_id`s:
@@ -687,7 +687,7 @@ public java.lang.String getPublicKeyId() {
      * 
      * The identifier for the public key that verifies this signature.
      *   * The `public_key_id` is required.
-     *   * The `public_key_id` MUST be an RFC3986 conformant URI.
+     *   * The `public_key_id` SHOULD be an RFC3986 conformant URI.
      *   * When possible, the `public_key_id` SHOULD be an immutable reference,
      *     such as a cryptographic digest.
      * Examples of valid `public_key_id`s:
@@ -722,7 +722,7 @@ public com.google.protobuf.ByteString getPublicKeyIdBytes() {
      * 
      * The identifier for the public key that verifies this signature.
      *   * The `public_key_id` is required.
-     *   * The `public_key_id` MUST be an RFC3986 conformant URI.
+     *   * The `public_key_id` SHOULD be an RFC3986 conformant URI.
      *   * When possible, the `public_key_id` SHOULD be an immutable reference,
      *     such as a cryptographic digest.
      * Examples of valid `public_key_id`s:
@@ -756,7 +756,7 @@ public Builder setPublicKeyId(java.lang.String value) {
      * 
      * The identifier for the public key that verifies this signature.
      *   * The `public_key_id` is required.
-     *   * The `public_key_id` MUST be an RFC3986 conformant URI.
+     *   * The `public_key_id` SHOULD be an RFC3986 conformant URI.
      *   * When possible, the `public_key_id` SHOULD be an immutable reference,
      *     such as a cryptographic digest.
      * Examples of valid `public_key_id`s:
@@ -786,7 +786,7 @@ public Builder clearPublicKeyId() {
      * 
      * The identifier for the public key that verifies this signature.
      *   * The `public_key_id` is required.
-     *   * The `public_key_id` MUST be an RFC3986 conformant URI.
+     *   * The `public_key_id` SHOULD be an RFC3986 conformant URI.
      *   * When possible, the `public_key_id` SHOULD be an immutable reference,
      *     such as a cryptographic digest.
      * Examples of valid `public_key_id`s:
diff --git a/src/main/java/io/grafeas/v1/SignatureOrBuilder.java b/src/main/java/io/grafeas/v1/SignatureOrBuilder.java
index 99684cb8..fb62d2f5 100644
--- a/src/main/java/io/grafeas/v1/SignatureOrBuilder.java
+++ b/src/main/java/io/grafeas/v1/SignatureOrBuilder.java
@@ -48,7 +48,7 @@ public interface SignatureOrBuilder
    * 
    * The identifier for the public key that verifies this signature.
    *   * The `public_key_id` is required.
-   *   * The `public_key_id` MUST be an RFC3986 conformant URI.
+   *   * The `public_key_id` SHOULD be an RFC3986 conformant URI.
    *   * When possible, the `public_key_id` SHOULD be an immutable reference,
    *     such as a cryptographic digest.
    * Examples of valid `public_key_id`s:
@@ -73,7 +73,7 @@ public interface SignatureOrBuilder
    * 
    * The identifier for the public key that verifies this signature.
    *   * The `public_key_id` is required.
-   *   * The `public_key_id` MUST be an RFC3986 conformant URI.
+   *   * The `public_key_id` SHOULD be an RFC3986 conformant URI.
    *   * When possible, the `public_key_id` SHOULD be an immutable reference,
    *     such as a cryptographic digest.
    * Examples of valid `public_key_id`s:
diff --git a/src/main/java/io/grafeas/v1/SlsaProvenance.java b/src/main/java/io/grafeas/v1/SlsaProvenance.java
new file mode 100644
index 00000000..b64dfb7c
--- /dev/null
+++ b/src/main/java/io/grafeas/v1/SlsaProvenance.java
@@ -0,0 +1,7426 @@
+/*
+ * Copyright 2019 The Grafeas Authors. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: grafeas/v1/slsa_provenance.proto
+
+package io.grafeas.v1;
+
+/** Protobuf type {@code grafeas.v1.SlsaProvenance} */
+public final class SlsaProvenance extends com.google.protobuf.GeneratedMessageV3
+    implements
+    // @@protoc_insertion_point(message_implements:grafeas.v1.SlsaProvenance)
+    SlsaProvenanceOrBuilder {
+  private static final long serialVersionUID = 0L;
+  // Use SlsaProvenance.newBuilder() to construct.
+  private SlsaProvenance(com.google.protobuf.GeneratedMessageV3.Builder builder) {
+    super(builder);
+  }
+
+  private SlsaProvenance() {
+    materials_ = java.util.Collections.emptyList();
+  }
+
+  @java.lang.Override
+  @SuppressWarnings({"unused"})
+  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
+    return new SlsaProvenance();
+  }
+
+  @java.lang.Override
+  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
+    return this.unknownFields;
+  }
+
+  private SlsaProvenance(
+      com.google.protobuf.CodedInputStream input,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    this();
+    if (extensionRegistry == null) {
+      throw new java.lang.NullPointerException();
+    }
+    int mutable_bitField0_ = 0;
+    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+        com.google.protobuf.UnknownFieldSet.newBuilder();
+    try {
+      boolean done = false;
+      while (!done) {
+        int tag = input.readTag();
+        switch (tag) {
+          case 0:
+            done = true;
+            break;
+          case 10:
+            {
+              io.grafeas.v1.SlsaProvenance.SlsaBuilder.Builder subBuilder = null;
+              if (builder_ != null) {
+                subBuilder = builder_.toBuilder();
+              }
+              builder_ =
+                  input.readMessage(
+                      io.grafeas.v1.SlsaProvenance.SlsaBuilder.parser(), extensionRegistry);
+              if (subBuilder != null) {
+                subBuilder.mergeFrom(builder_);
+                builder_ = subBuilder.buildPartial();
+              }
+
+              break;
+            }
+          case 18:
+            {
+              io.grafeas.v1.SlsaProvenance.SlsaRecipe.Builder subBuilder = null;
+              if (recipe_ != null) {
+                subBuilder = recipe_.toBuilder();
+              }
+              recipe_ =
+                  input.readMessage(
+                      io.grafeas.v1.SlsaProvenance.SlsaRecipe.parser(), extensionRegistry);
+              if (subBuilder != null) {
+                subBuilder.mergeFrom(recipe_);
+                recipe_ = subBuilder.buildPartial();
+              }
+
+              break;
+            }
+          case 26:
+            {
+              io.grafeas.v1.SlsaProvenance.SlsaMetadata.Builder subBuilder = null;
+              if (metadata_ != null) {
+                subBuilder = metadata_.toBuilder();
+              }
+              metadata_ =
+                  input.readMessage(
+                      io.grafeas.v1.SlsaProvenance.SlsaMetadata.parser(), extensionRegistry);
+              if (subBuilder != null) {
+                subBuilder.mergeFrom(metadata_);
+                metadata_ = subBuilder.buildPartial();
+              }
+
+              break;
+            }
+          case 34:
+            {
+              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
+                materials_ = new java.util.ArrayList();
+                mutable_bitField0_ |= 0x00000001;
+              }
+              materials_.add(
+                  input.readMessage(
+                      io.grafeas.v1.SlsaProvenance.Material.parser(), extensionRegistry));
+              break;
+            }
+          default:
+            {
+              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
+                done = true;
+              }
+              break;
+            }
+        }
+      }
+    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+      throw e.setUnfinishedMessage(this);
+    } catch (java.io.IOException e) {
+      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
+    } finally {
+      if (((mutable_bitField0_ & 0x00000001) != 0)) {
+        materials_ = java.util.Collections.unmodifiableList(materials_);
+      }
+      this.unknownFields = unknownFields.build();
+      makeExtensionsImmutable();
+    }
+  }
+
+  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
+    return io.grafeas.v1.SlsaProvenanceOuterClass
+        .internal_static_grafeas_v1_SlsaProvenance_descriptor;
+  }
+
+  @java.lang.Override
+  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+      internalGetFieldAccessorTable() {
+    return io.grafeas.v1.SlsaProvenanceOuterClass
+        .internal_static_grafeas_v1_SlsaProvenance_fieldAccessorTable
+        .ensureFieldAccessorsInitialized(
+            io.grafeas.v1.SlsaProvenance.class, io.grafeas.v1.SlsaProvenance.Builder.class);
+  }
+
+  public interface SlsaRecipeOrBuilder
+      extends
+      // @@protoc_insertion_point(interface_extends:grafeas.v1.SlsaProvenance.SlsaRecipe)
+      com.google.protobuf.MessageOrBuilder {
+
+    /**
+     *
+     *
+     * 
+     * URI indicating what type of recipe was performed. It determines the
+     * meaning of recipe.entryPoint, recipe.arguments, recipe.environment, and
+     * materials.
+     * 
+ * + * string type = 1; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+     * URI indicating what type of recipe was performed. It determines the
+     * meaning of recipe.entryPoint, recipe.arguments, recipe.environment, and
+     * materials.
+     * 
+ * + * string type = 1; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+     * Index in materials containing the recipe steps that are not implied by
+     * recipe.type. For example, if the recipe type were "make", then this would
+     * point to the source containing the Makefile, not the make program itself.
+     * Set to -1 if the recipe doesn't come from a material, as zero is default
+     * unset value for int64.
+     * 
+ * + * int64 defined_in_material = 2; + * + * @return The definedInMaterial. + */ + long getDefinedInMaterial(); + + /** + * + * + *
+     * String identifying the entry point into the build.
+     * This is often a path to a configuration file and/or a target label within
+     * that file. The syntax and meaning are defined by recipe.type. For
+     * example, if the recipe type were "make", then this would reference the
+     * directory in which to run make as well as which target to use.
+     * 
+ * + * string entry_point = 3; + * + * @return The entryPoint. + */ + java.lang.String getEntryPoint(); + /** + * + * + *
+     * String identifying the entry point into the build.
+     * This is often a path to a configuration file and/or a target label within
+     * that file. The syntax and meaning are defined by recipe.type. For
+     * example, if the recipe type were "make", then this would reference the
+     * directory in which to run make as well as which target to use.
+     * 
+ * + * string entry_point = 3; + * + * @return The bytes for entryPoint. + */ + com.google.protobuf.ByteString getEntryPointBytes(); + + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the
+     * recipe type were "make", then this might be the flags passed to make
+     * aside from the target, which is captured in recipe.entryPoint. Depending
+     * on the recipe Type, the structure may be different.
+     * 
+ * + * .google.protobuf.Any arguments = 4; + * + * @return Whether the arguments field is set. + */ + boolean hasArguments(); + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the
+     * recipe type were "make", then this might be the flags passed to make
+     * aside from the target, which is captured in recipe.entryPoint. Depending
+     * on the recipe Type, the structure may be different.
+     * 
+ * + * .google.protobuf.Any arguments = 4; + * + * @return The arguments. + */ + com.google.protobuf.Any getArguments(); + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the
+     * recipe type were "make", then this might be the flags passed to make
+     * aside from the target, which is captured in recipe.entryPoint. Depending
+     * on the recipe Type, the structure may be different.
+     * 
+ * + * .google.protobuf.Any arguments = 4; + */ + com.google.protobuf.AnyOrBuilder getArgumentsOrBuilder(); + + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating
+     * the recipe. Usually only needed for reproducing the build but not
+     * evaluated as part of policy. Depending on the recipe Type, the structure
+     * may be different.
+     * 
+ * + * .google.protobuf.Any environment = 5; + * + * @return Whether the environment field is set. + */ + boolean hasEnvironment(); + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating
+     * the recipe. Usually only needed for reproducing the build but not
+     * evaluated as part of policy. Depending on the recipe Type, the structure
+     * may be different.
+     * 
+ * + * .google.protobuf.Any environment = 5; + * + * @return The environment. + */ + com.google.protobuf.Any getEnvironment(); + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating
+     * the recipe. Usually only needed for reproducing the build but not
+     * evaluated as part of policy. Depending on the recipe Type, the structure
+     * may be different.
+     * 
+ * + * .google.protobuf.Any environment = 5; + */ + com.google.protobuf.AnyOrBuilder getEnvironmentOrBuilder(); + } + /** + * + * + *
+   * Steps taken to build the artifact.
+   * For a TaskRun, typically each container corresponds to one step in the
+   * recipe.
+   * 
+ * + * Protobuf type {@code grafeas.v1.SlsaProvenance.SlsaRecipe} + */ + public static final class SlsaRecipe extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.SlsaProvenance.SlsaRecipe) + SlsaRecipeOrBuilder { + private static final long serialVersionUID = 0L; + // Use SlsaRecipe.newBuilder() to construct. + private SlsaRecipe(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SlsaRecipe() { + type_ = ""; + entryPoint_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SlsaRecipe(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SlsaRecipe( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 16: + { + definedInMaterial_ = input.readInt64(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + entryPoint_ = s; + break; + } + case 34: + { + com.google.protobuf.Any.Builder subBuilder = null; + if (arguments_ != null) { + subBuilder = arguments_.toBuilder(); + } + arguments_ = input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(arguments_); + arguments_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Any.Builder subBuilder = null; + if (environment_ != null) { + subBuilder = environment_.toBuilder(); + } + environment_ = + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(environment_); + environment_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaRecipe_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaRecipe_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.SlsaProvenance.SlsaRecipe.class, + io.grafeas.v1.SlsaProvenance.SlsaRecipe.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object type_; + /** + * + * + *
+     * URI indicating what type of recipe was performed. It determines the
+     * meaning of recipe.entryPoint, recipe.arguments, recipe.environment, and
+     * materials.
+     * 
+ * + * string type = 1; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + 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(); + type_ = s; + return s; + } + } + /** + * + * + *
+     * URI indicating what type of recipe was performed. It determines the
+     * meaning of recipe.entryPoint, recipe.arguments, recipe.environment, and
+     * materials.
+     * 
+ * + * string type = 1; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEFINED_IN_MATERIAL_FIELD_NUMBER = 2; + private long definedInMaterial_; + /** + * + * + *
+     * Index in materials containing the recipe steps that are not implied by
+     * recipe.type. For example, if the recipe type were "make", then this would
+     * point to the source containing the Makefile, not the make program itself.
+     * Set to -1 if the recipe doesn't come from a material, as zero is default
+     * unset value for int64.
+     * 
+ * + * int64 defined_in_material = 2; + * + * @return The definedInMaterial. + */ + @java.lang.Override + public long getDefinedInMaterial() { + return definedInMaterial_; + } + + public static final int ENTRY_POINT_FIELD_NUMBER = 3; + private volatile java.lang.Object entryPoint_; + /** + * + * + *
+     * String identifying the entry point into the build.
+     * This is often a path to a configuration file and/or a target label within
+     * that file. The syntax and meaning are defined by recipe.type. For
+     * example, if the recipe type were "make", then this would reference the
+     * directory in which to run make as well as which target to use.
+     * 
+ * + * string entry_point = 3; + * + * @return The entryPoint. + */ + @java.lang.Override + public java.lang.String getEntryPoint() { + java.lang.Object ref = entryPoint_; + 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(); + entryPoint_ = s; + return s; + } + } + /** + * + * + *
+     * String identifying the entry point into the build.
+     * This is often a path to a configuration file and/or a target label within
+     * that file. The syntax and meaning are defined by recipe.type. For
+     * example, if the recipe type were "make", then this would reference the
+     * directory in which to run make as well as which target to use.
+     * 
+ * + * string entry_point = 3; + * + * @return The bytes for entryPoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEntryPointBytes() { + java.lang.Object ref = entryPoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entryPoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ARGUMENTS_FIELD_NUMBER = 4; + private com.google.protobuf.Any arguments_; + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the
+     * recipe type were "make", then this might be the flags passed to make
+     * aside from the target, which is captured in recipe.entryPoint. Depending
+     * on the recipe Type, the structure may be different.
+     * 
+ * + * .google.protobuf.Any arguments = 4; + * + * @return Whether the arguments field is set. + */ + @java.lang.Override + public boolean hasArguments() { + return arguments_ != null; + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the
+     * recipe type were "make", then this might be the flags passed to make
+     * aside from the target, which is captured in recipe.entryPoint. Depending
+     * on the recipe Type, the structure may be different.
+     * 
+ * + * .google.protobuf.Any arguments = 4; + * + * @return The arguments. + */ + @java.lang.Override + public com.google.protobuf.Any getArguments() { + return arguments_ == null ? com.google.protobuf.Any.getDefaultInstance() : arguments_; + } + /** + * + * + *
+     * Collection of all external inputs that influenced the build on top of
+     * recipe.definedInMaterial and recipe.entryPoint. For example, if the
+     * recipe type were "make", then this might be the flags passed to make
+     * aside from the target, which is captured in recipe.entryPoint. Depending
+     * on the recipe Type, the structure may be different.
+     * 
+ * + * .google.protobuf.Any arguments = 4; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getArgumentsOrBuilder() { + return getArguments(); + } + + public static final int ENVIRONMENT_FIELD_NUMBER = 5; + private com.google.protobuf.Any environment_; + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating
+     * the recipe. Usually only needed for reproducing the build but not
+     * evaluated as part of policy. Depending on the recipe Type, the structure
+     * may be different.
+     * 
+ * + * .google.protobuf.Any environment = 5; + * + * @return Whether the environment field is set. + */ + @java.lang.Override + public boolean hasEnvironment() { + return environment_ != null; + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating
+     * the recipe. Usually only needed for reproducing the build but not
+     * evaluated as part of policy. Depending on the recipe Type, the structure
+     * may be different.
+     * 
+ * + * .google.protobuf.Any environment = 5; + * + * @return The environment. + */ + @java.lang.Override + public com.google.protobuf.Any getEnvironment() { + return environment_ == null ? com.google.protobuf.Any.getDefaultInstance() : environment_; + } + /** + * + * + *
+     * Any other builder-controlled inputs necessary for correctly evaluating
+     * the recipe. Usually only needed for reproducing the build but not
+     * evaluated as part of policy. Depending on the recipe Type, the structure
+     * may be different.
+     * 
+ * + * .google.protobuf.Any environment = 5; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getEnvironmentOrBuilder() { + return getEnvironment(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); + } + if (definedInMaterial_ != 0L) { + output.writeInt64(2, definedInMaterial_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entryPoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, entryPoint_); + } + if (arguments_ != null) { + output.writeMessage(4, getArguments()); + } + if (environment_ != null) { + output.writeMessage(5, getEnvironment()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); + } + if (definedInMaterial_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, definedInMaterial_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entryPoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, entryPoint_); + } + if (arguments_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getArguments()); + } + if (environment_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getEnvironment()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.SlsaProvenance.SlsaRecipe)) { + return super.equals(obj); + } + io.grafeas.v1.SlsaProvenance.SlsaRecipe other = (io.grafeas.v1.SlsaProvenance.SlsaRecipe) obj; + + if (!getType().equals(other.getType())) return false; + if (getDefinedInMaterial() != other.getDefinedInMaterial()) return false; + if (!getEntryPoint().equals(other.getEntryPoint())) return false; + if (hasArguments() != other.hasArguments()) return false; + if (hasArguments()) { + if (!getArguments().equals(other.getArguments())) return false; + } + if (hasEnvironment() != other.hasEnvironment()) return false; + if (hasEnvironment()) { + if (!getEnvironment().equals(other.getEnvironment())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + DEFINED_IN_MATERIAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getDefinedInMaterial()); + hash = (37 * hash) + ENTRY_POINT_FIELD_NUMBER; + hash = (53 * hash) + getEntryPoint().hashCode(); + if (hasArguments()) { + hash = (37 * hash) + ARGUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getArguments().hashCode(); + } + if (hasEnvironment()) { + hash = (37 * hash) + ENVIRONMENT_FIELD_NUMBER; + hash = (53 * hash) + getEnvironment().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.SlsaProvenance.SlsaRecipe parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaRecipe parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaRecipe parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaRecipe parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaRecipe parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaRecipe parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaRecipe parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaRecipe parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaRecipe parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaRecipe parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaRecipe parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaRecipe parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.SlsaProvenance.SlsaRecipe 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Steps taken to build the artifact.
+     * For a TaskRun, typically each container corresponds to one step in the
+     * recipe.
+     * 
+ * + * Protobuf type {@code grafeas.v1.SlsaProvenance.SlsaRecipe} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.SlsaProvenance.SlsaRecipe) + io.grafeas.v1.SlsaProvenance.SlsaRecipeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaRecipe_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaRecipe_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.SlsaProvenance.SlsaRecipe.class, + io.grafeas.v1.SlsaProvenance.SlsaRecipe.Builder.class); + } + + // Construct using io.grafeas.v1.SlsaProvenance.SlsaRecipe.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = ""; + + definedInMaterial_ = 0L; + + entryPoint_ = ""; + + if (argumentsBuilder_ == null) { + arguments_ = null; + } else { + arguments_ = null; + argumentsBuilder_ = null; + } + if (environmentBuilder_ == null) { + environment_ = null; + } else { + environment_ = null; + environmentBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaRecipe_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaRecipe getDefaultInstanceForType() { + return io.grafeas.v1.SlsaProvenance.SlsaRecipe.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaRecipe build() { + io.grafeas.v1.SlsaProvenance.SlsaRecipe result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaRecipe buildPartial() { + io.grafeas.v1.SlsaProvenance.SlsaRecipe result = + new io.grafeas.v1.SlsaProvenance.SlsaRecipe(this); + result.type_ = type_; + result.definedInMaterial_ = definedInMaterial_; + result.entryPoint_ = entryPoint_; + if (argumentsBuilder_ == null) { + result.arguments_ = arguments_; + } else { + result.arguments_ = argumentsBuilder_.build(); + } + if (environmentBuilder_ == null) { + result.environment_ = environment_; + } else { + result.environment_ = environmentBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.SlsaProvenance.SlsaRecipe) { + return mergeFrom((io.grafeas.v1.SlsaProvenance.SlsaRecipe) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.SlsaProvenance.SlsaRecipe other) { + if (other == io.grafeas.v1.SlsaProvenance.SlsaRecipe.getDefaultInstance()) return this; + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (other.getDefinedInMaterial() != 0L) { + setDefinedInMaterial(other.getDefinedInMaterial()); + } + if (!other.getEntryPoint().isEmpty()) { + entryPoint_ = other.entryPoint_; + onChanged(); + } + if (other.hasArguments()) { + mergeArguments(other.getArguments()); + } + if (other.hasEnvironment()) { + mergeEnvironment(other.getEnvironment()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.SlsaProvenance.SlsaRecipe parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.SlsaProvenance.SlsaRecipe) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+       * URI indicating what type of recipe was performed. It determines the
+       * meaning of recipe.entryPoint, recipe.arguments, recipe.environment, and
+       * materials.
+       * 
+ * + * string type = 1; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * URI indicating what type of recipe was performed. It determines the
+       * meaning of recipe.entryPoint, recipe.arguments, recipe.environment, and
+       * materials.
+       * 
+ * + * string type = 1; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * URI indicating what type of recipe was performed. It determines the
+       * meaning of recipe.entryPoint, recipe.arguments, recipe.environment, and
+       * materials.
+       * 
+ * + * string type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * URI indicating what type of recipe was performed. It determines the
+       * meaning of recipe.entryPoint, recipe.arguments, recipe.environment, and
+       * materials.
+       * 
+ * + * string type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+       * URI indicating what type of recipe was performed. It determines the
+       * meaning of recipe.entryPoint, recipe.arguments, recipe.environment, and
+       * materials.
+       * 
+ * + * string type = 1; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private long definedInMaterial_; + /** + * + * + *
+       * Index in materials containing the recipe steps that are not implied by
+       * recipe.type. For example, if the recipe type were "make", then this would
+       * point to the source containing the Makefile, not the make program itself.
+       * Set to -1 if the recipe doesn't come from a material, as zero is default
+       * unset value for int64.
+       * 
+ * + * int64 defined_in_material = 2; + * + * @return The definedInMaterial. + */ + @java.lang.Override + public long getDefinedInMaterial() { + return definedInMaterial_; + } + /** + * + * + *
+       * Index in materials containing the recipe steps that are not implied by
+       * recipe.type. For example, if the recipe type were "make", then this would
+       * point to the source containing the Makefile, not the make program itself.
+       * Set to -1 if the recipe doesn't come from a material, as zero is default
+       * unset value for int64.
+       * 
+ * + * int64 defined_in_material = 2; + * + * @param value The definedInMaterial to set. + * @return This builder for chaining. + */ + public Builder setDefinedInMaterial(long value) { + + definedInMaterial_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Index in materials containing the recipe steps that are not implied by
+       * recipe.type. For example, if the recipe type were "make", then this would
+       * point to the source containing the Makefile, not the make program itself.
+       * Set to -1 if the recipe doesn't come from a material, as zero is default
+       * unset value for int64.
+       * 
+ * + * int64 defined_in_material = 2; + * + * @return This builder for chaining. + */ + public Builder clearDefinedInMaterial() { + + definedInMaterial_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object entryPoint_ = ""; + /** + * + * + *
+       * String identifying the entry point into the build.
+       * This is often a path to a configuration file and/or a target label within
+       * that file. The syntax and meaning are defined by recipe.type. For
+       * example, if the recipe type were "make", then this would reference the
+       * directory in which to run make as well as which target to use.
+       * 
+ * + * string entry_point = 3; + * + * @return The entryPoint. + */ + public java.lang.String getEntryPoint() { + java.lang.Object ref = entryPoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entryPoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * String identifying the entry point into the build.
+       * This is often a path to a configuration file and/or a target label within
+       * that file. The syntax and meaning are defined by recipe.type. For
+       * example, if the recipe type were "make", then this would reference the
+       * directory in which to run make as well as which target to use.
+       * 
+ * + * string entry_point = 3; + * + * @return The bytes for entryPoint. + */ + public com.google.protobuf.ByteString getEntryPointBytes() { + java.lang.Object ref = entryPoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entryPoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * String identifying the entry point into the build.
+       * This is often a path to a configuration file and/or a target label within
+       * that file. The syntax and meaning are defined by recipe.type. For
+       * example, if the recipe type were "make", then this would reference the
+       * directory in which to run make as well as which target to use.
+       * 
+ * + * string entry_point = 3; + * + * @param value The entryPoint to set. + * @return This builder for chaining. + */ + public Builder setEntryPoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + entryPoint_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * String identifying the entry point into the build.
+       * This is often a path to a configuration file and/or a target label within
+       * that file. The syntax and meaning are defined by recipe.type. For
+       * example, if the recipe type were "make", then this would reference the
+       * directory in which to run make as well as which target to use.
+       * 
+ * + * string entry_point = 3; + * + * @return This builder for chaining. + */ + public Builder clearEntryPoint() { + + entryPoint_ = getDefaultInstance().getEntryPoint(); + onChanged(); + return this; + } + /** + * + * + *
+       * String identifying the entry point into the build.
+       * This is often a path to a configuration file and/or a target label within
+       * that file. The syntax and meaning are defined by recipe.type. For
+       * example, if the recipe type were "make", then this would reference the
+       * directory in which to run make as well as which target to use.
+       * 
+ * + * string entry_point = 3; + * + * @param value The bytes for entryPoint to set. + * @return This builder for chaining. + */ + public Builder setEntryPointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + entryPoint_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Any arguments_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + argumentsBuilder_; + /** + * + * + *
+       * Collection of all external inputs that influenced the build on top of
+       * recipe.definedInMaterial and recipe.entryPoint. For example, if the
+       * recipe type were "make", then this might be the flags passed to make
+       * aside from the target, which is captured in recipe.entryPoint. Depending
+       * on the recipe Type, the structure may be different.
+       * 
+ * + * .google.protobuf.Any arguments = 4; + * + * @return Whether the arguments field is set. + */ + public boolean hasArguments() { + return argumentsBuilder_ != null || arguments_ != null; + } + /** + * + * + *
+       * Collection of all external inputs that influenced the build on top of
+       * recipe.definedInMaterial and recipe.entryPoint. For example, if the
+       * recipe type were "make", then this might be the flags passed to make
+       * aside from the target, which is captured in recipe.entryPoint. Depending
+       * on the recipe Type, the structure may be different.
+       * 
+ * + * .google.protobuf.Any arguments = 4; + * + * @return The arguments. + */ + public com.google.protobuf.Any getArguments() { + if (argumentsBuilder_ == null) { + return arguments_ == null ? com.google.protobuf.Any.getDefaultInstance() : arguments_; + } else { + return argumentsBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Collection of all external inputs that influenced the build on top of
+       * recipe.definedInMaterial and recipe.entryPoint. For example, if the
+       * recipe type were "make", then this might be the flags passed to make
+       * aside from the target, which is captured in recipe.entryPoint. Depending
+       * on the recipe Type, the structure may be different.
+       * 
+ * + * .google.protobuf.Any arguments = 4; + */ + public Builder setArguments(com.google.protobuf.Any value) { + if (argumentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + arguments_ = value; + onChanged(); + } else { + argumentsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Collection of all external inputs that influenced the build on top of
+       * recipe.definedInMaterial and recipe.entryPoint. For example, if the
+       * recipe type were "make", then this might be the flags passed to make
+       * aside from the target, which is captured in recipe.entryPoint. Depending
+       * on the recipe Type, the structure may be different.
+       * 
+ * + * .google.protobuf.Any arguments = 4; + */ + public Builder setArguments(com.google.protobuf.Any.Builder builderForValue) { + if (argumentsBuilder_ == null) { + arguments_ = builderForValue.build(); + onChanged(); + } else { + argumentsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Collection of all external inputs that influenced the build on top of
+       * recipe.definedInMaterial and recipe.entryPoint. For example, if the
+       * recipe type were "make", then this might be the flags passed to make
+       * aside from the target, which is captured in recipe.entryPoint. Depending
+       * on the recipe Type, the structure may be different.
+       * 
+ * + * .google.protobuf.Any arguments = 4; + */ + public Builder mergeArguments(com.google.protobuf.Any value) { + if (argumentsBuilder_ == null) { + if (arguments_ != null) { + arguments_ = + com.google.protobuf.Any.newBuilder(arguments_).mergeFrom(value).buildPartial(); + } else { + arguments_ = value; + } + onChanged(); + } else { + argumentsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Collection of all external inputs that influenced the build on top of
+       * recipe.definedInMaterial and recipe.entryPoint. For example, if the
+       * recipe type were "make", then this might be the flags passed to make
+       * aside from the target, which is captured in recipe.entryPoint. Depending
+       * on the recipe Type, the structure may be different.
+       * 
+ * + * .google.protobuf.Any arguments = 4; + */ + public Builder clearArguments() { + if (argumentsBuilder_ == null) { + arguments_ = null; + onChanged(); + } else { + arguments_ = null; + argumentsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Collection of all external inputs that influenced the build on top of
+       * recipe.definedInMaterial and recipe.entryPoint. For example, if the
+       * recipe type were "make", then this might be the flags passed to make
+       * aside from the target, which is captured in recipe.entryPoint. Depending
+       * on the recipe Type, the structure may be different.
+       * 
+ * + * .google.protobuf.Any arguments = 4; + */ + public com.google.protobuf.Any.Builder getArgumentsBuilder() { + + onChanged(); + return getArgumentsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Collection of all external inputs that influenced the build on top of
+       * recipe.definedInMaterial and recipe.entryPoint. For example, if the
+       * recipe type were "make", then this might be the flags passed to make
+       * aside from the target, which is captured in recipe.entryPoint. Depending
+       * on the recipe Type, the structure may be different.
+       * 
+ * + * .google.protobuf.Any arguments = 4; + */ + public com.google.protobuf.AnyOrBuilder getArgumentsOrBuilder() { + if (argumentsBuilder_ != null) { + return argumentsBuilder_.getMessageOrBuilder(); + } else { + return arguments_ == null ? com.google.protobuf.Any.getDefaultInstance() : arguments_; + } + } + /** + * + * + *
+       * Collection of all external inputs that influenced the build on top of
+       * recipe.definedInMaterial and recipe.entryPoint. For example, if the
+       * recipe type were "make", then this might be the flags passed to make
+       * aside from the target, which is captured in recipe.entryPoint. Depending
+       * on the recipe Type, the structure may be different.
+       * 
+ * + * .google.protobuf.Any arguments = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getArgumentsFieldBuilder() { + if (argumentsBuilder_ == null) { + argumentsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>( + getArguments(), getParentForChildren(), isClean()); + arguments_ = null; + } + return argumentsBuilder_; + } + + private com.google.protobuf.Any environment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + environmentBuilder_; + /** + * + * + *
+       * Any other builder-controlled inputs necessary for correctly evaluating
+       * the recipe. Usually only needed for reproducing the build but not
+       * evaluated as part of policy. Depending on the recipe Type, the structure
+       * may be different.
+       * 
+ * + * .google.protobuf.Any environment = 5; + * + * @return Whether the environment field is set. + */ + public boolean hasEnvironment() { + return environmentBuilder_ != null || environment_ != null; + } + /** + * + * + *
+       * Any other builder-controlled inputs necessary for correctly evaluating
+       * the recipe. Usually only needed for reproducing the build but not
+       * evaluated as part of policy. Depending on the recipe Type, the structure
+       * may be different.
+       * 
+ * + * .google.protobuf.Any environment = 5; + * + * @return The environment. + */ + public com.google.protobuf.Any getEnvironment() { + if (environmentBuilder_ == null) { + return environment_ == null ? com.google.protobuf.Any.getDefaultInstance() : environment_; + } else { + return environmentBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Any other builder-controlled inputs necessary for correctly evaluating
+       * the recipe. Usually only needed for reproducing the build but not
+       * evaluated as part of policy. Depending on the recipe Type, the structure
+       * may be different.
+       * 
+ * + * .google.protobuf.Any environment = 5; + */ + public Builder setEnvironment(com.google.protobuf.Any value) { + if (environmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + environment_ = value; + onChanged(); + } else { + environmentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Any other builder-controlled inputs necessary for correctly evaluating
+       * the recipe. Usually only needed for reproducing the build but not
+       * evaluated as part of policy. Depending on the recipe Type, the structure
+       * may be different.
+       * 
+ * + * .google.protobuf.Any environment = 5; + */ + public Builder setEnvironment(com.google.protobuf.Any.Builder builderForValue) { + if (environmentBuilder_ == null) { + environment_ = builderForValue.build(); + onChanged(); + } else { + environmentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Any other builder-controlled inputs necessary for correctly evaluating
+       * the recipe. Usually only needed for reproducing the build but not
+       * evaluated as part of policy. Depending on the recipe Type, the structure
+       * may be different.
+       * 
+ * + * .google.protobuf.Any environment = 5; + */ + public Builder mergeEnvironment(com.google.protobuf.Any value) { + if (environmentBuilder_ == null) { + if (environment_ != null) { + environment_ = + com.google.protobuf.Any.newBuilder(environment_).mergeFrom(value).buildPartial(); + } else { + environment_ = value; + } + onChanged(); + } else { + environmentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Any other builder-controlled inputs necessary for correctly evaluating
+       * the recipe. Usually only needed for reproducing the build but not
+       * evaluated as part of policy. Depending on the recipe Type, the structure
+       * may be different.
+       * 
+ * + * .google.protobuf.Any environment = 5; + */ + public Builder clearEnvironment() { + if (environmentBuilder_ == null) { + environment_ = null; + onChanged(); + } else { + environment_ = null; + environmentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Any other builder-controlled inputs necessary for correctly evaluating
+       * the recipe. Usually only needed for reproducing the build but not
+       * evaluated as part of policy. Depending on the recipe Type, the structure
+       * may be different.
+       * 
+ * + * .google.protobuf.Any environment = 5; + */ + public com.google.protobuf.Any.Builder getEnvironmentBuilder() { + + onChanged(); + return getEnvironmentFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Any other builder-controlled inputs necessary for correctly evaluating
+       * the recipe. Usually only needed for reproducing the build but not
+       * evaluated as part of policy. Depending on the recipe Type, the structure
+       * may be different.
+       * 
+ * + * .google.protobuf.Any environment = 5; + */ + public com.google.protobuf.AnyOrBuilder getEnvironmentOrBuilder() { + if (environmentBuilder_ != null) { + return environmentBuilder_.getMessageOrBuilder(); + } else { + return environment_ == null ? com.google.protobuf.Any.getDefaultInstance() : environment_; + } + } + /** + * + * + *
+       * Any other builder-controlled inputs necessary for correctly evaluating
+       * the recipe. Usually only needed for reproducing the build but not
+       * evaluated as part of policy. Depending on the recipe Type, the structure
+       * may be different.
+       * 
+ * + * .google.protobuf.Any environment = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getEnvironmentFieldBuilder() { + if (environmentBuilder_ == null) { + environmentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>( + getEnvironment(), getParentForChildren(), isClean()); + environment_ = null; + } + return environmentBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.SlsaProvenance.SlsaRecipe) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.SlsaProvenance.SlsaRecipe) + private static final io.grafeas.v1.SlsaProvenance.SlsaRecipe DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.SlsaProvenance.SlsaRecipe(); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaRecipe getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SlsaRecipe parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SlsaRecipe(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaRecipe getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SlsaCompletenessOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.SlsaProvenance.SlsaCompleteness) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * If true, the builder claims that recipe.arguments is complete, meaning
+     * that all external inputs are properly captured in the recipe.
+     * 
+ * + * bool arguments = 1; + * + * @return The arguments. + */ + boolean getArguments(); + + /** + * + * + *
+     * If true, the builder claims that recipe.environment is claimed to be
+     * complete.
+     * 
+ * + * bool environment = 2; + * + * @return The environment. + */ + boolean getEnvironment(); + + /** + * + * + *
+     * If true, the builder claims that materials are complete, usually through
+     * some controls to prevent network access. Sometimes called "hermetic".
+     * 
+ * + * bool materials = 3; + * + * @return The materials. + */ + boolean getMaterials(); + } + /** + * + * + *
+   * Indicates that the builder claims certain fields in this message to be
+   * complete.
+   * 
+ * + * Protobuf type {@code grafeas.v1.SlsaProvenance.SlsaCompleteness} + */ + public static final class SlsaCompleteness extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.SlsaProvenance.SlsaCompleteness) + SlsaCompletenessOrBuilder { + private static final long serialVersionUID = 0L; + // Use SlsaCompleteness.newBuilder() to construct. + private SlsaCompleteness(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SlsaCompleteness() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SlsaCompleteness(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SlsaCompleteness( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + arguments_ = input.readBool(); + break; + } + case 16: + { + environment_ = input.readBool(); + break; + } + case 24: + { + materials_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaCompleteness_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaCompleteness_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.SlsaProvenance.SlsaCompleteness.class, + io.grafeas.v1.SlsaProvenance.SlsaCompleteness.Builder.class); + } + + public static final int ARGUMENTS_FIELD_NUMBER = 1; + private boolean arguments_; + /** + * + * + *
+     * If true, the builder claims that recipe.arguments is complete, meaning
+     * that all external inputs are properly captured in the recipe.
+     * 
+ * + * bool arguments = 1; + * + * @return The arguments. + */ + @java.lang.Override + public boolean getArguments() { + return arguments_; + } + + public static final int ENVIRONMENT_FIELD_NUMBER = 2; + private boolean environment_; + /** + * + * + *
+     * If true, the builder claims that recipe.environment is claimed to be
+     * complete.
+     * 
+ * + * bool environment = 2; + * + * @return The environment. + */ + @java.lang.Override + public boolean getEnvironment() { + return environment_; + } + + public static final int MATERIALS_FIELD_NUMBER = 3; + private boolean materials_; + /** + * + * + *
+     * If true, the builder claims that materials are complete, usually through
+     * some controls to prevent network access. Sometimes called "hermetic".
+     * 
+ * + * bool materials = 3; + * + * @return The materials. + */ + @java.lang.Override + public boolean getMaterials() { + return materials_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (arguments_ != false) { + output.writeBool(1, arguments_); + } + if (environment_ != false) { + output.writeBool(2, environment_); + } + if (materials_ != false) { + output.writeBool(3, materials_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (arguments_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, arguments_); + } + if (environment_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, environment_); + } + if (materials_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, materials_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.SlsaProvenance.SlsaCompleteness)) { + return super.equals(obj); + } + io.grafeas.v1.SlsaProvenance.SlsaCompleteness other = + (io.grafeas.v1.SlsaProvenance.SlsaCompleteness) obj; + + if (getArguments() != other.getArguments()) return false; + if (getEnvironment() != other.getEnvironment()) return false; + if (getMaterials() != other.getMaterials()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ARGUMENTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getArguments()); + hash = (37 * hash) + ENVIRONMENT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnvironment()); + hash = (37 * hash) + MATERIALS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getMaterials()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.SlsaProvenance.SlsaCompleteness parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaCompleteness parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaCompleteness parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaCompleteness parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaCompleteness parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaCompleteness parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaCompleteness parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaCompleteness parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaCompleteness parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaCompleteness parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaCompleteness parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaCompleteness parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.SlsaProvenance.SlsaCompleteness 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Indicates that the builder claims certain fields in this message to be
+     * complete.
+     * 
+ * + * Protobuf type {@code grafeas.v1.SlsaProvenance.SlsaCompleteness} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.SlsaProvenance.SlsaCompleteness) + io.grafeas.v1.SlsaProvenance.SlsaCompletenessOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaCompleteness_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaCompleteness_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.SlsaProvenance.SlsaCompleteness.class, + io.grafeas.v1.SlsaProvenance.SlsaCompleteness.Builder.class); + } + + // Construct using io.grafeas.v1.SlsaProvenance.SlsaCompleteness.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + arguments_ = false; + + environment_ = false; + + materials_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaCompleteness_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaCompleteness getDefaultInstanceForType() { + return io.grafeas.v1.SlsaProvenance.SlsaCompleteness.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaCompleteness build() { + io.grafeas.v1.SlsaProvenance.SlsaCompleteness result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaCompleteness buildPartial() { + io.grafeas.v1.SlsaProvenance.SlsaCompleteness result = + new io.grafeas.v1.SlsaProvenance.SlsaCompleteness(this); + result.arguments_ = arguments_; + result.environment_ = environment_; + result.materials_ = materials_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.SlsaProvenance.SlsaCompleteness) { + return mergeFrom((io.grafeas.v1.SlsaProvenance.SlsaCompleteness) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.SlsaProvenance.SlsaCompleteness other) { + if (other == io.grafeas.v1.SlsaProvenance.SlsaCompleteness.getDefaultInstance()) + return this; + if (other.getArguments() != false) { + setArguments(other.getArguments()); + } + if (other.getEnvironment() != false) { + setEnvironment(other.getEnvironment()); + } + if (other.getMaterials() != false) { + setMaterials(other.getMaterials()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.SlsaProvenance.SlsaCompleteness parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.SlsaProvenance.SlsaCompleteness) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean arguments_; + /** + * + * + *
+       * If true, the builder claims that recipe.arguments is complete, meaning
+       * that all external inputs are properly captured in the recipe.
+       * 
+ * + * bool arguments = 1; + * + * @return The arguments. + */ + @java.lang.Override + public boolean getArguments() { + return arguments_; + } + /** + * + * + *
+       * If true, the builder claims that recipe.arguments is complete, meaning
+       * that all external inputs are properly captured in the recipe.
+       * 
+ * + * bool arguments = 1; + * + * @param value The arguments to set. + * @return This builder for chaining. + */ + public Builder setArguments(boolean value) { + + arguments_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * If true, the builder claims that recipe.arguments is complete, meaning
+       * that all external inputs are properly captured in the recipe.
+       * 
+ * + * bool arguments = 1; + * + * @return This builder for chaining. + */ + public Builder clearArguments() { + + arguments_ = false; + onChanged(); + return this; + } + + private boolean environment_; + /** + * + * + *
+       * If true, the builder claims that recipe.environment is claimed to be
+       * complete.
+       * 
+ * + * bool environment = 2; + * + * @return The environment. + */ + @java.lang.Override + public boolean getEnvironment() { + return environment_; + } + /** + * + * + *
+       * If true, the builder claims that recipe.environment is claimed to be
+       * complete.
+       * 
+ * + * bool environment = 2; + * + * @param value The environment to set. + * @return This builder for chaining. + */ + public Builder setEnvironment(boolean value) { + + environment_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * If true, the builder claims that recipe.environment is claimed to be
+       * complete.
+       * 
+ * + * bool environment = 2; + * + * @return This builder for chaining. + */ + public Builder clearEnvironment() { + + environment_ = false; + onChanged(); + return this; + } + + private boolean materials_; + /** + * + * + *
+       * If true, the builder claims that materials are complete, usually through
+       * some controls to prevent network access. Sometimes called "hermetic".
+       * 
+ * + * bool materials = 3; + * + * @return The materials. + */ + @java.lang.Override + public boolean getMaterials() { + return materials_; + } + /** + * + * + *
+       * If true, the builder claims that materials are complete, usually through
+       * some controls to prevent network access. Sometimes called "hermetic".
+       * 
+ * + * bool materials = 3; + * + * @param value The materials to set. + * @return This builder for chaining. + */ + public Builder setMaterials(boolean value) { + + materials_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * If true, the builder claims that materials are complete, usually through
+       * some controls to prevent network access. Sometimes called "hermetic".
+       * 
+ * + * bool materials = 3; + * + * @return This builder for chaining. + */ + public Builder clearMaterials() { + + materials_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.SlsaProvenance.SlsaCompleteness) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.SlsaProvenance.SlsaCompleteness) + private static final io.grafeas.v1.SlsaProvenance.SlsaCompleteness DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.SlsaProvenance.SlsaCompleteness(); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaCompleteness getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SlsaCompleteness parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SlsaCompleteness(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaCompleteness getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SlsaMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.SlsaProvenance.SlsaMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Identifies the particular build invocation, which can be useful for
+     * finding associated logs or other ad-hoc analysis. The value SHOULD be
+     * globally unique, per in-toto Provenance spec.
+     * 
+ * + * string build_invocation_id = 1; + * + * @return The buildInvocationId. + */ + java.lang.String getBuildInvocationId(); + /** + * + * + *
+     * Identifies the particular build invocation, which can be useful for
+     * finding associated logs or other ad-hoc analysis. The value SHOULD be
+     * globally unique, per in-toto Provenance spec.
+     * 
+ * + * string build_invocation_id = 1; + * + * @return The bytes for buildInvocationId. + */ + com.google.protobuf.ByteString getBuildInvocationIdBytes(); + + /** + * + * + *
+     * The timestamp of when the build started.
+     * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + * + * @return Whether the buildStartedOn field is set. + */ + boolean hasBuildStartedOn(); + /** + * + * + *
+     * The timestamp of when the build started.
+     * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + * + * @return The buildStartedOn. + */ + com.google.protobuf.Timestamp getBuildStartedOn(); + /** + * + * + *
+     * The timestamp of when the build started.
+     * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + */ + com.google.protobuf.TimestampOrBuilder getBuildStartedOnOrBuilder(); + + /** + * + * + *
+     * The timestamp of when the build completed.
+     * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + * + * @return Whether the buildFinishedOn field is set. + */ + boolean hasBuildFinishedOn(); + /** + * + * + *
+     * The timestamp of when the build completed.
+     * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + * + * @return The buildFinishedOn. + */ + com.google.protobuf.Timestamp getBuildFinishedOn(); + /** + * + * + *
+     * The timestamp of when the build completed.
+     * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + */ + com.google.protobuf.TimestampOrBuilder getBuildFinishedOnOrBuilder(); + + /** + * + * + *
+     * Indicates that the builder claims certain fields in this message to be
+     * complete.
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaCompleteness completeness = 4; + * + * @return Whether the completeness field is set. + */ + boolean hasCompleteness(); + /** + * + * + *
+     * Indicates that the builder claims certain fields in this message to be
+     * complete.
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaCompleteness completeness = 4; + * + * @return The completeness. + */ + io.grafeas.v1.SlsaProvenance.SlsaCompleteness getCompleteness(); + /** + * + * + *
+     * Indicates that the builder claims certain fields in this message to be
+     * complete.
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaCompleteness completeness = 4; + */ + io.grafeas.v1.SlsaProvenance.SlsaCompletenessOrBuilder getCompletenessOrBuilder(); + + /** + * + * + *
+     * If true, the builder claims that running the recipe on materials will
+     * produce bit-for-bit identical output.
+     * 
+ * + * bool reproducible = 5; + * + * @return The reproducible. + */ + boolean getReproducible(); + } + /** + * + * + *
+   * Other properties of the build.
+   * 
+ * + * Protobuf type {@code grafeas.v1.SlsaProvenance.SlsaMetadata} + */ + public static final class SlsaMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.SlsaProvenance.SlsaMetadata) + SlsaMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use SlsaMetadata.newBuilder() to construct. + private SlsaMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SlsaMetadata() { + buildInvocationId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SlsaMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SlsaMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + buildInvocationId_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (buildStartedOn_ != null) { + subBuilder = buildStartedOn_.toBuilder(); + } + buildStartedOn_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(buildStartedOn_); + buildStartedOn_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (buildFinishedOn_ != null) { + subBuilder = buildFinishedOn_.toBuilder(); + } + buildFinishedOn_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(buildFinishedOn_); + buildFinishedOn_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + io.grafeas.v1.SlsaProvenance.SlsaCompleteness.Builder subBuilder = null; + if (completeness_ != null) { + subBuilder = completeness_.toBuilder(); + } + completeness_ = + input.readMessage( + io.grafeas.v1.SlsaProvenance.SlsaCompleteness.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(completeness_); + completeness_ = subBuilder.buildPartial(); + } + + break; + } + case 40: + { + reproducible_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.SlsaProvenance.SlsaMetadata.class, + io.grafeas.v1.SlsaProvenance.SlsaMetadata.Builder.class); + } + + public static final int BUILD_INVOCATION_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object buildInvocationId_; + /** + * + * + *
+     * Identifies the particular build invocation, which can be useful for
+     * finding associated logs or other ad-hoc analysis. The value SHOULD be
+     * globally unique, per in-toto Provenance spec.
+     * 
+ * + * string build_invocation_id = 1; + * + * @return The buildInvocationId. + */ + @java.lang.Override + public java.lang.String getBuildInvocationId() { + java.lang.Object ref = buildInvocationId_; + 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(); + buildInvocationId_ = s; + return s; + } + } + /** + * + * + *
+     * Identifies the particular build invocation, which can be useful for
+     * finding associated logs or other ad-hoc analysis. The value SHOULD be
+     * globally unique, per in-toto Provenance spec.
+     * 
+ * + * string build_invocation_id = 1; + * + * @return The bytes for buildInvocationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBuildInvocationIdBytes() { + java.lang.Object ref = buildInvocationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + buildInvocationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUILD_STARTED_ON_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp buildStartedOn_; + /** + * + * + *
+     * The timestamp of when the build started.
+     * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + * + * @return Whether the buildStartedOn field is set. + */ + @java.lang.Override + public boolean hasBuildStartedOn() { + return buildStartedOn_ != null; + } + /** + * + * + *
+     * The timestamp of when the build started.
+     * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + * + * @return The buildStartedOn. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getBuildStartedOn() { + return buildStartedOn_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : buildStartedOn_; + } + /** + * + * + *
+     * The timestamp of when the build started.
+     * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getBuildStartedOnOrBuilder() { + return getBuildStartedOn(); + } + + public static final int BUILD_FINISHED_ON_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp buildFinishedOn_; + /** + * + * + *
+     * The timestamp of when the build completed.
+     * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + * + * @return Whether the buildFinishedOn field is set. + */ + @java.lang.Override + public boolean hasBuildFinishedOn() { + return buildFinishedOn_ != null; + } + /** + * + * + *
+     * The timestamp of when the build completed.
+     * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + * + * @return The buildFinishedOn. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getBuildFinishedOn() { + return buildFinishedOn_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : buildFinishedOn_; + } + /** + * + * + *
+     * The timestamp of when the build completed.
+     * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getBuildFinishedOnOrBuilder() { + return getBuildFinishedOn(); + } + + public static final int COMPLETENESS_FIELD_NUMBER = 4; + private io.grafeas.v1.SlsaProvenance.SlsaCompleteness completeness_; + /** + * + * + *
+     * Indicates that the builder claims certain fields in this message to be
+     * complete.
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaCompleteness completeness = 4; + * + * @return Whether the completeness field is set. + */ + @java.lang.Override + public boolean hasCompleteness() { + return completeness_ != null; + } + /** + * + * + *
+     * Indicates that the builder claims certain fields in this message to be
+     * complete.
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaCompleteness completeness = 4; + * + * @return The completeness. + */ + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaCompleteness getCompleteness() { + return completeness_ == null + ? io.grafeas.v1.SlsaProvenance.SlsaCompleteness.getDefaultInstance() + : completeness_; + } + /** + * + * + *
+     * Indicates that the builder claims certain fields in this message to be
+     * complete.
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaCompleteness completeness = 4; + */ + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaCompletenessOrBuilder getCompletenessOrBuilder() { + return getCompleteness(); + } + + public static final int REPRODUCIBLE_FIELD_NUMBER = 5; + private boolean reproducible_; + /** + * + * + *
+     * If true, the builder claims that running the recipe on materials will
+     * produce bit-for-bit identical output.
+     * 
+ * + * bool reproducible = 5; + * + * @return The reproducible. + */ + @java.lang.Override + public boolean getReproducible() { + return reproducible_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(buildInvocationId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, buildInvocationId_); + } + if (buildStartedOn_ != null) { + output.writeMessage(2, getBuildStartedOn()); + } + if (buildFinishedOn_ != null) { + output.writeMessage(3, getBuildFinishedOn()); + } + if (completeness_ != null) { + output.writeMessage(4, getCompleteness()); + } + if (reproducible_ != false) { + output.writeBool(5, reproducible_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(buildInvocationId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, buildInvocationId_); + } + if (buildStartedOn_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBuildStartedOn()); + } + if (buildFinishedOn_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBuildFinishedOn()); + } + if (completeness_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCompleteness()); + } + if (reproducible_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, reproducible_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.SlsaProvenance.SlsaMetadata)) { + return super.equals(obj); + } + io.grafeas.v1.SlsaProvenance.SlsaMetadata other = + (io.grafeas.v1.SlsaProvenance.SlsaMetadata) obj; + + if (!getBuildInvocationId().equals(other.getBuildInvocationId())) return false; + if (hasBuildStartedOn() != other.hasBuildStartedOn()) return false; + if (hasBuildStartedOn()) { + if (!getBuildStartedOn().equals(other.getBuildStartedOn())) return false; + } + if (hasBuildFinishedOn() != other.hasBuildFinishedOn()) return false; + if (hasBuildFinishedOn()) { + if (!getBuildFinishedOn().equals(other.getBuildFinishedOn())) return false; + } + if (hasCompleteness() != other.hasCompleteness()) return false; + if (hasCompleteness()) { + if (!getCompleteness().equals(other.getCompleteness())) return false; + } + if (getReproducible() != other.getReproducible()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BUILD_INVOCATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getBuildInvocationId().hashCode(); + if (hasBuildStartedOn()) { + hash = (37 * hash) + BUILD_STARTED_ON_FIELD_NUMBER; + hash = (53 * hash) + getBuildStartedOn().hashCode(); + } + if (hasBuildFinishedOn()) { + hash = (37 * hash) + BUILD_FINISHED_ON_FIELD_NUMBER; + hash = (53 * hash) + getBuildFinishedOn().hashCode(); + } + if (hasCompleteness()) { + hash = (37 * hash) + COMPLETENESS_FIELD_NUMBER; + hash = (53 * hash) + getCompleteness().hashCode(); + } + hash = (37 * hash) + REPRODUCIBLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReproducible()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.SlsaProvenance.SlsaMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.SlsaProvenance.SlsaMetadata 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Other properties of the build.
+     * 
+ * + * Protobuf type {@code grafeas.v1.SlsaProvenance.SlsaMetadata} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.SlsaProvenance.SlsaMetadata) + io.grafeas.v1.SlsaProvenance.SlsaMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.SlsaProvenance.SlsaMetadata.class, + io.grafeas.v1.SlsaProvenance.SlsaMetadata.Builder.class); + } + + // Construct using io.grafeas.v1.SlsaProvenance.SlsaMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + buildInvocationId_ = ""; + + if (buildStartedOnBuilder_ == null) { + buildStartedOn_ = null; + } else { + buildStartedOn_ = null; + buildStartedOnBuilder_ = null; + } + if (buildFinishedOnBuilder_ == null) { + buildFinishedOn_ = null; + } else { + buildFinishedOn_ = null; + buildFinishedOnBuilder_ = null; + } + if (completenessBuilder_ == null) { + completeness_ = null; + } else { + completeness_ = null; + completenessBuilder_ = null; + } + reproducible_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaMetadata_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaMetadata getDefaultInstanceForType() { + return io.grafeas.v1.SlsaProvenance.SlsaMetadata.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaMetadata build() { + io.grafeas.v1.SlsaProvenance.SlsaMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaMetadata buildPartial() { + io.grafeas.v1.SlsaProvenance.SlsaMetadata result = + new io.grafeas.v1.SlsaProvenance.SlsaMetadata(this); + result.buildInvocationId_ = buildInvocationId_; + if (buildStartedOnBuilder_ == null) { + result.buildStartedOn_ = buildStartedOn_; + } else { + result.buildStartedOn_ = buildStartedOnBuilder_.build(); + } + if (buildFinishedOnBuilder_ == null) { + result.buildFinishedOn_ = buildFinishedOn_; + } else { + result.buildFinishedOn_ = buildFinishedOnBuilder_.build(); + } + if (completenessBuilder_ == null) { + result.completeness_ = completeness_; + } else { + result.completeness_ = completenessBuilder_.build(); + } + result.reproducible_ = reproducible_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.SlsaProvenance.SlsaMetadata) { + return mergeFrom((io.grafeas.v1.SlsaProvenance.SlsaMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.SlsaProvenance.SlsaMetadata other) { + if (other == io.grafeas.v1.SlsaProvenance.SlsaMetadata.getDefaultInstance()) return this; + if (!other.getBuildInvocationId().isEmpty()) { + buildInvocationId_ = other.buildInvocationId_; + onChanged(); + } + if (other.hasBuildStartedOn()) { + mergeBuildStartedOn(other.getBuildStartedOn()); + } + if (other.hasBuildFinishedOn()) { + mergeBuildFinishedOn(other.getBuildFinishedOn()); + } + if (other.hasCompleteness()) { + mergeCompleteness(other.getCompleteness()); + } + if (other.getReproducible() != false) { + setReproducible(other.getReproducible()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.SlsaProvenance.SlsaMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.SlsaProvenance.SlsaMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object buildInvocationId_ = ""; + /** + * + * + *
+       * Identifies the particular build invocation, which can be useful for
+       * finding associated logs or other ad-hoc analysis. The value SHOULD be
+       * globally unique, per in-toto Provenance spec.
+       * 
+ * + * string build_invocation_id = 1; + * + * @return The buildInvocationId. + */ + public java.lang.String getBuildInvocationId() { + java.lang.Object ref = buildInvocationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + buildInvocationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Identifies the particular build invocation, which can be useful for
+       * finding associated logs or other ad-hoc analysis. The value SHOULD be
+       * globally unique, per in-toto Provenance spec.
+       * 
+ * + * string build_invocation_id = 1; + * + * @return The bytes for buildInvocationId. + */ + public com.google.protobuf.ByteString getBuildInvocationIdBytes() { + java.lang.Object ref = buildInvocationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + buildInvocationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Identifies the particular build invocation, which can be useful for
+       * finding associated logs or other ad-hoc analysis. The value SHOULD be
+       * globally unique, per in-toto Provenance spec.
+       * 
+ * + * string build_invocation_id = 1; + * + * @param value The buildInvocationId to set. + * @return This builder for chaining. + */ + public Builder setBuildInvocationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + buildInvocationId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Identifies the particular build invocation, which can be useful for
+       * finding associated logs or other ad-hoc analysis. The value SHOULD be
+       * globally unique, per in-toto Provenance spec.
+       * 
+ * + * string build_invocation_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearBuildInvocationId() { + + buildInvocationId_ = getDefaultInstance().getBuildInvocationId(); + onChanged(); + return this; + } + /** + * + * + *
+       * Identifies the particular build invocation, which can be useful for
+       * finding associated logs or other ad-hoc analysis. The value SHOULD be
+       * globally unique, per in-toto Provenance spec.
+       * 
+ * + * string build_invocation_id = 1; + * + * @param value The bytes for buildInvocationId to set. + * @return This builder for chaining. + */ + public Builder setBuildInvocationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + buildInvocationId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp buildStartedOn_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + buildStartedOnBuilder_; + /** + * + * + *
+       * The timestamp of when the build started.
+       * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + * + * @return Whether the buildStartedOn field is set. + */ + public boolean hasBuildStartedOn() { + return buildStartedOnBuilder_ != null || buildStartedOn_ != null; + } + /** + * + * + *
+       * The timestamp of when the build started.
+       * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + * + * @return The buildStartedOn. + */ + public com.google.protobuf.Timestamp getBuildStartedOn() { + if (buildStartedOnBuilder_ == null) { + return buildStartedOn_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : buildStartedOn_; + } else { + return buildStartedOnBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The timestamp of when the build started.
+       * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + */ + public Builder setBuildStartedOn(com.google.protobuf.Timestamp value) { + if (buildStartedOnBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + buildStartedOn_ = value; + onChanged(); + } else { + buildStartedOnBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The timestamp of when the build started.
+       * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + */ + public Builder setBuildStartedOn(com.google.protobuf.Timestamp.Builder builderForValue) { + if (buildStartedOnBuilder_ == null) { + buildStartedOn_ = builderForValue.build(); + onChanged(); + } else { + buildStartedOnBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The timestamp of when the build started.
+       * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + */ + public Builder mergeBuildStartedOn(com.google.protobuf.Timestamp value) { + if (buildStartedOnBuilder_ == null) { + if (buildStartedOn_ != null) { + buildStartedOn_ = + com.google.protobuf.Timestamp.newBuilder(buildStartedOn_) + .mergeFrom(value) + .buildPartial(); + } else { + buildStartedOn_ = value; + } + onChanged(); + } else { + buildStartedOnBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The timestamp of when the build started.
+       * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + */ + public Builder clearBuildStartedOn() { + if (buildStartedOnBuilder_ == null) { + buildStartedOn_ = null; + onChanged(); + } else { + buildStartedOn_ = null; + buildStartedOnBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The timestamp of when the build started.
+       * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + */ + public com.google.protobuf.Timestamp.Builder getBuildStartedOnBuilder() { + + onChanged(); + return getBuildStartedOnFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The timestamp of when the build started.
+       * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + */ + public com.google.protobuf.TimestampOrBuilder getBuildStartedOnOrBuilder() { + if (buildStartedOnBuilder_ != null) { + return buildStartedOnBuilder_.getMessageOrBuilder(); + } else { + return buildStartedOn_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : buildStartedOn_; + } + } + /** + * + * + *
+       * The timestamp of when the build started.
+       * 
+ * + * .google.protobuf.Timestamp build_started_on = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getBuildStartedOnFieldBuilder() { + if (buildStartedOnBuilder_ == null) { + buildStartedOnBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getBuildStartedOn(), getParentForChildren(), isClean()); + buildStartedOn_ = null; + } + return buildStartedOnBuilder_; + } + + private com.google.protobuf.Timestamp buildFinishedOn_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + buildFinishedOnBuilder_; + /** + * + * + *
+       * The timestamp of when the build completed.
+       * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + * + * @return Whether the buildFinishedOn field is set. + */ + public boolean hasBuildFinishedOn() { + return buildFinishedOnBuilder_ != null || buildFinishedOn_ != null; + } + /** + * + * + *
+       * The timestamp of when the build completed.
+       * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + * + * @return The buildFinishedOn. + */ + public com.google.protobuf.Timestamp getBuildFinishedOn() { + if (buildFinishedOnBuilder_ == null) { + return buildFinishedOn_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : buildFinishedOn_; + } else { + return buildFinishedOnBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The timestamp of when the build completed.
+       * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + */ + public Builder setBuildFinishedOn(com.google.protobuf.Timestamp value) { + if (buildFinishedOnBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + buildFinishedOn_ = value; + onChanged(); + } else { + buildFinishedOnBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The timestamp of when the build completed.
+       * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + */ + public Builder setBuildFinishedOn(com.google.protobuf.Timestamp.Builder builderForValue) { + if (buildFinishedOnBuilder_ == null) { + buildFinishedOn_ = builderForValue.build(); + onChanged(); + } else { + buildFinishedOnBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The timestamp of when the build completed.
+       * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + */ + public Builder mergeBuildFinishedOn(com.google.protobuf.Timestamp value) { + if (buildFinishedOnBuilder_ == null) { + if (buildFinishedOn_ != null) { + buildFinishedOn_ = + com.google.protobuf.Timestamp.newBuilder(buildFinishedOn_) + .mergeFrom(value) + .buildPartial(); + } else { + buildFinishedOn_ = value; + } + onChanged(); + } else { + buildFinishedOnBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The timestamp of when the build completed.
+       * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + */ + public Builder clearBuildFinishedOn() { + if (buildFinishedOnBuilder_ == null) { + buildFinishedOn_ = null; + onChanged(); + } else { + buildFinishedOn_ = null; + buildFinishedOnBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The timestamp of when the build completed.
+       * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + */ + public com.google.protobuf.Timestamp.Builder getBuildFinishedOnBuilder() { + + onChanged(); + return getBuildFinishedOnFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The timestamp of when the build completed.
+       * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + */ + public com.google.protobuf.TimestampOrBuilder getBuildFinishedOnOrBuilder() { + if (buildFinishedOnBuilder_ != null) { + return buildFinishedOnBuilder_.getMessageOrBuilder(); + } else { + return buildFinishedOn_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : buildFinishedOn_; + } + } + /** + * + * + *
+       * The timestamp of when the build completed.
+       * 
+ * + * .google.protobuf.Timestamp build_finished_on = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getBuildFinishedOnFieldBuilder() { + if (buildFinishedOnBuilder_ == null) { + buildFinishedOnBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getBuildFinishedOn(), getParentForChildren(), isClean()); + buildFinishedOn_ = null; + } + return buildFinishedOnBuilder_; + } + + private io.grafeas.v1.SlsaProvenance.SlsaCompleteness completeness_; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.SlsaProvenance.SlsaCompleteness, + io.grafeas.v1.SlsaProvenance.SlsaCompleteness.Builder, + io.grafeas.v1.SlsaProvenance.SlsaCompletenessOrBuilder> + completenessBuilder_; + /** + * + * + *
+       * Indicates that the builder claims certain fields in this message to be
+       * complete.
+       * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaCompleteness completeness = 4; + * + * @return Whether the completeness field is set. + */ + public boolean hasCompleteness() { + return completenessBuilder_ != null || completeness_ != null; + } + /** + * + * + *
+       * Indicates that the builder claims certain fields in this message to be
+       * complete.
+       * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaCompleteness completeness = 4; + * + * @return The completeness. + */ + public io.grafeas.v1.SlsaProvenance.SlsaCompleteness getCompleteness() { + if (completenessBuilder_ == null) { + return completeness_ == null + ? io.grafeas.v1.SlsaProvenance.SlsaCompleteness.getDefaultInstance() + : completeness_; + } else { + return completenessBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Indicates that the builder claims certain fields in this message to be
+       * complete.
+       * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaCompleteness completeness = 4; + */ + public Builder setCompleteness(io.grafeas.v1.SlsaProvenance.SlsaCompleteness value) { + if (completenessBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + completeness_ = value; + onChanged(); + } else { + completenessBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Indicates that the builder claims certain fields in this message to be
+       * complete.
+       * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaCompleteness completeness = 4; + */ + public Builder setCompleteness( + io.grafeas.v1.SlsaProvenance.SlsaCompleteness.Builder builderForValue) { + if (completenessBuilder_ == null) { + completeness_ = builderForValue.build(); + onChanged(); + } else { + completenessBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Indicates that the builder claims certain fields in this message to be
+       * complete.
+       * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaCompleteness completeness = 4; + */ + public Builder mergeCompleteness(io.grafeas.v1.SlsaProvenance.SlsaCompleteness value) { + if (completenessBuilder_ == null) { + if (completeness_ != null) { + completeness_ = + io.grafeas.v1.SlsaProvenance.SlsaCompleteness.newBuilder(completeness_) + .mergeFrom(value) + .buildPartial(); + } else { + completeness_ = value; + } + onChanged(); + } else { + completenessBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Indicates that the builder claims certain fields in this message to be
+       * complete.
+       * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaCompleteness completeness = 4; + */ + public Builder clearCompleteness() { + if (completenessBuilder_ == null) { + completeness_ = null; + onChanged(); + } else { + completeness_ = null; + completenessBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Indicates that the builder claims certain fields in this message to be
+       * complete.
+       * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaCompleteness completeness = 4; + */ + public io.grafeas.v1.SlsaProvenance.SlsaCompleteness.Builder getCompletenessBuilder() { + + onChanged(); + return getCompletenessFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Indicates that the builder claims certain fields in this message to be
+       * complete.
+       * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaCompleteness completeness = 4; + */ + public io.grafeas.v1.SlsaProvenance.SlsaCompletenessOrBuilder getCompletenessOrBuilder() { + if (completenessBuilder_ != null) { + return completenessBuilder_.getMessageOrBuilder(); + } else { + return completeness_ == null + ? io.grafeas.v1.SlsaProvenance.SlsaCompleteness.getDefaultInstance() + : completeness_; + } + } + /** + * + * + *
+       * Indicates that the builder claims certain fields in this message to be
+       * complete.
+       * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaCompleteness completeness = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.SlsaProvenance.SlsaCompleteness, + io.grafeas.v1.SlsaProvenance.SlsaCompleteness.Builder, + io.grafeas.v1.SlsaProvenance.SlsaCompletenessOrBuilder> + getCompletenessFieldBuilder() { + if (completenessBuilder_ == null) { + completenessBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.SlsaProvenance.SlsaCompleteness, + io.grafeas.v1.SlsaProvenance.SlsaCompleteness.Builder, + io.grafeas.v1.SlsaProvenance.SlsaCompletenessOrBuilder>( + getCompleteness(), getParentForChildren(), isClean()); + completeness_ = null; + } + return completenessBuilder_; + } + + private boolean reproducible_; + /** + * + * + *
+       * If true, the builder claims that running the recipe on materials will
+       * produce bit-for-bit identical output.
+       * 
+ * + * bool reproducible = 5; + * + * @return The reproducible. + */ + @java.lang.Override + public boolean getReproducible() { + return reproducible_; + } + /** + * + * + *
+       * If true, the builder claims that running the recipe on materials will
+       * produce bit-for-bit identical output.
+       * 
+ * + * bool reproducible = 5; + * + * @param value The reproducible to set. + * @return This builder for chaining. + */ + public Builder setReproducible(boolean value) { + + reproducible_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * If true, the builder claims that running the recipe on materials will
+       * produce bit-for-bit identical output.
+       * 
+ * + * bool reproducible = 5; + * + * @return This builder for chaining. + */ + public Builder clearReproducible() { + + reproducible_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.SlsaProvenance.SlsaMetadata) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.SlsaProvenance.SlsaMetadata) + private static final io.grafeas.v1.SlsaProvenance.SlsaMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.SlsaProvenance.SlsaMetadata(); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SlsaMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SlsaMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SlsaBuilderOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.SlsaProvenance.SlsaBuilder) + com.google.protobuf.MessageOrBuilder { + + /** + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + } + /** Protobuf type {@code grafeas.v1.SlsaProvenance.SlsaBuilder} */ + public static final class SlsaBuilder extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.SlsaProvenance.SlsaBuilder) + SlsaBuilderOrBuilder { + private static final long serialVersionUID = 0L; + // Use SlsaBuilder.newBuilder() to construct. + private SlsaBuilder(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SlsaBuilder() { + id_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SlsaBuilder(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SlsaBuilder( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + id_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaBuilder_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaBuilder_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.SlsaProvenance.SlsaBuilder.class, + io.grafeas.v1.SlsaProvenance.SlsaBuilder.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = 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; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.SlsaProvenance.SlsaBuilder)) { + return super.equals(obj); + } + io.grafeas.v1.SlsaProvenance.SlsaBuilder other = + (io.grafeas.v1.SlsaProvenance.SlsaBuilder) obj; + + if (!getId().equals(other.getId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.SlsaProvenance.SlsaBuilder parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaBuilder parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaBuilder parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaBuilder parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaBuilder parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaBuilder parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaBuilder parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaBuilder parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaBuilder parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaBuilder parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaBuilder parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaBuilder parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.SlsaProvenance.SlsaBuilder 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code grafeas.v1.SlsaProvenance.SlsaBuilder} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.SlsaProvenance.SlsaBuilder) + io.grafeas.v1.SlsaProvenance.SlsaBuilderOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaBuilder_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaBuilder_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.SlsaProvenance.SlsaBuilder.class, + io.grafeas.v1.SlsaProvenance.SlsaBuilder.Builder.class); + } + + // Construct using io.grafeas.v1.SlsaProvenance.SlsaBuilder.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_SlsaBuilder_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaBuilder getDefaultInstanceForType() { + return io.grafeas.v1.SlsaProvenance.SlsaBuilder.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaBuilder build() { + io.grafeas.v1.SlsaProvenance.SlsaBuilder result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaBuilder buildPartial() { + io.grafeas.v1.SlsaProvenance.SlsaBuilder result = + new io.grafeas.v1.SlsaProvenance.SlsaBuilder(this); + result.id_ = id_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.SlsaProvenance.SlsaBuilder) { + return mergeFrom((io.grafeas.v1.SlsaProvenance.SlsaBuilder) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.SlsaProvenance.SlsaBuilder other) { + if (other == io.grafeas.v1.SlsaProvenance.SlsaBuilder.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.SlsaProvenance.SlsaBuilder parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.SlsaProvenance.SlsaBuilder) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object id_ = ""; + /** + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.SlsaProvenance.SlsaBuilder) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.SlsaProvenance.SlsaBuilder) + private static final io.grafeas.v1.SlsaProvenance.SlsaBuilder DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.SlsaProvenance.SlsaBuilder(); + } + + public static io.grafeas.v1.SlsaProvenance.SlsaBuilder getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SlsaBuilder parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SlsaBuilder(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaBuilder getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MaterialOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.SlsaProvenance.Material) + com.google.protobuf.MessageOrBuilder { + + /** + * string uri = 1; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * string uri = 1; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** map<string, string> digest = 2; */ + int getDigestCount(); + /** map<string, string> digest = 2; */ + boolean containsDigest(java.lang.String key); + /** Use {@link #getDigestMap()} instead. */ + @java.lang.Deprecated + java.util.Map getDigest(); + /** map<string, string> digest = 2; */ + java.util.Map getDigestMap(); + /** map<string, string> digest = 2; */ + java.lang.String getDigestOrDefault(java.lang.String key, java.lang.String defaultValue); + /** map<string, string> digest = 2; */ + java.lang.String getDigestOrThrow(java.lang.String key); + } + /** Protobuf type {@code grafeas.v1.SlsaProvenance.Material} */ + public static final class Material extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.SlsaProvenance.Material) + MaterialOrBuilder { + private static final long serialVersionUID = 0L; + // Use Material.newBuilder() to construct. + private Material(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Material() { + uri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Material(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Material( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + digest_ = + com.google.protobuf.MapField.newMapField( + DigestDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry digest__ = + input.readMessage( + DigestDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + digest_.getMutableMap().put(digest__.getKey(), digest__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_Material_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetDigest(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_Material_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.SlsaProvenance.Material.class, + io.grafeas.v1.SlsaProvenance.Material.Builder.class); + } + + public static final int URI_FIELD_NUMBER = 1; + private volatile java.lang.Object uri_; + /** + * string uri = 1; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + * string uri = 1; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DIGEST_FIELD_NUMBER = 2; + + private static final class DigestDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_Material_DigestEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField digest_; + + private com.google.protobuf.MapField internalGetDigest() { + if (digest_ == null) { + return com.google.protobuf.MapField.emptyMapField(DigestDefaultEntryHolder.defaultEntry); + } + return digest_; + } + + public int getDigestCount() { + return internalGetDigest().getMap().size(); + } + /** map<string, string> digest = 2; */ + @java.lang.Override + public boolean containsDigest(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetDigest().getMap().containsKey(key); + } + /** Use {@link #getDigestMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDigest() { + return getDigestMap(); + } + /** map<string, string> digest = 2; */ + @java.lang.Override + public java.util.Map getDigestMap() { + return internalGetDigest().getMap(); + } + /** map<string, string> digest = 2; */ + @java.lang.Override + public java.lang.String getDigestOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetDigest().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** map<string, string> digest = 2; */ + @java.lang.Override + public java.lang.String getDigestOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetDigest().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetDigest(), DigestDefaultEntryHolder.defaultEntry, 2); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); + } + for (java.util.Map.Entry entry : + internalGetDigest().getMap().entrySet()) { + com.google.protobuf.MapEntry digest__ = + DigestDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, digest__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.SlsaProvenance.Material)) { + return super.equals(obj); + } + io.grafeas.v1.SlsaProvenance.Material other = (io.grafeas.v1.SlsaProvenance.Material) obj; + + if (!getUri().equals(other.getUri())) return false; + if (!internalGetDigest().equals(other.internalGetDigest())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + if (!internalGetDigest().getMap().isEmpty()) { + hash = (37 * hash) + DIGEST_FIELD_NUMBER; + hash = (53 * hash) + internalGetDigest().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.SlsaProvenance.Material parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.SlsaProvenance.Material parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.Material parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.SlsaProvenance.Material parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.Material parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.SlsaProvenance.Material parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.Material parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.SlsaProvenance.Material parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.Material parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.SlsaProvenance.Material parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance.Material parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.SlsaProvenance.Material parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.SlsaProvenance.Material 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code grafeas.v1.SlsaProvenance.Material} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.SlsaProvenance.Material) + io.grafeas.v1.SlsaProvenance.MaterialOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_Material_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetDigest(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableDigest(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_Material_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.SlsaProvenance.Material.class, + io.grafeas.v1.SlsaProvenance.Material.Builder.class); + } + + // Construct using io.grafeas.v1.SlsaProvenance.Material.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + uri_ = ""; + + internalGetMutableDigest().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_Material_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.Material getDefaultInstanceForType() { + return io.grafeas.v1.SlsaProvenance.Material.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.Material build() { + io.grafeas.v1.SlsaProvenance.Material result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.Material buildPartial() { + io.grafeas.v1.SlsaProvenance.Material result = + new io.grafeas.v1.SlsaProvenance.Material(this); + int from_bitField0_ = bitField0_; + result.uri_ = uri_; + result.digest_ = internalGetDigest(); + result.digest_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.SlsaProvenance.Material) { + return mergeFrom((io.grafeas.v1.SlsaProvenance.Material) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.SlsaProvenance.Material other) { + if (other == io.grafeas.v1.SlsaProvenance.Material.getDefaultInstance()) return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + internalGetMutableDigest().mergeFrom(other.internalGetDigest()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.SlsaProvenance.Material parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.SlsaProvenance.Material) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object uri_ = ""; + /** + * string uri = 1; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string uri = 1; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string uri = 1; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + * string uri = 1; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * string uri = 1; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField digest_; + + private com.google.protobuf.MapField internalGetDigest() { + if (digest_ == null) { + return com.google.protobuf.MapField.emptyMapField(DigestDefaultEntryHolder.defaultEntry); + } + return digest_; + } + + private com.google.protobuf.MapField + internalGetMutableDigest() { + onChanged(); + ; + if (digest_ == null) { + digest_ = com.google.protobuf.MapField.newMapField(DigestDefaultEntryHolder.defaultEntry); + } + if (!digest_.isMutable()) { + digest_ = digest_.copy(); + } + return digest_; + } + + public int getDigestCount() { + return internalGetDigest().getMap().size(); + } + /** map<string, string> digest = 2; */ + @java.lang.Override + public boolean containsDigest(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetDigest().getMap().containsKey(key); + } + /** Use {@link #getDigestMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDigest() { + return getDigestMap(); + } + /** map<string, string> digest = 2; */ + @java.lang.Override + public java.util.Map getDigestMap() { + return internalGetDigest().getMap(); + } + /** map<string, string> digest = 2; */ + @java.lang.Override + public java.lang.String getDigestOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetDigest().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** map<string, string> digest = 2; */ + @java.lang.Override + public java.lang.String getDigestOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetDigest().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearDigest() { + internalGetMutableDigest().getMutableMap().clear(); + return this; + } + /** map<string, string> digest = 2; */ + public Builder removeDigest(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableDigest().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableDigest() { + return internalGetMutableDigest().getMutableMap(); + } + /** map<string, string> digest = 2; */ + public Builder putDigest(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableDigest().getMutableMap().put(key, value); + return this; + } + /** map<string, string> digest = 2; */ + public Builder putAllDigest(java.util.Map values) { + internalGetMutableDigest().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.SlsaProvenance.Material) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.SlsaProvenance.Material) + private static final io.grafeas.v1.SlsaProvenance.Material DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.SlsaProvenance.Material(); + } + + public static io.grafeas.v1.SlsaProvenance.Material getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Material parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Material(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.Material getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int BUILDER_FIELD_NUMBER = 1; + private io.grafeas.v1.SlsaProvenance.SlsaBuilder builder_; + /** + * + * + *
+   * required
+   * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaBuilder builder = 1; + * + * @return Whether the builder field is set. + */ + @java.lang.Override + public boolean hasBuilder() { + return builder_ != null; + } + /** + * + * + *
+   * required
+   * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaBuilder builder = 1; + * + * @return The builder. + */ + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaBuilder getBuilder() { + return builder_ == null + ? io.grafeas.v1.SlsaProvenance.SlsaBuilder.getDefaultInstance() + : builder_; + } + /** + * + * + *
+   * required
+   * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaBuilder builder = 1; + */ + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaBuilderOrBuilder getBuilderOrBuilder() { + return getBuilder(); + } + + public static final int RECIPE_FIELD_NUMBER = 2; + private io.grafeas.v1.SlsaProvenance.SlsaRecipe recipe_; + /** + * + * + *
+   * Identifies the configuration used for the build.
+   * When combined with materials, this SHOULD fully describe the build,
+   * such that re-running this recipe results in bit-for-bit identical output
+   * (if the build is reproducible).
+   * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaRecipe recipe = 2; + * + * @return Whether the recipe field is set. + */ + @java.lang.Override + public boolean hasRecipe() { + return recipe_ != null; + } + /** + * + * + *
+   * Identifies the configuration used for the build.
+   * When combined with materials, this SHOULD fully describe the build,
+   * such that re-running this recipe results in bit-for-bit identical output
+   * (if the build is reproducible).
+   * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaRecipe recipe = 2; + * + * @return The recipe. + */ + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaRecipe getRecipe() { + return recipe_ == null ? io.grafeas.v1.SlsaProvenance.SlsaRecipe.getDefaultInstance() : recipe_; + } + /** + * + * + *
+   * Identifies the configuration used for the build.
+   * When combined with materials, this SHOULD fully describe the build,
+   * such that re-running this recipe results in bit-for-bit identical output
+   * (if the build is reproducible).
+   * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaRecipe recipe = 2; + */ + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaRecipeOrBuilder getRecipeOrBuilder() { + return getRecipe(); + } + + public static final int METADATA_FIELD_NUMBER = 3; + private io.grafeas.v1.SlsaProvenance.SlsaMetadata metadata_; + /** + * .grafeas.v1.SlsaProvenance.SlsaMetadata metadata = 3; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + * .grafeas.v1.SlsaProvenance.SlsaMetadata metadata = 3; + * + * @return The metadata. + */ + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaMetadata getMetadata() { + return metadata_ == null + ? io.grafeas.v1.SlsaProvenance.SlsaMetadata.getDefaultInstance() + : metadata_; + } + /** .grafeas.v1.SlsaProvenance.SlsaMetadata metadata = 3; */ + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.SlsaMetadataOrBuilder getMetadataOrBuilder() { + return getMetadata(); + } + + public static final int MATERIALS_FIELD_NUMBER = 4; + private java.util.List materials_; + /** + * + * + *
+   * The collection of artifacts that influenced the build including sources,
+   * dependencies, build tools, base images, and so on. This is considered to be
+   * incomplete unless metadata.completeness.materials is true. Unset or null is
+   * equivalent to empty.
+   * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + @java.lang.Override + public java.util.List getMaterialsList() { + return materials_; + } + /** + * + * + *
+   * The collection of artifacts that influenced the build including sources,
+   * dependencies, build tools, base images, and so on. This is considered to be
+   * incomplete unless metadata.completeness.materials is true. Unset or null is
+   * equivalent to empty.
+   * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + @java.lang.Override + public java.util.List + getMaterialsOrBuilderList() { + return materials_; + } + /** + * + * + *
+   * The collection of artifacts that influenced the build including sources,
+   * dependencies, build tools, base images, and so on. This is considered to be
+   * incomplete unless metadata.completeness.materials is true. Unset or null is
+   * equivalent to empty.
+   * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + @java.lang.Override + public int getMaterialsCount() { + return materials_.size(); + } + /** + * + * + *
+   * The collection of artifacts that influenced the build including sources,
+   * dependencies, build tools, base images, and so on. This is considered to be
+   * incomplete unless metadata.completeness.materials is true. Unset or null is
+   * equivalent to empty.
+   * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.Material getMaterials(int index) { + return materials_.get(index); + } + /** + * + * + *
+   * The collection of artifacts that influenced the build including sources,
+   * dependencies, build tools, base images, and so on. This is considered to be
+   * incomplete unless metadata.completeness.materials is true. Unset or null is
+   * equivalent to empty.
+   * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + @java.lang.Override + public io.grafeas.v1.SlsaProvenance.MaterialOrBuilder getMaterialsOrBuilder(int index) { + return materials_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (builder_ != null) { + output.writeMessage(1, getBuilder()); + } + if (recipe_ != null) { + output.writeMessage(2, getRecipe()); + } + if (metadata_ != null) { + output.writeMessage(3, getMetadata()); + } + for (int i = 0; i < materials_.size(); i++) { + output.writeMessage(4, materials_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (builder_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBuilder()); + } + if (recipe_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRecipe()); + } + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMetadata()); + } + for (int i = 0; i < materials_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, materials_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.SlsaProvenance)) { + return super.equals(obj); + } + io.grafeas.v1.SlsaProvenance other = (io.grafeas.v1.SlsaProvenance) obj; + + if (hasBuilder() != other.hasBuilder()) return false; + if (hasBuilder()) { + if (!getBuilder().equals(other.getBuilder())) return false; + } + if (hasRecipe() != other.hasRecipe()) return false; + if (hasRecipe()) { + if (!getRecipe().equals(other.getRecipe())) return false; + } + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!getMaterialsList().equals(other.getMaterialsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBuilder()) { + hash = (37 * hash) + BUILDER_FIELD_NUMBER; + hash = (53 * hash) + getBuilder().hashCode(); + } + if (hasRecipe()) { + hash = (37 * hash) + RECIPE_FIELD_NUMBER; + hash = (53 * hash) + getRecipe().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (getMaterialsCount() > 0) { + hash = (37 * hash) + MATERIALS_FIELD_NUMBER; + hash = (53 * hash) + getMaterialsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.SlsaProvenance parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.SlsaProvenance parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.SlsaProvenance parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.SlsaProvenance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.SlsaProvenance parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.SlsaProvenance parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.SlsaProvenance parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.SlsaProvenance parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.SlsaProvenance 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code grafeas.v1.SlsaProvenance} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.SlsaProvenance) + io.grafeas.v1.SlsaProvenanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.SlsaProvenance.class, io.grafeas.v1.SlsaProvenance.Builder.class); + } + + // Construct using io.grafeas.v1.SlsaProvenance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMaterialsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (builderBuilder_ == null) { + builder_ = null; + } else { + builder_ = null; + builderBuilder_ = null; + } + if (recipeBuilder_ == null) { + recipe_ = null; + } else { + recipe_ = null; + recipeBuilder_ = null; + } + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadata_ = null; + metadataBuilder_ = null; + } + if (materialsBuilder_ == null) { + materials_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + materialsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.SlsaProvenanceOuterClass + .internal_static_grafeas_v1_SlsaProvenance_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance getDefaultInstanceForType() { + return io.grafeas.v1.SlsaProvenance.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance build() { + io.grafeas.v1.SlsaProvenance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance buildPartial() { + io.grafeas.v1.SlsaProvenance result = new io.grafeas.v1.SlsaProvenance(this); + int from_bitField0_ = bitField0_; + if (builderBuilder_ == null) { + result.builder_ = builder_; + } else { + result.builder_ = builderBuilder_.build(); + } + if (recipeBuilder_ == null) { + result.recipe_ = recipe_; + } else { + result.recipe_ = recipeBuilder_.build(); + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + if (materialsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + materials_ = java.util.Collections.unmodifiableList(materials_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.materials_ = materials_; + } else { + result.materials_ = materialsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.SlsaProvenance) { + return mergeFrom((io.grafeas.v1.SlsaProvenance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.SlsaProvenance other) { + if (other == io.grafeas.v1.SlsaProvenance.getDefaultInstance()) return this; + if (other.hasBuilder()) { + mergeBuilder(other.getBuilder()); + } + if (other.hasRecipe()) { + mergeRecipe(other.getRecipe()); + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (materialsBuilder_ == null) { + if (!other.materials_.isEmpty()) { + if (materials_.isEmpty()) { + materials_ = other.materials_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMaterialsIsMutable(); + materials_.addAll(other.materials_); + } + onChanged(); + } + } else { + if (!other.materials_.isEmpty()) { + if (materialsBuilder_.isEmpty()) { + materialsBuilder_.dispose(); + materialsBuilder_ = null; + materials_ = other.materials_; + bitField0_ = (bitField0_ & ~0x00000001); + materialsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMaterialsFieldBuilder() + : null; + } else { + materialsBuilder_.addAllMessages(other.materials_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.SlsaProvenance parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.SlsaProvenance) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private io.grafeas.v1.SlsaProvenance.SlsaBuilder builder_; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.SlsaProvenance.SlsaBuilder, + io.grafeas.v1.SlsaProvenance.SlsaBuilder.Builder, + io.grafeas.v1.SlsaProvenance.SlsaBuilderOrBuilder> + builderBuilder_; + /** + * + * + *
+     * required
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaBuilder builder = 1; + * + * @return Whether the builder field is set. + */ + public boolean hasBuilder() { + return builderBuilder_ != null || builder_ != null; + } + /** + * + * + *
+     * required
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaBuilder builder = 1; + * + * @return The builder. + */ + public io.grafeas.v1.SlsaProvenance.SlsaBuilder getBuilder() { + if (builderBuilder_ == null) { + return builder_ == null + ? io.grafeas.v1.SlsaProvenance.SlsaBuilder.getDefaultInstance() + : builder_; + } else { + return builderBuilder_.getMessage(); + } + } + /** + * + * + *
+     * required
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaBuilder builder = 1; + */ + public Builder setBuilder(io.grafeas.v1.SlsaProvenance.SlsaBuilder value) { + if (builderBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + builder_ = value; + onChanged(); + } else { + builderBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * required
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaBuilder builder = 1; + */ + public Builder setBuilder(io.grafeas.v1.SlsaProvenance.SlsaBuilder.Builder builderForValue) { + if (builderBuilder_ == null) { + builder_ = builderForValue.build(); + onChanged(); + } else { + builderBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * required
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaBuilder builder = 1; + */ + public Builder mergeBuilder(io.grafeas.v1.SlsaProvenance.SlsaBuilder value) { + if (builderBuilder_ == null) { + if (builder_ != null) { + builder_ = + io.grafeas.v1.SlsaProvenance.SlsaBuilder.newBuilder(builder_) + .mergeFrom(value) + .buildPartial(); + } else { + builder_ = value; + } + onChanged(); + } else { + builderBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * required
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaBuilder builder = 1; + */ + public Builder clearBuilder() { + if (builderBuilder_ == null) { + builder_ = null; + onChanged(); + } else { + builder_ = null; + builderBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * required
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaBuilder builder = 1; + */ + public io.grafeas.v1.SlsaProvenance.SlsaBuilder.Builder getBuilderBuilder() { + + onChanged(); + return getBuilderFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * required
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaBuilder builder = 1; + */ + public io.grafeas.v1.SlsaProvenance.SlsaBuilderOrBuilder getBuilderOrBuilder() { + if (builderBuilder_ != null) { + return builderBuilder_.getMessageOrBuilder(); + } else { + return builder_ == null + ? io.grafeas.v1.SlsaProvenance.SlsaBuilder.getDefaultInstance() + : builder_; + } + } + /** + * + * + *
+     * required
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaBuilder builder = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.SlsaProvenance.SlsaBuilder, + io.grafeas.v1.SlsaProvenance.SlsaBuilder.Builder, + io.grafeas.v1.SlsaProvenance.SlsaBuilderOrBuilder> + getBuilderFieldBuilder() { + if (builderBuilder_ == null) { + builderBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.SlsaProvenance.SlsaBuilder, + io.grafeas.v1.SlsaProvenance.SlsaBuilder.Builder, + io.grafeas.v1.SlsaProvenance.SlsaBuilderOrBuilder>( + getBuilder(), getParentForChildren(), isClean()); + builder_ = null; + } + return builderBuilder_; + } + + private io.grafeas.v1.SlsaProvenance.SlsaRecipe recipe_; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.SlsaProvenance.SlsaRecipe, + io.grafeas.v1.SlsaProvenance.SlsaRecipe.Builder, + io.grafeas.v1.SlsaProvenance.SlsaRecipeOrBuilder> + recipeBuilder_; + /** + * + * + *
+     * Identifies the configuration used for the build.
+     * When combined with materials, this SHOULD fully describe the build,
+     * such that re-running this recipe results in bit-for-bit identical output
+     * (if the build is reproducible).
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaRecipe recipe = 2; + * + * @return Whether the recipe field is set. + */ + public boolean hasRecipe() { + return recipeBuilder_ != null || recipe_ != null; + } + /** + * + * + *
+     * Identifies the configuration used for the build.
+     * When combined with materials, this SHOULD fully describe the build,
+     * such that re-running this recipe results in bit-for-bit identical output
+     * (if the build is reproducible).
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaRecipe recipe = 2; + * + * @return The recipe. + */ + public io.grafeas.v1.SlsaProvenance.SlsaRecipe getRecipe() { + if (recipeBuilder_ == null) { + return recipe_ == null + ? io.grafeas.v1.SlsaProvenance.SlsaRecipe.getDefaultInstance() + : recipe_; + } else { + return recipeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Identifies the configuration used for the build.
+     * When combined with materials, this SHOULD fully describe the build,
+     * such that re-running this recipe results in bit-for-bit identical output
+     * (if the build is reproducible).
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaRecipe recipe = 2; + */ + public Builder setRecipe(io.grafeas.v1.SlsaProvenance.SlsaRecipe value) { + if (recipeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + recipe_ = value; + onChanged(); + } else { + recipeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Identifies the configuration used for the build.
+     * When combined with materials, this SHOULD fully describe the build,
+     * such that re-running this recipe results in bit-for-bit identical output
+     * (if the build is reproducible).
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaRecipe recipe = 2; + */ + public Builder setRecipe(io.grafeas.v1.SlsaProvenance.SlsaRecipe.Builder builderForValue) { + if (recipeBuilder_ == null) { + recipe_ = builderForValue.build(); + onChanged(); + } else { + recipeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Identifies the configuration used for the build.
+     * When combined with materials, this SHOULD fully describe the build,
+     * such that re-running this recipe results in bit-for-bit identical output
+     * (if the build is reproducible).
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaRecipe recipe = 2; + */ + public Builder mergeRecipe(io.grafeas.v1.SlsaProvenance.SlsaRecipe value) { + if (recipeBuilder_ == null) { + if (recipe_ != null) { + recipe_ = + io.grafeas.v1.SlsaProvenance.SlsaRecipe.newBuilder(recipe_) + .mergeFrom(value) + .buildPartial(); + } else { + recipe_ = value; + } + onChanged(); + } else { + recipeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Identifies the configuration used for the build.
+     * When combined with materials, this SHOULD fully describe the build,
+     * such that re-running this recipe results in bit-for-bit identical output
+     * (if the build is reproducible).
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaRecipe recipe = 2; + */ + public Builder clearRecipe() { + if (recipeBuilder_ == null) { + recipe_ = null; + onChanged(); + } else { + recipe_ = null; + recipeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Identifies the configuration used for the build.
+     * When combined with materials, this SHOULD fully describe the build,
+     * such that re-running this recipe results in bit-for-bit identical output
+     * (if the build is reproducible).
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaRecipe recipe = 2; + */ + public io.grafeas.v1.SlsaProvenance.SlsaRecipe.Builder getRecipeBuilder() { + + onChanged(); + return getRecipeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Identifies the configuration used for the build.
+     * When combined with materials, this SHOULD fully describe the build,
+     * such that re-running this recipe results in bit-for-bit identical output
+     * (if the build is reproducible).
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaRecipe recipe = 2; + */ + public io.grafeas.v1.SlsaProvenance.SlsaRecipeOrBuilder getRecipeOrBuilder() { + if (recipeBuilder_ != null) { + return recipeBuilder_.getMessageOrBuilder(); + } else { + return recipe_ == null + ? io.grafeas.v1.SlsaProvenance.SlsaRecipe.getDefaultInstance() + : recipe_; + } + } + /** + * + * + *
+     * Identifies the configuration used for the build.
+     * When combined with materials, this SHOULD fully describe the build,
+     * such that re-running this recipe results in bit-for-bit identical output
+     * (if the build is reproducible).
+     * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaRecipe recipe = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.SlsaProvenance.SlsaRecipe, + io.grafeas.v1.SlsaProvenance.SlsaRecipe.Builder, + io.grafeas.v1.SlsaProvenance.SlsaRecipeOrBuilder> + getRecipeFieldBuilder() { + if (recipeBuilder_ == null) { + recipeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.SlsaProvenance.SlsaRecipe, + io.grafeas.v1.SlsaProvenance.SlsaRecipe.Builder, + io.grafeas.v1.SlsaProvenance.SlsaRecipeOrBuilder>( + getRecipe(), getParentForChildren(), isClean()); + recipe_ = null; + } + return recipeBuilder_; + } + + private io.grafeas.v1.SlsaProvenance.SlsaMetadata metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.SlsaProvenance.SlsaMetadata, + io.grafeas.v1.SlsaProvenance.SlsaMetadata.Builder, + io.grafeas.v1.SlsaProvenance.SlsaMetadataOrBuilder> + metadataBuilder_; + /** + * .grafeas.v1.SlsaProvenance.SlsaMetadata metadata = 3; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return metadataBuilder_ != null || metadata_ != null; + } + /** + * .grafeas.v1.SlsaProvenance.SlsaMetadata metadata = 3; + * + * @return The metadata. + */ + public io.grafeas.v1.SlsaProvenance.SlsaMetadata getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? io.grafeas.v1.SlsaProvenance.SlsaMetadata.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** .grafeas.v1.SlsaProvenance.SlsaMetadata metadata = 3; */ + public Builder setMetadata(io.grafeas.v1.SlsaProvenance.SlsaMetadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + + return this; + } + /** .grafeas.v1.SlsaProvenance.SlsaMetadata metadata = 3; */ + public Builder setMetadata(io.grafeas.v1.SlsaProvenance.SlsaMetadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** .grafeas.v1.SlsaProvenance.SlsaMetadata metadata = 3; */ + public Builder mergeMetadata(io.grafeas.v1.SlsaProvenance.SlsaMetadata value) { + if (metadataBuilder_ == null) { + if (metadata_ != null) { + metadata_ = + io.grafeas.v1.SlsaProvenance.SlsaMetadata.newBuilder(metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + + return this; + } + /** .grafeas.v1.SlsaProvenance.SlsaMetadata metadata = 3; */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadata_ = null; + metadataBuilder_ = null; + } + + return this; + } + /** .grafeas.v1.SlsaProvenance.SlsaMetadata metadata = 3; */ + public io.grafeas.v1.SlsaProvenance.SlsaMetadata.Builder getMetadataBuilder() { + + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** .grafeas.v1.SlsaProvenance.SlsaMetadata metadata = 3; */ + public io.grafeas.v1.SlsaProvenance.SlsaMetadataOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? io.grafeas.v1.SlsaProvenance.SlsaMetadata.getDefaultInstance() + : metadata_; + } + } + /** .grafeas.v1.SlsaProvenance.SlsaMetadata metadata = 3; */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.SlsaProvenance.SlsaMetadata, + io.grafeas.v1.SlsaProvenance.SlsaMetadata.Builder, + io.grafeas.v1.SlsaProvenance.SlsaMetadataOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.SlsaProvenance.SlsaMetadata, + io.grafeas.v1.SlsaProvenance.SlsaMetadata.Builder, + io.grafeas.v1.SlsaProvenance.SlsaMetadataOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private java.util.List materials_ = + java.util.Collections.emptyList(); + + private void ensureMaterialsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + materials_ = new java.util.ArrayList(materials_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1.SlsaProvenance.Material, + io.grafeas.v1.SlsaProvenance.Material.Builder, + io.grafeas.v1.SlsaProvenance.MaterialOrBuilder> + materialsBuilder_; + + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + public java.util.List getMaterialsList() { + if (materialsBuilder_ == null) { + return java.util.Collections.unmodifiableList(materials_); + } else { + return materialsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + public int getMaterialsCount() { + if (materialsBuilder_ == null) { + return materials_.size(); + } else { + return materialsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + public io.grafeas.v1.SlsaProvenance.Material getMaterials(int index) { + if (materialsBuilder_ == null) { + return materials_.get(index); + } else { + return materialsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + public Builder setMaterials(int index, io.grafeas.v1.SlsaProvenance.Material value) { + if (materialsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMaterialsIsMutable(); + materials_.set(index, value); + onChanged(); + } else { + materialsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + public Builder setMaterials( + int index, io.grafeas.v1.SlsaProvenance.Material.Builder builderForValue) { + if (materialsBuilder_ == null) { + ensureMaterialsIsMutable(); + materials_.set(index, builderForValue.build()); + onChanged(); + } else { + materialsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + public Builder addMaterials(io.grafeas.v1.SlsaProvenance.Material value) { + if (materialsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMaterialsIsMutable(); + materials_.add(value); + onChanged(); + } else { + materialsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + public Builder addMaterials(int index, io.grafeas.v1.SlsaProvenance.Material value) { + if (materialsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMaterialsIsMutable(); + materials_.add(index, value); + onChanged(); + } else { + materialsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + public Builder addMaterials(io.grafeas.v1.SlsaProvenance.Material.Builder builderForValue) { + if (materialsBuilder_ == null) { + ensureMaterialsIsMutable(); + materials_.add(builderForValue.build()); + onChanged(); + } else { + materialsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + public Builder addMaterials( + int index, io.grafeas.v1.SlsaProvenance.Material.Builder builderForValue) { + if (materialsBuilder_ == null) { + ensureMaterialsIsMutable(); + materials_.add(index, builderForValue.build()); + onChanged(); + } else { + materialsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + public Builder addAllMaterials( + java.lang.Iterable values) { + if (materialsBuilder_ == null) { + ensureMaterialsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, materials_); + onChanged(); + } else { + materialsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + public Builder clearMaterials() { + if (materialsBuilder_ == null) { + materials_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + materialsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + public Builder removeMaterials(int index) { + if (materialsBuilder_ == null) { + ensureMaterialsIsMutable(); + materials_.remove(index); + onChanged(); + } else { + materialsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + public io.grafeas.v1.SlsaProvenance.Material.Builder getMaterialsBuilder(int index) { + return getMaterialsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + public io.grafeas.v1.SlsaProvenance.MaterialOrBuilder getMaterialsOrBuilder(int index) { + if (materialsBuilder_ == null) { + return materials_.get(index); + } else { + return materialsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + public java.util.List + getMaterialsOrBuilderList() { + if (materialsBuilder_ != null) { + return materialsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(materials_); + } + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + public io.grafeas.v1.SlsaProvenance.Material.Builder addMaterialsBuilder() { + return getMaterialsFieldBuilder() + .addBuilder(io.grafeas.v1.SlsaProvenance.Material.getDefaultInstance()); + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + public io.grafeas.v1.SlsaProvenance.Material.Builder addMaterialsBuilder(int index) { + return getMaterialsFieldBuilder() + .addBuilder(index, io.grafeas.v1.SlsaProvenance.Material.getDefaultInstance()); + } + /** + * + * + *
+     * The collection of artifacts that influenced the build including sources,
+     * dependencies, build tools, base images, and so on. This is considered to be
+     * incomplete unless metadata.completeness.materials is true. Unset or null is
+     * equivalent to empty.
+     * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + public java.util.List getMaterialsBuilderList() { + return getMaterialsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1.SlsaProvenance.Material, + io.grafeas.v1.SlsaProvenance.Material.Builder, + io.grafeas.v1.SlsaProvenance.MaterialOrBuilder> + getMaterialsFieldBuilder() { + if (materialsBuilder_ == null) { + materialsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1.SlsaProvenance.Material, + io.grafeas.v1.SlsaProvenance.Material.Builder, + io.grafeas.v1.SlsaProvenance.MaterialOrBuilder>( + materials_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + materials_ = null; + } + return materialsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.SlsaProvenance) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.SlsaProvenance) + private static final io.grafeas.v1.SlsaProvenance DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.SlsaProvenance(); + } + + public static io.grafeas.v1.SlsaProvenance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SlsaProvenance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SlsaProvenance(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.SlsaProvenance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/src/main/java/io/grafeas/v1/SlsaProvenanceOrBuilder.java b/src/main/java/io/grafeas/v1/SlsaProvenanceOrBuilder.java new file mode 100644 index 00000000..d811bec5 --- /dev/null +++ b/src/main/java/io/grafeas/v1/SlsaProvenanceOrBuilder.java @@ -0,0 +1,187 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/slsa_provenance.proto + +package io.grafeas.v1; + +public interface SlsaProvenanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.SlsaProvenance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * required
+   * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaBuilder builder = 1; + * + * @return Whether the builder field is set. + */ + boolean hasBuilder(); + /** + * + * + *
+   * required
+   * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaBuilder builder = 1; + * + * @return The builder. + */ + io.grafeas.v1.SlsaProvenance.SlsaBuilder getBuilder(); + /** + * + * + *
+   * required
+   * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaBuilder builder = 1; + */ + io.grafeas.v1.SlsaProvenance.SlsaBuilderOrBuilder getBuilderOrBuilder(); + + /** + * + * + *
+   * Identifies the configuration used for the build.
+   * When combined with materials, this SHOULD fully describe the build,
+   * such that re-running this recipe results in bit-for-bit identical output
+   * (if the build is reproducible).
+   * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaRecipe recipe = 2; + * + * @return Whether the recipe field is set. + */ + boolean hasRecipe(); + /** + * + * + *
+   * Identifies the configuration used for the build.
+   * When combined with materials, this SHOULD fully describe the build,
+   * such that re-running this recipe results in bit-for-bit identical output
+   * (if the build is reproducible).
+   * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaRecipe recipe = 2; + * + * @return The recipe. + */ + io.grafeas.v1.SlsaProvenance.SlsaRecipe getRecipe(); + /** + * + * + *
+   * Identifies the configuration used for the build.
+   * When combined with materials, this SHOULD fully describe the build,
+   * such that re-running this recipe results in bit-for-bit identical output
+   * (if the build is reproducible).
+   * 
+ * + * .grafeas.v1.SlsaProvenance.SlsaRecipe recipe = 2; + */ + io.grafeas.v1.SlsaProvenance.SlsaRecipeOrBuilder getRecipeOrBuilder(); + + /** + * .grafeas.v1.SlsaProvenance.SlsaMetadata metadata = 3; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * .grafeas.v1.SlsaProvenance.SlsaMetadata metadata = 3; + * + * @return The metadata. + */ + io.grafeas.v1.SlsaProvenance.SlsaMetadata getMetadata(); + /** .grafeas.v1.SlsaProvenance.SlsaMetadata metadata = 3; */ + io.grafeas.v1.SlsaProvenance.SlsaMetadataOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+   * The collection of artifacts that influenced the build including sources,
+   * dependencies, build tools, base images, and so on. This is considered to be
+   * incomplete unless metadata.completeness.materials is true. Unset or null is
+   * equivalent to empty.
+   * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + java.util.List getMaterialsList(); + /** + * + * + *
+   * The collection of artifacts that influenced the build including sources,
+   * dependencies, build tools, base images, and so on. This is considered to be
+   * incomplete unless metadata.completeness.materials is true. Unset or null is
+   * equivalent to empty.
+   * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + io.grafeas.v1.SlsaProvenance.Material getMaterials(int index); + /** + * + * + *
+   * The collection of artifacts that influenced the build including sources,
+   * dependencies, build tools, base images, and so on. This is considered to be
+   * incomplete unless metadata.completeness.materials is true. Unset or null is
+   * equivalent to empty.
+   * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + int getMaterialsCount(); + /** + * + * + *
+   * The collection of artifacts that influenced the build including sources,
+   * dependencies, build tools, base images, and so on. This is considered to be
+   * incomplete unless metadata.completeness.materials is true. Unset or null is
+   * equivalent to empty.
+   * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + java.util.List + getMaterialsOrBuilderList(); + /** + * + * + *
+   * The collection of artifacts that influenced the build including sources,
+   * dependencies, build tools, base images, and so on. This is considered to be
+   * incomplete unless metadata.completeness.materials is true. Unset or null is
+   * equivalent to empty.
+   * 
+ * + * repeated .grafeas.v1.SlsaProvenance.Material materials = 4; + */ + io.grafeas.v1.SlsaProvenance.MaterialOrBuilder getMaterialsOrBuilder(int index); +} diff --git a/src/main/java/io/grafeas/v1/SlsaProvenanceOuterClass.java b/src/main/java/io/grafeas/v1/SlsaProvenanceOuterClass.java new file mode 100644 index 00000000..a662d6d3 --- /dev/null +++ b/src/main/java/io/grafeas/v1/SlsaProvenanceOuterClass.java @@ -0,0 +1,168 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/slsa_provenance.proto + +package io.grafeas.v1; + +public final class SlsaProvenanceOuterClass { + private SlsaProvenanceOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_SlsaProvenance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_SlsaProvenance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_SlsaProvenance_SlsaRecipe_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_SlsaProvenance_SlsaRecipe_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_SlsaProvenance_SlsaCompleteness_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_SlsaProvenance_SlsaCompleteness_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_SlsaProvenance_SlsaMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_SlsaProvenance_SlsaMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_SlsaProvenance_SlsaBuilder_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_SlsaProvenance_SlsaBuilder_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_SlsaProvenance_Material_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_SlsaProvenance_Material_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_SlsaProvenance_Material_DigestEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_SlsaProvenance_Material_DigestEntry_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 grafeas/v1/slsa_provenance.proto\022\ngraf" + + "eas.v1\032\031google/protobuf/any.proto\032\037googl" + + "e/protobuf/timestamp.proto\"\376\006\n\016SlsaProve" + + "nance\0227\n\007builder\030\001 \001(\0132&.grafeas.v1.Slsa" + + "Provenance.SlsaBuilder\0225\n\006recipe\030\002 \001(\0132%" + + ".grafeas.v1.SlsaProvenance.SlsaRecipe\0229\n" + + "\010metadata\030\003 \001(\0132\'.grafeas.v1.SlsaProvena" + + "nce.SlsaMetadata\0226\n\tmaterials\030\004 \003(\0132#.gr" + + "afeas.v1.SlsaProvenance.Material\032\240\001\n\nSls" + + "aRecipe\022\014\n\004type\030\001 \001(\t\022\033\n\023defined_in_mate" + + "rial\030\002 \001(\003\022\023\n\013entry_point\030\003 \001(\t\022\'\n\targum" + + "ents\030\004 \001(\0132\024.google.protobuf.Any\022)\n\013envi" + + "ronment\030\005 \001(\0132\024.google.protobuf.Any\032M\n\020S" + + "lsaCompleteness\022\021\n\targuments\030\001 \001(\010\022\023\n\013en" + + "vironment\030\002 \001(\010\022\021\n\tmaterials\030\003 \001(\010\032\361\001\n\014S" + + "lsaMetadata\022\033\n\023build_invocation_id\030\001 \001(\t" + + "\0224\n\020build_started_on\030\002 \001(\0132\032.google.prot" + + "obuf.Timestamp\0225\n\021build_finished_on\030\003 \001(" + + "\0132\032.google.protobuf.Timestamp\022A\n\014complet" + + "eness\030\004 \001(\0132+.grafeas.v1.SlsaProvenance." + + "SlsaCompleteness\022\024\n\014reproducible\030\005 \001(\010\032\031" + + "\n\013SlsaBuilder\022\n\n\002id\030\001 \001(\t\032\207\001\n\010Material\022\013" + + "\n\003uri\030\001 \001(\t\022?\n\006digest\030\002 \003(\0132/.grafeas.v1" + + ".SlsaProvenance.Material.DigestEntry\032-\n\013" + + "DigestEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:" + + "\0028\001BQ\n\rio.grafeas.v1P\001Z8google.golang.or" + + "g/genproto/googleapis/grafeas/v1;grafeas" + + "\242\002\003GRAb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.AnyProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_grafeas_v1_SlsaProvenance_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_grafeas_v1_SlsaProvenance_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_SlsaProvenance_descriptor, + new java.lang.String[] { + "Builder", "Recipe", "Metadata", "Materials", + }); + internal_static_grafeas_v1_SlsaProvenance_SlsaRecipe_descriptor = + internal_static_grafeas_v1_SlsaProvenance_descriptor.getNestedTypes().get(0); + internal_static_grafeas_v1_SlsaProvenance_SlsaRecipe_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_SlsaProvenance_SlsaRecipe_descriptor, + new java.lang.String[] { + "Type", "DefinedInMaterial", "EntryPoint", "Arguments", "Environment", + }); + internal_static_grafeas_v1_SlsaProvenance_SlsaCompleteness_descriptor = + internal_static_grafeas_v1_SlsaProvenance_descriptor.getNestedTypes().get(1); + internal_static_grafeas_v1_SlsaProvenance_SlsaCompleteness_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_SlsaProvenance_SlsaCompleteness_descriptor, + new java.lang.String[] { + "Arguments", "Environment", "Materials", + }); + internal_static_grafeas_v1_SlsaProvenance_SlsaMetadata_descriptor = + internal_static_grafeas_v1_SlsaProvenance_descriptor.getNestedTypes().get(2); + internal_static_grafeas_v1_SlsaProvenance_SlsaMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_SlsaProvenance_SlsaMetadata_descriptor, + new java.lang.String[] { + "BuildInvocationId", + "BuildStartedOn", + "BuildFinishedOn", + "Completeness", + "Reproducible", + }); + internal_static_grafeas_v1_SlsaProvenance_SlsaBuilder_descriptor = + internal_static_grafeas_v1_SlsaProvenance_descriptor.getNestedTypes().get(3); + internal_static_grafeas_v1_SlsaProvenance_SlsaBuilder_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_SlsaProvenance_SlsaBuilder_descriptor, + new java.lang.String[] { + "Id", + }); + internal_static_grafeas_v1_SlsaProvenance_Material_descriptor = + internal_static_grafeas_v1_SlsaProvenance_descriptor.getNestedTypes().get(4); + internal_static_grafeas_v1_SlsaProvenance_Material_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_SlsaProvenance_Material_descriptor, + new java.lang.String[] { + "Uri", "Digest", + }); + internal_static_grafeas_v1_SlsaProvenance_Material_DigestEntry_descriptor = + internal_static_grafeas_v1_SlsaProvenance_Material_descriptor.getNestedTypes().get(0); + internal_static_grafeas_v1_SlsaProvenance_Material_DigestEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_SlsaProvenance_Material_DigestEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/io/grafeas/v1/Subject.java b/src/main/java/io/grafeas/v1/Subject.java new file mode 100644 index 00000000..a87f7ee1 --- /dev/null +++ b/src/main/java/io/grafeas/v1/Subject.java @@ -0,0 +1,925 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/intoto_statement.proto + +package io.grafeas.v1; + +/** Protobuf type {@code grafeas.v1.Subject} */ +public final class Subject extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.Subject) + SubjectOrBuilder { + private static final long serialVersionUID = 0L; + // Use Subject.newBuilder() to construct. + private Subject(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Subject() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Subject(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Subject( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + digest_ = + com.google.protobuf.MapField.newMapField(DigestDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry digest__ = + input.readMessage( + DigestDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + digest_.getMutableMap().put(digest__.getKey(), digest__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.InTotoStatementProto.internal_static_grafeas_v1_Subject_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetDigest(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.InTotoStatementProto.internal_static_grafeas_v1_Subject_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.Subject.class, io.grafeas.v1.Subject.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DIGEST_FIELD_NUMBER = 2; + + private static final class DigestDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + io.grafeas.v1.InTotoStatementProto + .internal_static_grafeas_v1_Subject_DigestEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField digest_; + + private com.google.protobuf.MapField internalGetDigest() { + if (digest_ == null) { + return com.google.protobuf.MapField.emptyMapField(DigestDefaultEntryHolder.defaultEntry); + } + return digest_; + } + + public int getDigestCount() { + return internalGetDigest().getMap().size(); + } + /** + * + * + *
+   * `"<ALGORITHM>": "<HEX_VALUE>"`
+   * Algorithms can be e.g. sha256, sha512
+   * See
+   * https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet
+   * 
+ * + * map<string, string> digest = 2; + */ + @java.lang.Override + public boolean containsDigest(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetDigest().getMap().containsKey(key); + } + /** Use {@link #getDigestMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDigest() { + return getDigestMap(); + } + /** + * + * + *
+   * `"<ALGORITHM>": "<HEX_VALUE>"`
+   * Algorithms can be e.g. sha256, sha512
+   * See
+   * https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet
+   * 
+ * + * map<string, string> digest = 2; + */ + @java.lang.Override + public java.util.Map getDigestMap() { + return internalGetDigest().getMap(); + } + /** + * + * + *
+   * `"<ALGORITHM>": "<HEX_VALUE>"`
+   * Algorithms can be e.g. sha256, sha512
+   * See
+   * https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet
+   * 
+ * + * map<string, string> digest = 2; + */ + @java.lang.Override + public java.lang.String getDigestOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetDigest().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * `"<ALGORITHM>": "<HEX_VALUE>"`
+   * Algorithms can be e.g. sha256, sha512
+   * See
+   * https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet
+   * 
+ * + * map<string, string> digest = 2; + */ + @java.lang.Override + public java.lang.String getDigestOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetDigest().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetDigest(), DigestDefaultEntryHolder.defaultEntry, 2); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (java.util.Map.Entry entry : + internalGetDigest().getMap().entrySet()) { + com.google.protobuf.MapEntry digest__ = + DigestDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, digest__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.Subject)) { + return super.equals(obj); + } + io.grafeas.v1.Subject other = (io.grafeas.v1.Subject) obj; + + if (!getName().equals(other.getName())) return false; + if (!internalGetDigest().equals(other.internalGetDigest())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (!internalGetDigest().getMap().isEmpty()) { + hash = (37 * hash) + DIGEST_FIELD_NUMBER; + hash = (53 * hash) + internalGetDigest().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.Subject parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.Subject parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.Subject parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.Subject parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.Subject parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.Subject parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.Subject parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.Subject parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.Subject parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.Subject parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.Subject parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.Subject parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.Subject 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code grafeas.v1.Subject} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.Subject) + io.grafeas.v1.SubjectOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.InTotoStatementProto.internal_static_grafeas_v1_Subject_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetDigest(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableDigest(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.InTotoStatementProto + .internal_static_grafeas_v1_Subject_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.Subject.class, io.grafeas.v1.Subject.Builder.class); + } + + // Construct using io.grafeas.v1.Subject.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + internalGetMutableDigest().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.InTotoStatementProto.internal_static_grafeas_v1_Subject_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.Subject getDefaultInstanceForType() { + return io.grafeas.v1.Subject.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.Subject build() { + io.grafeas.v1.Subject result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.Subject buildPartial() { + io.grafeas.v1.Subject result = new io.grafeas.v1.Subject(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.digest_ = internalGetDigest(); + result.digest_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.Subject) { + return mergeFrom((io.grafeas.v1.Subject) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.Subject other) { + if (other == io.grafeas.v1.Subject.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + internalGetMutableDigest().mergeFrom(other.internalGetDigest()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.Subject parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.Subject) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField digest_; + + private com.google.protobuf.MapField internalGetDigest() { + if (digest_ == null) { + return com.google.protobuf.MapField.emptyMapField(DigestDefaultEntryHolder.defaultEntry); + } + return digest_; + } + + private com.google.protobuf.MapField + internalGetMutableDigest() { + onChanged(); + ; + if (digest_ == null) { + digest_ = com.google.protobuf.MapField.newMapField(DigestDefaultEntryHolder.defaultEntry); + } + if (!digest_.isMutable()) { + digest_ = digest_.copy(); + } + return digest_; + } + + public int getDigestCount() { + return internalGetDigest().getMap().size(); + } + /** + * + * + *
+     * `"<ALGORITHM>": "<HEX_VALUE>"`
+     * Algorithms can be e.g. sha256, sha512
+     * See
+     * https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet
+     * 
+ * + * map<string, string> digest = 2; + */ + @java.lang.Override + public boolean containsDigest(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetDigest().getMap().containsKey(key); + } + /** Use {@link #getDigestMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDigest() { + return getDigestMap(); + } + /** + * + * + *
+     * `"<ALGORITHM>": "<HEX_VALUE>"`
+     * Algorithms can be e.g. sha256, sha512
+     * See
+     * https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet
+     * 
+ * + * map<string, string> digest = 2; + */ + @java.lang.Override + public java.util.Map getDigestMap() { + return internalGetDigest().getMap(); + } + /** + * + * + *
+     * `"<ALGORITHM>": "<HEX_VALUE>"`
+     * Algorithms can be e.g. sha256, sha512
+     * See
+     * https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet
+     * 
+ * + * map<string, string> digest = 2; + */ + @java.lang.Override + public java.lang.String getDigestOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetDigest().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * `"<ALGORITHM>": "<HEX_VALUE>"`
+     * Algorithms can be e.g. sha256, sha512
+     * See
+     * https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet
+     * 
+ * + * map<string, string> digest = 2; + */ + @java.lang.Override + public java.lang.String getDigestOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetDigest().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearDigest() { + internalGetMutableDigest().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * `"<ALGORITHM>": "<HEX_VALUE>"`
+     * Algorithms can be e.g. sha256, sha512
+     * See
+     * https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet
+     * 
+ * + * map<string, string> digest = 2; + */ + public Builder removeDigest(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableDigest().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableDigest() { + return internalGetMutableDigest().getMutableMap(); + } + /** + * + * + *
+     * `"<ALGORITHM>": "<HEX_VALUE>"`
+     * Algorithms can be e.g. sha256, sha512
+     * See
+     * https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet
+     * 
+ * + * map<string, string> digest = 2; + */ + public Builder putDigest(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableDigest().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * `"<ALGORITHM>": "<HEX_VALUE>"`
+     * Algorithms can be e.g. sha256, sha512
+     * See
+     * https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet
+     * 
+ * + * map<string, string> digest = 2; + */ + public Builder putAllDigest(java.util.Map values) { + internalGetMutableDigest().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.Subject) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1.Subject) + private static final io.grafeas.v1.Subject DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new io.grafeas.v1.Subject(); + } + + public static io.grafeas.v1.Subject getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Subject parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Subject(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.Subject getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/src/main/java/io/grafeas/v1/SubjectOrBuilder.java b/src/main/java/io/grafeas/v1/SubjectOrBuilder.java new file mode 100644 index 00000000..79e522f2 --- /dev/null +++ b/src/main/java/io/grafeas/v1/SubjectOrBuilder.java @@ -0,0 +1,108 @@ +/* + * Copyright 2019 The Grafeas Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: grafeas/v1/intoto_statement.proto + +package io.grafeas.v1; + +public interface SubjectOrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.Subject) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * `"<ALGORITHM>": "<HEX_VALUE>"`
+   * Algorithms can be e.g. sha256, sha512
+   * See
+   * https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet
+   * 
+ * + * map<string, string> digest = 2; + */ + int getDigestCount(); + /** + * + * + *
+   * `"<ALGORITHM>": "<HEX_VALUE>"`
+   * Algorithms can be e.g. sha256, sha512
+   * See
+   * https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet
+   * 
+ * + * map<string, string> digest = 2; + */ + boolean containsDigest(java.lang.String key); + /** Use {@link #getDigestMap()} instead. */ + @java.lang.Deprecated + java.util.Map getDigest(); + /** + * + * + *
+   * `"<ALGORITHM>": "<HEX_VALUE>"`
+   * Algorithms can be e.g. sha256, sha512
+   * See
+   * https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet
+   * 
+ * + * map<string, string> digest = 2; + */ + java.util.Map getDigestMap(); + /** + * + * + *
+   * `"<ALGORITHM>": "<HEX_VALUE>"`
+   * Algorithms can be e.g. sha256, sha512
+   * See
+   * https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet
+   * 
+ * + * map<string, string> digest = 2; + */ + java.lang.String getDigestOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * `"<ALGORITHM>": "<HEX_VALUE>"`
+   * Algorithms can be e.g. sha256, sha512
+   * See
+   * https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet
+   * 
+ * + * map<string, string> digest = 2; + */ + java.lang.String getDigestOrThrow(java.lang.String key); +} diff --git a/src/main/java/io/grafeas/v1/Version.java b/src/main/java/io/grafeas/v1/Version.java index e377e93d..7c45e03b 100644 --- a/src/main/java/io/grafeas/v1/Version.java +++ b/src/main/java/io/grafeas/v1/Version.java @@ -107,6 +107,11 @@ private Version( fullName_ = s; break; } + case 48: + { + inclusive_ = input.readBool(); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -435,6 +440,29 @@ public com.google.protobuf.ByteString getRevisionBytes() { } } + public static final int INCLUSIVE_FIELD_NUMBER = 6; + private boolean inclusive_; + /** + * + * + *
+   * Whether this version is specifying part of an inclusive range. Grafeas
+   * does not have the capability to specify version ranges; instead we have
+   * fields that specify start version and end versions. At times this is
+   * insufficient - we also need to specify whether the version is included in
+   * the range or is excluded from the range. This boolean is expected to be set
+   * to true when the version is included in a range.
+   * 
+ * + * bool inclusive = 6; + * + * @return The inclusive. + */ + @java.lang.Override + public boolean getInclusive() { + return inclusive_; + } + public static final int KIND_FIELD_NUMBER = 4; private int kind_; /** @@ -552,6 +580,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fullName_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, fullName_); } + if (inclusive_ != false) { + output.writeBool(6, inclusive_); + } unknownFields.writeTo(output); } @@ -576,6 +607,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fullName_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, fullName_); } + if (inclusive_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, inclusive_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -594,6 +628,7 @@ public boolean equals(final java.lang.Object obj) { if (getEpoch() != other.getEpoch()) return false; if (!getName().equals(other.getName())) return false; if (!getRevision().equals(other.getRevision())) return false; + if (getInclusive() != other.getInclusive()) return false; if (kind_ != other.kind_) return false; if (!getFullName().equals(other.getFullName())) return false; if (!unknownFields.equals(other.unknownFields)) return false; @@ -613,6 +648,8 @@ public int hashCode() { hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + REVISION_FIELD_NUMBER; hash = (53 * hash) + getRevision().hashCode(); + hash = (37 * hash) + INCLUSIVE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getInclusive()); hash = (37 * hash) + KIND_FIELD_NUMBER; hash = (53 * hash) + kind_; hash = (37 * hash) + FULL_NAME_FIELD_NUMBER; @@ -764,6 +801,8 @@ public Builder clear() { revision_ = ""; + inclusive_ = false; + kind_ = 0; fullName_ = ""; @@ -796,6 +835,7 @@ public io.grafeas.v1.Version buildPartial() { result.epoch_ = epoch_; result.name_ = name_; result.revision_ = revision_; + result.inclusive_ = inclusive_; result.kind_ = kind_; result.fullName_ = fullName_; onBuilt(); @@ -858,6 +898,9 @@ public Builder mergeFrom(io.grafeas.v1.Version other) { revision_ = other.revision_; onChanged(); } + if (other.getInclusive() != false) { + setInclusive(other.getInclusive()); + } if (other.kind_ != 0) { setKindValue(other.getKindValue()); } @@ -1163,6 +1206,73 @@ public Builder setRevisionBytes(com.google.protobuf.ByteString value) { return this; } + private boolean inclusive_; + /** + * + * + *
+     * Whether this version is specifying part of an inclusive range. Grafeas
+     * does not have the capability to specify version ranges; instead we have
+     * fields that specify start version and end versions. At times this is
+     * insufficient - we also need to specify whether the version is included in
+     * the range or is excluded from the range. This boolean is expected to be set
+     * to true when the version is included in a range.
+     * 
+ * + * bool inclusive = 6; + * + * @return The inclusive. + */ + @java.lang.Override + public boolean getInclusive() { + return inclusive_; + } + /** + * + * + *
+     * Whether this version is specifying part of an inclusive range. Grafeas
+     * does not have the capability to specify version ranges; instead we have
+     * fields that specify start version and end versions. At times this is
+     * insufficient - we also need to specify whether the version is included in
+     * the range or is excluded from the range. This boolean is expected to be set
+     * to true when the version is included in a range.
+     * 
+ * + * bool inclusive = 6; + * + * @param value The inclusive to set. + * @return This builder for chaining. + */ + public Builder setInclusive(boolean value) { + + inclusive_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether this version is specifying part of an inclusive range. Grafeas
+     * does not have the capability to specify version ranges; instead we have
+     * fields that specify start version and end versions. At times this is
+     * insufficient - we also need to specify whether the version is included in
+     * the range or is excluded from the range. This boolean is expected to be set
+     * to true when the version is included in a range.
+     * 
+ * + * bool inclusive = 6; + * + * @return This builder for chaining. + */ + public Builder clearInclusive() { + + inclusive_ = false; + onChanged(); + return this; + } + private int kind_ = 0; /** * diff --git a/src/main/java/io/grafeas/v1/VersionOrBuilder.java b/src/main/java/io/grafeas/v1/VersionOrBuilder.java index 95882d36..f743e7cf 100644 --- a/src/main/java/io/grafeas/v1/VersionOrBuilder.java +++ b/src/main/java/io/grafeas/v1/VersionOrBuilder.java @@ -89,6 +89,24 @@ public interface VersionOrBuilder */ com.google.protobuf.ByteString getRevisionBytes(); + /** + * + * + *
+   * Whether this version is specifying part of an inclusive range. Grafeas
+   * does not have the capability to specify version ranges; instead we have
+   * fields that specify start version and end versions. At times this is
+   * insufficient - we also need to specify whether the version is included in
+   * the range or is excluded from the range. This boolean is expected to be set
+   * to true when the version is included in a range.
+   * 
+ * + * bool inclusive = 6; + * + * @return The inclusive. + */ + boolean getInclusive(); + /** * * diff --git a/src/main/java/io/grafeas/v1/Vulnerability.java b/src/main/java/io/grafeas/v1/Vulnerability.java index 1ca5a5b7..b1e804ef 100644 --- a/src/main/java/io/grafeas/v1/Vulnerability.java +++ b/src/main/java/io/grafeas/v1/Vulnerability.java @@ -48,6 +48,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_grafeas_v1_VulnerabilityOccurrence_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_grafeas_v1_VulnerabilityOccurrence_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1_VulnerabilityOccurrence_CVSSV3_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1_VulnerabilityOccurrence_CVSSV3_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_grafeas_v1_VulnerabilityOccurrence_PackageIssue_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -62,56 +66,63 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n\036grafeas/v1/vulnerability.proto\022\ngrafea" - + "s.v1\032\037google/protobuf/timestamp.proto\032\027g" - + "rafeas/v1/common.proto\032\025grafeas/v1/cvss." - + "proto\032\030grafeas/v1/package.proto\"\372\006\n\021Vuln" - + "erabilityNote\022\022\n\ncvss_score\030\001 \001(\002\022&\n\010sev" - + "erity\030\002 \001(\0162\024.grafeas.v1.Severity\0225\n\007det" - + "ails\030\003 \003(\0132$.grafeas.v1.VulnerabilityNot" - + "e.Detail\022#\n\007cvss_v3\030\004 \001(\0132\022.grafeas.v1.C" - + "VSSv3\022D\n\017windows_details\030\005 \003(\0132+.grafeas" - + ".v1.VulnerabilityNote.WindowsDetail\0226\n\022s" - + "ource_update_time\030\006 \001(\0132\032.google.protobu" - + "f.Timestamp\032\215\003\n\006Detail\022\025\n\rseverity_name\030" - + "\001 \001(\t\022\023\n\013description\030\002 \001(\t\022\024\n\014package_ty" - + "pe\030\003 \001(\t\022\030\n\020affected_cpe_uri\030\004 \001(\t\022\030\n\020af" - + "fected_package\030\005 \001(\t\0223\n\026affected_version" - + "_start\030\006 \001(\0132\023.grafeas.v1.Version\0221\n\024aff" - + "ected_version_end\030\007 \001(\0132\023.grafeas.v1.Ver" - + "sion\022\025\n\rfixed_cpe_uri\030\010 \001(\t\022\025\n\rfixed_pac" - + "kage\030\t \001(\t\022*\n\rfixed_version\030\n \001(\0132\023.graf" - + "eas.v1.Version\022\023\n\013is_obsolete\030\013 \001(\010\0226\n\022s" - + "ource_update_time\030\014 \001(\0132\032.google.protobu" - + "f.Timestamp\032\276\001\n\rWindowsDetail\022\017\n\007cpe_uri" - + "\030\001 \001(\t\022\014\n\004name\030\002 \001(\t\022\023\n\013description\030\003 \001(" - + "\t\022M\n\nfixing_kbs\030\004 \003(\01329.grafeas.v1.Vulne" - + "rabilityNote.WindowsDetail.KnowledgeBase" - + "\032*\n\rKnowledgeBase\022\014\n\004name\030\001 \001(\t\022\013\n\003url\030\002" - + " \001(\t\"\275\004\n\027VulnerabilityOccurrence\022\014\n\004type" - + "\030\001 \001(\t\022&\n\010severity\030\002 \001(\0162\024.grafeas.v1.Se" - + "verity\022\022\n\ncvss_score\030\003 \001(\002\022G\n\rpackage_is" - + "sue\030\004 \003(\01320.grafeas.v1.VulnerabilityOccu" - + "rrence.PackageIssue\022\031\n\021short_description" - + "\030\005 \001(\t\022\030\n\020long_description\030\006 \001(\t\022,\n\014rela" - + "ted_urls\030\007 \003(\0132\026.grafeas.v1.RelatedUrl\0220" - + "\n\022effective_severity\030\010 \001(\0162\024.grafeas.v1." - + "Severity\022\025\n\rfix_available\030\t \001(\010\032\342\001\n\014Pack" - + "ageIssue\022\030\n\020affected_cpe_uri\030\001 \001(\t\022\030\n\020af" - + "fected_package\030\002 \001(\t\022-\n\020affected_version" - + "\030\003 \001(\0132\023.grafeas.v1.Version\022\025\n\rfixed_cpe" - + "_uri\030\004 \001(\t\022\025\n\rfixed_package\030\005 \001(\t\022*\n\rfix" - + "ed_version\030\006 \001(\0132\023.grafeas.v1.Version\022\025\n" - + "\rfix_available\030\007 \001(\010*^\n\010Severity\022\030\n\024SEVE" - + "RITY_UNSPECIFIED\020\000\022\013\n\007MINIMAL\020\001\022\007\n\003LOW\020\002" - + "\022\n\n\006MEDIUM\020\003\022\010\n\004HIGH\020\004\022\014\n\010CRITICAL\020\005BQ\n\r" - + "io.grafeas.v1P\001Z8google.golang.org/genpr" - + "oto/googleapis/grafeas/v1;grafeas\242\002\003GRAb" - + "\006proto3" + + "s.v1\032\037google/api/field_behavior.proto\032\037g" + + "oogle/protobuf/timestamp.proto\032\027grafeas/" + + "v1/common.proto\032\025grafeas/v1/cvss.proto\032\030" + + "grafeas/v1/package.proto\"\232\007\n\021Vulnerabili" + + "tyNote\022\022\n\ncvss_score\030\001 \001(\002\022&\n\010severity\030\002" + + " \001(\0162\024.grafeas.v1.Severity\0225\n\007details\030\003 " + + "\003(\0132$.grafeas.v1.VulnerabilityNote.Detai" + + "l\022#\n\007cvss_v3\030\004 \001(\0132\022.grafeas.v1.CVSSv3\022D" + + "\n\017windows_details\030\005 \003(\0132+.grafeas.v1.Vul" + + "nerabilityNote.WindowsDetail\0226\n\022source_u" + + "pdate_time\030\006 \001(\0132\032.google.protobuf.Times" + + "tamp\032\255\003\n\006Detail\022\025\n\rseverity_name\030\001 \001(\t\022\023" + + "\n\013description\030\002 \001(\t\022\024\n\014package_type\030\003 \001(" + + "\t\022\030\n\020affected_cpe_uri\030\004 \001(\t\022\030\n\020affected_" + + "package\030\005 \001(\t\0223\n\026affected_version_start\030" + + "\006 \001(\0132\023.grafeas.v1.Version\0221\n\024affected_v" + + "ersion_end\030\007 \001(\0132\023.grafeas.v1.Version\022\025\n" + + "\rfixed_cpe_uri\030\010 \001(\t\022\025\n\rfixed_package\030\t " + + "\001(\t\022*\n\rfixed_version\030\n \001(\0132\023.grafeas.v1." + + "Version\022\023\n\013is_obsolete\030\013 \001(\010\0226\n\022source_u" + + "pdate_time\030\014 \001(\0132\032.google.protobuf.Times" + + "tamp\022\016\n\006source\030\r \001(\t\022\016\n\006vendor\030\016 \001(\t\032\276\001\n" + + "\rWindowsDetail\022\017\n\007cpe_uri\030\001 \001(\t\022\014\n\004name\030" + + "\002 \001(\t\022\023\n\013description\030\003 \001(\t\022M\n\nfixing_kbs" + + "\030\004 \003(\01329.grafeas.v1.VulnerabilityNote.Wi" + + "ndowsDetail.KnowledgeBase\032*\n\rKnowledgeBa" + + "se\022\014\n\004name\030\001 \001(\t\022\013\n\003url\030\002 \001(\t\"\214\006\n\027Vulner" + + "abilityOccurrence\022\014\n\004type\030\001 \001(\t\022&\n\010sever" + + "ity\030\002 \001(\0162\024.grafeas.v1.Severity\022\022\n\ncvss_" + + "score\030\003 \001(\002\022:\n\006cvssv3\030\n \001(\0132*.grafeas.v1" + + ".VulnerabilityOccurrence.CVSSV3\022G\n\rpacka" + + "ge_issue\030\004 \003(\01320.grafeas.v1.Vulnerabilit" + + "yOccurrence.PackageIssue\022\031\n\021short_descri" + + "ption\030\005 \001(\t\022\030\n\020long_description\030\006 \001(\t\022,\n" + + "\014related_urls\030\007 \003(\0132\026.grafeas.v1.Related" + + "Url\0220\n\022effective_severity\030\010 \001(\0162\024.grafea" + + "s.v1.Severity\022\025\n\rfix_available\030\t \001(\010\032D\n\006" + + "CVSSV3\022\022\n\nbase_score\030\001 \001(\002\022&\n\010severity\030\002" + + " \001(\0162\024.grafeas.v1.Severity\032\257\002\n\014PackageIs" + + "sue\022\030\n\020affected_cpe_uri\030\001 \001(\t\022\030\n\020affecte" + + "d_package\030\002 \001(\t\022-\n\020affected_version\030\003 \001(" + + "\0132\023.grafeas.v1.Version\022\025\n\rfixed_cpe_uri\030" + + "\004 \001(\t\022\025\n\rfixed_package\030\005 \001(\t\022*\n\rfixed_ve" + + "rsion\030\006 \001(\0132\023.grafeas.v1.Version\022\025\n\rfix_" + + "available\030\007 \001(\010\022\024\n\014package_type\030\010 \001(\t\0225\n" + + "\022effective_severity\030\t \001(\0162\024.grafeas.v1.S" + + "everityB\003\340A\003*^\n\010Severity\022\030\n\024SEVERITY_UNS" + + "PECIFIED\020\000\022\013\n\007MINIMAL\020\001\022\007\n\003LOW\020\002\022\n\n\006MEDI" + + "UM\020\003\022\010\n\004HIGH\020\004\022\014\n\010CRITICAL\020\005BQ\n\rio.grafe" + + "as.v1P\001Z8google.golang.org/genproto/goog" + + "leapis/grafeas/v1;grafeas\242\002\003GRAb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), io.grafeas.v1.Common.getDescriptor(), io.grafeas.v1.Cvss.getDescriptor(), @@ -143,6 +154,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "FixedVersion", "IsObsolete", "SourceUpdateTime", + "Source", + "Vendor", }); internal_static_grafeas_v1_VulnerabilityNote_WindowsDetail_descriptor = internal_static_grafeas_v1_VulnerabilityNote_descriptor.getNestedTypes().get(1); @@ -171,6 +184,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Type", "Severity", "CvssScore", + "Cvssv3", "PackageIssue", "ShortDescription", "LongDescription", @@ -178,8 +192,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "EffectiveSeverity", "FixAvailable", }); - internal_static_grafeas_v1_VulnerabilityOccurrence_PackageIssue_descriptor = + internal_static_grafeas_v1_VulnerabilityOccurrence_CVSSV3_descriptor = internal_static_grafeas_v1_VulnerabilityOccurrence_descriptor.getNestedTypes().get(0); + internal_static_grafeas_v1_VulnerabilityOccurrence_CVSSV3_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1_VulnerabilityOccurrence_CVSSV3_descriptor, + new java.lang.String[] { + "BaseScore", "Severity", + }); + internal_static_grafeas_v1_VulnerabilityOccurrence_PackageIssue_descriptor = + internal_static_grafeas_v1_VulnerabilityOccurrence_descriptor.getNestedTypes().get(1); internal_static_grafeas_v1_VulnerabilityOccurrence_PackageIssue_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_grafeas_v1_VulnerabilityOccurrence_PackageIssue_descriptor, @@ -191,7 +213,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "FixedPackage", "FixedVersion", "FixAvailable", + "PackageType", + "EffectiveSeverity", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); io.grafeas.v1.Common.getDescriptor(); io.grafeas.v1.Cvss.getDescriptor(); diff --git a/src/main/java/io/grafeas/v1/VulnerabilityNote.java b/src/main/java/io/grafeas/v1/VulnerabilityNote.java index e4d44e17..c908397a 100644 --- a/src/main/java/io/grafeas/v1/VulnerabilityNote.java +++ b/src/main/java/io/grafeas/v1/VulnerabilityNote.java @@ -569,6 +569,56 @@ public interface DetailOrBuilder * .google.protobuf.Timestamp source_update_time = 12; */ com.google.protobuf.TimestampOrBuilder getSourceUpdateTimeOrBuilder(); + + /** + * + * + *
+     * The source from which the information in this Detail was obtained.
+     * 
+ * + * string source = 13; + * + * @return The source. + */ + java.lang.String getSource(); + /** + * + * + *
+     * The source from which the information in this Detail was obtained.
+     * 
+ * + * string source = 13; + * + * @return The bytes for source. + */ + com.google.protobuf.ByteString getSourceBytes(); + + /** + * + * + *
+     * The name of the vendor of the product.
+     * 
+ * + * string vendor = 14; + * + * @return The vendor. + */ + java.lang.String getVendor(); + /** + * + * + *
+     * The name of the vendor of the product.
+     * 
+ * + * string vendor = 14; + * + * @return The bytes for vendor. + */ + com.google.protobuf.ByteString getVendorBytes(); } /** * @@ -598,6 +648,8 @@ private Detail() { affectedPackage_ = ""; fixedCpeUri_ = ""; fixedPackage_ = ""; + source_ = ""; + vendor_ = ""; } @java.lang.Override @@ -741,6 +793,20 @@ private Detail( sourceUpdateTime_ = subBuilder.buildPartial(); } + break; + } + case 106: + { + java.lang.String s = input.readStringRequireUtf8(); + + source_ = s; + break; + } + case 114: + { + java.lang.String s = input.readStringRequireUtf8(); + + vendor_ = s; break; } default: @@ -1389,6 +1455,104 @@ public com.google.protobuf.TimestampOrBuilder getSourceUpdateTimeOrBuilder() { return getSourceUpdateTime(); } + public static final int SOURCE_FIELD_NUMBER = 13; + private volatile java.lang.Object source_; + /** + * + * + *
+     * The source from which the information in this Detail was obtained.
+     * 
+ * + * string source = 13; + * + * @return The source. + */ + @java.lang.Override + public java.lang.String getSource() { + java.lang.Object ref = source_; + 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(); + source_ = s; + return s; + } + } + /** + * + * + *
+     * The source from which the information in this Detail was obtained.
+     * 
+ * + * string source = 13; + * + * @return The bytes for source. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceBytes() { + java.lang.Object ref = source_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + source_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VENDOR_FIELD_NUMBER = 14; + private volatile java.lang.Object vendor_; + /** + * + * + *
+     * The name of the vendor of the product.
+     * 
+ * + * string vendor = 14; + * + * @return The vendor. + */ + @java.lang.Override + public java.lang.String getVendor() { + java.lang.Object ref = vendor_; + 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(); + vendor_ = s; + return s; + } + } + /** + * + * + *
+     * The name of the vendor of the product.
+     * 
+ * + * string vendor = 14; + * + * @return The bytes for vendor. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVendorBytes() { + java.lang.Object ref = vendor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + vendor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1439,6 +1603,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (sourceUpdateTime_ != null) { output.writeMessage(12, getSourceUpdateTime()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(source_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, source_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(vendor_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, vendor_); + } unknownFields.writeTo(output); } @@ -1486,6 +1656,12 @@ public int getSerializedSize() { if (sourceUpdateTime_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getSourceUpdateTime()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(source_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, source_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(vendor_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, vendor_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -1525,6 +1701,8 @@ public boolean equals(final java.lang.Object obj) { if (hasSourceUpdateTime()) { if (!getSourceUpdateTime().equals(other.getSourceUpdateTime())) return false; } + if (!getSource().equals(other.getSource())) return false; + if (!getVendor().equals(other.getVendor())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -1568,6 +1746,10 @@ public int hashCode() { hash = (37 * hash) + SOURCE_UPDATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getSourceUpdateTime().hashCode(); } + hash = (37 * hash) + SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getSource().hashCode(); + hash = (37 * hash) + VENDOR_FIELD_NUMBER; + hash = (53 * hash) + getVendor().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -1756,6 +1938,10 @@ public Builder clear() { sourceUpdateTime_ = null; sourceUpdateTimeBuilder_ = null; } + source_ = ""; + + vendor_ = ""; + return this; } @@ -1811,6 +1997,8 @@ public io.grafeas.v1.VulnerabilityNote.Detail buildPartial() { } else { result.sourceUpdateTime_ = sourceUpdateTimeBuilder_.build(); } + result.source_ = source_; + result.vendor_ = vendor_; onBuilt(); return result; } @@ -1905,6 +2093,14 @@ public Builder mergeFrom(io.grafeas.v1.VulnerabilityNote.Detail other) { if (other.hasSourceUpdateTime()) { mergeSourceUpdateTime(other.getSourceUpdateTime()); } + if (!other.getSource().isEmpty()) { + source_ = other.source_; + onChanged(); + } + if (!other.getVendor().isEmpty()) { + vendor_ = other.vendor_; + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -3627,6 +3823,218 @@ public com.google.protobuf.TimestampOrBuilder getSourceUpdateTimeOrBuilder() { return sourceUpdateTimeBuilder_; } + private java.lang.Object source_ = ""; + /** + * + * + *
+       * The source from which the information in this Detail was obtained.
+       * 
+ * + * string source = 13; + * + * @return The source. + */ + public java.lang.String getSource() { + java.lang.Object ref = source_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + source_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The source from which the information in this Detail was obtained.
+       * 
+ * + * string source = 13; + * + * @return The bytes for source. + */ + public com.google.protobuf.ByteString getSourceBytes() { + java.lang.Object ref = source_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + source_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The source from which the information in this Detail was obtained.
+       * 
+ * + * string source = 13; + * + * @param value The source to set. + * @return This builder for chaining. + */ + public Builder setSource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + source_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The source from which the information in this Detail was obtained.
+       * 
+ * + * string source = 13; + * + * @return This builder for chaining. + */ + public Builder clearSource() { + + source_ = getDefaultInstance().getSource(); + onChanged(); + return this; + } + /** + * + * + *
+       * The source from which the information in this Detail was obtained.
+       * 
+ * + * string source = 13; + * + * @param value The bytes for source to set. + * @return This builder for chaining. + */ + public Builder setSourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + source_ = value; + onChanged(); + return this; + } + + private java.lang.Object vendor_ = ""; + /** + * + * + *
+       * The name of the vendor of the product.
+       * 
+ * + * string vendor = 14; + * + * @return The vendor. + */ + public java.lang.String getVendor() { + java.lang.Object ref = vendor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + vendor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The name of the vendor of the product.
+       * 
+ * + * string vendor = 14; + * + * @return The bytes for vendor. + */ + public com.google.protobuf.ByteString getVendorBytes() { + java.lang.Object ref = vendor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + vendor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The name of the vendor of the product.
+       * 
+ * + * string vendor = 14; + * + * @param value The vendor to set. + * @return This builder for chaining. + */ + public Builder setVendor(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + vendor_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the vendor of the product.
+       * 
+ * + * string vendor = 14; + * + * @return This builder for chaining. + */ + public Builder clearVendor() { + + vendor_ = getDefaultInstance().getVendor(); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the vendor of the product.
+       * 
+ * + * string vendor = 14; + * + * @param value The bytes for vendor to set. + * @return This builder for chaining. + */ + public Builder setVendorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + vendor_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/src/main/java/io/grafeas/v1/VulnerabilityOccurrence.java b/src/main/java/io/grafeas/v1/VulnerabilityOccurrence.java index dd2323a8..6256491c 100644 --- a/src/main/java/io/grafeas/v1/VulnerabilityOccurrence.java +++ b/src/main/java/io/grafeas/v1/VulnerabilityOccurrence.java @@ -144,6 +144,22 @@ private VulnerabilityOccurrence( case 72: { fixAvailable_ = input.readBool(); + break; + } + case 82: + { + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3.Builder subBuilder = null; + if (cvssv3_ != null) { + subBuilder = cvssv3_.toBuilder(); + } + cvssv3_ = + input.readMessage( + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(cvssv3_); + cvssv3_ = subBuilder.buildPartial(); + } + break; } default: @@ -155,35 +171,767 @@ private VulnerabilityOccurrence( } } } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - packageIssue_ = java.util.Collections.unmodifiableList(packageIssue_); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + packageIssue_ = java.util.Collections.unmodifiableList(packageIssue_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + relatedUrls_ = java.util.Collections.unmodifiableList(relatedUrls_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Vulnerability + .internal_static_grafeas_v1_VulnerabilityOccurrence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Vulnerability + .internal_static_grafeas_v1_VulnerabilityOccurrence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.VulnerabilityOccurrence.class, + io.grafeas.v1.VulnerabilityOccurrence.Builder.class); + } + + public interface CVSSV3OrBuilder + extends + // @@protoc_insertion_point(interface_extends:grafeas.v1.VulnerabilityOccurrence.CVSSV3) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The base score for for this vulnerability according to cvss v3.
+     * 
+ * + * float base_score = 1; + * + * @return The baseScore. + */ + float getBaseScore(); + + /** + * + * + *
+     * The severity rating assigned to this vulnerability by vulnerability
+     * provider.
+     * 
+ * + * .grafeas.v1.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + /** + * + * + *
+     * The severity rating assigned to this vulnerability by vulnerability
+     * provider.
+     * 
+ * + * .grafeas.v1.Severity severity = 2; + * + * @return The severity. + */ + io.grafeas.v1.Severity getSeverity(); + } + /** + * + * + *
+   * The CVSS v3 score for this vulnerability.
+   * 
+ * + * Protobuf type {@code grafeas.v1.VulnerabilityOccurrence.CVSSV3} + */ + public static final class CVSSV3 extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:grafeas.v1.VulnerabilityOccurrence.CVSSV3) + CVSSV3OrBuilder { + private static final long serialVersionUID = 0L; + // Use CVSSV3.newBuilder() to construct. + private CVSSV3(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CVSSV3() { + severity_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CVSSV3(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CVSSV3( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + baseScore_ = input.readFloat(); + break; + } + case 16: + { + int rawValue = input.readEnum(); + + severity_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Vulnerability + .internal_static_grafeas_v1_VulnerabilityOccurrence_CVSSV3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Vulnerability + .internal_static_grafeas_v1_VulnerabilityOccurrence_CVSSV3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3.class, + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3.Builder.class); + } + + public static final int BASE_SCORE_FIELD_NUMBER = 1; + private float baseScore_; + /** + * + * + *
+     * The base score for for this vulnerability according to cvss v3.
+     * 
+ * + * float base_score = 1; + * + * @return The baseScore. + */ + @java.lang.Override + public float getBaseScore() { + return baseScore_; + } + + public static final int SEVERITY_FIELD_NUMBER = 2; + private int severity_; + /** + * + * + *
+     * The severity rating assigned to this vulnerability by vulnerability
+     * provider.
+     * 
+ * + * .grafeas.v1.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+     * The severity rating assigned to this vulnerability by vulnerability
+     * provider.
+     * 
+ * + * .grafeas.v1.Severity severity = 2; + * + * @return The severity. + */ + @java.lang.Override + public io.grafeas.v1.Severity getSeverity() { + @SuppressWarnings("deprecation") + io.grafeas.v1.Severity result = io.grafeas.v1.Severity.valueOf(severity_); + return result == null ? io.grafeas.v1.Severity.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (baseScore_ != 0F) { + output.writeFloat(1, baseScore_); + } + if (severity_ != io.grafeas.v1.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + output.writeEnum(2, severity_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (baseScore_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, baseScore_); + } + if (severity_ != io.grafeas.v1.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, severity_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1.VulnerabilityOccurrence.CVSSV3)) { + return super.equals(obj); + } + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 other = + (io.grafeas.v1.VulnerabilityOccurrence.CVSSV3) obj; + + if (java.lang.Float.floatToIntBits(getBaseScore()) + != java.lang.Float.floatToIntBits(other.getBaseScore())) return false; + if (severity_ != other.severity_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BASE_SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getBaseScore()); + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The CVSS v3 score for this vulnerability.
+     * 
+ * + * Protobuf type {@code grafeas.v1.VulnerabilityOccurrence.CVSSV3} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:grafeas.v1.VulnerabilityOccurrence.CVSSV3) + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return io.grafeas.v1.Vulnerability + .internal_static_grafeas_v1_VulnerabilityOccurrence_CVSSV3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1.Vulnerability + .internal_static_grafeas_v1_VulnerabilityOccurrence_CVSSV3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3.class, + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3.Builder.class); + } + + // Construct using io.grafeas.v1.VulnerabilityOccurrence.CVSSV3.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + baseScore_ = 0F; + + severity_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return io.grafeas.v1.Vulnerability + .internal_static_grafeas_v1_VulnerabilityOccurrence_CVSSV3_descriptor; + } + + @java.lang.Override + public io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 getDefaultInstanceForType() { + return io.grafeas.v1.VulnerabilityOccurrence.CVSSV3.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 build() { + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 buildPartial() { + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 result = + new io.grafeas.v1.VulnerabilityOccurrence.CVSSV3(this); + result.baseScore_ = baseScore_; + result.severity_ = severity_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1.VulnerabilityOccurrence.CVSSV3) { + return mergeFrom((io.grafeas.v1.VulnerabilityOccurrence.CVSSV3) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 other) { + if (other == io.grafeas.v1.VulnerabilityOccurrence.CVSSV3.getDefaultInstance()) return this; + if (other.getBaseScore() != 0F) { + setBaseScore(other.getBaseScore()); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1.VulnerabilityOccurrence.CVSSV3) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float baseScore_; + /** + * + * + *
+       * The base score for for this vulnerability according to cvss v3.
+       * 
+ * + * float base_score = 1; + * + * @return The baseScore. + */ + @java.lang.Override + public float getBaseScore() { + return baseScore_; + } + /** + * + * + *
+       * The base score for for this vulnerability according to cvss v3.
+       * 
+ * + * float base_score = 1; + * + * @param value The baseScore to set. + * @return This builder for chaining. + */ + public Builder setBaseScore(float value) { + + baseScore_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The base score for for this vulnerability according to cvss v3.
+       * 
+ * + * float base_score = 1; + * + * @return This builder for chaining. + */ + public Builder clearBaseScore() { + + baseScore_ = 0F; + onChanged(); + return this; + } + + private int severity_ = 0; + /** + * + * + *
+       * The severity rating assigned to this vulnerability by vulnerability
+       * provider.
+       * 
+ * + * .grafeas.v1.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+       * The severity rating assigned to this vulnerability by vulnerability
+       * provider.
+       * 
+ * + * .grafeas.v1.Severity severity = 2; + * + * @param value The enum numeric value on the wire for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityValue(int value) { + + severity_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The severity rating assigned to this vulnerability by vulnerability
+       * provider.
+       * 
+ * + * .grafeas.v1.Severity severity = 2; + * + * @return The severity. + */ + @java.lang.Override + public io.grafeas.v1.Severity getSeverity() { + @SuppressWarnings("deprecation") + io.grafeas.v1.Severity result = io.grafeas.v1.Severity.valueOf(severity_); + return result == null ? io.grafeas.v1.Severity.UNRECOGNIZED : result; + } + /** + * + * + *
+       * The severity rating assigned to this vulnerability by vulnerability
+       * provider.
+       * 
+ * + * .grafeas.v1.Severity severity = 2; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(io.grafeas.v1.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The severity rating assigned to this vulnerability by vulnerability
+       * provider.
+       * 
+ * + * .grafeas.v1.Severity severity = 2; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + + severity_ = 0; + onChanged(); + return this; } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - relatedUrls_ = java.util.Collections.unmodifiableList(relatedUrls_); + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:grafeas.v1.VulnerabilityOccurrence.CVSSV3) } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.grafeas.v1.Vulnerability - .internal_static_grafeas_v1_VulnerabilityOccurrence_descriptor; - } + // @@protoc_insertion_point(class_scope:grafeas.v1.VulnerabilityOccurrence.CVSSV3) + private static final io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 DEFAULT_INSTANCE; - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.grafeas.v1.Vulnerability - .internal_static_grafeas_v1_VulnerabilityOccurrence_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.grafeas.v1.VulnerabilityOccurrence.class, - io.grafeas.v1.VulnerabilityOccurrence.Builder.class); + static { + DEFAULT_INSTANCE = new io.grafeas.v1.VulnerabilityOccurrence.CVSSV3(); + } + + public static io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CVSSV3 parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CVSSV3(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } } public interface PackageIssueOrBuilder @@ -387,6 +1135,64 @@ public interface PackageIssueOrBuilder * @return The fixAvailable. */ boolean getFixAvailable(); + + /** + * + * + *
+     * The type of package (e.g. OS, MAVEN, GO).
+     * 
+ * + * string package_type = 8; + * + * @return The packageType. + */ + java.lang.String getPackageType(); + /** + * + * + *
+     * The type of package (e.g. OS, MAVEN, GO).
+     * 
+ * + * string package_type = 8; + * + * @return The bytes for packageType. + */ + com.google.protobuf.ByteString getPackageTypeBytes(); + + /** + * + * + *
+     * The distro or language system assigned severity for this vulnerability
+     * when that is available and note provider assigned severity when it is not
+     * available.
+     * 
+ * + * + * .grafeas.v1.Severity effective_severity = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for effectiveSeverity. + */ + int getEffectiveSeverityValue(); + /** + * + * + *
+     * The distro or language system assigned severity for this vulnerability
+     * when that is available and note provider assigned severity when it is not
+     * available.
+     * 
+ * + * + * .grafeas.v1.Severity effective_severity = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The effectiveSeverity. + */ + io.grafeas.v1.Severity getEffectiveSeverity(); } /** * @@ -413,6 +1219,8 @@ private PackageIssue() { affectedPackage_ = ""; fixedCpeUri_ = ""; fixedPackage_ = ""; + packageType_ = ""; + effectiveSeverity_ = 0; } @java.lang.Override @@ -507,6 +1315,20 @@ private PackageIssue( fixAvailable_ = input.readBool(); break; } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + packageType_ = s; + break; + } + case 72: + { + int rawValue = input.readEnum(); + + effectiveSeverity_ = rawValue; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -796,71 +1618,163 @@ public com.google.protobuf.ByteString getFixedPackageBytes() { } } - public static final int FIXED_VERSION_FIELD_NUMBER = 6; - private io.grafeas.v1.Version fixedVersion_; + public static final int FIXED_VERSION_FIELD_NUMBER = 6; + private io.grafeas.v1.Version fixedVersion_; + /** + * + * + *
+     * Required. The version of the package this vulnerability was fixed in.
+     * Setting this to VersionKind.MAXIMUM means no fix is yet available.
+     * 
+ * + * .grafeas.v1.Version fixed_version = 6; + * + * @return Whether the fixedVersion field is set. + */ + @java.lang.Override + public boolean hasFixedVersion() { + return fixedVersion_ != null; + } + /** + * + * + *
+     * Required. The version of the package this vulnerability was fixed in.
+     * Setting this to VersionKind.MAXIMUM means no fix is yet available.
+     * 
+ * + * .grafeas.v1.Version fixed_version = 6; + * + * @return The fixedVersion. + */ + @java.lang.Override + public io.grafeas.v1.Version getFixedVersion() { + return fixedVersion_ == null ? io.grafeas.v1.Version.getDefaultInstance() : fixedVersion_; + } + /** + * + * + *
+     * Required. The version of the package this vulnerability was fixed in.
+     * Setting this to VersionKind.MAXIMUM means no fix is yet available.
+     * 
+ * + * .grafeas.v1.Version fixed_version = 6; + */ + @java.lang.Override + public io.grafeas.v1.VersionOrBuilder getFixedVersionOrBuilder() { + return getFixedVersion(); + } + + public static final int FIX_AVAILABLE_FIELD_NUMBER = 7; + private boolean fixAvailable_; + /** + * + * + *
+     * Output only. Whether a fix is available for this package.
+     * 
+ * + * bool fix_available = 7; + * + * @return The fixAvailable. + */ + @java.lang.Override + public boolean getFixAvailable() { + return fixAvailable_; + } + + public static final int PACKAGE_TYPE_FIELD_NUMBER = 8; + private volatile java.lang.Object packageType_; /** * * *
-     * Required. The version of the package this vulnerability was fixed in.
-     * Setting this to VersionKind.MAXIMUM means no fix is yet available.
+     * The type of package (e.g. OS, MAVEN, GO).
      * 
* - * .grafeas.v1.Version fixed_version = 6; + * string package_type = 8; * - * @return Whether the fixedVersion field is set. + * @return The packageType. */ @java.lang.Override - public boolean hasFixedVersion() { - return fixedVersion_ != null; + public java.lang.String getPackageType() { + java.lang.Object ref = packageType_; + 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(); + packageType_ = s; + return s; + } } /** * * *
-     * Required. The version of the package this vulnerability was fixed in.
-     * Setting this to VersionKind.MAXIMUM means no fix is yet available.
+     * The type of package (e.g. OS, MAVEN, GO).
      * 
* - * .grafeas.v1.Version fixed_version = 6; + * string package_type = 8; * - * @return The fixedVersion. + * @return The bytes for packageType. */ @java.lang.Override - public io.grafeas.v1.Version getFixedVersion() { - return fixedVersion_ == null ? io.grafeas.v1.Version.getDefaultInstance() : fixedVersion_; + public com.google.protobuf.ByteString getPackageTypeBytes() { + java.lang.Object ref = packageType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + packageType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } + + public static final int EFFECTIVE_SEVERITY_FIELD_NUMBER = 9; + private int effectiveSeverity_; /** * * *
-     * Required. The version of the package this vulnerability was fixed in.
-     * Setting this to VersionKind.MAXIMUM means no fix is yet available.
+     * The distro or language system assigned severity for this vulnerability
+     * when that is available and note provider assigned severity when it is not
+     * available.
      * 
* - * .grafeas.v1.Version fixed_version = 6; + * + * .grafeas.v1.Severity effective_severity = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for effectiveSeverity. */ @java.lang.Override - public io.grafeas.v1.VersionOrBuilder getFixedVersionOrBuilder() { - return getFixedVersion(); + public int getEffectiveSeverityValue() { + return effectiveSeverity_; } - - public static final int FIX_AVAILABLE_FIELD_NUMBER = 7; - private boolean fixAvailable_; /** * * *
-     * Output only. Whether a fix is available for this package.
+     * The distro or language system assigned severity for this vulnerability
+     * when that is available and note provider assigned severity when it is not
+     * available.
      * 
* - * bool fix_available = 7; + * + * .grafeas.v1.Severity effective_severity = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @return The fixAvailable. + * @return The effectiveSeverity. */ @java.lang.Override - public boolean getFixAvailable() { - return fixAvailable_; + public io.grafeas.v1.Severity getEffectiveSeverity() { + @SuppressWarnings("deprecation") + io.grafeas.v1.Severity result = io.grafeas.v1.Severity.valueOf(effectiveSeverity_); + return result == null ? io.grafeas.v1.Severity.UNRECOGNIZED : result; } private byte memoizedIsInitialized = -1; @@ -898,6 +1812,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (fixAvailable_ != false) { output.writeBool(7, fixAvailable_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(packageType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, packageType_); + } + if (effectiveSeverity_ != io.grafeas.v1.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + output.writeEnum(9, effectiveSeverity_); + } unknownFields.writeTo(output); } @@ -928,6 +1848,12 @@ public int getSerializedSize() { if (fixAvailable_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, fixAvailable_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(packageType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, packageType_); + } + if (effectiveSeverity_ != io.grafeas.v1.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, effectiveSeverity_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -957,6 +1883,8 @@ public boolean equals(final java.lang.Object obj) { if (!getFixedVersion().equals(other.getFixedVersion())) return false; } if (getFixAvailable() != other.getFixAvailable()) return false; + if (!getPackageType().equals(other.getPackageType())) return false; + if (effectiveSeverity_ != other.effectiveSeverity_) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -986,6 +1914,10 @@ public int hashCode() { } hash = (37 * hash) + FIX_AVAILABLE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFixAvailable()); + hash = (37 * hash) + PACKAGE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getPackageType().hashCode(); + hash = (37 * hash) + EFFECTIVE_SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + effectiveSeverity_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -1156,6 +2088,10 @@ public Builder clear() { } fixAvailable_ = false; + packageType_ = ""; + + effectiveSeverity_ = 0; + return this; } @@ -1198,6 +2134,8 @@ public io.grafeas.v1.VulnerabilityOccurrence.PackageIssue buildPartial() { result.fixedVersion_ = fixedVersionBuilder_.build(); } result.fixAvailable_ = fixAvailable_; + result.packageType_ = packageType_; + result.effectiveSeverity_ = effectiveSeverity_; onBuilt(); return result; } @@ -1275,6 +2213,13 @@ public Builder mergeFrom(io.grafeas.v1.VulnerabilityOccurrence.PackageIssue othe if (other.getFixAvailable() != false) { setFixAvailable(other.getFixAvailable()); } + if (!other.getPackageType().isEmpty()) { + packageType_ = other.packageType_; + onChanged(); + } + if (other.effectiveSeverity_ != 0) { + setEffectiveSeverityValue(other.getEffectiveSeverityValue()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -2006,152 +2951,364 @@ public Builder setFixedVersion(io.grafeas.v1.Version value) { * Setting this to VersionKind.MAXIMUM means no fix is yet available. *
* - * .grafeas.v1.Version fixed_version = 6; + * .grafeas.v1.Version fixed_version = 6; + */ + public Builder setFixedVersion(io.grafeas.v1.Version.Builder builderForValue) { + if (fixedVersionBuilder_ == null) { + fixedVersion_ = builderForValue.build(); + onChanged(); + } else { + fixedVersionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Required. The version of the package this vulnerability was fixed in.
+       * Setting this to VersionKind.MAXIMUM means no fix is yet available.
+       * 
+ * + * .grafeas.v1.Version fixed_version = 6; + */ + public Builder mergeFixedVersion(io.grafeas.v1.Version value) { + if (fixedVersionBuilder_ == null) { + if (fixedVersion_ != null) { + fixedVersion_ = + io.grafeas.v1.Version.newBuilder(fixedVersion_).mergeFrom(value).buildPartial(); + } else { + fixedVersion_ = value; + } + onChanged(); + } else { + fixedVersionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Required. The version of the package this vulnerability was fixed in.
+       * Setting this to VersionKind.MAXIMUM means no fix is yet available.
+       * 
+ * + * .grafeas.v1.Version fixed_version = 6; + */ + public Builder clearFixedVersion() { + if (fixedVersionBuilder_ == null) { + fixedVersion_ = null; + onChanged(); + } else { + fixedVersion_ = null; + fixedVersionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Required. The version of the package this vulnerability was fixed in.
+       * Setting this to VersionKind.MAXIMUM means no fix is yet available.
+       * 
+ * + * .grafeas.v1.Version fixed_version = 6; + */ + public io.grafeas.v1.Version.Builder getFixedVersionBuilder() { + + onChanged(); + return getFixedVersionFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. The version of the package this vulnerability was fixed in.
+       * Setting this to VersionKind.MAXIMUM means no fix is yet available.
+       * 
+ * + * .grafeas.v1.Version fixed_version = 6; + */ + public io.grafeas.v1.VersionOrBuilder getFixedVersionOrBuilder() { + if (fixedVersionBuilder_ != null) { + return fixedVersionBuilder_.getMessageOrBuilder(); + } else { + return fixedVersion_ == null ? io.grafeas.v1.Version.getDefaultInstance() : fixedVersion_; + } + } + /** + * + * + *
+       * Required. The version of the package this vulnerability was fixed in.
+       * Setting this to VersionKind.MAXIMUM means no fix is yet available.
+       * 
+ * + * .grafeas.v1.Version fixed_version = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.Version, io.grafeas.v1.Version.Builder, io.grafeas.v1.VersionOrBuilder> + getFixedVersionFieldBuilder() { + if (fixedVersionBuilder_ == null) { + fixedVersionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.Version, + io.grafeas.v1.Version.Builder, + io.grafeas.v1.VersionOrBuilder>( + getFixedVersion(), getParentForChildren(), isClean()); + fixedVersion_ = null; + } + return fixedVersionBuilder_; + } + + private boolean fixAvailable_; + /** + * + * + *
+       * Output only. Whether a fix is available for this package.
+       * 
+ * + * bool fix_available = 7; + * + * @return The fixAvailable. + */ + @java.lang.Override + public boolean getFixAvailable() { + return fixAvailable_; + } + /** + * + * + *
+       * Output only. Whether a fix is available for this package.
+       * 
+ * + * bool fix_available = 7; + * + * @param value The fixAvailable to set. + * @return This builder for chaining. + */ + public Builder setFixAvailable(boolean value) { + + fixAvailable_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Whether a fix is available for this package.
+       * 
+ * + * bool fix_available = 7; + * + * @return This builder for chaining. + */ + public Builder clearFixAvailable() { + + fixAvailable_ = false; + onChanged(); + return this; + } + + private java.lang.Object packageType_ = ""; + /** + * + * + *
+       * The type of package (e.g. OS, MAVEN, GO).
+       * 
+ * + * string package_type = 8; + * + * @return The packageType. + */ + public java.lang.String getPackageType() { + java.lang.Object ref = packageType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + packageType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The type of package (e.g. OS, MAVEN, GO).
+       * 
+ * + * string package_type = 8; + * + * @return The bytes for packageType. */ - public Builder setFixedVersion(io.grafeas.v1.Version.Builder builderForValue) { - if (fixedVersionBuilder_ == null) { - fixedVersion_ = builderForValue.build(); - onChanged(); + public com.google.protobuf.ByteString getPackageTypeBytes() { + java.lang.Object ref = packageType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + packageType_ = b; + return b; } else { - fixedVersionBuilder_.setMessage(builderForValue.build()); + return (com.google.protobuf.ByteString) ref; } - - return this; } /** * * *
-       * Required. The version of the package this vulnerability was fixed in.
-       * Setting this to VersionKind.MAXIMUM means no fix is yet available.
+       * The type of package (e.g. OS, MAVEN, GO).
        * 
* - * .grafeas.v1.Version fixed_version = 6; + * string package_type = 8; + * + * @param value The packageType to set. + * @return This builder for chaining. */ - public Builder mergeFixedVersion(io.grafeas.v1.Version value) { - if (fixedVersionBuilder_ == null) { - if (fixedVersion_ != null) { - fixedVersion_ = - io.grafeas.v1.Version.newBuilder(fixedVersion_).mergeFrom(value).buildPartial(); - } else { - fixedVersion_ = value; - } - onChanged(); - } else { - fixedVersionBuilder_.mergeFrom(value); + public Builder setPackageType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } + packageType_ = value; + onChanged(); return this; } /** * * *
-       * Required. The version of the package this vulnerability was fixed in.
-       * Setting this to VersionKind.MAXIMUM means no fix is yet available.
+       * The type of package (e.g. OS, MAVEN, GO).
        * 
* - * .grafeas.v1.Version fixed_version = 6; + * string package_type = 8; + * + * @return This builder for chaining. */ - public Builder clearFixedVersion() { - if (fixedVersionBuilder_ == null) { - fixedVersion_ = null; - onChanged(); - } else { - fixedVersion_ = null; - fixedVersionBuilder_ = null; - } + public Builder clearPackageType() { + packageType_ = getDefaultInstance().getPackageType(); + onChanged(); return this; } /** * * *
-       * Required. The version of the package this vulnerability was fixed in.
-       * Setting this to VersionKind.MAXIMUM means no fix is yet available.
+       * The type of package (e.g. OS, MAVEN, GO).
        * 
* - * .grafeas.v1.Version fixed_version = 6; + * string package_type = 8; + * + * @param value The bytes for packageType to set. + * @return This builder for chaining. */ - public io.grafeas.v1.Version.Builder getFixedVersionBuilder() { + public Builder setPackageTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + packageType_ = value; onChanged(); - return getFixedVersionFieldBuilder().getBuilder(); + return this; } + + private int effectiveSeverity_ = 0; /** * * *
-       * Required. The version of the package this vulnerability was fixed in.
-       * Setting this to VersionKind.MAXIMUM means no fix is yet available.
+       * The distro or language system assigned severity for this vulnerability
+       * when that is available and note provider assigned severity when it is not
+       * available.
        * 
* - * .grafeas.v1.Version fixed_version = 6; + * + * .grafeas.v1.Severity effective_severity = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for effectiveSeverity. */ - public io.grafeas.v1.VersionOrBuilder getFixedVersionOrBuilder() { - if (fixedVersionBuilder_ != null) { - return fixedVersionBuilder_.getMessageOrBuilder(); - } else { - return fixedVersion_ == null ? io.grafeas.v1.Version.getDefaultInstance() : fixedVersion_; - } + @java.lang.Override + public int getEffectiveSeverityValue() { + return effectiveSeverity_; } /** * * *
-       * Required. The version of the package this vulnerability was fixed in.
-       * Setting this to VersionKind.MAXIMUM means no fix is yet available.
+       * The distro or language system assigned severity for this vulnerability
+       * when that is available and note provider assigned severity when it is not
+       * available.
        * 
* - * .grafeas.v1.Version fixed_version = 6; + * + * .grafeas.v1.Severity effective_severity = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for effectiveSeverity to set. + * @return This builder for chaining. */ - private com.google.protobuf.SingleFieldBuilderV3< - io.grafeas.v1.Version, io.grafeas.v1.Version.Builder, io.grafeas.v1.VersionOrBuilder> - getFixedVersionFieldBuilder() { - if (fixedVersionBuilder_ == null) { - fixedVersionBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - io.grafeas.v1.Version, - io.grafeas.v1.Version.Builder, - io.grafeas.v1.VersionOrBuilder>( - getFixedVersion(), getParentForChildren(), isClean()); - fixedVersion_ = null; - } - return fixedVersionBuilder_; - } + public Builder setEffectiveSeverityValue(int value) { - private boolean fixAvailable_; + effectiveSeverity_ = value; + onChanged(); + return this; + } /** * * *
-       * Output only. Whether a fix is available for this package.
+       * The distro or language system assigned severity for this vulnerability
+       * when that is available and note provider assigned severity when it is not
+       * available.
        * 
* - * bool fix_available = 7; + * + * .grafeas.v1.Severity effective_severity = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @return The fixAvailable. + * @return The effectiveSeverity. */ @java.lang.Override - public boolean getFixAvailable() { - return fixAvailable_; + public io.grafeas.v1.Severity getEffectiveSeverity() { + @SuppressWarnings("deprecation") + io.grafeas.v1.Severity result = io.grafeas.v1.Severity.valueOf(effectiveSeverity_); + return result == null ? io.grafeas.v1.Severity.UNRECOGNIZED : result; } /** * * *
-       * Output only. Whether a fix is available for this package.
+       * The distro or language system assigned severity for this vulnerability
+       * when that is available and note provider assigned severity when it is not
+       * available.
        * 
* - * bool fix_available = 7; + * + * .grafeas.v1.Severity effective_severity = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @param value The fixAvailable to set. + * @param value The effectiveSeverity to set. * @return This builder for chaining. */ - public Builder setFixAvailable(boolean value) { + public Builder setEffectiveSeverity(io.grafeas.v1.Severity value) { + if (value == null) { + throw new NullPointerException(); + } - fixAvailable_ = value; + effectiveSeverity_ = value.getNumber(); onChanged(); return this; } @@ -2159,16 +3316,20 @@ public Builder setFixAvailable(boolean value) { * * *
-       * Output only. Whether a fix is available for this package.
+       * The distro or language system assigned severity for this vulnerability
+       * when that is available and note provider assigned severity when it is not
+       * available.
        * 
* - * bool fix_available = 7; + * + * .grafeas.v1.Severity effective_severity = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return This builder for chaining. */ - public Builder clearFixAvailable() { + public Builder clearEffectiveSeverity() { - fixAvailable_ = false; + effectiveSeverity_ = 0; onChanged(); return this; } @@ -2331,6 +3492,54 @@ public float getCvssScore() { return cvssScore_; } + public static final int CVSSV3_FIELD_NUMBER = 10; + private io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3_; + /** + * + * + *
+   * The cvss v3 score for the vulnerability.
+   * 
+ * + * .grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3 = 10; + * + * @return Whether the cvssv3 field is set. + */ + @java.lang.Override + public boolean hasCvssv3() { + return cvssv3_ != null; + } + /** + * + * + *
+   * The cvss v3 score for the vulnerability.
+   * 
+ * + * .grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3 = 10; + * + * @return The cvssv3. + */ + @java.lang.Override + public io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 getCvssv3() { + return cvssv3_ == null + ? io.grafeas.v1.VulnerabilityOccurrence.CVSSV3.getDefaultInstance() + : cvssv3_; + } + /** + * + * + *
+   * The cvss v3 score for the vulnerability.
+   * 
+ * + * .grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3 = 10; + */ + @java.lang.Override + public io.grafeas.v1.VulnerabilityOccurrence.CVSSV3OrBuilder getCvssv3OrBuilder() { + return getCvssv3(); + } + public static final int PACKAGE_ISSUE_FIELD_NUMBER = 4; private java.util.List packageIssue_; /** @@ -2580,6 +3789,13 @@ public io.grafeas.v1.RelatedUrlOrBuilder getRelatedUrlsOrBuilder(int index) { *
    * The distro assigned severity for this vulnerability when it is available,
    * otherwise this is the note provider assigned severity.
+   * When there are multiple PackageIssues for this vulnerability, they can have
+   * different effective severities because some might be provided by the distro
+   * while others are provided by the language ecosystem for a language pack.
+   * For this reason, it is advised to use the effective severity on the
+   * PackageIssue level. In the case where multiple PackageIssues have differing
+   * effective severities, this field should be the highest severity for any of
+   * the PackageIssues.
    * 
* * .grafeas.v1.Severity effective_severity = 8; @@ -2596,6 +3812,13 @@ public int getEffectiveSeverityValue() { *
    * The distro assigned severity for this vulnerability when it is available,
    * otherwise this is the note provider assigned severity.
+   * When there are multiple PackageIssues for this vulnerability, they can have
+   * different effective severities because some might be provided by the distro
+   * while others are provided by the language ecosystem for a language pack.
+   * For this reason, it is advised to use the effective severity on the
+   * PackageIssue level. In the case where multiple PackageIssues have differing
+   * effective severities, this field should be the highest severity for any of
+   * the PackageIssues.
    * 
* * .grafeas.v1.Severity effective_severity = 8; @@ -2669,6 +3892,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (fixAvailable_ != false) { output.writeBool(9, fixAvailable_); } + if (cvssv3_ != null) { + output.writeMessage(10, getCvssv3()); + } unknownFields.writeTo(output); } @@ -2705,6 +3931,9 @@ public int getSerializedSize() { if (fixAvailable_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, fixAvailable_); } + if (cvssv3_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getCvssv3()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -2724,6 +3953,10 @@ public boolean equals(final java.lang.Object obj) { if (severity_ != other.severity_) return false; if (java.lang.Float.floatToIntBits(getCvssScore()) != java.lang.Float.floatToIntBits(other.getCvssScore())) return false; + if (hasCvssv3() != other.hasCvssv3()) return false; + if (hasCvssv3()) { + if (!getCvssv3().equals(other.getCvssv3())) return false; + } if (!getPackageIssueList().equals(other.getPackageIssueList())) return false; if (!getShortDescription().equals(other.getShortDescription())) return false; if (!getLongDescription().equals(other.getLongDescription())) return false; @@ -2747,6 +3980,10 @@ public int hashCode() { hash = (53 * hash) + severity_; hash = (37 * hash) + CVSS_SCORE_FIELD_NUMBER; hash = (53 * hash) + java.lang.Float.floatToIntBits(getCvssScore()); + if (hasCvssv3()) { + hash = (37 * hash) + CVSSV3_FIELD_NUMBER; + hash = (53 * hash) + getCvssv3().hashCode(); + } if (getPackageIssueCount() > 0) { hash = (37 * hash) + PACKAGE_ISSUE_FIELD_NUMBER; hash = (53 * hash) + getPackageIssueList().hashCode(); @@ -2916,6 +4153,12 @@ public Builder clear() { cvssScore_ = 0F; + if (cvssv3Builder_ == null) { + cvssv3_ = null; + } else { + cvssv3_ = null; + cvssv3Builder_ = null; + } if (packageIssueBuilder_ == null) { packageIssue_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); @@ -2967,6 +4210,11 @@ public io.grafeas.v1.VulnerabilityOccurrence buildPartial() { result.type_ = type_; result.severity_ = severity_; result.cvssScore_ = cvssScore_; + if (cvssv3Builder_ == null) { + result.cvssv3_ = cvssv3_; + } else { + result.cvssv3_ = cvssv3Builder_.build(); + } if (packageIssueBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { packageIssue_ = java.util.Collections.unmodifiableList(packageIssue_); @@ -3048,6 +4296,9 @@ public Builder mergeFrom(io.grafeas.v1.VulnerabilityOccurrence other) { if (other.getCvssScore() != 0F) { setCvssScore(other.getCvssScore()); } + if (other.hasCvssv3()) { + mergeCvssv3(other.getCvssv3()); + } if (packageIssueBuilder_ == null) { if (!other.packageIssue_.isEmpty()) { if (packageIssue_.isEmpty()) { @@ -3406,6 +4657,192 @@ public Builder clearCvssScore() { return this; } + private io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3_; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3, + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3.Builder, + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3OrBuilder> + cvssv3Builder_; + /** + * + * + *
+     * The cvss v3 score for the vulnerability.
+     * 
+ * + * .grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3 = 10; + * + * @return Whether the cvssv3 field is set. + */ + public boolean hasCvssv3() { + return cvssv3Builder_ != null || cvssv3_ != null; + } + /** + * + * + *
+     * The cvss v3 score for the vulnerability.
+     * 
+ * + * .grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3 = 10; + * + * @return The cvssv3. + */ + public io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 getCvssv3() { + if (cvssv3Builder_ == null) { + return cvssv3_ == null + ? io.grafeas.v1.VulnerabilityOccurrence.CVSSV3.getDefaultInstance() + : cvssv3_; + } else { + return cvssv3Builder_.getMessage(); + } + } + /** + * + * + *
+     * The cvss v3 score for the vulnerability.
+     * 
+ * + * .grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3 = 10; + */ + public Builder setCvssv3(io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 value) { + if (cvssv3Builder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cvssv3_ = value; + onChanged(); + } else { + cvssv3Builder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The cvss v3 score for the vulnerability.
+     * 
+ * + * .grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3 = 10; + */ + public Builder setCvssv3(io.grafeas.v1.VulnerabilityOccurrence.CVSSV3.Builder builderForValue) { + if (cvssv3Builder_ == null) { + cvssv3_ = builderForValue.build(); + onChanged(); + } else { + cvssv3Builder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The cvss v3 score for the vulnerability.
+     * 
+ * + * .grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3 = 10; + */ + public Builder mergeCvssv3(io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 value) { + if (cvssv3Builder_ == null) { + if (cvssv3_ != null) { + cvssv3_ = + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 + .newBuilder(cvssv3_) + .mergeFrom(value) + .buildPartial(); + } else { + cvssv3_ = value; + } + onChanged(); + } else { + cvssv3Builder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The cvss v3 score for the vulnerability.
+     * 
+ * + * .grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3 = 10; + */ + public Builder clearCvssv3() { + if (cvssv3Builder_ == null) { + cvssv3_ = null; + onChanged(); + } else { + cvssv3_ = null; + cvssv3Builder_ = null; + } + + return this; + } + /** + * + * + *
+     * The cvss v3 score for the vulnerability.
+     * 
+ * + * .grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3 = 10; + */ + public io.grafeas.v1.VulnerabilityOccurrence.CVSSV3.Builder getCvssv3Builder() { + + onChanged(); + return getCvssv3FieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The cvss v3 score for the vulnerability.
+     * 
+ * + * .grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3 = 10; + */ + public io.grafeas.v1.VulnerabilityOccurrence.CVSSV3OrBuilder getCvssv3OrBuilder() { + if (cvssv3Builder_ != null) { + return cvssv3Builder_.getMessageOrBuilder(); + } else { + return cvssv3_ == null + ? io.grafeas.v1.VulnerabilityOccurrence.CVSSV3.getDefaultInstance() + : cvssv3_; + } + } + /** + * + * + *
+     * The cvss v3 score for the vulnerability.
+     * 
+ * + * .grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3 = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3, + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3.Builder, + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3OrBuilder> + getCvssv3FieldBuilder() { + if (cvssv3Builder_ == null) { + cvssv3Builder_ = + new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3, + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3.Builder, + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3OrBuilder>( + getCvssv3(), getParentForChildren(), isClean()); + cvssv3_ = null; + } + return cvssv3Builder_; + } + private java.util.List packageIssue_ = java.util.Collections.emptyList(); @@ -4347,6 +5784,13 @@ public java.util.List getRelatedUrlsBuilderLis *
      * The distro assigned severity for this vulnerability when it is available,
      * otherwise this is the note provider assigned severity.
+     * When there are multiple PackageIssues for this vulnerability, they can have
+     * different effective severities because some might be provided by the distro
+     * while others are provided by the language ecosystem for a language pack.
+     * For this reason, it is advised to use the effective severity on the
+     * PackageIssue level. In the case where multiple PackageIssues have differing
+     * effective severities, this field should be the highest severity for any of
+     * the PackageIssues.
      * 
* * .grafeas.v1.Severity effective_severity = 8; @@ -4363,6 +5807,13 @@ public int getEffectiveSeverityValue() { *
      * The distro assigned severity for this vulnerability when it is available,
      * otherwise this is the note provider assigned severity.
+     * When there are multiple PackageIssues for this vulnerability, they can have
+     * different effective severities because some might be provided by the distro
+     * while others are provided by the language ecosystem for a language pack.
+     * For this reason, it is advised to use the effective severity on the
+     * PackageIssue level. In the case where multiple PackageIssues have differing
+     * effective severities, this field should be the highest severity for any of
+     * the PackageIssues.
      * 
* * .grafeas.v1.Severity effective_severity = 8; @@ -4382,6 +5833,13 @@ public Builder setEffectiveSeverityValue(int value) { *
      * The distro assigned severity for this vulnerability when it is available,
      * otherwise this is the note provider assigned severity.
+     * When there are multiple PackageIssues for this vulnerability, they can have
+     * different effective severities because some might be provided by the distro
+     * while others are provided by the language ecosystem for a language pack.
+     * For this reason, it is advised to use the effective severity on the
+     * PackageIssue level. In the case where multiple PackageIssues have differing
+     * effective severities, this field should be the highest severity for any of
+     * the PackageIssues.
      * 
* * .grafeas.v1.Severity effective_severity = 8; @@ -4400,6 +5858,13 @@ public io.grafeas.v1.Severity getEffectiveSeverity() { *
      * The distro assigned severity for this vulnerability when it is available,
      * otherwise this is the note provider assigned severity.
+     * When there are multiple PackageIssues for this vulnerability, they can have
+     * different effective severities because some might be provided by the distro
+     * while others are provided by the language ecosystem for a language pack.
+     * For this reason, it is advised to use the effective severity on the
+     * PackageIssue level. In the case where multiple PackageIssues have differing
+     * effective severities, this field should be the highest severity for any of
+     * the PackageIssues.
      * 
* * .grafeas.v1.Severity effective_severity = 8; @@ -4422,6 +5887,13 @@ public Builder setEffectiveSeverity(io.grafeas.v1.Severity value) { *
      * The distro assigned severity for this vulnerability when it is available,
      * otherwise this is the note provider assigned severity.
+     * When there are multiple PackageIssues for this vulnerability, they can have
+     * different effective severities because some might be provided by the distro
+     * while others are provided by the language ecosystem for a language pack.
+     * For this reason, it is advised to use the effective severity on the
+     * PackageIssue level. In the case where multiple PackageIssues have differing
+     * effective severities, this field should be the highest severity for any of
+     * the PackageIssues.
      * 
* * .grafeas.v1.Severity effective_severity = 8; diff --git a/src/main/java/io/grafeas/v1/VulnerabilityOccurrenceOrBuilder.java b/src/main/java/io/grafeas/v1/VulnerabilityOccurrenceOrBuilder.java index 95735c3f..c2631955 100644 --- a/src/main/java/io/grafeas/v1/VulnerabilityOccurrenceOrBuilder.java +++ b/src/main/java/io/grafeas/v1/VulnerabilityOccurrenceOrBuilder.java @@ -91,6 +91,41 @@ public interface VulnerabilityOccurrenceOrBuilder */ float getCvssScore(); + /** + * + * + *
+   * The cvss v3 score for the vulnerability.
+   * 
+ * + * .grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3 = 10; + * + * @return Whether the cvssv3 field is set. + */ + boolean hasCvssv3(); + /** + * + * + *
+   * The cvss v3 score for the vulnerability.
+   * 
+ * + * .grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3 = 10; + * + * @return The cvssv3. + */ + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3 getCvssv3(); + /** + * + * + *
+   * The cvss v3 score for the vulnerability.
+   * 
+ * + * .grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3 = 10; + */ + io.grafeas.v1.VulnerabilityOccurrence.CVSSV3OrBuilder getCvssv3OrBuilder(); + /** * * @@ -255,6 +290,13 @@ public interface VulnerabilityOccurrenceOrBuilder *
    * The distro assigned severity for this vulnerability when it is available,
    * otherwise this is the note provider assigned severity.
+   * When there are multiple PackageIssues for this vulnerability, they can have
+   * different effective severities because some might be provided by the distro
+   * while others are provided by the language ecosystem for a language pack.
+   * For this reason, it is advised to use the effective severity on the
+   * PackageIssue level. In the case where multiple PackageIssues have differing
+   * effective severities, this field should be the highest severity for any of
+   * the PackageIssues.
    * 
* * .grafeas.v1.Severity effective_severity = 8; @@ -268,6 +310,13 @@ public interface VulnerabilityOccurrenceOrBuilder *
    * The distro assigned severity for this vulnerability when it is available,
    * otherwise this is the note provider assigned severity.
+   * When there are multiple PackageIssues for this vulnerability, they can have
+   * different effective severities because some might be provided by the distro
+   * while others are provided by the language ecosystem for a language pack.
+   * For this reason, it is advised to use the effective severity on the
+   * PackageIssue level. In the case where multiple PackageIssues have differing
+   * effective severities, this field should be the highest severity for any of
+   * the PackageIssues.
    * 
* * .grafeas.v1.Severity effective_severity = 8; diff --git a/src/main/java/io/grafeas/v1/package-info.java b/src/main/java/io/grafeas/v1/package-info.java index 11e1aea6..f2393982 100644 --- a/src/main/java/io/grafeas/v1/package-info.java +++ b/src/main/java/io/grafeas/v1/package-info.java @@ -15,7 +15,9 @@ */ /** - * The interfaces provided are listed below, along with usage samples. + * A client to Container Analysis API + * + *

The interfaces provided are listed below, along with usage samples. * *

======================= GrafeasClient ======================= * diff --git a/src/main/proto/grafeas/v1/attestation.proto b/src/main/proto/grafeas/v1/attestation.proto index 61423d3e..f2854fe6 100644 --- a/src/main/proto/grafeas/v1/attestation.proto +++ b/src/main/proto/grafeas/v1/attestation.proto @@ -53,6 +53,13 @@ message AttestationNote { Hint hint = 1; } +message Jwt { + // The compact encoding of a JWS, which is always three base64 encoded strings + // joined by periods. For details, see: + // https://tools.ietf.org/html/rfc7515.html#section-3.1 + string compact_jwt = 1; +} + // Occurrence that represents a single "attestation". The authenticity of an // attestation can be verified using the attached signature. If the verifier // trusts the public key of the signer, then verifying the signature is @@ -70,4 +77,14 @@ message AttestationOccurrence { // `signature` verifies `serialized_payload`. See `Signature` in common.proto // for more details on signature structure and verification. repeated Signature signatures = 2; + // One or more JWTs encoding a self-contained attestation. + // Each JWT encodes the payload that it verifies within the JWT itself. + // Verifier implementation SHOULD ignore the `serialized_payload` field + // when verifying these JWTs. + // If only JWTs are present on this AttestationOccurrence, then the + // `serialized_payload` SHOULD be left empty. + // Each JWT SHOULD encode a claim specific to the `resource_uri` of this + // Occurrence, but this is not validated by Grafeas metadata API + // implementations. The JWT itself is opaque to Grafeas. + repeated Jwt jwts = 3; } diff --git a/src/main/proto/grafeas/v1/build.proto b/src/main/proto/grafeas/v1/build.proto index c0e9c756..172637fd 100644 --- a/src/main/proto/grafeas/v1/build.proto +++ b/src/main/proto/grafeas/v1/build.proto @@ -16,6 +16,8 @@ syntax = "proto3"; package grafeas.v1; +import "grafeas/v1/intoto_provenance.proto"; +import "grafeas/v1/intoto_statement.proto"; import "grafeas/v1/provenance.proto"; option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; @@ -32,7 +34,7 @@ message BuildNote { // Details of a build occurrence. message BuildOccurrence { - // Required. The actual provenance for the build. + // The actual provenance for the build. grafeas.v1.BuildProvenance provenance = 1; // Serialized JSON representation of the provenance, used in generating the @@ -47,4 +49,14 @@ message BuildOccurrence { // provenance is marshalled to json as well to prevent incompatibilities with // future changes. string provenance_bytes = 2; + + // Deprecated. See InTotoStatement for the replacement. + // In-toto Provenance representation as defined in spec. + InTotoProvenance intoto_provenance = 3; + + // In-toto Statement representation as defined in spec. + // The intoto_statement can contain any type of provenance. The serialized + // payload of the statement can be stored and signed in the Occurrence's + // envelope. + InTotoStatement intoto_statement = 4; } diff --git a/src/main/proto/grafeas/v1/common.proto b/src/main/proto/grafeas/v1/common.proto index db780bb6..29a66632 100644 --- a/src/main/proto/grafeas/v1/common.proto +++ b/src/main/proto/grafeas/v1/common.proto @@ -23,7 +23,7 @@ option objc_class_prefix = "GRA"; // Kind represents the kinds of notes supported. enum NoteKind { - // Unknown. + // Default value. This value is unused. NOTE_KIND_UNSPECIFIED = 0; // The note and occurrence represent a package vulnerability. VULNERABILITY = 1; @@ -41,6 +41,10 @@ enum NoteKind { ATTESTATION = 7; // This represents an available package upgrade. UPGRADE = 8; + // This represents a Compliance Note + COMPLIANCE = 9; + // This represents a DSSE attestation Note + DSSE_ATTESTATION = 10; } // Metadata for any related URL information. @@ -84,7 +88,7 @@ message Signature { // The identifier for the public key that verifies this signature. // * The `public_key_id` is required. - // * The `public_key_id` MUST be an RFC3986 conformant URI. + // * The `public_key_id` SHOULD be an RFC3986 conformant URI. // * When possible, the `public_key_id` SHOULD be an immutable reference, // such as a cryptographic digest. // @@ -101,3 +105,17 @@ message Signature { // * "nih:///sha-256;703f68f42aba2c6de30f488a5ea122fef76324679c9bf89791ba95a1271589a5" string public_key_id = 2; } + +// MUST match +// https://github.com/secure-systems-lab/dsse/blob/master/envelope.proto. An +// authenticated message of arbitrary type. +message Envelope { + bytes payload = 1; + string payload_type = 2; + repeated EnvelopeSignature signatures = 3; +} + +message EnvelopeSignature { + bytes sig = 1; + string keyid = 2; +} diff --git a/src/main/proto/grafeas/v1/compliance.proto b/src/main/proto/grafeas/v1/compliance.proto new file mode 100644 index 00000000..1d41db2c --- /dev/null +++ b/src/main/proto/grafeas/v1/compliance.proto @@ -0,0 +1,79 @@ +// Copyright 2021 The Grafeas Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package grafeas.v1; + +import "grafeas/v1/vulnerability.proto"; + +option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1"; +option objc_class_prefix = "GRA"; + +message ComplianceNote { + // The title that identifies this compliance check. + string title = 1; + // A description about this compliance check. + string description = 2; + // The OS and config versions the benchmark applies to. + repeated grafeas.v1.ComplianceVersion version = 3; + // A rationale for the existence of this compliance check. + string rationale = 4; + // A description of remediation steps if the compliance check fails. + string remediation = 5; + // A compliance check that is a CIS benchmark. + message CisBenchmark { + int32 profile_level = 1; + grafeas.v1.Severity severity = 2; + } + oneof compliance_type { + CisBenchmark cis_benchmark = 6; + } + // Serialized scan instructions with a predefined format. + bytes scan_instructions = 7; +} + +// Describes the CIS benchmark version that is applicable to a given OS and +// os version. +message ComplianceVersion { + // The CPE URI (https://cpe.mitre.org/specification/) this benchmark is + // applicable to. + string cpe_uri = 1; + // The version of the benchmark. This is set to the version of the OS-specific + // CIS document the benchmark is defined in. + string version = 2; +} + +// An indication that the compliance checks in the associated ComplianceNote +// were not satisfied for particular resources or a specified reason. +message ComplianceOccurrence { + repeated NonCompliantFile non_compliant_files = 2; + string non_compliance_reason = 3; +} + +// Details about files that caused a compliance check to fail. +message NonCompliantFile { + // display_command is a single command that can be used to display a list of + // non compliant files. When there is no such command, we can also iterate a + // list of non compliant file using 'path'. + + // Empty if `display_command` is set. + string path = 1; + // Command to display the non-compliant files. + string display_command = 2; + // Explains why a file is non compliant for a CIS check. + string reason = 3; +} diff --git a/src/main/proto/grafeas/v1/dsse_attestation.proto b/src/main/proto/grafeas/v1/dsse_attestation.proto new file mode 100644 index 00000000..0264ab99 --- /dev/null +++ b/src/main/proto/grafeas/v1/dsse_attestation.proto @@ -0,0 +1,52 @@ +// Copyright 2021 The Grafeas Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +syntax = "proto3"; + +package grafeas.v1; + +import "grafeas/v1/common.proto"; +import "grafeas/v1/intoto_statement.proto"; + +option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1"; +option objc_class_prefix = "GRA"; + +message DSSEAttestationNote { + // This submessage provides human-readable hints about the purpose of the + // authority. Because the name of a note acts as its resource reference, it is + // important to disambiguate the canonical name of the Note (which might be a + // UUID for security purposes) from "readable" names more suitable for debug + // output. Note that these hints should not be used to look up authorities in + // security sensitive contexts, such as when looking up attestations to + // verify. + message DSSEHint { + // Required. The human readable name of this attestation authority, for + // example "cloudbuild-prod". + string human_readable_name = 1; + } + // DSSEHint hints at the purpose of the attestation authority. + DSSEHint hint = 1; +} + +// Deprecated. Prefer to use a regular Occurrence, and populate the +// Envelope at the top level of the Occurrence. +message DSSEAttestationOccurrence { + // If doing something security critical, make sure to verify the signatures in + // this metadata. + Envelope envelope = 1; + oneof decoded_payload { + InTotoStatement statement = 2; + } +} \ No newline at end of file diff --git a/src/main/proto/grafeas/v1/grafeas.proto b/src/main/proto/grafeas/v1/grafeas.proto index 57b2fc23..5665fe36 100644 --- a/src/main/proto/grafeas/v1/grafeas.proto +++ b/src/main/proto/grafeas/v1/grafeas.proto @@ -26,8 +26,10 @@ import "google/protobuf/timestamp.proto"; import "grafeas/v1/attestation.proto"; import "grafeas/v1/build.proto"; import "grafeas/v1/common.proto"; +import "grafeas/v1/compliance.proto"; import "grafeas/v1/deployment.proto"; import "grafeas/v1/discovery.proto"; +import "grafeas/v1/dsse_attestation.proto"; import "grafeas/v1/image.proto"; import "grafeas/v1/package.proto"; import "grafeas/v1/upgrade.proto"; @@ -242,7 +244,14 @@ message Occurrence { grafeas.v1.AttestationOccurrence attestation = 14; // Describes an available package upgrade on the linked resource. grafeas.v1.UpgradeOccurrence upgrade = 15; + // Describes a compliance violation on a linked resource. + grafeas.v1.ComplianceOccurrence compliance = 16; + // Describes an attestation of an artifact using dsse. + grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17; } + + // https://github.com/secure-systems-lab/dsse + grafeas.v1.Envelope envelope = 18; } // A type of analysis that can be done for a resource. @@ -301,6 +310,10 @@ message Note { grafeas.v1.AttestationNote attestation = 16; // A note describing available package upgrades. grafeas.v1.UpgradeNote upgrade = 17; + // A note describing a compliance check. + grafeas.v1.ComplianceNote compliance = 18; + // A note describing a dsse attestation note. + grafeas.v1.DSSEAttestationNote dsse_attestation = 19; } } diff --git a/src/main/proto/grafeas/v1/intoto_provenance.proto b/src/main/proto/grafeas/v1/intoto_provenance.proto new file mode 100644 index 00000000..78886b66 --- /dev/null +++ b/src/main/proto/grafeas/v1/intoto_provenance.proto @@ -0,0 +1,113 @@ +// Copyright 2021 The Grafeas Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package grafeas.v1; + +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1"; +option objc_class_prefix = "GRA"; +option java_outer_classname = "InTotoProvenanceProto"; + +// Spec defined at +// https://github.com/in-toto/attestation/blob/main/spec/predicates/provenance.md + +// Steps taken to build the artifact. +// For a TaskRun, typically each container corresponds to one step in the +// recipe. +message Recipe { + // URI indicating what type of recipe was performed. It determines the meaning + // of recipe.entryPoint, recipe.arguments, recipe.environment, and materials. + string type = 1; + // Index in materials containing the recipe steps that are not implied by + // recipe.type. For example, if the recipe type were "make", then this would + // point to the source containing the Makefile, not the make program itself. + // Set to -1 if the recipe doesn't come from a material, as zero is default + // unset value for int64. + int64 defined_in_material = 2; + // String identifying the entry point into the build. + // This is often a path to a configuration file and/or a target label within + // that file. The syntax and meaning are defined by recipe.type. For example, + // if the recipe type were "make", then this would reference the directory in + // which to run make as well as which target to use. + string entry_point = 3; + // Collection of all external inputs that influenced the build on top of + // recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe + // type were "make", then this might be the flags passed to make aside from + // the target, which is captured in recipe.entryPoint. Since the arguments + // field can greatly vary in structure, depending on the builder and recipe + // type, this is of form "Any". + repeated google.protobuf.Any arguments = 4; + // Any other builder-controlled inputs necessary for correctly evaluating the + // recipe. Usually only needed for reproducing the build but not evaluated as + // part of policy. Since the environment field can greatly vary in structure, + // depending on the builder and recipe type, this is of form "Any". + repeated google.protobuf.Any environment = 5; +} + +// Indicates that the builder claims certain fields in this message to be +// complete. +message Completeness { + // If true, the builder claims that recipe.arguments is complete, meaning that + // all external inputs are properly captured in the recipe. + bool arguments = 1; + // If true, the builder claims that recipe.environment is claimed to be + // complete. + bool environment = 2; + // If true, the builder claims that materials are complete, usually through + // some controls to prevent network access. Sometimes called "hermetic". + bool materials = 3; +} + +// Other properties of the build. +message Metadata { + // Identifies the particular build invocation, which can be useful for finding + // associated logs or other ad-hoc analysis. The value SHOULD be globally + // unique, per in-toto Provenance spec. + string build_invocation_id = 1; + // The timestamp of when the build started. + google.protobuf.Timestamp build_started_on = 2; + // The timestamp of when the build completed. + google.protobuf.Timestamp build_finished_on = 3; + // Indicates that the builder claims certain fields in this message to be + // complete. + Completeness completeness = 4; + // If true, the builder claims that running the recipe on materials will + // produce bit-for-bit identical output. + bool reproducible = 5; +} + +message BuilderConfig { + string id = 1; +} + +message InTotoProvenance { + BuilderConfig builder_config = 1; // required + // Identifies the configuration used for the build. + // When combined with materials, this SHOULD fully describe the build, + // such that re-running this recipe results in bit-for-bit identical output + // (if the build is reproducible). + Recipe recipe = 2; // required + Metadata metadata = 3; + // The collection of artifacts that influenced the build including sources, + // dependencies, build tools, base images, and so on. This is considered to be + // incomplete unless metadata.completeness.materials is true. Unset or null is + // equivalent to empty. + repeated string materials = 4; +} diff --git a/src/main/proto/grafeas/v1/intoto_statement.proto b/src/main/proto/grafeas/v1/intoto_statement.proto new file mode 100644 index 00000000..9e4067cb --- /dev/null +++ b/src/main/proto/grafeas/v1/intoto_statement.proto @@ -0,0 +1,50 @@ +// Copyright 2021 The Grafeas Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package grafeas.v1; + +import "grafeas/v1/intoto_provenance.proto"; +import "grafeas/v1/slsa_provenance.proto"; + +option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1"; +option objc_class_prefix = "GRA"; +option java_outer_classname = "InTotoStatementProto"; + +// Spec defined at +// https://github.com/in-toto/attestation/tree/main/spec#statement The +// serialized InTotoStatement will be stored as Envelope.payload. +// Envelope.payloadType is always "application/vnd.in-toto+json". +message InTotoStatement { + // Always `https://in-toto.io/Statement/v0.1`. + string type = 1 [json_name = "_type"]; + repeated Subject subject = 2; + // `https://slsa.dev/provenance/v0.1` for SlsaProvenance. + string predicate_type = 3; + oneof predicate { + InTotoProvenance provenance = 4; + SlsaProvenance slsa_provenance = 5; + } +} +message Subject { + string name = 1; + // `"": ""` + // Algorithms can be e.g. sha256, sha512 + // See + // https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet + map digest = 2; +} diff --git a/src/main/proto/grafeas/v1/package.proto b/src/main/proto/grafeas/v1/package.proto index b04686d9..078c88c7 100644 --- a/src/main/proto/grafeas/v1/package.proto +++ b/src/main/proto/grafeas/v1/package.proto @@ -102,6 +102,14 @@ message Version { // The iteration of the package build from the above version. string revision = 3; + // Whether this version is specifying part of an inclusive range. Grafeas + // does not have the capability to specify version ranges; instead we have + // fields that specify start version and end versions. At times this is + // insufficient - we also need to specify whether the version is included in + // the range or is excluded from the range. This boolean is expected to be set + // to true when the version is included in a range. + bool inclusive = 6; + // Whether this is an ordinary package version or a sentinel MIN/MAX version. enum VersionKind { // Unknown. @@ -112,7 +120,7 @@ message Version { MINIMUM = 2; // A special version representing positive infinity. MAXIMUM = 3; - }; + } // Required. Distinguishes between sentinel MIN/MAX versions and normal // versions. diff --git a/src/main/proto/grafeas/v1/slsa_provenance.proto b/src/main/proto/grafeas/v1/slsa_provenance.proto new file mode 100644 index 00000000..b585f0b7 --- /dev/null +++ b/src/main/proto/grafeas/v1/slsa_provenance.proto @@ -0,0 +1,114 @@ +// Copyright 2021 The Grafeas Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package grafeas.v1; + +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1"; +option objc_class_prefix = "GRA"; + +message SlsaProvenance { + // Steps taken to build the artifact. + // For a TaskRun, typically each container corresponds to one step in the + // recipe. + message SlsaRecipe { + // URI indicating what type of recipe was performed. It determines the + // meaning of recipe.entryPoint, recipe.arguments, recipe.environment, and + // materials. + string type = 1; + // Index in materials containing the recipe steps that are not implied by + // recipe.type. For example, if the recipe type were "make", then this would + // point to the source containing the Makefile, not the make program itself. + // Set to -1 if the recipe doesn't come from a material, as zero is default + // unset value for int64. + int64 defined_in_material = 2; + // String identifying the entry point into the build. + // This is often a path to a configuration file and/or a target label within + // that file. The syntax and meaning are defined by recipe.type. For + // example, if the recipe type were "make", then this would reference the + // directory in which to run make as well as which target to use. + string entry_point = 3; + // Collection of all external inputs that influenced the build on top of + // recipe.definedInMaterial and recipe.entryPoint. For example, if the + // recipe type were "make", then this might be the flags passed to make + // aside from the target, which is captured in recipe.entryPoint. Depending + // on the recipe Type, the structure may be different. + google.protobuf.Any arguments = 4; + // Any other builder-controlled inputs necessary for correctly evaluating + // the recipe. Usually only needed for reproducing the build but not + // evaluated as part of policy. Depending on the recipe Type, the structure + // may be different. + google.protobuf.Any environment = 5; + } + + // Indicates that the builder claims certain fields in this message to be + // complete. + message SlsaCompleteness { + // If true, the builder claims that recipe.arguments is complete, meaning + // that all external inputs are properly captured in the recipe. + bool arguments = 1; + // If true, the builder claims that recipe.environment is claimed to be + // complete. + bool environment = 2; + // If true, the builder claims that materials are complete, usually through + // some controls to prevent network access. Sometimes called "hermetic". + bool materials = 3; + } + + // Other properties of the build. + message SlsaMetadata { + // Identifies the particular build invocation, which can be useful for + // finding associated logs or other ad-hoc analysis. The value SHOULD be + // globally unique, per in-toto Provenance spec. + string build_invocation_id = 1; + // The timestamp of when the build started. + google.protobuf.Timestamp build_started_on = 2; + // The timestamp of when the build completed. + google.protobuf.Timestamp build_finished_on = 3; + // Indicates that the builder claims certain fields in this message to be + // complete. + SlsaCompleteness completeness = 4; + // If true, the builder claims that running the recipe on materials will + // produce bit-for-bit identical output. + bool reproducible = 5; + } + + message SlsaBuilder { + string id = 1; + } + + message Material { + string uri = 1; + map digest = 2; + } + + SlsaBuilder builder = 1; // required + // Identifies the configuration used for the build. + // When combined with materials, this SHOULD fully describe the build, + // such that re-running this recipe results in bit-for-bit identical output + // (if the build is reproducible). + SlsaRecipe recipe = 2; // required + SlsaMetadata metadata = 3; + // The collection of artifacts that influenced the build including sources, + // dependencies, build tools, base images, and so on. This is considered to be + // incomplete unless metadata.completeness.materials is true. Unset or null is + // equivalent to empty. + repeated Material materials = 4; +} \ No newline at end of file diff --git a/src/main/proto/grafeas/v1/vulnerability.proto b/src/main/proto/grafeas/v1/vulnerability.proto index 6c94cdf0..476d3202 100644 --- a/src/main/proto/grafeas/v1/vulnerability.proto +++ b/src/main/proto/grafeas/v1/vulnerability.proto @@ -16,6 +16,7 @@ syntax = "proto3"; package grafeas.v1; +import "google/api/field_behavior.proto"; import "google/protobuf/timestamp.proto"; import "grafeas/v1/common.proto"; import "grafeas/v1/cvss.proto"; @@ -115,6 +116,12 @@ message VulnerabilityNote { // upstream timestamp from the underlying information source - e.g. Ubuntu // security tracker. google.protobuf.Timestamp source_update_time = 12; + + // The source from which the information in this Detail was obtained. + string source = 13; + + // The name of the vendor of the product. + string vendor = 14; } // The full description of the CVSSv3 for this vulnerability. @@ -172,6 +179,18 @@ message VulnerabilityOccurrence { // severity. float cvss_score = 3; + // The CVSS v3 score for this vulnerability. + message CVSSV3 { + // The base score for for this vulnerability according to cvss v3. + float base_score = 1; + // The severity rating assigned to this vulnerability by vulnerability + // provider. + Severity severity = 2; + } + + // The cvss v3 score for the vulnerability. + CVSSV3 cvssv3 = 10; + // Required. The set of affected locations and their fixes (if available) // within the associated resource. repeated PackageIssue package_issue = 4; @@ -205,6 +224,14 @@ message VulnerabilityOccurrence { // Output only. Whether a fix is available for this package. bool fix_available = 7; + + // The type of package (e.g. OS, MAVEN, GO). + string package_type = 8; + + // The distro or language system assigned severity for this vulnerability + // when that is available and note provider assigned severity when it is not + // available. + Severity effective_severity = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Output only. A one sentence description of this vulnerability. @@ -218,6 +245,14 @@ message VulnerabilityOccurrence { // The distro assigned severity for this vulnerability when it is available, // otherwise this is the note provider assigned severity. + // + // When there are multiple PackageIssues for this vulnerability, they can have + // different effective severities because some might be provided by the distro + // while others are provided by the language ecosystem for a language pack. + // For this reason, it is advised to use the effective severity on the + // PackageIssue level. In the case where multiple PackageIssues have differing + // effective severities, this field should be the highest severity for any of + // the PackageIssues. Severity effective_severity = 8; // Output only. Whether at least one of the affected packages has a fix diff --git a/src/test/java/io/grafeas/v1/GrafeasClientTest.java b/src/test/java/io/grafeas/v1/GrafeasClientTest.java index d9c744dd..3f618e86 100644 --- a/src/test/java/io/grafeas/v1/GrafeasClientTest.java +++ b/src/test/java/io/grafeas/v1/GrafeasClientTest.java @@ -97,6 +97,7 @@ public void getOccurrenceTest() throws Exception { .setRemediation("remediation779381797") .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setEnvelope(Envelope.newBuilder().build()) .build(); mockGrafeas.addResponse(expectedResponse); @@ -141,6 +142,7 @@ public void getOccurrenceTest2() throws Exception { .setRemediation("remediation779381797") .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setEnvelope(Envelope.newBuilder().build()) .build(); mockGrafeas.addResponse(expectedResponse); @@ -347,6 +349,7 @@ public void createOccurrenceTest() throws Exception { .setRemediation("remediation779381797") .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setEnvelope(Envelope.newBuilder().build()) .build(); mockGrafeas.addResponse(expectedResponse); @@ -394,6 +397,7 @@ public void createOccurrenceTest2() throws Exception { .setRemediation("remediation779381797") .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setEnvelope(Envelope.newBuilder().build()) .build(); mockGrafeas.addResponse(expectedResponse); @@ -527,6 +531,7 @@ public void updateOccurrenceTest() throws Exception { .setRemediation("remediation779381797") .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setEnvelope(Envelope.newBuilder().build()) .build(); mockGrafeas.addResponse(expectedResponse); @@ -577,6 +582,7 @@ public void updateOccurrenceTest2() throws Exception { .setRemediation("remediation779381797") .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setEnvelope(Envelope.newBuilder().build()) .build(); mockGrafeas.addResponse(expectedResponse); diff --git a/synth.metadata b/synth.metadata index cf458895..53b83b34 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-grafeas.git", - "sha": "c5083349cc1ac6217694f463220b19e230c49957" + "sha": "cef2f854f69c48cde5bad7f09845cef344497d64" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d2977af9e9f1fc0c9dc8368352daa032471f3c63", - "internalRef": "403132955" + "sha": "297bfd86f13acc8e06251bc0b23207f91bcba081", + "internalRef": "414718329" } }, { @@ -130,6 +130,8 @@ "src/main/java/io/grafeas/v1/BuildOccurrenceOrBuilder.java", "src/main/java/io/grafeas/v1/BuildProvenance.java", "src/main/java/io/grafeas/v1/BuildProvenanceOrBuilder.java", + "src/main/java/io/grafeas/v1/BuilderConfig.java", + "src/main/java/io/grafeas/v1/BuilderConfigOrBuilder.java", "src/main/java/io/grafeas/v1/CVSSv3.java", "src/main/java/io/grafeas/v1/CVSSv3OrBuilder.java", "src/main/java/io/grafeas/v1/CloudRepoSourceContext.java", @@ -137,11 +139,24 @@ "src/main/java/io/grafeas/v1/Command.java", "src/main/java/io/grafeas/v1/CommandOrBuilder.java", "src/main/java/io/grafeas/v1/Common.java", + "src/main/java/io/grafeas/v1/Completeness.java", + "src/main/java/io/grafeas/v1/CompletenessOrBuilder.java", + "src/main/java/io/grafeas/v1/Compliance.java", + "src/main/java/io/grafeas/v1/ComplianceNote.java", + "src/main/java/io/grafeas/v1/ComplianceNoteOrBuilder.java", + "src/main/java/io/grafeas/v1/ComplianceOccurrence.java", + "src/main/java/io/grafeas/v1/ComplianceOccurrenceOrBuilder.java", + "src/main/java/io/grafeas/v1/ComplianceVersion.java", + "src/main/java/io/grafeas/v1/ComplianceVersionOrBuilder.java", "src/main/java/io/grafeas/v1/CreateNoteRequest.java", "src/main/java/io/grafeas/v1/CreateNoteRequestOrBuilder.java", "src/main/java/io/grafeas/v1/CreateOccurrenceRequest.java", "src/main/java/io/grafeas/v1/CreateOccurrenceRequestOrBuilder.java", "src/main/java/io/grafeas/v1/Cvss.java", + "src/main/java/io/grafeas/v1/DSSEAttestationNote.java", + "src/main/java/io/grafeas/v1/DSSEAttestationNoteOrBuilder.java", + "src/main/java/io/grafeas/v1/DSSEAttestationOccurrence.java", + "src/main/java/io/grafeas/v1/DSSEAttestationOccurrenceOrBuilder.java", "src/main/java/io/grafeas/v1/DeleteNoteRequest.java", "src/main/java/io/grafeas/v1/DeleteNoteRequestOrBuilder.java", "src/main/java/io/grafeas/v1/DeleteOccurrenceRequest.java", @@ -158,6 +173,11 @@ "src/main/java/io/grafeas/v1/DiscoveryOccurrenceOrBuilder.java", "src/main/java/io/grafeas/v1/Distribution.java", "src/main/java/io/grafeas/v1/DistributionOrBuilder.java", + "src/main/java/io/grafeas/v1/DsseAttestation.java", + "src/main/java/io/grafeas/v1/Envelope.java", + "src/main/java/io/grafeas/v1/EnvelopeOrBuilder.java", + "src/main/java/io/grafeas/v1/EnvelopeSignature.java", + "src/main/java/io/grafeas/v1/EnvelopeSignatureOrBuilder.java", "src/main/java/io/grafeas/v1/FileHashes.java", "src/main/java/io/grafeas/v1/FileHashesOrBuilder.java", "src/main/java/io/grafeas/v1/Fingerprint.java", @@ -183,6 +203,14 @@ "src/main/java/io/grafeas/v1/ImageNoteOrBuilder.java", "src/main/java/io/grafeas/v1/ImageOccurrence.java", "src/main/java/io/grafeas/v1/ImageOccurrenceOrBuilder.java", + "src/main/java/io/grafeas/v1/InTotoProvenance.java", + "src/main/java/io/grafeas/v1/InTotoProvenanceOrBuilder.java", + "src/main/java/io/grafeas/v1/InTotoProvenanceProto.java", + "src/main/java/io/grafeas/v1/InTotoStatement.java", + "src/main/java/io/grafeas/v1/InTotoStatementOrBuilder.java", + "src/main/java/io/grafeas/v1/InTotoStatementProto.java", + "src/main/java/io/grafeas/v1/Jwt.java", + "src/main/java/io/grafeas/v1/JwtOrBuilder.java", "src/main/java/io/grafeas/v1/Layer.java", "src/main/java/io/grafeas/v1/LayerOrBuilder.java", "src/main/java/io/grafeas/v1/ListNoteOccurrencesRequest.java", @@ -199,6 +227,10 @@ "src/main/java/io/grafeas/v1/ListOccurrencesResponseOrBuilder.java", "src/main/java/io/grafeas/v1/Location.java", "src/main/java/io/grafeas/v1/LocationOrBuilder.java", + "src/main/java/io/grafeas/v1/Metadata.java", + "src/main/java/io/grafeas/v1/MetadataOrBuilder.java", + "src/main/java/io/grafeas/v1/NonCompliantFile.java", + "src/main/java/io/grafeas/v1/NonCompliantFileOrBuilder.java", "src/main/java/io/grafeas/v1/Note.java", "src/main/java/io/grafeas/v1/NoteKind.java", "src/main/java/io/grafeas/v1/NoteName.java", @@ -215,6 +247,8 @@ "src/main/java/io/grafeas/v1/ProjectRepoId.java", "src/main/java/io/grafeas/v1/ProjectRepoIdOrBuilder.java", "src/main/java/io/grafeas/v1/Provenance.java", + "src/main/java/io/grafeas/v1/Recipe.java", + "src/main/java/io/grafeas/v1/RecipeOrBuilder.java", "src/main/java/io/grafeas/v1/RelatedUrl.java", "src/main/java/io/grafeas/v1/RelatedUrlOrBuilder.java", "src/main/java/io/grafeas/v1/RepoId.java", @@ -222,10 +256,15 @@ "src/main/java/io/grafeas/v1/Severity.java", "src/main/java/io/grafeas/v1/Signature.java", "src/main/java/io/grafeas/v1/SignatureOrBuilder.java", + "src/main/java/io/grafeas/v1/SlsaProvenance.java", + "src/main/java/io/grafeas/v1/SlsaProvenanceOrBuilder.java", + "src/main/java/io/grafeas/v1/SlsaProvenanceOuterClass.java", "src/main/java/io/grafeas/v1/Source.java", "src/main/java/io/grafeas/v1/SourceContext.java", "src/main/java/io/grafeas/v1/SourceContextOrBuilder.java", "src/main/java/io/grafeas/v1/SourceOrBuilder.java", + "src/main/java/io/grafeas/v1/Subject.java", + "src/main/java/io/grafeas/v1/SubjectOrBuilder.java", "src/main/java/io/grafeas/v1/UpdateNoteRequest.java", "src/main/java/io/grafeas/v1/UpdateNoteRequestOrBuilder.java", "src/main/java/io/grafeas/v1/UpdateOccurrenceRequest.java", @@ -255,13 +294,18 @@ "src/main/proto/grafeas/v1/attestation.proto", "src/main/proto/grafeas/v1/build.proto", "src/main/proto/grafeas/v1/common.proto", + "src/main/proto/grafeas/v1/compliance.proto", "src/main/proto/grafeas/v1/cvss.proto", "src/main/proto/grafeas/v1/deployment.proto", "src/main/proto/grafeas/v1/discovery.proto", + "src/main/proto/grafeas/v1/dsse_attestation.proto", "src/main/proto/grafeas/v1/grafeas.proto", "src/main/proto/grafeas/v1/image.proto", + "src/main/proto/grafeas/v1/intoto_provenance.proto", + "src/main/proto/grafeas/v1/intoto_statement.proto", "src/main/proto/grafeas/v1/package.proto", "src/main/proto/grafeas/v1/provenance.proto", + "src/main/proto/grafeas/v1/slsa_provenance.proto", "src/main/proto/grafeas/v1/upgrade.proto", "src/main/proto/grafeas/v1/vulnerability.proto", "src/test/java/io/grafeas/v1/GrafeasClientTest.java",