@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
public Builder mergeFrom(io.grafeas.v1beta1.Occurrence other) { if (other == io.grafeas.v1beta1.Occurrence.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); if (other.hasResource()) { mergeResource(other.getResource()); if (!other.getNoteName().isEmpty()) { noteName_ = other.noteName_; onChanged(); setKindValue(other.getKindValue()); if (!other.getRemediation().isEmpty()) { remediation_ = other.remediation_; onChanged(); if (other.hasCreateTime()) { mergeCreateTime(other.getCreateTime()); if (other.hasUpdateTime()) { mergeUpdateTime(other.getUpdateTime()); switch (other.getDetailsCase()) { case VULNERABILITY: mergeVulnerability(other.getVulnerability()); break;
@java.lang.Override public io.grafeas.v1beta1.Occurrence buildPartial() { io.grafeas.v1beta1.Occurrence result = new io.grafeas.v1beta1.Occurrence(this); result.name_ = name_; if (resourceBuilder_ == null) {
/** * * * <pre> * A description of actions that can be taken to remedy the note. * </pre> * * <code>string remediation = 5;</code> */ public Builder clearRemediation() { remediation_ = getDefaultInstance().getRemediation(); onChanged(); return this; } /**
/** * * * <pre> * Output only. The name of the occurrence in the form of * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
/** * * * <pre> * Required. Immutable. The analysis note associated with this occurrence, in * the form of `projects[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be used * as a filter in list requests. * </pre> * * <code>string note_name = 3;</code> */ public Builder clearNoteName() { noteName_ = getDefaultInstance().getNoteName(); onChanged(); return this; } /**
@java.lang.Override public io.grafeas.v1beta1.Occurrence getDefaultInstanceForType() { return io.grafeas.v1beta1.Occurrence.getDefaultInstance(); }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); output.writeMessage(2, getResource()); if (!getNoteNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, noteName_); output.writeEnum(4, kind_); if (!getRemediationBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, remediation_); output.writeMessage(6, getCreateTime()); output.writeMessage(7, getUpdateTime());
/** * Retrieves all the Occurrences associated with a specified image * Here, all Occurrences are simply printed and counted * @param client The Grafeas client used to perform the API requests. * @param imageUrl the Container Registry URL associated with the image * example: "https://gcr.io/project/image@sha256:foo" * @param projectId the GCP project to search for Occurrences in * @return number of Occurrences found */ public static int getOccurrencesForImage(GrafeasV1Beta1Client client, String imageUrl, String projectId) { final String filterStr = "resourceUrl=\"" + imageUrl + "\""; final String projectName = ProjectName.format(projectId); int i = 0; for (Occurrence o : client.listOccurrences(projectName, filterStr).iterateAll()) { // Write custom code to process each Occurrence here System.out.println(o.getName()); i = i + 1; } return i; } // [END occurrences_for_image]
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.grafeas.v1beta1.CreateOccurrenceRequest)) { return super.equals(obj); } io.grafeas.v1beta1.CreateOccurrenceRequest other = (io.grafeas.v1beta1.CreateOccurrenceRequest) obj; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && (hasOccurrence() == other.hasOccurrence()); if (hasOccurrence()) { result = result && getOccurrence().equals(other.getOccurrence()); } result = result && unknownFields.equals(other.unknownFields); return result; }
/** * * * <pre> * Output only. The time this occurrence was created. * </pre> * * <code>.google.protobuf.Timestamp create_time = 6;</code> */ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { return getCreateTime(); }
result = result && getName().equals(other.getName()); result = result && (hasResource() == other.hasResource()); if (hasResource()) { result = result && getResource().equals(other.getResource()); result = result && getNoteName().equals(other.getNoteName()); result = result && kind_ == other.kind_; result = result && getRemediation().equals(other.getRemediation()); result = result && (hasCreateTime() == other.hasCreateTime()); if (hasCreateTime()) { result = result && getCreateTime().equals(other.getCreateTime()); result = result && (hasUpdateTime() == other.hasUpdateTime()); if (hasUpdateTime()) { result = result && getUpdateTime().equals(other.getUpdateTime()); result = result && getDetailsCase().equals(other.getDetailsCase()); if (!result) return false; switch (detailsCase_) { case 8: result = result && getVulnerability().equals(other.getVulnerability()); break; case 9: result = result && getBuild().equals(other.getBuild()); break; case 10: result = result && getDerivedImage().equals(other.getDerivedImage()); break; case 11:
/** * * * <pre> * The occurrence to create. * </pre> * * <code>.grafeas.v1beta1.Occurrence occurrence = 2;</code> */ public io.grafeas.v1beta1.Occurrence getOccurrence() { return occurrence_ == null ? io.grafeas.v1beta1.Occurrence.getDefaultInstance() : occurrence_; } /**
if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getResource()); if (!getNoteNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, noteName_); size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, kind_); if (!getRemediationBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, remediation_); size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCreateTime()); size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getUpdateTime());
/** * * * <pre> * Output only. The name of the occurrence in the form of * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
/** * * * <pre> * A description of actions that can be taken to remedy the note. * </pre> * * <code>string remediation = 5;</code> */ public Builder clearRemediation() { remediation_ = getDefaultInstance().getRemediation(); onChanged(); return this; } /**
/** * * * <pre> * Required. Immutable. The analysis note associated with this occurrence, in * the form of `projects[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be used * as a filter in list requests. * </pre> * * <code>string note_name = 3;</code> */ public Builder clearNoteName() { noteName_ = getDefaultInstance().getNoteName(); onChanged(); return this; } /**
/** * Retrieves all the Occurrences associated with a specified Note * Here, all Occurrences are printed and counted * @param client The Grafeas client used to perform the API requests. * @param noteId the Note's unique identifier * @param projectId the GCP project the Note belongs to * @return number of Occurrences found */ public static int getOccurrencesForNote(GrafeasV1Beta1Client client, String noteId, String projectId) { final NoteName noteName = NoteName.of(projectId, noteId); int i = 0; ListNoteOccurrencesRequest request = ListNoteOccurrencesRequest.newBuilder() .setName(noteName.toString()) .build(); for (Occurrence o : client.listNoteOccurrences(request).iterateAll()) { // Write custom code to process each Occurrence here System.out.println(o.getName()); i = i + 1; } return i; } // [END occurrences_for_note]
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.grafeas.v1beta1.UpdateOccurrenceRequest)) { return super.equals(obj); } io.grafeas.v1beta1.UpdateOccurrenceRequest other = (io.grafeas.v1beta1.UpdateOccurrenceRequest) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && (hasOccurrence() == other.hasOccurrence()); if (hasOccurrence()) { result = result && getOccurrence().equals(other.getOccurrence()); } result = result && (hasUpdateMask() == other.hasUpdateMask()); if (hasUpdateMask()) { result = result && getUpdateMask().equals(other.getUpdateMask()); } result = result && unknownFields.equals(other.unknownFields); return result; }
/** * * * <pre> * Output only. The time this occurrence was created. * </pre> * * <code>.google.protobuf.Timestamp create_time = 6;</code> */ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { return getCreateTime(); }