1 /* 2 * Copyright 2022 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.google.cloud.aiplatform.v1beta1; 18 19 import static com.google.cloud.aiplatform.v1beta1.JobServiceClient.ListBatchPredictionJobsPagedResponse; 20 import static com.google.cloud.aiplatform.v1beta1.JobServiceClient.ListCustomJobsPagedResponse; 21 import static com.google.cloud.aiplatform.v1beta1.JobServiceClient.ListDataLabelingJobsPagedResponse; 22 import static com.google.cloud.aiplatform.v1beta1.JobServiceClient.ListHyperparameterTuningJobsPagedResponse; 23 import static com.google.cloud.aiplatform.v1beta1.JobServiceClient.ListLocationsPagedResponse; 24 import static com.google.cloud.aiplatform.v1beta1.JobServiceClient.ListModelDeploymentMonitoringJobsPagedResponse; 25 import static com.google.cloud.aiplatform.v1beta1.JobServiceClient.ListNasJobsPagedResponse; 26 import static com.google.cloud.aiplatform.v1beta1.JobServiceClient.ListNasTrialDetailsPagedResponse; 27 import static com.google.cloud.aiplatform.v1beta1.JobServiceClient.SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse; 28 29 import com.google.api.core.ApiFunction; 30 import com.google.api.core.BetaApi; 31 import com.google.api.gax.core.GoogleCredentialsProvider; 32 import com.google.api.gax.core.InstantiatingExecutorProvider; 33 import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; 34 import com.google.api.gax.rpc.ApiClientHeaderProvider; 35 import com.google.api.gax.rpc.ClientContext; 36 import com.google.api.gax.rpc.ClientSettings; 37 import com.google.api.gax.rpc.OperationCallSettings; 38 import com.google.api.gax.rpc.PagedCallSettings; 39 import com.google.api.gax.rpc.TransportChannelProvider; 40 import com.google.api.gax.rpc.UnaryCallSettings; 41 import com.google.cloud.aiplatform.v1beta1.stub.JobServiceStubSettings; 42 import com.google.cloud.location.GetLocationRequest; 43 import com.google.cloud.location.ListLocationsRequest; 44 import com.google.cloud.location.ListLocationsResponse; 45 import com.google.cloud.location.Location; 46 import com.google.iam.v1.GetIamPolicyRequest; 47 import com.google.iam.v1.Policy; 48 import com.google.iam.v1.SetIamPolicyRequest; 49 import com.google.iam.v1.TestIamPermissionsRequest; 50 import com.google.iam.v1.TestIamPermissionsResponse; 51 import com.google.longrunning.Operation; 52 import com.google.protobuf.Empty; 53 import java.io.IOException; 54 import java.util.List; 55 import javax.annotation.Generated; 56 57 // AUTO-GENERATED DOCUMENTATION AND CLASS. 58 /** 59 * Settings class to configure an instance of {@link JobServiceClient}. 60 * 61 * <p>The default instance has everything set to sensible defaults: 62 * 63 * <ul> 64 * <li>The default service address (aiplatform.googleapis.com) and default port (443) are used. 65 * <li>Credentials are acquired automatically through Application Default Credentials. 66 * <li>Retries are configured for idempotent methods but not for non-idempotent methods. 67 * </ul> 68 * 69 * <p>The builder of this class is recursive, so contained classes are themselves builders. When 70 * build() is called, the tree of builders is called to create the complete settings object. 71 * 72 * <p>For example, to set the total timeout of createCustomJob to 30 seconds: 73 * 74 * <pre>{@code 75 * // This snippet has been automatically generated and should be regarded as a code template only. 76 * // It will require modifications to work: 77 * // - It may require correct/in-range values for request initialization. 78 * // - It may require specifying regional endpoints when creating the service client as shown in 79 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 80 * JobServiceSettings.Builder jobServiceSettingsBuilder = JobServiceSettings.newBuilder(); 81 * jobServiceSettingsBuilder 82 * .createCustomJobSettings() 83 * .setRetrySettings( 84 * jobServiceSettingsBuilder 85 * .createCustomJobSettings() 86 * .getRetrySettings() 87 * .toBuilder() 88 * .setTotalTimeout(Duration.ofSeconds(30)) 89 * .build()); 90 * JobServiceSettings jobServiceSettings = jobServiceSettingsBuilder.build(); 91 * }</pre> 92 */ 93 @BetaApi 94 @Generated("by gapic-generator-java") 95 public class JobServiceSettings extends ClientSettings<JobServiceSettings> { 96 97 /** Returns the object with the settings used for calls to createCustomJob. */ createCustomJobSettings()98 public UnaryCallSettings<CreateCustomJobRequest, CustomJob> createCustomJobSettings() { 99 return ((JobServiceStubSettings) getStubSettings()).createCustomJobSettings(); 100 } 101 102 /** Returns the object with the settings used for calls to getCustomJob. */ getCustomJobSettings()103 public UnaryCallSettings<GetCustomJobRequest, CustomJob> getCustomJobSettings() { 104 return ((JobServiceStubSettings) getStubSettings()).getCustomJobSettings(); 105 } 106 107 /** Returns the object with the settings used for calls to listCustomJobs. */ 108 public PagedCallSettings< 109 ListCustomJobsRequest, ListCustomJobsResponse, ListCustomJobsPagedResponse> listCustomJobsSettings()110 listCustomJobsSettings() { 111 return ((JobServiceStubSettings) getStubSettings()).listCustomJobsSettings(); 112 } 113 114 /** Returns the object with the settings used for calls to deleteCustomJob. */ deleteCustomJobSettings()115 public UnaryCallSettings<DeleteCustomJobRequest, Operation> deleteCustomJobSettings() { 116 return ((JobServiceStubSettings) getStubSettings()).deleteCustomJobSettings(); 117 } 118 119 /** Returns the object with the settings used for calls to deleteCustomJob. */ 120 public OperationCallSettings<DeleteCustomJobRequest, Empty, DeleteOperationMetadata> deleteCustomJobOperationSettings()121 deleteCustomJobOperationSettings() { 122 return ((JobServiceStubSettings) getStubSettings()).deleteCustomJobOperationSettings(); 123 } 124 125 /** Returns the object with the settings used for calls to cancelCustomJob. */ cancelCustomJobSettings()126 public UnaryCallSettings<CancelCustomJobRequest, Empty> cancelCustomJobSettings() { 127 return ((JobServiceStubSettings) getStubSettings()).cancelCustomJobSettings(); 128 } 129 130 /** Returns the object with the settings used for calls to createDataLabelingJob. */ 131 public UnaryCallSettings<CreateDataLabelingJobRequest, DataLabelingJob> createDataLabelingJobSettings()132 createDataLabelingJobSettings() { 133 return ((JobServiceStubSettings) getStubSettings()).createDataLabelingJobSettings(); 134 } 135 136 /** Returns the object with the settings used for calls to getDataLabelingJob. */ 137 public UnaryCallSettings<GetDataLabelingJobRequest, DataLabelingJob> getDataLabelingJobSettings()138 getDataLabelingJobSettings() { 139 return ((JobServiceStubSettings) getStubSettings()).getDataLabelingJobSettings(); 140 } 141 142 /** Returns the object with the settings used for calls to listDataLabelingJobs. */ 143 public PagedCallSettings< 144 ListDataLabelingJobsRequest, 145 ListDataLabelingJobsResponse, 146 ListDataLabelingJobsPagedResponse> listDataLabelingJobsSettings()147 listDataLabelingJobsSettings() { 148 return ((JobServiceStubSettings) getStubSettings()).listDataLabelingJobsSettings(); 149 } 150 151 /** Returns the object with the settings used for calls to deleteDataLabelingJob. */ 152 public UnaryCallSettings<DeleteDataLabelingJobRequest, Operation> deleteDataLabelingJobSettings()153 deleteDataLabelingJobSettings() { 154 return ((JobServiceStubSettings) getStubSettings()).deleteDataLabelingJobSettings(); 155 } 156 157 /** Returns the object with the settings used for calls to deleteDataLabelingJob. */ 158 public OperationCallSettings<DeleteDataLabelingJobRequest, Empty, DeleteOperationMetadata> deleteDataLabelingJobOperationSettings()159 deleteDataLabelingJobOperationSettings() { 160 return ((JobServiceStubSettings) getStubSettings()).deleteDataLabelingJobOperationSettings(); 161 } 162 163 /** Returns the object with the settings used for calls to cancelDataLabelingJob. */ cancelDataLabelingJobSettings()164 public UnaryCallSettings<CancelDataLabelingJobRequest, Empty> cancelDataLabelingJobSettings() { 165 return ((JobServiceStubSettings) getStubSettings()).cancelDataLabelingJobSettings(); 166 } 167 168 /** Returns the object with the settings used for calls to createHyperparameterTuningJob. */ 169 public UnaryCallSettings<CreateHyperparameterTuningJobRequest, HyperparameterTuningJob> createHyperparameterTuningJobSettings()170 createHyperparameterTuningJobSettings() { 171 return ((JobServiceStubSettings) getStubSettings()).createHyperparameterTuningJobSettings(); 172 } 173 174 /** Returns the object with the settings used for calls to getHyperparameterTuningJob. */ 175 public UnaryCallSettings<GetHyperparameterTuningJobRequest, HyperparameterTuningJob> getHyperparameterTuningJobSettings()176 getHyperparameterTuningJobSettings() { 177 return ((JobServiceStubSettings) getStubSettings()).getHyperparameterTuningJobSettings(); 178 } 179 180 /** Returns the object with the settings used for calls to listHyperparameterTuningJobs. */ 181 public PagedCallSettings< 182 ListHyperparameterTuningJobsRequest, 183 ListHyperparameterTuningJobsResponse, 184 ListHyperparameterTuningJobsPagedResponse> listHyperparameterTuningJobsSettings()185 listHyperparameterTuningJobsSettings() { 186 return ((JobServiceStubSettings) getStubSettings()).listHyperparameterTuningJobsSettings(); 187 } 188 189 /** Returns the object with the settings used for calls to deleteHyperparameterTuningJob. */ 190 public UnaryCallSettings<DeleteHyperparameterTuningJobRequest, Operation> deleteHyperparameterTuningJobSettings()191 deleteHyperparameterTuningJobSettings() { 192 return ((JobServiceStubSettings) getStubSettings()).deleteHyperparameterTuningJobSettings(); 193 } 194 195 /** Returns the object with the settings used for calls to deleteHyperparameterTuningJob. */ 196 public OperationCallSettings<DeleteHyperparameterTuningJobRequest, Empty, DeleteOperationMetadata> deleteHyperparameterTuningJobOperationSettings()197 deleteHyperparameterTuningJobOperationSettings() { 198 return ((JobServiceStubSettings) getStubSettings()) 199 .deleteHyperparameterTuningJobOperationSettings(); 200 } 201 202 /** Returns the object with the settings used for calls to cancelHyperparameterTuningJob. */ 203 public UnaryCallSettings<CancelHyperparameterTuningJobRequest, Empty> cancelHyperparameterTuningJobSettings()204 cancelHyperparameterTuningJobSettings() { 205 return ((JobServiceStubSettings) getStubSettings()).cancelHyperparameterTuningJobSettings(); 206 } 207 208 /** Returns the object with the settings used for calls to createNasJob. */ createNasJobSettings()209 public UnaryCallSettings<CreateNasJobRequest, NasJob> createNasJobSettings() { 210 return ((JobServiceStubSettings) getStubSettings()).createNasJobSettings(); 211 } 212 213 /** Returns the object with the settings used for calls to getNasJob. */ getNasJobSettings()214 public UnaryCallSettings<GetNasJobRequest, NasJob> getNasJobSettings() { 215 return ((JobServiceStubSettings) getStubSettings()).getNasJobSettings(); 216 } 217 218 /** Returns the object with the settings used for calls to listNasJobs. */ 219 public PagedCallSettings<ListNasJobsRequest, ListNasJobsResponse, ListNasJobsPagedResponse> listNasJobsSettings()220 listNasJobsSettings() { 221 return ((JobServiceStubSettings) getStubSettings()).listNasJobsSettings(); 222 } 223 224 /** Returns the object with the settings used for calls to deleteNasJob. */ deleteNasJobSettings()225 public UnaryCallSettings<DeleteNasJobRequest, Operation> deleteNasJobSettings() { 226 return ((JobServiceStubSettings) getStubSettings()).deleteNasJobSettings(); 227 } 228 229 /** Returns the object with the settings used for calls to deleteNasJob. */ 230 public OperationCallSettings<DeleteNasJobRequest, Empty, DeleteOperationMetadata> deleteNasJobOperationSettings()231 deleteNasJobOperationSettings() { 232 return ((JobServiceStubSettings) getStubSettings()).deleteNasJobOperationSettings(); 233 } 234 235 /** Returns the object with the settings used for calls to cancelNasJob. */ cancelNasJobSettings()236 public UnaryCallSettings<CancelNasJobRequest, Empty> cancelNasJobSettings() { 237 return ((JobServiceStubSettings) getStubSettings()).cancelNasJobSettings(); 238 } 239 240 /** Returns the object with the settings used for calls to getNasTrialDetail. */ getNasTrialDetailSettings()241 public UnaryCallSettings<GetNasTrialDetailRequest, NasTrialDetail> getNasTrialDetailSettings() { 242 return ((JobServiceStubSettings) getStubSettings()).getNasTrialDetailSettings(); 243 } 244 245 /** Returns the object with the settings used for calls to listNasTrialDetails. */ 246 public PagedCallSettings< 247 ListNasTrialDetailsRequest, ListNasTrialDetailsResponse, ListNasTrialDetailsPagedResponse> listNasTrialDetailsSettings()248 listNasTrialDetailsSettings() { 249 return ((JobServiceStubSettings) getStubSettings()).listNasTrialDetailsSettings(); 250 } 251 252 /** Returns the object with the settings used for calls to createBatchPredictionJob. */ 253 public UnaryCallSettings<CreateBatchPredictionJobRequest, BatchPredictionJob> createBatchPredictionJobSettings()254 createBatchPredictionJobSettings() { 255 return ((JobServiceStubSettings) getStubSettings()).createBatchPredictionJobSettings(); 256 } 257 258 /** Returns the object with the settings used for calls to getBatchPredictionJob. */ 259 public UnaryCallSettings<GetBatchPredictionJobRequest, BatchPredictionJob> getBatchPredictionJobSettings()260 getBatchPredictionJobSettings() { 261 return ((JobServiceStubSettings) getStubSettings()).getBatchPredictionJobSettings(); 262 } 263 264 /** Returns the object with the settings used for calls to listBatchPredictionJobs. */ 265 public PagedCallSettings< 266 ListBatchPredictionJobsRequest, 267 ListBatchPredictionJobsResponse, 268 ListBatchPredictionJobsPagedResponse> listBatchPredictionJobsSettings()269 listBatchPredictionJobsSettings() { 270 return ((JobServiceStubSettings) getStubSettings()).listBatchPredictionJobsSettings(); 271 } 272 273 /** Returns the object with the settings used for calls to deleteBatchPredictionJob. */ 274 public UnaryCallSettings<DeleteBatchPredictionJobRequest, Operation> deleteBatchPredictionJobSettings()275 deleteBatchPredictionJobSettings() { 276 return ((JobServiceStubSettings) getStubSettings()).deleteBatchPredictionJobSettings(); 277 } 278 279 /** Returns the object with the settings used for calls to deleteBatchPredictionJob. */ 280 public OperationCallSettings<DeleteBatchPredictionJobRequest, Empty, DeleteOperationMetadata> deleteBatchPredictionJobOperationSettings()281 deleteBatchPredictionJobOperationSettings() { 282 return ((JobServiceStubSettings) getStubSettings()).deleteBatchPredictionJobOperationSettings(); 283 } 284 285 /** Returns the object with the settings used for calls to cancelBatchPredictionJob. */ 286 public UnaryCallSettings<CancelBatchPredictionJobRequest, Empty> cancelBatchPredictionJobSettings()287 cancelBatchPredictionJobSettings() { 288 return ((JobServiceStubSettings) getStubSettings()).cancelBatchPredictionJobSettings(); 289 } 290 291 /** Returns the object with the settings used for calls to createModelDeploymentMonitoringJob. */ 292 public UnaryCallSettings<CreateModelDeploymentMonitoringJobRequest, ModelDeploymentMonitoringJob> createModelDeploymentMonitoringJobSettings()293 createModelDeploymentMonitoringJobSettings() { 294 return ((JobServiceStubSettings) getStubSettings()) 295 .createModelDeploymentMonitoringJobSettings(); 296 } 297 298 /** 299 * Returns the object with the settings used for calls to 300 * searchModelDeploymentMonitoringStatsAnomalies. 301 */ 302 public PagedCallSettings< 303 SearchModelDeploymentMonitoringStatsAnomaliesRequest, 304 SearchModelDeploymentMonitoringStatsAnomaliesResponse, 305 SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse> searchModelDeploymentMonitoringStatsAnomaliesSettings()306 searchModelDeploymentMonitoringStatsAnomaliesSettings() { 307 return ((JobServiceStubSettings) getStubSettings()) 308 .searchModelDeploymentMonitoringStatsAnomaliesSettings(); 309 } 310 311 /** Returns the object with the settings used for calls to getModelDeploymentMonitoringJob. */ 312 public UnaryCallSettings<GetModelDeploymentMonitoringJobRequest, ModelDeploymentMonitoringJob> getModelDeploymentMonitoringJobSettings()313 getModelDeploymentMonitoringJobSettings() { 314 return ((JobServiceStubSettings) getStubSettings()).getModelDeploymentMonitoringJobSettings(); 315 } 316 317 /** Returns the object with the settings used for calls to listModelDeploymentMonitoringJobs. */ 318 public PagedCallSettings< 319 ListModelDeploymentMonitoringJobsRequest, 320 ListModelDeploymentMonitoringJobsResponse, 321 ListModelDeploymentMonitoringJobsPagedResponse> listModelDeploymentMonitoringJobsSettings()322 listModelDeploymentMonitoringJobsSettings() { 323 return ((JobServiceStubSettings) getStubSettings()).listModelDeploymentMonitoringJobsSettings(); 324 } 325 326 /** Returns the object with the settings used for calls to updateModelDeploymentMonitoringJob. */ 327 public UnaryCallSettings<UpdateModelDeploymentMonitoringJobRequest, Operation> updateModelDeploymentMonitoringJobSettings()328 updateModelDeploymentMonitoringJobSettings() { 329 return ((JobServiceStubSettings) getStubSettings()) 330 .updateModelDeploymentMonitoringJobSettings(); 331 } 332 333 /** Returns the object with the settings used for calls to updateModelDeploymentMonitoringJob. */ 334 public OperationCallSettings< 335 UpdateModelDeploymentMonitoringJobRequest, 336 ModelDeploymentMonitoringJob, 337 UpdateModelDeploymentMonitoringJobOperationMetadata> updateModelDeploymentMonitoringJobOperationSettings()338 updateModelDeploymentMonitoringJobOperationSettings() { 339 return ((JobServiceStubSettings) getStubSettings()) 340 .updateModelDeploymentMonitoringJobOperationSettings(); 341 } 342 343 /** Returns the object with the settings used for calls to deleteModelDeploymentMonitoringJob. */ 344 public UnaryCallSettings<DeleteModelDeploymentMonitoringJobRequest, Operation> deleteModelDeploymentMonitoringJobSettings()345 deleteModelDeploymentMonitoringJobSettings() { 346 return ((JobServiceStubSettings) getStubSettings()) 347 .deleteModelDeploymentMonitoringJobSettings(); 348 } 349 350 /** Returns the object with the settings used for calls to deleteModelDeploymentMonitoringJob. */ 351 public OperationCallSettings< 352 DeleteModelDeploymentMonitoringJobRequest, Empty, DeleteOperationMetadata> deleteModelDeploymentMonitoringJobOperationSettings()353 deleteModelDeploymentMonitoringJobOperationSettings() { 354 return ((JobServiceStubSettings) getStubSettings()) 355 .deleteModelDeploymentMonitoringJobOperationSettings(); 356 } 357 358 /** Returns the object with the settings used for calls to pauseModelDeploymentMonitoringJob. */ 359 public UnaryCallSettings<PauseModelDeploymentMonitoringJobRequest, Empty> pauseModelDeploymentMonitoringJobSettings()360 pauseModelDeploymentMonitoringJobSettings() { 361 return ((JobServiceStubSettings) getStubSettings()).pauseModelDeploymentMonitoringJobSettings(); 362 } 363 364 /** Returns the object with the settings used for calls to resumeModelDeploymentMonitoringJob. */ 365 public UnaryCallSettings<ResumeModelDeploymentMonitoringJobRequest, Empty> resumeModelDeploymentMonitoringJobSettings()366 resumeModelDeploymentMonitoringJobSettings() { 367 return ((JobServiceStubSettings) getStubSettings()) 368 .resumeModelDeploymentMonitoringJobSettings(); 369 } 370 371 /** Returns the object with the settings used for calls to listLocations. */ 372 public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings()373 listLocationsSettings() { 374 return ((JobServiceStubSettings) getStubSettings()).listLocationsSettings(); 375 } 376 377 /** Returns the object with the settings used for calls to getLocation. */ getLocationSettings()378 public UnaryCallSettings<GetLocationRequest, Location> getLocationSettings() { 379 return ((JobServiceStubSettings) getStubSettings()).getLocationSettings(); 380 } 381 382 /** Returns the object with the settings used for calls to setIamPolicy. */ setIamPolicySettings()383 public UnaryCallSettings<SetIamPolicyRequest, Policy> setIamPolicySettings() { 384 return ((JobServiceStubSettings) getStubSettings()).setIamPolicySettings(); 385 } 386 387 /** Returns the object with the settings used for calls to getIamPolicy. */ getIamPolicySettings()388 public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() { 389 return ((JobServiceStubSettings) getStubSettings()).getIamPolicySettings(); 390 } 391 392 /** Returns the object with the settings used for calls to testIamPermissions. */ 393 public UnaryCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse> testIamPermissionsSettings()394 testIamPermissionsSettings() { 395 return ((JobServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); 396 } 397 create(JobServiceStubSettings stub)398 public static final JobServiceSettings create(JobServiceStubSettings stub) throws IOException { 399 return new JobServiceSettings.Builder(stub.toBuilder()).build(); 400 } 401 402 /** Returns a builder for the default ExecutorProvider for this service. */ defaultExecutorProviderBuilder()403 public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { 404 return JobServiceStubSettings.defaultExecutorProviderBuilder(); 405 } 406 407 /** Returns the default service endpoint. */ getDefaultEndpoint()408 public static String getDefaultEndpoint() { 409 return JobServiceStubSettings.getDefaultEndpoint(); 410 } 411 412 /** Returns the default service scopes. */ getDefaultServiceScopes()413 public static List<String> getDefaultServiceScopes() { 414 return JobServiceStubSettings.getDefaultServiceScopes(); 415 } 416 417 /** Returns a builder for the default credentials for this service. */ defaultCredentialsProviderBuilder()418 public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { 419 return JobServiceStubSettings.defaultCredentialsProviderBuilder(); 420 } 421 422 /** Returns a builder for the default ChannelProvider for this service. */ defaultGrpcTransportProviderBuilder()423 public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { 424 return JobServiceStubSettings.defaultGrpcTransportProviderBuilder(); 425 } 426 defaultTransportChannelProvider()427 public static TransportChannelProvider defaultTransportChannelProvider() { 428 return JobServiceStubSettings.defaultTransportChannelProvider(); 429 } 430 431 @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") defaultApiClientHeaderProviderBuilder()432 public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { 433 return JobServiceStubSettings.defaultApiClientHeaderProviderBuilder(); 434 } 435 436 /** Returns a new builder for this class. */ newBuilder()437 public static Builder newBuilder() { 438 return Builder.createDefault(); 439 } 440 441 /** Returns a new builder for this class. */ newBuilder(ClientContext clientContext)442 public static Builder newBuilder(ClientContext clientContext) { 443 return new Builder(clientContext); 444 } 445 446 /** Returns a builder containing all the values of this settings class. */ toBuilder()447 public Builder toBuilder() { 448 return new Builder(this); 449 } 450 JobServiceSettings(Builder settingsBuilder)451 protected JobServiceSettings(Builder settingsBuilder) throws IOException { 452 super(settingsBuilder); 453 } 454 455 /** Builder for JobServiceSettings. */ 456 public static class Builder extends ClientSettings.Builder<JobServiceSettings, Builder> { 457 Builder()458 protected Builder() throws IOException { 459 this(((ClientContext) null)); 460 } 461 Builder(ClientContext clientContext)462 protected Builder(ClientContext clientContext) { 463 super(JobServiceStubSettings.newBuilder(clientContext)); 464 } 465 Builder(JobServiceSettings settings)466 protected Builder(JobServiceSettings settings) { 467 super(settings.getStubSettings().toBuilder()); 468 } 469 Builder(JobServiceStubSettings.Builder stubSettings)470 protected Builder(JobServiceStubSettings.Builder stubSettings) { 471 super(stubSettings); 472 } 473 createDefault()474 private static Builder createDefault() { 475 return new Builder(JobServiceStubSettings.newBuilder()); 476 } 477 getStubSettingsBuilder()478 public JobServiceStubSettings.Builder getStubSettingsBuilder() { 479 return ((JobServiceStubSettings.Builder) getStubSettings()); 480 } 481 482 /** 483 * Applies the given settings updater function to all of the unary API methods in this service. 484 * 485 * <p>Note: This method does not support applying settings to streaming methods. 486 */ applyToAllUnaryMethods( ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater)487 public Builder applyToAllUnaryMethods( 488 ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) { 489 super.applyToAllUnaryMethods( 490 getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); 491 return this; 492 } 493 494 /** Returns the builder for the settings used for calls to createCustomJob. */ createCustomJobSettings()495 public UnaryCallSettings.Builder<CreateCustomJobRequest, CustomJob> createCustomJobSettings() { 496 return getStubSettingsBuilder().createCustomJobSettings(); 497 } 498 499 /** Returns the builder for the settings used for calls to getCustomJob. */ getCustomJobSettings()500 public UnaryCallSettings.Builder<GetCustomJobRequest, CustomJob> getCustomJobSettings() { 501 return getStubSettingsBuilder().getCustomJobSettings(); 502 } 503 504 /** Returns the builder for the settings used for calls to listCustomJobs. */ 505 public PagedCallSettings.Builder< 506 ListCustomJobsRequest, ListCustomJobsResponse, ListCustomJobsPagedResponse> listCustomJobsSettings()507 listCustomJobsSettings() { 508 return getStubSettingsBuilder().listCustomJobsSettings(); 509 } 510 511 /** Returns the builder for the settings used for calls to deleteCustomJob. */ deleteCustomJobSettings()512 public UnaryCallSettings.Builder<DeleteCustomJobRequest, Operation> deleteCustomJobSettings() { 513 return getStubSettingsBuilder().deleteCustomJobSettings(); 514 } 515 516 /** Returns the builder for the settings used for calls to deleteCustomJob. */ 517 public OperationCallSettings.Builder<DeleteCustomJobRequest, Empty, DeleteOperationMetadata> deleteCustomJobOperationSettings()518 deleteCustomJobOperationSettings() { 519 return getStubSettingsBuilder().deleteCustomJobOperationSettings(); 520 } 521 522 /** Returns the builder for the settings used for calls to cancelCustomJob. */ cancelCustomJobSettings()523 public UnaryCallSettings.Builder<CancelCustomJobRequest, Empty> cancelCustomJobSettings() { 524 return getStubSettingsBuilder().cancelCustomJobSettings(); 525 } 526 527 /** Returns the builder for the settings used for calls to createDataLabelingJob. */ 528 public UnaryCallSettings.Builder<CreateDataLabelingJobRequest, DataLabelingJob> createDataLabelingJobSettings()529 createDataLabelingJobSettings() { 530 return getStubSettingsBuilder().createDataLabelingJobSettings(); 531 } 532 533 /** Returns the builder for the settings used for calls to getDataLabelingJob. */ 534 public UnaryCallSettings.Builder<GetDataLabelingJobRequest, DataLabelingJob> getDataLabelingJobSettings()535 getDataLabelingJobSettings() { 536 return getStubSettingsBuilder().getDataLabelingJobSettings(); 537 } 538 539 /** Returns the builder for the settings used for calls to listDataLabelingJobs. */ 540 public PagedCallSettings.Builder< 541 ListDataLabelingJobsRequest, 542 ListDataLabelingJobsResponse, 543 ListDataLabelingJobsPagedResponse> listDataLabelingJobsSettings()544 listDataLabelingJobsSettings() { 545 return getStubSettingsBuilder().listDataLabelingJobsSettings(); 546 } 547 548 /** Returns the builder for the settings used for calls to deleteDataLabelingJob. */ 549 public UnaryCallSettings.Builder<DeleteDataLabelingJobRequest, Operation> deleteDataLabelingJobSettings()550 deleteDataLabelingJobSettings() { 551 return getStubSettingsBuilder().deleteDataLabelingJobSettings(); 552 } 553 554 /** Returns the builder for the settings used for calls to deleteDataLabelingJob. */ 555 public OperationCallSettings.Builder< 556 DeleteDataLabelingJobRequest, Empty, DeleteOperationMetadata> deleteDataLabelingJobOperationSettings()557 deleteDataLabelingJobOperationSettings() { 558 return getStubSettingsBuilder().deleteDataLabelingJobOperationSettings(); 559 } 560 561 /** Returns the builder for the settings used for calls to cancelDataLabelingJob. */ 562 public UnaryCallSettings.Builder<CancelDataLabelingJobRequest, Empty> cancelDataLabelingJobSettings()563 cancelDataLabelingJobSettings() { 564 return getStubSettingsBuilder().cancelDataLabelingJobSettings(); 565 } 566 567 /** Returns the builder for the settings used for calls to createHyperparameterTuningJob. */ 568 public UnaryCallSettings.Builder<CreateHyperparameterTuningJobRequest, HyperparameterTuningJob> createHyperparameterTuningJobSettings()569 createHyperparameterTuningJobSettings() { 570 return getStubSettingsBuilder().createHyperparameterTuningJobSettings(); 571 } 572 573 /** Returns the builder for the settings used for calls to getHyperparameterTuningJob. */ 574 public UnaryCallSettings.Builder<GetHyperparameterTuningJobRequest, HyperparameterTuningJob> getHyperparameterTuningJobSettings()575 getHyperparameterTuningJobSettings() { 576 return getStubSettingsBuilder().getHyperparameterTuningJobSettings(); 577 } 578 579 /** Returns the builder for the settings used for calls to listHyperparameterTuningJobs. */ 580 public PagedCallSettings.Builder< 581 ListHyperparameterTuningJobsRequest, 582 ListHyperparameterTuningJobsResponse, 583 ListHyperparameterTuningJobsPagedResponse> listHyperparameterTuningJobsSettings()584 listHyperparameterTuningJobsSettings() { 585 return getStubSettingsBuilder().listHyperparameterTuningJobsSettings(); 586 } 587 588 /** Returns the builder for the settings used for calls to deleteHyperparameterTuningJob. */ 589 public UnaryCallSettings.Builder<DeleteHyperparameterTuningJobRequest, Operation> deleteHyperparameterTuningJobSettings()590 deleteHyperparameterTuningJobSettings() { 591 return getStubSettingsBuilder().deleteHyperparameterTuningJobSettings(); 592 } 593 594 /** Returns the builder for the settings used for calls to deleteHyperparameterTuningJob. */ 595 public OperationCallSettings.Builder< 596 DeleteHyperparameterTuningJobRequest, Empty, DeleteOperationMetadata> deleteHyperparameterTuningJobOperationSettings()597 deleteHyperparameterTuningJobOperationSettings() { 598 return getStubSettingsBuilder().deleteHyperparameterTuningJobOperationSettings(); 599 } 600 601 /** Returns the builder for the settings used for calls to cancelHyperparameterTuningJob. */ 602 public UnaryCallSettings.Builder<CancelHyperparameterTuningJobRequest, Empty> cancelHyperparameterTuningJobSettings()603 cancelHyperparameterTuningJobSettings() { 604 return getStubSettingsBuilder().cancelHyperparameterTuningJobSettings(); 605 } 606 607 /** Returns the builder for the settings used for calls to createNasJob. */ createNasJobSettings()608 public UnaryCallSettings.Builder<CreateNasJobRequest, NasJob> createNasJobSettings() { 609 return getStubSettingsBuilder().createNasJobSettings(); 610 } 611 612 /** Returns the builder for the settings used for calls to getNasJob. */ getNasJobSettings()613 public UnaryCallSettings.Builder<GetNasJobRequest, NasJob> getNasJobSettings() { 614 return getStubSettingsBuilder().getNasJobSettings(); 615 } 616 617 /** Returns the builder for the settings used for calls to listNasJobs. */ 618 public PagedCallSettings.Builder< 619 ListNasJobsRequest, ListNasJobsResponse, ListNasJobsPagedResponse> listNasJobsSettings()620 listNasJobsSettings() { 621 return getStubSettingsBuilder().listNasJobsSettings(); 622 } 623 624 /** Returns the builder for the settings used for calls to deleteNasJob. */ deleteNasJobSettings()625 public UnaryCallSettings.Builder<DeleteNasJobRequest, Operation> deleteNasJobSettings() { 626 return getStubSettingsBuilder().deleteNasJobSettings(); 627 } 628 629 /** Returns the builder for the settings used for calls to deleteNasJob. */ 630 public OperationCallSettings.Builder<DeleteNasJobRequest, Empty, DeleteOperationMetadata> deleteNasJobOperationSettings()631 deleteNasJobOperationSettings() { 632 return getStubSettingsBuilder().deleteNasJobOperationSettings(); 633 } 634 635 /** Returns the builder for the settings used for calls to cancelNasJob. */ cancelNasJobSettings()636 public UnaryCallSettings.Builder<CancelNasJobRequest, Empty> cancelNasJobSettings() { 637 return getStubSettingsBuilder().cancelNasJobSettings(); 638 } 639 640 /** Returns the builder for the settings used for calls to getNasTrialDetail. */ 641 public UnaryCallSettings.Builder<GetNasTrialDetailRequest, NasTrialDetail> getNasTrialDetailSettings()642 getNasTrialDetailSettings() { 643 return getStubSettingsBuilder().getNasTrialDetailSettings(); 644 } 645 646 /** Returns the builder for the settings used for calls to listNasTrialDetails. */ 647 public PagedCallSettings.Builder< 648 ListNasTrialDetailsRequest, 649 ListNasTrialDetailsResponse, 650 ListNasTrialDetailsPagedResponse> listNasTrialDetailsSettings()651 listNasTrialDetailsSettings() { 652 return getStubSettingsBuilder().listNasTrialDetailsSettings(); 653 } 654 655 /** Returns the builder for the settings used for calls to createBatchPredictionJob. */ 656 public UnaryCallSettings.Builder<CreateBatchPredictionJobRequest, BatchPredictionJob> createBatchPredictionJobSettings()657 createBatchPredictionJobSettings() { 658 return getStubSettingsBuilder().createBatchPredictionJobSettings(); 659 } 660 661 /** Returns the builder for the settings used for calls to getBatchPredictionJob. */ 662 public UnaryCallSettings.Builder<GetBatchPredictionJobRequest, BatchPredictionJob> getBatchPredictionJobSettings()663 getBatchPredictionJobSettings() { 664 return getStubSettingsBuilder().getBatchPredictionJobSettings(); 665 } 666 667 /** Returns the builder for the settings used for calls to listBatchPredictionJobs. */ 668 public PagedCallSettings.Builder< 669 ListBatchPredictionJobsRequest, 670 ListBatchPredictionJobsResponse, 671 ListBatchPredictionJobsPagedResponse> listBatchPredictionJobsSettings()672 listBatchPredictionJobsSettings() { 673 return getStubSettingsBuilder().listBatchPredictionJobsSettings(); 674 } 675 676 /** Returns the builder for the settings used for calls to deleteBatchPredictionJob. */ 677 public UnaryCallSettings.Builder<DeleteBatchPredictionJobRequest, Operation> deleteBatchPredictionJobSettings()678 deleteBatchPredictionJobSettings() { 679 return getStubSettingsBuilder().deleteBatchPredictionJobSettings(); 680 } 681 682 /** Returns the builder for the settings used for calls to deleteBatchPredictionJob. */ 683 public OperationCallSettings.Builder< 684 DeleteBatchPredictionJobRequest, Empty, DeleteOperationMetadata> deleteBatchPredictionJobOperationSettings()685 deleteBatchPredictionJobOperationSettings() { 686 return getStubSettingsBuilder().deleteBatchPredictionJobOperationSettings(); 687 } 688 689 /** Returns the builder for the settings used for calls to cancelBatchPredictionJob. */ 690 public UnaryCallSettings.Builder<CancelBatchPredictionJobRequest, Empty> cancelBatchPredictionJobSettings()691 cancelBatchPredictionJobSettings() { 692 return getStubSettingsBuilder().cancelBatchPredictionJobSettings(); 693 } 694 695 /** 696 * Returns the builder for the settings used for calls to createModelDeploymentMonitoringJob. 697 */ 698 public UnaryCallSettings.Builder< 699 CreateModelDeploymentMonitoringJobRequest, ModelDeploymentMonitoringJob> createModelDeploymentMonitoringJobSettings()700 createModelDeploymentMonitoringJobSettings() { 701 return getStubSettingsBuilder().createModelDeploymentMonitoringJobSettings(); 702 } 703 704 /** 705 * Returns the builder for the settings used for calls to 706 * searchModelDeploymentMonitoringStatsAnomalies. 707 */ 708 public PagedCallSettings.Builder< 709 SearchModelDeploymentMonitoringStatsAnomaliesRequest, 710 SearchModelDeploymentMonitoringStatsAnomaliesResponse, 711 SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse> searchModelDeploymentMonitoringStatsAnomaliesSettings()712 searchModelDeploymentMonitoringStatsAnomaliesSettings() { 713 return getStubSettingsBuilder().searchModelDeploymentMonitoringStatsAnomaliesSettings(); 714 } 715 716 /** Returns the builder for the settings used for calls to getModelDeploymentMonitoringJob. */ 717 public UnaryCallSettings.Builder< 718 GetModelDeploymentMonitoringJobRequest, ModelDeploymentMonitoringJob> getModelDeploymentMonitoringJobSettings()719 getModelDeploymentMonitoringJobSettings() { 720 return getStubSettingsBuilder().getModelDeploymentMonitoringJobSettings(); 721 } 722 723 /** Returns the builder for the settings used for calls to listModelDeploymentMonitoringJobs. */ 724 public PagedCallSettings.Builder< 725 ListModelDeploymentMonitoringJobsRequest, 726 ListModelDeploymentMonitoringJobsResponse, 727 ListModelDeploymentMonitoringJobsPagedResponse> listModelDeploymentMonitoringJobsSettings()728 listModelDeploymentMonitoringJobsSettings() { 729 return getStubSettingsBuilder().listModelDeploymentMonitoringJobsSettings(); 730 } 731 732 /** 733 * Returns the builder for the settings used for calls to updateModelDeploymentMonitoringJob. 734 */ 735 public UnaryCallSettings.Builder<UpdateModelDeploymentMonitoringJobRequest, Operation> updateModelDeploymentMonitoringJobSettings()736 updateModelDeploymentMonitoringJobSettings() { 737 return getStubSettingsBuilder().updateModelDeploymentMonitoringJobSettings(); 738 } 739 740 /** 741 * Returns the builder for the settings used for calls to updateModelDeploymentMonitoringJob. 742 */ 743 public OperationCallSettings.Builder< 744 UpdateModelDeploymentMonitoringJobRequest, 745 ModelDeploymentMonitoringJob, 746 UpdateModelDeploymentMonitoringJobOperationMetadata> updateModelDeploymentMonitoringJobOperationSettings()747 updateModelDeploymentMonitoringJobOperationSettings() { 748 return getStubSettingsBuilder().updateModelDeploymentMonitoringJobOperationSettings(); 749 } 750 751 /** 752 * Returns the builder for the settings used for calls to deleteModelDeploymentMonitoringJob. 753 */ 754 public UnaryCallSettings.Builder<DeleteModelDeploymentMonitoringJobRequest, Operation> deleteModelDeploymentMonitoringJobSettings()755 deleteModelDeploymentMonitoringJobSettings() { 756 return getStubSettingsBuilder().deleteModelDeploymentMonitoringJobSettings(); 757 } 758 759 /** 760 * Returns the builder for the settings used for calls to deleteModelDeploymentMonitoringJob. 761 */ 762 public OperationCallSettings.Builder< 763 DeleteModelDeploymentMonitoringJobRequest, Empty, DeleteOperationMetadata> deleteModelDeploymentMonitoringJobOperationSettings()764 deleteModelDeploymentMonitoringJobOperationSettings() { 765 return getStubSettingsBuilder().deleteModelDeploymentMonitoringJobOperationSettings(); 766 } 767 768 /** Returns the builder for the settings used for calls to pauseModelDeploymentMonitoringJob. */ 769 public UnaryCallSettings.Builder<PauseModelDeploymentMonitoringJobRequest, Empty> pauseModelDeploymentMonitoringJobSettings()770 pauseModelDeploymentMonitoringJobSettings() { 771 return getStubSettingsBuilder().pauseModelDeploymentMonitoringJobSettings(); 772 } 773 774 /** 775 * Returns the builder for the settings used for calls to resumeModelDeploymentMonitoringJob. 776 */ 777 public UnaryCallSettings.Builder<ResumeModelDeploymentMonitoringJobRequest, Empty> resumeModelDeploymentMonitoringJobSettings()778 resumeModelDeploymentMonitoringJobSettings() { 779 return getStubSettingsBuilder().resumeModelDeploymentMonitoringJobSettings(); 780 } 781 782 /** Returns the builder for the settings used for calls to listLocations. */ 783 public PagedCallSettings.Builder< 784 ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings()785 listLocationsSettings() { 786 return getStubSettingsBuilder().listLocationsSettings(); 787 } 788 789 /** Returns the builder for the settings used for calls to getLocation. */ getLocationSettings()790 public UnaryCallSettings.Builder<GetLocationRequest, Location> getLocationSettings() { 791 return getStubSettingsBuilder().getLocationSettings(); 792 } 793 794 /** Returns the builder for the settings used for calls to setIamPolicy. */ setIamPolicySettings()795 public UnaryCallSettings.Builder<SetIamPolicyRequest, Policy> setIamPolicySettings() { 796 return getStubSettingsBuilder().setIamPolicySettings(); 797 } 798 799 /** Returns the builder for the settings used for calls to getIamPolicy. */ getIamPolicySettings()800 public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettings() { 801 return getStubSettingsBuilder().getIamPolicySettings(); 802 } 803 804 /** Returns the builder for the settings used for calls to testIamPermissions. */ 805 public UnaryCallSettings.Builder<TestIamPermissionsRequest, TestIamPermissionsResponse> testIamPermissionsSettings()806 testIamPermissionsSettings() { 807 return getStubSettingsBuilder().testIamPermissionsSettings(); 808 } 809 810 @Override build()811 public JobServiceSettings build() throws IOException { 812 return new JobServiceSettings(this); 813 } 814 } 815 } 816