@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
/** * Updates the specified occurrence. * * <p>Sample code: * * <pre><code> * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) { * OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]"); * Occurrence occurrence = Occurrence.newBuilder().build(); * FieldMask updateMask = FieldMask.newBuilder().build(); * Occurrence response = grafeasV1Beta1Client.updateOccurrence(name.toString(), occurrence, updateMask); * } * </code></pre> * * @param name The name of the occurrence in the form of * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. * @param occurrence The updated occurrence. * @param updateMask The fields to update. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Occurrence updateOccurrence( String name, Occurrence occurrence, FieldMask updateMask) { UpdateOccurrenceRequest request = UpdateOccurrenceRequest.newBuilder() .setName(name) .setOccurrence(occurrence) .setUpdateMask(updateMask) .build(); return updateOccurrence(request); }
/** * Updates the specified occurrence. * * <p>Sample code: * * <pre><code> * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) { * OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]"); * Occurrence occurrence = Occurrence.newBuilder().build(); * FieldMask updateMask = FieldMask.newBuilder().build(); * Occurrence response = grafeasV1Beta1Client.updateOccurrence(name, occurrence, updateMask); * } * </code></pre> * * @param name The name of the occurrence in the form of * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. * @param occurrence The updated occurrence. * @param updateMask The fields to update. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Occurrence updateOccurrence( OccurrenceName name, Occurrence occurrence, FieldMask updateMask) { UpdateOccurrenceRequest request = UpdateOccurrenceRequest.newBuilder() .setName(name == null ? null : name.toString()) .setOccurrence(occurrence) .setUpdateMask(updateMask) .build(); return updateOccurrence(request); }
/** * Pushes an update to an Occurrence that already exists on the server * @param client The Grafeas client used to perform the API requests. * @param occurrenceName the name of the Occurrence to delete. * format: "projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]" * @param updated an Occurrence object representing the desired updates to push */ public static Occurrence updateOccurrence(GrafeasV1Beta1Client client, String occurrenceName, Occurrence updated) { UpdateOccurrenceRequest request = UpdateOccurrenceRequest.newBuilder() .setName(occurrenceName) .setOccurrence(updated) .build(); return client.updateOccurrence(request); } // [END update_occurrence]
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }