public static List<String> toStringList(List<OccurrenceName> values) { List<String> list = new ArrayList<String>(values.size()); for (OccurrenceName value : values) { if (value == null) { list.add(""); } else { list.add(value.toString()); } } return list; }
public static String format(String project, String occurrence) { return newBuilder().setProject(project).setOccurrence(occurrence).build().toString(); }
/** * Gets the note attached to the specified occurrence. Consumer projects can use this method to * get a note that belongs to a provider project. * * <p>Sample code: * * <pre><code> * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) { * OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]"); * Note response = grafeasV1Beta1Client.getOccurrenceNote(name); * } * </code></pre> * * @param name The name of the occurrence in the form of * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Note getOccurrenceNote(OccurrenceName name) { GetOccurrenceNoteRequest request = GetOccurrenceNoteRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); return getOccurrenceNote(request); }
/** * Gets the specified occurrence. * * <p>Sample code: * * <pre><code> * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) { * OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]"); * Occurrence response = grafeasV1Beta1Client.getOccurrence(name); * } * </code></pre> * * @param name The name of the occurrence in the form of * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Occurrence getOccurrence(OccurrenceName name) { GetOccurrenceRequest request = GetOccurrenceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getOccurrence(request); }
/** * Deletes the specified occurrence. For example, use this method to delete an occurrence when the * occurrence is no longer applicable for the given resource. * * <p>Sample code: * * <pre><code> * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) { * OccurrenceName name = OccurrenceName.of("[PROJECT]", "[OCCURRENCE]"); * grafeasV1Beta1Client.deleteOccurrence(name); * } * </code></pre> * * @param name The name of the occurrence in the form of * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteOccurrence(OccurrenceName name) { DeleteOccurrenceRequest request = DeleteOccurrenceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deleteOccurrence(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); }
public static List<String> toStringList(List<OccurrenceName> values) { List<String> list = new ArrayList<String>(values.size()); for (OccurrenceName value : values) { if (value == null) { list.add(""); } else { list.add(value.toString()); } } return list; }
public static String format(String project, String occurrence) { return newBuilder().setProject(project).setOccurrence(occurrence).build().toString(); }