diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/JobServiceClient.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/JobServiceClient.java index 4484658f1ce4..bfe3e6fc7cb3 100644 --- a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/JobServiceClient.java +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/JobServiceClient.java @@ -2329,6 +2329,973 @@ public final void cancelHyperparameterTuningJob(CancelHyperparameterTuningJobReq return stub.cancelHyperparameterTuningJobCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a NasJob + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * NasJob nasJob = NasJob.newBuilder().build(); + * NasJob response = jobServiceClient.createNasJob(parent, nasJob); + * } + * }+ * + * @param parent Required. The resource name of the Location to create the NasJob in. Format: + * `projects/{project}/locations/{location}` + * @param nasJob Required. The NasJob to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NasJob createNasJob(LocationName parent, NasJob nasJob) { + CreateNasJobRequest request = + CreateNasJobRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setNasJob(nasJob) + .build(); + return createNasJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a NasJob + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * NasJob nasJob = NasJob.newBuilder().build(); + * NasJob response = jobServiceClient.createNasJob(parent, nasJob); + * } + * }+ * + * @param parent Required. The resource name of the Location to create the NasJob in. Format: + * `projects/{project}/locations/{location}` + * @param nasJob Required. The NasJob to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NasJob createNasJob(String parent, NasJob nasJob) { + CreateNasJobRequest request = + CreateNasJobRequest.newBuilder().setParent(parent).setNasJob(nasJob).build(); + return createNasJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a NasJob + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * CreateNasJobRequest request = + * CreateNasJobRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setNasJob(NasJob.newBuilder().build()) + * .build(); + * NasJob response = jobServiceClient.createNasJob(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NasJob createNasJob(CreateNasJobRequest request) { + return createNasJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a NasJob + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * CreateNasJobRequest request = + * CreateNasJobRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setNasJob(NasJob.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = jobServiceClient.createNasJobCallable().futureCall(request); + * // Do something. + * NasJob response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * NasJobName name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]"); + * NasJob response = jobServiceClient.getNasJob(name); + * } + * }+ * + * @param name Required. The name of the NasJob resource. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NasJob getNasJob(NasJobName name) { + GetNasJobRequest request = + GetNasJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getNasJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a NasJob + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString(); + * NasJob response = jobServiceClient.getNasJob(name); + * } + * }+ * + * @param name Required. The name of the NasJob resource. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NasJob getNasJob(String name) { + GetNasJobRequest request = GetNasJobRequest.newBuilder().setName(name).build(); + return getNasJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a NasJob + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * GetNasJobRequest request = + * GetNasJobRequest.newBuilder() + * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .build(); + * NasJob response = jobServiceClient.getNasJob(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NasJob getNasJob(GetNasJobRequest request) { + return getNasJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a NasJob + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * GetNasJobRequest request = + * GetNasJobRequest.newBuilder() + * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = jobServiceClient.getNasJobCallable().futureCall(request); + * // Do something. + * NasJob response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (NasJob element : jobServiceClient.listNasJobs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The resource name of the Location to list the NasJobs from. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNasJobsPagedResponse listNasJobs(LocationName parent) { + ListNasJobsRequest request = + ListNasJobsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listNasJobs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists NasJobs in a Location. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (NasJob element : jobServiceClient.listNasJobs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The resource name of the Location to list the NasJobs from. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNasJobsPagedResponse listNasJobs(String parent) { + ListNasJobsRequest request = ListNasJobsRequest.newBuilder().setParent(parent).build(); + return listNasJobs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists NasJobs in a Location. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * ListNasJobsRequest request = + * ListNasJobsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * for (NasJob element : jobServiceClient.listNasJobs(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNasJobsPagedResponse listNasJobs(ListNasJobsRequest request) { + return listNasJobsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists NasJobs in a Location. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * ListNasJobsRequest request = + * ListNasJobsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = jobServiceClient.listNasJobsPagedCallable().futureCall(request); + * // Do something. + * for (NasJob element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * ListNasJobsRequest request = + * ListNasJobsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * while (true) { + * ListNasJobsResponse response = jobServiceClient.listNasJobsCallable().call(request); + * for (NasJob element : response.getNasJobsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * NasJobName name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]"); + * jobServiceClient.deleteNasJobAsync(name).get(); + * } + * }+ * + * @param name Required. The name of the NasJob resource to be deleted. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString(); + * jobServiceClient.deleteNasJobAsync(name).get(); + * } + * }+ * + * @param name Required. The name of the NasJob resource to be deleted. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * DeleteNasJobRequest request = + * DeleteNasJobRequest.newBuilder() + * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .build(); + * jobServiceClient.deleteNasJobAsync(request).get(); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * DeleteNasJobRequest request = + * DeleteNasJobRequest.newBuilder() + * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .build(); + * OperationFuture+ */ + public final OperationCallablefuture = + * jobServiceClient.deleteNasJobOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * DeleteNasJobRequest request = + * DeleteNasJobRequest.newBuilder() + * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = jobServiceClient.deleteNasJobCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * NasJobName name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]"); + * jobServiceClient.cancelNasJob(name); + * } + * }+ * + * @param name Required. The name of the NasJob to cancel. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void cancelNasJob(NasJobName name) { + CancelNasJobRequest request = + CancelNasJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + cancelNasJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels a NasJob. Starts asynchronous cancellation on the NasJob. The server makes a best + * effort to cancel the job, but success is not guaranteed. Clients can use + * [JobService.GetNasJob][google.cloud.aiplatform.v1.JobService.GetNasJob] or other methods to + * check whether the cancellation succeeded or whether the job completed despite cancellation. On + * successful cancellation, the NasJob is not deleted; instead it becomes a job with a + * [NasJob.error][google.cloud.aiplatform.v1.NasJob.error] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and + * [NasJob.state][google.cloud.aiplatform.v1.NasJob.state] is set to `CANCELLED`. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString(); + * jobServiceClient.cancelNasJob(name); + * } + * }+ * + * @param name Required. The name of the NasJob to cancel. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void cancelNasJob(String name) { + CancelNasJobRequest request = CancelNasJobRequest.newBuilder().setName(name).build(); + cancelNasJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels a NasJob. Starts asynchronous cancellation on the NasJob. The server makes a best + * effort to cancel the job, but success is not guaranteed. Clients can use + * [JobService.GetNasJob][google.cloud.aiplatform.v1.JobService.GetNasJob] or other methods to + * check whether the cancellation succeeded or whether the job completed despite cancellation. On + * successful cancellation, the NasJob is not deleted; instead it becomes a job with a + * [NasJob.error][google.cloud.aiplatform.v1.NasJob.error] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and + * [NasJob.state][google.cloud.aiplatform.v1.NasJob.state] is set to `CANCELLED`. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * CancelNasJobRequest request = + * CancelNasJobRequest.newBuilder() + * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .build(); + * jobServiceClient.cancelNasJob(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void cancelNasJob(CancelNasJobRequest request) { + cancelNasJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels a NasJob. Starts asynchronous cancellation on the NasJob. The server makes a best + * effort to cancel the job, but success is not guaranteed. Clients can use + * [JobService.GetNasJob][google.cloud.aiplatform.v1.JobService.GetNasJob] or other methods to + * check whether the cancellation succeeded or whether the job completed despite cancellation. On + * successful cancellation, the NasJob is not deleted; instead it becomes a job with a + * [NasJob.error][google.cloud.aiplatform.v1.NasJob.error] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and + * [NasJob.state][google.cloud.aiplatform.v1.NasJob.state] is set to `CANCELLED`. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * CancelNasJobRequest request = + * CancelNasJobRequest.newBuilder() + * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = jobServiceClient.cancelNasJobCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * NasTrialDetailName name = + * NasTrialDetailName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]", "[NAS_TRIAL_DETAIL]"); + * NasTrialDetail response = jobServiceClient.getNasTrialDetail(name); + * } + * }+ * + * @param name Required. The name of the NasTrialDetail resource. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NasTrialDetail getNasTrialDetail(NasTrialDetailName name) { + GetNasTrialDetailRequest request = + GetNasTrialDetailRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getNasTrialDetail(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a NasTrialDetail. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String name = + * NasTrialDetailName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]", "[NAS_TRIAL_DETAIL]") + * .toString(); + * NasTrialDetail response = jobServiceClient.getNasTrialDetail(name); + * } + * }+ * + * @param name Required. The name of the NasTrialDetail resource. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NasTrialDetail getNasTrialDetail(String name) { + GetNasTrialDetailRequest request = GetNasTrialDetailRequest.newBuilder().setName(name).build(); + return getNasTrialDetail(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a NasTrialDetail. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * GetNasTrialDetailRequest request = + * GetNasTrialDetailRequest.newBuilder() + * .setName( + * NasTrialDetailName.of( + * "[PROJECT]", "[LOCATION]", "[NAS_JOB]", "[NAS_TRIAL_DETAIL]") + * .toString()) + * .build(); + * NasTrialDetail response = jobServiceClient.getNasTrialDetail(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NasTrialDetail getNasTrialDetail(GetNasTrialDetailRequest request) { + return getNasTrialDetailCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a NasTrialDetail. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * GetNasTrialDetailRequest request = + * GetNasTrialDetailRequest.newBuilder() + * .setName( + * NasTrialDetailName.of( + * "[PROJECT]", "[LOCATION]", "[NAS_JOB]", "[NAS_TRIAL_DETAIL]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * jobServiceClient.getNasTrialDetailCallable().futureCall(request); + * // Do something. + * NasTrialDetail response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * NasJobName parent = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]"); + * for (NasTrialDetail element : jobServiceClient.listNasTrialDetails(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The name of the NasJob resource. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNasTrialDetailsPagedResponse listNasTrialDetails(NasJobName parent) { + ListNasTrialDetailsRequest request = + ListNasTrialDetailsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listNasTrialDetails(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List top NasTrialDetails of a NasJob. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String parent = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString(); + * for (NasTrialDetail element : jobServiceClient.listNasTrialDetails(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The name of the NasJob resource. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNasTrialDetailsPagedResponse listNasTrialDetails(String parent) { + ListNasTrialDetailsRequest request = + ListNasTrialDetailsRequest.newBuilder().setParent(parent).build(); + return listNasTrialDetails(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List top NasTrialDetails of a NasJob. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * ListNasTrialDetailsRequest request = + * ListNasTrialDetailsRequest.newBuilder() + * .setParent(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (NasTrialDetail element : jobServiceClient.listNasTrialDetails(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNasTrialDetailsPagedResponse listNasTrialDetails( + ListNasTrialDetailsRequest request) { + return listNasTrialDetailsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List top NasTrialDetails of a NasJob. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * ListNasTrialDetailsRequest request = + * ListNasTrialDetailsRequest.newBuilder() + * .setParent(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * jobServiceClient.listNasTrialDetailsPagedCallable().futureCall(request); + * // Do something. + * for (NasTrialDetail element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * ListNasTrialDetailsRequest request = + * ListNasTrialDetailsRequest.newBuilder() + * .setParent(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListNasTrialDetailsResponse response = + * jobServiceClient.listNasTrialDetailsCallable().call(request); + * for (NasTrialDetail element : response.getNasTrialDetailsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * ModelName sourceModel = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * CopyModelResponse response = modelServiceClient.copyModelAsync(parent, sourceModel).get(); + * } + * }+ * + * @param parent Required. The resource name of the Location into which to copy the Model. Format: + * `projects/{project}/locations/{location}` + * @param sourceModel Required. The resource name of the Model to copy. That Model must be in the + * same Project. Format: `projects/{project}/locations/{location}/models/{model}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * String sourceModel = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * CopyModelResponse response = modelServiceClient.copyModelAsync(parent, sourceModel).get(); + * } + * }+ * + * @param parent Required. The resource name of the Location into which to copy the Model. Format: + * `projects/{project}/locations/{location}` + * @param sourceModel Required. The resource name of the Model to copy. That Model must be in the + * same Project. Format: `projects/{project}/locations/{location}/models/{model}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * ModelName sourceModel = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + * CopyModelResponse response = modelServiceClient.copyModelAsync(parent, sourceModel).get(); + * } + * }+ * + * @param parent Required. The resource name of the Location into which to copy the Model. Format: + * `projects/{project}/locations/{location}` + * @param sourceModel Required. The resource name of the Model to copy. That Model must be in the + * same Project. Format: `projects/{project}/locations/{location}/models/{model}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * String sourceModel = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); + * CopyModelResponse response = modelServiceClient.copyModelAsync(parent, sourceModel).get(); + * } + * }+ * + * @param parent Required. The resource name of the Location into which to copy the Model. Format: + * `projects/{project}/locations/{location}` + * @param sourceModel Required. The resource name of the Model to copy. That Model must be in the + * same Project. Format: `projects/{project}/locations/{location}/models/{model}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) { + * CopyModelRequest request = + * CopyModelRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setSourceModel(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + * .build(); + * CopyModelResponse response = modelServiceClient.copyModelAsync(request).get(); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) { + * CopyModelRequest request = + * CopyModelRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setSourceModel(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + * .build(); + * OperationFuture+ */ + public final OperationCallablefuture = + * modelServiceClient.copyModelOperationCallable().futureCall(request); + * // Do something. + * CopyModelResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) { + * CopyModelRequest request = + * CopyModelRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setSourceModel(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) + * .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = modelServiceClient.copyModelCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * NasJob nasJob = NasJob.newBuilder().build(); + * NasJob response = jobServiceClient.createNasJob(parent, nasJob); + * } + * }+ * + * @param parent Required. The resource name of the Location to create the NasJob in. Format: + * `projects/{project}/locations/{location}` + * @param nasJob Required. The NasJob to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NasJob createNasJob(LocationName parent, NasJob nasJob) { + CreateNasJobRequest request = + CreateNasJobRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setNasJob(nasJob) + .build(); + return createNasJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a NasJob + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * NasJob nasJob = NasJob.newBuilder().build(); + * NasJob response = jobServiceClient.createNasJob(parent, nasJob); + * } + * }+ * + * @param parent Required. The resource name of the Location to create the NasJob in. Format: + * `projects/{project}/locations/{location}` + * @param nasJob Required. The NasJob to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NasJob createNasJob(String parent, NasJob nasJob) { + CreateNasJobRequest request = + CreateNasJobRequest.newBuilder().setParent(parent).setNasJob(nasJob).build(); + return createNasJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a NasJob + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * CreateNasJobRequest request = + * CreateNasJobRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setNasJob(NasJob.newBuilder().build()) + * .build(); + * NasJob response = jobServiceClient.createNasJob(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NasJob createNasJob(CreateNasJobRequest request) { + return createNasJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a NasJob + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * CreateNasJobRequest request = + * CreateNasJobRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setNasJob(NasJob.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = jobServiceClient.createNasJobCallable().futureCall(request); + * // Do something. + * NasJob response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * NasJobName name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]"); + * NasJob response = jobServiceClient.getNasJob(name); + * } + * }+ * + * @param name Required. The name of the NasJob resource. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NasJob getNasJob(NasJobName name) { + GetNasJobRequest request = + GetNasJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getNasJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a NasJob + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString(); + * NasJob response = jobServiceClient.getNasJob(name); + * } + * }+ * + * @param name Required. The name of the NasJob resource. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NasJob getNasJob(String name) { + GetNasJobRequest request = GetNasJobRequest.newBuilder().setName(name).build(); + return getNasJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a NasJob + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * GetNasJobRequest request = + * GetNasJobRequest.newBuilder() + * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .build(); + * NasJob response = jobServiceClient.getNasJob(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NasJob getNasJob(GetNasJobRequest request) { + return getNasJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a NasJob + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * GetNasJobRequest request = + * GetNasJobRequest.newBuilder() + * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = jobServiceClient.getNasJobCallable().futureCall(request); + * // Do something. + * NasJob response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (NasJob element : jobServiceClient.listNasJobs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The resource name of the Location to list the NasJobs from. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNasJobsPagedResponse listNasJobs(LocationName parent) { + ListNasJobsRequest request = + ListNasJobsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listNasJobs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists NasJobs in a Location. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (NasJob element : jobServiceClient.listNasJobs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The resource name of the Location to list the NasJobs from. Format: + * `projects/{project}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNasJobsPagedResponse listNasJobs(String parent) { + ListNasJobsRequest request = ListNasJobsRequest.newBuilder().setParent(parent).build(); + return listNasJobs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists NasJobs in a Location. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * ListNasJobsRequest request = + * ListNasJobsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * for (NasJob element : jobServiceClient.listNasJobs(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNasJobsPagedResponse listNasJobs(ListNasJobsRequest request) { + return listNasJobsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists NasJobs in a Location. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * ListNasJobsRequest request = + * ListNasJobsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = jobServiceClient.listNasJobsPagedCallable().futureCall(request); + * // Do something. + * for (NasJob element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * ListNasJobsRequest request = + * ListNasJobsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * while (true) { + * ListNasJobsResponse response = jobServiceClient.listNasJobsCallable().call(request); + * for (NasJob element : response.getNasJobsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * NasJobName name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]"); + * jobServiceClient.deleteNasJobAsync(name).get(); + * } + * }+ * + * @param name Required. The name of the NasJob resource to be deleted. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString(); + * jobServiceClient.deleteNasJobAsync(name).get(); + * } + * }+ * + * @param name Required. The name of the NasJob resource to be deleted. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * DeleteNasJobRequest request = + * DeleteNasJobRequest.newBuilder() + * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .build(); + * jobServiceClient.deleteNasJobAsync(request).get(); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * DeleteNasJobRequest request = + * DeleteNasJobRequest.newBuilder() + * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .build(); + * OperationFuture+ */ + public final OperationCallablefuture = + * jobServiceClient.deleteNasJobOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * DeleteNasJobRequest request = + * DeleteNasJobRequest.newBuilder() + * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = jobServiceClient.deleteNasJobCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * NasJobName name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]"); + * jobServiceClient.cancelNasJob(name); + * } + * }+ * + * @param name Required. The name of the NasJob to cancel. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void cancelNasJob(NasJobName name) { + CancelNasJobRequest request = + CancelNasJobRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + cancelNasJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels a NasJob. Starts asynchronous cancellation on the NasJob. The server makes a best + * effort to cancel the job, but success is not guaranteed. Clients can use + * [JobService.GetNasJob][google.cloud.aiplatform.v1beta1.JobService.GetNasJob] or other methods + * to check whether the cancellation succeeded or whether the job completed despite cancellation. + * On successful cancellation, the NasJob is not deleted; instead it becomes a job with a + * [NasJob.error][google.cloud.aiplatform.v1beta1.NasJob.error] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and + * [NasJob.state][google.cloud.aiplatform.v1beta1.NasJob.state] is set to `CANCELLED`. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString(); + * jobServiceClient.cancelNasJob(name); + * } + * }+ * + * @param name Required. The name of the NasJob to cancel. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void cancelNasJob(String name) { + CancelNasJobRequest request = CancelNasJobRequest.newBuilder().setName(name).build(); + cancelNasJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels a NasJob. Starts asynchronous cancellation on the NasJob. The server makes a best + * effort to cancel the job, but success is not guaranteed. Clients can use + * [JobService.GetNasJob][google.cloud.aiplatform.v1beta1.JobService.GetNasJob] or other methods + * to check whether the cancellation succeeded or whether the job completed despite cancellation. + * On successful cancellation, the NasJob is not deleted; instead it becomes a job with a + * [NasJob.error][google.cloud.aiplatform.v1beta1.NasJob.error] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and + * [NasJob.state][google.cloud.aiplatform.v1beta1.NasJob.state] is set to `CANCELLED`. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * CancelNasJobRequest request = + * CancelNasJobRequest.newBuilder() + * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .build(); + * jobServiceClient.cancelNasJob(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void cancelNasJob(CancelNasJobRequest request) { + cancelNasJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels a NasJob. Starts asynchronous cancellation on the NasJob. The server makes a best + * effort to cancel the job, but success is not guaranteed. Clients can use + * [JobService.GetNasJob][google.cloud.aiplatform.v1beta1.JobService.GetNasJob] or other methods + * to check whether the cancellation succeeded or whether the job completed despite cancellation. + * On successful cancellation, the NasJob is not deleted; instead it becomes a job with a + * [NasJob.error][google.cloud.aiplatform.v1beta1.NasJob.error] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and + * [NasJob.state][google.cloud.aiplatform.v1beta1.NasJob.state] is set to `CANCELLED`. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * CancelNasJobRequest request = + * CancelNasJobRequest.newBuilder() + * .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = jobServiceClient.cancelNasJobCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * NasTrialDetailName name = + * NasTrialDetailName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]", "[NAS_TRIAL_DETAIL]"); + * NasTrialDetail response = jobServiceClient.getNasTrialDetail(name); + * } + * }+ * + * @param name Required. The name of the NasTrialDetail resource. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NasTrialDetail getNasTrialDetail(NasTrialDetailName name) { + GetNasTrialDetailRequest request = + GetNasTrialDetailRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getNasTrialDetail(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a NasTrialDetail. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String name = + * NasTrialDetailName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]", "[NAS_TRIAL_DETAIL]") + * .toString(); + * NasTrialDetail response = jobServiceClient.getNasTrialDetail(name); + * } + * }+ * + * @param name Required. The name of the NasTrialDetail resource. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NasTrialDetail getNasTrialDetail(String name) { + GetNasTrialDetailRequest request = GetNasTrialDetailRequest.newBuilder().setName(name).build(); + return getNasTrialDetail(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a NasTrialDetail. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * GetNasTrialDetailRequest request = + * GetNasTrialDetailRequest.newBuilder() + * .setName( + * NasTrialDetailName.of( + * "[PROJECT]", "[LOCATION]", "[NAS_JOB]", "[NAS_TRIAL_DETAIL]") + * .toString()) + * .build(); + * NasTrialDetail response = jobServiceClient.getNasTrialDetail(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final NasTrialDetail getNasTrialDetail(GetNasTrialDetailRequest request) { + return getNasTrialDetailCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a NasTrialDetail. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * GetNasTrialDetailRequest request = + * GetNasTrialDetailRequest.newBuilder() + * .setName( + * NasTrialDetailName.of( + * "[PROJECT]", "[LOCATION]", "[NAS_JOB]", "[NAS_TRIAL_DETAIL]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * jobServiceClient.getNasTrialDetailCallable().futureCall(request); + * // Do something. + * NasTrialDetail response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * NasJobName parent = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]"); + * for (NasTrialDetail element : jobServiceClient.listNasTrialDetails(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The name of the NasJob resource. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNasTrialDetailsPagedResponse listNasTrialDetails(NasJobName parent) { + ListNasTrialDetailsRequest request = + ListNasTrialDetailsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listNasTrialDetails(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List top NasTrialDetails of a NasJob. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String parent = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString(); + * for (NasTrialDetail element : jobServiceClient.listNasTrialDetails(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The name of the NasJob resource. Format: + * `projects/{project}/locations/{location}/nasJobs/{nas_job}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNasTrialDetailsPagedResponse listNasTrialDetails(String parent) { + ListNasTrialDetailsRequest request = + ListNasTrialDetailsRequest.newBuilder().setParent(parent).build(); + return listNasTrialDetails(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List top NasTrialDetails of a NasJob. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * ListNasTrialDetailsRequest request = + * ListNasTrialDetailsRequest.newBuilder() + * .setParent(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (NasTrialDetail element : jobServiceClient.listNasTrialDetails(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNasTrialDetailsPagedResponse listNasTrialDetails( + ListNasTrialDetailsRequest request) { + return listNasTrialDetailsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List top NasTrialDetails of a NasJob. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * ListNasTrialDetailsRequest request = + * ListNasTrialDetailsRequest.newBuilder() + * .setParent(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * jobServiceClient.listNasTrialDetailsPagedCallable().futureCall(request); + * // Do something. + * for (NasTrialDetail element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * ListNasTrialDetailsRequest request = + * ListNasTrialDetailsRequest.newBuilder() + * .setParent(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListNasTrialDetailsResponse response = + * jobServiceClient.listNasTrialDetailsCallable().call(request); + * for (NasTrialDetail element : response.getNasTrialDetailsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable